smoosic 1.0.25 → 1.0.26
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/build/smoosic.js +1 -1
- package/package.json +1 -1
- package/release/smoosic.js +1 -1
- package/src/application/exports.ts +1 -0
- package/types/src/application/application.d.ts +102 -102
- package/types/src/application/common.d.ts +74 -74
- package/types/src/application/configuration.d.ts +74 -74
- package/types/src/application/dom.d.ts +8 -8
- package/types/src/application/dynamicInit.d.ts +1 -1
- package/types/src/application/eventHandler.d.ts +78 -78
- package/types/src/application/exports.d.ts +494 -493
- package/types/src/application/generateVexTests.d.ts +10 -10
- package/types/src/application/keyCommands.d.ts +90 -90
- package/types/src/common/bootstrap.bundle.d.ts +1138 -1138
- package/types/src/common/htmlHelpers.d.ts +105 -105
- package/types/src/common/jszip.d.ts +2 -2
- package/types/src/common/midi-parser.d.ts +38 -38
- package/types/src/common/promiseHelpers.d.ts +30 -30
- package/types/src/common/serializationHelpers.d.ts +29 -29
- package/types/src/common/textformatter.d.ts +140 -140
- package/types/src/common/vex.d.ts +222 -222
- package/types/src/render/audio/musicCursor.d.ts +25 -25
- package/types/src/render/audio/oscillator.d.ts +98 -98
- package/types/src/render/audio/player.d.ts +141 -141
- package/types/src/render/audio/samples.d.ts +56 -56
- package/types/src/render/sui/configuration.d.ts +12 -12
- package/types/src/render/sui/formatter.d.ts +151 -151
- package/types/src/render/sui/layoutDebug.d.ts +43 -43
- package/types/src/render/sui/mapper.d.ts +116 -116
- package/types/src/render/sui/piano.d.ts +46 -46
- package/types/src/render/sui/renderState.d.ts +88 -88
- package/types/src/render/sui/scoreRender.d.ts +93 -93
- package/types/src/render/sui/scoreView.d.ts +267 -267
- package/types/src/render/sui/scoreViewOperations.d.ts +594 -594
- package/types/src/render/sui/scroller.d.ts +34 -34
- package/types/src/render/sui/svgHelpers.d.ts +85 -85
- package/types/src/render/sui/svgPageMap.d.ts +318 -318
- package/types/src/render/sui/textEdit.d.ts +310 -310
- package/types/src/render/sui/textRender.d.ts +189 -189
- package/types/src/render/sui/tracker.d.ts +90 -90
- package/types/src/render/vex/glyphDimensions.d.ts +23 -23
- package/types/src/render/vex/smoAdapter.d.ts +46 -46
- package/types/src/render/vex/toVex.d.ts +13 -13
- package/types/src/render/vex/vxMeasure.d.ts +95 -95
- package/types/src/render/vex/vxNote.d.ts +55 -55
- package/types/src/render/vex/vxSystem.d.ts +64 -64
- package/types/src/smo/data/common.d.ts +220 -220
- package/types/src/smo/data/measure.d.ts +510 -510
- package/types/src/smo/data/measureModifiers.d.ts +506 -506
- package/types/src/smo/data/music.d.ts +438 -438
- package/types/src/smo/data/note.d.ts +485 -485
- package/types/src/smo/data/noteModifiers.d.ts +590 -590
- package/types/src/smo/data/partInfo.d.ts +162 -162
- package/types/src/smo/data/score.d.ts +395 -395
- package/types/src/smo/data/scoreModifiers.d.ts +433 -433
- package/types/src/smo/data/scoreText.d.ts +277 -277
- package/types/src/smo/data/staffModifiers.d.ts +767 -767
- package/types/src/smo/data/systemStaff.d.ts +238 -238
- package/types/src/smo/data/tuplet.d.ts +146 -146
- package/types/src/smo/midi/midiToSmo.d.ts +198 -198
- package/types/src/smo/midi/smoToMidi.d.ts +23 -23
- package/types/src/smo/mxml/smoToXml.d.ts +165 -165
- package/types/src/smo/mxml/xmlHelpers.d.ts +140 -140
- package/types/src/smo/mxml/xmlState.d.ts +257 -257
- package/types/src/smo/mxml/xmlToSmo.d.ts +92 -92
- package/types/src/smo/xform/beamers.d.ts +46 -46
- package/types/src/smo/xform/copypaste.d.ts +99 -99
- package/types/src/smo/xform/operations.d.ts +127 -127
- package/types/src/smo/xform/roadmap.d.ts +70 -70
- package/types/src/smo/xform/selections.d.ts +153 -153
- package/types/src/smo/xform/tickDuration.d.ts +155 -155
- package/types/src/smo/xform/tickMap.d.ts +34 -34
- package/types/src/smo/xform/undo.d.ts +142 -142
- package/types/src/smo/xform/updateAudio.d.ts +9 -9
- package/types/src/styles/font_metrics/Commissioner-Medium-Metrics.d.ts +871 -871
- package/types/src/styles/font_metrics/ConcertOne-Regular.d.ts +871 -871
- package/types/src/styles/font_metrics/Merriweather-Regular.d.ts +871 -871
- package/types/src/styles/font_metrics/arial_metrics.d.ts +870 -870
- package/types/src/styles/font_metrics/ssp-sans-metrics.d.ts +871 -871
- package/types/src/styles/font_metrics/ssp-serif-metrics.d.ts +871 -871
- package/types/src/styles/font_metrics/times_metrics.d.ts +870 -870
- package/types/src/ui/buttons/button.d.ts +95 -95
- package/types/src/ui/buttons/collapsable.d.ts +42 -42
- package/types/src/ui/buttons/display.d.ts +23 -23
- package/types/src/ui/buttons/ribbon.d.ts +76 -76
- package/types/src/ui/common.d.ts +45 -45
- package/types/src/ui/composable/draggable.d.ts +12 -12
- package/types/src/ui/configuration.d.ts +31 -31
- package/types/src/ui/dialogs/adapter.d.ts +107 -107
- package/types/src/ui/dialogs/addMeasure.d.ts +20 -20
- package/types/src/ui/dialogs/arpeggio.d.ts +2 -2
- package/types/src/ui/dialogs/articulation.d.ts +2 -2
- package/types/src/ui/dialogs/audioSettings.d.ts +32 -32
- package/types/src/ui/dialogs/chordChange.d.ts +35 -35
- package/types/src/ui/dialogs/clefChange.d.ts +2 -2
- package/types/src/ui/dialogs/components/baseComponent.d.ts +158 -158
- package/types/src/ui/dialogs/components/button.d.ts +54 -54
- package/types/src/ui/dialogs/components/buttonArray.d.ts +101 -101
- package/types/src/ui/dialogs/components/checkdrop.d.ts +27 -27
- package/types/src/ui/dialogs/components/dragText.d.ts +27 -27
- package/types/src/ui/dialogs/components/dropdown.d.ts +78 -78
- package/types/src/ui/dialogs/components/fileDownload.d.ts +28 -28
- package/types/src/ui/dialogs/components/fontComponent.d.ts +32 -32
- package/types/src/ui/dialogs/components/noteText.d.ts +98 -98
- package/types/src/ui/dialogs/components/pitch.d.ts +95 -95
- package/types/src/ui/dialogs/components/rocker.d.ts +66 -66
- package/types/src/ui/dialogs/components/staffComponents.d.ts +77 -77
- package/types/src/ui/dialogs/components/textCheck.d.ts +38 -38
- package/types/src/ui/dialogs/components/textInPlace.d.ts +90 -90
- package/types/src/ui/dialogs/components/textInput.d.ts +58 -58
- package/types/src/ui/dialogs/components/tie.d.ts +41 -41
- package/types/src/ui/dialogs/components/toggle.d.ts +53 -53
- package/types/src/ui/dialogs/components/tree.d.ts +46 -46
- package/types/src/ui/dialogs/customTuplets.d.ts +25 -25
- package/types/src/ui/dialogs/dialog.d.ts +201 -201
- package/types/src/ui/dialogs/durations.d.ts +2 -2
- package/types/src/ui/dialogs/dynamics.d.ts +37 -37
- package/types/src/ui/dialogs/endings.d.ts +61 -61
- package/types/src/ui/dialogs/factory.d.ts +15 -15
- package/types/src/ui/dialogs/fileDialogs.d.ts +4 -4
- package/types/src/ui/dialogs/fonts.d.ts +2 -2
- package/types/src/ui/dialogs/globalLayout.d.ts +2 -2
- package/types/src/ui/dialogs/gracenote.d.ts +2 -2
- package/types/src/ui/dialogs/hairpin.d.ts +35 -35
- package/types/src/ui/dialogs/instrument.d.ts +3 -3
- package/types/src/ui/dialogs/keySignature.d.ts +33 -33
- package/types/src/ui/dialogs/library.d.ts +70 -70
- package/types/src/ui/dialogs/lyric.d.ts +39 -39
- package/types/src/ui/dialogs/measureFormat.d.ts +52 -52
- package/types/src/ui/dialogs/microtones.d.ts +2 -2
- package/types/src/ui/dialogs/noteHead.d.ts +2 -2
- package/types/src/ui/dialogs/ornament.d.ts +2 -2
- package/types/src/ui/dialogs/pageLayout.d.ts +2 -2
- package/types/src/ui/dialogs/partInfo.d.ts +2 -2
- package/types/src/ui/dialogs/pedalMarking.d.ts +35 -35
- package/types/src/ui/dialogs/pitch.d.ts +2 -2
- package/types/src/ui/dialogs/preferences.d.ts +2 -2
- package/types/src/ui/dialogs/scoreId.d.ts +2 -2
- package/types/src/ui/dialogs/scoreView.d.ts +2 -2
- package/types/src/ui/dialogs/slur.d.ts +57 -57
- package/types/src/ui/dialogs/staffGroup.d.ts +2 -2
- package/types/src/ui/dialogs/tabNote.d.ts +32 -32
- package/types/src/ui/dialogs/tabStave.d.ts +43 -43
- package/types/src/ui/dialogs/tempo.d.ts +50 -50
- package/types/src/ui/dialogs/textBlock.d.ts +61 -61
- package/types/src/ui/dialogs/textBracket.d.ts +35 -35
- package/types/src/ui/dialogs/tie.d.ts +41 -41
- package/types/src/ui/dialogs/timeSignature.d.ts +34 -34
- package/types/src/ui/dialogs/transposeScore.d.ts +2 -2
- package/types/src/ui/dialogs/volta.d.ts +40 -40
- package/types/src/ui/eventSource.d.ts +63 -63
- package/types/src/ui/exceptions.d.ts +12 -12
- package/types/src/ui/fileio/fileInput.d.ts +12 -12
- package/types/src/ui/fileio/library.d.ts +40 -40
- package/types/src/ui/fileio/xhrLoader.d.ts +18 -18
- package/types/src/ui/help.d.ts +22 -22
- package/types/src/ui/i18n/language.d.ts +37 -37
- package/types/src/ui/i18n/language_ar.d.ts +5 -5
- package/types/src/ui/i18n/language_de.d.ts +1 -1
- package/types/src/ui/i18n/language_en.d.ts +18 -18
- package/types/src/ui/i18n/translationEditor.d.ts +14 -14
- package/types/src/ui/keyBindings/default/editorKeys.d.ts +7 -7
- package/types/src/ui/keyBindings/default/trackerKeys.d.ts +7 -7
- package/types/src/ui/menus/beams.d.ts +13 -13
- package/types/src/ui/menus/edit.d.ts +8 -8
- package/types/src/ui/menus/file.d.ts +26 -26
- package/types/src/ui/menus/help.d.ts +8 -8
- package/types/src/ui/menus/keySignature.d.ts +13 -13
- package/types/src/ui/menus/language.d.ts +12 -12
- package/types/src/ui/menus/manager.d.ts +57 -57
- package/types/src/ui/menus/measure.d.ts +8 -8
- package/types/src/ui/menus/menu.d.ts +136 -136
- package/types/src/ui/menus/note.d.ts +8 -8
- package/types/src/ui/menus/partSelection.d.ts +19 -19
- package/types/src/ui/menus/parts.d.ts +50 -50
- package/types/src/ui/menus/score.d.ts +20 -20
- package/types/src/ui/menus/staffModifier.d.ts +21 -21
- package/types/src/ui/menus/text.d.ts +8 -8
- package/types/src/ui/menus/timeSignature.d.ts +12 -12
- package/types/src/ui/menus/tuplets.d.ts +13 -13
- package/types/src/ui/menus/voices.d.ts +8 -8
- package/types/src/ui/modalDialogs.d.ts +1 -1
- package/types/src/ui/navigation.d.ts +15 -15
- package/types/src/ui/qwerty.d.ts +41 -41
- package/types/src/ui/ribbonLayout/default/defaultRibbon.d.ts +15 -15
- package/types/src/ui/ribbonLayout/default/tabletRibbon.d.ts +22 -22
- package/types/typedoc.d.ts +158 -158
|
@@ -1,189 +1,189 @@
|
|
|
1
|
-
import { OutlineInfo } from './svgHelpers';
|
|
2
|
-
import { SmoTextGroup, SmoScoreText } from '../../smo/data/scoreText';
|
|
3
|
-
import { SuiScroller } from './scroller';
|
|
4
|
-
import { SmoAttrs, SvgBox, ElementLike } from '../../smo/data/common';
|
|
5
|
-
import { SvgPage, SvgPageMap } from './svgPageMap';
|
|
6
|
-
import { TextFormatter } from '../../common/textformatter';
|
|
7
|
-
/**
|
|
8
|
-
* parameters to render text
|
|
9
|
-
* @category SuiRender
|
|
10
|
-
*/
|
|
11
|
-
export interface SuiInlineTextParams {
|
|
12
|
-
fontFamily: string;
|
|
13
|
-
fontWeight: string;
|
|
14
|
-
fontSize: number;
|
|
15
|
-
fontStyle: string;
|
|
16
|
-
startX: number;
|
|
17
|
-
startY: number;
|
|
18
|
-
scroller: SuiScroller;
|
|
19
|
-
purpose: string;
|
|
20
|
-
context: SvgPage;
|
|
21
|
-
pageMap: SvgPageMap;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* metrics for a single line of text. A textGroup can be composed
|
|
25
|
-
* of multiple inline blocks.
|
|
26
|
-
* @category SuiRender
|
|
27
|
-
*/
|
|
28
|
-
export interface SuiInlineBlock {
|
|
29
|
-
symbolType: number;
|
|
30
|
-
textType: number;
|
|
31
|
-
highlighted: boolean;
|
|
32
|
-
x: number;
|
|
33
|
-
y: number;
|
|
34
|
-
width: number;
|
|
35
|
-
height: number;
|
|
36
|
-
scale: number;
|
|
37
|
-
metrics: any;
|
|
38
|
-
glyph: any;
|
|
39
|
-
glyphCode: string;
|
|
40
|
-
text: string;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* @category SuiRender
|
|
44
|
-
*/
|
|
45
|
-
export interface SuiInlineArtifact {
|
|
46
|
-
block: SuiInlineBlock;
|
|
47
|
-
box: SvgBox;
|
|
48
|
-
index: number;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Inline text is a block of SVG text with the same font. Each block can
|
|
52
|
-
* contain either text or an svg (vex) glyph. Each block in the text has its own
|
|
53
|
-
* metrics so we can support inline svg text editors (cursor).
|
|
54
|
-
* @category SuiRender
|
|
55
|
-
*/
|
|
56
|
-
export declare class SuiInlineText {
|
|
57
|
-
static get textTypes(): {
|
|
58
|
-
normal: number;
|
|
59
|
-
superScript: number;
|
|
60
|
-
subScript: number;
|
|
61
|
-
};
|
|
62
|
-
static get symbolTypes(): {
|
|
63
|
-
GLYPH: number;
|
|
64
|
-
TEXT: number;
|
|
65
|
-
LINE: number;
|
|
66
|
-
};
|
|
67
|
-
static get textPurposes(): Record<string, string>;
|
|
68
|
-
static get textTypeTransitions(): number[][];
|
|
69
|
-
static getTextTypeResult(oldType: number, newType: number): number;
|
|
70
|
-
static getTextTypeTransition(oldType: number, result: number): number;
|
|
71
|
-
get spacing(): number;
|
|
72
|
-
static get defaults(): SuiInlineTextParams;
|
|
73
|
-
fontFamily: string;
|
|
74
|
-
fontWeight: string;
|
|
75
|
-
fontStyle: string;
|
|
76
|
-
fontSize: number;
|
|
77
|
-
width: number;
|
|
78
|
-
height: number;
|
|
79
|
-
purpose: string;
|
|
80
|
-
attrs: SmoAttrs;
|
|
81
|
-
textFont: TextFormatter;
|
|
82
|
-
startX: number;
|
|
83
|
-
startY: number;
|
|
84
|
-
blocks: SuiInlineBlock[];
|
|
85
|
-
updatedMetrics: boolean;
|
|
86
|
-
context: SvgPage;
|
|
87
|
-
pageMap: SvgPageMap;
|
|
88
|
-
scroller: SuiScroller;
|
|
89
|
-
artifacts: SuiInlineArtifact[];
|
|
90
|
-
logicalBox: SvgBox;
|
|
91
|
-
element: ElementLike;
|
|
92
|
-
updateFontInfo(): TextFormatter;
|
|
93
|
-
constructor(params: SuiInlineTextParams);
|
|
94
|
-
static fromScoreText(scoreText: SmoScoreText, context: SvgPage, pageMap: SvgPageMap, scroller: SuiScroller): SuiInlineText;
|
|
95
|
-
static get blockDefaults(): SuiInlineBlock;
|
|
96
|
-
get pointsToPixels(): number;
|
|
97
|
-
offsetStartX(offset: number): void;
|
|
98
|
-
offsetStartY(offset: number): void;
|
|
99
|
-
maxFontHeight(scale: number): number;
|
|
100
|
-
_glyphOffset(block: SuiInlineBlock): number;
|
|
101
|
-
/**
|
|
102
|
-
* Based on the font metrics, compute the width of the strings and glyph that make up
|
|
103
|
-
* this block
|
|
104
|
-
*/
|
|
105
|
-
_calculateBlockIndex(): void;
|
|
106
|
-
getLogicalBox(): SvgBox;
|
|
107
|
-
renderCursorAt(position: number, textType: number): void;
|
|
108
|
-
removeCursor(): void;
|
|
109
|
-
unrender(): void;
|
|
110
|
-
getIntersectingBlocks(box: SvgBox): SuiInlineArtifact[];
|
|
111
|
-
_addBlockAt(position: number, block: SuiInlineBlock): void;
|
|
112
|
-
removeBlockAt(position: number): void;
|
|
113
|
-
addTextBlockAt(position: number, params: SuiInlineBlock): void;
|
|
114
|
-
_getGlyphBlock(params: SuiInlineBlock): SuiInlineBlock;
|
|
115
|
-
addGlyphBlockAt(position: number, params: SuiInlineBlock): void;
|
|
116
|
-
isSuperscript(block: SuiInlineBlock): boolean;
|
|
117
|
-
isSubcript(block: SuiInlineBlock): boolean;
|
|
118
|
-
getHighlight(block: SuiInlineBlock): boolean;
|
|
119
|
-
setHighlight(block: SuiInlineBlock, value: boolean): void;
|
|
120
|
-
rescale(scale: number): void;
|
|
121
|
-
render(): void;
|
|
122
|
-
_drawBlock(block: SuiInlineBlock): void;
|
|
123
|
-
getText(): string;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* @category SuiRender
|
|
127
|
-
*/
|
|
128
|
-
export interface SuiTextBlockBlock {
|
|
129
|
-
text: SuiInlineText;
|
|
130
|
-
position: number;
|
|
131
|
-
activeText: boolean;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* @category SuiRender
|
|
135
|
-
*/
|
|
136
|
-
export interface SuiTextBlockParams {
|
|
137
|
-
blocks: SuiTextBlockBlock[];
|
|
138
|
-
scroller: SuiScroller;
|
|
139
|
-
spacing: number;
|
|
140
|
-
context: SvgPage;
|
|
141
|
-
skipRender: boolean;
|
|
142
|
-
justification: number;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* @category SuiRender
|
|
146
|
-
*/
|
|
147
|
-
export interface SuiTextBlockJusityCalc {
|
|
148
|
-
blocks: SuiInlineText[];
|
|
149
|
-
minx: number;
|
|
150
|
-
maxx: number;
|
|
151
|
-
width: number;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* SVG representation of SmoTextGroup
|
|
155
|
-
* @category SuiRender
|
|
156
|
-
*/
|
|
157
|
-
export declare class SuiTextBlock {
|
|
158
|
-
static get relativePosition(): {
|
|
159
|
-
ABOVE: number;
|
|
160
|
-
BELOW: number;
|
|
161
|
-
LEFT: number;
|
|
162
|
-
RIGHT: number;
|
|
163
|
-
};
|
|
164
|
-
inlineBlocks: SuiTextBlockBlock[];
|
|
165
|
-
scroller: SuiScroller;
|
|
166
|
-
spacing: number;
|
|
167
|
-
context: SvgPage;
|
|
168
|
-
skipRender: boolean;
|
|
169
|
-
currentBlockIndex: number;
|
|
170
|
-
justification: number;
|
|
171
|
-
outlineRect: OutlineInfo | null;
|
|
172
|
-
currentBlock: SuiTextBlockBlock | null;
|
|
173
|
-
logicalBox: SvgBox;
|
|
174
|
-
constructor(params: SuiTextBlockParams);
|
|
175
|
-
render(): void;
|
|
176
|
-
_outlineBox(context: any, box: SvgBox): void;
|
|
177
|
-
offsetStartX(offset: number): void;
|
|
178
|
-
offsetStartY(offset: number): void;
|
|
179
|
-
rescale(scale: number): void;
|
|
180
|
-
get x(): number;
|
|
181
|
-
get y(): number;
|
|
182
|
-
maxFontHeight(scale: number): number;
|
|
183
|
-
static blockFromScoreText(scoreText: SmoScoreText, context: SvgPage, pageMap: SvgPageMap, position: number, scroller: SuiScroller): SuiTextBlockBlock;
|
|
184
|
-
getLogicalBox(): SvgBox;
|
|
185
|
-
_calculateBoundingClientRect(): SvgBox;
|
|
186
|
-
static fromTextGroup(tg: SmoTextGroup, context: SvgPage, pageMap: SvgPageMap, scroller: SuiScroller): SuiTextBlock;
|
|
187
|
-
unrender(): void;
|
|
188
|
-
_justify(): void;
|
|
189
|
-
}
|
|
1
|
+
import { OutlineInfo } from './svgHelpers';
|
|
2
|
+
import { SmoTextGroup, SmoScoreText } from '../../smo/data/scoreText';
|
|
3
|
+
import { SuiScroller } from './scroller';
|
|
4
|
+
import { SmoAttrs, SvgBox, ElementLike } from '../../smo/data/common';
|
|
5
|
+
import { SvgPage, SvgPageMap } from './svgPageMap';
|
|
6
|
+
import { TextFormatter } from '../../common/textformatter';
|
|
7
|
+
/**
|
|
8
|
+
* parameters to render text
|
|
9
|
+
* @category SuiRender
|
|
10
|
+
*/
|
|
11
|
+
export interface SuiInlineTextParams {
|
|
12
|
+
fontFamily: string;
|
|
13
|
+
fontWeight: string;
|
|
14
|
+
fontSize: number;
|
|
15
|
+
fontStyle: string;
|
|
16
|
+
startX: number;
|
|
17
|
+
startY: number;
|
|
18
|
+
scroller: SuiScroller;
|
|
19
|
+
purpose: string;
|
|
20
|
+
context: SvgPage;
|
|
21
|
+
pageMap: SvgPageMap;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* metrics for a single line of text. A textGroup can be composed
|
|
25
|
+
* of multiple inline blocks.
|
|
26
|
+
* @category SuiRender
|
|
27
|
+
*/
|
|
28
|
+
export interface SuiInlineBlock {
|
|
29
|
+
symbolType: number;
|
|
30
|
+
textType: number;
|
|
31
|
+
highlighted: boolean;
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
scale: number;
|
|
37
|
+
metrics: any;
|
|
38
|
+
glyph: any;
|
|
39
|
+
glyphCode: string;
|
|
40
|
+
text: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @category SuiRender
|
|
44
|
+
*/
|
|
45
|
+
export interface SuiInlineArtifact {
|
|
46
|
+
block: SuiInlineBlock;
|
|
47
|
+
box: SvgBox;
|
|
48
|
+
index: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Inline text is a block of SVG text with the same font. Each block can
|
|
52
|
+
* contain either text or an svg (vex) glyph. Each block in the text has its own
|
|
53
|
+
* metrics so we can support inline svg text editors (cursor).
|
|
54
|
+
* @category SuiRender
|
|
55
|
+
*/
|
|
56
|
+
export declare class SuiInlineText {
|
|
57
|
+
static get textTypes(): {
|
|
58
|
+
normal: number;
|
|
59
|
+
superScript: number;
|
|
60
|
+
subScript: number;
|
|
61
|
+
};
|
|
62
|
+
static get symbolTypes(): {
|
|
63
|
+
GLYPH: number;
|
|
64
|
+
TEXT: number;
|
|
65
|
+
LINE: number;
|
|
66
|
+
};
|
|
67
|
+
static get textPurposes(): Record<string, string>;
|
|
68
|
+
static get textTypeTransitions(): number[][];
|
|
69
|
+
static getTextTypeResult(oldType: number, newType: number): number;
|
|
70
|
+
static getTextTypeTransition(oldType: number, result: number): number;
|
|
71
|
+
get spacing(): number;
|
|
72
|
+
static get defaults(): SuiInlineTextParams;
|
|
73
|
+
fontFamily: string;
|
|
74
|
+
fontWeight: string;
|
|
75
|
+
fontStyle: string;
|
|
76
|
+
fontSize: number;
|
|
77
|
+
width: number;
|
|
78
|
+
height: number;
|
|
79
|
+
purpose: string;
|
|
80
|
+
attrs: SmoAttrs;
|
|
81
|
+
textFont: TextFormatter;
|
|
82
|
+
startX: number;
|
|
83
|
+
startY: number;
|
|
84
|
+
blocks: SuiInlineBlock[];
|
|
85
|
+
updatedMetrics: boolean;
|
|
86
|
+
context: SvgPage;
|
|
87
|
+
pageMap: SvgPageMap;
|
|
88
|
+
scroller: SuiScroller;
|
|
89
|
+
artifacts: SuiInlineArtifact[];
|
|
90
|
+
logicalBox: SvgBox;
|
|
91
|
+
element: ElementLike;
|
|
92
|
+
updateFontInfo(): TextFormatter;
|
|
93
|
+
constructor(params: SuiInlineTextParams);
|
|
94
|
+
static fromScoreText(scoreText: SmoScoreText, context: SvgPage, pageMap: SvgPageMap, scroller: SuiScroller): SuiInlineText;
|
|
95
|
+
static get blockDefaults(): SuiInlineBlock;
|
|
96
|
+
get pointsToPixels(): number;
|
|
97
|
+
offsetStartX(offset: number): void;
|
|
98
|
+
offsetStartY(offset: number): void;
|
|
99
|
+
maxFontHeight(scale: number): number;
|
|
100
|
+
_glyphOffset(block: SuiInlineBlock): number;
|
|
101
|
+
/**
|
|
102
|
+
* Based on the font metrics, compute the width of the strings and glyph that make up
|
|
103
|
+
* this block
|
|
104
|
+
*/
|
|
105
|
+
_calculateBlockIndex(): void;
|
|
106
|
+
getLogicalBox(): SvgBox;
|
|
107
|
+
renderCursorAt(position: number, textType: number): void;
|
|
108
|
+
removeCursor(): void;
|
|
109
|
+
unrender(): void;
|
|
110
|
+
getIntersectingBlocks(box: SvgBox): SuiInlineArtifact[];
|
|
111
|
+
_addBlockAt(position: number, block: SuiInlineBlock): void;
|
|
112
|
+
removeBlockAt(position: number): void;
|
|
113
|
+
addTextBlockAt(position: number, params: SuiInlineBlock): void;
|
|
114
|
+
_getGlyphBlock(params: SuiInlineBlock): SuiInlineBlock;
|
|
115
|
+
addGlyphBlockAt(position: number, params: SuiInlineBlock): void;
|
|
116
|
+
isSuperscript(block: SuiInlineBlock): boolean;
|
|
117
|
+
isSubcript(block: SuiInlineBlock): boolean;
|
|
118
|
+
getHighlight(block: SuiInlineBlock): boolean;
|
|
119
|
+
setHighlight(block: SuiInlineBlock, value: boolean): void;
|
|
120
|
+
rescale(scale: number): void;
|
|
121
|
+
render(): void;
|
|
122
|
+
_drawBlock(block: SuiInlineBlock): void;
|
|
123
|
+
getText(): string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* @category SuiRender
|
|
127
|
+
*/
|
|
128
|
+
export interface SuiTextBlockBlock {
|
|
129
|
+
text: SuiInlineText;
|
|
130
|
+
position: number;
|
|
131
|
+
activeText: boolean;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* @category SuiRender
|
|
135
|
+
*/
|
|
136
|
+
export interface SuiTextBlockParams {
|
|
137
|
+
blocks: SuiTextBlockBlock[];
|
|
138
|
+
scroller: SuiScroller;
|
|
139
|
+
spacing: number;
|
|
140
|
+
context: SvgPage;
|
|
141
|
+
skipRender: boolean;
|
|
142
|
+
justification: number;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* @category SuiRender
|
|
146
|
+
*/
|
|
147
|
+
export interface SuiTextBlockJusityCalc {
|
|
148
|
+
blocks: SuiInlineText[];
|
|
149
|
+
minx: number;
|
|
150
|
+
maxx: number;
|
|
151
|
+
width: number;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* SVG representation of SmoTextGroup
|
|
155
|
+
* @category SuiRender
|
|
156
|
+
*/
|
|
157
|
+
export declare class SuiTextBlock {
|
|
158
|
+
static get relativePosition(): {
|
|
159
|
+
ABOVE: number;
|
|
160
|
+
BELOW: number;
|
|
161
|
+
LEFT: number;
|
|
162
|
+
RIGHT: number;
|
|
163
|
+
};
|
|
164
|
+
inlineBlocks: SuiTextBlockBlock[];
|
|
165
|
+
scroller: SuiScroller;
|
|
166
|
+
spacing: number;
|
|
167
|
+
context: SvgPage;
|
|
168
|
+
skipRender: boolean;
|
|
169
|
+
currentBlockIndex: number;
|
|
170
|
+
justification: number;
|
|
171
|
+
outlineRect: OutlineInfo | null;
|
|
172
|
+
currentBlock: SuiTextBlockBlock | null;
|
|
173
|
+
logicalBox: SvgBox;
|
|
174
|
+
constructor(params: SuiTextBlockParams);
|
|
175
|
+
render(): void;
|
|
176
|
+
_outlineBox(context: any, box: SvgBox): void;
|
|
177
|
+
offsetStartX(offset: number): void;
|
|
178
|
+
offsetStartY(offset: number): void;
|
|
179
|
+
rescale(scale: number): void;
|
|
180
|
+
get x(): number;
|
|
181
|
+
get y(): number;
|
|
182
|
+
maxFontHeight(scale: number): number;
|
|
183
|
+
static blockFromScoreText(scoreText: SmoScoreText, context: SvgPage, pageMap: SvgPageMap, position: number, scroller: SuiScroller): SuiTextBlockBlock;
|
|
184
|
+
getLogicalBox(): SvgBox;
|
|
185
|
+
_calculateBoundingClientRect(): SvgBox;
|
|
186
|
+
static fromTextGroup(tg: SmoTextGroup, context: SvgPage, pageMap: SvgPageMap, scroller: SuiScroller): SuiTextBlock;
|
|
187
|
+
unrender(): void;
|
|
188
|
+
_justify(): void;
|
|
189
|
+
}
|
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
import { SuiMapper, SuiRendererBase } from './mapper';
|
|
2
|
-
import { StrokeInfo } from './svgHelpers';
|
|
3
|
-
import { SmoSelection, SmoSelector, ModifierTab } from '../../smo/xform/selections';
|
|
4
|
-
import { SmoScore } from '../../smo/data/score';
|
|
5
|
-
import { SvgBox, KeyEvent, keyHandler } from '../../smo/data/common';
|
|
6
|
-
import { SuiScroller } from './scroller';
|
|
7
|
-
import { SmoNote } from '../../smo/data/note';
|
|
8
|
-
import { SmoMeasure } from '../../smo/data/measure';
|
|
9
|
-
export interface TrackerKeyHandler {
|
|
10
|
-
moveHome: keyHandler;
|
|
11
|
-
moveEnd: keyHandler;
|
|
12
|
-
moveSelectionRight: keyHandler;
|
|
13
|
-
moveSelectionLeft: keyHandler;
|
|
14
|
-
moveSelectionUp: keyHandler;
|
|
15
|
-
moveSelectionDown: keyHandler;
|
|
16
|
-
moveSelectionRightMeasure: keyHandler;
|
|
17
|
-
moveSelectionLeftMeasure: keyHandler;
|
|
18
|
-
advanceModifierSelection: keyHandler;
|
|
19
|
-
growSelectionRight: keyHandler;
|
|
20
|
-
growSelectionLeft: keyHandler;
|
|
21
|
-
moveSelectionPitchUp: keyHandler;
|
|
22
|
-
moveSelectionPitchDown: keyHandler;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* SuiTracker
|
|
26
|
-
* A tracker maps the UI elements to the logical elements ,and allows the user to
|
|
27
|
-
* move through the score and make selections, for navigation and editing.
|
|
28
|
-
* @category SuiRender
|
|
29
|
-
*/
|
|
30
|
-
export declare class SuiTracker extends SuiMapper implements TrackerKeyHandler {
|
|
31
|
-
idleTimer: number;
|
|
32
|
-
musicCursorGlyph: SVGSVGElement | null;
|
|
33
|
-
deferPlayAdvance: boolean;
|
|
34
|
-
static get strokes(): Record<string, StrokeInfo>;
|
|
35
|
-
constructor(renderer: SuiRendererBase, scroller: SuiScroller);
|
|
36
|
-
get renderElement(): Element;
|
|
37
|
-
get score(): SmoScore | null;
|
|
38
|
-
getIdleTime(): number;
|
|
39
|
-
playSelection(artifact: SmoSelection): void;
|
|
40
|
-
deferNextAutoPlay(): void;
|
|
41
|
-
getSelectedModifier(): ModifierTab | null;
|
|
42
|
-
getSelectedModifiers(): ModifierTab[];
|
|
43
|
-
static serializeEvent(evKey: KeyEvent | null): any;
|
|
44
|
-
advanceModifierSelection(keyEv?: KeyEvent): void;
|
|
45
|
-
static stringifyBox(box: SvgBox): string;
|
|
46
|
-
_getOffsetSelection(offset: number): SmoSelector;
|
|
47
|
-
getSelectedGraceNotes(): ModifierTab[];
|
|
48
|
-
isGraceNoteSelected(): boolean;
|
|
49
|
-
_growGraceNoteSelections(offset: number): void;
|
|
50
|
-
get autoPlay(): boolean;
|
|
51
|
-
growSelectionRight(): void;
|
|
52
|
-
_growSelectionRight(skipPlay: boolean): number;
|
|
53
|
-
moveHome(keyEvent?: KeyEvent): void;
|
|
54
|
-
moveEnd(keyEvent?: KeyEvent): void;
|
|
55
|
-
growSelectionRightMeasure(): void;
|
|
56
|
-
growSelectionLeft(): number;
|
|
57
|
-
moveSelectionRight(): void;
|
|
58
|
-
moveSelectionLeft(): void;
|
|
59
|
-
moveSelectionLeftMeasure(): void;
|
|
60
|
-
moveSelectionRightMeasure(): void;
|
|
61
|
-
_moveSelectionMeasure(offset: number): void;
|
|
62
|
-
_moveStaffOffset(offset: number): void;
|
|
63
|
-
removePitchSelection(): void;
|
|
64
|
-
_moveSelectionPitch(index: number): void;
|
|
65
|
-
moveSelectionPitchUp(): void;
|
|
66
|
-
moveSelectionPitchDown(): void;
|
|
67
|
-
moveSelectionUp(): void;
|
|
68
|
-
moveSelectionDown(): void;
|
|
69
|
-
containsArtifact(): boolean;
|
|
70
|
-
_replaceSelection(nselector: SmoSelector, skipPlay: boolean): void;
|
|
71
|
-
getFirstMeasureOfSelection(): SmoMeasure | null;
|
|
72
|
-
getSelectedMeasures(): SmoSelection[];
|
|
73
|
-
_addSelection(selection: SmoSelection): void;
|
|
74
|
-
_selectBetweenSelections(s1o: SmoSelection, s2o: SmoSelection): void;
|
|
75
|
-
selectSuggestion(ev: KeyEvent): void;
|
|
76
|
-
_setModifierAsSuggestion(artifact: ModifierTab): void;
|
|
77
|
-
_setArtifactAsSuggestion(artifact: SmoSelection): void;
|
|
78
|
-
_highlightModifier(): void;
|
|
79
|
-
_highlightPitchSelection(note: SmoNote, index: number): void;
|
|
80
|
-
_highlightActiveVoice(selection: SmoSelection): void;
|
|
81
|
-
selectActiveVoice(): void;
|
|
82
|
-
highlightSelection(): void;
|
|
83
|
-
/**
|
|
84
|
-
* Boxes are divided up into lines/systems already. But we need
|
|
85
|
-
* to put the correct box on the correct page.
|
|
86
|
-
* @param boxes
|
|
87
|
-
*/
|
|
88
|
-
drawSelectionRects(boxes: SvgBox[]): void;
|
|
89
|
-
_drawRect(pBox: SvgBox | SvgBox[], strokeName: string): void;
|
|
90
|
-
}
|
|
1
|
+
import { SuiMapper, SuiRendererBase } from './mapper';
|
|
2
|
+
import { StrokeInfo } from './svgHelpers';
|
|
3
|
+
import { SmoSelection, SmoSelector, ModifierTab } from '../../smo/xform/selections';
|
|
4
|
+
import { SmoScore } from '../../smo/data/score';
|
|
5
|
+
import { SvgBox, KeyEvent, keyHandler } from '../../smo/data/common';
|
|
6
|
+
import { SuiScroller } from './scroller';
|
|
7
|
+
import { SmoNote } from '../../smo/data/note';
|
|
8
|
+
import { SmoMeasure } from '../../smo/data/measure';
|
|
9
|
+
export interface TrackerKeyHandler {
|
|
10
|
+
moveHome: keyHandler;
|
|
11
|
+
moveEnd: keyHandler;
|
|
12
|
+
moveSelectionRight: keyHandler;
|
|
13
|
+
moveSelectionLeft: keyHandler;
|
|
14
|
+
moveSelectionUp: keyHandler;
|
|
15
|
+
moveSelectionDown: keyHandler;
|
|
16
|
+
moveSelectionRightMeasure: keyHandler;
|
|
17
|
+
moveSelectionLeftMeasure: keyHandler;
|
|
18
|
+
advanceModifierSelection: keyHandler;
|
|
19
|
+
growSelectionRight: keyHandler;
|
|
20
|
+
growSelectionLeft: keyHandler;
|
|
21
|
+
moveSelectionPitchUp: keyHandler;
|
|
22
|
+
moveSelectionPitchDown: keyHandler;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* SuiTracker
|
|
26
|
+
* A tracker maps the UI elements to the logical elements ,and allows the user to
|
|
27
|
+
* move through the score and make selections, for navigation and editing.
|
|
28
|
+
* @category SuiRender
|
|
29
|
+
*/
|
|
30
|
+
export declare class SuiTracker extends SuiMapper implements TrackerKeyHandler {
|
|
31
|
+
idleTimer: number;
|
|
32
|
+
musicCursorGlyph: SVGSVGElement | null;
|
|
33
|
+
deferPlayAdvance: boolean;
|
|
34
|
+
static get strokes(): Record<string, StrokeInfo>;
|
|
35
|
+
constructor(renderer: SuiRendererBase, scroller: SuiScroller);
|
|
36
|
+
get renderElement(): Element;
|
|
37
|
+
get score(): SmoScore | null;
|
|
38
|
+
getIdleTime(): number;
|
|
39
|
+
playSelection(artifact: SmoSelection): void;
|
|
40
|
+
deferNextAutoPlay(): void;
|
|
41
|
+
getSelectedModifier(): ModifierTab | null;
|
|
42
|
+
getSelectedModifiers(): ModifierTab[];
|
|
43
|
+
static serializeEvent(evKey: KeyEvent | null): any;
|
|
44
|
+
advanceModifierSelection(keyEv?: KeyEvent): void;
|
|
45
|
+
static stringifyBox(box: SvgBox): string;
|
|
46
|
+
_getOffsetSelection(offset: number): SmoSelector;
|
|
47
|
+
getSelectedGraceNotes(): ModifierTab[];
|
|
48
|
+
isGraceNoteSelected(): boolean;
|
|
49
|
+
_growGraceNoteSelections(offset: number): void;
|
|
50
|
+
get autoPlay(): boolean;
|
|
51
|
+
growSelectionRight(): void;
|
|
52
|
+
_growSelectionRight(skipPlay: boolean): number;
|
|
53
|
+
moveHome(keyEvent?: KeyEvent): void;
|
|
54
|
+
moveEnd(keyEvent?: KeyEvent): void;
|
|
55
|
+
growSelectionRightMeasure(): void;
|
|
56
|
+
growSelectionLeft(): number;
|
|
57
|
+
moveSelectionRight(): void;
|
|
58
|
+
moveSelectionLeft(): void;
|
|
59
|
+
moveSelectionLeftMeasure(): void;
|
|
60
|
+
moveSelectionRightMeasure(): void;
|
|
61
|
+
_moveSelectionMeasure(offset: number): void;
|
|
62
|
+
_moveStaffOffset(offset: number): void;
|
|
63
|
+
removePitchSelection(): void;
|
|
64
|
+
_moveSelectionPitch(index: number): void;
|
|
65
|
+
moveSelectionPitchUp(): void;
|
|
66
|
+
moveSelectionPitchDown(): void;
|
|
67
|
+
moveSelectionUp(): void;
|
|
68
|
+
moveSelectionDown(): void;
|
|
69
|
+
containsArtifact(): boolean;
|
|
70
|
+
_replaceSelection(nselector: SmoSelector, skipPlay: boolean): void;
|
|
71
|
+
getFirstMeasureOfSelection(): SmoMeasure | null;
|
|
72
|
+
getSelectedMeasures(): SmoSelection[];
|
|
73
|
+
_addSelection(selection: SmoSelection): void;
|
|
74
|
+
_selectBetweenSelections(s1o: SmoSelection, s2o: SmoSelection): void;
|
|
75
|
+
selectSuggestion(ev: KeyEvent): void;
|
|
76
|
+
_setModifierAsSuggestion(artifact: ModifierTab): void;
|
|
77
|
+
_setArtifactAsSuggestion(artifact: SmoSelection): void;
|
|
78
|
+
_highlightModifier(): void;
|
|
79
|
+
_highlightPitchSelection(note: SmoNote, index: number): void;
|
|
80
|
+
_highlightActiveVoice(selection: SmoSelection): void;
|
|
81
|
+
selectActiveVoice(): void;
|
|
82
|
+
highlightSelection(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Boxes are divided up into lines/systems already. But we need
|
|
85
|
+
* to put the correct box on the correct page.
|
|
86
|
+
* @param boxes
|
|
87
|
+
*/
|
|
88
|
+
drawSelectionRects(boxes: SvgBox[]): void;
|
|
89
|
+
_drawRect(pBox: SvgBox | SvgBox[], strokeName: string): void;
|
|
90
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { SmoBarline } from '../../smo/data/measureModifiers';
|
|
2
|
-
import { GlyphInfo } from '../../common/vex';
|
|
3
|
-
/**
|
|
4
|
-
* Some hard-coded dimensions of common Vexflow glyphs
|
|
5
|
-
* @category SuiRender
|
|
6
|
-
*/
|
|
7
|
-
export declare class vexGlyph {
|
|
8
|
-
static width(smoGlyph: GlyphInfo): number;
|
|
9
|
-
static accidental(a: string): GlyphInfo;
|
|
10
|
-
static barWidth(b: SmoBarline): number;
|
|
11
|
-
static accidentalWidth(accidental: string): number;
|
|
12
|
-
static get accidentals(): Record<string, GlyphInfo>;
|
|
13
|
-
static repeatSymbolWidth(): number;
|
|
14
|
-
static get tempo(): GlyphInfo;
|
|
15
|
-
static keySignatureLength(key: string): number;
|
|
16
|
-
static get timeSignature(): GlyphInfo;
|
|
17
|
-
static get dot(): GlyphInfo;
|
|
18
|
-
static get tupletBeam(): GlyphInfo;
|
|
19
|
-
static get stem(): GlyphInfo;
|
|
20
|
-
static get flag(): GlyphInfo;
|
|
21
|
-
static clef(c: string): GlyphInfo;
|
|
22
|
-
static get dimensions(): Record<string, GlyphInfo>;
|
|
23
|
-
}
|
|
1
|
+
import { SmoBarline } from '../../smo/data/measureModifiers';
|
|
2
|
+
import { GlyphInfo } from '../../common/vex';
|
|
3
|
+
/**
|
|
4
|
+
* Some hard-coded dimensions of common Vexflow glyphs
|
|
5
|
+
* @category SuiRender
|
|
6
|
+
*/
|
|
7
|
+
export declare class vexGlyph {
|
|
8
|
+
static width(smoGlyph: GlyphInfo): number;
|
|
9
|
+
static accidental(a: string): GlyphInfo;
|
|
10
|
+
static barWidth(b: SmoBarline): number;
|
|
11
|
+
static accidentalWidth(accidental: string): number;
|
|
12
|
+
static get accidentals(): Record<string, GlyphInfo>;
|
|
13
|
+
static repeatSymbolWidth(): number;
|
|
14
|
+
static get tempo(): GlyphInfo;
|
|
15
|
+
static keySignatureLength(key: string): number;
|
|
16
|
+
static get timeSignature(): GlyphInfo;
|
|
17
|
+
static get dot(): GlyphInfo;
|
|
18
|
+
static get tupletBeam(): GlyphInfo;
|
|
19
|
+
static get stem(): GlyphInfo;
|
|
20
|
+
static get flag(): GlyphInfo;
|
|
21
|
+
static clef(c: string): GlyphInfo;
|
|
22
|
+
static get dimensions(): Record<string, GlyphInfo>;
|
|
23
|
+
}
|