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.
- package/CHANGELOG.md +6 -0
- package/dist/audio/index.d.ts +1 -1
- 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-OKY6DMTT.mjs → chunk-3L3RBNBV.mjs} +3 -3
- package/dist/{chunk-FCR7WBDV.mjs → chunk-5P4O5YX2.mjs} +3 -3
- package/dist/{chunk-SNZ77AGL.mjs → chunk-5W6ROWBC.mjs} +2 -2
- package/dist/{chunk-URLQD334.mjs → chunk-7PNMM2PM.mjs} +63 -37
- package/dist/{chunk-OZZ3NSJS.mjs → chunk-GNFWJCFN.mjs} +4 -4
- package/dist/{chunk-2NTPGV6U.mjs → chunk-OXLTN43T.mjs} +2 -2
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +4 -4
- package/dist/iife/{audio-cg.global.js → audio-cg.js} +2 -2
- package/dist/iife/{index.global.js → index.js} +13 -13
- package/dist/{music-objects-DLmp5uL6.d.ts → music-objects-CiIS8yPn.d.ts} +2 -2
- package/dist/{note-RVXvpfyV.d.ts → note-CJuq5aBy.d.ts} +1 -1
- package/dist/pieces/index.d.ts +3 -3
- package/dist/pieces/index.js +1 -1
- package/dist/pieces/index.mjs +2 -2
- package/dist/react-ui/index.d.ts +3 -3
- package/dist/react-ui/index.js +1 -1
- package/dist/react-ui/index.mjs +2 -2
- package/dist/{scale-B1M10_fu.d.ts → scale-DxGqFxlv.d.ts} +2 -2
- package/dist/score/index.d.ts +5 -5
- package/dist/score/index.js +77 -40
- package/dist/score/index.mjs +21 -10
- package/dist/{tempo-D-JF-8b_.d.ts → tempo-pCAa6qgo.d.ts} +1 -1
- package/dist/theory/index.d.ts +5 -5
- package/dist/theory/index.js +61 -35
- package/dist/theory/index.mjs +4 -4
- package/package.json +4 -3
package/dist/theory/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* WebMusicScore v6.0.0-pre.
|
|
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;
|
|
@@ -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.2 | (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-GNFWJCFN.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-7PNMM2PM.mjs";
|
|
20
20
|
import {
|
|
21
21
|
__publicField
|
|
22
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-OXLTN43T.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.2",
|
|
4
4
|
"author": "Stefan Brockmann",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -95,7 +95,8 @@
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
|
-
"unpkg": "./dist/iife/index.
|
|
98
|
+
"unpkg": "./dist/iife/index.js",
|
|
99
|
+
"jsdelivr": "./dist/iife/index.js",
|
|
99
100
|
"files": [
|
|
100
101
|
"CHANGELOG.md",
|
|
101
102
|
"LICENSE",
|
|
@@ -110,7 +111,7 @@
|
|
|
110
111
|
},
|
|
111
112
|
"devDependencies": {
|
|
112
113
|
"@tspro/tsup-plugin-inline-assets": "^1.0.0",
|
|
113
|
-
"@tspro/ts-utils-lib": "^2.2.
|
|
114
|
+
"@tspro/ts-utils-lib": "^2.2.1",
|
|
114
115
|
"@types/react": "^18.0.0",
|
|
115
116
|
"@types/react-dom": "^18.0.0",
|
|
116
117
|
"color-name-to-code": "^1.0.1",
|