@viritura/score-engine 0.1.1-next.5 → 0.1.1-next.6

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 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.5", BUNDLE_WORKER_FILE = "score-engine.worker.js";
1873
+ var PACKAGE_VERSION = "0.1.1-next.6", BUNDLE_WORKER_FILE = "score-engine.worker.js";
1874
1874
  function buildCommit() {
1875
- return "c8003ba2e3ffd854d438011de34b43e9cc3fb4a8";
1875
+ return "3839ceae5b4e815e59efdacf32a0ea0520c0bbb8";
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)