schematex 0.9.0 → 0.9.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 (151) hide show
  1. package/dist/ai/ai-sdk.cjs +24 -24
  2. package/dist/ai/ai-sdk.d.cts +2 -2
  3. package/dist/ai/ai-sdk.d.ts +2 -2
  4. package/dist/ai/ai-sdk.js +19 -19
  5. package/dist/ai/index.cjs +33 -33
  6. package/dist/ai/index.js +20 -20
  7. package/dist/browser.cjs +25 -25
  8. package/dist/browser.js +19 -19
  9. package/dist/{chunk-YMFYPB5Y.cjs → chunk-2A5HJFOX.cjs} +4 -4
  10. package/dist/{chunk-YMFYPB5Y.cjs.map → chunk-2A5HJFOX.cjs.map} +1 -1
  11. package/dist/{chunk-6L46VIXI.cjs → chunk-2ASZMLC3.cjs} +20 -28
  12. package/dist/chunk-2ASZMLC3.cjs.map +1 -0
  13. package/dist/{chunk-6NUAGU6O.js → chunk-2RFFCZ3I.js} +3 -3
  14. package/dist/{chunk-6NUAGU6O.js.map → chunk-2RFFCZ3I.js.map} +1 -1
  15. package/dist/{chunk-HKOPXQYU.cjs → chunk-3DSNGR26.cjs} +5 -5
  16. package/dist/{chunk-HKOPXQYU.cjs.map → chunk-3DSNGR26.cjs.map} +1 -1
  17. package/dist/{chunk-D34VGLSE.cjs → chunk-4MGALM2C.cjs} +5 -5
  18. package/dist/{chunk-D34VGLSE.cjs.map → chunk-4MGALM2C.cjs.map} +1 -1
  19. package/dist/{chunk-ABCMTAOZ.js → chunk-56DSMSXK.js} +7 -4
  20. package/dist/chunk-56DSMSXK.js.map +1 -0
  21. package/dist/{chunk-Q2YRJHFB.cjs → chunk-6BJKQULN.cjs} +7 -7
  22. package/dist/chunk-6BJKQULN.cjs.map +1 -0
  23. package/dist/{chunk-NFZMNKOR.cjs → chunk-7JJQEECD.cjs} +15 -15
  24. package/dist/{chunk-NFZMNKOR.cjs.map → chunk-7JJQEECD.cjs.map} +1 -1
  25. package/dist/{chunk-JN6FHUC6.js → chunk-7SVB3XA7.js} +3 -3
  26. package/dist/{chunk-JN6FHUC6.js.map → chunk-7SVB3XA7.js.map} +1 -1
  27. package/dist/{chunk-HPEAE3JM.js → chunk-7Z2GDS4G.js} +58 -8
  28. package/dist/chunk-7Z2GDS4G.js.map +1 -0
  29. package/dist/{chunk-PR6IAGVP.js → chunk-CURAZVOH.js} +3 -3
  30. package/dist/{chunk-PR6IAGVP.js.map → chunk-CURAZVOH.js.map} +1 -1
  31. package/dist/{chunk-KGOZBABH.cjs → chunk-GYTU7L4L.cjs} +12 -12
  32. package/dist/{chunk-KGOZBABH.cjs.map → chunk-GYTU7L4L.cjs.map} +1 -1
  33. package/dist/{chunk-B5AQ3CG3.cjs → chunk-HILYXWGJ.cjs} +16 -13
  34. package/dist/chunk-HILYXWGJ.cjs.map +1 -0
  35. package/dist/{chunk-E3CAJGJM.js → chunk-HJA7MIMV.js} +6 -6
  36. package/dist/chunk-HJA7MIMV.js.map +1 -0
  37. package/dist/{chunk-DX44TBFZ.js → chunk-IQLZUCWI.js} +20 -28
  38. package/dist/chunk-IQLZUCWI.js.map +1 -0
  39. package/dist/{chunk-NXU4XKLY.cjs → chunk-JHJJT5H5.cjs} +9 -7
  40. package/dist/chunk-JHJJT5H5.cjs.map +1 -0
  41. package/dist/{chunk-CDK7KDIW.js → chunk-JR6JNQEZ.js} +4 -4
  42. package/dist/{chunk-CDK7KDIW.js.map → chunk-JR6JNQEZ.js.map} +1 -1
  43. package/dist/{chunk-YTGOLTLJ.js → chunk-KR7PPCC4.js} +4 -4
  44. package/dist/{chunk-YTGOLTLJ.js.map → chunk-KR7PPCC4.js.map} +1 -1
  45. package/dist/{chunk-AJJYWXZB.cjs → chunk-L2NY4XEY.cjs} +4 -4
  46. package/dist/{chunk-AJJYWXZB.cjs.map → chunk-L2NY4XEY.cjs.map} +1 -1
  47. package/dist/{chunk-T3GV7OVF.js → chunk-MERU76LW.js} +21 -4
  48. package/dist/chunk-MERU76LW.js.map +1 -0
  49. package/dist/{chunk-IXRPRMHI.js → chunk-MTIZIHWE.js} +9 -7
  50. package/dist/chunk-MTIZIHWE.js.map +1 -0
  51. package/dist/{chunk-DR3DDDQY.cjs → chunk-MUE45N2A.cjs} +59 -9
  52. package/dist/chunk-MUE45N2A.cjs.map +1 -0
  53. package/dist/{chunk-DHI7YAQJ.cjs → chunk-MYVY55DO.cjs} +15 -15
  54. package/dist/{chunk-DHI7YAQJ.cjs.map → chunk-MYVY55DO.cjs.map} +1 -1
  55. package/dist/{chunk-NZT5P2XZ.cjs → chunk-NT6VVMLW.cjs} +291 -2
  56. package/dist/chunk-NT6VVMLW.cjs.map +1 -0
  57. package/dist/{chunk-UGB42BGK.cjs → chunk-NTQBNBBP.cjs} +486 -437
  58. package/dist/chunk-NTQBNBBP.cjs.map +1 -0
  59. package/dist/{chunk-T5KHNJ67.cjs → chunk-PSQGLE6U.cjs} +6 -6
  60. package/dist/{chunk-T5KHNJ67.cjs.map → chunk-PSQGLE6U.cjs.map} +1 -1
  61. package/dist/{chunk-GDZNTILD.js → chunk-TMAOPJCT.js} +4 -4
  62. package/dist/chunk-TMAOPJCT.js.map +1 -0
  63. package/dist/{chunk-LM5X7ZNR.js → chunk-TP7LQ5PF.js} +312 -263
  64. package/dist/chunk-TP7LQ5PF.js.map +1 -0
  65. package/dist/{chunk-UOM3EDE6.js → chunk-TWTUIUNK.js} +3 -3
  66. package/dist/{chunk-UOM3EDE6.js.map → chunk-TWTUIUNK.js.map} +1 -1
  67. package/dist/{chunk-UK6HF6PE.js → chunk-TYEQC7PV.js} +288 -3
  68. package/dist/chunk-TYEQC7PV.js.map +1 -0
  69. package/dist/{chunk-2SZJQVPN.cjs → chunk-V3JTVTPY.cjs} +87 -30
  70. package/dist/chunk-V3JTVTPY.cjs.map +1 -0
  71. package/dist/{chunk-KF3DFASA.js → chunk-VMUNKEB2.js} +3 -3
  72. package/dist/{chunk-KF3DFASA.js.map → chunk-VMUNKEB2.js.map} +1 -1
  73. package/dist/{chunk-K2D6VFLP.js → chunk-VWIKDJNV.js} +78 -22
  74. package/dist/chunk-VWIKDJNV.js.map +1 -0
  75. package/dist/{chunk-JGCKW5RS.js → chunk-VY4JOTM2.js} +5 -5
  76. package/dist/chunk-VY4JOTM2.js.map +1 -0
  77. package/dist/{chunk-LENRV7ZJ.cjs → chunk-VYAUTNHC.cjs} +5 -5
  78. package/dist/chunk-VYAUTNHC.cjs.map +1 -0
  79. package/dist/{chunk-E7LXMEKX.js → chunk-VZVREOTM.js} +3 -3
  80. package/dist/{chunk-E7LXMEKX.js.map → chunk-VZVREOTM.js.map} +1 -1
  81. package/dist/{chunk-JIUC4DRS.cjs → chunk-WFVRUUJW.cjs} +6 -6
  82. package/dist/chunk-WFVRUUJW.cjs.map +1 -0
  83. package/dist/{chunk-JIJWGHRN.cjs → chunk-XA6XIAMN.cjs} +22 -5
  84. package/dist/chunk-XA6XIAMN.cjs.map +1 -0
  85. package/dist/diagrams/blockdiagram/index.cjs +6 -5
  86. package/dist/diagrams/blockdiagram/index.d.cts +2 -2
  87. package/dist/diagrams/blockdiagram/index.d.ts +2 -2
  88. package/dist/diagrams/blockdiagram/index.js +2 -1
  89. package/dist/diagrams/circuit/index.cjs +9 -9
  90. package/dist/diagrams/circuit/index.js +2 -2
  91. package/dist/diagrams/ecomap/index.cjs +7 -7
  92. package/dist/diagrams/ecomap/index.js +2 -2
  93. package/dist/diagrams/entity/index.cjs +6 -6
  94. package/dist/diagrams/entity/index.js +2 -2
  95. package/dist/diagrams/fishbone/index.cjs +8 -8
  96. package/dist/diagrams/fishbone/index.js +2 -2
  97. package/dist/diagrams/flowchart/index.cjs +8 -8
  98. package/dist/diagrams/flowchart/index.d.cts +1 -1
  99. package/dist/diagrams/flowchart/index.d.ts +1 -1
  100. package/dist/diagrams/flowchart/index.js +2 -2
  101. package/dist/diagrams/genogram/index.cjs +9 -9
  102. package/dist/diagrams/genogram/index.js +2 -2
  103. package/dist/diagrams/ladder/index.cjs +6 -6
  104. package/dist/diagrams/ladder/index.js +2 -2
  105. package/dist/diagrams/logic/index.cjs +8 -8
  106. package/dist/diagrams/logic/index.js +2 -2
  107. package/dist/diagrams/orgchart/index.cjs +8 -8
  108. package/dist/diagrams/orgchart/index.js +2 -2
  109. package/dist/diagrams/pedigree/index.cjs +7 -7
  110. package/dist/diagrams/pedigree/index.js +2 -2
  111. package/dist/diagrams/phylo/index.cjs +7 -7
  112. package/dist/diagrams/phylo/index.js +2 -2
  113. package/dist/diagrams/sld/index.cjs +8 -8
  114. package/dist/diagrams/sld/index.js +2 -2
  115. package/dist/diagrams/sociogram/index.cjs +6 -6
  116. package/dist/diagrams/sociogram/index.js +2 -2
  117. package/dist/diagrams/timing/index.cjs +4 -4
  118. package/dist/diagrams/timing/index.js +1 -1
  119. package/dist/diagrams/venn/index.cjs +9 -9
  120. package/dist/diagrams/venn/index.js +2 -2
  121. package/dist/{index-B0YO7rx8.d.cts → index-BiXWjQht.d.cts} +10 -4
  122. package/dist/{index-u3KZBdas.d.ts → index-Cq8y1aaa.d.ts} +10 -4
  123. package/dist/index.cjs +87 -87
  124. package/dist/index.d.cts +1 -1
  125. package/dist/index.d.ts +1 -1
  126. package/dist/index.js +23 -23
  127. package/dist/react.cjs +19 -19
  128. package/dist/react.js +18 -18
  129. package/package.json +1 -1
  130. package/dist/chunk-2SZJQVPN.cjs.map +0 -1
  131. package/dist/chunk-6L46VIXI.cjs.map +0 -1
  132. package/dist/chunk-ABCMTAOZ.js.map +0 -1
  133. package/dist/chunk-B5AQ3CG3.cjs.map +0 -1
  134. package/dist/chunk-DR3DDDQY.cjs.map +0 -1
  135. package/dist/chunk-DX44TBFZ.js.map +0 -1
  136. package/dist/chunk-E3CAJGJM.js.map +0 -1
  137. package/dist/chunk-GDZNTILD.js.map +0 -1
  138. package/dist/chunk-HPEAE3JM.js.map +0 -1
  139. package/dist/chunk-IXRPRMHI.js.map +0 -1
  140. package/dist/chunk-JGCKW5RS.js.map +0 -1
  141. package/dist/chunk-JIJWGHRN.cjs.map +0 -1
  142. package/dist/chunk-JIUC4DRS.cjs.map +0 -1
  143. package/dist/chunk-K2D6VFLP.js.map +0 -1
  144. package/dist/chunk-LENRV7ZJ.cjs.map +0 -1
  145. package/dist/chunk-LM5X7ZNR.js.map +0 -1
  146. package/dist/chunk-NXU4XKLY.cjs.map +0 -1
  147. package/dist/chunk-NZT5P2XZ.cjs.map +0 -1
  148. package/dist/chunk-Q2YRJHFB.cjs.map +0 -1
  149. package/dist/chunk-T3GV7OVF.js.map +0 -1
  150. package/dist/chunk-UGB42BGK.cjs.map +0 -1
  151. package/dist/chunk-UK6HF6PE.js.map +0 -1
@@ -1,21 +1,21 @@
1
- import { orgchart } from './chunk-E3CAJGJM.js';
2
- import { circuit } from './chunk-T3GV7OVF.js';
3
- import { blockdiagram } from './chunk-DX44TBFZ.js';
4
- import { ladder } from './chunk-JGCKW5RS.js';
5
- import { sld } from './chunk-KF3DFASA.js';
6
- import { entity } from './chunk-GDZNTILD.js';
7
- import { fishbone } from './chunk-YTGOLTLJ.js';
8
- import { venn } from './chunk-UOM3EDE6.js';
9
- import { flowchart, layoutFlowchart } from './chunk-HPEAE3JM.js';
10
- import { genogram } from './chunk-6NUAGU6O.js';
11
- import { ecomap } from './chunk-K2D6VFLP.js';
12
- import { pedigree } from './chunk-JN6FHUC6.js';
1
+ import { orgchart } from './chunk-HJA7MIMV.js';
2
+ import { circuit } from './chunk-MERU76LW.js';
3
+ import { blockdiagram } from './chunk-IQLZUCWI.js';
4
+ import { ladder } from './chunk-VY4JOTM2.js';
5
+ import { sld } from './chunk-VMUNKEB2.js';
6
+ import { entity } from './chunk-TMAOPJCT.js';
7
+ import { fishbone } from './chunk-KR7PPCC4.js';
8
+ import { venn } from './chunk-TWTUIUNK.js';
9
+ import { flowchart, layoutFlowchart } from './chunk-7Z2GDS4G.js';
10
+ import { genogram } from './chunk-2RFFCZ3I.js';
11
+ import { ecomap, estimateTextWidth } from './chunk-VWIKDJNV.js';
12
+ import { pedigree } from './chunk-7SVB3XA7.js';
13
13
  import { parseFrontmatter } from './chunk-2KTQ75LN.js';
14
- import { phylo } from './chunk-E7LXMEKX.js';
15
- import { sociogram } from './chunk-ABCMTAOZ.js';
16
- import { timing } from './chunk-IXRPRMHI.js';
17
- import { logic } from './chunk-CDK7KDIW.js';
18
- import { resolveBaseTheme, resolveTimelineTheme, cssCustomProperties, resolvePetriTheme, resolveNetworkTheme, resolveUmlClassTheme, DEFAULT_FONT_FAMILY, FONT_SIZE, resolveReliabilityTheme, STROKE_WIDTH, resolveBowtieTheme, resolveMindmapTheme } from './chunk-UK6HF6PE.js';
14
+ import { phylo } from './chunk-VZVREOTM.js';
15
+ import { sociogram } from './chunk-56DSMSXK.js';
16
+ import { timing } from './chunk-MTIZIHWE.js';
17
+ import { logic } from './chunk-JR6JNQEZ.js';
18
+ import { resolveBaseTheme, resolveTimelineTheme, resolveStateTheme, cssCustomProperties, resolvePetriTheme, resolveNetworkTheme, resolveUmlClassTheme, DEFAULT_FONT_FAMILY, FONT_SIZE, resolveReliabilityTheme, STROKE_WIDTH, resolveBowtieTheme, resolveMindmapTheme, resolveMatrixTheme, resolveBpmnTheme } from './chunk-TYEQC7PV.js';
19
19
  import { QUOTE_PAIRS, stripQuotes, isOpenQuote, extractQuotedString, matchQuotedTitle } from './chunk-TO6PNBT3.js';
20
20
  import { el, escapeXml, group, rect, text, line, path, circle, polygon, title, desc, svgRoot, defs, multilineText } from './chunk-SYYBKDL7.js';
21
21
 
@@ -1253,7 +1253,7 @@ var CLASS_PALETTE = [
1253
1253
  function buildCss2(t) {
1254
1254
  return `
1255
1255
  .lt-dtree { font-family: system-ui, -apple-system, sans-serif; }
1256
- .lt-dtree-title { font: 500 16px sans-serif; fill: ${t.text}; }
1256
+ .lt-dtree-title { font: 700 16px sans-serif; fill: ${t.text}; }
1257
1257
  .lt-dtree-edge { fill: none; stroke: ${t.stroke}; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
1258
1258
  .lt-dtree-edge-optimal { fill: none; stroke: ${t.positive}; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
1259
1259
  .lt-dtree-edge-leader { fill: none; stroke: ${t.stroke}; stroke-width: 1; stroke-dasharray: 2 2; opacity: 0.55; }
@@ -1585,7 +1585,7 @@ function renderDecisionTree(ast, config) {
1585
1585
  children.push(desc(`Decision tree (${ast.mode} mode) with ${layout.nodes.length} nodes and ${layout.edges.length} edges`));
1586
1586
  children.push(el("style", {}, buildCss2(t)));
1587
1587
  if (ast.title) {
1588
- children.push(text({ x: 20, y: 24, class: "lt-dtree-title" }, ast.title));
1588
+ children.push(text({ x: width / 2, y: 24, class: "lt-dtree-title", "text-anchor": "middle" }, ast.title));
1589
1589
  }
1590
1590
  const inner = [];
1591
1591
  for (const e of layout.edges) {
@@ -4124,40 +4124,42 @@ function shiftPathY(d, dy) {
4124
4124
 
4125
4125
  // src/diagrams/state/renderer.ts
4126
4126
  var ARROW_MARKER_ID = "lt-state-arrow";
4127
- var STYLE = `
4128
- .lt-state-body { fill: #ffffff; stroke: #2a2a2a; stroke-width: 1.6; }
4129
- .lt-state-name { font: 600 12px system-ui, sans-serif; fill: #1a1a1a; }
4130
- .lt-state-div { stroke: #2a2a2a; stroke-width: 1; }
4131
- .lt-state-activity { font: 11px ui-monospace, monospace; fill: #444; }
4127
+ function buildStyle(t) {
4128
+ return `
4129
+ .lt-state-body { fill: ${t.stateFill}; stroke: ${t.stateStroke}; stroke-width: 1.6; }
4130
+ .lt-state-name { font: 600 12px system-ui, sans-serif; fill: ${t.stateText}; }
4131
+ .lt-state-div { stroke: ${t.stateStroke}; stroke-width: 1; }
4132
+ .lt-state-activity { font: 11px ui-monospace, monospace; fill: ${t.activityText}; }
4132
4133
 
4133
- .lt-composite-body { fill: #fafafa; stroke: #2a2a2a; stroke-width: 1.6; }
4134
- .lt-composite-title { font: 600 12px system-ui, sans-serif; fill: #1a1a1a; }
4135
- .lt-composite-titlebar { fill: #f0f0f0; stroke: #2a2a2a; stroke-width: 1; }
4136
- .lt-region-div { stroke: #888; stroke-width: 1; stroke-dasharray: 6 4; }
4134
+ .lt-composite-body { fill: ${t.compositeFill}; stroke: ${t.stateStroke}; stroke-width: 1.6; }
4135
+ .lt-composite-title { font: 600 12px system-ui, sans-serif; fill: ${t.stateText}; }
4136
+ .lt-composite-titlebar { fill: ${t.compositeTitlebar}; stroke: ${t.stateStroke}; stroke-width: 1; }
4137
+ .lt-region-div { stroke: ${t.regionDiv}; stroke-width: 1; stroke-dasharray: 6 4; }
4137
4138
 
4138
- .lt-ps-initial { fill: #1a1a1a; }
4139
- .lt-ps-final-outer { fill: #ffffff; stroke: #1a1a1a; stroke-width: 1.6; }
4140
- .lt-ps-final-inner { fill: #1a1a1a; }
4141
- .lt-ps-choice { fill: #ffffff; stroke: #1a1a1a; stroke-width: 1.6; }
4142
- .lt-ps-junction { fill: #1a1a1a; }
4143
- .lt-ps-bar { fill: #1a1a1a; }
4144
- .lt-ps-history-body { fill: #ffffff; stroke: #1a1a1a; stroke-width: 1.6; }
4145
- .lt-ps-history-text { font: 600 11px serif; fill: #1a1a1a; }
4146
- .lt-ps-terminate { stroke: #1a1a1a; stroke-width: 2; }
4147
- .lt-ps-entrypoint { fill: #ffffff; stroke: #1a1a1a; stroke-width: 1.6; }
4148
- .lt-ps-exitpoint { fill: #ffffff; stroke: #1a1a1a; stroke-width: 1.6; }
4139
+ .lt-ps-initial { fill: ${t.psInk}; }
4140
+ .lt-ps-final-outer { fill: ${t.stateFill}; stroke: ${t.psInk}; stroke-width: 1.6; }
4141
+ .lt-ps-final-inner { fill: ${t.psInk}; }
4142
+ .lt-ps-choice { fill: ${t.stateFill}; stroke: ${t.psInk}; stroke-width: 1.6; }
4143
+ .lt-ps-junction { fill: ${t.psInk}; }
4144
+ .lt-ps-bar { fill: ${t.psInk}; }
4145
+ .lt-ps-history-body { fill: ${t.stateFill}; stroke: ${t.psInk}; stroke-width: 1.6; }
4146
+ .lt-ps-history-text { font: 600 11px serif; fill: ${t.psInk}; }
4147
+ .lt-ps-terminate { stroke: ${t.psInk}; stroke-width: 2; }
4148
+ .lt-ps-entrypoint { fill: ${t.stateFill}; stroke: ${t.psInk}; stroke-width: 1.6; }
4149
+ .lt-ps-exitpoint { fill: ${t.stateFill}; stroke: ${t.psInk}; stroke-width: 1.6; }
4149
4150
 
4150
- .lt-transition { stroke: #2a2a2a; stroke-width: 1.4; fill: none; }
4151
- .lt-transition-label { font: 11px system-ui, sans-serif; fill: #1a1a1a; }
4152
- .lt-transition-label-bg { fill: #ffffff; opacity: 0.92; }
4151
+ .lt-transition { stroke: ${t.transitionStroke}; stroke-width: 1.4; fill: none; }
4152
+ .lt-transition-label { font: 11px system-ui, sans-serif; fill: ${t.transitionLabel}; }
4153
+ .lt-transition-label-bg { fill: ${t.labelBg}; opacity: 0.92; }
4153
4154
 
4154
- .lt-note-body { fill: #fff8c5; stroke: #b79400; stroke-width: 1; }
4155
- .lt-note-text { font: 11px system-ui, sans-serif; fill: #2a2a2a; }
4156
- .lt-note-leader { stroke: #b79400; stroke-width: 1; stroke-dasharray: 3 3; fill: none; }
4155
+ .lt-note-body { fill: ${t.noteFill}; stroke: ${t.noteStroke}; stroke-width: 1; }
4156
+ .lt-note-text { font: 11px system-ui, sans-serif; fill: ${t.noteText}; }
4157
+ .lt-note-leader { stroke: ${t.noteStroke}; stroke-width: 1; stroke-dasharray: 3 3; fill: none; }
4157
4158
 
4158
- .lt-title { font: 600 14px system-ui, sans-serif; fill: #1a1a1a; }
4159
+ .lt-title { font: 700 16px system-ui, sans-serif; fill: ${t.stateText}; }
4159
4160
  `;
4160
- function renderArrowMarker() {
4161
+ }
4162
+ function renderArrowMarker(t) {
4161
4163
  return el(
4162
4164
  "marker",
4163
4165
  {
@@ -4169,7 +4171,7 @@ function renderArrowMarker() {
4169
4171
  orient: "auto",
4170
4172
  markerUnits: "strokeWidth"
4171
4173
  },
4172
- [polygon({ points: "0,0 10,3 0,6", fill: "#2a2a2a" })]
4174
+ [polygon({ points: "0,0 10,3 0,6", fill: t.transitionStroke })]
4173
4175
  );
4174
4176
  }
4175
4177
  function activityText2(a) {
@@ -4400,12 +4402,12 @@ function renderNote(n) {
4400
4402
  }
4401
4403
  return group({ class: "lt-note", "data-target": n.note.target }, parts);
4402
4404
  }
4403
- function renderStateDiagram(ast, _config) {
4405
+ function renderStateDiagram(ast, config) {
4404
4406
  const layout = layoutStateDiagram(ast);
4405
- return renderLayout(layout);
4407
+ return renderLayout(layout, resolveStateTheme(config?.theme ?? "default"));
4406
4408
  }
4407
- function renderLayout(layout) {
4408
- const titleNode = layout.title ? text({ x: 16, y: 22, class: "lt-title" }, layout.title) : "";
4409
+ function renderLayout(layout, t) {
4410
+ const titleNode = layout.title ? text({ x: layout.width / 2, y: 22, class: "lt-title", "text-anchor": "middle" }, layout.title) : "";
4409
4411
  return svgRoot(
4410
4412
  {
4411
4413
  width: layout.width,
@@ -4417,7 +4419,7 @@ function renderLayout(layout) {
4417
4419
  [
4418
4420
  el("title", {}, escapeXml(`State Diagram${layout.title ? " \u2014 " + layout.title : ""}`)),
4419
4421
  el("desc", {}, "UML 2.5 / Harel statechart rendered by Schematex"),
4420
- defs([renderArrowMarker(), el("style", {}, STYLE)]),
4422
+ defs([renderArrowMarker(t), el("style", {}, buildStyle(t))]),
4421
4423
  titleNode,
4422
4424
  // Composite clusters first so simple-state bodies sit on top.
4423
4425
  group({ class: "lt-clusters" }, layout.clusters.map(renderComposite)),
@@ -4437,7 +4439,7 @@ var state = {
4437
4439
  parse: parseStateDiagram,
4438
4440
  render(text2, config) {
4439
4441
  const ast = parseStateDiagram(text2);
4440
- return renderStateDiagram(ast);
4442
+ return renderStateDiagram(ast, config);
4441
4443
  }
4442
4444
  };
4443
4445
 
@@ -5787,7 +5789,7 @@ function resolveAnchor(id, port, fallback, equipById, instById) {
5787
5789
  }
5788
5790
 
5789
5791
  // src/diagrams/pid/renderer.ts
5790
- var STYLE2 = `
5792
+ var STYLE = `
5791
5793
  .lt-pid-equip { fill: #ffffff; stroke: #1d1d1d; stroke-width: 1.6; }
5792
5794
  .lt-pid-equip-tag { font: 600 11px system-ui, sans-serif; fill: #1d1d1d; }
5793
5795
  .lt-pid-tray-line { stroke: #555; stroke-width: 1; fill: none; }
@@ -5813,7 +5815,7 @@ var STYLE2 = `
5813
5815
  .lt-pid-line-tag-bg { fill: #ffffff; stroke: #1d1d1d; stroke-width: 0.6; }
5814
5816
  .lt-pid-line-tag-text { font: 9px ui-monospace, monospace; fill: #1d1d1d; }
5815
5817
 
5816
- .lt-pid-title { font: 600 14px system-ui, sans-serif; fill: #1d1d1d; }
5818
+ .lt-pid-title { font: 700 16px system-ui, sans-serif; fill: #1d1d1d; }
5817
5819
 
5818
5820
  .lt-pid-unknown-box { fill: none; stroke: #c0392b; stroke-width: 1.6; stroke-dasharray: 5 3; }
5819
5821
  .lt-pid-unknown-mark { font: 700 18px system-ui, sans-serif; fill: #c0392b; }
@@ -5988,7 +5990,7 @@ function renderLayout2(layout) {
5988
5990
  }
5989
5991
  }
5990
5992
  }
5991
- const titleNode = layout.title ? text({ x: 16, y: 22, class: "lt-pid-title" }, layout.title) : "";
5993
+ const titleNode = layout.title ? text({ x: layout.width / 2, y: 22, class: "lt-pid-title", "text-anchor": "middle" }, layout.title) : "";
5992
5994
  return svgRoot(
5993
5995
  {
5994
5996
  width: layout.width,
@@ -6014,7 +6016,7 @@ function renderLayout2(layout) {
6014
6016
  },
6015
6017
  [polygon({ points: "0,0 10,3 0,6", fill: "#1d1d1d" })]
6016
6018
  ),
6017
- el("style", {}, STYLE2)
6019
+ el("style", {}, STYLE)
6018
6020
  ]),
6019
6021
  titleNode,
6020
6022
  // Z-order: process pipes behind equipment; signal lines + instruments above.
@@ -7386,7 +7388,7 @@ function headerHeightFor(lineCount) {
7386
7388
  function buildCss3(t) {
7387
7389
  return `
7388
7390
  .prisma { font-family: system-ui, -apple-system, sans-serif; }
7389
- .prisma-title { font: 600 17px sans-serif; fill: ${t.text}; }
7391
+ .prisma-title { font: 700 16px sans-serif; fill: ${t.text}; }
7390
7392
  .prisma-subtitle { font: 400 12px sans-serif; fill: ${t.textMuted}; }
7391
7393
 
7392
7394
  .prisma-stage { stroke-width: 1.1; stroke: #90a4ae; }
@@ -8269,7 +8271,7 @@ function ellipsePerimeterPoint(cx, cy, rx, ry, tx, ty) {
8269
8271
  function isWideGlyph(cp) {
8270
8272
  return cp >= 12288 && cp <= 40959 || cp >= 44032 && cp <= 55203 || cp >= 65280 && cp <= 65519;
8271
8273
  }
8272
- function estimateTextWidth(s, charW) {
8274
+ function estimateTextWidth2(s, charW) {
8273
8275
  let w = 0;
8274
8276
  for (const ch of s) {
8275
8277
  w += isWideGlyph(ch.codePointAt(0) ?? 0) ? charW * 1.7 : charW;
@@ -8278,10 +8280,10 @@ function estimateTextWidth(s, charW) {
8278
8280
  }
8279
8281
  function sizeEllipse(uc) {
8280
8282
  const C2 = USECASE_CONST;
8281
- const nameW = estimateTextWidth(uc.name, C2.CHAR_W_NAME);
8283
+ const nameW = estimateTextWidth2(uc.name, C2.CHAR_W_NAME);
8282
8284
  let widest = nameW;
8283
8285
  if (uc.stereotype) {
8284
- widest = Math.max(widest, estimateTextWidth(`\xAB${uc.stereotype}\xBB`, C2.CHAR_W_EXT));
8286
+ widest = Math.max(widest, estimateTextWidth2(`\xAB${uc.stereotype}\xBB`, C2.CHAR_W_EXT));
8285
8287
  }
8286
8288
  let stack = 0;
8287
8289
  if (uc.stereotype) stack += C2.STEREO_LH;
@@ -8291,9 +8293,9 @@ function sizeEllipse(uc) {
8291
8293
  stack += 8;
8292
8294
  stack += C2.EXTPOINT_LH;
8293
8295
  stack += uc.extensionPoints.length * C2.EXTPOINT_LH;
8294
- widest = Math.max(widest, estimateTextWidth(C2.EXT_HEADER, C2.CHAR_W_EXT));
8296
+ widest = Math.max(widest, estimateTextWidth2(C2.EXT_HEADER, C2.CHAR_W_EXT));
8295
8297
  for (const ep of uc.extensionPoints) {
8296
- widest = Math.max(widest, estimateTextWidth(ep, C2.CHAR_W_EXT) + 16);
8298
+ widest = Math.max(widest, estimateTextWidth2(ep, C2.CHAR_W_EXT) + 16);
8297
8299
  }
8298
8300
  }
8299
8301
  const rx = Math.max(C2.MIN_RX, widest / 2 * Math.SQRT2 + C2.ELLIPSE_PAD_X);
@@ -8549,7 +8551,7 @@ function layoutUsecase(ast) {
8549
8551
  let right = b.x + b.width;
8550
8552
  const isRect = b.actor.kind === "external" || b.actor.kind === "system";
8551
8553
  if (!isRect) {
8552
- const labelW = estimateTextWidth(b.actor.name, 6.4);
8554
+ const labelW = estimateTextWidth2(b.actor.name, 6.4);
8553
8555
  const cx = b.x + b.width / 2;
8554
8556
  left = Math.min(left, cx - labelW / 2);
8555
8557
  right = Math.max(right, cx + labelW / 2);
@@ -13514,6 +13516,7 @@ var DET = "sx-net-detail";
13514
13516
  var GLY = "sx-net-glyph";
13515
13517
  var GLYL = "sx-net-glyph-line";
13516
13518
  var ITX = "sx-net-icontext";
13519
+ var ITAG = "sx-net-icontag";
13517
13520
  var CLOUD = "sx-net-cloud-body";
13518
13521
  var CTX = "sx-net-cloudtext";
13519
13522
  var r2 = (n) => Math.round(n * 100) / 100;
@@ -13557,7 +13560,7 @@ function switchBox(b, glyph) {
13557
13560
  }
13558
13561
  function poeSwitch(b) {
13559
13562
  const cx = b.x + b.w / 2;
13560
- return group({}, [switchBox(b, "straight"), text({ class: ITX, x: r2(cx), y: r2(b.y + b.h * 0.78 + 8), "text-anchor": "middle" }, "PoE")]);
13563
+ return group({}, [switchBox(b, "straight"), text({ class: ITAG, x: r2(cx), y: r2(b.y + b.h * 0.78 + 8), "text-anchor": "middle" }, "PoE")]);
13561
13564
  }
13562
13565
  function firewall(b) {
13563
13566
  const cx = b.x + b.w / 2, cy = b.y + b.h / 2;
@@ -13612,7 +13615,7 @@ function serverFarm(b, d) {
13612
13615
  for (let i = 2; i >= 0; i--) {
13613
13616
  parts.push(server({ x: b.x + i * off, y: b.y - i * off * 0.5, w: b.w - 2 * off, h: b.h - off }));
13614
13617
  }
13615
- if (d.count) parts.push(text({ class: ITX, x: r2(b.x + b.w - 6), y: r2(b.y + b.h - 2), "text-anchor": "end" }, `\xD7${d.count}`));
13618
+ if (d.count) parts.push(text({ class: ITAG, x: r2(b.x + b.w - 6), y: r2(b.y + b.h - 2), "text-anchor": "end" }, `\xD7${d.count}`));
13616
13619
  return group({}, parts);
13617
13620
  }
13618
13621
  function pc(b) {
@@ -13750,9 +13753,9 @@ function drawDeviceIcon(d, b) {
13750
13753
  case "router":
13751
13754
  return router(b);
13752
13755
  case "gateway":
13753
- return group({}, [router(b), text({ class: ITX, x: r2(b.x + b.w / 2), y: r2(b.y + b.h - 1), "text-anchor": "middle" }, "GW")]);
13756
+ return group({}, [router(b), text({ class: ITAG, x: r2(b.x + b.w / 2), y: r2(b.y + b.h - 1), "text-anchor": "middle" }, "GW")]);
13754
13757
  case "vpngw":
13755
- return group({}, [router(b), text({ class: ITX, x: r2(b.x + b.w / 2), y: r2(b.y + b.h - 1), "text-anchor": "middle" }, "VPN")]);
13758
+ return group({}, [router(b), text({ class: ITAG, x: r2(b.x + b.w / 2), y: r2(b.y + b.h - 1), "text-anchor": "middle" }, "VPN")]);
13756
13759
  case "switch":
13757
13760
  return switchBox(b, "straight");
13758
13761
  case "l3switch":
@@ -14232,16 +14235,54 @@ function layoutNetwork2(ast) {
14232
14235
  depth: gb.depth
14233
14236
  });
14234
14237
  }
14238
+ const labelClearsDevices = (x, y, halfW) => {
14239
+ const margin = 6;
14240
+ for (const b of boxes) {
14241
+ const e = effBox(b);
14242
+ if (x + halfW >= e.left - margin && x - halfW <= e.right + margin && y + 5 >= e.top - margin && y - 5 <= e.bottom + margin) {
14243
+ return false;
14244
+ }
14245
+ }
14246
+ return true;
14247
+ };
14248
+ const placedLabels = [];
14249
+ const labelClearsPlaced = (x, y) => placedLabels.every((p) => Math.abs(p.x - x) > 90 || Math.abs(p.y - y) > 16);
14235
14250
  const linkGeoms = links.map((link) => {
14236
14251
  const a = boxById.get(link.from);
14237
14252
  const b = boxById.get(link.to);
14238
14253
  const p1 = edgePoint(a, b.cx, b.cy);
14239
14254
  const p2 = edgePoint(b, a.cx, a.cy);
14255
+ const hasAnnotation = Boolean(
14256
+ link.label || link.speed || link.mode || link.vlans && link.vlans.length
14257
+ );
14258
+ let labelT = 0.5;
14259
+ if (hasAnnotation) {
14260
+ const annLen = (link.mode ? link.mode.length + 3 : 0) + (link.vlans && link.vlans.length ? 6 + link.vlans.join(",").length + 3 : 0) + (link.speed ? link.speed.length + 3 : 0) + (link.label ? link.label.length : 0);
14261
+ const halfW = annLen * 5.4 / 2;
14262
+ const candidates = [0.5, 0.38, 0.62, 0.28, 0.72, 0.2, 0.8, 0.14, 0.86];
14263
+ const at = (t) => ({
14264
+ x: p1.x + (p2.x - p1.x) * t,
14265
+ y: p1.y + (p2.y - p1.y) * t
14266
+ });
14267
+ const strict = candidates.find((t) => {
14268
+ const p = at(t);
14269
+ return labelClearsDevices(p.x, p.y, halfW) && labelClearsPlaced(p.x, p.y);
14270
+ });
14271
+ const relaxed = strict ?? candidates.find((t) => {
14272
+ const p = at(t);
14273
+ return labelClearsDevices(p.x, p.y, halfW);
14274
+ });
14275
+ labelT = relaxed ?? 0.5;
14276
+ placedLabels.push({
14277
+ x: p1.x + (p2.x - p1.x) * labelT,
14278
+ y: p1.y + (p2.y - p1.y) * labelT
14279
+ });
14280
+ }
14240
14281
  return {
14241
14282
  link,
14242
14283
  points: [p1, p2],
14243
- labelX: (p1.x + p2.x) / 2,
14244
- labelY: (p1.y + p2.y) / 2
14284
+ labelX: p1.x + (p2.x - p1.x) * labelT,
14285
+ labelY: p1.y + (p2.y - p1.y) * labelT
14245
14286
  };
14246
14287
  });
14247
14288
  const width = maxX - minX + 2 * NET_CONST.PAD;
@@ -14269,11 +14310,12 @@ function buildCss8(t) {
14269
14310
  .sx-net-glyph { fill: ${t.deviceAccent}; stroke: none; }
14270
14311
  .sx-net-glyph-line { fill: none; stroke: ${t.deviceAccent}; stroke-width: 1.4; }
14271
14312
  .sx-net-icontext { font: 700 8px sans-serif; fill: ${t.deviceAccent}; }
14313
+ .sx-net-icontag { font: 700 8px sans-serif; fill: ${t.subLabel}; paint-order: stroke; stroke: ${t.bg}; stroke-width: 2.5px; stroke-linejoin: round; }
14272
14314
  .sx-net-cloud-body { fill: ${t.cloudFill}; stroke: ${t.cloudStroke}; stroke-width: 2; }
14273
14315
  .sx-net-cloudtext { font: 600 13px sans-serif; fill: ${t.text}; }
14274
14316
  .sx-net-bus { stroke: ${t.deviceStroke}; stroke-width: 4; stroke-linecap: round; }
14275
- .sx-net-label { font: 12px sans-serif; fill: ${t.label}; }
14276
- .sx-net-sublabel { font: 10px sans-serif; fill: ${t.subLabel}; }
14317
+ .sx-net-label { font: 12px sans-serif; fill: ${t.label}; paint-order: stroke; stroke: ${t.bg}; stroke-width: 3px; stroke-linejoin: round; }
14318
+ .sx-net-sublabel { font: 10px sans-serif; fill: ${t.subLabel}; paint-order: stroke; stroke: ${t.bg}; stroke-width: 3px; stroke-linejoin: round; }
14277
14319
  .sx-net-link { fill: none; stroke-width: 2; }
14278
14320
  .sx-net-link-wireless, .sx-net-link-vpn { stroke-dasharray: 5 4; }
14279
14321
  .sx-net-link-lag { stroke-width: 3; }
@@ -16208,7 +16250,7 @@ function renderUmlClassLayout(layout, config) {
16208
16250
  .sx-umlclass-edge-label { fill: ${theme.edgeLabel}; font-size: ${FONT_SIZE.small + 1}px; font-weight: 500; }
16209
16251
  .sx-umlclass-edge-name { fill: ${theme.edgeLabel}; font-size: ${FONT_SIZE.label}px; font-style: italic; }
16210
16252
  .sx-umlclass-edge-name-halo { fill: ${theme.bg}; stroke: ${theme.bg}; stroke-width: ${UMLCLASS_CONST.EDGE_LABEL_HALO}; stroke-linejoin: round; }
16211
- .sx-umlclass-title { fill: ${theme.nameText}; font-size: ${FONT_SIZE.title}px; font-weight: 600; }
16253
+ .sx-umlclass-title { fill: ${theme.nameText}; font-size: ${FONT_SIZE.title}px; font-weight: 700; }
16212
16254
  .sx-umlclass-package { fill: ${theme.packageFill}; stroke: ${theme.packageStroke}; stroke-width: 1; }
16213
16255
  .sx-umlclass-package-label { fill: ${theme.packageLabel}; font-size: ${FONT_SIZE.label}px; font-weight: 600; }
16214
16256
  `.trim()
@@ -17592,7 +17634,7 @@ function renderFaultTreeLayout(layout, config) {
17592
17634
  const inner = [];
17593
17635
  if (ast.title) {
17594
17636
  inner.push(
17595
- text({ x: FAULTTREE_CONST.CANVAS_PAD, y: 22, class: "sx-ft-title", "font-family": fontFamily }, ast.title)
17637
+ text({ x: layout.width / 2, y: 22, class: "sx-ft-title", "font-family": fontFamily, "text-anchor": "middle" }, ast.title)
17596
17638
  );
17597
17639
  }
17598
17640
  for (const box of layout.cutSetBoxes) {
@@ -18289,7 +18331,7 @@ function renderBowtieLayout(layout, config) {
18289
18331
  ];
18290
18332
  const inner = [];
18291
18333
  if (ast.title) {
18292
- inner.push(text({ x: BOWTIE_CONST.PAGE_PAD, y: BOWTIE_CONST.PAGE_PAD + 6, class: "sx-bowtie-title", "font-family": fontFamily }, ast.title));
18334
+ inner.push(text({ x: layout.width / 2, y: BOWTIE_CONST.PAGE_PAD + 6, class: "sx-bowtie-title", "font-family": fontFamily, "text-anchor": "middle" }, ast.title));
18293
18335
  }
18294
18336
  if (layout.hazardTie) {
18295
18337
  inner.push(line({ x1: layout.hazardTie.x, y1: layout.hazardTie.y1, x2: layout.hazardTie.x, y2: layout.hazardTie.y2, class: "sx-bowtie-line" }));
@@ -18917,7 +18959,7 @@ function renderEventTreeLayout(layout, config) {
18917
18959
  ];
18918
18960
  const inner = [];
18919
18961
  if (ast.title) {
18920
- inner.push(text({ x: EVENTTREE_CONST.CANVAS_PAD, y: EVENTTREE_CONST.CANVAS_PAD + 4, class: "sx-et-title", "font-family": fontFamily }, ast.title));
18962
+ inner.push(text({ x: layout.width / 2, y: EVENTTREE_CONST.CANVAS_PAD + 4, class: "sx-et-title", "font-family": fontFamily, "text-anchor": "middle" }, ast.title));
18921
18963
  }
18922
18964
  for (const h of layout.headers) {
18923
18965
  inner.push(
@@ -20111,7 +20153,7 @@ function renderHeaderBlock(layout) {
20111
20153
  const x0 = FMEA_CONST.CANVAS_PAD;
20112
20154
  let y = FMEA_CONST.CANVAS_PAD + 14;
20113
20155
  if (ast.title) {
20114
- out.push(text({ x: x0, y, class: "sx-fmea-title" }, ast.title));
20156
+ out.push(text({ x: layout.width / 2, y, class: "sx-fmea-title", "text-anchor": "middle" }, ast.title));
20115
20157
  y += FMEA_CONST.TITLE_H - 8;
20116
20158
  }
20117
20159
  const metaEntries = Object.entries(ast.metadata);
@@ -20894,7 +20936,7 @@ function renderCausalLoopLayout(layout, config) {
20894
20936
  if (ast.title) {
20895
20937
  inner.push(
20896
20938
  text(
20897
- { x: CAUSALLOOP_CONST.CANVAS_PAD, y: 20, class: "sx-cld-title", "font-family": fontFamily },
20939
+ { x: layout.width / 2, y: 20, class: "sx-cld-title", "font-family": fontFamily, "text-anchor": "middle" },
20898
20940
  ast.title
20899
20941
  )
20900
20942
  );
@@ -22721,7 +22763,7 @@ function renderGitGraphLayout(layout, config) {
22721
22763
  const width = layout.width + pad * 2;
22722
22764
  const height = layout.height + pad * 2;
22723
22765
  const a11y = ast.title ?? "Git commit graph";
22724
- const styleBlock = buildStyle(pal, ast.showBranches);
22766
+ const styleBlock = buildStyle2(pal, ast.showBranches);
22725
22767
  const children = [
22726
22768
  title(a11y),
22727
22769
  desc(summarise6(layout)),
@@ -22937,7 +22979,7 @@ function renderCommitLabel(id, x, y, rotate, fontFamily) {
22937
22979
  id
22938
22980
  );
22939
22981
  }
22940
- function buildStyle(pal, showBranches) {
22982
+ function buildStyle2(pal, showBranches) {
22941
22983
  const laneStyle = showBranches ? `
22942
22984
  .sx-gg-lane { stroke-width: ${STROKE_WIDTH.thick}; stroke-linecap: round; opacity: 0.9; }
22943
22985
  .sx-gg-pill { stroke: none; }
@@ -23559,7 +23601,8 @@ function layoutEpc(ast) {
23559
23601
  const shift = (maxCrossExtent - rankWidths[r6]) / 2 + EPC_CONST.CANVAS_PAD;
23560
23602
  for (const id of ranks[r6]) crossPos.set(id, crossPos.get(id) + shift);
23561
23603
  }
23562
- const crossExtent = maxCrossExtent + EPC_CONST.CANVAS_PAD * 2 + EPC_CONST.BACK_MARGIN;
23604
+ const backMargin = backSet.size > 0 ? EPC_CONST.BACK_MARGIN : 0;
23605
+ const crossExtent = maxCrossExtent + EPC_CONST.CANVAS_PAD * 2 + backMargin;
23563
23606
  const flaggedIds = /* @__PURE__ */ new Set();
23564
23607
  for (const v of analysis.violations) {
23565
23608
  if (v.severity === "error") for (const id of v.nodes) flaggedIds.add(id);
@@ -23840,7 +23883,7 @@ function renderEpcLayout(layout, config) {
23840
23883
  ];
23841
23884
  const inner = [];
23842
23885
  if (ast.title) {
23843
- inner.push(text({ x: EPC_CONST.CANVAS_PAD, y: 22, class: "sx-epc-title", "font-family": fontFamily }, ast.title));
23886
+ inner.push(text({ x: layout.width / 2, y: 22, class: "sx-epc-title", "font-family": fontFamily, "text-anchor": "middle" }, ast.title));
23844
23887
  }
23845
23888
  for (const e of layout.edges) inner.push(renderEdge6(e));
23846
23889
  for (const n of layout.nodes) inner.push(renderNode3(n));
@@ -24578,7 +24621,7 @@ function renderIdef0Layout(layout, config) {
24578
24621
  const inner = [];
24579
24622
  if (ast.title) {
24580
24623
  inner.push(
24581
- text({ x: IDEF0_CONST.MARGIN, y: 24, class: "sx-idef0-title", "font-family": fontFamily }, ast.title)
24624
+ text({ x: layout.width / 2, y: 24, class: "sx-idef0-title", "font-family": fontFamily, "text-anchor": "middle" }, ast.title)
24582
24625
  );
24583
24626
  }
24584
24627
  for (const a of layout.arrows) {
@@ -25399,7 +25442,7 @@ function renderThreatModelLayout(layout, config) {
25399
25442
  if (layout.ast.title) {
25400
25443
  inner.push(
25401
25444
  text(
25402
- { x: TM_CONST.PAD, y: 24, class: "sx-tm-title", "font-family": fontFamily },
25445
+ { x: layout.width / 2, y: 24, class: "sx-tm-title", "font-family": fontFamily, "text-anchor": "middle" },
25403
25446
  layout.ast.title
25404
25447
  )
25405
25448
  );
@@ -28317,7 +28360,8 @@ function layoutSipoc(ast) {
28317
28360
  var QFD_CELL = 46;
28318
28361
  var QFD_WHAT_LABEL_W = 190;
28319
28362
  var QFD_WEIGHT_W = 46;
28320
- var QFD_HOW_LABEL_H = 130;
28363
+ var QFD_HOW_FONT = 11.5;
28364
+ var QFD_HOW_ANGLE_SIN = Math.sin(60 * Math.PI / 180);
28321
28365
  var QFD_FOOTER_H = 64;
28322
28366
  var QFD_PAD = 24;
28323
28367
  function layoutQfd(ast) {
@@ -28329,7 +28373,11 @@ function layoutQfd(ast) {
28329
28373
  const roofH = Math.ceil(cellW / 2 * cols) + 8;
28330
28374
  const whatLabelW = QFD_WHAT_LABEL_W;
28331
28375
  const weightW = QFD_WEIGHT_W;
28332
- const howLabelH = QFD_HOW_LABEL_H;
28376
+ const maxHowW = Math.max(
28377
+ 0,
28378
+ ...(ast.qfd?.hows ?? []).map((h) => estimateTextWidth(h.label, QFD_HOW_FONT))
28379
+ );
28380
+ const howLabelH = Math.max(48, Math.min(220, Math.ceil(maxHowW * QFD_HOW_ANGLE_SIN) + 26));
28333
28381
  const footerH = QFD_FOOTER_H;
28334
28382
  const gridX0 = QFD_PAD + whatLabelW + weightW;
28335
28383
  const gridY0 = QFD_PAD + titleH + roofH + howLabelH;
@@ -28466,76 +28514,78 @@ var HEAT_RAMP = [
28466
28514
  "#ef4444",
28467
28515
  "#b91c1c"
28468
28516
  ];
28469
- var CSS2 = `
28517
+ function buildMatrixCss(t) {
28518
+ return `
28470
28519
  .sx-matrix { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
28471
- .sx-matrix-title { font: 600 16px sans-serif; fill: #111; }
28472
- .sx-matrix-grid { stroke: #e5e7eb; stroke-width: 1; fill: none; }
28473
- .sx-matrix-mid { stroke: #9ca3af; stroke-width: 1.2; stroke-dasharray: 4 3; fill: none; }
28474
- .sx-matrix-plot-border { stroke: #374151; stroke-width: 1.2; fill: none; }
28475
- .sx-matrix-axis-label { font: 500 12px sans-serif; fill: #374151; }
28476
- .sx-matrix-axis-end { font: 500 11px sans-serif; fill: #6b7280; }
28477
- .sx-matrix-quad-annot { font: 600 13px sans-serif; fill: #475569; opacity: 0.75; }
28478
- .sx-matrix-quad-desc { font: 400 10.5px sans-serif; fill: #64748b; opacity: 0.85; }
28479
- .sx-matrix-corr-header { font: 600 11.5px sans-serif; fill: #1f2937; text-anchor: middle; }
28480
- .sx-matrix-corr-rowlabel { font: 500 11.5px sans-serif; fill: #1f2937; text-anchor: end; dominant-baseline: central; }
28481
- .sx-matrix-corr-margin { font: 500 11px sans-serif; fill: #374151; text-anchor: middle; dominant-baseline: central; }
28482
- .sx-matrix-corr-margin-best { font: 700 11.5px sans-serif; fill: #111; text-anchor: middle; dominant-baseline: central; }
28483
- .sx-matrix-corr-grid { stroke: #d1d5db; stroke-width: 0.8; fill: none; }
28484
- .sx-matrix-corr-rowbg-a { fill: #f0fdf4; }
28485
- .sx-matrix-corr-rowbg-b { fill: #fff; }
28486
- .sx-matrix-cell-label { font: 500 12px sans-serif; fill: #1f2937; text-anchor: middle; }
28487
- .sx-matrix-cell-title { font: 600 13px sans-serif; fill: #111827; }
28488
- .sx-matrix-cell-subtitle { font: 400 11px sans-serif; fill: #6b7280; }
28489
- .sx-matrix-cell-item { font: 500 12px sans-serif; fill: #1f2937; }
28490
- .sx-matrix-cell-value { font: 600 18px sans-serif; fill: #111; text-anchor: middle; }
28520
+ .sx-matrix-title { font: 700 16px sans-serif; fill: ${t.inkStrong}; }
28521
+ .sx-matrix-grid { stroke: ${t.gridFaint}; stroke-width: 1; fill: none; }
28522
+ .sx-matrix-mid { stroke: ${t.gridStrong}; stroke-width: 1.2; stroke-dasharray: 4 3; fill: none; }
28523
+ .sx-matrix-plot-border { stroke: ${t.inkMuted}; stroke-width: 1.2; fill: none; }
28524
+ .sx-matrix-axis-label { font: 500 12px sans-serif; fill: ${t.inkMuted}; }
28525
+ .sx-matrix-axis-end { font: 500 11px sans-serif; fill: ${t.inkFaint}; }
28526
+ .sx-matrix-quad-annot { font: 600 13px sans-serif; fill: ${t.inkMuted}; opacity: 0.75; }
28527
+ .sx-matrix-quad-desc { font: 400 10.5px sans-serif; fill: ${t.inkFaint}; opacity: 0.85; }
28528
+ .sx-matrix-corr-header { font: 600 11.5px sans-serif; fill: ${t.ink}; text-anchor: middle; }
28529
+ .sx-matrix-corr-rowlabel { font: 500 11.5px sans-serif; fill: ${t.ink}; text-anchor: end; dominant-baseline: central; }
28530
+ .sx-matrix-corr-margin { font: 500 11px sans-serif; fill: ${t.inkMuted}; text-anchor: middle; dominant-baseline: central; }
28531
+ .sx-matrix-corr-margin-best { font: 700 11.5px sans-serif; fill: ${t.inkStrong}; text-anchor: middle; dominant-baseline: central; }
28532
+ .sx-matrix-corr-grid { stroke: ${t.grid}; stroke-width: 0.8; fill: none; }
28533
+ .sx-matrix-corr-rowbg-a { fill: ${t.surfaceTint}; }
28534
+ .sx-matrix-corr-rowbg-b { fill: ${t.surface}; }
28535
+ .sx-matrix-cell-label { font: 500 12px sans-serif; fill: ${t.ink}; text-anchor: middle; }
28536
+ .sx-matrix-cell-title { font: 600 13px sans-serif; fill: ${t.inkStrong}; }
28537
+ .sx-matrix-cell-subtitle { font: 400 11px sans-serif; fill: ${t.inkFaint}; }
28538
+ .sx-matrix-cell-item { font: 500 12px sans-serif; fill: ${t.ink}; }
28539
+ .sx-matrix-cell-value { font: 600 18px sans-serif; fill: ${t.inkStrong}; text-anchor: middle; }
28491
28540
  .sx-matrix-bubble { stroke-width: 1.5; }
28492
- .sx-matrix-label { font: 500 11px sans-serif; fill: #111827; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
28493
- .sx-matrix-leader { stroke: #94a3b8; stroke-width: 0.6; opacity: 0.7; fill: none; }
28494
- .sx-matrix-legend-text { font: 500 11px sans-serif; fill: #374151; }
28495
- .sx-matrix-offchart { fill: #ea580c; }
28496
- .sx-sipoc-header { font: 700 13px sans-serif; fill: #fff; text-anchor: middle; dominant-baseline: central; }
28497
- .sx-sipoc-headbox { stroke: #fff; stroke-width: 1; }
28498
- .sx-sipoc-cell { fill: #fff; stroke: #cbd5e1; stroke-width: 1; }
28499
- .sx-sipoc-cell-alt { fill: #f8fafc; stroke: #cbd5e1; stroke-width: 1; }
28500
- .sx-sipoc-process { fill: #eff6ff; stroke: #cbd5e1; stroke-width: 1; }
28501
- .sx-sipoc-item { font: 500 12px sans-serif; fill: #1f2937; text-anchor: middle; dominant-baseline: central; }
28502
- .sx-sipoc-step { font: 600 12px sans-serif; fill: #1e3a8a; text-anchor: middle; dominant-baseline: central; }
28503
- .sx-qfd-grid { stroke: #cbd5e1; stroke-width: 1; fill: none; }
28504
- .sx-qfd-cellbg { fill: #fff; }
28505
- .sx-qfd-cellbg-alt { fill: #f8fafc; }
28506
- .sx-qfd-what { font: 500 12px sans-serif; fill: #1f2937; text-anchor: end; dominant-baseline: central; }
28507
- .sx-qfd-how { font: 500 11.5px sans-serif; fill: #1f2937; }
28508
- .sx-qfd-weight { font: 600 12px sans-serif; fill: #111; text-anchor: middle; dominant-baseline: central; }
28509
- .sx-qfd-weight-head { font: 600 10px sans-serif; fill: #475569; text-anchor: middle; dominant-baseline: central; }
28510
- .sx-qfd-rel-strong { fill: #2563eb; }
28511
- .sx-qfd-rel-medium { fill: #93c5fd; stroke: #2563eb; stroke-width: 1.4; }
28512
- .sx-qfd-rel-weak { fill: none; stroke: #2563eb; stroke-width: 1.4; }
28513
- .sx-qfd-roof-cell { fill: #f8fafc; stroke: #94a3b8; stroke-width: 0.8; }
28514
- .sx-qfd-roof-cell-filled { fill: #eef2ff; stroke: #64748b; stroke-width: 0.9; }
28541
+ .sx-matrix-label { font: 500 11px sans-serif; fill: ${t.inkStrong}; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
28542
+ .sx-matrix-leader { stroke: ${t.gridStrong}; stroke-width: 0.6; opacity: 0.7; fill: none; }
28543
+ .sx-matrix-legend-text { font: 500 11px sans-serif; fill: ${t.inkMuted}; }
28544
+ .sx-matrix-offchart { fill: ${t.warnDeep}; }
28545
+ .sx-sipoc-header { font: 700 13px sans-serif; fill: ${t.onHeader}; text-anchor: middle; dominant-baseline: central; }
28546
+ .sx-sipoc-headbox { stroke: ${t.surface}; stroke-width: 1; }
28547
+ .sx-sipoc-cell { fill: ${t.surface}; stroke: ${t.gridMid}; stroke-width: 1; }
28548
+ .sx-sipoc-cell-alt { fill: ${t.surfaceAlt}; stroke: ${t.gridMid}; stroke-width: 1; }
28549
+ .sx-sipoc-process { fill: ${t.accentTint}; stroke: ${t.gridMid}; stroke-width: 1; }
28550
+ .sx-sipoc-item { font: 500 12px sans-serif; fill: ${t.ink}; text-anchor: middle; dominant-baseline: central; }
28551
+ .sx-sipoc-step { font: 600 12px sans-serif; fill: ${t.accentDeep}; text-anchor: middle; dominant-baseline: central; }
28552
+ .sx-qfd-grid { stroke: ${t.gridMid}; stroke-width: 1; fill: none; }
28553
+ .sx-qfd-cellbg { fill: ${t.surface}; }
28554
+ .sx-qfd-cellbg-alt { fill: ${t.surfaceAlt}; }
28555
+ .sx-qfd-what { font: 500 12px sans-serif; fill: ${t.ink}; text-anchor: end; dominant-baseline: central; }
28556
+ .sx-qfd-how { font: 500 11.5px sans-serif; fill: ${t.ink}; }
28557
+ .sx-qfd-weight { font: 600 12px sans-serif; fill: ${t.inkStrong}; text-anchor: middle; dominant-baseline: central; }
28558
+ .sx-qfd-weight-head { font: 600 10px sans-serif; fill: ${t.inkMuted}; text-anchor: middle; dominant-baseline: central; }
28559
+ .sx-qfd-rel-strong { fill: ${t.accent}; }
28560
+ .sx-qfd-rel-medium { fill: ${t.accentSoft}; stroke: ${t.accent}; stroke-width: 1.4; }
28561
+ .sx-qfd-rel-weak { fill: none; stroke: ${t.accent}; stroke-width: 1.4; }
28562
+ .sx-qfd-roof-cell { fill: ${t.surfaceAlt}; stroke: ${t.gridStrong}; stroke-width: 0.8; }
28563
+ .sx-qfd-roof-cell-filled { fill: ${t.roofFilled}; stroke: ${t.inkFaint}; stroke-width: 0.9; }
28515
28564
  .sx-qfd-corr { font: 700 13px sans-serif; text-anchor: middle; dominant-baseline: central; }
28516
- .sx-qfd-corr-strong-pos { fill: #15803d; }
28517
- .sx-qfd-corr-pos { fill: #16a34a; }
28518
- .sx-qfd-corr-neg { fill: #dc2626; }
28519
- .sx-qfd-corr-strong-neg { fill: #b91c1c; }
28520
- .sx-qfd-imp-band { fill: #eff6ff; stroke: #cbd5e1; stroke-width: 1; }
28521
- .sx-qfd-imp-head { font: 600 11px sans-serif; fill: #1e3a8a; text-anchor: end; dominant-baseline: central; }
28522
- .sx-qfd-imp-value { font: 700 13px sans-serif; fill: #1e3a8a; text-anchor: middle; dominant-baseline: central; }
28523
- .sx-qfd-imp-value-top { font: 800 14px sans-serif; fill: #dc2626; text-anchor: middle; dominant-baseline: central; }
28524
- .sx-qfd-dir { font: 700 13px sans-serif; fill: #475569; text-anchor: middle; dominant-baseline: central; }
28525
- .sx-punnett-corner { fill: #f1f5f9; stroke: #94a3b8; stroke-width: 1; }
28526
- .sx-punnett-cornerline { stroke: #cbd5e1; stroke-width: 1; }
28527
- .sx-punnett-corner-p1 { font: 600 11px sans-serif; fill: #1e3a8a; dominant-baseline: hanging; }
28528
- .sx-punnett-corner-p2 { font: 600 11px sans-serif; fill: #1e3a8a; }
28529
- .sx-punnett-header { fill: #e2e8f0; stroke: #94a3b8; stroke-width: 1; }
28530
- .sx-punnett-gamete { font: 700 14px ui-monospace, "SF Mono", Menlo, monospace; fill: #0f172a; text-anchor: middle; dominant-baseline: central; }
28531
- .sx-punnett-cell { stroke: #94a3b8; stroke-width: 1; }
28532
- .sx-punnett-genotype { font: 700 15px ui-monospace, "SF Mono", Menlo, monospace; fill: #0f172a; text-anchor: middle; dominant-baseline: central; }
28533
- .sx-punnett-footer-head { font: 700 13px sans-serif; fill: #111; }
28534
- .sx-punnett-legend { font: 500 12.5px sans-serif; fill: #1f2937; dominant-baseline: central; }
28535
- .sx-punnett-geno-ratio { font: 500 12px sans-serif; fill: #475569; }
28536
- .sx-punnett-hint { font: 500 13px sans-serif; fill: #64748b; text-anchor: middle; }
28565
+ .sx-qfd-corr-strong-pos { fill: ${t.positiveDeep}; }
28566
+ .sx-qfd-corr-pos { fill: ${t.positive}; }
28567
+ .sx-qfd-corr-neg { fill: ${t.negative}; }
28568
+ .sx-qfd-corr-strong-neg { fill: ${t.negativeDeep}; }
28569
+ .sx-qfd-imp-band { fill: ${t.accentTint}; stroke: ${t.gridMid}; stroke-width: 1; }
28570
+ .sx-qfd-imp-head { font: 600 11px sans-serif; fill: ${t.accentDeep}; text-anchor: end; dominant-baseline: central; }
28571
+ .sx-qfd-imp-value { font: 700 13px sans-serif; fill: ${t.accentDeep}; text-anchor: middle; dominant-baseline: central; }
28572
+ .sx-qfd-imp-value-top { font: 800 14px sans-serif; fill: ${t.negative}; text-anchor: middle; dominant-baseline: central; }
28573
+ .sx-qfd-dir { font: 700 13px sans-serif; fill: ${t.inkMuted}; text-anchor: middle; dominant-baseline: central; }
28574
+ .sx-punnett-corner { fill: ${t.cornerFill}; stroke: ${t.gridStrong}; stroke-width: 1; }
28575
+ .sx-punnett-cornerline { stroke: ${t.gridMid}; stroke-width: 1; }
28576
+ .sx-punnett-corner-p1 { font: 600 11px sans-serif; fill: ${t.accentDeep}; dominant-baseline: hanging; }
28577
+ .sx-punnett-corner-p2 { font: 600 11px sans-serif; fill: ${t.accentDeep}; }
28578
+ .sx-punnett-header { fill: ${t.headerFill}; stroke: ${t.gridStrong}; stroke-width: 1; }
28579
+ .sx-punnett-gamete { font: 700 14px ui-monospace, "SF Mono", Menlo, monospace; fill: ${t.inkStrong}; text-anchor: middle; dominant-baseline: central; }
28580
+ .sx-punnett-cell { stroke: ${t.gridStrong}; stroke-width: 1; }
28581
+ .sx-punnett-genotype { font: 700 15px ui-monospace, "SF Mono", Menlo, monospace; fill: ${t.inkStrong}; text-anchor: middle; dominant-baseline: central; }
28582
+ .sx-punnett-footer-head { font: 700 13px sans-serif; fill: ${t.inkStrong}; }
28583
+ .sx-punnett-legend { font: 500 12.5px sans-serif; fill: ${t.ink}; dominant-baseline: central; }
28584
+ .sx-punnett-geno-ratio { font: 500 12px sans-serif; fill: ${t.inkMuted}; }
28585
+ .sx-punnett-hint { font: 500 13px sans-serif; fill: ${t.inkFaint}; text-anchor: middle; }
28537
28586
  `.trim();
28538
- function axisArrow() {
28587
+ }
28588
+ function axisArrow(t) {
28539
28589
  return el(
28540
28590
  "marker",
28541
28591
  {
@@ -28547,7 +28597,7 @@ function axisArrow() {
28547
28597
  markerHeight: 8,
28548
28598
  orient: "auto-start-reverse"
28549
28599
  },
28550
- [el("path", { d: "M0,0 L10,5 L0,10 z", fill: "#374151" })]
28600
+ [el("path", { d: "M0,0 L10,5 L0,10 z", fill: t.border })]
28551
28601
  );
28552
28602
  }
28553
28603
  function bubbleFill(p, categories) {
@@ -29334,7 +29384,8 @@ function wrapToLines(textStr, maxChars, maxLines) {
29334
29384
  kept[maxLines - 1] = kept[maxLines - 1].replace(/\s+\S*$/, "") + "\u2026";
29335
29385
  return kept;
29336
29386
  }
29337
- function renderSipocAST(ast) {
29387
+ function renderSipocAST(ast, config) {
29388
+ const t = resolveMatrixTheme(config?.theme ?? "default");
29338
29389
  const sipoc = ast.sipoc ?? { suppliers: [], inputs: [], process: [], outputs: [], customers: [] };
29339
29390
  const lay = layoutSipoc(ast);
29340
29391
  const nodes = [];
@@ -29416,7 +29467,7 @@ function renderSipocAST(ast) {
29416
29467
  desc(
29417
29468
  `SIPOC scoping table \u2014 ${sipoc.suppliers.length} supplier(s), ${sipoc.inputs.length} input(s), ${sipoc.process.length} process step(s), ${sipoc.outputs.length} output(s), ${sipoc.customers.length} customer(s)`
29418
29469
  ),
29419
- defs([el("style", {}, CSS2)]),
29470
+ defs([el("style", {}, buildMatrixCss(t))]),
29420
29471
  ...nodes
29421
29472
  ]
29422
29473
  );
@@ -29455,7 +29506,8 @@ function renderQfdRelationshipSymbol(strength, cx, cy, r6) {
29455
29506
  class: "sx-qfd-rel-weak"
29456
29507
  });
29457
29508
  }
29458
- function renderQfdAST(ast) {
29509
+ function renderQfdAST(ast, config) {
29510
+ const t = resolveMatrixTheme(config?.theme ?? "default");
29459
29511
  const qfd = ast.qfd ?? { whats: [], hows: [], relationships: [], roof: [], normalize: false };
29460
29512
  const lay = layoutQfd(ast);
29461
29513
  const importance = computeQfdImportance(qfd);
@@ -29645,7 +29697,7 @@ function renderQfdAST(ast) {
29645
29697
  desc(
29646
29698
  `QFD House of Quality \u2014 ${qfd.whats.length} customer requirement(s), ${qfd.hows.length} engineering characteristic(s), ${qfd.relationships.length} relationship(s); technical importance computed per column`
29647
29699
  ),
29648
- defs([el("style", {}, CSS2)]),
29700
+ defs([el("style", {}, buildMatrixCss(t))]),
29649
29701
  ...nodes
29650
29702
  ]
29651
29703
  );
@@ -29659,7 +29711,8 @@ function genotypeText(parent, genes) {
29659
29711
  return a === dom ? a + b : b === dom ? b + a : a + b;
29660
29712
  }).join("");
29661
29713
  }
29662
- function renderPunnettAST(ast) {
29714
+ function renderPunnettAST(ast, config) {
29715
+ const t = resolveMatrixTheme(config?.theme ?? "default");
29663
29716
  const pd = ast.punnett;
29664
29717
  const lay = layoutPunnett(ast);
29665
29718
  const svgWrap = (body, descText2) => svgRoot(
@@ -29675,7 +29728,7 @@ function renderPunnettAST(ast) {
29675
29728
  [
29676
29729
  title(ast.title ? `Punnett square \u2014 ${escapeXml(ast.title)}` : "Punnett square"),
29677
29730
  desc(descText2),
29678
- defs([el("style", {}, CSS2)]),
29731
+ defs([el("style", {}, buildMatrixCss(t))]),
29679
29732
  ...body
29680
29733
  ]
29681
29734
  );
@@ -29770,10 +29823,11 @@ function renderPunnettAST(ast) {
29770
29823
  const descText = `Punnett square \u2014 ${pd.genes.length === 1 ? "monohybrid" : pd.genes.length === 2 ? "dihybrid" : `${pd.genes.length}-gene`} cross ${genotypeText(pd.parent1, pd.genes)} \xD7 ${genotypeText(pd.parent2, pd.genes)}; phenotype ratio ${footer.phenotypeRatio}`;
29771
29824
  return svgWrap(nodes, descText);
29772
29825
  }
29773
- function renderMatrixAST(ast) {
29774
- if (ast.mode === "sipoc") return renderSipocAST(ast);
29775
- if (ast.mode === "qfd") return renderQfdAST(ast);
29776
- if (ast.mode === "punnett") return renderPunnettAST(ast);
29826
+ function renderMatrixAST(ast, config) {
29827
+ if (ast.mode === "sipoc") return renderSipocAST(ast, config);
29828
+ if (ast.mode === "qfd") return renderQfdAST(ast, config);
29829
+ if (ast.mode === "punnett") return renderPunnettAST(ast, config);
29830
+ const t = resolveMatrixTheme(config?.theme ?? "default");
29777
29831
  const lay = layoutMatrix(ast);
29778
29832
  const needsLegendSpace = lay.categories.length > 0 || ast.mode === "correlation";
29779
29833
  const extraWidth = needsLegendSpace && lay.plot.x0 + lay.plot.w + 140 > lay.canvasWidth ? 160 : 0;
@@ -29807,14 +29861,14 @@ function renderMatrixAST(ast) {
29807
29861
  desc(
29808
29862
  `Matrix diagram${ast.template ? ` (${ast.template} template)` : ""}, ${ast.mode} mode, ${ast.points.length} point(s)`
29809
29863
  ),
29810
- defs([el("style", {}, CSS2), axisArrow()]),
29864
+ defs([el("style", {}, buildMatrixCss(t)), axisArrow(t)]),
29811
29865
  ...body
29812
29866
  ]
29813
29867
  );
29814
29868
  }
29815
- function renderMatrix(text2) {
29869
+ function renderMatrix(text2, config) {
29816
29870
  const ast = parseMatrix(text2);
29817
- return renderMatrixAST(ast);
29871
+ return renderMatrixAST(ast, config);
29818
29872
  }
29819
29873
 
29820
29874
  // src/diagrams/matrix/index.ts
@@ -29825,8 +29879,8 @@ var matrix = {
29825
29879
  return first.startsWith("matrix");
29826
29880
  },
29827
29881
  parse: parseMatrix,
29828
- render(text2) {
29829
- return renderMatrix(text2);
29882
+ render(text2, config) {
29883
+ return renderMatrix(text2, config);
29830
29884
  }
29831
29885
  };
29832
29886
 
@@ -32026,7 +32080,7 @@ var WIRE_COLOR_MAP = {
32026
32080
  function buildCss12(t) {
32027
32081
  return `
32028
32082
  .lt-bb { font-family: system-ui, -apple-system, sans-serif; }
32029
- .lt-bb-title { font: 600 16px sans-serif; fill: ${t.text}; }
32083
+ .lt-bb-title { font: 700 16px sans-serif; fill: ${t.text}; }
32030
32084
  .lt-bb-substrate { fill: #e7d8b6; stroke: #b08c4f; stroke-width: 1.5; }
32031
32085
  .lt-bb-rail-pos { fill: #fde2e2; stroke: #dc2626; stroke-width: 0.6; }
32032
32086
  .lt-bb-rail-neg { fill: #dde7fa; stroke: #2563eb; stroke-width: 0.6; }
@@ -32173,7 +32227,7 @@ function renderBreadboardLayout(layout, config) {
32173
32227
  const theme = resolveBaseTheme(config?.theme ?? "default");
32174
32228
  const css = buildCss12(theme);
32175
32229
  const titleStr = layout.ast.title ?? "Breadboard";
32176
- const titleNode = layout.ast.title ? text({ x: BB_CONST.MARGIN, y: 22, class: "lt-bb-title" }, layout.ast.title) : "";
32230
+ const titleNode = layout.ast.title ? text({ x: layout.width / 2, y: 22, class: "lt-bb-title", "text-anchor": "middle" }, layout.ast.title) : "";
32177
32231
  const substrate = renderSubstrate(layout.substrate);
32178
32232
  const parts = layout.parts.map(renderPart).join("\n");
32179
32233
  const wires = layout.wires.map(renderWire).join("\n");
@@ -33036,26 +33090,19 @@ function routeMessageFlow(f, objCenter, poolByLabel) {
33036
33090
 
33037
33091
  // src/diagrams/bpmn/renderer.ts
33038
33092
  var FONT_FAMILY = "system-ui, -apple-system, 'Segoe UI', sans-serif";
33039
- var STROKE = "#1f2937";
33040
- var STROKE_LIGHT = "#94a3b8";
33041
- var POOL_FILL = "#ffffff";
33042
- var LANE_FILL = "#fafbfc";
33043
- var TASK_FILL = "#ffffff";
33044
- var GATEWAY_FILL = "#fffbeb";
33045
- var EVENT_FILL = "#ffffff";
33046
- var LABEL_BAND_FILL = "#f1f5f9";
33047
33093
  function renderBpmn(textInput, config) {
33048
33094
  const ast = parseBpmn(textInput);
33049
33095
  const layout = layoutBpmn(ast);
33050
- return renderBpmnLayout(layout);
33096
+ return renderBpmnLayout(layout, config);
33051
33097
  }
33052
- function renderBpmnLayout(layout, _config) {
33098
+ function renderBpmnLayout(layout, config) {
33053
33099
  const { width, height, ast } = layout;
33100
+ const t = resolveBpmnTheme(config?.theme ?? "default");
33054
33101
  const out = [];
33055
33102
  out.push(title(ast.title ?? "BPMN diagram"));
33056
33103
  out.push(desc(`BPMN ${ast.direction} \u2014 ${ast.pools.length} pool(s), ${layout.objects.length} flow object(s).`));
33057
- out.push(buildDefs());
33058
- for (const pl2 of layout.pools) out.push(renderPool(pl2));
33104
+ out.push(buildDefs(t));
33105
+ for (const pl2 of layout.pools) out.push(renderPool(pl2, t));
33059
33106
  for (const lan of layout.lanes) {
33060
33107
  out.push(
33061
33108
  group({ class: "schematex-bpmn-lane" }, [
@@ -33064,8 +33111,8 @@ function renderBpmnLayout(layout, _config) {
33064
33111
  y: lan.y,
33065
33112
  width: lan.width - lan.labelHeight,
33066
33113
  height: lan.height,
33067
- fill: LANE_FILL,
33068
- stroke: STROKE,
33114
+ fill: t.laneFill,
33115
+ stroke: t.bpmnStroke,
33069
33116
  "stroke-width": 1
33070
33117
  }),
33071
33118
  rect({
@@ -33073,8 +33120,8 @@ function renderBpmnLayout(layout, _config) {
33073
33120
  y: lan.y,
33074
33121
  width: lan.labelHeight,
33075
33122
  height: lan.height,
33076
- fill: LABEL_BAND_FILL,
33077
- stroke: STROKE,
33123
+ fill: t.labelBandFill,
33124
+ stroke: t.bpmnStroke,
33078
33125
  "stroke-width": 1
33079
33126
  }),
33080
33127
  text(
@@ -33086,15 +33133,15 @@ function renderBpmnLayout(layout, _config) {
33086
33133
  "dominant-baseline": "middle",
33087
33134
  "font-family": FONT_FAMILY,
33088
33135
  "font-size": 12,
33089
- fill: STROKE
33136
+ fill: t.bpmnText
33090
33137
  },
33091
33138
  lan.lane.label
33092
33139
  )
33093
33140
  ])
33094
33141
  );
33095
33142
  }
33096
- for (const fl of layout.flows) out.push(renderFlow2(fl));
33097
- for (const ol of layout.objects) out.push(renderObject(ol));
33143
+ for (const fl of layout.flows) out.push(renderFlow2(fl, t));
33144
+ for (const ol of layout.objects) out.push(renderObject(ol, t));
33098
33145
  return svgRoot(
33099
33146
  {
33100
33147
  width,
@@ -33105,7 +33152,7 @@ function renderBpmnLayout(layout, _config) {
33105
33152
  out
33106
33153
  );
33107
33154
  }
33108
- function buildDefs() {
33155
+ function buildDefs(t) {
33109
33156
  return defs([
33110
33157
  // Sequence flow — filled triangle.
33111
33158
  el(
@@ -33122,7 +33169,7 @@ function buildDefs() {
33122
33169
  [
33123
33170
  el("path", {
33124
33171
  d: "M 0 0 L 10 5 L 0 10 z",
33125
- fill: STROKE
33172
+ fill: t.flowStroke
33126
33173
  })
33127
33174
  ]
33128
33175
  ),
@@ -33141,8 +33188,8 @@ function buildDefs() {
33141
33188
  [
33142
33189
  el("path", {
33143
33190
  d: "M 0 0 L 10 5 L 0 10 z",
33144
- fill: "#ffffff",
33145
- stroke: STROKE,
33191
+ fill: t.poolFill,
33192
+ stroke: t.msgFlowStroke,
33146
33193
  "stroke-width": 1
33147
33194
  })
33148
33195
  ]
@@ -33160,12 +33207,12 @@ function buildDefs() {
33160
33207
  orient: "auto"
33161
33208
  },
33162
33209
  [
33163
- el("circle", { cx: 5, cy: 5, r: 3, fill: "#ffffff", stroke: STROKE })
33210
+ el("circle", { cx: 5, cy: 5, r: 3, fill: t.poolFill, stroke: t.msgFlowStroke })
33164
33211
  ]
33165
33212
  )
33166
33213
  ]);
33167
33214
  }
33168
- function renderPool(pl2) {
33215
+ function renderPool(pl2, t) {
33169
33216
  const labelCx = pl2.labelX + pl2.labelWidth / 2;
33170
33217
  const labelCy = pl2.labelY + pl2.height / 2;
33171
33218
  if (pl2.pool.blackbox) {
@@ -33175,8 +33222,8 @@ function renderPool(pl2) {
33175
33222
  y: pl2.y,
33176
33223
  width: pl2.width,
33177
33224
  height: pl2.height,
33178
- fill: POOL_FILL,
33179
- stroke: STROKE,
33225
+ fill: t.poolFill,
33226
+ stroke: t.bpmnStroke,
33180
33227
  "stroke-width": 1.5
33181
33228
  }),
33182
33229
  rect({
@@ -33184,8 +33231,8 @@ function renderPool(pl2) {
33184
33231
  y: pl2.y,
33185
33232
  width: pl2.labelWidth,
33186
33233
  height: pl2.height,
33187
- fill: LABEL_BAND_FILL,
33188
- stroke: STROKE,
33234
+ fill: t.labelBandFill,
33235
+ stroke: t.bpmnStroke,
33189
33236
  "stroke-width": 1
33190
33237
  }),
33191
33238
  text(
@@ -33198,7 +33245,7 @@ function renderPool(pl2) {
33198
33245
  "font-family": FONT_FAMILY,
33199
33246
  "font-size": 13,
33200
33247
  "font-weight": "bold",
33201
- fill: STROKE
33248
+ fill: t.bpmnText
33202
33249
  },
33203
33250
  pl2.pool.label
33204
33251
  )
@@ -33210,8 +33257,8 @@ function renderPool(pl2) {
33210
33257
  y: pl2.y,
33211
33258
  width: pl2.width,
33212
33259
  height: pl2.height,
33213
- fill: POOL_FILL,
33214
- stroke: STROKE,
33260
+ fill: t.poolFill,
33261
+ stroke: t.bpmnStroke,
33215
33262
  "stroke-width": 1.5
33216
33263
  }),
33217
33264
  rect({
@@ -33219,8 +33266,8 @@ function renderPool(pl2) {
33219
33266
  y: pl2.y,
33220
33267
  width: pl2.labelWidth,
33221
33268
  height: pl2.height,
33222
- fill: LABEL_BAND_FILL,
33223
- stroke: STROKE,
33269
+ fill: t.labelBandFill,
33270
+ stroke: t.bpmnStroke,
33224
33271
  "stroke-width": 1
33225
33272
  }),
33226
33273
  text(
@@ -33233,19 +33280,19 @@ function renderPool(pl2) {
33233
33280
  "font-family": FONT_FAMILY,
33234
33281
  "font-size": 13,
33235
33282
  "font-weight": "bold",
33236
- fill: STROKE
33283
+ fill: t.bpmnText
33237
33284
  },
33238
33285
  pl2.pool.label
33239
33286
  )
33240
33287
  ]);
33241
33288
  }
33242
- function renderObject(ol) {
33289
+ function renderObject(ol, t) {
33243
33290
  const o = ol.obj;
33244
- if ("gatewayKind" in o) return renderGateway(ol);
33245
- if ("marker" in o) return renderActivity(ol);
33246
- return renderEvent2(ol);
33291
+ if ("gatewayKind" in o) return renderGateway(ol, t);
33292
+ if ("marker" in o) return renderActivity(ol, t);
33293
+ return renderEvent2(ol, t);
33247
33294
  }
33248
- function renderActivity(ol) {
33295
+ function renderActivity(ol, t) {
33249
33296
  const a = ol.obj;
33250
33297
  const isSubproc = a.kind === "subprocess-collapsed";
33251
33298
  const cx = ol.x + ol.width / 2;
@@ -33258,8 +33305,8 @@ function renderActivity(ol) {
33258
33305
  height: ol.height,
33259
33306
  rx: 10,
33260
33307
  ry: 10,
33261
- fill: TASK_FILL,
33262
- stroke: STROKE,
33308
+ fill: t.taskFill,
33309
+ stroke: t.taskStroke,
33263
33310
  "stroke-width": 1.5
33264
33311
  }),
33265
33312
  multilineText(
@@ -33270,14 +33317,14 @@ function renderActivity(ol) {
33270
33317
  "dominant-baseline": "middle",
33271
33318
  "font-family": FONT_FAMILY,
33272
33319
  "font-size": 12,
33273
- fill: STROKE
33320
+ fill: t.bpmnText
33274
33321
  },
33275
33322
  a.label,
33276
33323
  14
33277
33324
  )
33278
33325
  ];
33279
33326
  if (a.kind === "task" && a.marker !== "abstract") {
33280
- children.push(taskMarker(ol.x + 6, ol.y + 6, a.marker));
33327
+ children.push(taskMarker(ol.x + 6, ol.y + 6, a.marker, t));
33281
33328
  }
33282
33329
  if (isSubproc) {
33283
33330
  const mx = cx;
@@ -33289,53 +33336,53 @@ function renderActivity(ol) {
33289
33336
  width: 12,
33290
33337
  height: 12,
33291
33338
  fill: "none",
33292
- stroke: STROKE,
33339
+ stroke: t.bpmnStroke,
33293
33340
  "stroke-width": 1
33294
33341
  }),
33295
33342
  el("path", {
33296
33343
  d: `M ${mx - 4} ${my} L ${mx + 4} ${my} M ${mx} ${my - 4} L ${mx} ${my + 4}`,
33297
- stroke: STROKE,
33344
+ stroke: t.bpmnStroke,
33298
33345
  "stroke-width": 1
33299
33346
  })
33300
33347
  );
33301
33348
  }
33302
33349
  return group({ class: `schematex-bpmn-task marker-${a.marker}` }, children);
33303
33350
  }
33304
- function taskMarker(x, y, marker) {
33351
+ function taskMarker(x, y, marker, t) {
33305
33352
  const cx = x + 7;
33306
33353
  const cy = y + 7;
33307
33354
  if (marker === "user") {
33308
33355
  return el("g", { class: "marker-user" }, [
33309
- el("circle", { cx, cy: cy - 1, r: 2.5, fill: "none", stroke: STROKE, "stroke-width": 1 }),
33356
+ el("circle", { cx, cy: cy - 1, r: 2.5, fill: "none", stroke: t.bpmnStroke, "stroke-width": 1 }),
33310
33357
  el("path", {
33311
33358
  d: `M ${cx - 5} ${cy + 6} Q ${cx} ${cy + 1} ${cx + 5} ${cy + 6}`,
33312
33359
  fill: "none",
33313
- stroke: STROKE,
33360
+ stroke: t.bpmnStroke,
33314
33361
  "stroke-width": 1
33315
33362
  })
33316
33363
  ]);
33317
33364
  }
33318
33365
  if (marker === "service") {
33319
33366
  return el("g", { class: "marker-service" }, [
33320
- el("circle", { cx, cy, r: 4, fill: "none", stroke: STROKE, "stroke-width": 1 }),
33321
- el("circle", { cx, cy, r: 1.5, fill: STROKE }),
33367
+ el("circle", { cx, cy, r: 4, fill: "none", stroke: t.bpmnStroke, "stroke-width": 1 }),
33368
+ el("circle", { cx, cy, r: 1.5, fill: t.bpmnStroke }),
33322
33369
  el("path", {
33323
33370
  d: `M ${cx} ${cy - 6} L ${cx} ${cy - 4} M ${cx} ${cy + 4} L ${cx} ${cy + 6} M ${cx - 6} ${cy} L ${cx - 4} ${cy} M ${cx + 4} ${cy} L ${cx + 6} ${cy}`,
33324
- stroke: STROKE,
33371
+ stroke: t.bpmnStroke,
33325
33372
  "stroke-width": 1
33326
33373
  })
33327
33374
  ]);
33328
33375
  }
33329
33376
  if (marker === "send") {
33330
33377
  return el("g", { class: "marker-send" }, [
33331
- el("rect", { x: cx - 5, y: cy - 3, width: 10, height: 7, fill: STROKE }),
33332
- el("path", { d: `M ${cx - 5} ${cy - 3} L ${cx} ${cy + 1} L ${cx + 5} ${cy - 3}`, stroke: "#ffffff", "stroke-width": 1, fill: "none" })
33378
+ el("rect", { x: cx - 5, y: cy - 3, width: 10, height: 7, fill: t.bpmnStroke }),
33379
+ el("path", { d: `M ${cx - 5} ${cy - 3} L ${cx} ${cy + 1} L ${cx + 5} ${cy - 3}`, stroke: t.poolFill, "stroke-width": 1, fill: "none" })
33333
33380
  ]);
33334
33381
  }
33335
33382
  if (marker === "receive") {
33336
33383
  return el("g", { class: "marker-receive" }, [
33337
- el("rect", { x: cx - 5, y: cy - 3, width: 10, height: 7, fill: "none", stroke: STROKE, "stroke-width": 1 }),
33338
- el("path", { d: `M ${cx - 5} ${cy - 3} L ${cx} ${cy + 1} L ${cx + 5} ${cy - 3}`, stroke: STROKE, "stroke-width": 1, fill: "none" })
33384
+ el("rect", { x: cx - 5, y: cy - 3, width: 10, height: 7, fill: "none", stroke: t.bpmnStroke, "stroke-width": 1 }),
33385
+ el("path", { d: `M ${cx - 5} ${cy - 3} L ${cx} ${cy + 1} L ${cx + 5} ${cy - 3}`, stroke: t.bpmnStroke, "stroke-width": 1, fill: "none" })
33339
33386
  ]);
33340
33387
  }
33341
33388
  if (marker === "manual") {
@@ -33343,7 +33390,7 @@ function taskMarker(x, y, marker) {
33343
33390
  el("path", {
33344
33391
  d: `M ${cx - 3} ${cy + 4} L ${cx - 3} ${cy} L ${cx - 1.5} ${cy} L ${cx - 1.5} ${cy - 4} L ${cx} ${cy - 4} L ${cx} ${cy} L ${cx + 1.5} ${cy} L ${cx + 1.5} ${cy + 1} L ${cx + 3} ${cy + 1} L ${cx + 3} ${cy + 4} z`,
33345
33392
  fill: "none",
33346
- stroke: STROKE,
33393
+ stroke: t.bpmnStroke,
33347
33394
  "stroke-width": 1
33348
33395
  })
33349
33396
  ]);
@@ -33353,19 +33400,19 @@ function taskMarker(x, y, marker) {
33353
33400
  el("path", {
33354
33401
  d: `M ${cx - 4} ${cy - 5} Q ${cx - 6} ${cy} ${cx - 4} ${cy + 5} L ${cx + 4} ${cy + 5} Q ${cx + 2} ${cy} ${cx + 4} ${cy - 5} z`,
33355
33402
  fill: "none",
33356
- stroke: STROKE,
33403
+ stroke: t.bpmnStroke,
33357
33404
  "stroke-width": 1
33358
33405
  }),
33359
33406
  el("path", {
33360
33407
  d: `M ${cx - 2} ${cy - 2} L ${cx + 2} ${cy - 2} M ${cx - 2} ${cy} L ${cx + 2} ${cy} M ${cx - 2} ${cy + 2} L ${cx + 2} ${cy + 2}`,
33361
- stroke: STROKE,
33408
+ stroke: t.bpmnStroke,
33362
33409
  "stroke-width": 0.8
33363
33410
  })
33364
33411
  ]);
33365
33412
  }
33366
33413
  return "";
33367
33414
  }
33368
- function renderGateway(ol) {
33415
+ function renderGateway(ol, t) {
33369
33416
  const g = ol.obj;
33370
33417
  const cx = ol.x + ol.width / 2;
33371
33418
  const cy = ol.y + ol.height / 2;
@@ -33377,7 +33424,7 @@ function renderGateway(ol) {
33377
33424
  inner.push(
33378
33425
  el("path", {
33379
33426
  d: `M ${cx - a} ${cy - a} L ${cx + a} ${cy + a} M ${cx + a} ${cy - a} L ${cx - a} ${cy + a}`,
33380
- stroke: STROKE,
33427
+ stroke: t.gatewayGlyph,
33381
33428
  "stroke-width": 2.5,
33382
33429
  "stroke-linecap": "round"
33383
33430
  })
@@ -33387,7 +33434,7 @@ function renderGateway(ol) {
33387
33434
  inner.push(
33388
33435
  el("path", {
33389
33436
  d: `M ${cx - a} ${cy} L ${cx + a} ${cy} M ${cx} ${cy - a} L ${cx} ${cy + a}`,
33390
- stroke: STROKE,
33437
+ stroke: t.gatewayGlyph,
33391
33438
  "stroke-width": 2.5,
33392
33439
  "stroke-linecap": "round"
33393
33440
  })
@@ -33399,7 +33446,7 @@ function renderGateway(ol) {
33399
33446
  cy,
33400
33447
  r: r6 * 0.45,
33401
33448
  fill: "none",
33402
- stroke: STROKE,
33449
+ stroke: t.gatewayGlyph,
33403
33450
  "stroke-width": 2
33404
33451
  })
33405
33452
  );
@@ -33410,7 +33457,7 @@ function renderGateway(ol) {
33410
33457
  cy,
33411
33458
  r: r6 * 0.55,
33412
33459
  fill: "none",
33413
- stroke: STROKE,
33460
+ stroke: t.gatewayGlyph,
33414
33461
  "stroke-width": 1
33415
33462
  })
33416
33463
  );
@@ -33424,7 +33471,7 @@ function renderGateway(ol) {
33424
33471
  el("polygon", {
33425
33472
  points: pts.join(" "),
33426
33473
  fill: "none",
33427
- stroke: STROKE,
33474
+ stroke: t.gatewayGlyph,
33428
33475
  "stroke-width": 1.2
33429
33476
  })
33430
33477
  );
@@ -33437,22 +33484,22 @@ function renderGateway(ol) {
33437
33484
  "text-anchor": "middle",
33438
33485
  "font-family": FONT_FAMILY,
33439
33486
  "font-size": 11,
33440
- fill: STROKE
33487
+ fill: t.bpmnText
33441
33488
  },
33442
33489
  labelStr
33443
33490
  ) : "";
33444
33491
  return group({ class: `schematex-bpmn-gateway kind-${g.gatewayKind}` }, [
33445
33492
  el("polygon", {
33446
33493
  points,
33447
- fill: GATEWAY_FILL,
33448
- stroke: STROKE,
33494
+ fill: t.gatewayFill,
33495
+ stroke: t.gatewayStroke,
33449
33496
  "stroke-width": 1.5
33450
33497
  }),
33451
33498
  ...inner,
33452
33499
  labelEl
33453
33500
  ]);
33454
33501
  }
33455
- function renderEvent2(ol) {
33502
+ function renderEvent2(ol, t) {
33456
33503
  const e = ol.obj;
33457
33504
  const cx = ol.x + ol.width / 2;
33458
33505
  const cy = ol.y + ol.height / 2;
@@ -33460,14 +33507,16 @@ function renderEvent2(ol) {
33460
33507
  const isEnd = e.kind === "end";
33461
33508
  const isIntermediate = e.kind === "intermediate";
33462
33509
  const strokeW = isEnd ? 3 : 1.2;
33510
+ const fill = isEnd ? t.endFill : isIntermediate ? t.intermediateFill : t.startFill;
33511
+ const ring = isEnd ? t.endStroke : isIntermediate ? t.intermediateStroke : t.startStroke;
33463
33512
  const children = [];
33464
33513
  children.push(
33465
33514
  el("circle", {
33466
33515
  cx,
33467
33516
  cy,
33468
33517
  r: r6,
33469
- fill: EVENT_FILL,
33470
- stroke: STROKE,
33518
+ fill,
33519
+ stroke: ring,
33471
33520
  "stroke-width": strokeW
33472
33521
  })
33473
33522
  );
@@ -33478,16 +33527,16 @@ function renderEvent2(ol) {
33478
33527
  cy,
33479
33528
  r: r6 - 3,
33480
33529
  fill: "none",
33481
- stroke: STROKE,
33530
+ stroke: ring,
33482
33531
  "stroke-width": 1.2
33483
33532
  })
33484
33533
  );
33485
33534
  }
33486
33535
  const filled = e.throwCatch === "throw" && (isIntermediate || isEnd);
33487
33536
  if (e.trigger === "message") {
33488
- children.push(messageGlyph(cx, cy, r6 * 0.55, filled));
33537
+ children.push(messageGlyph(cx, cy, r6 * 0.55, filled, t));
33489
33538
  } else if (e.trigger === "timer") {
33490
- children.push(timerGlyph(cx, cy, r6 * 0.55));
33539
+ children.push(timerGlyph(cx, cy, r6 * 0.55, t));
33491
33540
  }
33492
33541
  if (e.label) {
33493
33542
  children.push(
@@ -33498,7 +33547,7 @@ function renderEvent2(ol) {
33498
33547
  "text-anchor": "middle",
33499
33548
  "font-family": FONT_FAMILY,
33500
33549
  "font-size": 11,
33501
- fill: STROKE
33550
+ fill: t.bpmnText
33502
33551
  },
33503
33552
  e.label
33504
33553
  )
@@ -33506,7 +33555,7 @@ function renderEvent2(ol) {
33506
33555
  }
33507
33556
  return group({ class: `schematex-bpmn-event kind-${e.kind} trigger-${e.trigger}` }, children);
33508
33557
  }
33509
- function messageGlyph(cx, cy, size, filled) {
33558
+ function messageGlyph(cx, cy, size, filled, t) {
33510
33559
  const w = size;
33511
33560
  const h = size * 0.7;
33512
33561
  const x = cx - w / 2;
@@ -33517,19 +33566,19 @@ function messageGlyph(cx, cy, size, filled) {
33517
33566
  y,
33518
33567
  width: w,
33519
33568
  height: h,
33520
- fill: filled ? STROKE : "#ffffff",
33521
- stroke: STROKE,
33569
+ fill: filled ? t.bpmnStroke : t.poolFill,
33570
+ stroke: t.bpmnStroke,
33522
33571
  "stroke-width": 1
33523
33572
  }),
33524
33573
  el("path", {
33525
33574
  d: `M ${x} ${y} L ${cx} ${y + h * 0.55} L ${x + w} ${y}`,
33526
- stroke: filled ? "#ffffff" : STROKE,
33575
+ stroke: filled ? t.poolFill : t.bpmnStroke,
33527
33576
  "stroke-width": 1,
33528
33577
  fill: "none"
33529
33578
  })
33530
33579
  ]);
33531
33580
  }
33532
- function timerGlyph(cx, cy, size) {
33581
+ function timerGlyph(cx, cy, size, t) {
33533
33582
  const r6 = size / 2;
33534
33583
  const ticks = [];
33535
33584
  for (let k = 0; k < 12; k++) {
@@ -33541,18 +33590,18 @@ function timerGlyph(cx, cy, size) {
33541
33590
  ticks.push(`M ${t1x} ${t1y} L ${t2x} ${t2y}`);
33542
33591
  }
33543
33592
  return el("g", { class: "trigger-timer" }, [
33544
- el("circle", { cx, cy, r: r6, fill: "none", stroke: STROKE, "stroke-width": 1 }),
33545
- el("path", { d: ticks.join(" "), stroke: STROKE, "stroke-width": 0.8 }),
33593
+ el("circle", { cx, cy, r: r6, fill: "none", stroke: t.bpmnStroke, "stroke-width": 1 }),
33594
+ el("path", { d: ticks.join(" "), stroke: t.bpmnStroke, "stroke-width": 0.8 }),
33546
33595
  // Hands
33547
33596
  el("path", {
33548
33597
  d: `M ${cx} ${cy} L ${cx} ${cy - r6 * 0.7} M ${cx} ${cy} L ${cx + r6 * 0.5} ${cy}`,
33549
- stroke: STROKE,
33598
+ stroke: t.bpmnStroke,
33550
33599
  "stroke-width": 1.2,
33551
33600
  "stroke-linecap": "round"
33552
33601
  })
33553
33602
  ]);
33554
33603
  }
33555
- function renderFlow2(fl) {
33604
+ function renderFlow2(fl, t) {
33556
33605
  const f = fl.flow;
33557
33606
  const isMessage = f.kind === "message";
33558
33607
  const dasharray = isMessage ? "6 4" : void 0;
@@ -33562,7 +33611,7 @@ function renderFlow2(fl) {
33562
33611
  path({
33563
33612
  d: fl.path,
33564
33613
  fill: "none",
33565
- stroke: isMessage ? STROKE_LIGHT : STROKE,
33614
+ stroke: isMessage ? t.msgFlowStroke : t.flowStroke,
33566
33615
  "stroke-width": 1.4,
33567
33616
  "stroke-dasharray": dasharray,
33568
33617
  "marker-start": markerStart,
@@ -33575,8 +33624,8 @@ function renderFlow2(fl) {
33575
33624
  children.push(
33576
33625
  el("polygon", {
33577
33626
  points: diamondPoints(head.x, head.y, 5),
33578
- fill: "#ffffff",
33579
- stroke: STROKE,
33627
+ fill: t.poolFill,
33628
+ stroke: t.flowStroke,
33580
33629
  "stroke-width": 1
33581
33630
  })
33582
33631
  );
@@ -33588,7 +33637,7 @@ function renderFlow2(fl) {
33588
33637
  children.push(
33589
33638
  el("path", {
33590
33639
  d: `M ${head.x - 4} ${head.y + 4} L ${head.x + 4} ${head.y - 4}`,
33591
- stroke: STROKE,
33640
+ stroke: t.flowStroke,
33592
33641
  "stroke-width": 1.5
33593
33642
  })
33594
33643
  );
@@ -33603,7 +33652,7 @@ function renderFlow2(fl) {
33603
33652
  "text-anchor": "middle",
33604
33653
  "font-family": FONT_FAMILY,
33605
33654
  "font-size": 10,
33606
- fill: STROKE
33655
+ fill: t.bpmnText
33607
33656
  },
33608
33657
  f.label
33609
33658
  )
@@ -33635,7 +33684,7 @@ var bpmn = {
33635
33684
  },
33636
33685
  parse: parseBpmn,
33637
33686
  render(text2, config) {
33638
- return renderBpmn(text2);
33687
+ return renderBpmn(text2, config);
33639
33688
  }
33640
33689
  };
33641
33690
 
@@ -36117,5 +36166,5 @@ function renderWithPlugin(prepared, plugin, config) {
36117
36166
  }
36118
36167
 
36119
36168
  export { GEOMETRY, bowtie2 as bowtie, causalloop, decisiontree, drawDeviceIcon, epc, eventtree, faulttree, fmea, gitgraph, iconSize, idef0, markov, network, parse, parseResult, pert, petri, pid, prisma, render, renderEquip, renderPreview, renderResult, sequence, state, threatmodel, timeline, umlclass, usecase, welding };
36120
- //# sourceMappingURL=chunk-LM5X7ZNR.js.map
36121
- //# sourceMappingURL=chunk-LM5X7ZNR.js.map
36169
+ //# sourceMappingURL=chunk-TP7LQ5PF.js.map
36170
+ //# sourceMappingURL=chunk-TP7LQ5PF.js.map