web-music-score 6.0.0-pre.0 → 6.0.0-pre.2

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 (35) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/audio/index.d.ts +1 -1
  3. package/dist/audio/index.js +61 -35
  4. package/dist/audio/index.mjs +4 -4
  5. package/dist/audio-cg/index.js +1 -1
  6. package/dist/audio-cg/index.mjs +4 -4
  7. package/dist/audio-synth/index.js +1 -1
  8. package/dist/audio-synth/index.mjs +4 -4
  9. package/dist/{chunk-OKY6DMTT.mjs → chunk-3L3RBNBV.mjs} +3 -3
  10. package/dist/{chunk-FCR7WBDV.mjs → chunk-5P4O5YX2.mjs} +3 -3
  11. package/dist/{chunk-SNZ77AGL.mjs → chunk-5W6ROWBC.mjs} +2 -2
  12. package/dist/{chunk-URLQD334.mjs → chunk-7PNMM2PM.mjs} +63 -37
  13. package/dist/{chunk-OZZ3NSJS.mjs → chunk-GNFWJCFN.mjs} +4 -4
  14. package/dist/{chunk-2NTPGV6U.mjs → chunk-OXLTN43T.mjs} +2 -2
  15. package/dist/core/index.js +2 -2
  16. package/dist/core/index.mjs +4 -4
  17. package/dist/iife/{audio-cg.global.js → audio-cg.js} +2 -2
  18. package/dist/iife/{index.global.js → index.js} +13 -13
  19. package/dist/{music-objects-DLmp5uL6.d.ts → music-objects-CiIS8yPn.d.ts} +2 -2
  20. package/dist/{note-RVXvpfyV.d.ts → note-CJuq5aBy.d.ts} +1 -1
  21. package/dist/pieces/index.d.ts +3 -3
  22. package/dist/pieces/index.js +1 -1
  23. package/dist/pieces/index.mjs +2 -2
  24. package/dist/react-ui/index.d.ts +3 -3
  25. package/dist/react-ui/index.js +1 -1
  26. package/dist/react-ui/index.mjs +2 -2
  27. package/dist/{scale-B1M10_fu.d.ts → scale-DxGqFxlv.d.ts} +2 -2
  28. package/dist/score/index.d.ts +5 -5
  29. package/dist/score/index.js +77 -40
  30. package/dist/score/index.mjs +21 -10
  31. package/dist/{tempo-D-JF-8b_.d.ts → tempo-pCAa6qgo.d.ts} +1 -1
  32. package/dist/theory/index.d.ts +5 -5
  33. package/dist/theory/index.js +61 -35
  34. package/dist/theory/index.mjs +4 -4
  35. package/package.json +4 -3
@@ -1,5 +1,5 @@
1
- import { N as Note, A as Accidental } from './note-RVXvpfyV.js';
2
- import { R as RhythmProps, N as NoteLength, h as NoteLengthStr, k as TupletRatio, c as Tempo, K as KeySignature, a as TimeSignature } from './tempo-D-JF-8b_.js';
1
+ import { N as Note, A as Accidental } from './note-CJuq5aBy.js';
2
+ import { R as RhythmProps, N as NoteLength, h as NoteLengthStr, k as TupletRatio, c as Tempo, K as KeySignature, a as TimeSignature } from './tempo-pCAa6qgo.js';
3
3
  import { AnchoredRect, UniMap, Rect, Vec } from '@tspro/ts-utils-lib';
4
4
 
5
5
  /** Staff preset values for score configuration. */
@@ -300,7 +300,7 @@ declare class Note {
300
300
  * @param b - Note b.
301
301
  * @returns - -1, 0 or 1.
302
302
  */
303
- static compareFunc(a: Note, b: Note): 1 | 0 | -1;
303
+ static compareFunc(a: Note, b: Note): 1 | -1 | 0;
304
304
  }
305
305
 
306
306
  export { type Accidental as A, DefaultPitchNotation as D, GuitarNoteLabel as G, Note as N, type ParsedNote as P, SymbolSet as S, type NoteLetter as a, PitchNotation as b, PitchNotationList as c, DefaultGuitarNoteLabel as d, GuitarNoteLabelList as e, validateGuitarNoteLabel as f, getPitchNotationName as g, validatePitchNotation as v };
@@ -1,6 +1,6 @@
1
- import { M as MDocument } from '../music-objects-DLmp5uL6.js';
2
- import '../note-RVXvpfyV.js';
3
- import '../tempo-D-JF-8b_.js';
1
+ import { M as MDocument } from '../music-objects-CiIS8yPn.js';
2
+ import '../note-CJuq5aBy.js';
3
+ import '../tempo-pCAa6qgo.js';
4
4
  import '@tspro/ts-utils-lib';
5
5
 
6
6
  /**
@@ -1,4 +1,4 @@
1
- /* WebMusicScore v6.0.0-pre.0 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
1
+ /* WebMusicScore v6.0.0-pre.2 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,5 +1,5 @@
1
- /* WebMusicScore v6.0.0-pre.0 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
2
- import "../chunk-2NTPGV6U.mjs";
1
+ /* WebMusicScore v6.0.0-pre.2 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
2
+ import "../chunk-OXLTN43T.mjs";
3
3
 
4
4
  // src/pieces/andante-diabelli.ts
5
5
  import { DocumentBuilder } from "web-music-score/score";
@@ -1,8 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import { M as MDocument, o as ScoreEventListener, r as MPlaybackButtons } from '../music-objects-DLmp5uL6.js';
4
- import '../note-RVXvpfyV.js';
5
- import '../tempo-D-JF-8b_.js';
3
+ import { M as MDocument, o as ScoreEventListener, r as MPlaybackButtons } from '../music-objects-CiIS8yPn.js';
4
+ import '../note-CJuq5aBy.js';
5
+ import '../tempo-pCAa6qgo.js';
6
6
  import '@tspro/ts-utils-lib';
7
7
 
8
8
  interface MusicScoreViewProps {
@@ -1,4 +1,4 @@
1
- /* WebMusicScore v6.0.0-pre.0 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
1
+ /* WebMusicScore v6.0.0-pre.2 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
2
2
  "use strict";
3
3
  var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
@@ -1,7 +1,7 @@
1
- /* WebMusicScore v6.0.0-pre.0 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
1
+ /* WebMusicScore v6.0.0-pre.2 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
2
2
  import {
3
3
  __publicField
4
- } from "../chunk-2NTPGV6U.mjs";
4
+ } from "../chunk-OXLTN43T.mjs";
5
5
 
6
6
  // src/react-ui/music-score-view.tsx
7
7
  import * as React from "react";
@@ -1,5 +1,5 @@
1
- import { N as Note, S as SymbolSet } from './note-RVXvpfyV.js';
2
- import { K as KeySignature } from './tempo-D-JF-8b_.js';
1
+ import { N as Note, S as SymbolSet } from './note-CJuq5aBy.js';
2
+ import { K as KeySignature } from './tempo-pCAa6qgo.js';
3
3
 
4
4
  /** Interval direction type. */
5
5
  type IntervalDirection = "Unison" | "Ascending" | "Descending";
@@ -1,8 +1,8 @@
1
- import { N as NoteOptions, R as RestOptions, S as StaffPreset, a as ScoreConfiguration, M as MDocument, b as MeasureOptions, V as VoiceId, T as TupletOptions, c as VerseNumber, L as LyricsOptions, d as StaffTabOrGroups, F as Fermata, e as Navigation, A as AnnotationText, f as Annotation, g as Label, C as Connective, h as TieType, i as NoteAnchor, j as VerticalPosition } from '../music-objects-DLmp5uL6.js';
2
- export { ak as Arpeggio, a6 as BaseConfig, a5 as Clef, ao as DynamicsAnnotation, am as LyricsAlign, an as LyricsHyphen, t as MAccidental, v as MArpeggio, H as MBarLineLeft, G as MBarLineRight, w as MBeamGroup, u as MConnective, y as MEnding, a4 as MExtensionLine, z as MFermata, B as MHeader, D as MImage, a3 as MLyrics, E as MMeasure, J as MNoteGroup, r as MPlaybackButtons, p as MPlayer, q as MRenderContext, P as MRest, U as MRhythmColumn, W as MScoreRow, X as MScoreRowGroup, a1 as MSpecialText, Y as MStaff, I as MStaffBarLine, x as MStaffBeamGroup, K as MStaffNoteGroup, Q as MStaffRest, _ as MStaffSignature, Z as MTab, O as MTabNoteGroup, a0 as MTabRhythm, $ as MTabSignature, a2 as MText, s as MusicInterface, aq as PlayState, ar as PlayStateChangeListener, l as ScoreEvent, o as ScoreEventListener, k as ScoreEventType, n as ScoreObjectEvent, m as ScoreStaffPosEvent, a7 as StaffConfig, al as StaffTabOrGroup, aj as Stem, ac as StringNumber, a8 as TabConfig, ap as TempoAnnotation, ad as getStringNumbers, ag as getVerseNumbers, a9 as getVoiceIds, ae as isStringNumber, ah as isVerseNumber, aa as isVoiceId, af as validateStringNumber, ai as validateVerseNumber, ab as validateVoiceId } from '../music-objects-DLmp5uL6.js';
3
- import { N as Note } from '../note-RVXvpfyV.js';
4
- import { S as ScaleType, c as Scale } from '../scale-B1M10_fu.js';
5
- import { N as NoteLength, h as NoteLengthStr, K as KeySignature, a as TimeSignature, T as TimeSignatures, B as BeamGrouping, k as TupletRatio } from '../tempo-D-JF-8b_.js';
1
+ import { N as NoteOptions, R as RestOptions, S as StaffPreset, a as ScoreConfiguration, M as MDocument, b as MeasureOptions, V as VoiceId, T as TupletOptions, c as VerseNumber, L as LyricsOptions, d as StaffTabOrGroups, F as Fermata, e as Navigation, A as AnnotationText, f as Annotation, g as Label, C as Connective, h as TieType, i as NoteAnchor, j as VerticalPosition } from '../music-objects-CiIS8yPn.js';
2
+ export { ak as Arpeggio, a6 as BaseConfig, a5 as Clef, ao as DynamicsAnnotation, am as LyricsAlign, an as LyricsHyphen, t as MAccidental, v as MArpeggio, H as MBarLineLeft, G as MBarLineRight, w as MBeamGroup, u as MConnective, y as MEnding, a4 as MExtensionLine, z as MFermata, B as MHeader, D as MImage, a3 as MLyrics, E as MMeasure, J as MNoteGroup, r as MPlaybackButtons, p as MPlayer, q as MRenderContext, P as MRest, U as MRhythmColumn, W as MScoreRow, X as MScoreRowGroup, a1 as MSpecialText, Y as MStaff, I as MStaffBarLine, x as MStaffBeamGroup, K as MStaffNoteGroup, Q as MStaffRest, _ as MStaffSignature, Z as MTab, O as MTabNoteGroup, a0 as MTabRhythm, $ as MTabSignature, a2 as MText, s as MusicInterface, aq as PlayState, ar as PlayStateChangeListener, l as ScoreEvent, o as ScoreEventListener, k as ScoreEventType, n as ScoreObjectEvent, m as ScoreStaffPosEvent, a7 as StaffConfig, al as StaffTabOrGroup, aj as Stem, ac as StringNumber, a8 as TabConfig, ap as TempoAnnotation, ad as getStringNumbers, ag as getVerseNumbers, a9 as getVoiceIds, ae as isStringNumber, ah as isVerseNumber, aa as isVoiceId, af as validateStringNumber, ai as validateVerseNumber, ab as validateVoiceId } from '../music-objects-CiIS8yPn.js';
3
+ import { N as Note } from '../note-CJuq5aBy.js';
4
+ import { S as ScaleType, c as Scale } from '../scale-DxGqFxlv.js';
5
+ import { N as NoteLength, h as NoteLengthStr, K as KeySignature, a as TimeSignature, T as TimeSignatures, B as BeamGrouping, k as TupletRatio } from '../tempo-pCAa6qgo.js';
6
6
  import '@tspro/ts-utils-lib';
7
7
 
8
8
  /**
@@ -1,4 +1,4 @@
1
- /* WebMusicScore v6.0.0-pre.0 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
1
+ /* WebMusicScore v6.0.0-pre.2 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
2
2
  "use strict";
3
3
  var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
@@ -1275,7 +1275,9 @@ var _consent;
1275
1275
  var _expires;
1276
1276
  var str = _read(ConsentCookieName);
1277
1277
  _consent = str === "accept" || str === "decline" ? str : void 0;
1278
- function _getList() {
1278
+ function _getCookieList() {
1279
+ if (typeof document === "undefined")
1280
+ return [];
1279
1281
  let s = document.cookie;
1280
1282
  return s.split(";").map((c) => c.trim());
1281
1283
  }
@@ -1284,15 +1286,17 @@ function _save(name, value) {
1284
1286
  if (_expires) {
1285
1287
  cookie += "expires=" + _expires.toUTCString() + ";";
1286
1288
  }
1287
- document.cookie = cookie;
1289
+ if (typeof document !== "undefined")
1290
+ document.cookie = cookie;
1288
1291
  return value;
1289
1292
  }
1290
1293
  function _read(name, defaultValue) {
1291
- let str2 = _getList().find((c) => c.startsWith(name + "="));
1294
+ let str2 = _getCookieList().find((c) => c.startsWith(name + "="));
1292
1295
  return str2 === void 0 ? defaultValue : str2.substring(name.length + 1);
1293
1296
  }
1294
1297
  function _erase(name) {
1295
- document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 UTC;";
1298
+ if (typeof document !== "undefined")
1299
+ document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 UTC;";
1296
1300
  }
1297
1301
  function setExpireDays(days) {
1298
1302
  _expires = /* @__PURE__ */ new Date();
@@ -1342,7 +1346,8 @@ function erase(name) {
1342
1346
  _erase(name);
1343
1347
  }
1344
1348
  function eraseAll() {
1345
- document.cookie.split(";").forEach((c) => erase(c.trim().split("=")[0]));
1349
+ if (typeof document !== "undefined")
1350
+ document.cookie.split(";").forEach((c) => erase(c.trim().split("=")[0]));
1346
1351
  }
1347
1352
  var device_exports = {};
1348
1353
  __export2(device_exports, {
@@ -1358,12 +1363,16 @@ __export2(device_exports, {
1358
1363
  toPx: () => toPx
1359
1364
  });
1360
1365
  function getDPI() {
1361
- let el = document.createElement("div");
1362
- el.style.width = "1in";
1363
- document.body.appendChild(el);
1364
- let dpi = el.offsetWidth;
1365
- el.remove();
1366
- return dpi || 96;
1366
+ try {
1367
+ let el = document.createElement("div");
1368
+ el.style.width = "1in";
1369
+ document.body.appendChild(el);
1370
+ let dpi = el.offsetWidth;
1371
+ el.remove();
1372
+ return dpi || 96;
1373
+ } catch (e) {
1374
+ return 96;
1375
+ }
1367
1376
  }
1368
1377
  function getScrollBarWidth() {
1369
1378
  try {
@@ -1386,18 +1395,23 @@ function getScrollBarWidth() {
1386
1395
  }
1387
1396
  }
1388
1397
  function getSystemFontSize() {
1389
- let tmpDiv = document.createElement("div");
1390
- tmpDiv.style.cssText = "display:inline-block; padding:0; line-height:1; position:absolute; visibility:hidden; font-size:1em";
1391
- tmpDiv.appendChild(document.createTextNode("M"));
1392
- document.body.appendChild(tmpDiv);
1393
- let fontsize = tmpDiv.offsetHeight;
1394
- document.body.removeChild(tmpDiv);
1395
- return fontsize;
1398
+ try {
1399
+ let tmpDiv = document.createElement("div");
1400
+ tmpDiv.style.cssText = "display:inline-block; padding:0; line-height:1; position:absolute; visibility:hidden; font-size:1em";
1401
+ tmpDiv.appendChild(document.createTextNode("M"));
1402
+ document.body.appendChild(tmpDiv);
1403
+ let fontsize = tmpDiv.offsetHeight;
1404
+ document.body.removeChild(tmpDiv);
1405
+ return fontsize;
1406
+ } catch (e) {
1407
+ return 16;
1408
+ }
1396
1409
  }
1397
1410
  function getIsTouchDevice() {
1398
- if ("ontouchstart" in window || "DocumentTouch" in window || "createTouch" in document && "createTouchList" in document) {
1411
+ if (typeof window === "undefined")
1412
+ return false;
1413
+ if ("ontouchstart" in window || "DocumentTouch" in window || "createTouch" in document && "createTouchList" in document)
1399
1414
  return true;
1400
- }
1401
1415
  var prefixes = " -webkit- -moz- -o- -ms- ".split(" ");
1402
1416
  var mq = function(query2) {
1403
1417
  return window.matchMedia(query2).matches;
@@ -1410,7 +1424,10 @@ function getIsMobileDevice() {
1410
1424
  return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4));
1411
1425
  }
1412
1426
  function getHostAddress() {
1413
- return location.protocol + "//" + location.host;
1427
+ if (typeof location === "undefined" || !location.host) {
1428
+ return "localhost";
1429
+ }
1430
+ return `${location.protocol}//${location.host}`;
1414
1431
  }
1415
1432
  var UnitRegExp = /^(mm|cm|in|inch|px|em)$/;
1416
1433
  var ValueUnitRegExp = /^([0-9\\.]+)(.*)$/;
@@ -1565,6 +1582,10 @@ __export2(dom_exports, {
1565
1582
  setWidth: () => setWidth,
1566
1583
  styleLayoutChanged: () => styleLayoutChanged
1567
1584
  });
1585
+ function _getElemById(id) {
1586
+ var _a;
1587
+ return typeof document === "undefined" ? void 0 : (_a = document.getElementById(id)) != null ? _a : void 0;
1588
+ }
1568
1589
  function toPx2(value) {
1569
1590
  return value === void 0 ? void 0 : device_exports.toPx(value);
1570
1591
  }
@@ -1601,12 +1622,17 @@ function setOffset(el, left, top, unit = "px") {
1601
1622
  el.style.top = top + unit;
1602
1623
  }
1603
1624
  function getOffset(el) {
1604
- let box = el.getBoundingClientRect();
1605
- let docElem = document.documentElement;
1606
- return {
1607
- top: box.top + window.pageYOffset - docElem.clientTop,
1608
- left: box.left + window.pageXOffset - docElem.clientLeft
1609
- };
1625
+ let { left, top } = el.getBoundingClientRect();
1626
+ if (typeof window !== "undefined") {
1627
+ left += window.pageXOffset;
1628
+ top += window.pageYOffset;
1629
+ }
1630
+ if (typeof document !== "undefined") {
1631
+ let de = document.documentElement;
1632
+ left -= de.clientLeft;
1633
+ top -= de.clientTop;
1634
+ }
1635
+ return { left, top };
1610
1636
  }
1611
1637
  function getWidth(el) {
1612
1638
  if (el instanceof Window) {
@@ -1646,11 +1672,11 @@ function setRect(el, left, top, width, height, unit = "px") {
1646
1672
  el.style.height = height + unit;
1647
1673
  }
1648
1674
  function getButton(btn) {
1649
- let el = typeof btn === "string" ? document.getElementById(btn) : btn;
1675
+ let el = typeof btn === "string" ? _getElemById(btn) : btn;
1650
1676
  return el instanceof HTMLButtonElement ? el : void 0;
1651
1677
  }
1652
1678
  function getCanvas(canvas2) {
1653
- let el = typeof canvas2 === "string" ? document.getElementById(canvas2) : canvas2;
1679
+ let el = typeof canvas2 === "string" ? _getElemById(canvas2) : canvas2;
1654
1680
  return el instanceof HTMLCanvasElement ? el : void 0;
1655
1681
  }
1656
1682
  function getPadding(style) {
@@ -1724,11 +1750,11 @@ function styleLayoutChanged(style1, style2) {
1724
1750
  }
1725
1751
  var canvas;
1726
1752
  function getCanvasTextWidth(text, font) {
1727
- canvas != null ? canvas : canvas = document.createElement("canvas");
1728
- let ctx = canvas.getContext("2d");
1729
- if (!ctx) {
1753
+ if (!canvas && typeof document !== "undefined")
1754
+ canvas = document.createElement("canvas");
1755
+ let ctx = canvas == null ? void 0 : canvas.getContext("2d");
1756
+ if (!ctx)
1730
1757
  return 0;
1731
- }
1732
1758
  ctx.font = font;
1733
1759
  return ctx.measureText(text).width;
1734
1760
  }
@@ -4675,7 +4701,7 @@ var RenderContext = class {
4675
4701
  __publicField(this, "onMouseMoveFn");
4676
4702
  __publicField(this, "onMouseLeaveFn");
4677
4703
  __publicField(this, "onTouchEndFn");
4678
- this.devicePixelRatio = window.devicePixelRatio;
4704
+ this.devicePixelRatio = typeof window !== "undefined" ? window.devicePixelRatio : 1;
4679
4705
  this.fontSize = device_exports.FontSize * DocumentSettings.DocumentScale * this.devicePixelRatio;
4680
4706
  this.unitSize = this.fontSize * 0.3;
4681
4707
  this._lineWidth = this.unitSize * 0.2;
@@ -4722,6 +4748,10 @@ var RenderContext = class {
4722
4748
  }
4723
4749
  const [nr, ng, nb, na] = colorNameToRGBA(data.color);
4724
4750
  const threshold = 40;
4751
+ if (typeof document === "undefined") {
4752
+ console.error("Failed to colorize image: document is undefined.");
4753
+ return;
4754
+ }
4725
4755
  const canvas2 = document.createElement("canvas");
4726
4756
  canvas2.width = data.img.width;
4727
4757
  canvas2.height = data.img.height;
@@ -7486,6 +7516,13 @@ function getAnnotation(text) {
7486
7516
  }
7487
7517
 
7488
7518
  // src/score/engine/player.ts
7519
+ function _setTimeout(cb, ms) {
7520
+ return typeof window === "undefined" ? void 0 : window.setTimeout(cb, ms);
7521
+ }
7522
+ function _clearTimeout(t) {
7523
+ if (typeof window !== "undefined")
7524
+ window.clearTimeout(t);
7525
+ }
7489
7526
  var AccelerandoSpeedMul = 2;
7490
7527
  var RitardandoSpeedDiv = 2;
7491
7528
  var CrescendoVolumeAdd = 0.5;
@@ -7803,7 +7840,7 @@ var Player = class _Player {
7803
7840
  }
7804
7841
  if (arpeggioDelayTicks > 0) {
7805
7842
  let arpeggioDelay = getDuration(arpeggioDelayTicks, tempo);
7806
- window.setTimeout(() => Audio.playNote(note.note, noteSeconds, volume), arpeggioDelay * 1e3);
7843
+ _setTimeout(() => Audio.playNote(note.note, noteSeconds, volume), arpeggioDelay * 1e3);
7807
7844
  } else {
7808
7845
  Audio.playNote(note.note, noteSeconds, volume);
7809
7846
  }
@@ -7811,7 +7848,7 @@ var Player = class _Player {
7811
7848
  });
7812
7849
  timeoutSeconds = getDuration(col.getTicksToNextColumn() + fermataHoldTicks, tempo);
7813
7850
  }
7814
- this.playTimer = window.setTimeout(() => this.playStep(), timeoutSeconds * 1e3);
7851
+ this.playTimer = _setTimeout(() => this.playStep(), timeoutSeconds * 1e3);
7815
7852
  this.playPos = this.getNextPlayPosition(this.playPos);
7816
7853
  this.notifyPlayStateChanged();
7817
7854
  }
@@ -7837,7 +7874,7 @@ var Player = class _Player {
7837
7874
  }
7838
7875
  pause() {
7839
7876
  if (this.playTimer) {
7840
- window.clearTimeout(this.playTimer);
7877
+ _clearTimeout(this.playTimer);
7841
7878
  this.playTimer = void 0;
7842
7879
  }
7843
7880
  this.notifyCursorPositionChanged();
@@ -7846,7 +7883,7 @@ var Player = class _Player {
7846
7883
  stop() {
7847
7884
  this.playPos = void 0;
7848
7885
  if (this.playTimer) {
7849
- window.clearTimeout(this.playTimer);
7886
+ _clearTimeout(this.playTimer);
7850
7887
  this.playTimer = void 0;
7851
7888
  }
7852
7889
  this.notifyCursorPositionChanged();
@@ -13919,7 +13956,7 @@ var import_core20 = require("web-music-score/core");
13919
13956
 
13920
13957
  @tspro/ts-utils-lib/dist/index.mjs:
13921
13958
  (*!
13922
- * TsUtilsLib v2.2.0 (esm)
13959
+ * TsUtilsLib v2.2.1 (esm)
13923
13960
  * (c) 2023-2025 PahkaSoft
13924
13961
  * Licensed under the MIT License
13925
13962
  *)
@@ -1,12 +1,12 @@
1
- /* WebMusicScore v6.0.0-pre.0 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
1
+ /* WebMusicScore v6.0.0-pre.2 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
2
2
  import {
3
3
  MusicError
4
- } from "../chunk-FCR7WBDV.mjs";
4
+ } from "../chunk-5P4O5YX2.mjs";
5
5
  import {
6
6
  NoteLengthProps,
7
7
  RhythmProps,
8
8
  validateNoteLength
9
- } from "../chunk-OZZ3NSJS.mjs";
9
+ } from "../chunk-GNFWJCFN.mjs";
10
10
  import {
11
11
  AnchoredRect,
12
12
  BiMap,
@@ -20,12 +20,12 @@ import {
20
20
  device_exports,
21
21
  guard_exports,
22
22
  utils_exports
23
- } from "../chunk-URLQD334.mjs";
23
+ } from "../chunk-7PNMM2PM.mjs";
24
24
  import {
25
25
  __publicField,
26
26
  __spreadProps,
27
27
  __spreadValues
28
- } from "../chunk-2NTPGV6U.mjs";
28
+ } from "../chunk-OXLTN43T.mjs";
29
29
 
30
30
  // src/score/engine/settings.ts
31
31
  var DebugSettings = {
@@ -839,7 +839,7 @@ var RenderContext = class {
839
839
  __publicField(this, "onMouseMoveFn");
840
840
  __publicField(this, "onMouseLeaveFn");
841
841
  __publicField(this, "onTouchEndFn");
842
- this.devicePixelRatio = window.devicePixelRatio;
842
+ this.devicePixelRatio = typeof window !== "undefined" ? window.devicePixelRatio : 1;
843
843
  this.fontSize = device_exports.FontSize * DocumentSettings.DocumentScale * this.devicePixelRatio;
844
844
  this.unitSize = this.fontSize * 0.3;
845
845
  this._lineWidth = this.unitSize * 0.2;
@@ -886,6 +886,10 @@ var RenderContext = class {
886
886
  }
887
887
  const [nr, ng, nb, na] = colorNameToRGBA(data.color);
888
888
  const threshold = 40;
889
+ if (typeof document === "undefined") {
890
+ console.error("Failed to colorize image: document is undefined.");
891
+ return;
892
+ }
889
893
  const canvas = document.createElement("canvas");
890
894
  canvas.width = data.img.width;
891
895
  canvas.height = data.img.height;
@@ -3650,6 +3654,13 @@ function getAnnotation(text) {
3650
3654
  }
3651
3655
 
3652
3656
  // src/score/engine/player.ts
3657
+ function _setTimeout(cb, ms) {
3658
+ return typeof window === "undefined" ? void 0 : window.setTimeout(cb, ms);
3659
+ }
3660
+ function _clearTimeout(t) {
3661
+ if (typeof window !== "undefined")
3662
+ window.clearTimeout(t);
3663
+ }
3653
3664
  var AccelerandoSpeedMul = 2;
3654
3665
  var RitardandoSpeedDiv = 2;
3655
3666
  var CrescendoVolumeAdd = 0.5;
@@ -3967,7 +3978,7 @@ var Player = class _Player {
3967
3978
  }
3968
3979
  if (arpeggioDelayTicks > 0) {
3969
3980
  let arpeggioDelay = getDuration(arpeggioDelayTicks, tempo);
3970
- window.setTimeout(() => Audio.playNote(note.note, noteSeconds, volume), arpeggioDelay * 1e3);
3981
+ _setTimeout(() => Audio.playNote(note.note, noteSeconds, volume), arpeggioDelay * 1e3);
3971
3982
  } else {
3972
3983
  Audio.playNote(note.note, noteSeconds, volume);
3973
3984
  }
@@ -3975,7 +3986,7 @@ var Player = class _Player {
3975
3986
  });
3976
3987
  timeoutSeconds = getDuration(col.getTicksToNextColumn() + fermataHoldTicks, tempo);
3977
3988
  }
3978
- this.playTimer = window.setTimeout(() => this.playStep(), timeoutSeconds * 1e3);
3989
+ this.playTimer = _setTimeout(() => this.playStep(), timeoutSeconds * 1e3);
3979
3990
  this.playPos = this.getNextPlayPosition(this.playPos);
3980
3991
  this.notifyPlayStateChanged();
3981
3992
  }
@@ -4001,7 +4012,7 @@ var Player = class _Player {
4001
4012
  }
4002
4013
  pause() {
4003
4014
  if (this.playTimer) {
4004
- window.clearTimeout(this.playTimer);
4015
+ _clearTimeout(this.playTimer);
4005
4016
  this.playTimer = void 0;
4006
4017
  }
4007
4018
  this.notifyCursorPositionChanged();
@@ -4010,7 +4021,7 @@ var Player = class _Player {
4010
4021
  stop() {
4011
4022
  this.playPos = void 0;
4012
4023
  if (this.playTimer) {
4013
- window.clearTimeout(this.playTimer);
4024
+ _clearTimeout(this.playTimer);
4014
4025
  this.playTimer = void 0;
4015
4026
  }
4016
4027
  this.notifyCursorPositionChanged();
@@ -1,4 +1,4 @@
1
- import { N as Note, A as Accidental } from './note-RVXvpfyV.js';
1
+ import { N as Note, A as Accidental } from './note-CJuq5aBy.js';
2
2
 
3
3
  /** Mode enum. */
4
4
  declare enum Mode {
@@ -1,8 +1,8 @@
1
- import { N as Note } from '../note-RVXvpfyV.js';
2
- export { A as Accidental, d as DefaultGuitarNoteLabel, D as DefaultPitchNotation, G as GuitarNoteLabel, e as GuitarNoteLabelList, a as NoteLetter, P as ParsedNote, b as PitchNotation, c as PitchNotationList, S as SymbolSet, g as getPitchNotationName, f as validateGuitarNoteLabel, v as validatePitchNotation } from '../note-RVXvpfyV.js';
3
- import { D as Degree } from '../scale-B1M10_fu.js';
4
- export { b as Interval, I as IntervalDirection, a as IntervalQuality, c as Scale, d as ScaleFactory, S as ScaleType, i as getDefaultScale, h as getScale, e as getScaleFactory, g as getScaleFactoryList, v as validateIntervalQuality, f as validateScaleType } from '../scale-B1M10_fu.js';
5
- export { A as AccidentalType, B as BeamGrouping, K as KeySignature, M as Mode, N as NoteLength, j as NoteLengthProps, h as NoteLengthStr, R as RhythmProps, c as Tempo, a as TimeSignature, T as TimeSignatures, n as Tuplet, k as TupletRatio, f as alterTempoSpeed, g as getDefaultKeySignature, d as getDefaultTempo, b as getDefaultTimeSignature, e as getTempoString, i as isNoteLength, l as isTupletRatio, v as validateNoteLength, m as validateTupletRatio } from '../tempo-D-JF-8b_.js';
1
+ import { N as Note } from '../note-CJuq5aBy.js';
2
+ export { A as Accidental, d as DefaultGuitarNoteLabel, D as DefaultPitchNotation, G as GuitarNoteLabel, e as GuitarNoteLabelList, a as NoteLetter, P as ParsedNote, b as PitchNotation, c as PitchNotationList, S as SymbolSet, g as getPitchNotationName, f as validateGuitarNoteLabel, v as validatePitchNotation } from '../note-CJuq5aBy.js';
3
+ import { D as Degree } from '../scale-DxGqFxlv.js';
4
+ export { b as Interval, I as IntervalDirection, a as IntervalQuality, c as Scale, d as ScaleFactory, S as ScaleType, i as getDefaultScale, h as getScale, e as getScaleFactory, g as getScaleFactoryList, v as validateIntervalQuality, f as validateScaleType } from '../scale-DxGqFxlv.js';
5
+ export { A as AccidentalType, B as BeamGrouping, K as KeySignature, M as Mode, N as NoteLength, j as NoteLengthProps, h as NoteLengthStr, R as RhythmProps, c as Tempo, a as TimeSignature, T as TimeSignatures, n as Tuplet, k as TupletRatio, f as alterTempoSpeed, g as getDefaultKeySignature, d as getDefaultTempo, b as getDefaultTimeSignature, e as getTempoString, i as isNoteLength, l as isTupletRatio, v as validateNoteLength, m as validateTupletRatio } from '../tempo-pCAa6qgo.js';
6
6
 
7
7
  /** Chord info type. */
8
8
  type ChordInfo = {