@viritura/score-engine 0.1.1-next.5 → 0.1.1-next.7
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/index.js +19 -3
- package/dist/index.js.map +2 -2
- package/dist/wasm/viritura_wasm.js +6 -6
- package/dist/wasm/viritura_wasm_bg.wasm +0 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1870,9 +1870,9 @@ function interpolateBeatAnchors(bounds, beat, endX) {
|
|
|
1870
1870
|
|
|
1871
1871
|
// packages/score-engine/src/buildInfo.ts
|
|
1872
1872
|
init_define_import_meta_env();
|
|
1873
|
-
var PACKAGE_VERSION = "0.1.1-next.
|
|
1873
|
+
var PACKAGE_VERSION = "0.1.1-next.7", BUNDLE_WORKER_FILE = "score-engine.worker.js";
|
|
1874
1874
|
function buildCommit() {
|
|
1875
|
-
return "
|
|
1875
|
+
return "5f67e97a568c1617adbc7221871d70f7cb1fa821";
|
|
1876
1876
|
}
|
|
1877
1877
|
function bundledAssetBase() {
|
|
1878
1878
|
let moduleUrl = import.meta.url;
|
|
@@ -2335,7 +2335,7 @@ function parseGlobalMeasure(raw) {
|
|
|
2335
2335
|
let rm = viritura.rehearsalMark;
|
|
2336
2336
|
measure.rehearsalMark = { text: parseTextContent(rm.text) ?? [] }, rm.style && (measure.rehearsalMark.style = rm.style), applyManualPlacement(measure.rehearsalMark, rm);
|
|
2337
2337
|
}
|
|
2338
|
-
viritura.coda && (measure.coda = parseCoda(viritura.coda)), viritura.jump && (measure.jump = parseJump(viritura.jump)), viritura.gradualTempo && (measure.gradualTempo = parseGradualTempo(viritura.gradualTempo)), viritura.chordSymbols && (measure.chordSymbols = viritura.chordSymbols.map(parseChordSymbol));
|
|
2338
|
+
viritura.coda && (measure.coda = parseCoda(viritura.coda)), viritura.jump && (measure.jump = parseJump(viritura.jump)), applyMarkerTextExtension(measure, viritura.markerText), viritura.gradualTempo && (measure.gradualTempo = parseGradualTempo(viritura.gradualTempo)), viritura.chordSymbols && (measure.chordSymbols = viritura.chordSymbols.map(parseChordSymbol));
|
|
2339
2339
|
}
|
|
2340
2340
|
return measure;
|
|
2341
2341
|
}
|
|
@@ -2491,6 +2491,22 @@ function parseJump(raw) {
|
|
|
2491
2491
|
location: parseRhythmicPosition(raw.location)
|
|
2492
2492
|
};
|
|
2493
2493
|
}
|
|
2494
|
+
function parseMarkerText(raw, owner) {
|
|
2495
|
+
let content = parseTextContent(raw.content);
|
|
2496
|
+
if (!content) throw new Error(`markerText.${owner} must contain at least one text or glyph run.`);
|
|
2497
|
+
return { content, placement: raw.placement };
|
|
2498
|
+
}
|
|
2499
|
+
function applyMarkerTextExtension(measure, raw) {
|
|
2500
|
+
if (!raw) return;
|
|
2501
|
+
let owners = { segno: measure.segno, coda: measure.coda, fine: measure.fine, jump: measure.jump };
|
|
2502
|
+
for (let key of ["segno", "coda", "fine", "jump"]) {
|
|
2503
|
+
let text = raw[key];
|
|
2504
|
+
if (!text) continue;
|
|
2505
|
+
let owner = owners[key];
|
|
2506
|
+
if (!owner) throw new Error(`markerText.${key} requires a ${key} on the same measure.`);
|
|
2507
|
+
owner.text = parseMarkerText(text, key);
|
|
2508
|
+
}
|
|
2509
|
+
}
|
|
2494
2510
|
function parseCoda(raw) {
|
|
2495
2511
|
let coda = {
|
|
2496
2512
|
location: parseRhythmicPosition(raw.location)
|