score-viewer 1.0.45 → 1.0.46
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/dist/score-viewer.js +13941 -13916
- package/dist/score-viewer.js.map +1 -1
- package/dist/score-viewer.umd.cjs +85 -85
- package/dist/score-viewer.umd.cjs.map +1 -1
- package/dist/types/main.d.ts +168 -16
- package/package.json +1 -1
package/dist/types/main.d.ts
CHANGED
|
@@ -2,7 +2,11 @@ import { Context as Context_2 } from 'react';
|
|
|
2
2
|
import { ForwardRefExoticComponent } from 'react';
|
|
3
3
|
import { JSX } from 'react/jsx-runtime';
|
|
4
4
|
import { RefAttributes } from 'react';
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
declare type Action = {
|
|
7
|
+
type: string;
|
|
8
|
+
config: LoadConfig | LoadAutoScrollConfig | RenderConfig | RenderAutoScrollConfig;
|
|
9
|
+
};
|
|
6
10
|
|
|
7
11
|
declare interface Annotation {
|
|
8
12
|
id: string;
|
|
@@ -56,6 +60,22 @@ declare class FetchError extends Error {
|
|
|
56
60
|
constructor(type: string, message: string);
|
|
57
61
|
}
|
|
58
62
|
|
|
63
|
+
declare type LoadAutoScrollConfig = {
|
|
64
|
+
height: number;
|
|
65
|
+
meiStr: string;
|
|
66
|
+
transposition: string | null;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
declare type LoadConfig = {
|
|
70
|
+
scoreUrl: string;
|
|
71
|
+
postLoadTransition?: Transition | undefined;
|
|
72
|
+
meiStr: string;
|
|
73
|
+
page?: number | undefined;
|
|
74
|
+
scale: number;
|
|
75
|
+
transposition: string | null;
|
|
76
|
+
restorePositionForAchor?: string | undefined;
|
|
77
|
+
};
|
|
78
|
+
|
|
59
79
|
export declare type LyricItem = {
|
|
60
80
|
title: string;
|
|
61
81
|
text: string | FetchError;
|
|
@@ -68,18 +88,38 @@ declare interface Option_2 {
|
|
|
68
88
|
contentDescription: string | undefined;
|
|
69
89
|
}
|
|
70
90
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
91
|
+
declare enum PlayingState {
|
|
92
|
+
PLAYING = 0,
|
|
93
|
+
PAUSED = 1,
|
|
94
|
+
STOPPED = 2
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
declare type RenderAutoScrollConfig = {
|
|
98
|
+
height: number;
|
|
75
99
|
};
|
|
76
100
|
|
|
77
|
-
declare type
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
101
|
+
declare type RenderConfig = {
|
|
102
|
+
scoreUrl: string;
|
|
103
|
+
loadedWidth: number;
|
|
104
|
+
loadedHeight: number;
|
|
105
|
+
transition?: Transition | undefined;
|
|
106
|
+
renderPage: number;
|
|
107
|
+
loadedPagesCount: number;
|
|
108
|
+
scale: number;
|
|
81
109
|
};
|
|
82
110
|
|
|
111
|
+
declare interface RenderedData {
|
|
112
|
+
id: string;
|
|
113
|
+
scoreUrl: string;
|
|
114
|
+
scale: number;
|
|
115
|
+
page: number;
|
|
116
|
+
timemap: TimeMapEvent[];
|
|
117
|
+
anchorElement: string | null;
|
|
118
|
+
width?: number;
|
|
119
|
+
height?: number;
|
|
120
|
+
svgHTML?: string;
|
|
121
|
+
}
|
|
122
|
+
|
|
83
123
|
export declare type Score = {
|
|
84
124
|
url: string;
|
|
85
125
|
title: string;
|
|
@@ -98,7 +138,6 @@ export declare type ScoreProperties = {
|
|
|
98
138
|
composer: string;
|
|
99
139
|
lyricist: string;
|
|
100
140
|
editor: string;
|
|
101
|
-
reconstructions: Reconstruction[];
|
|
102
141
|
reconstructionBy: string | null;
|
|
103
142
|
sections: {
|
|
104
143
|
label: string;
|
|
@@ -152,7 +191,6 @@ export declare interface ScoreViewerConfigSettings {
|
|
|
152
191
|
showTextSection: boolean;
|
|
153
192
|
showFacsimileSection: boolean;
|
|
154
193
|
showOptions: boolean;
|
|
155
|
-
showMusicAnalysisByDefault: boolean;
|
|
156
194
|
renderTitlesFromMEI: boolean;
|
|
157
195
|
backgroundColor?: string | undefined;
|
|
158
196
|
basePath: string;
|
|
@@ -175,9 +213,107 @@ export declare interface ScoreViewerRef {
|
|
|
175
213
|
selectScore: (scoreIndex: number | null) => void;
|
|
176
214
|
}
|
|
177
215
|
|
|
216
|
+
declare class ScoreViewerStoreApi {
|
|
217
|
+
use: {
|
|
218
|
+
queuedAction: () => Action | null;
|
|
219
|
+
setQueuedAction: () => (action: Action | null) => void;
|
|
220
|
+
pendingAction: () => Action | null;
|
|
221
|
+
setPendingAction: () => (action: Action | null) => void;
|
|
222
|
+
score: () => Score | null;
|
|
223
|
+
showingMei: () => string | null;
|
|
224
|
+
scoreCache: () => {
|
|
225
|
+
[index: string]: Score;
|
|
226
|
+
};
|
|
227
|
+
textCache: () => TextPartsCache;
|
|
228
|
+
textComments: () => string | FetchError | null | undefined;
|
|
229
|
+
textIntroduction: () => string | FetchError | null | undefined;
|
|
230
|
+
textLyrics: () => LyricItem[] | null | undefined;
|
|
231
|
+
setScore: () => (score: Score | null) => void;
|
|
232
|
+
setShowingMei: () => (mei: string | null) => void;
|
|
233
|
+
setScoreCache: () => (scoreCache: {
|
|
234
|
+
[index: string]: Score;
|
|
235
|
+
}) => void;
|
|
236
|
+
setTextCache: () => (textCache: TextPartsCache, replace: boolean) => void;
|
|
237
|
+
setTextComments: () => (textComments: string | FetchError | null | undefined) => void;
|
|
238
|
+
setTextIntroduction: () => (textIntroduction: string | FetchError | null | undefined) => void;
|
|
239
|
+
setTextLyrics: () => (textLyrics: LyricItem[] | null | undefined, replace: boolean) => void;
|
|
240
|
+
isLoading: () => boolean;
|
|
241
|
+
scoreSvg: () => string | null;
|
|
242
|
+
scale: () => number;
|
|
243
|
+
reachedEffectiveMaxScale: () => boolean;
|
|
244
|
+
isSplitView: () => boolean;
|
|
245
|
+
activeSplitView: () => string;
|
|
246
|
+
splitViewOrientation: () => "horizontal" | "vertical";
|
|
247
|
+
activeTab: () => string;
|
|
248
|
+
setIsLoading: () => (isLoading: boolean) => void;
|
|
249
|
+
setScoreSvg: () => (svg: string | null) => void;
|
|
250
|
+
setScale: () => (scale: number) => void;
|
|
251
|
+
increaseScale: () => () => void;
|
|
252
|
+
decreaseScale: () => () => void;
|
|
253
|
+
setReachedEffectiveMaxScale: () => (value: boolean) => void;
|
|
254
|
+
setIsSplitView: () => (splitView: boolean) => void;
|
|
255
|
+
setSplitViewOrientation: () => (orientation: "horizontal" | "vertical") => void;
|
|
256
|
+
setActiveTab: () => (tab: string) => void;
|
|
257
|
+
setActiveSplitView: () => (view: string) => void;
|
|
258
|
+
resetUILayout: () => () => void;
|
|
259
|
+
pageCount: () => number;
|
|
260
|
+
currentPage: () => number;
|
|
261
|
+
sectionPageMap: () => Record<string, number>;
|
|
262
|
+
setScoreLayout: () => (layout: {
|
|
263
|
+
pageCount: number;
|
|
264
|
+
sectionPageMap: Record<string, number>;
|
|
265
|
+
currentPage: number;
|
|
266
|
+
}) => void;
|
|
267
|
+
goToPage: () => (page: number) => void;
|
|
268
|
+
goToNextPage: () => () => void;
|
|
269
|
+
goToPreviousPage: () => () => void;
|
|
270
|
+
goToSection: () => (sectionId: string) => void;
|
|
271
|
+
navigationCommand: () => {
|
|
272
|
+
type: "section" | "page";
|
|
273
|
+
target: string | number;
|
|
274
|
+
} | null;
|
|
275
|
+
clearNavigationCommand: () => () => void;
|
|
276
|
+
playingState: () => PlayingState;
|
|
277
|
+
playingPosition: () => number;
|
|
278
|
+
seekPosition: () => number;
|
|
279
|
+
autoScroll: () => boolean;
|
|
280
|
+
setPlayingState: () => (state: PlayingState) => void;
|
|
281
|
+
setPlayingPosition: () => (position: number) => void;
|
|
282
|
+
setSeekPosition: () => (position: number) => void;
|
|
283
|
+
setAutoScroll: () => (autoScroll: boolean) => void;
|
|
284
|
+
resetPlayerPosition: () => () => void;
|
|
285
|
+
showNVerses: () => number;
|
|
286
|
+
showEditorial: () => boolean;
|
|
287
|
+
showOriginalClefs: () => boolean;
|
|
288
|
+
normalizeFicta: () => boolean;
|
|
289
|
+
showingEditorial: () => string | null;
|
|
290
|
+
appOptions: () => string[];
|
|
291
|
+
choiceOptions: () => string[];
|
|
292
|
+
withoutTransposition: () => boolean;
|
|
293
|
+
showMusicAnalysis: () => boolean;
|
|
294
|
+
measureNumberInterval: () => number;
|
|
295
|
+
setShowNVerses: () => (n: number) => void;
|
|
296
|
+
setShowEditorial: () => (showEditorial: boolean) => void;
|
|
297
|
+
setShowOriginalClefs: () => (showOriginalClefs: boolean) => void;
|
|
298
|
+
setNormalizeFicta: () => (normalizeFicta: boolean) => void;
|
|
299
|
+
setShowingEditorial: () => (editorial: string | null) => void;
|
|
300
|
+
setAppOptions: () => (options: string[], replace: boolean) => void;
|
|
301
|
+
setChoiceOptions: () => (options: string[], replace: boolean) => void;
|
|
302
|
+
setWithoutTransposition: () => (withoutTransposition: boolean) => void;
|
|
303
|
+
setShowMusicAnalysis: () => (showMusicAnalysis: boolean) => void;
|
|
304
|
+
setMeasureNumberInterval: () => (interval: number) => void;
|
|
305
|
+
resetScoreSettings: () => () => void;
|
|
306
|
+
renderedSvgData: () => RenderedData | null;
|
|
307
|
+
setRenderedSvgData: () => (data: RenderedData) => void;
|
|
308
|
+
pageCache: () => Map<number, RenderedData>;
|
|
309
|
+
setCachedPage: () => (page: number, data: RenderedData) => void;
|
|
310
|
+
getCachedPage: () => (page: number) => RenderedData | null;
|
|
311
|
+
clearPageCache: () => () => void;
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
|
|
178
315
|
declare interface ScoreViewProps {
|
|
179
316
|
backgroundColor?: string | undefined;
|
|
180
|
-
showMusicAnalysisByDefault: boolean;
|
|
181
317
|
}
|
|
182
318
|
|
|
183
319
|
declare type Sources = {
|
|
@@ -192,6 +328,25 @@ export declare type TextParts = {
|
|
|
192
328
|
introduction: string | null;
|
|
193
329
|
};
|
|
194
330
|
|
|
331
|
+
declare type TextPartsCache = {
|
|
332
|
+
[url: string]: string | FetchError | null;
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
declare type TimeMapEvent = {
|
|
336
|
+
on?: string[] | undefined;
|
|
337
|
+
off?: string[] | undefined;
|
|
338
|
+
measureOn?: string | undefined;
|
|
339
|
+
qstamp: number;
|
|
340
|
+
tstamp: number;
|
|
341
|
+
tempo?: number | undefined;
|
|
342
|
+
stavesOn?: string[] | undefined;
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
declare enum Transition {
|
|
346
|
+
FADE_OUT = 0,
|
|
347
|
+
FADE_IN = 1
|
|
348
|
+
}
|
|
349
|
+
|
|
195
350
|
declare type Transposition = "" | "P4" | "+P4" | "-P4" | "M3" | "+M3" | "-M3" | "P8" | "+P8" | "-P8";
|
|
196
351
|
|
|
197
352
|
export declare function useScoreManager({ t, config, normalizeFicta, onScoreAnalyzed, onFetchScoreError }: UseScoreManagerProps): {
|
|
@@ -209,7 +364,7 @@ declare interface UseScoreManagerProps {
|
|
|
209
364
|
onFetchScoreError?: ((url: string, error: Error) => void) | undefined;
|
|
210
365
|
}
|
|
211
366
|
|
|
212
|
-
export declare const useStore:
|
|
367
|
+
export declare const useStore: ScoreViewerStoreApi;
|
|
213
368
|
|
|
214
369
|
export declare function useTextParts({ config, }: UseTextPartsProps): {
|
|
215
370
|
fetchTextParts: (scoreIndex: number) => void;
|
|
@@ -224,9 +379,6 @@ declare interface UseTextPartsProps {
|
|
|
224
379
|
|
|
225
380
|
export declare type VisualizationOptions = {
|
|
226
381
|
showOriginalClefs?: boolean | null | undefined;
|
|
227
|
-
showReconstructions?: {
|
|
228
|
-
[staff: string]: string;
|
|
229
|
-
} | undefined;
|
|
230
382
|
};
|
|
231
383
|
|
|
232
384
|
export { }
|