guidex 0.5.0 → 0.6.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.
- package/CHANGELOG.md +215 -0
- package/README.md +62 -16
- package/dist/lib/app/App.d.ts +1 -0
- package/dist/lib/app/AretinoControls.d.ts +35 -0
- package/dist/lib/app/CaretBand.d.ts +28 -0
- package/dist/lib/app/Developers.d.ts +13 -0
- package/dist/lib/app/EditorContext.d.ts +15 -0
- package/dist/lib/app/EditorTextarea.d.ts +18 -1
- package/dist/lib/app/EditorToolbar.d.ts +13 -0
- package/dist/lib/app/ExportSettings.d.ts +20 -1
- package/dist/lib/app/Footer.d.ts +1 -0
- package/dist/lib/app/GlyphChooser.d.ts +31 -0
- package/dist/lib/app/Inspector.d.ts +26 -0
- package/dist/lib/app/LiveScore.d.ts +31 -0
- package/dist/lib/app/Opening.d.ts +3 -0
- package/dist/lib/app/Reference.d.ts +28 -0
- package/dist/lib/app/RenderSettings.d.ts +2 -1
- package/dist/lib/app/ScriptViews.d.ts +8 -0
- package/dist/lib/app/SectionSize.d.ts +33 -0
- package/dist/lib/app/StaffSettings.d.ts +4 -0
- package/dist/lib/app/StaffedGlyph.d.ts +8 -0
- package/dist/lib/app/Tabs.d.ts +15 -0
- package/dist/lib/app/TakeItOut.d.ts +1 -0
- package/dist/lib/app/ThemeSwitch.d.ts +1 -0
- package/dist/lib/app/TopBar.d.ts +6 -0
- package/dist/lib/app/WidthControls.d.ts +21 -0
- package/dist/lib/app/aretinoCaret.d.ts +47 -0
- package/dist/lib/app/aretinoSource.d.ts +46 -0
- package/dist/lib/app/caretSync.d.ts +48 -0
- package/dist/lib/app/chantLibrary.d.ts +8 -4
- package/dist/lib/app/editorSnapshot.d.ts +11 -0
- package/dist/lib/app/editorState.d.ts +38 -5
- package/dist/lib/app/expandLink.d.ts +19 -0
- package/dist/lib/app/glyphData.d.ts +37 -0
- package/dist/lib/app/inCode.d.ts +4 -0
- package/dist/lib/app/insertAtCaret.d.ts +12 -0
- package/dist/lib/app/learn/Learn.d.ts +1 -0
- package/dist/lib/app/learn/LessonCard.d.ts +12 -0
- package/dist/lib/app/learn/lessons.d.ts +64 -0
- package/dist/lib/app/learn/narrowing.d.ts +24 -0
- package/dist/lib/app/learn/progress.d.ts +14 -0
- package/dist/lib/app/pageEvents.d.ts +14 -0
- package/dist/lib/app/previewHighlight.d.ts +44 -0
- package/dist/lib/app/samples.d.ts +9 -1
- package/dist/lib/app/scriptParts.d.ts +31 -0
- package/dist/lib/app/shareLink.d.ts +12 -2
- package/dist/lib/app/showcases/Showcases.d.ts +17 -0
- package/dist/lib/app/wordCopy.d.ts +4 -0
- package/dist/lib/aretino/fromAretino.d.ts +99 -0
- package/dist/lib/aretino/index.d.ts +38 -0
- package/dist/lib/aretino/index.js +1870 -0
- package/dist/lib/aretino/toAretino.d.ts +27 -0
- package/dist/lib/chantLayout-BRQ6FYND.js +1345 -0
- package/dist/lib/chantLayout.d.ts +101 -6
- package/dist/lib/chantMarkup-DX4K86Rv.js +993 -0
- package/dist/lib/drawnStaff.d.ts +39 -5
- package/dist/lib/editorStorage.d.ts +48 -6
- package/dist/lib/embed/core.d.ts +15 -1
- package/dist/lib/embed/index.js +1 -1
- package/dist/lib/embed/manual.d.ts +5 -4
- package/dist/lib/embed/manual.js +6 -4
- package/dist/lib/fonts/guidohu-staffless.woff2 +0 -0
- package/dist/lib/fonts/guidohu.ttf +0 -0
- package/dist/lib/glyphFamilies.d.ts +5 -1
- package/dist/lib/guidoRender.d.ts +30 -1
- package/dist/lib/guidoScriptTransforms.d.ts +2 -2
- package/dist/lib/guidoStyles-CvnACCsk.js +1466 -0
- package/dist/lib/guidoStyles.d.ts +23 -2
- package/dist/lib/react/GuidexScore.d.ts +10 -2
- package/dist/lib/react/index.js +14 -4
- package/dist/lib/{scoreImage-B2SGdROL.js → scoreImage-CKsQxHg5.js} +282 -1026
- package/dist/lib/theme.d.ts +13 -0
- package/dist/lib/word/index.d.ts +1 -1
- package/dist/lib/word/index.js +1 -1
- package/dist/lib/{wordChecker-CjYl2yof.js → wordChecker-BN_9dKAx.js} +133 -20
- package/dist/lib/wordChecker.d.ts +18 -1
- package/dist/lib/wordExport.d.ts +51 -3
- package/dist-embed/demo.html +2 -2
- package/dist-embed/fonts/guidohu-staffless.woff2 +0 -0
- package/dist-embed/fonts/guidohu.ttf +0 -0
- package/dist-embed/guidex-embed.min.js +1 -1
- package/package.json +10 -1
- package/dist/lib/app/ControlsRow.d.ts +0 -1
- package/dist/lib/app/SettingsMenu.d.ts +0 -1
- package/dist/lib/app/SettingsPanel.d.ts +0 -1
- package/dist/lib/chantLayout-BrCQUOhp.js +0 -2616
package/dist/lib/drawnStaff.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** How the staff is drawn: by the font (Guido HU's own lines
|
|
2
|
-
* or as elements behind the staffless font. */
|
|
1
|
+
/** How the staff is drawn: by the font (Guido HU's own lines)
|
|
2
|
+
* or as elements behind the staffless font (the default). */
|
|
3
3
|
export type StaffMode = 'font' | 'drawn';
|
|
4
4
|
/** A staff line color: any CSS color (alpha included), or one for the light
|
|
5
5
|
* and one for the dark color scheme. */
|
|
@@ -10,7 +10,7 @@ export type StaffColor = string | {
|
|
|
10
10
|
export type PitchLetter = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g';
|
|
11
11
|
/** The drawn staff's options (render, embed and React). */
|
|
12
12
|
export interface DrawnStaffOptions {
|
|
13
|
-
/** How the staff is drawn (default `font`); every option below needs `drawn` */
|
|
13
|
+
/** How the staff is drawn (default `drawn`; `font` keeps Guido HU's own lines); every option below needs `drawn` */
|
|
14
14
|
staff?: StaffMode;
|
|
15
15
|
/** The fewest lines to draw, 1–5 (default 5). The lines sit where the
|
|
16
16
|
* score's notes and clefs need them, and more are drawn when a note
|
|
@@ -32,6 +32,12 @@ export interface DrawnStaffOptions {
|
|
|
32
32
|
* follows inline clef changes (default 1): above 1, the clef's line
|
|
33
33
|
* stands out from the others */
|
|
34
34
|
staffClefLineWeight?: number;
|
|
35
|
+
/** Color of the line the clef in effect sits on, following inline clef
|
|
36
|
+
* changes; wins over every other color. With `clefMark: 'line'` this
|
|
37
|
+
* line is how the clef shows (default: the style set's `clefLine`).
|
|
38
|
+
* `'none'` colors it like any other line (the pitch, position or
|
|
39
|
+
* every-line color), the style set's color included */
|
|
40
|
+
staffClefLineColor?: ClefLineColor;
|
|
35
41
|
/** Run every drawn line past the score: `start` is where the lines begin
|
|
36
42
|
* and `end` where they end, in px from the notes line's left edge (a
|
|
37
43
|
* negative `start` reaches left of it). A line already longer keeps its
|
|
@@ -67,9 +73,14 @@ export interface StaffLineRange {
|
|
|
67
73
|
export declare function chooseStaffLines(lines: readonly {
|
|
68
74
|
clefPrefix: string;
|
|
69
75
|
notesParts: readonly string[];
|
|
76
|
+
clefs?: readonly {
|
|
77
|
+
clef: string;
|
|
78
|
+
}[];
|
|
70
79
|
}[], fewest?: number): StaffLineRange;
|
|
71
80
|
/** The color a line takes under `clef` (a clef glyph), or undefined for
|
|
72
81
|
* the default (the notes' text color). */
|
|
82
|
+
/** The clef line's color: a staff color, or `'none'` for no color of its own. */
|
|
83
|
+
export type ClefLineColor = StaffColor | 'none';
|
|
73
84
|
export declare function staffLineColor(index: number, clef: string, options: DrawnStaffOptions): StaffColor | undefined;
|
|
74
85
|
/** A line's thickness multiplier under `clef`: all lines × its position ×
|
|
75
86
|
* the clef's own line. */
|
|
@@ -82,15 +93,36 @@ export interface StaffSpan {
|
|
|
82
93
|
color: StaffColor | undefined;
|
|
83
94
|
/** Thickness multiplier (1 = the font's line) */
|
|
84
95
|
weight: number;
|
|
96
|
+
/** Whether this is the line the clef in effect sits on */
|
|
97
|
+
clefLine?: boolean;
|
|
85
98
|
}
|
|
86
99
|
/**
|
|
87
100
|
* The drawn line stretches of one notes line: `text` as the notes line holds
|
|
88
101
|
* it (clef prefix and notes), plus the break marker `*` when it stands
|
|
89
102
|
* `breakMarkerLeftPx` past the text. Each line index in `range` is one span
|
|
90
103
|
* per run of glyphs with the same color and weight, which change at an
|
|
91
|
-
* inline clef.
|
|
104
|
+
* inline clef. `clefs` (the layout line's) say where each clef takes
|
|
105
|
+
* effect when the text has no clef glyphs (`clefMark: 'line'`); clef
|
|
106
|
+
* glyphs in the text count too.
|
|
92
107
|
*/
|
|
93
|
-
export declare function staffSpans(text: string, notesPx: number, range: StaffLineRange, options?: DrawnStaffOptions, breakMarkerLeftPx?: number
|
|
108
|
+
export declare function staffSpans(text: string, notesPx: number, range: StaffLineRange, options?: DrawnStaffOptions, breakMarkerLeftPx?: number, clefs?: readonly {
|
|
109
|
+
at: number;
|
|
110
|
+
clef: string;
|
|
111
|
+
}[]): StaffSpan[];
|
|
112
|
+
/** The inline style of a drawn staff's anchor: zero-size, on the baseline. */
|
|
113
|
+
export declare const STAFF_ANCHOR_CSS = "position:relative;display:inline-block;width:0;height:0;vertical-align:baseline;user-select:none;pointer-events:none";
|
|
114
|
+
/**
|
|
115
|
+
* Where a drawn line stretch sits against its anchor: left and width in
|
|
116
|
+
* `unit` (the span's own unit: px from `staffSpans` with the notes size, em
|
|
117
|
+
* with a notes size of 1), bottom and height in em of the notes font. A
|
|
118
|
+
* weighted line grows from the font line's centre.
|
|
119
|
+
*/
|
|
120
|
+
export declare function staffLinePlacement(span: StaffSpan, unit?: 'px' | 'em'): {
|
|
121
|
+
left: string;
|
|
122
|
+
width: string;
|
|
123
|
+
bottom: string;
|
|
124
|
+
height: string;
|
|
125
|
+
};
|
|
94
126
|
/**
|
|
95
127
|
* The drawn staff of one notes line: a zero-size anchor on the baseline at
|
|
96
128
|
* the line's start, holding one absolutely placed span per stretch. Heights
|
|
@@ -116,6 +148,8 @@ export declare function snapStaff(root: ParentNode): void;
|
|
|
116
148
|
* undefined.
|
|
117
149
|
*/
|
|
118
150
|
export declare function parseStaffColor(text: string | undefined, label?: string): StaffColor | undefined;
|
|
151
|
+
/** The clef line's color as text: a staff color, or `none` (any case). */
|
|
152
|
+
export declare function parseClefLineColor(text: string | undefined, label?: string): ClefLineColor | undefined;
|
|
119
153
|
/** Colors by position as text: up to five colors (`light|dark` each),
|
|
120
154
|
* bottom line first, separated by `;` (an empty entry keeps the default). */
|
|
121
155
|
export declare function parseStaffLineColors(text: string | undefined): (StaffColor | undefined)[] | undefined;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { StaffFill } from './chantLayout';
|
|
1
|
+
import { ClefMark, StaffFill } from './chantLayout';
|
|
2
2
|
import { StyleSetName } from './guidoStyles';
|
|
3
3
|
import { SpacerChar } from './wordExport';
|
|
4
4
|
import { StaffMode } from './drawnStaff';
|
|
5
5
|
/** Versioned localStorage key; an unknown version is ignored wholesale. */
|
|
6
6
|
export declare const EDITOR_STORAGE_KEY = "guidex.editor.v1";
|
|
7
|
-
export declare const EDITOR_SCHEMA_VERSION =
|
|
7
|
+
export declare const EDITOR_SCHEMA_VERSION = 2;
|
|
8
|
+
/** The schema version 0.5.x wrote, migrated on read (see the top). */
|
|
9
|
+
export declare const LEGACY_SCHEMA_VERSION = 1;
|
|
8
10
|
/** Base text size for every renderer on the page; the chant font is 2× this. */
|
|
9
|
-
export declare const RENDER_BASE_PX =
|
|
11
|
+
export declare const RENDER_BASE_PX = 20;
|
|
10
12
|
/** Declared range of the base font size input: the min/max attributes and
|
|
11
13
|
* the sanitizer's clamp, from one source. */
|
|
12
14
|
export declare const BASE_PX_MIN = 12;
|
|
@@ -25,6 +27,11 @@ export declare const JUNCTION_DASHES_MIN = 1;
|
|
|
25
27
|
export declare const JUNCTION_DASHES_MAX = 8;
|
|
26
28
|
export declare const STAFF_FILL_SNAP_MIN = 0;
|
|
27
29
|
export declare const STAFF_FILL_SNAP_MAX = 60;
|
|
30
|
+
/** The break-star padding slider's range, px; the default is the built-in
|
|
31
|
+
* style sets' own padding. */
|
|
32
|
+
export declare const PADDING_MIN = 0;
|
|
33
|
+
export declare const PADDING_MAX = 40;
|
|
34
|
+
export declare const PADDING_DEFAULT = 12;
|
|
28
35
|
export declare const STAFF_LINES_MIN = 1;
|
|
29
36
|
export declare const STAFF_LINES_MAX = 5;
|
|
30
37
|
/** The staff weight sliders' range (a multiple of the font's line). */
|
|
@@ -55,7 +62,12 @@ export interface WordCopySettings {
|
|
|
55
62
|
export interface EditorSettings {
|
|
56
63
|
style: StyleSetName;
|
|
57
64
|
bold: boolean;
|
|
65
|
+
/** The text font, an installed font by name ('' = the style set's). */
|
|
66
|
+
textFont: string;
|
|
58
67
|
maxWidthPx: number;
|
|
68
|
+
/** The line width set aside: the score is one line, never broken (a page
|
|
69
|
+
* setting, like the width: not part of a saved chant or a share link). */
|
|
70
|
+
unboundWidth: boolean;
|
|
59
71
|
transpose: number;
|
|
60
72
|
basePx: number;
|
|
61
73
|
decoupleNotes: boolean;
|
|
@@ -69,6 +81,8 @@ export interface EditorSettings {
|
|
|
69
81
|
staffFill: StaffFill;
|
|
70
82
|
/** With `longest`: the distance from the max width that snaps to it. */
|
|
71
83
|
staffFillSnapPx: number;
|
|
84
|
+
/** The gap between a broken line's notes and its break star, px. */
|
|
85
|
+
paddingPx: number;
|
|
72
86
|
/** Two-syllable recitations as plain notes (issue #21). */
|
|
73
87
|
twoSyllableRecitationsToPlain: boolean;
|
|
74
88
|
/** Three or more plain notes on a line as a recitation (issue #21). */
|
|
@@ -85,6 +99,10 @@ export interface EditorSettings {
|
|
|
85
99
|
staffWeight: number;
|
|
86
100
|
staffLineWeights: string;
|
|
87
101
|
staffClefLineWeight: number;
|
|
102
|
+
/** The clef line's color, text like `staffColor` ('' = the style set's). */
|
|
103
|
+
staffClefLineColor: string;
|
|
104
|
+
/** How a line shows its clef: the glyph, or a marked staff line. */
|
|
105
|
+
clefMark: ClefMark;
|
|
88
106
|
/** The preview's drawn lines run to the screen's edges (a page
|
|
89
107
|
* setting: not part of a saved chant or a share link). */
|
|
90
108
|
staffToEdges: boolean;
|
|
@@ -108,7 +126,8 @@ export type EditorSettingsPatch = Partial<Omit<EditorSettings, 'word'>> & {
|
|
|
108
126
|
/** #rrggbb for a color picker, or the fallback when the value is not a
|
|
109
127
|
* 6-digit hex (the theme's palette variables always are). */
|
|
110
128
|
export declare function hexColor(value: string, fallback: string): string;
|
|
111
|
-
/** Loads the sanitized settings — always complete, never throws.
|
|
129
|
+
/** Loads the sanitized settings — always complete, never throws. A 0.5.x
|
|
130
|
+
* blob is migrated and written back on the way. */
|
|
112
131
|
export declare function loadEditorSettings(): EditorSettings;
|
|
113
132
|
/** Schedules a debounced save of the given settings slice; repeated calls
|
|
114
133
|
* within the window accumulate into one write. */
|
|
@@ -134,6 +153,14 @@ export declare function flushSettingsSave(): void;
|
|
|
134
153
|
/** Versioned localStorage key for the script draft; the value is the raw
|
|
135
154
|
* textarea string, so the version lives in the key itself. */
|
|
136
155
|
export declare const DRAFT_STORAGE_KEY = "guidex.draft.v1";
|
|
156
|
+
/** The syntax a script is written in: GuidoScript, or Aretino (issue #79),
|
|
157
|
+
* which the editor converts to GuidoScript on every edit. */
|
|
158
|
+
export type ScriptSyntax = 'guido' | 'aretino';
|
|
159
|
+
/** The draft's syntax, under its own key next to the draft: absent (every
|
|
160
|
+
* draft written before issue #79) is GuidoScript. */
|
|
161
|
+
export declare const DRAFT_SYNTAX_STORAGE_KEY = "guidex.draft-syntax.v1";
|
|
162
|
+
export declare function saveDraftSyntax(syntax: ScriptSyntax): void;
|
|
163
|
+
export declare function loadDraftSyntax(): ScriptSyntax;
|
|
137
164
|
/** Schedules a debounced save of the given draft text; repeated calls
|
|
138
165
|
* within the window collapse into one write of the last text. */
|
|
139
166
|
export declare function scheduleDraftSave(text: string): void;
|
|
@@ -169,11 +196,13 @@ export declare function loadDraft(): string | null;
|
|
|
169
196
|
*/
|
|
170
197
|
/** Versioned localStorage key for the chant library. */
|
|
171
198
|
export declare const CHANTS_STORAGE_KEY = "guidex.chants.v1";
|
|
172
|
-
|
|
199
|
+
/** Version 2 migrates the 0.5.x font staff, like the settings blob. */
|
|
200
|
+
export declare const CHANTS_SCHEMA_VERSION = 2;
|
|
173
201
|
/** The render settings a saved chant snapshots, restored when it loads. */
|
|
174
202
|
export interface ChantPrefs {
|
|
175
203
|
style: StyleSetName;
|
|
176
204
|
bold: boolean;
|
|
205
|
+
textFont: string;
|
|
177
206
|
basePx: number;
|
|
178
207
|
decoupleNotes: boolean;
|
|
179
208
|
/** The chant size while decoupled (the adopted 2× base or a typed one). */
|
|
@@ -183,6 +212,7 @@ export interface ChantPrefs {
|
|
|
183
212
|
junctionDashes: number;
|
|
184
213
|
staffFill: StaffFill;
|
|
185
214
|
staffFillSnapPx: number;
|
|
215
|
+
paddingPx: number;
|
|
186
216
|
twoSyllableRecitationsToPlain: boolean;
|
|
187
217
|
plainRunsToRecitation: boolean;
|
|
188
218
|
staff: StaffMode;
|
|
@@ -193,6 +223,10 @@ export interface ChantPrefs {
|
|
|
193
223
|
staffWeight: number;
|
|
194
224
|
staffLineWeights: string;
|
|
195
225
|
staffClefLineWeight: number;
|
|
226
|
+
/** The clef line's color, text like `staffColor` ('' = the style set's). */
|
|
227
|
+
staffClefLineColor: string;
|
|
228
|
+
/** How a line shows its clef: the glyph, or a marked staff line. */
|
|
229
|
+
clefMark: ClefMark;
|
|
196
230
|
transpose: number;
|
|
197
231
|
}
|
|
198
232
|
export interface SavedChant {
|
|
@@ -200,6 +234,12 @@ export interface SavedChant {
|
|
|
200
234
|
name: string;
|
|
201
235
|
/** The raw script source, as typed — transforms stay in the prefs. */
|
|
202
236
|
script: string;
|
|
237
|
+
/** Set when the script is Aretino (issue #79); absent is GuidoScript. */
|
|
238
|
+
syntax?: 'aretino';
|
|
239
|
+
/** The Aretino reader's version (`ARETINO_CONVERTER_VERSION`) when it
|
|
240
|
+
* was saved: an Aretino chant is converted again on every load, so
|
|
241
|
+
* another reader can draw it differently */
|
|
242
|
+
converter?: number;
|
|
203
243
|
createdAt: number;
|
|
204
244
|
updatedAt: number;
|
|
205
245
|
prefs: ChantPrefs;
|
|
@@ -220,7 +260,9 @@ export declare function newChantId(): string;
|
|
|
220
260
|
* the rest passes through clamped. */
|
|
221
261
|
export declare function sanitizeChantPrefs(raw: unknown): ChantPrefs;
|
|
222
262
|
/** The stored library, sanitized — an empty array when absent, corrupt,
|
|
223
|
-
* or written by an unknown schema version. Never throws.
|
|
263
|
+
* or written by an unknown schema version. Never throws. A 0.5.x library
|
|
264
|
+
* (version 1) loads with each chant's font staff migrated to drawn, every
|
|
265
|
+
* other pref kept, and is written back as the current version. */
|
|
224
266
|
export declare function loadChants(): SavedChant[];
|
|
225
267
|
/** Writes the whole library in the given order — the array order is the
|
|
226
268
|
* display order everywhere. Best-effort like the other keys, but the
|
package/dist/lib/embed/core.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { EmptySlots, StanzaStack, StanzaWarning } from '../stanzas';
|
|
|
2
2
|
import { MarkWarning } from '../chantMarkup';
|
|
3
3
|
import { DrawnStaffOptions } from '../drawnStaff';
|
|
4
4
|
import { SpanProblem } from '../textMarkup';
|
|
5
|
-
import { StaffFill } from '../chantLayout';
|
|
5
|
+
import { ClefMark, StaffFill } from '../chantLayout';
|
|
6
6
|
import { MarkDefinitions, StyleSetName } from '../guidoStyles';
|
|
7
7
|
export declare const version: string;
|
|
8
8
|
/** Line-breaking budget: a fixed pixel width, or 'auto' to fit the
|
|
@@ -28,6 +28,16 @@ export interface EmbedOptions extends DrawnStaffOptions {
|
|
|
28
28
|
/** With `staffFill: 'longest'`: the distance from the available width
|
|
29
29
|
* within which every line runs to it instead (default 0) */
|
|
30
30
|
staffFillSnapPx?: number;
|
|
31
|
+
/** The gap between a broken line's notes and its break star, px
|
|
32
|
+
* (default: the style set's padding, 12; `data-padding`) */
|
|
33
|
+
paddingPx?: number;
|
|
34
|
+
/** How a line shows its clef (default `glyph`): `line` leaves the glyph
|
|
35
|
+
* out and marks the clef's staff line, with the padding on the left
|
|
36
|
+
* too; needs the drawn staff (`data-clef-mark`) */
|
|
37
|
+
clefMark?: ClefMark;
|
|
38
|
+
/** The syllable text's font, an installed font by name (default: the
|
|
39
|
+
* style set's, which stays behind it as the fallback; `data-text-font`) */
|
|
40
|
+
textFont?: string;
|
|
31
41
|
/** Render a recitation that covers exactly 2 syllables on a line as
|
|
32
42
|
* plain notes of the same pitch (default true, issue #21;
|
|
33
43
|
* `data-two-syllable-recitations-to-plain`) */
|
|
@@ -36,6 +46,10 @@ export interface EmbedOptions extends DrawnStaffOptions {
|
|
|
36
46
|
* (`1`–`9`, `ö`, `ü`) on a line as a recitation (default false;
|
|
37
47
|
* `data-plain-runs-to-recitation`) */
|
|
38
48
|
plainRunsToRecitation?: boolean;
|
|
49
|
+
/** Cut an empty slot (`~(…)`) that does not fit at a line end at its
|
|
50
|
+
* dashes, like a sung group (default true; `data-cut-empty-slots`);
|
|
51
|
+
* `false` moves it whole to a fresh line first, as held groups do */
|
|
52
|
+
cutEmptySlots?: boolean;
|
|
39
53
|
transpose?: number;
|
|
40
54
|
/** The stanza sung under the notes (1-based; 1 is the script's own
|
|
41
55
|
* text, 2… its `(@stanza …)` statements or the `stanzas` option). */
|
package/dist/lib/embed/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as dispose, c as renderScore, i as scoreSvg, l as version, n as downloadScoreSvg, o as init, r as scorePngBlob, s as renderAll, t as downloadScorePng } from "../scoreImage-
|
|
1
|
+
import { a as dispose, c as renderScore, i as scoreSvg, l as version, n as downloadScoreSvg, o as init, r as scorePngBlob, s as renderAll, t as downloadScorePng } from "../scoreImage-CKsQxHg5.js";
|
|
2
2
|
//#region src/embed/index.ts
|
|
3
3
|
if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", () => init(), { once: true });
|
|
4
4
|
else init();
|
|
@@ -26,15 +26,16 @@ export { GuidoScript, unescape, chantText, scriptSyllables, type ChantTextOption
|
|
|
26
26
|
export { SCORE_MARKERS, splitNoteMarkers, type NoteGroupParts } from '../noteGroups';
|
|
27
27
|
export { composeScript, type ComposeOptions, type MarkerPart, type NotesPart, type PartTranspose, type ScriptPart, type ScriptSlicePart, } from '../composeScript';
|
|
28
28
|
export { chantRuns, chantHtml, chantTextStyle, markupWarnings, type ChantHtmlOptions, type ChantWordRun, type MarkWarning, } from '../chantMarkup';
|
|
29
|
-
export { STYLE_SETS, DEFAULT_STYLE_SET, defineStyleSet, resolveSyllableParts, type MarkDefinitions, type StyleSetDefinition, } from '../guidoStyles';
|
|
29
|
+
export { STYLE_SETS, DEFAULT_STYLE_SET, defineStyleSet, resolveSyllableParts, cleanFontName, type MarkDefinitions, type StyleSetDefinition, } from '../guidoStyles';
|
|
30
30
|
export type { Mark, SpanProblem, TextRun } from '../textMarkup';
|
|
31
31
|
export { KEY_SIGNATURES, PITCH_ROWS, STANZA_PLACEHOLDER, padStanza, parseInterval, parseStanza, selectStanza, slotCount, smallHeads, stackStanzas, stackedStanzaNumbers, stanzaCount, stanzaTexts, stanzaWarnings, transposeBy, transposeExact, transposeNotes, transposeScript, TranspositionRangeError, withStanza, type EmptySlots, type SelectStanzaOptions, type ScriptTransform, type StanzaOptions, type StanzaStack, type StanzaSyllable, type StanzaWarning, type SpelledInterval, type TransposeOverflow, type TranspositionTarget, } from '../guidoScriptTransforms';
|
|
32
32
|
export type { StyleSetName, SyllablePart, PartStyle, ChantRunKind } from '../guidoStyles';
|
|
33
|
-
export type { StaffFill } from '../chantLayout';
|
|
34
|
-
export {
|
|
33
|
+
export type { StaffFill, ClefMark } from '../chantLayout';
|
|
34
|
+
export { isFontAvailable } from '../chantLayout';
|
|
35
|
+
export { chooseStaffLines, formatStaffColor, parseClefLineColor, parseStaffColor, parseStaffLineColors, parseStaffLineWeights, parseStaffPitchColors, parseStaffWeight, snapStaff, staffLineColor, staffLineWeight, staffSpans, STAFFLESS_FONT_FAMILY, type DrawnStaffOptions, type PitchLetter, type StaffColor, type ClefLineColor, type StaffLineRange, type StaffMode, type StaffOverflow, type StaffSpan, } from '../drawnStaff';
|
|
35
36
|
export type { ChantRun, ChantSyllable, ChantWord, ChantMarkupOptions } from '../chantMarkup';
|
|
36
37
|
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';
|
|
37
38
|
export { baseOf, gClefPitchOf, modifyDown, modifyNatural, modifyUp, toCephalicus, toConnectDown, toLonga, toSmallHead, toSmallPoint, toVirga, variantOf, type VariantRole, } from '../glyphFamilies';
|
|
38
39
|
export { copyWordHtml, copyWordPlainText, type CopyResult } from '../wordClipboard';
|
|
39
|
-
export { checkWordHtml, type WordCheckIssue, type WordCheckReport, type WordGapClass, type WordGapMechanism, type WordGapStat, type WordParagraphDiag, } from '../wordChecker';
|
|
40
|
+
export { checkWordHtml, type WordCheckIssue, type WordCheckOptions, type WordCheckReport, type WordGapClass, type WordGapMechanism, type WordGapStat, type WordParagraphDiag, } from '../wordChecker';
|
|
40
41
|
export { downloadScorePng, downloadScoreSvg, scorePngBlob, scoreSvg, type ScoreDownloadOptions, type ScoreImageOptions, } from '../scoreImage';
|
package/dist/lib/embed/manual.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { B as
|
|
3
|
-
import { a as
|
|
1
|
+
import { S as staffSpans, _ as parseStaffPitchColors, a as dispose, b as staffLineColor, c as renderScore, d as chooseStaffLines, f as formatStaffColor, g as parseStaffLineWeights, h as parseStaffLineColors, i as scoreSvg, l as version, m as parseStaffColor, n as downloadScoreSvg, o as init, p as parseClefLineColor, r as scorePngBlob, s as renderAll, t as downloadScorePng, u as STAFFLESS_FONT_FAMILY, v as parseStaffWeight, x as staffLineWeight, y as snapStaff } from "../scoreImage-CKsQxHg5.js";
|
|
2
|
+
import { A as splitNoteMarkers, B as modifyUp, C as scriptSyllables, E as unescape, F as gClefPitchOf, G as toSmallHead, H as toCephalicus, I as isClefGlyph, J as variantOf, K as toSmallPoint, N as baseOf, R as modifyDown, S as runProperties, T as syllableText, U as toConnectDown, W as toLonga, _ as GuidoScript, a as defineStyleSet, f as resolveSyllableParts, i as cleanFontName, k as SCORE_MARKERS, q as toVirga, r as STYLE_SETS, t as DEFAULT_STYLE_SET, v as chantText, w as statementSource, y as escape, z as modifyNatural } from "../guidoStyles-CvnACCsk.js";
|
|
3
|
+
import { C as stanzaCount, E as withStanza, S as stackedStanzaNumbers, T as stanzaWarnings, _ as parseStanza, a as PITCH_ROWS, b as smallHeads, c as KEY_SIGNATURES, d as sameKeyGlyphs, f as transposeExact, g as padStanza, h as isSlot, i as markupWarnings, l as TranspositionRangeError, m as STANZA_PLACEHOLDER, n as chantRuns, o as transposeBy, p as transposeScript, r as chantTextStyle, s as transposeNotes, t as chantHtml, u as parseInterval, v as selectStanza, w as stanzaTexts, x as stackStanzas, y as slotCount } from "../chantMarkup-DX4K86Rv.js";
|
|
4
|
+
import { r as isFontAvailable } from "../chantLayout-BRQ6FYND.js";
|
|
5
|
+
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-BN_9dKAx.js";
|
|
4
6
|
//#region src/composeScript.ts
|
|
5
7
|
/**
|
|
6
8
|
* Combining scripts (issue #71): one GuidoScript built from parts of
|
|
@@ -351,4 +353,4 @@ function composeScript(parts, options = {}) {
|
|
|
351
353
|
return clefGroup(opening) + writeTokens(out) + stanzas.join("");
|
|
352
354
|
}
|
|
353
355
|
//#endregion
|
|
354
|
-
export { DEFAULT_SPACER, DEFAULT_STYLE_SET, DEFAULT_TAB_INTERVAL_PT, GuidoScript, KEY_SIGNATURES, PITCH_ROWS, SCORE_MARKERS, STAFFLESS_FONT_FAMILY, STANZA_PLACEHOLDER, STYLE_SETS, SpacerMeter, TranspositionRangeError, baseOf, chantHtml, chantRuns, chantText, chantTextStyle, checkWordHtml, chooseStaffLines, composeScript, copyWordHtml, copyWordPlainText, defineStyleSet, dispose, downloadScorePng, downloadScoreSvg, formatStaffColor, gClefPitchOf, init, layoutForWord, markupWarnings, modifyDown, modifyNatural, modifyUp, padStanza, parseInterval, parseStaffColor, parseStaffLineColors, parseStaffLineWeights, parseStaffPitchColors, parseStaffWeight, parseStanza, renderAll, renderScore, resolveSyllableParts, scorePngBlob, scoreSvg, scriptSyllables, selectStanza, slotCount, smallHeads, snapStaff, splitNoteMarkers, stackStanzas, stackedStanzaNumbers, staffLineColor, staffLineWeight, staffSpans, stanzaCount, stanzaTexts, stanzaWarnings, toCephalicus, toConnectDown, toLonga, toSmallHead, toSmallPoint, toVirga, toWordHtml, toWordText, transposeBy, transposeExact, transposeNotes, transposeScript, unescape, variantOf, version, withStanza, wordLayoutText };
|
|
356
|
+
export { DEFAULT_SPACER, DEFAULT_STYLE_SET, DEFAULT_TAB_INTERVAL_PT, GuidoScript, KEY_SIGNATURES, PITCH_ROWS, SCORE_MARKERS, STAFFLESS_FONT_FAMILY, STANZA_PLACEHOLDER, STYLE_SETS, SpacerMeter, TranspositionRangeError, baseOf, chantHtml, chantRuns, chantText, chantTextStyle, checkWordHtml, chooseStaffLines, cleanFontName, composeScript, copyWordHtml, copyWordPlainText, defineStyleSet, dispose, downloadScorePng, downloadScoreSvg, formatStaffColor, gClefPitchOf, init, isFontAvailable, layoutForWord, markupWarnings, modifyDown, modifyNatural, modifyUp, padStanza, parseClefLineColor, parseInterval, parseStaffColor, parseStaffLineColors, parseStaffLineWeights, parseStaffPitchColors, parseStaffWeight, parseStanza, renderAll, renderScore, resolveSyllableParts, scorePngBlob, scoreSvg, scriptSyllables, selectStanza, slotCount, smallHeads, snapStaff, splitNoteMarkers, stackStanzas, stackedStanzaNumbers, staffLineColor, staffLineWeight, staffSpans, stanzaCount, stanzaTexts, stanzaWarnings, toCephalicus, toConnectDown, toLonga, toSmallHead, toSmallPoint, toVirga, toWordHtml, toWordText, transposeBy, transposeExact, transposeNotes, transposeScript, unescape, variantOf, version, withStanza, wordLayoutText };
|
|
Binary file
|
|
Binary file
|
|
@@ -10,13 +10,17 @@
|
|
|
10
10
|
* The table is hand-written from the notation reference, not derived from
|
|
11
11
|
* `PITCH_ROWS` offsets: the accidentals do not follow row position (`1`
|
|
12
12
|
* takes its sharp from row 6 and its flat from row 5). A missing entry
|
|
13
|
-
* means the pitch has no such variant, not an untranscribed one.
|
|
13
|
+
* means the pitch has no such variant, not an untranscribed one. The
|
|
14
|
+
* longas of a, b, c' and a'' (`€Žž¤`) are not Guido HU's own: they were added
|
|
15
|
+
* to the font by `tools/staffless-font/longas.py`.
|
|
14
16
|
*/
|
|
15
17
|
/** The variant roles a pitch glyph can carry. */
|
|
16
18
|
export type VariantRole = 'virga' | 'longa' | 'smallHead' | 'cephalicus' | 'connectOneDown' | 'connectTwoDown' | 'connectThreeDown' | 'connectFourDown' | 'smallPoint' | 'modifyUp' | 'modifyDown' | 'modifyNatural';
|
|
17
19
|
/** The standard g-clef pitch name of a base glyph, or of the base of a
|
|
18
20
|
* variant glyph; undefined when the glyph has no pitch. */
|
|
19
21
|
export declare function gClefPitchOf(ch: string): string | undefined;
|
|
22
|
+
/** Glyphs Guido HU draws like a table glyph, typed on another key: read as that glyph */
|
|
23
|
+
export declare const GLYPH_ALIASES: Readonly<Record<string, string>>;
|
|
20
24
|
/** The variant of `ch` in `role`, or undefined when `ch` has none. */
|
|
21
25
|
export declare function variantOf(ch: string, role: VariantRole): string | undefined;
|
|
22
26
|
/** The virga (the stemmed form) of a pitch glyph. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MarkDefinitions, StyleSetName } from './guidoStyles';
|
|
2
|
-
import { LayoutSource, StaffFill } from './chantLayout';
|
|
2
|
+
import { LayoutSource, StaffFill, ClefMark } from './chantLayout';
|
|
3
3
|
import { DrawnStaffOptions } from './drawnStaff';
|
|
4
4
|
export { NOTE_MODIFIERS, SCORE_MARKERS } from './chantLayout';
|
|
5
5
|
/** Options for one render. All fields optional; defaults reproduce the
|
|
@@ -17,6 +17,16 @@ export interface RenderOptions extends DrawnStaffOptions {
|
|
|
17
17
|
notesPx?: number;
|
|
18
18
|
/** Debug titles on the rendered spans */
|
|
19
19
|
debug?: boolean;
|
|
20
|
+
/** Stamp each syllable span with where it comes from, for a host that
|
|
21
|
+
* ties the score back to its script (an editor following the caret):
|
|
22
|
+
* `data-syl` is the syllable's index among `GuidoScript.syllables`,
|
|
23
|
+
* `data-notes-start` / `data-notes-width` its notes' run on the notes
|
|
24
|
+
* line, px from the line's content start (absent without notes); each
|
|
25
|
+
* notes line's `data-groups` lists `syllable:from:to` for every group
|
|
26
|
+
* piece on it (character offsets into its text: a split group has a
|
|
27
|
+
* piece on each line, a held group its own).
|
|
28
|
+
* Default false: the output is otherwise unchanged. */
|
|
29
|
+
sourceMap?: boolean;
|
|
20
30
|
/** Maximum notes-line width before a staff break (default: none) */
|
|
21
31
|
maxWidthPx?: number;
|
|
22
32
|
/** Dashes in a normal junction between note groups, in steps of a third (default 3) */
|
|
@@ -26,12 +36,31 @@ export interface RenderOptions extends DrawnStaffOptions {
|
|
|
26
36
|
/** With `staffFill: 'longest'`: the distance from the available width
|
|
27
37
|
* within which every line runs to it instead (default 0) */
|
|
28
38
|
staffFillSnapPx?: number;
|
|
39
|
+
/** The gap between a broken line's notes and its break star, px
|
|
40
|
+
* (default: the style set's padding, 12) */
|
|
41
|
+
paddingPx?: number;
|
|
42
|
+
/** How a line shows its clef (default `glyph`): `line` leaves the clef
|
|
43
|
+
* glyph out and marks the clef's staff line (`staffClefLineColor`, else
|
|
44
|
+
* the style set's `clefLine`), with the padding on the left too. Needs
|
|
45
|
+
* the drawn staff; with `staff: 'font'` the glyph stays. */
|
|
46
|
+
clefMark?: ClefMark;
|
|
47
|
+
/** The syllable text's font, an installed font by name (default: the
|
|
48
|
+
* style set's, which stays behind it as the fallback) */
|
|
49
|
+
textFont?: string;
|
|
29
50
|
/** Render a recitation that covers exactly 2 syllables on a line as
|
|
30
51
|
* plain notes of the same pitch (default true, issue #21) */
|
|
31
52
|
twoSyllableRecitationsToPlain?: boolean;
|
|
32
53
|
/** Render 3 or more syllables on one plain note with a reciting glyph
|
|
33
54
|
* (`1`–`9`, `ö`, `ü`) on a line as a recitation (default false) */
|
|
34
55
|
plainRunsToRecitation?: boolean;
|
|
56
|
+
/** Draw a `**()` star right after a group closing with a bar centred
|
|
57
|
+
* under the bar, moving nothing (default true); `false` sets it between
|
|
58
|
+
* the syllables */
|
|
59
|
+
starUnderBar?: boolean;
|
|
60
|
+
/** Cut an empty slot (`~(…)`) that does not fit at a line end at its
|
|
61
|
+
* dashes, like a sung group (default true); `false` moves it whole to
|
|
62
|
+
* a fresh line first, as held groups do */
|
|
63
|
+
cutEmptySlots?: boolean;
|
|
35
64
|
}
|
|
36
65
|
/**
|
|
37
66
|
* Renders a GuidoScript into a tidy score: a notes line in the chant font,
|
|
@@ -11,7 +11,7 @@ export interface ScriptTransform {
|
|
|
11
11
|
* its row; characters outside every row carry no pitch and stay put.
|
|
12
12
|
* Rows are searched in order, so a character found in several rows
|
|
13
13
|
* transposes within the first one. */
|
|
14
|
-
export declare const PITCH_ROWS: readonly ["ðñ0123456789öüó", "^]qwertzuiopõú", "ÝÞQWERTZUIOPÕÚ", "
|
|
14
|
+
export declare const PITCH_ROWS: readonly ["ðñ0123456789öüó", "^]qwertzuiopõú", "ÝÞQWERTZUIOPÕÚ", "Ô×sdfghjkléáû", "ØÙDFGHJKLÉÁÛ", "÷øaASÍYXCVBN$m", "ÈÊËÌÎÏÐÑÒþßòôùý", "“”•–—˜™š›œº»", "®−§'\"+!%/=()ÖÜÓ", "€ŽžŸ¡¢£[¥¦©ª«¬¤", "~¯‚ƒ„…†‡ˆ‰Š‹Œ‘’", "àâãäåæçèêëìîï", "½°±²³´μ·¾¸¹"];
|
|
15
15
|
/** What happens when a shift runs past the end of a pitch row:
|
|
16
16
|
* `clamp` keeps the first/last available character, `null` emits
|
|
17
17
|
* `U+0000`, which shows up as a missing glyph in the score, and `error`
|
|
@@ -21,7 +21,7 @@ export type TransposeOverflow = 'clamp' | 'null' | 'error';
|
|
|
21
21
|
* written in the source (escapes included) — the staff-degree shift
|
|
22
22
|
* `transposeBy` applies to every group. Escape pairs stand for their
|
|
23
23
|
* underlying character (an escaped paren is a pitch glyph of the
|
|
24
|
-
*
|
|
24
|
+
* `®−§'…` row), and a shifted result that is a control character of the
|
|
25
25
|
* group syntax is written escaped. A statement group's content (`@…`) is returned
|
|
26
26
|
* unchanged: its keyword letters are pitch glyphs, but no notes. */
|
|
27
27
|
export declare function transposeNotes(notes: string, shift: number, options?: {
|