guidex 0.2.5 → 0.3.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 (46) hide show
  1. package/README.md +239 -3
  2. package/dist/lib/app/ControlsRow.d.ts +1 -0
  3. package/dist/lib/app/Editor.d.ts +1 -0
  4. package/dist/lib/app/EditorContext.d.ts +17 -0
  5. package/dist/lib/app/EditorTextarea.d.ts +1 -0
  6. package/dist/lib/app/ExportSettings.d.ts +1 -0
  7. package/dist/lib/app/FeedbackSpan.d.ts +5 -0
  8. package/dist/lib/app/RenderSettings.d.ts +1 -0
  9. package/dist/lib/app/SamplesRow.d.ts +1 -0
  10. package/dist/lib/app/SettingsMenu.d.ts +1 -0
  11. package/dist/lib/app/SettingsPanel.d.ts +1 -0
  12. package/dist/lib/app/SyllablesTable.d.ts +1 -0
  13. package/dist/lib/app/WordCheckPanel.d.ts +1 -0
  14. package/dist/lib/app/WordCopyControls.d.ts +1 -0
  15. package/dist/lib/app/chantLibrary.d.ts +11 -0
  16. package/dist/lib/app/editorState.d.ts +159 -0
  17. package/dist/lib/app/samples.d.ts +10 -0
  18. package/dist/lib/app/wordCopy.d.ts +30 -0
  19. package/dist/lib/chantLayout-GAfg2iKS.js +1042 -0
  20. package/dist/lib/chantLayout.d.ts +169 -0
  21. package/dist/lib/chantMarkup.d.ts +36 -0
  22. package/dist/lib/editorStorage.d.ts +179 -0
  23. package/dist/lib/embed/index.d.ts +1 -0
  24. package/dist/lib/embed/index.js +2 -2
  25. package/dist/lib/embed/manual.d.ts +19 -1
  26. package/dist/lib/embed/manual.js +43 -2
  27. package/dist/lib/guidoRender.d.ts +22 -29
  28. package/dist/lib/guidoScript.d.ts +31 -3
  29. package/dist/lib/guidoScriptTransforms.d.ts +5 -4
  30. package/dist/lib/guidoStyles.d.ts +23 -5
  31. package/dist/lib/main.d.ts +0 -1
  32. package/dist/lib/react/GuidexScore.d.ts +1 -1
  33. package/dist/lib/react/index.d.ts +1 -0
  34. package/dist/lib/react/index.js +2 -2
  35. package/dist/lib/scoreImage-DnFIbtF_.js +951 -0
  36. package/dist/lib/scoreImage.d.ts +63 -0
  37. package/dist/lib/word/index.d.ts +17 -0
  38. package/dist/lib/word/index.js +2 -0
  39. package/dist/lib/wordChecker-C3nJrk_j.js +1042 -0
  40. package/dist/lib/wordChecker.d.ts +66 -0
  41. package/dist/lib/wordClipboard.d.ts +25 -0
  42. package/dist/lib/wordExport.d.ts +244 -0
  43. package/dist-embed/guidex-embed.min.js +1 -1
  44. package/package.json +8 -1
  45. package/dist/lib/core-CmzGmufM.js +0 -1262
  46. package/dist/lib/settingsMenu.d.ts +0 -1
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Score image export: turns a rendered score's DOM into a PNG (and a
3
+ * self-contained SVG), exactly as the page paints it.
4
+ *
5
+ * The technique is the standard foreignObject capture: the score subtree
6
+ * is cloned with its computed styles inlined, wrapped in a
7
+ * `<foreignObject>` and loaded as an `<img>` — an isolated document that
8
+ * cannot fetch anything, so the webfonts travel along as base64 data
9
+ * URLs — which the browser then rasterizes with its own text engine.
10
+ * Drawing that image onto a canvas and encoding it yields the PNG. Every
11
+ * placement decision is already baked into the cloned markup as inline
12
+ * px styles (the renderer's spacer spans, raises, and the break star),
13
+ * so the picture matches the screen by construction rather than by
14
+ * re-implementation; the computed-style copy also resolves the theme's
15
+ * CSS variables (red accents, dark-mode palette) into literals at export
16
+ * time.
17
+ */
18
+ /** Options shared by every export entry point. */
19
+ export interface ScoreImageOptions {
20
+ /** Raster size multiplier against the CSS-pixel layout (default 2 —
21
+ * crisp on retina displays and in print). SVG download ignores it. */
22
+ scale?: number;
23
+ /** Fill painted behind the score — a canvas fill on the PNG and a
24
+ * `<rect>` in the SVG; undefined or null leaves the export
25
+ * transparent. */
26
+ background?: string | null;
27
+ /** Margin around the cropped score content, in layout px (default 0). */
28
+ padding?: number;
29
+ /** Overrides the ink color of everything that is not the accent
30
+ * (text and notes lines alike); undefined keeps the displayed
31
+ * colors. Any CSS color string. */
32
+ foreground?: string | null;
33
+ /** Overrides the style set's accent ink (the red runs: initial,
34
+ * rubrics, Liturgy text, the star); undefined keeps the displayed
35
+ * color. Applies only where the style set actually uses the accent
36
+ * (Vesperale has none). Any CSS color string. */
37
+ accent?: string | null;
38
+ }
39
+ /** Download options: the same raster options plus the filename. */
40
+ export interface ScoreDownloadOptions extends ScoreImageOptions {
41
+ /** Download filename (default `score.png` / `score.svg`). */
42
+ filename?: string;
43
+ }
44
+ /** Splits a computed font-family stack into family names, honoring
45
+ * quotes around names that contain commas. */
46
+ export declare function parseFamilies(stack: string): string[];
47
+ /** Serializes the rendered score under `el` into a self-contained SVG
48
+ * string (fonts embedded, colors resolved) sized to the score's content.
49
+ * Throws when no score was rendered into the element. */
50
+ export declare function scoreSvg(el: HTMLElement, options?: ScoreImageOptions): Promise<string>;
51
+ /** Rasterizes the rendered score under `el` to a PNG blob: the
52
+ * self-contained SVG loads as an image (the browser's own renderer
53
+ * paints it, so the picture matches the DOM exactly) and draws onto a
54
+ * canvas at `scale`×. Throws when no score was rendered into the
55
+ * element or the environment has no 2D canvas. */
56
+ export declare function scorePngBlob(el: HTMLElement, options?: ScoreImageOptions): Promise<Blob>;
57
+ /** Exports the rendered score under `el` as a PNG download. Resolves
58
+ * with the filename used. */
59
+ export declare function downloadScorePng(el: HTMLElement, options?: ScoreDownloadOptions): Promise<string>;
60
+ /** Exports the rendered score under `el` as a self-contained SVG
61
+ * download (fonts embedded — the print-friendlier artifact). Resolves
62
+ * with the filename used. */
63
+ export declare function downloadScoreSvg(el: HTMLElement, options?: ScoreDownloadOptions): Promise<string>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Word entry (`guidex/word`): the Word-compatible export for consumers
3
+ * assembling Word documents themselves. `layoutForWord` returns the
4
+ * layout as structured lines — per line pair, the notes text and the
5
+ * text line as styled runs with self-correcting spacer counts (and their
6
+ * absolute end positions, which double as tab stops for the tab
7
+ * strategy) — so a `.docx` builder (e.g. the `docx` library) can emit
8
+ * paragraphs directly instead of parsing the clipboard HTML.
9
+ * `wordLayoutText(layout)` serializes it to exactly `toWordText`'s output.
10
+ *
11
+ * Browser-only: the layout measures with canvas and loaded webfonts
12
+ * (import `guidex/guidex.css`, or @font-face the fonts yourself).
13
+ */
14
+ export { DEFAULT_SPACER, DEFAULT_TAB_INTERVAL_PT, SpacerMeter, layoutForWord, toWordHtml, toWordText, wordLayoutText, type SpacerChar, type SpacerConfig, type SpacerWidth, type WordExportOptions, type WordLayout, type WordLine, type WordRun, type WordStyleNames, type WordTextPiece, } from '../wordExport';
15
+ export { copyWordHtml, copyWordPlainText, type CopyResult } from '../wordClipboard';
16
+ export { checkWordHtml, type WordCheckIssue, type WordCheckReport, type WordGapClass, type WordGapMechanism, type WordGapStat, type WordParagraphDiag, } from '../wordChecker';
17
+ export type { StyleSetName, ChantRunKind } from '../guidoStyles';
@@ -0,0 +1,2 @@
1
+ import { a as DEFAULT_TAB_INTERVAL_PT, c as toWordHtml, i as DEFAULT_SPACER, l as toWordText, n as copyWordHtml, o as SpacerMeter, r as copyWordPlainText, s as layoutForWord, t as checkWordHtml, u as wordLayoutText } from "../wordChecker-C3nJrk_j.js";
2
+ export { DEFAULT_SPACER, DEFAULT_TAB_INTERVAL_PT, SpacerMeter, checkWordHtml, copyWordHtml, copyWordPlainText, layoutForWord, toWordHtml, toWordText, wordLayoutText };