yuhwa 1.4.0 → 1.5.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.d.ts +28 -2
- package/dist/astro.js +27 -4
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +5 -5
- package/dist/canvas.js +1 -1
- package/dist/cli.js +4 -1
- package/dist/editor/assets/index-B-h3Fc8X.js +689 -0
- package/dist/editor/assets/index-Dd3yJXpt.css +1 -0
- package/dist/editor/assets/lsp.worker-C3Z1Mv2o.js +36 -0
- package/dist/editor/index.html +68 -57
- package/dist/{figure-BLHfxz_e.d.ts → figure-BA0baRTM.d.ts} +1 -1
- package/dist/{index-xVW43gqW.d.ts → index-DG5JlX3s.d.ts} +34 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +5 -5
- package/dist/ironmark.d.ts +7 -3
- package/dist/ironmark.js +13 -5
- package/dist/llms.txt +4 -4
- package/dist/lsp-browser.d.ts +2 -2
- package/dist/lsp-browser.js +1 -1
- package/dist/lsp-node.js +21 -18
- package/dist/lsp-server.d.ts +1 -1
- package/dist/lsp-server.js +1 -1
- package/dist/lsp.d.ts +1 -1
- package/dist/lsp.js +1 -1
- package/dist/markdown-it.d.ts +1 -1
- package/dist/markdown-it.js +17 -5
- package/dist/{node-CkrQnPFb.js → node-sVTeEPkh.js} +61 -12
- package/dist/{parse--ljBMU60.js → parse-B8adkq5n.js} +129 -93
- package/dist/{plugin-CitzbblK.js → plugin-D0dl0pi7.js} +2 -3
- package/dist/{plugin-NMP_uf1a.d.ts → plugin-DhSeDLo1.d.ts} +44 -27
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.js +2 -2
- package/dist/{raster-iqi6XRPU.js → raster-C9Ks31AI.js} +1 -1
- package/dist/remark.d.ts +1 -1
- package/dist/remark.js +8 -20
- package/dist/satteri.d.ts +32 -0
- package/dist/satteri.js +41 -0
- package/dist/{server-DMAOtqqK.d.ts → server-Bb5_7tRV.d.ts} +1 -1
- package/dist/{server-BTYtmr6B.js → server-CnVuHCkF.js} +3 -3
- package/dist/{service-C60VdeKS.js → service-CrHH2VV_.js} +22 -19
- package/dist/{service-DimTFsE3.d.ts → service-wlaqtXGz.d.ts} +1 -1
- package/dist/{shared-h8tkFLY4.js → shared-H9nq7QLk.js} +527 -347
- package/dist/{src-NCXCTK_4.js → src-DyMPSQux.js} +442 -148
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +3 -3
- package/dist/vuepress.d.ts +1 -1
- package/dist/vuepress.js +1 -1
- package/dist/yuhwa.iife.js +54 -54
- package/package.json +6 -1
- package/dist/editor/assets/index-DWm3xV_v.js +0 -689
- package/dist/editor/assets/index-DaWl0OPj.css +0 -1
- package/dist/editor/assets/lsp.worker-N6A9m364.js +0 -36
package/dist/astro.d.ts
CHANGED
|
@@ -1,9 +1,35 @@
|
|
|
1
|
-
import { t as YuhwaDocsOptions } from "./figure-
|
|
1
|
+
import { t as YuhwaDocsOptions } from "./figure-BA0baRTM.js";
|
|
2
|
+
interface Watcher {
|
|
3
|
+
on: (event: "change" | "add", fn: (file: string) => void) => unknown;
|
|
4
|
+
add: (files: string[]) => unknown;
|
|
5
|
+
emit: (event: "change", file: string) => unknown;
|
|
6
|
+
}
|
|
7
|
+
interface DevPlugin {
|
|
8
|
+
name: string;
|
|
9
|
+
apply: "serve";
|
|
10
|
+
configureServer: (server: {
|
|
11
|
+
watcher: Watcher;
|
|
12
|
+
}) => void;
|
|
13
|
+
}
|
|
2
14
|
interface SetupParams {
|
|
15
|
+
command?: string;
|
|
16
|
+
config?: {
|
|
17
|
+
markdown?: {
|
|
18
|
+
processor?: {
|
|
19
|
+
name: string;
|
|
20
|
+
options: {
|
|
21
|
+
mdastPlugins?: unknown[];
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
3
26
|
updateConfig: (config: {
|
|
4
|
-
markdown
|
|
27
|
+
markdown?: {
|
|
5
28
|
remarkPlugins: unknown[];
|
|
6
29
|
};
|
|
30
|
+
vite?: {
|
|
31
|
+
plugins: DevPlugin[];
|
|
32
|
+
};
|
|
7
33
|
}) => unknown;
|
|
8
34
|
injectScript: (stage: "page-ssr" | "page", content: string) => void;
|
|
9
35
|
}
|
package/dist/astro.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import remarkYuhwa from "./remark.js";
|
|
2
|
-
import
|
|
2
|
+
import satteriYuhwa from "./satteri.js";
|
|
3
|
+
import { n as onTrack, o as clientImports, r as pagesUsing } from "./node-sVTeEPkh.js";
|
|
3
4
|
// src/integrations/astro.ts
|
|
4
5
|
/**
|
|
5
6
|
* Astro integration, also for Starlight: renders ```yuhwa blocks in .md and
|
|
6
|
-
* .mdx and adds the light/dark stylesheet.
|
|
7
|
+
* .mdx and adds the light/dark stylesheet. It plugs into whichever Markdown
|
|
8
|
+
* processor the site uses: Sätteri (the Astro 7 default) or unified/remark.
|
|
7
9
|
*
|
|
8
10
|
* // astro.config.mjs
|
|
9
11
|
* import yuhwa from 'yuhwa/astro';
|
|
@@ -12,6 +14,24 @@ import { r as clientImports } from "./node-CkrQnPFb.js";
|
|
|
12
14
|
* `yuhwa({ zoom: true })` also loads the pan and zoom script. The canvas
|
|
13
15
|
* script always loads, for `output=canvas` fences.
|
|
14
16
|
*/
|
|
17
|
+
/**
|
|
18
|
+
* Dev only: when a diagram file a page read changes (`file="..."` or an
|
|
19
|
+
* import), report its pages as changed, so Astro renders them again.
|
|
20
|
+
*/
|
|
21
|
+
function watchDiagrams() {
|
|
22
|
+
return {
|
|
23
|
+
name: "yuhwa-watch",
|
|
24
|
+
apply: "serve",
|
|
25
|
+
configureServer({ watcher }) {
|
|
26
|
+
onTrack((files) => watcher.add(files));
|
|
27
|
+
const changed = (file) => {
|
|
28
|
+
for (const page of pagesUsing(file)) watcher.emit("change", page);
|
|
29
|
+
};
|
|
30
|
+
watcher.on("change", changed);
|
|
31
|
+
watcher.on("add", changed);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
15
35
|
function yuhwa(opts = {}) {
|
|
16
36
|
const docs = opts.zoom ? {
|
|
17
37
|
...opts,
|
|
@@ -19,8 +39,11 @@ function yuhwa(opts = {}) {
|
|
|
19
39
|
} : opts;
|
|
20
40
|
return {
|
|
21
41
|
name: "yuhwa",
|
|
22
|
-
hooks: { "astro:config:setup": ({ updateConfig, injectScript }) => {
|
|
23
|
-
|
|
42
|
+
hooks: { "astro:config:setup": ({ command, config, updateConfig, injectScript }) => {
|
|
43
|
+
const processor = config?.markdown?.processor;
|
|
44
|
+
if (processor?.name === "satteri") (processor.options.mdastPlugins ??= []).push(satteriYuhwa(docs));
|
|
45
|
+
else updateConfig({ markdown: { remarkPlugins: [[remarkYuhwa, docs]] } });
|
|
46
|
+
if (command === "dev") updateConfig({ vite: { plugins: [watchDiagrams()] } });
|
|
24
47
|
for (const m of clientImports(opts)) injectScript(m.endsWith(".css") ? "page-ssr" : "page", `import '${m}';`);
|
|
25
48
|
} }
|
|
26
49
|
};
|
package/dist/browser.d.ts
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
* <yuhwa-diagram render="canvas">a -> b</yuhwa-diagram> // or png; default svg
|
|
12
12
|
* el.source = 'a -> b' // re-renders
|
|
13
13
|
*/
|
|
14
|
-
import { $ as
|
|
15
|
-
import { $ as
|
|
14
|
+
import { $ as Point, A as Diagnostic, At as registry, B as LaidNode, C as setLineProp, Cn as canvasMeasure, Ct as RowKind, D as Box, Dt as optionKind, Et as YuhwaPlugin, F as GroupDecl, Ft as renderHead, G as NodeOverride, Gt as segsW, H as Layout, Ht as parseInline, I as HeadKind, It as InkColors, J as PanelOverride, Jt as tspans, K as PanelDecl, L as LabelRef, Lt as Seg, M as Direction, Mt as use, N as EdgeDecl, Nt as MarkerKind, O as Component, Ot as perPass, P as EdgeOverride, Pt as ShapeKind, Q as PartEdit, Qt as RAMPS, R as LaidEdge, Rt as esc, S as serializeProps, Sn as approxMeasure, St as RowCtx, T as splitTrailingProps, Tt as StatementKind, U as LayoutOverrides, V as LaidPanel, W as NodeDecl, Wt as renderSegs, X as PartAction, Xt as LineStyle, Y as PanelPart, Z as PartChange, _ as joinPath, _n as ramp, _t as Decoration, a as portOn, an as ThemeInput, at as SourceRef, b as parse, bn as themeNames, bt as PanelKind, c as KNOWN_SETTINGS, ct as groupPath, d as ParseOptions, dn as getTheme, en as THEMES, et as Props, f as SETTING_VALUES, g as isYuhwaPath, gn as isToneOrHex, h as blockBraces, hn as isSafeLink, in as Theme, it as Side, j as Diagram, jt as unuse, k as Curve, kt as recolor, l as LexedLine, ln as fontFamilies, lt as layout, m as TokKind, mn as isSafeCss, nn as THEME_NAMES, nt as ResolvedNodeStyle, ot as GRID, p as Tok, pn as isGenericFont, pt as lineStyle, q as PanelHandle, r as SHAPES, rn as TONES, rt as ShapeName, sn as createTheme, tn as THEME_KEYS, tt as ResolvedEdgeStyle, u as PANELS, un as fontStack, ut as dashFor, v as lex, vn as registerTheme, vt as FrameKind, w as setTrailingProp, wt as RowPaint, x as parseProps, xt as PanelOption, y as onlyColor, yt as PanelCtx, z as LaidGroup } from "./plugin-DhSeDLo1.js";
|
|
15
|
+
import { $ as addNode, A as GROUP_PROPS, B as MdBlock, C as markers, D as COLORS, E as BOOLS, F as lint, G as replaceBlockSource, H as MdResult, I as ConvertResult, J as embedFonts, K as FontSource, L as fromMermaid, M as NUMBERS, N as PANEL_PROPS, O as EDGE_PROPS, P as PANEL_PROP_HELP, Q as addEdge, R as isMermaid, S as themes, T as GUIDE, U as findBlocks, V as MdOptions, W as processMarkdown, X as svgToCanvas, Y as loadFonts, Z as Target, _ as legend, at as setProp, b as tables, c as treeview, ct as writePanelDrag, d as gantt, dt as fromJSON, et as editPart, f as mindmap, ft as renderSvg, g as sequence, h as timeline, i as hash, it as setPartTone, j as NODE_PROPS, k as ENUMS, l as kanban, lt as DiagramJSON, m as chart, n as Options, nt as removeElement, o as toSource, ot as setSetting, p as git, q as RasterOptions, r as Result, rt as setLabel, s as builtins, st as writeLayout, t as InputFormat, tt as formatLayout, u as quadrant, ut as JsonResult, v as footer, w as shapes, x as charts, y as frames, z as MD_LANGUAGES } from "./index-DG5JlX3s.js";
|
|
16
16
|
import { i as zoomable, n as Zoomer, r as zoomHeight, t as ZoomOptions } from "./zoom-CCSUbX1X.js";
|
|
17
17
|
export declare function render(source: string, opts?: Options): Result;
|
|
18
18
|
/** `render`, then draw the diagram into a canvas. */
|
|
@@ -41,4 +41,4 @@ export declare class YuhwaDiagram extends Base {
|
|
|
41
41
|
connectedCallback(): void;
|
|
42
42
|
attributeChangedCallback(): void;
|
|
43
43
|
}
|
|
44
|
-
export { BOOLS, type Box, COLORS, type Component, type ConvertResult, type Curve, type Decoration, type Diagnostic, type Diagram, type DiagramJSON, type Direction, EDGE_PROPS, ENUMS, type EdgeDecl, type EdgeOverride, type FontSource, type FrameKind, GRID, GROUP_PROPS, GUIDE, type GroupDecl, type HeadKind, type InkColors, InputFormat, type JsonResult, KNOWN_SETTINGS, type LabelRef, type LaidEdge, type LaidGroup, type LaidNode, type LaidPanel, type Layout, type LayoutOverrides, type LexedLine, type LineStyle, MD_LANGUAGES, type MarkerKind, type MdBlock, type MdOptions, type MdResult, NODE_PROPS, NUMBERS, type NodeDecl, type NodeOverride, Options, PANELS, PANEL_PROPS, type PanelCtx, type PanelDecl, type PanelHandle, type PanelKind, type PanelOption, type PanelOverride, type PanelPart, type ParseOptions, type PartAction, type PartChange, type PartEdit, type Point, type Props, RAMPS, type RasterOptions, type ResolvedEdgeStyle, type ResolvedNodeStyle, Result, type RowCtx, type RowKind, type RowPaint, SETTING_VALUES, SHAPES, type Seg, type ShapeKind, type ShapeName, type Side, type SourceRef, type StatementKind, THEMES, THEME_KEYS, THEME_NAMES, TONES, type Theme, type ThemeInput, type Tok, type TokKind, type YuhwaPlugin, type ZoomOptions, type Zoomer, approxMeasure, blockBraces, builtins, canvasMeasure, chart, charts, createTheme, dashFor, editPart, embedFonts, esc, findBlocks, fontFamilies, fontStack, footer, formatLayout, frames, fromJSON, fromMermaid, gantt, getTheme, git, groupPath, 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, 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, zoomHeight, zoomable };
|
|
44
|
+
export { BOOLS, type Box, COLORS, type Component, type ConvertResult, type Curve, type Decoration, type Diagnostic, type Diagram, type DiagramJSON, type Direction, EDGE_PROPS, ENUMS, type EdgeDecl, type EdgeOverride, type FontSource, type FrameKind, GRID, GROUP_PROPS, GUIDE, type GroupDecl, type HeadKind, type InkColors, InputFormat, type JsonResult, KNOWN_SETTINGS, type LabelRef, type LaidEdge, type LaidGroup, type LaidNode, type LaidPanel, type Layout, type LayoutOverrides, type LexedLine, type LineStyle, MD_LANGUAGES, type MarkerKind, type MdBlock, type MdOptions, type MdResult, NODE_PROPS, NUMBERS, type NodeDecl, type NodeOverride, Options, PANELS, PANEL_PROPS, PANEL_PROP_HELP, type PanelCtx, type PanelDecl, type PanelHandle, type PanelKind, type PanelOption, type PanelOverride, type PanelPart, type ParseOptions, type PartAction, type PartChange, type PartEdit, type Point, type Props, RAMPS, type RasterOptions, type ResolvedEdgeStyle, type ResolvedNodeStyle, Result, type RowCtx, type RowKind, type RowPaint, SETTING_VALUES, SHAPES, type Seg, type ShapeKind, type ShapeName, type Side, type SourceRef, type StatementKind, THEMES, THEME_KEYS, THEME_NAMES, TONES, type Target, type Theme, type ThemeInput, type Tok, type TokKind, type YuhwaPlugin, type ZoomOptions, type Zoomer, 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, 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, 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, zoomHeight, zoomable };
|
package/dist/browser.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as
|
|
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 } from "./plugin-
|
|
1
|
+
import { A as treeview, B as footer, C as isMermaid, D as groupPath, E as GRID, F as git, G as markers, H as tables, I as chart, K as shapes, L as timeline, M as quadrant, N as gantt, O as layout, P as mindmap, R as sequence, S as fromMermaid, T as renderSvg, U as charts, V as frames, W as themes, _ as setPartTone, a as MD_LANGUAGES, b as writeLayout, d as addEdge, f as addNode, g as setLabel, h as removeElement, i as GUIDE, j as kanban, k as builtins, l as processMarkdown, m as formatLayout, n as render$1, o as findBlocks, p as editPart, r as toSource, t as hash, u as replaceBlockSource, v as setProp, w as fromJSON, x as writePanelDrag, y as setSetting, z as legend } from "./src-DyMPSQux.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 } from "./plugin-D0dl0pi7.js";
|
|
3
3
|
import { n as zoomable, t as zoomHeight } from "./zoom-yxhxX16c.js";
|
|
4
|
-
import { a as svgFamilies, c as swapForRaster, n as embedFonts, r as loadFonts, s as svgToCanvas } from "./raster-
|
|
5
|
-
import {
|
|
4
|
+
import { a as svgFamilies, c as swapForRaster, n as embedFonts, r as loadFonts, s as svgToCanvas } from "./raster-C9Ks31AI.js";
|
|
5
|
+
import { $ as lineStyle, C as EDGE_PROPS, D as NUMBERS, E as NODE_PROPS, Ft as THEME_KEYS, Gt as isGenericFont, Ht as fontStack, It as THEME_NAMES, Jt as isToneOrHex, Kt as isSafeCss, L as portOn, Lt as TONES, Mt as RAMPS, O as PANEL_PROPS, P as SHAPES, Pt as THEMES, Qt as themeNames, S as COLORS, St as segsW, T as GROUP_PROPS, Ut as getTheme, Vt as fontFamilies, Xt as registerTheme, Y as dashFor, Yt as ramp, _ as setLineProp, b as unquote, c as joinPath, d as parse, f as parseProps, gt as parseInline, h as serializeProps, j as lint, k as PANEL_PROP_HELP, kt as tspans, l as lex, n as PANELS, o as blockBraces, q as renderHead, qt as isSafeLink, r as SETTING_VALUES, s as isYuhwaPath, t as KNOWN_SETTINGS, u as onlyColor, ut as esc, v as setTrailingProp, w as ENUMS, x as BOOLS, y as splitTrailingProps, yt as renderSegs, zt as createTheme } from "./parse-B8adkq5n.js";
|
|
6
6
|
// src/browser.ts
|
|
7
7
|
/**
|
|
8
8
|
* Drop-in browser runtime: <script src="yuhwa.js"><\/script>
|
|
@@ -248,4 +248,4 @@ if (typeof document !== "undefined") {
|
|
|
248
248
|
else run();
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
-
export { BOOLS, COLORS, EDGE_PROPS, ENUMS, GRID, GROUP_PROPS, GUIDE, KNOWN_SETTINGS, MD_LANGUAGES, NODE_PROPS, NUMBERS, PANELS, PANEL_PROPS, RAMPS, SETTING_VALUES, SHAPES, THEMES, THEME_KEYS, THEME_NAMES, TONES, YuhwaDiagram, approxMeasure, blockBraces, builtins, canvasMeasure, chart, charts, createTheme, dashFor, editPart, embedFonts, esc, fetchImports, findBlocks, fontFamilies, fontStack, footer, formatLayout, frames, fromJSON, fromMermaid, gantt, getTheme, git, groupPath, 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, render, renderCanvas, renderHead, renderSegs, renderSvg, replaceBlockSource, run, segsW, sequence, serializeProps, setLabel, setLineProp, setPartTone, setProp, setSetting, setTrailingProp, shapes, splitTrailingProps, svgToCanvas, tables, themeNames, themes, timeline, toSource, treeview, tspans, unuse, use, writeLayout, writePanelDrag, zoomHeight, zoomable };
|
|
251
|
+
export { BOOLS, COLORS, EDGE_PROPS, ENUMS, GRID, GROUP_PROPS, GUIDE, KNOWN_SETTINGS, MD_LANGUAGES, NODE_PROPS, NUMBERS, PANELS, PANEL_PROPS, PANEL_PROP_HELP, RAMPS, SETTING_VALUES, SHAPES, THEMES, THEME_KEYS, THEME_NAMES, TONES, YuhwaDiagram, addEdge, addNode, approxMeasure, blockBraces, builtins, canvasMeasure, chart, charts, createTheme, dashFor, editPart, embedFonts, esc, fetchImports, findBlocks, fontFamilies, fontStack, footer, formatLayout, frames, fromJSON, fromMermaid, gantt, getTheme, git, groupPath, 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, renderCanvas, renderHead, renderSegs, renderSvg, replaceBlockSource, run, segsW, sequence, serializeProps, setLabel, setLineProp, setPartTone, setProp, setSetting, setTrailingProp, shapes, splitTrailingProps, svgToCanvas, tables, themeNames, themes, timeline, toSource, treeview, tspans, unuse, use, writeLayout, writePanelDrag, zoomHeight, zoomable };
|
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-C9Ks31AI.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 { F as NODE_PROPS, G as
|
|
3
|
+
import { B as SHAPES, F as NODE_PROPS, G as THEME_KEYS, H as esc, J as isSafeCss, K as THEME_NAMES, L as PANEL_PROPS, M as EDGE_PROPS, N as ENUMS, P as GROUP_PROPS, S as SETTING_VALUES, T as joinPath, _ as canvasMeasure, a as formatPage, b as KNOWN_SETTINGS, c as diskResolve, d as MD_LANGUAGES, f as findBlocks, g as replaceBlockSource, h as processMarkdown, i as format, j as COLORS, k as unquote, l as render$1, m as pageBlocks, p as isMarkdown, q as TONES, s as tidy, t as VERSION, u as toSource, v as optionKind, w as isYuhwaPath, y as registry } from "./shared-H9nq7QLk.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";
|
|
@@ -1710,6 +1710,9 @@ function cmdEdit(a) {
|
|
|
1710
1710
|
name: mainName,
|
|
1711
1711
|
mtime: statSync(file).mtimeMs
|
|
1712
1712
|
}));
|
|
1713
|
+
}).catch((e) => {
|
|
1714
|
+
res.statusCode = 500;
|
|
1715
|
+
res.end(JSON.stringify({ error: String(e) }));
|
|
1713
1716
|
});
|
|
1714
1717
|
return;
|
|
1715
1718
|
}
|