yuhwa 1.8.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/astro.js +1 -1
- package/dist/browser.js +4 -4
- package/dist/canvas.js +1 -1
- package/dist/cli.js +39 -41
- package/dist/editor/assets/{index-B7LvqDCZ.js → index-CzZbWTHS.js} +5 -5
- package/dist/editor/assets/{lsp.worker-BCEqba2A.js → lsp.worker-DE33sIum.js} +22 -22
- package/dist/editor/index.html +1 -1
- package/dist/index.js +4 -4
- package/dist/ironmark.js +1 -1
- package/dist/{lex-B95erg9Z.js → lex-D4UEbl0Y.js} +1 -7
- package/dist/lsp-browser.js +1 -1
- package/dist/lsp-node.js +1 -1
- package/dist/lsp-server.js +1 -1
- package/dist/lsp.js +1 -1
- package/dist/markdown-it.js +2 -2
- package/dist/{node-D1wvmy4u.js → node-B4v84i-l.js} +3 -3
- package/dist/{plugin-D5lzFpzv.js → plugin-Bp8z1wBE.js} +1 -1
- package/dist/plugin.js +2 -2
- package/dist/{raster-Cy1jbYgz.js → raster-DI66_cLD.js} +1 -1
- package/dist/remark.js +1 -1
- package/dist/satteri.js +1 -1
- package/dist/{server-BrO0eGn8.js → server-I2YzR5H3.js} +2 -2
- package/dist/{service-C1M9jbzR.js → service-DU8fxD4h.js} +3 -3
- package/dist/{shared-BsaZuOAh.js → shared-B153eecg.js} +12 -16
- package/dist/{src-DXSUoZMj.js → src-De2RtCva.js} +12 -10
- package/dist/vite.js +2 -2
- package/dist/vuepress.js +1 -1
- package/dist/yuhwa.iife.js +4 -4
- package/package.json +1 -1
package/dist/astro.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import remarkYuhwa from "./remark.js";
|
|
2
2
|
import satteriYuhwa from "./satteri.js";
|
|
3
|
-
import { n as onTrack, o as clientImports, r as pagesUsing } from "./node-
|
|
3
|
+
import { n as onTrack, o as clientImports, r as pagesUsing } from "./node-B4v84i-l.js";
|
|
4
4
|
// src/integrations/astro.ts
|
|
5
5
|
/**
|
|
6
6
|
* Astro integration, also for Starlight: renders ```yuhwa blocks in .md and
|
package/dist/browser.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
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$1, 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-
|
|
2
|
-
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-
|
|
1
|
+
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$1, 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-De2RtCva.js";
|
|
2
|
+
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-Bp8z1wBE.js";
|
|
3
3
|
import { n as zoomable, t as zoomHeight } from "./zoom-D3Lahr1T.js";
|
|
4
|
-
import { a as svgFamilies, c as swapForRaster, n as embedFonts, r as loadFonts, s as svgToCanvas } from "./raster-
|
|
5
|
-
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, v as unquote, vn as THEME_KEYS, wn as fontFamilies, x as SETTING_HELP, yn as THEME_NAMES, z as lint } from "./lex-
|
|
4
|
+
import { a as svgFamilies, c as swapForRaster, n as embedFonts, r as loadFonts, s as svgToCanvas } from "./raster-DI66_cLD.js";
|
|
5
|
+
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, v as unquote, vn as THEME_KEYS, wn as fontFamilies, x as SETTING_HELP, yn as THEME_NAMES, z as lint } from "./lex-D4UEbl0Y.js";
|
|
6
6
|
// src/browser.ts
|
|
7
7
|
/**
|
|
8
8
|
* Drop-in browser runtime: <script src="yuhwa.js"><\/script>
|
package/dist/canvas.js
CHANGED
|
@@ -17,7 +17,7 @@ function installCanvas() {
|
|
|
17
17
|
const swap = async (img) => {
|
|
18
18
|
const svg = svgFromDataUri(img.getAttribute("src") ?? "");
|
|
19
19
|
if (svg === void 0) return;
|
|
20
|
-
const { swapForRaster } = await import("./raster-
|
|
20
|
+
const { swapForRaster } = await import("./raster-DI66_cLD.js").then((n) => n.i);
|
|
21
21
|
const canvas = await swapForRaster(img, svg, "canvas", img.alt);
|
|
22
22
|
if (canvas) canvas.className = img.className;
|
|
23
23
|
};
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
3
|
-
import { $ as isSafeCss, C as canvasMeasure, D as KNOWN_SETTINGS, F as GROUP_PROPS, H as SHAPES, I as NODE_PROPS, M as COLORS, N as EDGE_PROPS, P as ENUMS, Q as TONES, R as PANEL_PROPS, S as unquote, T as registry, W as ALIGN_SIDES_HINT, X as THEME_KEYS, Z as THEME_NAMES, a as formatPage, c as diskResolve, d as MD_LANGUAGES, f as findBlocks, g as replaceBlockSource, h as processMarkdown, i as format, k as SETTING_VALUES, l as render$1, m as pageBlocks, nt as isYuhwaPath, p as isMarkdown, q as esc, rt as joinPath, s as tidy, t as VERSION, u as toSource, w as optionKind } from "./shared-
|
|
3
|
+
import { $ as isSafeCss, C as canvasMeasure, D as KNOWN_SETTINGS, F as GROUP_PROPS, H as SHAPES, I as NODE_PROPS, M as COLORS, N as EDGE_PROPS, P as ENUMS, Q as TONES, R as PANEL_PROPS, S as unquote, T as registry, W as ALIGN_SIDES_HINT, X as THEME_KEYS, Z as THEME_NAMES, a as formatPage, c as diskResolve, d as MD_LANGUAGES, f as findBlocks, g as replaceBlockSource, h as processMarkdown, i as format, k as SETTING_VALUES, l as render$1, m as pageBlocks, nt as isYuhwaPath, p as isMarkdown, q as esc, rt as joinPath, s as tidy, t as VERSION, u as toSource, w as optionKind } from "./shared-B153eecg.js";
|
|
4
4
|
import { createServer } from "node:http";
|
|
5
5
|
import { basename, dirname, extname, join, resolve, sep } from "node:path";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
@@ -1027,18 +1027,14 @@ function decodeSource(encoded, compressed) {
|
|
|
1027
1027
|
const buf = Buffer.from(encoded.replace(/\.svg$/, ""), "base64url");
|
|
1028
1028
|
if (!compressed) return buf.toString("utf8");
|
|
1029
1029
|
const opts = { maxOutputLength: MAX_BODY };
|
|
1030
|
-
|
|
1031
|
-
try {
|
|
1032
|
-
return
|
|
1030
|
+
let err;
|
|
1031
|
+
for (const inflate of [inflateSync, inflateRawSync]) try {
|
|
1032
|
+
return inflate(buf, opts).toString("utf8");
|
|
1033
1033
|
} catch (e) {
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
return inflateRawSync(buf, opts).toString("utf8");
|
|
1037
|
-
} catch (raw) {
|
|
1038
|
-
err = raw;
|
|
1039
|
-
}
|
|
1040
|
-
throw tooLarge(err) ? Object.assign(/* @__PURE__ */ new Error("source too large"), { status: 413 }) : err;
|
|
1034
|
+
if (e.code === "ERR_BUFFER_TOO_LARGE") throw Object.assign(/* @__PURE__ */ new Error("source too large"), { status: 413 });
|
|
1035
|
+
err = e;
|
|
1041
1036
|
}
|
|
1037
|
+
throw err;
|
|
1042
1038
|
}
|
|
1043
1039
|
/** header values must be Latin-1 without controls: keep printable ASCII, write the rest as `\u` escapes */
|
|
1044
1040
|
function headerSafe(text) {
|
|
@@ -1901,44 +1897,46 @@ function cmdEdit(a) {
|
|
|
1901
1897
|
if (!a["no-open"]) openBrowser(url);
|
|
1902
1898
|
});
|
|
1903
1899
|
}
|
|
1900
|
+
const COMMANDS = /* @__PURE__ */ new Set([
|
|
1901
|
+
"render",
|
|
1902
|
+
"md",
|
|
1903
|
+
"edit",
|
|
1904
|
+
"check",
|
|
1905
|
+
"lint",
|
|
1906
|
+
"convert",
|
|
1907
|
+
"url",
|
|
1908
|
+
"serve",
|
|
1909
|
+
"guide",
|
|
1910
|
+
"llms",
|
|
1911
|
+
"themes"
|
|
1912
|
+
]);
|
|
1913
|
+
/** the commands that take diagram source on the command line */
|
|
1914
|
+
const TAKES_INLINE = /* @__PURE__ */ new Set([
|
|
1915
|
+
"render",
|
|
1916
|
+
"check",
|
|
1917
|
+
"convert",
|
|
1918
|
+
"url"
|
|
1919
|
+
]);
|
|
1904
1920
|
function main() {
|
|
1905
1921
|
const a = parseArgs(process.argv.slice(2));
|
|
1922
|
+
const first = a._[0];
|
|
1923
|
+
if (first ? !COMMANDS.has(first) && (existsSync(first) || looksInline(first)) : typeof a.source === "string") a._.unshift("render");
|
|
1906
1924
|
const cmd = a._[0];
|
|
1907
1925
|
try {
|
|
1926
|
+
if (TAKES_INLINE.has(cmd)) takeInline(a);
|
|
1908
1927
|
if (a.version || cmd === "version") process.stdout.write(VERSION + "\n");
|
|
1909
|
-
else if (!cmd
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
...a,
|
|
1913
|
-
_: ["render", ...a._.slice(1)]
|
|
1914
|
-
});
|
|
1915
|
-
} else if (!cmd || cmd === "help" || a.help) process.stdout.write(HELP);
|
|
1916
|
-
else if (cmd === "render") {
|
|
1917
|
-
takeInline(a);
|
|
1918
|
-
cmdRender(a);
|
|
1919
|
-
} else if (cmd === "md") cmdMd(a);
|
|
1928
|
+
else if (!cmd || cmd === "help" || a.help) process.stdout.write(HELP);
|
|
1929
|
+
else if (cmd === "render") cmdRender(a);
|
|
1930
|
+
else if (cmd === "md") cmdMd(a);
|
|
1920
1931
|
else if (cmd === "edit") cmdEdit(a);
|
|
1921
|
-
else if (cmd === "check")
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
else if (cmd === "
|
|
1926
|
-
takeInline(a);
|
|
1927
|
-
cmdConvert(a);
|
|
1928
|
-
} else if (cmd === "url") {
|
|
1929
|
-
takeInline(a);
|
|
1930
|
-
cmdUrl(a);
|
|
1931
|
-
} else if (cmd === "serve") serve(Number(str(a.port) ?? 4749), str(a.host) ?? "127.0.0.1");
|
|
1932
|
+
else if (cmd === "check") cmdCheck(a);
|
|
1933
|
+
else if (cmd === "lint") cmdLint(a);
|
|
1934
|
+
else if (cmd === "convert") cmdConvert(a);
|
|
1935
|
+
else if (cmd === "url") cmdUrl(a);
|
|
1936
|
+
else if (cmd === "serve") serve(Number(str(a.port) ?? 4749), str(a.host) ?? "127.0.0.1");
|
|
1932
1937
|
else if (cmd === "guide" || cmd === "llms") process.stdout.write(GUIDE);
|
|
1933
1938
|
else if (cmd === "themes") process.stdout.write(THEME_NAMES.join("\n") + "\n");
|
|
1934
|
-
else
|
|
1935
|
-
const r = {
|
|
1936
|
-
...a,
|
|
1937
|
-
_: ["render", ...a._]
|
|
1938
|
-
};
|
|
1939
|
-
takeInline(r);
|
|
1940
|
-
cmdRender(r);
|
|
1941
|
-
} else throw new Error(`unknown command "${cmd}"`);
|
|
1939
|
+
else throw new Error(`unknown command "${cmd}"`);
|
|
1942
1940
|
} catch (e) {
|
|
1943
1941
|
process.stderr.write(`yuhwa: ${e.message}\n`);
|
|
1944
1942
|
process.exitCode = 1;
|