yuhwa 1.8.0 → 1.8.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.
@@ -9,7 +9,7 @@
9
9
  rel="icon"
10
10
  href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%232563eb'/%3E%3Cstop offset='1' stop-color='%239333ea'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='64' height='64' rx='15' fill='url%28%23g%29'/%3E%3Crect x='9' y='11' width='26' height='17' rx='5' fill='%23fff'/%3E%3Cpath d='M15 17.5h10M15 22h14' stroke='%237c3aed' stroke-opacity='.35' stroke-width='2.5' stroke-linecap='round'/%3E%3Cpath d='M18 28v5a11 11 0 0 0 11 11h1' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round'/%3E%3Cpath d='m29 38 6 6-6 6' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3Crect x='38' y='36' width='17' height='16' rx='5' fill='%23fff' fill-opacity='.9'/%3E%3C/svg%3E"
11
11
  />
12
- <script type="module" crossorigin src="./assets/index-B7LvqDCZ.js"></script>
12
+ <script type="module" crossorigin src="./assets/index-BzQE05yU.js"></script>
13
13
  <link rel="stylesheet" crossorigin href="./assets/index-BtyZhez4.css">
14
14
  </head>
15
15
  <body>
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { $t as parseInline, An as isSafeLink, C as SETTING_VALUES, D as EDGE_PROPS, E as COLORS, En as getTheme, Fn as themeNames, H as SHAPES, K as portOn, M as NUMBERS, Mn as ramp, Mt as groupProp, N as PANEL_PROPS, Nn as registerTheme, O as ENUMS, On as isGenericFont, P as PANEL_PROP_HELP, Pt as lineStyle, Sn as createTheme, T as BOOLS, Tn as fontStack, Tt as dashFor, _n as THEMES, a as lex, an as segsW, b as KNOWN_SETTINGS, bn as TONES, bt as ALIGN_SIDES, c as parseProps, d as serializeProps, fn as tspans, h as splitTrailingProps, hn as RAMPS, i as blockBraces, j as NODE_PROPS, jn as isToneOrHex, jt as groupPath, k as GROUP_PROPS, kn as isSafeCss, m as setTrailingProp, nn as renderSegs, p as setLineProp, qt as esc, rt as renderHead, s as onlyColor, vn as THEME_KEYS, wn as fontFamilies, x as SETTING_HELP, yn as THEME_NAMES, z as lint } from "./lex-B95erg9Z.js";
2
- import { A as joinPath, B as timeline, C as isMermaid, D as GRID, E as layout, F as quadrant, G as tables, H as legend, I as gantt, J as markers, K as charts, L as mindmap, M as builtins, N as treeview, O as parse, P as kanban, R as git, S as fromMermaid, T as renderSvg, U as footer, V as sequence, W as frames, Y as shapes, _ as setPartTone, a as MD_LANGUAGES, b as writeLayout, d as addEdge, f as addNode, g as setLabel, h as removeElement, i as GUIDE, k as isYuhwaPath, l as processMarkdown, m as formatLayout, n as render, o as findBlocks, p as editPart, q as themes, r as toSource, t as hash, u as replaceBlockSource, v as setProp, w as fromJSON, x as writePanelDrag, y as setSetting, z as chart } from "./src-DXSUoZMj.js";
3
- import { a as perPass, c as unuse, i as optionKind, l as use, n as approxMeasure, o as recolor, r as canvasMeasure, s as registry, u as PANELS } from "./plugin-D5lzFpzv.js";
4
- import { n as embedFonts, r as loadFonts, s as svgToCanvas } from "./raster-Cy1jbYgz.js";
1
+ import { An as isSafeCss, C as SETTING_VALUES, Cn as createTheme, D as EDGE_PROPS, Dn as getTheme, E as COLORS, En as fontStack, H as SHAPES, In as themeNames, Jt as esc, K as portOn, M as NUMBERS, Mn as isToneOrHex, Mt as groupProp, N as PANEL_PROPS, Nn as ramp, O as ENUMS, P as PANEL_PROP_HELP, Pn as registerTheme, Pt as lineStyle, T as BOOLS, Tn as fontFamilies, Tt as dashFor, a as lex, b as KNOWN_SETTINGS, bn as THEME_NAMES, bt as ALIGN_SIDES, c as parseProps, d as serializeProps, en as parseInline, gn as RAMPS, h as splitTrailingProps, i as blockBraces, j as NODE_PROPS, jn as isSafeLink, jt as groupPath, k as GROUP_PROPS, kn as isGenericFont, m as setTrailingProp, on as segsW, p as setLineProp, pn as tspans, rn as renderSegs, rt as renderHead, s as onlyColor, vn as THEMES, x as SETTING_HELP, xn as TONES, yn as THEME_KEYS, z as lint } from "./lex-DIq2EFvl.js";
2
+ import { A as joinPath, B as timeline, C as isMermaid, D as GRID, E as layout, F as quadrant, G as tables, H as legend, I as gantt, J as markers, K as charts, L as mindmap, M as builtins, N as treeview, O as parse, P as kanban, R as git, S as fromMermaid, T as renderSvg, U as footer, V as sequence, W as frames, Y as shapes, _ as setPartTone, a as MD_LANGUAGES, b as writeLayout, d as addEdge, f as addNode, g as setLabel, h as removeElement, i as GUIDE, k as isYuhwaPath, l as processMarkdown, m as formatLayout, n as render, o as findBlocks, p as editPart, q as themes, r as toSource, t as hash, u as replaceBlockSource, v as setProp, w as fromJSON, x as writePanelDrag, y as setSetting, z as chart } from "./src-BWFm7GlK.js";
3
+ import { a as perPass, c as unuse, i as optionKind, l as use, n as approxMeasure, o as recolor, r as canvasMeasure, s as registry, u as PANELS } from "./plugin-3vxnUvv9.js";
4
+ import { n as embedFonts, r as loadFonts, s as svgToCanvas } from "./raster-Bqtxssxh.js";
5
5
  export { ALIGN_SIDES, BOOLS, COLORS, EDGE_PROPS, ENUMS, GRID, GROUP_PROPS, GUIDE, KNOWN_SETTINGS, MD_LANGUAGES, NODE_PROPS, NUMBERS, PANELS, PANEL_PROPS, PANEL_PROP_HELP, RAMPS, SETTING_HELP, SETTING_VALUES, SHAPES, THEMES, THEME_KEYS, THEME_NAMES, TONES, addEdge, addNode, approxMeasure, blockBraces, builtins, canvasMeasure, chart, charts, createTheme, dashFor, editPart, embedFonts, esc, findBlocks, fontFamilies, fontStack, footer, formatLayout, frames, fromJSON, fromMermaid, gantt, getTheme, git, groupPath, groupProp, hash, isGenericFont, isMermaid, isSafeCss, isSafeLink, isToneOrHex, isYuhwaPath, joinPath, kanban, layout, legend, lex, lineStyle, lint, loadFonts, markers, mindmap, onlyColor, optionKind, parse, parseInline, parseProps, perPass, portOn, processMarkdown, quadrant, ramp, recolor, registerTheme, registry, removeElement, render, renderHead, renderSegs, renderSvg, replaceBlockSource, segsW, sequence, serializeProps, setLabel, setLineProp, setPartTone, setProp, setSetting, setTrailingProp, shapes, splitTrailingProps, svgToCanvas, tables, themeNames, themes, timeline, toSource, treeview, tspans, unuse, use, writeLayout, writePanelDrag };
package/dist/ironmark.js CHANGED
@@ -1,4 +1,4 @@
1
- import { d as zoomTag, i as renderBlock, l as toHtml, u as wantsRender } from "./node-D1wvmy4u.js";
1
+ import { d as zoomTag, i as renderBlock, l as toHtml, u as wantsRender } from "./node-GljwUyhc.js";
2
2
  // src/integrations/ironmark.ts
3
3
  /**
4
4
  * ironmark support: renders ```yuhwa fences before ironmark parses the file.
@@ -909,14 +909,30 @@ const linesSize = (lines, fs) => lines.reduce((a, l) => MARKUP_RE.test(l) ? pars
909
909
  const LINE_HEIGHT = 1.3;
910
910
  /** the line height of a block of label lines: its largest font size times `k` */
911
911
  const lineHeight = (lines, fs, k = LINE_HEIGHT) => linesSize(lines, fs) * k;
912
+ /** one `<tspan>` per line at `x`, line `i` at `y(i)` */
913
+ const textLines = (lines, x, y, body) => lines.map((l, i) => `<tspan x="${f(x)}" y="${f(y(i))}">${body(l)}</tspan>`).join("");
912
914
  /**
913
- * Safari (WebKit) does not pass `dominant-baseline` from a `<text>` down to its
914
- * `<tspan>`s, so they fall back to the alphabetic baseline and sit too high.
915
- * Every tspan restates it as `inherit`.
915
+ * How far below a line's middle its alphabetic baseline sits, per em. Close to
916
+ * where `dominant-baseline="central"` puts it (Inter's is 0.363em).
916
917
  */
917
- const BASELINE = "dominant-baseline=\"inherit\"";
918
- /** one `<tspan>` per line at `x`, line `i` at `y(i)` */
919
- const textLines = (lines, x, y, body) => lines.map((l, i) => `<tspan x="${f(x)}" y="${f(y(i))}" ${BASELINE}>${body(l)}</tspan>`).join("");
918
+ const CENTRAL_SHIFT = .35;
919
+ const TEXT_EL = /<text\b([^>]*)>([\s\S]*?)<\/text>/g;
920
+ const Y_ATTR = /(\s)y="(-?[\d.]+)"/;
921
+ /**
922
+ * Renderers write `<text>` centred on its `y` with `dominant-baseline="central"`.
923
+ * Figma, Inkscape and Safari's tspans ignore that and draw on the alphabetic
924
+ * baseline, a third of a line too high. This bakes the shift into the `y` of
925
+ * the text and its line tspans so every viewer places it the same.
926
+ */
927
+ function bakeBaselines(svg) {
928
+ return svg.replace(TEXT_EL, (whole, attrs, body) => {
929
+ if (!attrs.includes("dominant-baseline=\"central\"")) return whole;
930
+ const fs = Number(/\sfont-size="([\d.]+)"/.exec(attrs)?.[1]);
931
+ if (!fs) return whole;
932
+ const shift = (tag) => tag.replace(Y_ATTR, (_, sp, y) => `${sp}y="${f(Number(y) + fs * CENTRAL_SHIFT)}"`);
933
+ return `<text${shift(attrs.replace(" dominant-baseline=\"central\"", ""))}>${body.replace(/<tspan\b[^>]*>/g, shift)}</text>`;
934
+ });
935
+ }
920
936
  /**
921
937
  * The inside of a `<text>`/`<tspan>` for a label line: escaped text when it
922
938
  * has no markup (so plain labels render as before), styled tspans otherwise.
@@ -1000,7 +1016,7 @@ function renderSegs(segs, x, cy, fs, col, theme, muted = false, weight = 400) {
1000
1016
  */
1001
1017
  function tspans(segs, col, theme, muted = false) {
1002
1018
  return segs.map((s) => {
1003
- const a = [`fill="${segColor(s, col, theme, muted)}"`, BASELINE];
1019
+ const a = [`fill="${segColor(s, col, theme, muted)}"`];
1004
1020
  if (s.size) a.push(`font-size="${f(s.size)}"`);
1005
1021
  if (s.weight) a.push(`font-weight="${s.weight}"`);
1006
1022
  else if (s.kind === "bold") a.push("font-weight=\"750\"");
@@ -1797,13 +1813,7 @@ const CURVES$1 = [
1797
1813
  /** `none` is core; `use()` adds every plugin's markers (the built-in ones too) in front of it */
1798
1814
  const HEADS = ["none"];
1799
1815
  /** the sides an edge may leave or enter a node by: the four of a box, or `auto` */
1800
- const SIDES = [
1801
- "top",
1802
- "right",
1803
- "bottom",
1804
- "left",
1805
- "auto"
1806
- ];
1816
+ const SIDES = [...SIDES$1, "auto"];
1807
1817
  /**
1808
1818
  * Node props that place a node next to another one: the value is that node's
1809
1819
  * id. `below`/`above`/`right-of`/`left-of` are screen directions, whatever the
@@ -2605,4 +2615,4 @@ function arrowInfo(a) {
2605
2615
  const quote = (s) => `"${s.replace(/[\\"]/g, "\\$&").replace(/\r\n?|\n/g, "\\n").replace(/\t/g, "\\t")}"`;
2606
2616
  /** `"a \"b\""` → `a "b"`; an unquoted value is only trimmed */
2607
2617
  const unquote = (s) => /^(["']).*\1$/s.test(s.trim()) ? unescape(s.trim().slice(1, -1)) : s.trim();
2608
- export { AFTER_LAYOUT as $, parseInline as $t, MAX_NUMBER as A, isSafeLink as An, groupPadding as At, placementOf as B, guard as Bn, resolveNodeStyle as Bt, SETTING_VALUES as C, cssHex as Cn, alignSide as Ct, EDGE_PROPS as D, isColor as Dn, edgeWidthOf as Dt, COLORS as E, getTheme as En, edgeFont as Et, PLACEMENT_PROPS as F, themeNames as Fn, num as Ft, normalizeShape as G, SPAN_KEYS as Gt, SHAPES as H, table as Hn, size as Ht, SIDES as I, claim as In, panelTheme as It, rectPath as J, f as Jt, portOn as K, dedent as Kt, didYouMean as L, clearOwners as Ln, posNum as Lt, NUMBERS as M, ramp as Mn, groupProp as Mt, PANEL_PROPS as N, registerTheme as Nn, inheritedProp as Nt, ENUMS as O, isGenericFont as On, effectiveProps as Ot, PANEL_PROP_HELP as P, resolveColor as Pn, lineStyle as Pt, textOffset as Q, nodeInk as Qt, inRange as R, collecting as Rn, resolveEdgeStyle as Rt, SETTING_NAMES as S, createTheme as Sn, alignSets as St, BOOLS as T, fontStack as Tn, dashFor as Tt, SHAPE_ALIASES as U, textFont as Ut, propLine as V, ownerOf as Vn, resolvePanelStyle as Vt, SIDE_NORMAL as W, withEdgeInk as Wt, shapePath as X, inkColor as Xt, shapeDetail as Y, fontAttrs as Yt, sizeForShape as Z, lineHeight as Zt, unescape as _, THEMES as _n, sub as _t, lex as a, segsW as an, headSize as at, KNOWN_SETTINGS as b, TONES as bn, ALIGN_SIDES as bt, parseProps as c, subInk as cn, trimFor as ct, serializeProps as d, textLines as dn, center as dt, parseSpanStyle as en, MARKER_KINDS as et, serializeValue as f, tspans as fn, hits as ft, stripComment as g, SANS as gn, sample as gt, splitTrailingProps as h, RAMPS as hn, pointAtHalf as ht, blockBraces as i, richW as in, endDirection as it, NODE_PROPS as j, isToneOrHex as jn, groupPath as jt, GROUP_PROPS as k, isSafeCss as kn, groupGap as kt, propKey as l, sumW as ln, SIDES$1 as lt, setTrailingProp as m, MONO as mn, pathData as mt, addNodeProps as n, renderSegs as nn, SHAPE_KINDS as nt, nodeProps as o, spanKey as on, labelSpot as ot, setLineProp as p, COLOR_TOKEN as pn, norm as pt, portPoint as q, esc as qt, arrowInfo as r, richText as rn, renderHead as rt, onlyColor as s, splitWords as sn, trim as st, KEYED_TAIL_RE as t, plain as tn, POST_RENDER as tt, quote as u, textEl as un, add as ut, unquote as v, THEME_KEYS as vn, orthoRoute as vt, STATEMENT_KEYWORDS as w, fontFamilies as wn, listsIds as wt, SETTING_HELP as x, bool as xn, ALIGN_SIDES_HINT as xt, DIRECTION_ALIASES as y, THEME_NAMES as yn, smoothRoute as yt, lint as z, errorText as zn, resolveGroupStyle as zt };
2618
+ export { AFTER_LAYOUT as $, nodeInk as $t, MAX_NUMBER as A, isSafeCss as An, groupPadding as At, placementOf as B, errorText as Bn, resolveNodeStyle as Bt, SETTING_VALUES as C, createTheme as Cn, alignSide as Ct, EDGE_PROPS as D, getTheme as Dn, edgeWidthOf as Dt, COLORS as E, fontStack as En, edgeFont as Et, PLACEMENT_PROPS as F, resolveColor as Fn, num as Ft, normalizeShape as G, SPAN_KEYS as Gt, SHAPES as H, ownerOf as Hn, size as Ht, SIDES as I, themeNames as In, panelTheme as It, rectPath as J, esc as Jt, portOn as K, bakeBaselines as Kt, didYouMean as L, claim as Ln, posNum as Lt, NUMBERS as M, isToneOrHex as Mn, groupProp as Mt, PANEL_PROPS as N, ramp as Nn, inheritedProp as Nt, ENUMS as O, isColor as On, effectiveProps as Ot, PANEL_PROP_HELP as P, registerTheme as Pn, lineStyle as Pt, textOffset as Q, lineHeight as Qt, inRange as R, clearOwners as Rn, resolveEdgeStyle as Rt, SETTING_NAMES as S, bool as Sn, alignSets as St, BOOLS as T, fontFamilies as Tn, dashFor as Tt, SHAPE_ALIASES as U, table as Un, textFont as Ut, propLine as V, guard as Vn, resolvePanelStyle as Vt, SIDE_NORMAL as W, withEdgeInk as Wt, shapePath as X, fontAttrs as Xt, shapeDetail as Y, f as Yt, sizeForShape as Z, inkColor as Zt, unescape as _, SANS as _n, sub as _t, lex as a, richW as an, headSize as at, KNOWN_SETTINGS as b, THEME_NAMES as bn, ALIGN_SIDES as bt, parseProps as c, splitWords as cn, trimFor as ct, serializeProps as d, textEl as dn, center as dt, parseInline as en, MARKER_KINDS as et, serializeValue as f, textLines as fn, hits as ft, stripComment as g, RAMPS as gn, sample as gt, splitTrailingProps as h, MONO as hn, pointAtHalf as ht, blockBraces as i, richText as in, endDirection as it, NODE_PROPS as j, isSafeLink as jn, groupPath as jt, GROUP_PROPS as k, isGenericFont as kn, groupGap as kt, propKey as l, subInk as ln, SIDES$1 as lt, setTrailingProp as m, COLOR_TOKEN as mn, pathData as mt, addNodeProps as n, plain as nn, SHAPE_KINDS as nt, nodeProps as o, segsW as on, labelSpot as ot, setLineProp as p, tspans as pn, norm as pt, portPoint as q, dedent as qt, arrowInfo as r, renderSegs as rn, renderHead as rt, onlyColor as s, spanKey as sn, trim as st, KEYED_TAIL_RE as t, parseSpanStyle as tn, POST_RENDER as tt, quote as u, sumW as un, add as ut, unquote as v, THEMES as vn, orthoRoute as vt, STATEMENT_KEYWORDS as w, cssHex as wn, listsIds as wt, SETTING_HELP as x, TONES as xn, ALIGN_SIDES_HINT as xt, DIRECTION_ALIASES as y, THEME_KEYS as yn, smoothRoute as yt, lint as z, collecting as zn, resolveGroupStyle as zt };
@@ -1,5 +1,5 @@
1
1
  import { t as __commonJSMin } from "./rolldown-runtime-CEjnN5Q1.js";
2
- import { i as require_api, n as require_api$2, r as require_api$1, t as startServer } from "./server-BrO0eGn8.js";
2
+ import { i as require_api, n as require_api$2, r as require_api$1, t as startServer } from "./server-8-F7RVrN.js";
3
3
  // ../../node_modules/.pnpm/vscode-jsonrpc@10.0.0/node_modules/vscode-jsonrpc/lib/browser/ril.js
4
4
  var require_ril = /* @__PURE__ */ __commonJSMin(((exports) => {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
package/dist/lsp-node.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from "node:module";
3
- import { A as STATEMENT_KEYWORDS, B as PLACEMENT_PROPS, D as KNOWN_SETTINGS, E as PANELS, F as GROUP_PROPS, G as listsIds, H as SHAPES, I as NODE_PROPS, J as parseSpanStyle, K as SPAN_KEYS, L as NUMBERS, M as COLORS, N as EDGE_PROPS, O as SETTING_HELP, P as ENUMS, Q as TONES, R as PANEL_PROPS, U as ALIGN_SIDES, V as SIDES, W as ALIGN_SIDES_HINT, X as THEME_KEYS, Y as spanKey, _ as parse, a as formatPage, b as lex, c as diskResolve, et as themeNames, i as format, j as BOOLS, k as SETTING_VALUES, n as applyChange, o as onTypeEdits, p as isMarkdown, r as diffEdits, rt as joinPath, s as tidy, t as VERSION, tt as table, v as LAYOUT_KEYWORDS, w as optionKind, x as serializeProps, y as blockBraces, z as PANEL_PROP_HELP } from "./shared-BsaZuOAh.js";
3
+ import { A as STATEMENT_KEYWORDS, B as PLACEMENT_PROPS, D as KNOWN_SETTINGS, E as PANELS, F as GROUP_PROPS, G as listsIds, H as SHAPES, I as NODE_PROPS, J as parseSpanStyle, K as SPAN_KEYS, L as NUMBERS, M as COLORS, N as EDGE_PROPS, O as SETTING_HELP, P as ENUMS, Q as TONES, R as PANEL_PROPS, U as ALIGN_SIDES, V as SIDES, W as ALIGN_SIDES_HINT, X as THEME_KEYS, Y as spanKey, _ as parse, a as formatPage, b as lex, c as diskResolve, et as themeNames, i as format, j as BOOLS, k as SETTING_VALUES, n as applyChange, o as onTypeEdits, p as isMarkdown, r as diffEdits, rt as joinPath, s as tidy, t as VERSION, tt as table, v as LAYOUT_KEYWORDS, w as optionKind, x as serializeProps, y as blockBraces, z as PANEL_PROP_HELP } from "./shared-Bhnvepka.js";
4
4
  import { fileURLToPath, pathToFileURL } from "node:url";
5
5
  // \0rolldown/runtime.js
6
6
  var __defProp = Object.defineProperty;
@@ -1 +1 @@
1
- export { t as startServer } from "./server-BrO0eGn8.js";
1
+ export { t as startServer } from "./server-8-F7RVrN.js";
package/dist/lsp.js CHANGED
@@ -1 +1 @@
1
- export { n as SEMANTIC_LEGEND, t as YuhwaService, r as applyChange, i as closeIndent, a as diffEdits, o as enterEdit, s as format, c as newlineIndent, l as newlinePrefix, u as offsetAt, d as onTypeEdits, f as positionAt, p as shiftLines } from "./service-C1M9jbzR.js";
1
+ export { n as SEMANTIC_LEGEND, t as YuhwaService, r as applyChange, i as closeIndent, a as diffEdits, o as enterEdit, s as format, c as newlineIndent, l as newlinePrefix, u as offsetAt, d as onTypeEdits, f as positionAt, p as shiftLines } from "./service-S1OY7wrO.js";
@@ -1,5 +1,5 @@
1
- import { d as zoomTag, i as renderBlock, l as toHtml, u as wantsRender } from "./node-D1wvmy4u.js";
2
- import { a as MD_LANGUAGES } from "./src-DXSUoZMj.js";
1
+ import { d as zoomTag, i as renderBlock, l as toHtml, u as wantsRender } from "./node-GljwUyhc.js";
2
+ import { a as MD_LANGUAGES } from "./src-BWFm7GlK.js";
3
3
  // src/integrations/markdown-it.ts
4
4
  /**
5
5
  * markdown-it plugin: renders ```yuhwa fences at build time.
@@ -1,10 +1,10 @@
1
1
  import { readFileSync, realpathSync } from "node:fs";
2
2
  import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
3
- import { a as MD_LANGUAGES, k as isYuhwaPath, n as render } from "./src-DXSUoZMj.js";
3
+ import { a as MD_LANGUAGES, k as isYuhwaPath, n as render } from "./src-BWFm7GlK.js";
4
4
  import { n as zoomScript } from "./zoom-script-DPxmav2F.js";
5
5
  import { t as zoomHeight } from "./zoom-D3Lahr1T.js";
6
- import { Hn as table } from "./lex-B95erg9Z.js";
7
- import { o as svgSize, t as base64 } from "./raster-Cy1jbYgz.js";
6
+ import { Un as table } from "./lex-DIq2EFvl.js";
7
+ import { o as svgSize, t as base64 } from "./raster-Bqtxssxh.js";
8
8
  import { t as svgDataUri } from "./svg-uri-Dx8SGV-n.js";
9
9
  // src/integrations/png.ts
10
10
  let resvg;
@@ -1,4 +1,4 @@
1
- import { $ as AFTER_LAYOUT, Bn as guard, D as EDGE_PROPS, H as SHAPES, In as claim, J as rectPath, Ln as clearOwners, M as NUMBERS, Nn as registerTheme, O as ENUMS, T as BOOLS, U as SHAPE_ALIASES, _n as THEMES, b as KNOWN_SETTINGS, et as MARKER_KINDS, j as NODE_PROPS, k as GROUP_PROPS, mn as MONO, nt as SHAPE_KINDS, tt as POST_RENDER, yn as THEME_NAMES } from "./lex-B95erg9Z.js";
1
+ import { $ as AFTER_LAYOUT, D as EDGE_PROPS, H as SHAPES, J as rectPath, Ln as claim, M as NUMBERS, O as ENUMS, Pn as registerTheme, Rn as clearOwners, T as BOOLS, U as SHAPE_ALIASES, Vn as guard, b as KNOWN_SETTINGS, bn as THEME_NAMES, et as MARKER_KINDS, hn as MONO, j as NODE_PROPS, k as GROUP_PROPS, nt as SHAPE_KINDS, tt as POST_RENDER, vn as THEMES } from "./lex-DIq2EFvl.js";
2
2
  // src/core/registry.ts
3
3
  /** panel kinds by keyword */
4
4
  const PANELS = /* @__PURE__ */ new Map();
package/dist/plugin.js CHANGED
@@ -1,3 +1,3 @@
1
- import { $t as parseInline, An as isSafeLink, Bt as resolveNodeStyle, Cn as cssHex, Dn as isColor, Dt as edgeWidthOf, Ft as num, G as normalizeShape, Hn as table, J as rectPath, Jt as f, K as portOn, Lt as posNum, Mn as ramp, Ot as effectiveProps, Pn as resolveColor, Pt as lineStyle, Qt as nodeInk, Sn as createTheme, Tt as dashFor, X as shapePath, Xt as inkColor, an as segsW, c as parseProps, d as serializeProps, fn as tspans, gn as SANS, h as splitTrailingProps, hn as RAMPS, kn as isSafeCss, ln as sumW, m as setTrailingProp, mn as MONO, nn as renderSegs, p as setLineProp, pn as COLOR_TOKEN, qt as esc, rt as renderHead, s as onlyColor, tn as plain, un as textEl, v as unquote, xn as bool } from "./lex-B95erg9Z.js";
2
- import { a as perPass, i as optionKind, n as approxMeasure, o as recolor, t as definePlugin } from "./plugin-D5lzFpzv.js";
1
+ import { $t as nodeInk, An as isSafeCss, Bt as resolveNodeStyle, Cn as createTheme, Dt as edgeWidthOf, Fn as resolveColor, Ft as num, G as normalizeShape, J as rectPath, Jt as esc, K as portOn, Lt as posNum, Nn as ramp, On as isColor, Ot as effectiveProps, Pt as lineStyle, Sn as bool, Tt as dashFor, Un as table, X as shapePath, Yt as f, Zt as inkColor, _n as SANS, c as parseProps, d as serializeProps, dn as textEl, en as parseInline, gn as RAMPS, h as splitTrailingProps, hn as MONO, jn as isSafeLink, m as setTrailingProp, mn as COLOR_TOKEN, nn as plain, on as segsW, p as setLineProp, pn as tspans, rn as renderSegs, rt as renderHead, s as onlyColor, un as sumW, v as unquote, wn as cssHex } from "./lex-DIq2EFvl.js";
2
+ import { a as perPass, i as optionKind, n as approxMeasure, o as recolor, t as definePlugin } from "./plugin-3vxnUvv9.js";
3
3
  export { COLOR_TOKEN, MONO, RAMPS, SANS, approxMeasure, bool, createTheme, cssHex, dashFor, definePlugin, edgeWidthOf, effectiveProps, esc, f, inkColor, isColor, isSafeCss, isSafeLink, lineStyle, nodeInk, normalizeShape, num, onlyColor, optionKind, parseInline, parseProps, perPass, plain, portOn, posNum, ramp, recolor, rectPath, renderHead, renderSegs, resolveColor, resolveNodeStyle, segsW, serializeProps, setLineProp, setTrailingProp, shapePath, splitTrailingProps, sumW, table, textEl, tspans, unquote };
@@ -1,5 +1,5 @@
1
1
  import { r as __exportAll } from "./rolldown-runtime-CEjnN5Q1.js";
2
- import { v as unquote } from "./lex-B95erg9Z.js";
2
+ import { v as unquote } from "./lex-DIq2EFvl.js";
3
3
  // src/raster.ts
4
4
  /**
5
5
  * Drawing a rendered SVG into a canvas. No side effects on import, so the
package/dist/remark.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as trackPage, c as mdastElement, d as zoomTag, i as renderBlock, u as wantsRender } from "./node-D1wvmy4u.js";
1
+ import { a as trackPage, c as mdastElement, d as zoomTag, i as renderBlock, u as wantsRender } from "./node-GljwUyhc.js";
2
2
  // src/integrations/remark.ts
3
3
  /**
4
4
  * remark plugin: replaces ```yuhwa code blocks with a rendered figure.
package/dist/satteri.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { fileURLToPath } from "node:url";
2
- import { a as trackPage, c as mdastElement, d as zoomTag, i as renderBlock, u as wantsRender } from "./node-D1wvmy4u.js";
2
+ import { a as trackPage, c as mdastElement, d as zoomTag, i as renderBlock, u as wantsRender } from "./node-GljwUyhc.js";
3
3
  // src/integrations/satteri.ts
4
4
  /**
5
5
  * Sätteri plugin (Astro 7's default Markdown processor): replaces ```yuhwa
@@ -1,6 +1,6 @@
1
1
  import { i as __toCommonJS, n as __esmMin, r as __exportAll, t as __commonJSMin } from "./rolldown-runtime-CEjnN5Q1.js";
2
- import { n as SEMANTIC_LEGEND, r as applyChange, t as YuhwaService } from "./service-C1M9jbzR.js";
3
- import { s as isMarkdown } from "./src-DXSUoZMj.js";
2
+ import { n as SEMANTIC_LEGEND, r as applyChange, t as YuhwaService } from "./service-S1OY7wrO.js";
3
+ import { s as isMarkdown } from "./src-BWFm7GlK.js";
4
4
  // ../../node_modules/.pnpm/vscode-jsonrpc@10.0.0/node_modules/vscode-jsonrpc/lib/common/is.js
5
5
  var require_is$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,6 @@
1
- import { A as joinPath, C as isMermaid, O as parse, c as pageBlocks, j as LAYOUT_KEYWORDS } from "./src-DXSUoZMj.js";
2
- import { C as SETTING_VALUES, D as EDGE_PROPS, E as COLORS, F as PLACEMENT_PROPS, Fn as themeNames, Gt as SPAN_KEYS, H as SHAPES, Hn as table, I as SIDES, M as NUMBERS, N as PANEL_PROPS, O as ENUMS, P as PANEL_PROP_HELP, T as BOOLS, a as lex, b as KNOWN_SETTINGS, bn as TONES, bt as ALIGN_SIDES, d as serializeProps, en as parseSpanStyle, i as blockBraces, j as NODE_PROPS, k as GROUP_PROPS, on as spanKey, vn as THEME_KEYS, w as STATEMENT_KEYWORDS, wt as listsIds, x as SETTING_HELP, xt as ALIGN_SIDES_HINT } from "./lex-B95erg9Z.js";
3
- import { i as optionKind, u as PANELS } from "./plugin-D5lzFpzv.js";
1
+ import { A as joinPath, C as isMermaid, O as parse, c as pageBlocks, j as LAYOUT_KEYWORDS } from "./src-BWFm7GlK.js";
2
+ import { C as SETTING_VALUES, D as EDGE_PROPS, E as COLORS, F as PLACEMENT_PROPS, Gt as SPAN_KEYS, H as SHAPES, I as SIDES, In as themeNames, M as NUMBERS, N as PANEL_PROPS, O as ENUMS, P as PANEL_PROP_HELP, T as BOOLS, Un as table, a as lex, b as KNOWN_SETTINGS, bt as ALIGN_SIDES, d as serializeProps, i as blockBraces, j as NODE_PROPS, k as GROUP_PROPS, sn as spanKey, tn as parseSpanStyle, w as STATEMENT_KEYWORDS, wt as listsIds, x as SETTING_HELP, xn as TONES, xt as ALIGN_SIDES_HINT, yn as THEME_KEYS } from "./lex-DIq2EFvl.js";
3
+ import { i as optionKind, u as PANELS } from "./plugin-3vxnUvv9.js";
4
4
  // src/lsp/format.ts
5
5
  /**
6
6
  * Formatting and text edits, without a parser of their own beyond `lex`.
@@ -929,14 +929,30 @@ const linesSize = (lines, fs) => lines.reduce((a, l) => MARKUP_RE.test(l) ? pars
929
929
  const LINE_HEIGHT = 1.3;
930
930
  /** the line height of a block of label lines: its largest font size times `k` */
931
931
  const lineHeight = (lines, fs, k = LINE_HEIGHT) => linesSize(lines, fs) * k;
932
+ /** one `<tspan>` per line at `x`, line `i` at `y(i)` */
933
+ const textLines = (lines, x, y, body) => lines.map((l, i) => `<tspan x="${f$1(x)}" y="${f$1(y(i))}">${body(l)}</tspan>`).join("");
932
934
  /**
933
- * Safari (WebKit) does not pass `dominant-baseline` from a `<text>` down to its
934
- * `<tspan>`s, so they fall back to the alphabetic baseline and sit too high.
935
- * Every tspan restates it as `inherit`.
935
+ * How far below a line's middle its alphabetic baseline sits, per em. Close to
936
+ * where `dominant-baseline="central"` puts it (Inter's is 0.363em).
936
937
  */
937
- const BASELINE = "dominant-baseline=\"inherit\"";
938
- /** one `<tspan>` per line at `x`, line `i` at `y(i)` */
939
- const textLines = (lines, x, y, body) => lines.map((l, i) => `<tspan x="${f$1(x)}" y="${f$1(y(i))}" ${BASELINE}>${body(l)}</tspan>`).join("");
938
+ const CENTRAL_SHIFT = .35;
939
+ const TEXT_EL = /<text\b([^>]*)>([\s\S]*?)<\/text>/g;
940
+ const Y_ATTR = /(\s)y="(-?[\d.]+)"/;
941
+ /**
942
+ * Renderers write `<text>` centred on its `y` with `dominant-baseline="central"`.
943
+ * Figma, Inkscape and Safari's tspans ignore that and draw on the alphabetic
944
+ * baseline, a third of a line too high. This bakes the shift into the `y` of
945
+ * the text and its line tspans so every viewer places it the same.
946
+ */
947
+ function bakeBaselines(svg) {
948
+ return svg.replace(TEXT_EL, (whole, attrs, body) => {
949
+ if (!attrs.includes("dominant-baseline=\"central\"")) return whole;
950
+ const fs = Number(/\sfont-size="([\d.]+)"/.exec(attrs)?.[1]);
951
+ if (!fs) return whole;
952
+ const shift = (tag) => tag.replace(Y_ATTR, (_, sp, y) => `${sp}y="${f$1(Number(y) + fs * CENTRAL_SHIFT)}"`);
953
+ return `<text${shift(attrs.replace(" dominant-baseline=\"central\"", ""))}>${body.replace(/<tspan\b[^>]*>/g, shift)}</text>`;
954
+ });
955
+ }
940
956
  /**
941
957
  * The inside of a `<text>`/`<tspan>` for a label line: escaped text when it
942
958
  * has no markup (so plain labels render as before), styled tspans otherwise.
@@ -1020,7 +1036,7 @@ function renderSegs(segs, x, cy, fs, col, theme, muted = false, weight = 400) {
1020
1036
  */
1021
1037
  function tspans(segs, col, theme, muted = false) {
1022
1038
  return segs.map((s) => {
1023
- const a = [`fill="${segColor(s, col, theme, muted)}"`, BASELINE];
1039
+ const a = [`fill="${segColor(s, col, theme, muted)}"`];
1024
1040
  if (s.size) a.push(`font-size="${f$1(s.size)}"`);
1025
1041
  if (s.weight) a.push(`font-weight="${s.weight}"`);
1026
1042
  else if (s.kind === "bold") a.push("font-weight=\"750\"");
@@ -2306,13 +2322,7 @@ const CURVES$1 = [
2306
2322
  /** `none` is core; `use()` adds every plugin's markers (the built-in ones too) in front of it */
2307
2323
  const HEADS = ["none"];
2308
2324
  /** the sides an edge may leave or enter a node by: the four of a box, or `auto` */
2309
- const SIDES = [
2310
- "top",
2311
- "right",
2312
- "bottom",
2313
- "left",
2314
- "auto"
2315
- ];
2325
+ const SIDES = [...SIDES$1, "auto"];
2316
2326
  /**
2317
2327
  * Node props that place a node next to another one: the value is that node's
2318
2328
  * id. `below`/`above`/`right-of`/`left-of` are screen directions, whatever the
@@ -11611,14 +11621,15 @@ function applySettings(base, s) {
11611
11621
  const MAX_DUMMIES = 2e4;
11612
11622
  /** the edges, longest first, that must skip their bends to keep within MAX_DUMMIES */
11613
11623
  function longEdgesOverBudget(edges, rank) {
11614
- const spans = edges.filter((e) => !e.hidden).map((e) => ({
11615
- idx: e.idx,
11616
- n: Math.abs(rank.get(e.to) - rank.get(e.from)) - 1
11617
- })).filter((e) => e.n > 0);
11618
- let total = spans.reduce((sum, e) => sum + e.n, 0);
11624
+ const span = (e) => e.hidden ? 0 : Math.abs(rank.get(e.to) - rank.get(e.from)) - 1;
11625
+ let total = 0;
11626
+ for (const e of edges) total += Math.max(0, span(e));
11619
11627
  const out = /* @__PURE__ */ new Set();
11620
11628
  if (total <= MAX_DUMMIES) return out;
11621
- spans.sort((a, b) => b.n - a.n);
11629
+ const spans = edges.map((e) => ({
11630
+ idx: e.idx,
11631
+ n: span(e)
11632
+ })).filter((e) => e.n > 0).sort((a, b) => b.n - a.n);
11622
11633
  for (const e of spans) {
11623
11634
  if (total <= MAX_DUMMIES) break;
11624
11635
  out.add(e.idx);
@@ -12170,7 +12181,7 @@ function draw(d, L, opts) {
12170
12181
  out.push("</g></svg>");
12171
12182
  let svg = out.join("");
12172
12183
  for (const hook of POST_RENDER) svg = hook(svg, d, L);
12173
- return svg;
12184
+ return bakeBaselines(svg);
12174
12185
  }
12175
12186
  function renderPanel(p, L, measure, shadow, id) {
12176
12187
  const base = L.theme;
@@ -13805,7 +13816,8 @@ function lastNode(box) {
13805
13816
  }
13806
13817
  // src/convert/mermaid/lines.ts
13807
13818
  /** Mermaid source lines: the flowchart header, comments, front matter and indented body lines. */
13808
- const HEADER_RE = /^\s*(graph|flowchart)\b\s*(TD|TB|BT|RL|LR)?\s*;?\s*$/i;
13819
+ /** a flowchart header; statements may follow it after a `;` (`graph TD; A-->B`) */
13820
+ const HEADER_RE = /^\s*(graph|flowchart)\b\s*(TD|TB|BT|RL|LR)?\s*(?:;.*)?$/i;
13809
13821
  /** number of lines taken by a leading `---` ... `---` front matter block (0 when none) */
13810
13822
  function frontMatterLines(lines) {
13811
13823
  const first = lines.findIndex((l) => l.trim());
@@ -14399,7 +14411,7 @@ function mermaidHeader(source) {
14399
14411
  function isMermaid(source) {
14400
14412
  const lines = source.split("\n");
14401
14413
  const i = firstStatementIndex(lines);
14402
- if (i >= 0 && HEADER_RE.test(lines[i].split(";")[0])) return true;
14414
+ if (i >= 0 && HEADER_RE.test(lines[i])) return true;
14403
14415
  const h = mermaidHeader(source);
14404
14416
  return !!h && h.type in CONVERTERS;
14405
14417
  }
@@ -14990,5 +15002,5 @@ function onTypeEdits(text, pos, ch) {
14990
15002
  }
14991
15003
  // src/version.ts
14992
15004
  /** the package version, inlined by the build */
14993
- const VERSION = "1.8.0";
15005
+ const VERSION = "1.8.2";
14994
15006
  export { isSafeCss as $, STATEMENT_KEYWORDS as A, PLACEMENT_PROPS as B, canvasMeasure as C, KNOWN_SETTINGS as D, PANELS as E, GROUP_PROPS as F, listsIds as G, SHAPES$2 as H, NODE_PROPS as I, parseSpanStyle as J, SPAN_KEYS as K, NUMBERS as L, COLORS as M, EDGE_PROPS as N, SETTING_HELP as O, ENUMS as P, TONES as Q, PANEL_PROPS as R, unquote as S, registry as T, ALIGN_SIDES as U, SIDES as V, ALIGN_SIDES_HINT as W, THEME_KEYS as X, spanKey as Y, THEME_NAMES as Z, parse as _, formatPage as a, lex as b, diskResolve as c, MD_LANGUAGES as d, themeNames as et, findBlocks as f, replaceBlockSource as g, processMarkdown as h, format as i, BOOLS as j, SETTING_VALUES as k, render as l, pageBlocks as m, applyChange as n, isYuhwaPath as nt, onTypeEdits as o, isMarkdown as p, esc as q, diffEdits as r, joinPath as rt, tidy as s, VERSION as t, table as tt, toSource as u, LAYOUT_KEYWORDS as v, optionKind as w, serializeProps as x, blockBraces as y, PANEL_PROP_HELP as z };
@@ -1,5 +1,5 @@
1
- import { $ as AFTER_LAYOUT, $t as parseInline, A as MAX_NUMBER, An as isSafeLink, At as groupPadding, B as placementOf, Bt as resolveNodeStyle, C as SETTING_VALUES, Cn as cssHex, Ct as alignSide, D as EDGE_PROPS, Dn as isColor, Dt as edgeWidthOf, E as COLORS, En as getTheme, Et as edgeFont, Fn as themeNames, Ft as num$1, G as normalizeShape, H as SHAPES$2, Hn as table, Ht as size, I as SIDES$1, It as panelTheme, J as rectPath, Jt as f$1, K as portOn, Kt as dedent, L as didYouMean, Lt as posNum, Mn as ramp, N as PANEL_PROPS, Nt as inheritedProp, O as ENUMS, Ot as effectiveProps, Pn as resolveColor, Pt as lineStyle, Q as textOffset, Qt as nodeInk, R as inRange, Rn as collecting, Rt as resolveEdgeStyle, S as SETTING_NAMES, Sn as createTheme, St as alignSets, Tn as fontStack, Tt as dashFor, Ut as textFont, V as propLine, Vn as ownerOf, Vt as resolvePanelStyle, W as SIDE_NORMAL, Wt as withEdgeInk, X as shapePath, Xt as inkColor, Y as shapeDetail, Yt as fontAttrs, Z as sizeForShape, Zt as lineHeight, _ as unescape, _t as sub, a as lex, an as segsW, at as headSize, b as KNOWN_SETTINGS, bn as TONES, c as parseProps, cn as subInk, ct as trimFor, d as serializeProps, dn as textLines, dt as center, et as MARKER_KINDS, f as serializeValue, fn as tspans, ft as hits, g as stripComment$1, gn as SANS, gt as sample, h as splitTrailingProps, hn as RAMPS, ht as pointAtHalf, i as blockBraces, in as richW, it as endDirection, j as NODE_PROPS, jt as groupPath, k as GROUP_PROPS, kn as isSafeCss, kt as groupGap, l as propKey, ln as sumW, lt as SIDES, m as setTrailingProp, mn as MONO, mt as pathData, n as addNodeProps, nn as renderSegs, o as nodeProps, ot as labelSpot, p as setLineProp, pn as COLOR_TOKEN, pt as norm, q as portPoint, qt as esc, r as arrowInfo, rn as richText, rt as renderHead, s as onlyColor, sn as splitWords, st as trim, t as KEYED_TAIL_RE, tn as plain, tt as POST_RENDER, u as quote$1, un as textEl, ut as add, v as unquote, vn as THEME_KEYS, vt as orthoRoute, w as STATEMENT_KEYWORDS, wt as listsIds, xn as bool, xt as ALIGN_SIDES_HINT, y as DIRECTION_ALIASES, yn as THEME_NAMES, yt as smoothRoute, z as lint, zn as errorText, zt as resolveGroupStyle } from "./lex-B95erg9Z.js";
2
- import { a as perPass, d as STATEMENTS, f as TRANSFORMS, i as optionKind, l as use, n as approxMeasure, o as recolor, s as registry, u as PANELS } from "./plugin-D5lzFpzv.js";
1
+ import { $ as AFTER_LAYOUT, $t as nodeInk, A as MAX_NUMBER, An as isSafeCss, At as groupPadding, B as placementOf, Bn as errorText, Bt as resolveNodeStyle, C as SETTING_VALUES, Cn as createTheme, Ct as alignSide, D as EDGE_PROPS, Dn as getTheme, Dt as edgeWidthOf, E as COLORS, En as fontStack, Et as edgeFont, Fn as resolveColor, Ft as num$1, G as normalizeShape, H as SHAPES$2, Hn as ownerOf, Ht as size, I as SIDES$1, In as themeNames, It as panelTheme, J as rectPath, Jt as esc, K as portOn, Kt as bakeBaselines, L as didYouMean, Lt as posNum, N as PANEL_PROPS, Nn as ramp, Nt as inheritedProp, O as ENUMS, On as isColor, Ot as effectiveProps, Pt as lineStyle, Q as textOffset, Qt as lineHeight, R as inRange, Rt as resolveEdgeStyle, S as SETTING_NAMES, Sn as bool, St as alignSets, Tt as dashFor, Un as table, Ut as textFont, V as propLine, Vt as resolvePanelStyle, W as SIDE_NORMAL, Wt as withEdgeInk, X as shapePath, Xt as fontAttrs, Y as shapeDetail, Yt as f$1, Z as sizeForShape, Zt as inkColor, _ as unescape, _n as SANS, _t as sub, a as lex, an as richW, at as headSize, b as KNOWN_SETTINGS, bn as THEME_NAMES, c as parseProps, cn as splitWords, ct as trimFor, d as serializeProps, dn as textEl, dt as center, en as parseInline, et as MARKER_KINDS, f as serializeValue, fn as textLines, ft as hits, g as stripComment$1, gn as RAMPS, gt as sample, h as splitTrailingProps, hn as MONO, ht as pointAtHalf, i as blockBraces, in as richText, it as endDirection, j as NODE_PROPS, jn as isSafeLink, jt as groupPath, k as GROUP_PROPS, kt as groupGap, l as propKey, ln as subInk, lt as SIDES, m as setTrailingProp, mn as COLOR_TOKEN, mt as pathData, n as addNodeProps, nn as plain, o as nodeProps, on as segsW, ot as labelSpot, p as setLineProp, pn as tspans, pt as norm, q as portPoint, qt as dedent, r as arrowInfo, rn as renderSegs, rt as renderHead, s as onlyColor, st as trim, t as KEYED_TAIL_RE, tt as POST_RENDER, u as quote$1, un as sumW, ut as add, v as unquote, vt as orthoRoute, w as STATEMENT_KEYWORDS, wn as cssHex, wt as listsIds, xn as TONES, xt as ALIGN_SIDES_HINT, y as DIRECTION_ALIASES, yn as THEME_KEYS, yt as smoothRoute, z as lint, zn as collecting, zt as resolveGroupStyle } from "./lex-DIq2EFvl.js";
2
+ import { a as perPass, d as STATEMENTS, f as TRANSFORMS, i as optionKind, l as use, n as approxMeasure, o as recolor, s as registry, u as PANELS } from "./plugin-3vxnUvv9.js";
3
3
  // src/core/route/sides.ts
4
4
  /** Choose the side of `box` facing `target`. */
5
5
  function autoSide(box, target, other, dir) {
@@ -8723,14 +8723,15 @@ function applySettings(base, s) {
8723
8723
  const MAX_DUMMIES = 2e4;
8724
8724
  /** the edges, longest first, that must skip their bends to keep within MAX_DUMMIES */
8725
8725
  function longEdgesOverBudget(edges, rank) {
8726
- const spans = edges.filter((e) => !e.hidden).map((e) => ({
8727
- idx: e.idx,
8728
- n: Math.abs(rank.get(e.to) - rank.get(e.from)) - 1
8729
- })).filter((e) => e.n > 0);
8730
- let total = spans.reduce((sum, e) => sum + e.n, 0);
8726
+ const span = (e) => e.hidden ? 0 : Math.abs(rank.get(e.to) - rank.get(e.from)) - 1;
8727
+ let total = 0;
8728
+ for (const e of edges) total += Math.max(0, span(e));
8731
8729
  const out = /* @__PURE__ */ new Set();
8732
8730
  if (total <= MAX_DUMMIES) return out;
8733
- spans.sort((a, b) => b.n - a.n);
8731
+ const spans = edges.map((e) => ({
8732
+ idx: e.idx,
8733
+ n: span(e)
8734
+ })).filter((e) => e.n > 0).sort((a, b) => b.n - a.n);
8734
8735
  for (const e of spans) {
8735
8736
  if (total <= MAX_DUMMIES) break;
8736
8737
  out.add(e.idx);
@@ -9282,7 +9283,7 @@ function draw(d, L, opts) {
9282
9283
  out.push("</g></svg>");
9283
9284
  let svg = out.join("");
9284
9285
  for (const hook of POST_RENDER) svg = hook(svg, d, L);
9285
- return svg;
9286
+ return bakeBaselines(svg);
9286
9287
  }
9287
9288
  function renderPanel(p, L, measure, shadow, id) {
9288
9289
  const base = L.theme;
@@ -10917,7 +10918,8 @@ function lastNode(box) {
10917
10918
  }
10918
10919
  // src/convert/mermaid/lines.ts
10919
10920
  /** Mermaid source lines: the flowchart header, comments, front matter and indented body lines. */
10920
- const HEADER_RE = /^\s*(graph|flowchart)\b\s*(TD|TB|BT|RL|LR)?\s*;?\s*$/i;
10921
+ /** a flowchart header; statements may follow it after a `;` (`graph TD; A-->B`) */
10922
+ const HEADER_RE = /^\s*(graph|flowchart)\b\s*(TD|TB|BT|RL|LR)?\s*(?:;.*)?$/i;
10921
10923
  /** number of lines taken by a leading `---` ... `---` front matter block (0 when none) */
10922
10924
  function frontMatterLines(lines) {
10923
10925
  const first = lines.findIndex((l) => l.trim());
@@ -11511,7 +11513,7 @@ function mermaidHeader(source) {
11511
11513
  function isMermaid(source) {
11512
11514
  const lines = source.split("\n");
11513
11515
  const i = firstStatementIndex(lines);
11514
- if (i >= 0 && HEADER_RE.test(lines[i].split(";")[0])) return true;
11516
+ if (i >= 0 && HEADER_RE.test(lines[i])) return true;
11515
11517
  const h = mermaidHeader(source);
11516
11518
  return !!h && h.type in CONVERTERS;
11517
11519
  }
package/dist/vite.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { readFileSync } from "node:fs";
2
- import { s as errorMessage, t as diskResolve } from "./node-D1wvmy4u.js";
3
- import { k as isYuhwaPath, n as render } from "./src-DXSUoZMj.js";
2
+ import { s as errorMessage, t as diskResolve } from "./node-GljwUyhc.js";
3
+ import { k as isYuhwaPath, n as render } from "./src-BWFm7GlK.js";
4
4
  // src/integrations/vite.ts
5
5
  /**
6
6
  * Vite plugin: `import diagram from './arch.yu'` gives the rendered SVG
package/dist/vuepress.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import yuhwaMarkdownIt from "./markdown-it.js";
2
- import { o as clientImports } from "./node-D1wvmy4u.js";
2
+ import { o as clientImports } from "./node-GljwUyhc.js";
3
3
  // src/integrations/vuepress.ts
4
4
  /**
5
5
  * VuePress 2 plugin: renders ```yuhwa fences and adds the light/dark stylesheet.