guidex 0.3.3 → 0.5.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 (36) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/README.md +266 -37
  3. package/dist/lib/app/StaffSettings.d.ts +1 -0
  4. package/dist/lib/app/editorState.d.ts +32 -23
  5. package/dist/lib/app/shareLink.d.ts +2 -3
  6. package/dist/lib/{chantLayout-CVVuJUJl.js → chantLayout-BrCQUOhp.js} +980 -1142
  7. package/dist/lib/chantLayout.d.ts +32 -3
  8. package/dist/lib/chantMarkup.d.ts +63 -20
  9. package/dist/lib/drawnStaff.d.ts +130 -0
  10. package/dist/lib/editorStorage.d.ts +44 -4
  11. package/dist/lib/embed/core.d.ts +26 -4
  12. package/dist/lib/embed/index.js +1 -1
  13. package/dist/lib/embed/manual.d.ts +9 -3
  14. package/dist/lib/embed/manual.js +16 -49
  15. package/dist/lib/fonts/guidohu-staffless.woff2 +0 -0
  16. package/dist/lib/guidex.css +27 -0
  17. package/dist/lib/guidoRender.d.ts +22 -4
  18. package/dist/lib/guidoScript.d.ts +60 -23
  19. package/dist/lib/guidoScriptTransforms.d.ts +0 -18
  20. package/dist/lib/guidoStyles.d.ts +85 -74
  21. package/dist/lib/react/GuidexScore.d.ts +18 -6
  22. package/dist/lib/react/index.d.ts +2 -0
  23. package/dist/lib/react/index.js +47 -4
  24. package/dist/lib/recitationSegments.d.ts +93 -0
  25. package/dist/lib/scoreImage-B2SGdROL.js +8391 -0
  26. package/dist/lib/staffGlyphs.d.ts +12 -0
  27. package/dist/lib/stanzas.d.ts +6 -3
  28. package/dist/lib/textMarkup.d.ts +67 -0
  29. package/dist/lib/word/index.js +1 -1
  30. package/dist/lib/{wordChecker-DG09l_ol.js → wordChecker-CjYl2yof.js} +40 -13
  31. package/dist/lib/wordExport.d.ts +23 -4
  32. package/dist-embed/fonts/guidohu-staffless.woff2 +0 -0
  33. package/dist-embed/guidex-embed.min.css +1 -1
  34. package/dist-embed/guidex-embed.min.js +1 -1
  35. package/package.json +3 -2
  36. package/dist/lib/scoreImage-lvOrTbG-.js +0 -1009
@@ -0,0 +1,93 @@
1
+ import { ScriptToken } from './guidoScript';
2
+ export interface RecitationOptions {
3
+ /** Render a line segment of exactly 2 syllables of a reciting glyph as
4
+ * plain notes of the same pitch (default true) */
5
+ twoSyllableRecitationsToPlain?: boolean;
6
+ /** Render a line segment of 3 or more syllables on one plain note that
7
+ * has a reciting glyph (`1`–`9`, `ö`, `ü`) as a recitation (default
8
+ * false) */
9
+ plainRunsToRecitation?: boolean;
10
+ }
11
+ /** A note group sung on a reciting pitch. */
12
+ export interface RecitationPitch {
13
+ /** The accidental sign before the note, or '' */
14
+ sign: string;
15
+ /** The plain note (`7`) */
16
+ plain: string;
17
+ /** The reciting glyph (`¦`) */
18
+ glyph: string;
19
+ /** Which of the two the group is written with */
20
+ written: 'glyph' | 'plain';
21
+ }
22
+ /** The reciting pitch of a note group: one reciting glyph, or one plain
23
+ * note that has one, optionally after one accidental sign; null for any
24
+ * other group. */
25
+ export declare function recitationPitch(notes: string): RecitationPitch | null;
26
+ /** How a syllable of a run renders: as a recitation, as plain notes, or as
27
+ * written. */
28
+ export type RecitationMode = 'recite' | 'plain' | 'written';
29
+ /** The notes a group renders with in a mode. */
30
+ export declare function notesInMode(notes: string, mode: RecitationMode): string;
31
+ /** One syllable as the decisions see it, indexed like the layout's
32
+ * syllables (the script's syllable tokens, in order). */
33
+ export interface RunSyllable {
34
+ /** The group's notes as written ('' for a syllable without notes) */
35
+ notes: string;
36
+ /** Some underlay sings text on it (not every one holds it or leaves
37
+ * the slot empty) */
38
+ counted: boolean;
39
+ }
40
+ /** The decisions' view of a script: its syllables, and where a clef or key
41
+ * statement stands (a run never continues across one). */
42
+ export declare function runSyllables(underlays: readonly (readonly ScriptToken[])[]): {
43
+ syllables: RunSyllable[];
44
+ /** Syllable indices a clef or key statement stands right before */
45
+ pitchBreaks: Set<number>;
46
+ };
47
+ /**
48
+ * The mode each member is first laid out in: a recitation when its run in
49
+ * the script counts 3 or more syllables (so the line segments are counted
50
+ * with the recitation's widths), else as written (a run of 2 or fewer can
51
+ * only ever need its pair converted).
52
+ */
53
+ export declare function trialModes(syllables: readonly RunSyllable[], pitchBreaks: ReadonlySet<number>, options: Required<RecitationOptions>): Map<number, RecitationMode>;
54
+ /** Whether a script has anything for the decisions to do. */
55
+ export declare function hasCandidates(syllables: readonly RunSyllable[], options: Required<RecitationOptions>): boolean;
56
+ /** A segment whose form the last step changed, still to be checked on
57
+ * its line. */
58
+ interface Pending {
59
+ members: number[];
60
+ /** The line its decision counted it on */
61
+ line: number;
62
+ }
63
+ /** The decision state carried from pass to pass. */
64
+ export interface DecisionState {
65
+ /** Final modes, by syllable */
66
+ decided: Map<number, RecitationMode>;
67
+ /** Syllables that open a fresh line: a changed segment that opened its
68
+ * line, and a member that no longer fits its line in the new form */
69
+ breakBefore: Set<number>;
70
+ /** The segment changed in the last step */
71
+ pending: Pending | null;
72
+ }
73
+ export declare function initialState(): DecisionState;
74
+ /** The mode each member renders with in the next pass. */
75
+ export declare function passModes(trial: ReadonlyMap<number, RecitationMode>, state: DecisionState): Map<number, RecitationMode>;
76
+ /**
77
+ * One step of the decisions over a laid-out pass, from the left: checks the
78
+ * segment changed in the previous step, then decides segments in order while
79
+ * the pass already rendered them as decided, and stops at the first one
80
+ * whose decision changes what the pass rendered. Returns whether another
81
+ * pass is needed.
82
+ *
83
+ * Every pass lays the score out left to right, so a decision only moves
84
+ * what comes after it: the segments decided before it stay where they
85
+ * were. A segment is counted on the line the pass put it on, and a change
86
+ * keeps it there: one that opened its line still opens it (as plain notes
87
+ * it might fit the line before), and a member that no longer fits its line
88
+ * in the new form (a pair turned plain is wider than its recitation) opens
89
+ * the next one and is decided again there, the members before it keeping
90
+ * their written form.
91
+ */
92
+ export declare function decideStep(syllables: readonly RunSyllable[], placedNotes: readonly (string | undefined)[], sylLines: readonly (number | undefined)[], modes: ReadonlyMap<number, RecitationMode>, state: DecisionState, options: Required<RecitationOptions>): boolean;
93
+ export {};