yuhwa 1.8.1 → 1.9.0

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 (56) hide show
  1. package/dist/{index-0qJC6glR.d.ts → api-DHkPcxuZ.d.ts} +18 -22
  2. package/dist/{src-De2RtCva.js → api-DZunc9Tf.js} +6143 -8753
  3. package/dist/astro.d.ts +1 -1
  4. package/dist/astro.js +1 -1
  5. package/dist/browser.d.ts +26 -3
  6. package/dist/browser.js +103 -32
  7. package/dist/canvas.js +1 -1
  8. package/dist/cli.js +65 -39
  9. package/dist/editor/assets/index-DuDUY7_0.js +842 -0
  10. package/dist/editor/assets/lsp.worker-DrpLBfKZ.js +55 -0
  11. package/dist/editor/index.html +1 -1
  12. package/dist/{figure-Cn5Ls_0U.d.ts → figure-Dlri_efy.d.ts} +1 -1
  13. package/dist/grammar-BgXa5hBR.js +974 -0
  14. package/dist/index-Bab6qq3T.d.ts +2 -0
  15. package/dist/index-rUYmvQft.d.ts +20 -0
  16. package/dist/index.d.ts +10 -3
  17. package/dist/index.js +7 -5
  18. package/dist/ironmark.d.ts +1 -1
  19. package/dist/ironmark.js +1 -1
  20. package/dist/{lex-D4UEbl0Y.js → lex-BgngnZsA.js} +72 -24
  21. package/dist/llms.txt +23 -6
  22. package/dist/lsp-browser.js +1 -1
  23. package/dist/lsp-node.js +6 -4
  24. package/dist/lsp-server.js +1 -1
  25. package/dist/lsp.js +1 -1
  26. package/dist/markdown-it.d.ts +1 -1
  27. package/dist/markdown-it.js +2 -2
  28. package/dist/{node-B4v84i-l.js → node-DoenSsSL.js} +4 -3
  29. package/dist/plugin-CUnb4PAy.js +970 -0
  30. package/dist/plugin-DGmREJ8U.d.ts +9 -0
  31. package/dist/plugin.d.ts +3 -2
  32. package/dist/plugin.js +3 -3
  33. package/dist/plugins-CUSZZfpe.js +8675 -0
  34. package/dist/plugins.d.ts +12 -0
  35. package/dist/plugins.js +3 -0
  36. package/dist/{raster-DI66_cLD.js → raster-CA2EZVsH.js} +8 -8
  37. package/dist/remark.d.ts +1 -1
  38. package/dist/remark.js +1 -1
  39. package/dist/satteri.d.ts +1 -1
  40. package/dist/satteri.js +1 -1
  41. package/dist/{server-I2YzR5H3.js → server-CMv83EL8.js} +2 -2
  42. package/dist/{service-DU8fxD4h.js → service-DUPpv6QR.js} +31 -8
  43. package/dist/{plugin-COlq-EO9.d.ts → shapes-dSoHjzhn.d.ts} +109 -13
  44. package/dist/{shared-B153eecg.js → shared-BNy-W1fR.js} +14232 -6159
  45. package/dist/slim.d.ts +12 -0
  46. package/dist/slim.js +5 -0
  47. package/dist/src-DegXsZtj.js +337 -0
  48. package/dist/vite.d.ts +1 -1
  49. package/dist/vite.js +3 -2
  50. package/dist/vuepress.d.ts +1 -1
  51. package/dist/vuepress.js +1 -1
  52. package/dist/yuhwa.iife.js +79 -55
  53. package/package.json +11 -1
  54. package/dist/editor/assets/index-CzZbWTHS.js +0 -689
  55. package/dist/editor/assets/lsp.worker-DE33sIum.js +0 -36
  56. package/dist/plugin-Bp8z1wBE.js +0 -307
@@ -1,4 +1,4 @@
1
- import { E as Diagram, H as PanelHandle, L as Layout, R as LayoutOverrides, T as Diagnostic, Zt as Theme, mn as Measure, mt as PanelOption, pt as PanelKind, q as PartEdit, x as AlignSide, yt as YuhwaPlugin } from "./plugin-COlq-EO9.js";
1
+ import { Dn as Measure, G as Layout, K as LayoutOverrides, M as Diagnostic, O as AlignSide, P as Diagram, St as PanelOption, X as PanelHandle, cn as Theme, d as TextOptions, tt as PartEdit, xt as PanelKind } from "./shapes-dSoHjzhn.js";
2
2
  interface ParseOptions {
3
3
  /**
4
4
  * Reads a file named by `import "..."`. Gets the resolved path (relative
@@ -204,8 +204,9 @@ declare function embedFonts(svg: string, fonts?: "page" | FontSource[]): Promise
204
204
  * it uses. Text is measured when the diagram renders, and a font that has
205
205
  * not loaded yet is measured with its fallback. Resolves true when a font
206
206
  * finished loading that was not ready before: render again for exact boxes.
207
+ * `families` saves a scan when the caller already has `svgFamilies(svg)`.
207
208
  */
208
- declare function loadFonts(svg: string): Promise<boolean>;
209
+ declare function loadFonts(svg: string, families?: Set<string>): Promise<boolean>;
209
210
  /**
210
211
  * Draws an SVG string, such as `render(...).svg`, into a canvas. The page's
211
212
  * web fonts that the diagram names are embedded first (see `fonts`).
@@ -288,25 +289,6 @@ declare const NUMBERS: string[];
288
289
  /** a panel kind's typed header props, looked up by kind name */
289
290
  type PanelOptions = (kind: string) => Record<string, PanelOption> | undefined;
290
291
  declare function lint(d: Diagram, panelOptions?: PanelOptions): void;
291
- declare const GUIDE: string;
292
- declare const shapes: YuhwaPlugin;
293
- declare const markers: YuhwaPlugin;
294
- declare const themes: YuhwaPlugin;
295
- declare const charts: YuhwaPlugin;
296
- declare const tables: YuhwaPlugin;
297
- declare const frames: YuhwaPlugin;
298
- declare const footer: YuhwaPlugin;
299
- declare const legend: YuhwaPlugin;
300
- declare const sequence: YuhwaPlugin;
301
- declare const timeline: YuhwaPlugin;
302
- declare const chart: YuhwaPlugin;
303
- declare const git: YuhwaPlugin;
304
- declare const mindmap: YuhwaPlugin;
305
- declare const gantt: YuhwaPlugin;
306
- declare const quadrant: YuhwaPlugin;
307
- declare const kanban: YuhwaPlugin;
308
- declare const treeview: YuhwaPlugin;
309
- declare const builtins: YuhwaPlugin[];
310
292
  interface Options extends LayoutOptions, RenderOptions {
311
293
  /**
312
294
  * Reads files named by `import "..."`: gets the resolved path, returns the
@@ -315,6 +297,12 @@ interface Options extends LayoutOptions, RenderOptions {
315
297
  resolve?: ParseOptions["resolve"];
316
298
  /** path of the source being rendered; relative imports resolve against it */
317
299
  file?: string;
300
+ /**
301
+ * The reader's colour scheme. Set, a light/dark pair theme (`auto`), and a
302
+ * diagram with no theme at all, draw only that side instead of one SVG that
303
+ * follows `prefers-color-scheme`. The browser runtime sets it.
304
+ */
305
+ scheme?: "light" | "dark";
318
306
  }
319
307
  interface Result {
320
308
  svg: string;
@@ -338,6 +326,14 @@ declare function toSource(input: string | DiagramJSON): {
338
326
  format: InputFormat;
339
327
  diagnostics: Diagnostic[];
340
328
  };
329
+ /**
330
+ * Parse, lay out and draw a diagram as text: box-drawing characters, or plain
331
+ * ASCII with `ascii: true`. Panels draw themselves when their kind has a text
332
+ * form (sequence, treeview); others get a placeholder line. Never throws.
333
+ */
334
+ declare function renderText(input: string | DiagramJSON, opts?: Options & TextOptions): Omit<Result, "svg"> & {
335
+ text: string;
336
+ };
341
337
  /** Parse, lay out and render a diagram to an SVG string. Never throws on bad input. */
342
338
  declare function render(input: string | DiagramJSON, opts?: Options): Result;
343
- export { addNode as $, GROUP_PROPS as A, MdBlock as B, markers as C, ParseOptions as Ct, COLORS as D, BOOLS as E, lint as F, replaceBlockSource as G, MdResult as H, ConvertResult as I, embedFonts as J, FontSource as K, fromMermaid as L, NUMBERS as M, PANEL_PROPS as N, EDGE_PROPS as O, PANEL_PROP_HELP as P, addEdge as Q, isMermaid as R, themes as S, SETTING_VALUES as St, GUIDE as T, findBlocks as U, MdOptions as V, processMarkdown as W, svgToCanvas as X, loadFonts as Y, Target as Z, legend as _, isYuhwaPath as _t, render as a, setProp as at, tables as b, KNOWN_SETTINGS as bt, treeview as c, writePanelDrag as ct, gantt as d, DiagramJSON as dt, editPart as et, mindmap as f, JsonResult as ft, sequence as g, parse as gt, timeline as h, layout as ht, hash as i, setPartTone as it, NODE_PROPS as j, ENUMS as k, kanban as l, ALIGN_SIDES as lt, chart as m, renderSvg as mt, Options as n, removeElement as nt, toSource as o, setSetting as ot, git as p, fromJSON as pt, RasterOptions as q, Result as r, setLabel as rt, builtins as s, writeLayout as st, InputFormat as t, formatLayout as tt, quadrant as u, GRID as ut, footer as v, joinPath as vt, shapes as w, charts as x, SETTING_HELP as xt, frames as y, PANELS as yt, MD_LANGUAGES as z };
339
+ export { isYuhwaPath as $, embedFonts as A, setPartTone as B, MdOptions as C, replaceBlockSource as D, processMarkdown as E, addNode as F, ALIGN_SIDES as G, setSetting as H, editPart as I, JsonResult as J, GRID as K, formatLayout as L, svgToCanvas as M, Target as N, FontSource as O, addEdge as P, parse as Q, removeElement as R, MdBlock as S, findBlocks as T, writeLayout as U, setProp as V, writePanelDrag as W, renderSvg as X, fromJSON as Y, layout as Z, lint as _, render as a, ParseOptions as at, isMermaid as b, BOOLS as c, ENUMS as d, joinPath as et, GROUP_PROPS as f, PANEL_PROP_HELP as g, PANEL_PROPS as h, hash as i, SETTING_VALUES as it, loadFonts as j, RasterOptions as k, COLORS as l, NUMBERS as m, Options as n, KNOWN_SETTINGS as nt, renderText as o, NODE_PROPS as p, DiagramJSON as q, Result as r, SETTING_HELP as rt, toSource as s, InputFormat as t, PANELS as tt, EDGE_PROPS as u, ConvertResult as v, MdResult as w, MD_LANGUAGES as x, fromMermaid as y, setLabel as z };