web-music-score 6.0.0-pre.0 → 6.0.0-pre.1
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/CHANGELOG.md +3 -0
- package/dist/audio/index.js +61 -35
- package/dist/audio/index.mjs +4 -4
- package/dist/audio-cg/index.js +1 -1
- package/dist/audio-cg/index.mjs +4 -4
- package/dist/audio-synth/index.js +1 -1
- package/dist/audio-synth/index.mjs +4 -4
- package/dist/{chunk-2NTPGV6U.mjs → chunk-A7C2G7OG.mjs} +2 -2
- package/dist/{chunk-OZZ3NSJS.mjs → chunk-GNT3ECDB.mjs} +4 -4
- package/dist/{chunk-OKY6DMTT.mjs → chunk-LO4NI4AU.mjs} +3 -3
- package/dist/{chunk-FCR7WBDV.mjs → chunk-PW2SO6EZ.mjs} +3 -3
- package/dist/{chunk-SNZ77AGL.mjs → chunk-VHB57TXT.mjs} +2 -2
- package/dist/{chunk-URLQD334.mjs → chunk-X7BMJX7E.mjs} +63 -37
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +4 -4
- package/dist/iife/audio-cg.global.js +1 -1
- package/dist/iife/index.global.js +12 -12
- package/dist/pieces/index.js +1 -1
- package/dist/pieces/index.mjs +2 -2
- package/dist/react-ui/index.js +1 -1
- package/dist/react-ui/index.mjs +2 -2
- package/dist/score/index.js +77 -40
- package/dist/score/index.mjs +21 -10
- package/dist/theory/index.js +61 -35
- package/dist/theory/index.mjs +4 -4
- package/package.json +2 -2
package/dist/pieces/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* WebMusicScore v6.0.0-pre.
|
|
1
|
+
/* WebMusicScore v6.0.0-pre.1 | (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;
|
package/dist/pieces/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* WebMusicScore v6.0.0-pre.
|
|
2
|
-
import "../chunk-
|
|
1
|
+
/* WebMusicScore v6.0.0-pre.1 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
|
|
2
|
+
import "../chunk-A7C2G7OG.mjs";
|
|
3
3
|
|
|
4
4
|
// src/pieces/andante-diabelli.ts
|
|
5
5
|
import { DocumentBuilder } from "web-music-score/score";
|
package/dist/react-ui/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* WebMusicScore v6.0.0-pre.
|
|
1
|
+
/* WebMusicScore v6.0.0-pre.1 | (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;
|
package/dist/react-ui/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* WebMusicScore v6.0.0-pre.
|
|
1
|
+
/* WebMusicScore v6.0.0-pre.1 | (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-
|
|
4
|
+
} from "../chunk-A7C2G7OG.mjs";
|
|
5
5
|
|
|
6
6
|
// src/react-ui/music-score-view.tsx
|
|
7
7
|
import * as React from "react";
|
package/dist/score/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* WebMusicScore v6.0.0-pre.
|
|
1
|
+
/* WebMusicScore v6.0.0-pre.1 | (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
|
|
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
|
|
1289
|
+
if (typeof document !== "undefined")
|
|
1290
|
+
document.cookie = cookie;
|
|
1288
1291
|
return value;
|
|
1289
1292
|
}
|
|
1290
1293
|
function _read(name, defaultValue) {
|
|
1291
|
-
let str2 =
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
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
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
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 (
|
|
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
|
-
|
|
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
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
top
|
|
1608
|
-
|
|
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" ?
|
|
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" ?
|
|
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
|
|
1728
|
-
|
|
1729
|
-
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
13959
|
+
* TsUtilsLib v2.2.1 (esm)
|
|
13923
13960
|
* (c) 2023-2025 PahkaSoft
|
|
13924
13961
|
* Licensed under the MIT License
|
|
13925
13962
|
*)
|
package/dist/score/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/* WebMusicScore v6.0.0-pre.
|
|
1
|
+
/* WebMusicScore v6.0.0-pre.1 | (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-
|
|
4
|
+
} from "../chunk-PW2SO6EZ.mjs";
|
|
5
5
|
import {
|
|
6
6
|
NoteLengthProps,
|
|
7
7
|
RhythmProps,
|
|
8
8
|
validateNoteLength
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-GNT3ECDB.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-
|
|
23
|
+
} from "../chunk-X7BMJX7E.mjs";
|
|
24
24
|
import {
|
|
25
25
|
__publicField,
|
|
26
26
|
__spreadProps,
|
|
27
27
|
__spreadValues
|
|
28
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-A7C2G7OG.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
|
-
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
4024
|
+
_clearTimeout(this.playTimer);
|
|
4014
4025
|
this.playTimer = void 0;
|
|
4015
4026
|
}
|
|
4016
4027
|
this.notifyCursorPositionChanged();
|
package/dist/theory/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* WebMusicScore v6.0.0-pre.
|
|
1
|
+
/* WebMusicScore v6.0.0-pre.1 | (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;
|
|
@@ -1228,7 +1228,9 @@ var _consent;
|
|
|
1228
1228
|
var _expires;
|
|
1229
1229
|
var str = _read(ConsentCookieName);
|
|
1230
1230
|
_consent = str === "accept" || str === "decline" ? str : void 0;
|
|
1231
|
-
function
|
|
1231
|
+
function _getCookieList() {
|
|
1232
|
+
if (typeof document === "undefined")
|
|
1233
|
+
return [];
|
|
1232
1234
|
let s = document.cookie;
|
|
1233
1235
|
return s.split(";").map((c) => c.trim());
|
|
1234
1236
|
}
|
|
@@ -1237,15 +1239,17 @@ function _save(name, value) {
|
|
|
1237
1239
|
if (_expires) {
|
|
1238
1240
|
cookie += "expires=" + _expires.toUTCString() + ";";
|
|
1239
1241
|
}
|
|
1240
|
-
document
|
|
1242
|
+
if (typeof document !== "undefined")
|
|
1243
|
+
document.cookie = cookie;
|
|
1241
1244
|
return value;
|
|
1242
1245
|
}
|
|
1243
1246
|
function _read(name, defaultValue) {
|
|
1244
|
-
let str2 =
|
|
1247
|
+
let str2 = _getCookieList().find((c) => c.startsWith(name + "="));
|
|
1245
1248
|
return str2 === void 0 ? defaultValue : str2.substring(name.length + 1);
|
|
1246
1249
|
}
|
|
1247
1250
|
function _erase(name) {
|
|
1248
|
-
|
|
1251
|
+
if (typeof document !== "undefined")
|
|
1252
|
+
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 UTC;";
|
|
1249
1253
|
}
|
|
1250
1254
|
function setExpireDays(days) {
|
|
1251
1255
|
_expires = /* @__PURE__ */ new Date();
|
|
@@ -1295,7 +1299,8 @@ function erase(name) {
|
|
|
1295
1299
|
_erase(name);
|
|
1296
1300
|
}
|
|
1297
1301
|
function eraseAll() {
|
|
1298
|
-
|
|
1302
|
+
if (typeof document !== "undefined")
|
|
1303
|
+
document.cookie.split(";").forEach((c) => erase(c.trim().split("=")[0]));
|
|
1299
1304
|
}
|
|
1300
1305
|
var device_exports = {};
|
|
1301
1306
|
__export2(device_exports, {
|
|
@@ -1311,12 +1316,16 @@ __export2(device_exports, {
|
|
|
1311
1316
|
toPx: () => toPx
|
|
1312
1317
|
});
|
|
1313
1318
|
function getDPI() {
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1319
|
+
try {
|
|
1320
|
+
let el = document.createElement("div");
|
|
1321
|
+
el.style.width = "1in";
|
|
1322
|
+
document.body.appendChild(el);
|
|
1323
|
+
let dpi = el.offsetWidth;
|
|
1324
|
+
el.remove();
|
|
1325
|
+
return dpi || 96;
|
|
1326
|
+
} catch (e) {
|
|
1327
|
+
return 96;
|
|
1328
|
+
}
|
|
1320
1329
|
}
|
|
1321
1330
|
function getScrollBarWidth() {
|
|
1322
1331
|
try {
|
|
@@ -1339,18 +1348,23 @@ function getScrollBarWidth() {
|
|
|
1339
1348
|
}
|
|
1340
1349
|
}
|
|
1341
1350
|
function getSystemFontSize() {
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1351
|
+
try {
|
|
1352
|
+
let tmpDiv = document.createElement("div");
|
|
1353
|
+
tmpDiv.style.cssText = "display:inline-block; padding:0; line-height:1; position:absolute; visibility:hidden; font-size:1em";
|
|
1354
|
+
tmpDiv.appendChild(document.createTextNode("M"));
|
|
1355
|
+
document.body.appendChild(tmpDiv);
|
|
1356
|
+
let fontsize = tmpDiv.offsetHeight;
|
|
1357
|
+
document.body.removeChild(tmpDiv);
|
|
1358
|
+
return fontsize;
|
|
1359
|
+
} catch (e) {
|
|
1360
|
+
return 16;
|
|
1361
|
+
}
|
|
1349
1362
|
}
|
|
1350
1363
|
function getIsTouchDevice() {
|
|
1351
|
-
if (
|
|
1364
|
+
if (typeof window === "undefined")
|
|
1365
|
+
return false;
|
|
1366
|
+
if ("ontouchstart" in window || "DocumentTouch" in window || "createTouch" in document && "createTouchList" in document)
|
|
1352
1367
|
return true;
|
|
1353
|
-
}
|
|
1354
1368
|
var prefixes = " -webkit- -moz- -o- -ms- ".split(" ");
|
|
1355
1369
|
var mq = function(query2) {
|
|
1356
1370
|
return window.matchMedia(query2).matches;
|
|
@@ -1363,7 +1377,10 @@ function getIsMobileDevice() {
|
|
|
1363
1377
|
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));
|
|
1364
1378
|
}
|
|
1365
1379
|
function getHostAddress() {
|
|
1366
|
-
|
|
1380
|
+
if (typeof location === "undefined" || !location.host) {
|
|
1381
|
+
return "localhost";
|
|
1382
|
+
}
|
|
1383
|
+
return `${location.protocol}//${location.host}`;
|
|
1367
1384
|
}
|
|
1368
1385
|
var UnitRegExp = /^(mm|cm|in|inch|px|em)$/;
|
|
1369
1386
|
var ValueUnitRegExp = /^([0-9\\.]+)(.*)$/;
|
|
@@ -1518,6 +1535,10 @@ __export2(dom_exports, {
|
|
|
1518
1535
|
setWidth: () => setWidth,
|
|
1519
1536
|
styleLayoutChanged: () => styleLayoutChanged
|
|
1520
1537
|
});
|
|
1538
|
+
function _getElemById(id) {
|
|
1539
|
+
var _a;
|
|
1540
|
+
return typeof document === "undefined" ? void 0 : (_a = document.getElementById(id)) != null ? _a : void 0;
|
|
1541
|
+
}
|
|
1521
1542
|
function toPx2(value) {
|
|
1522
1543
|
return value === void 0 ? void 0 : device_exports.toPx(value);
|
|
1523
1544
|
}
|
|
@@ -1554,12 +1575,17 @@ function setOffset(el, left, top, unit = "px") {
|
|
|
1554
1575
|
el.style.top = top + unit;
|
|
1555
1576
|
}
|
|
1556
1577
|
function getOffset(el) {
|
|
1557
|
-
let
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
top
|
|
1561
|
-
|
|
1562
|
-
|
|
1578
|
+
let { left, top } = el.getBoundingClientRect();
|
|
1579
|
+
if (typeof window !== "undefined") {
|
|
1580
|
+
left += window.pageXOffset;
|
|
1581
|
+
top += window.pageYOffset;
|
|
1582
|
+
}
|
|
1583
|
+
if (typeof document !== "undefined") {
|
|
1584
|
+
let de = document.documentElement;
|
|
1585
|
+
left -= de.clientLeft;
|
|
1586
|
+
top -= de.clientTop;
|
|
1587
|
+
}
|
|
1588
|
+
return { left, top };
|
|
1563
1589
|
}
|
|
1564
1590
|
function getWidth(el) {
|
|
1565
1591
|
if (el instanceof Window) {
|
|
@@ -1599,11 +1625,11 @@ function setRect(el, left, top, width, height, unit = "px") {
|
|
|
1599
1625
|
el.style.height = height + unit;
|
|
1600
1626
|
}
|
|
1601
1627
|
function getButton(btn) {
|
|
1602
|
-
let el = typeof btn === "string" ?
|
|
1628
|
+
let el = typeof btn === "string" ? _getElemById(btn) : btn;
|
|
1603
1629
|
return el instanceof HTMLButtonElement ? el : void 0;
|
|
1604
1630
|
}
|
|
1605
1631
|
function getCanvas(canvas2) {
|
|
1606
|
-
let el = typeof canvas2 === "string" ?
|
|
1632
|
+
let el = typeof canvas2 === "string" ? _getElemById(canvas2) : canvas2;
|
|
1607
1633
|
return el instanceof HTMLCanvasElement ? el : void 0;
|
|
1608
1634
|
}
|
|
1609
1635
|
function getPadding(style) {
|
|
@@ -1677,11 +1703,11 @@ function styleLayoutChanged(style1, style2) {
|
|
|
1677
1703
|
}
|
|
1678
1704
|
var canvas;
|
|
1679
1705
|
function getCanvasTextWidth(text, font) {
|
|
1680
|
-
canvas
|
|
1681
|
-
|
|
1682
|
-
|
|
1706
|
+
if (!canvas && typeof document !== "undefined")
|
|
1707
|
+
canvas = document.createElement("canvas");
|
|
1708
|
+
let ctx = canvas == null ? void 0 : canvas.getContext("2d");
|
|
1709
|
+
if (!ctx)
|
|
1683
1710
|
return 0;
|
|
1684
|
-
}
|
|
1685
1711
|
ctx.font = font;
|
|
1686
1712
|
return ctx.measureText(text).width;
|
|
1687
1713
|
}
|
|
@@ -4808,7 +4834,7 @@ var import_core10 = require("web-music-score/core");
|
|
|
4808
4834
|
|
|
4809
4835
|
@tspro/ts-utils-lib/dist/index.mjs:
|
|
4810
4836
|
(*!
|
|
4811
|
-
* TsUtilsLib v2.2.
|
|
4837
|
+
* TsUtilsLib v2.2.1 (esm)
|
|
4812
4838
|
* (c) 2023-2025 PahkaSoft
|
|
4813
4839
|
* Licensed under the MIT License
|
|
4814
4840
|
*)
|
package/dist/theory/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* WebMusicScore v6.0.0-pre.
|
|
1
|
+
/* WebMusicScore v6.0.0-pre.1 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
|
|
2
2
|
import {
|
|
3
3
|
NoteLength,
|
|
4
4
|
NoteLengthProps,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
isTupletRatio,
|
|
9
9
|
validateNoteLength,
|
|
10
10
|
validateTupletRatio
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-GNT3ECDB.mjs";
|
|
12
12
|
import {
|
|
13
13
|
IndexArray,
|
|
14
14
|
LRUCache,
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
UniMap,
|
|
17
17
|
guard_exports,
|
|
18
18
|
utils_exports
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-X7BMJX7E.mjs";
|
|
20
20
|
import {
|
|
21
21
|
__publicField
|
|
22
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-A7C2G7OG.mjs";
|
|
23
23
|
|
|
24
24
|
// src/theory/types.ts
|
|
25
25
|
import { MusicError, MusicErrorType } from "web-music-score/core";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "web-music-score",
|
|
3
|
-
"version": "6.0.0-pre.
|
|
3
|
+
"version": "6.0.0-pre.1",
|
|
4
4
|
"author": "Stefan Brockmann",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
},
|
|
111
111
|
"devDependencies": {
|
|
112
112
|
"@tspro/tsup-plugin-inline-assets": "^1.0.0",
|
|
113
|
-
"@tspro/ts-utils-lib": "^2.2.
|
|
113
|
+
"@tspro/ts-utils-lib": "^2.2.1",
|
|
114
114
|
"@types/react": "^18.0.0",
|
|
115
115
|
"@types/react-dom": "^18.0.0",
|
|
116
116
|
"color-name-to-code": "^1.0.1",
|