guidex 0.2.6 → 0.3.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/README.md +235 -0
- package/dist/lib/app/ControlsRow.d.ts +1 -0
- package/dist/lib/app/Editor.d.ts +1 -0
- package/dist/lib/app/EditorContext.d.ts +17 -0
- package/dist/lib/app/EditorTextarea.d.ts +1 -0
- package/dist/lib/app/ExportSettings.d.ts +1 -0
- package/dist/lib/app/FeedbackSpan.d.ts +5 -0
- package/dist/lib/app/RenderSettings.d.ts +1 -0
- package/dist/lib/app/SamplesRow.d.ts +1 -0
- package/dist/lib/app/SettingsMenu.d.ts +1 -0
- package/dist/lib/app/SettingsPanel.d.ts +1 -0
- package/dist/lib/app/SyllablesTable.d.ts +1 -0
- package/dist/lib/app/WordCheckPanel.d.ts +1 -0
- package/dist/lib/app/WordCopyControls.d.ts +1 -0
- package/dist/lib/app/chantLibrary.d.ts +11 -0
- package/dist/lib/app/editorState.d.ts +159 -0
- package/dist/lib/app/samples.d.ts +10 -0
- package/dist/lib/app/wordCopy.d.ts +30 -0
- package/dist/lib/chantLayout-GAfg2iKS.js +1042 -0
- package/dist/lib/chantLayout.d.ts +169 -0
- package/dist/lib/chantMarkup.d.ts +36 -0
- package/dist/lib/editorStorage.d.ts +179 -0
- package/dist/lib/embed/index.d.ts +1 -0
- package/dist/lib/embed/index.js +2 -2
- package/dist/lib/embed/manual.d.ts +16 -4
- package/dist/lib/embed/manual.js +315 -2
- package/dist/lib/glyphFamilies.d.ts +46 -0
- package/dist/lib/guidoRender.d.ts +22 -29
- package/dist/lib/guidoScript.d.ts +28 -3
- package/dist/lib/guidoScriptTransforms.d.ts +5 -4
- package/dist/lib/guidoStyles.d.ts +23 -5
- package/dist/lib/main.d.ts +0 -1
- package/dist/lib/react/index.d.ts +1 -0
- package/dist/lib/react/index.js +2 -2
- package/dist/lib/scoreImage-oVBasBX5.js +951 -0
- package/dist/lib/scoreImage.d.ts +63 -0
- package/dist/lib/word/index.d.ts +17 -0
- package/dist/lib/word/index.js +2 -0
- package/dist/lib/wordChecker-C3nJrk_j.js +1042 -0
- package/dist/lib/wordChecker.d.ts +66 -0
- package/dist/lib/wordClipboard.d.ts +25 -0
- package/dist/lib/wordExport.d.ts +244 -0
- package/dist-embed/guidex-embed.min.js +1 -1
- package/package.json +8 -1
- package/dist/lib/core-hF6L1EtS.js +0 -1268
- 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 };
|