@tspro/web-music-score 5.5.0 → 5.5.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 +4 -0
- package/README.md +8 -553
- package/dist/audio/index.js +163 -52
- 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-BMKUAUSJ.mjs → chunk-7GVRGM3N.mjs} +3 -3
- package/dist/{chunk-T6TYLAJE.mjs → chunk-AUOH7S2E.mjs} +165 -54
- package/dist/{chunk-2DCCUAGC.mjs → chunk-BZE5UGTJ.mjs} +3 -3
- package/dist/{chunk-2PEB4HWS.mjs → chunk-FLBNOYUN.mjs} +2 -2
- package/dist/{chunk-33HIE3HR.mjs → chunk-KKIFSIFK.mjs} +4 -4
- package/dist/{chunk-PCQGQM63.mjs → chunk-L7VPSGMT.mjs} +3 -3
- 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 +13 -13
- package/dist/pieces/index.js +1 -1
- package/dist/pieces/index.mjs +2 -2
- package/dist/react-ui/index.js +163 -52
- package/dist/react-ui/index.mjs +3 -3
- package/dist/score/index.js +168 -55
- package/dist/score/index.mjs +9 -7
- package/dist/theory/index.js +164 -53
- package/dist/theory/index.mjs +4 -4
- package/package.json +1 -1
package/dist/theory/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/* WebMusicScore v5.5.
|
|
1
|
+
/* WebMusicScore v5.5.1 | (c) 2023-2025 PahkaSoft | 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;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
7
|
+
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : /* @__PURE__ */ Symbol.for("Symbol." + name);
|
|
8
8
|
var __typeError = (msg) => {
|
|
9
9
|
throw TypeError(msg);
|
|
10
10
|
};
|
|
@@ -174,6 +174,11 @@ __export2(assert_exports, {
|
|
|
174
174
|
isNumber: () => isNumber2,
|
|
175
175
|
isNumberBetween: () => isNumberBetween2,
|
|
176
176
|
isNumberBetweenExclusive: () => isNumberBetweenExclusive2,
|
|
177
|
+
isNumberEq: () => isNumberEq2,
|
|
178
|
+
isNumberGt: () => isNumberGt2,
|
|
179
|
+
isNumberGte: () => isNumberGte2,
|
|
180
|
+
isNumberLt: () => isNumberLt2,
|
|
181
|
+
isNumberLte: () => isNumberLte2,
|
|
177
182
|
isNumberOrUndefined: () => isNumberOrUndefined2,
|
|
178
183
|
isNumericString: () => isNumericString2,
|
|
179
184
|
isObject: () => isObject2,
|
|
@@ -185,6 +190,7 @@ __export2(assert_exports, {
|
|
|
185
190
|
isPosZero: () => isPosZero2,
|
|
186
191
|
isPowerOfTwo: () => isPowerOfTwo2,
|
|
187
192
|
isSafeInteger: () => isSafeInteger2,
|
|
193
|
+
isSafeNumber: () => isSafeNumber2,
|
|
188
194
|
isStrictEqual: () => isStrictEqual2,
|
|
189
195
|
isString: () => isString2,
|
|
190
196
|
isStringOrUndefined: () => isStringOrUndefined2,
|
|
@@ -208,6 +214,9 @@ __export2(str_exports, {
|
|
|
208
214
|
removeAt: () => removeAt,
|
|
209
215
|
repeatString: () => repeatString,
|
|
210
216
|
replaceAt: () => replaceAt,
|
|
217
|
+
splitByCaps: () => splitByCaps,
|
|
218
|
+
splitByChars: () => splitByChars,
|
|
219
|
+
splitByStrings: () => splitByStrings,
|
|
211
220
|
stringify: () => stringify,
|
|
212
221
|
toCharArray: () => toCharArray
|
|
213
222
|
});
|
|
@@ -272,6 +281,11 @@ __export2(guard_exports, {
|
|
|
272
281
|
isNumber: () => isNumber,
|
|
273
282
|
isNumberBetween: () => isNumberBetween,
|
|
274
283
|
isNumberBetweenExclusive: () => isNumberBetweenExclusive,
|
|
284
|
+
isNumberEq: () => isNumberEq,
|
|
285
|
+
isNumberGt: () => isNumberGt,
|
|
286
|
+
isNumberGte: () => isNumberGte,
|
|
287
|
+
isNumberLt: () => isNumberLt,
|
|
288
|
+
isNumberLte: () => isNumberLte,
|
|
275
289
|
isNumberOrUndefined: () => isNumberOrUndefined,
|
|
276
290
|
isNumericString: () => isNumericString,
|
|
277
291
|
isObject: () => isObject,
|
|
@@ -283,6 +297,7 @@ __export2(guard_exports, {
|
|
|
283
297
|
isPosZero: () => isPosZero,
|
|
284
298
|
isPowerOfTwo: () => isPowerOfTwo,
|
|
285
299
|
isSafeInteger: () => isSafeInteger,
|
|
300
|
+
isSafeNumber: () => isSafeNumber,
|
|
286
301
|
isStrictEqual: () => isStrictEqual,
|
|
287
302
|
isString: () => isString,
|
|
288
303
|
isStringOrUndefined: () => isStringOrUndefined,
|
|
@@ -434,9 +449,33 @@ function isBigInt(val) {
|
|
|
434
449
|
function isNumber(val) {
|
|
435
450
|
return typeof val === "number";
|
|
436
451
|
}
|
|
452
|
+
function isSafeNumber(val) {
|
|
453
|
+
return isNumber(val) && Number.isSafeInteger(val);
|
|
454
|
+
}
|
|
437
455
|
function isNumberOrUndefined(val) {
|
|
438
456
|
return typeof val === "number" || val === void 0;
|
|
439
457
|
}
|
|
458
|
+
function isNumberEq(val, ref) {
|
|
459
|
+
return isNumber(val) && val === ref;
|
|
460
|
+
}
|
|
461
|
+
function isNumberGt(val, ref) {
|
|
462
|
+
return isNumber(val) && isNumber(ref) && val > ref;
|
|
463
|
+
}
|
|
464
|
+
function isNumberGte(val, ref) {
|
|
465
|
+
return isNumber(val) && isNumber(ref) && val >= ref;
|
|
466
|
+
}
|
|
467
|
+
function isNumberLt(val, ref) {
|
|
468
|
+
return isNumber(val) && isNumber(ref) && val < ref;
|
|
469
|
+
}
|
|
470
|
+
function isNumberLte(val, ref) {
|
|
471
|
+
return isNumber(val) && isNumber(ref) && val <= ref;
|
|
472
|
+
}
|
|
473
|
+
function isNumberBetween(val, min, max) {
|
|
474
|
+
return isNumber(val) && isNumber(min) && isNumber(max) && val >= min && val <= max;
|
|
475
|
+
}
|
|
476
|
+
function isNumberBetweenExclusive(val, min, max) {
|
|
477
|
+
return isNumber(val) && isNumber(min) && isNumber(max) && val > min && val < max;
|
|
478
|
+
}
|
|
440
479
|
function isFinite2(val) {
|
|
441
480
|
return typeof val === "number" && Number.isFinite(val);
|
|
442
481
|
}
|
|
@@ -473,12 +512,6 @@ function isIntegerBetween(val, min, max) {
|
|
|
473
512
|
function isIntegerBetweenExclusive(val, min, max) {
|
|
474
513
|
return isInteger(val) && isNumber(min) && isNumber(max) && val > min && val < max;
|
|
475
514
|
}
|
|
476
|
-
function isNumberBetween(val, min, max) {
|
|
477
|
-
return isNumber(val) && isNumber(min) && isNumber(max) && val >= min && val <= max;
|
|
478
|
-
}
|
|
479
|
-
function isNumberBetweenExclusive(val, min, max) {
|
|
480
|
-
return isNumber(val) && isNumber(min) && isNumber(max) && val > min && val < max;
|
|
481
|
-
}
|
|
482
515
|
function isNaNValue(val) {
|
|
483
516
|
return typeof val === "number" && Number.isNaN(val);
|
|
484
517
|
}
|
|
@@ -744,6 +777,18 @@ function stringify(value, maxDepth = 5, seen = /* @__PURE__ */ new WeakSet()) {
|
|
|
744
777
|
}
|
|
745
778
|
return String(value);
|
|
746
779
|
}
|
|
780
|
+
function splitByCaps(str2) {
|
|
781
|
+
return str2.split(/(?=[A-Z])/).filter((x) => !!x);
|
|
782
|
+
}
|
|
783
|
+
function splitByStrings(str2, ...splitters) {
|
|
784
|
+
if (splitters.length === 0) return [str2];
|
|
785
|
+
const escaped = splitters.map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
786
|
+
const regex = new RegExp(escaped.join("|"), "g");
|
|
787
|
+
return str2.split(regex);
|
|
788
|
+
}
|
|
789
|
+
function splitByChars(str2, splitters) {
|
|
790
|
+
return splitByStrings(str2, ...splitters.split(""));
|
|
791
|
+
}
|
|
747
792
|
var fmt = stringify;
|
|
748
793
|
var errorConstructor = Error;
|
|
749
794
|
function setErrorClass(errorClass) {
|
|
@@ -961,11 +1006,51 @@ function isNumber2(val, msg) {
|
|
|
961
1006
|
_fail(`Expected ${fmt(val)} to be number`, msg);
|
|
962
1007
|
return val;
|
|
963
1008
|
}
|
|
1009
|
+
function isSafeNumber2(val, msg) {
|
|
1010
|
+
if (!guard_exports.isSafeNumber(val))
|
|
1011
|
+
_fail(`Expected ${fmt(val)} to be safe number`, msg);
|
|
1012
|
+
return val;
|
|
1013
|
+
}
|
|
964
1014
|
function isNumberOrUndefined2(val, msg) {
|
|
965
1015
|
if (!guard_exports.isNumberOrUndefined(val))
|
|
966
1016
|
_fail(`Expected ${fmt(val)} to be number or undefined`, msg);
|
|
967
1017
|
return val;
|
|
968
1018
|
}
|
|
1019
|
+
function isNumberEq2(val, ref, msg) {
|
|
1020
|
+
if (!guard_exports.isNumberEq(val, ref))
|
|
1021
|
+
_fail(`Expected ${fmt(val)} to be number equal to ${fmt(ref)}`, msg);
|
|
1022
|
+
return val;
|
|
1023
|
+
}
|
|
1024
|
+
function isNumberGt2(val, ref, msg) {
|
|
1025
|
+
if (!guard_exports.isNumberGt(val, ref))
|
|
1026
|
+
_fail(`Expected ${fmt(val)} to be number > ${fmt(ref)}`, msg);
|
|
1027
|
+
return val;
|
|
1028
|
+
}
|
|
1029
|
+
function isNumberGte2(val, ref, msg) {
|
|
1030
|
+
if (!guard_exports.isNumberGte(val, ref))
|
|
1031
|
+
_fail(`Expected ${fmt(val)} to be number >= ${fmt(ref)}`, msg);
|
|
1032
|
+
return val;
|
|
1033
|
+
}
|
|
1034
|
+
function isNumberLt2(val, ref, msg) {
|
|
1035
|
+
if (!guard_exports.isNumberLt(val, ref))
|
|
1036
|
+
_fail(`Expected ${fmt(val)} to be number < ${fmt(ref)}`, msg);
|
|
1037
|
+
return val;
|
|
1038
|
+
}
|
|
1039
|
+
function isNumberLte2(val, ref, msg) {
|
|
1040
|
+
if (!guard_exports.isNumberLte(val, ref))
|
|
1041
|
+
_fail(`Expected ${fmt(val)} to be number <= ${fmt(ref)}`, msg);
|
|
1042
|
+
return val;
|
|
1043
|
+
}
|
|
1044
|
+
function isNumberBetween2(val, min, max, msg) {
|
|
1045
|
+
if (!guard_exports.isNumberBetween(val, min, max))
|
|
1046
|
+
_fail(`Expected number ${fmt(min)} <= ${fmt(val)} <= ${fmt(max)}`, msg);
|
|
1047
|
+
return val;
|
|
1048
|
+
}
|
|
1049
|
+
function isNumberBetweenExclusive2(val, min, max, msg) {
|
|
1050
|
+
if (!guard_exports.isNumberBetweenExclusive(val, min, max))
|
|
1051
|
+
_fail(`Expected number ${fmt(min)} < ${fmt(val)} < ${fmt(max)}`, msg);
|
|
1052
|
+
return val;
|
|
1053
|
+
}
|
|
969
1054
|
function isFinite3(val, msg) {
|
|
970
1055
|
if (!guard_exports.isFinite(val))
|
|
971
1056
|
_fail(`Expected ${fmt(val)} to be finite`, msg);
|
|
@@ -1026,16 +1111,6 @@ function isIntegerBetweenExclusive2(val, min, max, msg) {
|
|
|
1026
1111
|
_fail(`Expected integer ${fmt(min)} < ${fmt(val)} < ${fmt(max)}`, msg);
|
|
1027
1112
|
return val;
|
|
1028
1113
|
}
|
|
1029
|
-
function isNumberBetween2(val, min, max, msg) {
|
|
1030
|
-
if (!guard_exports.isNumberBetween(val, min, max))
|
|
1031
|
-
_fail(`Expected number ${fmt(min)} <= ${fmt(val)} <= ${fmt(max)}`, msg);
|
|
1032
|
-
return val;
|
|
1033
|
-
}
|
|
1034
|
-
function isNumberBetweenExclusive2(val, min, max, msg) {
|
|
1035
|
-
if (!guard_exports.isNumberBetweenExclusive(val, min, max))
|
|
1036
|
-
_fail(`Expected number ${fmt(min)} < ${fmt(val)} < ${fmt(max)}`, msg);
|
|
1037
|
-
return val;
|
|
1038
|
-
}
|
|
1039
1114
|
function isNaNValue2(val, msg) {
|
|
1040
1115
|
if (!guard_exports.isNaNValue(val))
|
|
1041
1116
|
_fail(`Expected ${fmt(val)} to be NaN`, msg);
|
|
@@ -1156,7 +1231,9 @@ var _consent;
|
|
|
1156
1231
|
var _expires;
|
|
1157
1232
|
var str = _read(ConsentCookieName);
|
|
1158
1233
|
_consent = str === "accept" || str === "decline" ? str : void 0;
|
|
1159
|
-
function
|
|
1234
|
+
function _getCookieList() {
|
|
1235
|
+
if (typeof document === "undefined")
|
|
1236
|
+
return [];
|
|
1160
1237
|
let s = document.cookie;
|
|
1161
1238
|
return s.split(";").map((c) => c.trim());
|
|
1162
1239
|
}
|
|
@@ -1165,15 +1242,17 @@ function _save(name, value) {
|
|
|
1165
1242
|
if (_expires) {
|
|
1166
1243
|
cookie += "expires=" + _expires.toUTCString() + ";";
|
|
1167
1244
|
}
|
|
1168
|
-
document
|
|
1245
|
+
if (typeof document !== "undefined")
|
|
1246
|
+
document.cookie = cookie;
|
|
1169
1247
|
return value;
|
|
1170
1248
|
}
|
|
1171
1249
|
function _read(name, defaultValue) {
|
|
1172
|
-
let str2 =
|
|
1250
|
+
let str2 = _getCookieList().find((c) => c.startsWith(name + "="));
|
|
1173
1251
|
return str2 === void 0 ? defaultValue : str2.substring(name.length + 1);
|
|
1174
1252
|
}
|
|
1175
1253
|
function _erase(name) {
|
|
1176
|
-
|
|
1254
|
+
if (typeof document !== "undefined")
|
|
1255
|
+
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 UTC;";
|
|
1177
1256
|
}
|
|
1178
1257
|
function setExpireDays(days) {
|
|
1179
1258
|
_expires = /* @__PURE__ */ new Date();
|
|
@@ -1223,7 +1302,8 @@ function erase(name) {
|
|
|
1223
1302
|
_erase(name);
|
|
1224
1303
|
}
|
|
1225
1304
|
function eraseAll() {
|
|
1226
|
-
|
|
1305
|
+
if (typeof document !== "undefined")
|
|
1306
|
+
document.cookie.split(";").forEach((c) => erase(c.trim().split("=")[0]));
|
|
1227
1307
|
}
|
|
1228
1308
|
var device_exports = {};
|
|
1229
1309
|
__export2(device_exports, {
|
|
@@ -1239,12 +1319,16 @@ __export2(device_exports, {
|
|
|
1239
1319
|
toPx: () => toPx
|
|
1240
1320
|
});
|
|
1241
1321
|
function getDPI() {
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1322
|
+
try {
|
|
1323
|
+
let el = document.createElement("div");
|
|
1324
|
+
el.style.width = "1in";
|
|
1325
|
+
document.body.appendChild(el);
|
|
1326
|
+
let dpi = el.offsetWidth;
|
|
1327
|
+
el.remove();
|
|
1328
|
+
return dpi || 96;
|
|
1329
|
+
} catch (e) {
|
|
1330
|
+
return 96;
|
|
1331
|
+
}
|
|
1248
1332
|
}
|
|
1249
1333
|
function getScrollBarWidth() {
|
|
1250
1334
|
try {
|
|
@@ -1267,18 +1351,23 @@ function getScrollBarWidth() {
|
|
|
1267
1351
|
}
|
|
1268
1352
|
}
|
|
1269
1353
|
function getSystemFontSize() {
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1354
|
+
try {
|
|
1355
|
+
let tmpDiv = document.createElement("div");
|
|
1356
|
+
tmpDiv.style.cssText = "display:inline-block; padding:0; line-height:1; position:absolute; visibility:hidden; font-size:1em";
|
|
1357
|
+
tmpDiv.appendChild(document.createTextNode("M"));
|
|
1358
|
+
document.body.appendChild(tmpDiv);
|
|
1359
|
+
let fontsize = tmpDiv.offsetHeight;
|
|
1360
|
+
document.body.removeChild(tmpDiv);
|
|
1361
|
+
return fontsize;
|
|
1362
|
+
} catch (e) {
|
|
1363
|
+
return 16;
|
|
1364
|
+
}
|
|
1277
1365
|
}
|
|
1278
1366
|
function getIsTouchDevice() {
|
|
1279
|
-
if (
|
|
1367
|
+
if (typeof window === "undefined")
|
|
1368
|
+
return false;
|
|
1369
|
+
if ("ontouchstart" in window || "DocumentTouch" in window || "createTouch" in document && "createTouchList" in document)
|
|
1280
1370
|
return true;
|
|
1281
|
-
}
|
|
1282
1371
|
var prefixes = " -webkit- -moz- -o- -ms- ".split(" ");
|
|
1283
1372
|
var mq = function(query2) {
|
|
1284
1373
|
return window.matchMedia(query2).matches;
|
|
@@ -1291,7 +1380,10 @@ function getIsMobileDevice() {
|
|
|
1291
1380
|
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));
|
|
1292
1381
|
}
|
|
1293
1382
|
function getHostAddress() {
|
|
1294
|
-
|
|
1383
|
+
if (typeof location === "undefined" || !location.host) {
|
|
1384
|
+
return "localhost";
|
|
1385
|
+
}
|
|
1386
|
+
return `${location.protocol}//${location.host}`;
|
|
1295
1387
|
}
|
|
1296
1388
|
var UnitRegExp = /^(mm|cm|in|inch|px|em)$/;
|
|
1297
1389
|
var ValueUnitRegExp = /^([0-9\\.]+)(.*)$/;
|
|
@@ -1437,6 +1529,7 @@ __export2(dom_exports, {
|
|
|
1437
1529
|
getPadding: () => getPadding,
|
|
1438
1530
|
getWidth: () => getWidth,
|
|
1439
1531
|
hasClass: () => hasClass,
|
|
1532
|
+
injectCss: () => injectCss,
|
|
1440
1533
|
removeClass: () => removeClass,
|
|
1441
1534
|
removeFromParent: () => removeFromParent,
|
|
1442
1535
|
setHeight: () => setHeight,
|
|
@@ -1446,6 +1539,10 @@ __export2(dom_exports, {
|
|
|
1446
1539
|
setWidth: () => setWidth,
|
|
1447
1540
|
styleLayoutChanged: () => styleLayoutChanged
|
|
1448
1541
|
});
|
|
1542
|
+
function _getElemById(id) {
|
|
1543
|
+
var _a;
|
|
1544
|
+
return typeof document === "undefined" ? void 0 : (_a = document.getElementById(id)) != null ? _a : void 0;
|
|
1545
|
+
}
|
|
1449
1546
|
function toPx2(value) {
|
|
1450
1547
|
return value === void 0 ? void 0 : device_exports.toPx(value);
|
|
1451
1548
|
}
|
|
@@ -1482,12 +1579,17 @@ function setOffset(el, left, top, unit = "px") {
|
|
|
1482
1579
|
el.style.top = top + unit;
|
|
1483
1580
|
}
|
|
1484
1581
|
function getOffset(el) {
|
|
1485
|
-
let
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
top
|
|
1489
|
-
|
|
1490
|
-
|
|
1582
|
+
let { left, top } = el.getBoundingClientRect();
|
|
1583
|
+
if (typeof window !== "undefined") {
|
|
1584
|
+
left += window.pageXOffset;
|
|
1585
|
+
top += window.pageYOffset;
|
|
1586
|
+
}
|
|
1587
|
+
if (typeof document !== "undefined") {
|
|
1588
|
+
let de = document.documentElement;
|
|
1589
|
+
left -= de.clientLeft;
|
|
1590
|
+
top -= de.clientTop;
|
|
1591
|
+
}
|
|
1592
|
+
return { left, top };
|
|
1491
1593
|
}
|
|
1492
1594
|
function getWidth(el) {
|
|
1493
1595
|
if (el instanceof Window) {
|
|
@@ -1527,11 +1629,11 @@ function setRect(el, left, top, width, height, unit = "px") {
|
|
|
1527
1629
|
el.style.height = height + unit;
|
|
1528
1630
|
}
|
|
1529
1631
|
function getButton(btn) {
|
|
1530
|
-
let el = typeof btn === "string" ?
|
|
1632
|
+
let el = typeof btn === "string" ? _getElemById(btn) : btn;
|
|
1531
1633
|
return el instanceof HTMLButtonElement ? el : void 0;
|
|
1532
1634
|
}
|
|
1533
1635
|
function getCanvas(canvas2) {
|
|
1534
|
-
let el = typeof canvas2 === "string" ?
|
|
1636
|
+
let el = typeof canvas2 === "string" ? _getElemById(canvas2) : canvas2;
|
|
1535
1637
|
return el instanceof HTMLCanvasElement ? el : void 0;
|
|
1536
1638
|
}
|
|
1537
1639
|
function getPadding(style) {
|
|
@@ -1605,14 +1707,23 @@ function styleLayoutChanged(style1, style2) {
|
|
|
1605
1707
|
}
|
|
1606
1708
|
var canvas;
|
|
1607
1709
|
function getCanvasTextWidth(text, font) {
|
|
1608
|
-
canvas
|
|
1609
|
-
|
|
1610
|
-
|
|
1710
|
+
if (!canvas && typeof document !== "undefined")
|
|
1711
|
+
canvas = document.createElement("canvas");
|
|
1712
|
+
let ctx = canvas == null ? void 0 : canvas.getContext("2d");
|
|
1713
|
+
if (!ctx)
|
|
1611
1714
|
return 0;
|
|
1612
|
-
}
|
|
1613
1715
|
ctx.font = font;
|
|
1614
1716
|
return ctx.measureText(text).width;
|
|
1615
1717
|
}
|
|
1718
|
+
function injectCss(styleId, styleCss) {
|
|
1719
|
+
if (styleId === "" || styleCss === "") return;
|
|
1720
|
+
if (typeof document === "undefined") return;
|
|
1721
|
+
if (document.getElementById(styleId)) return;
|
|
1722
|
+
const style = document.createElement("style");
|
|
1723
|
+
style.id = styleId;
|
|
1724
|
+
style.textContent = styleCss;
|
|
1725
|
+
document.head.appendChild(style);
|
|
1726
|
+
}
|
|
1616
1727
|
var math_exports = {};
|
|
1617
1728
|
__export2(math_exports, {
|
|
1618
1729
|
avg: () => avg,
|
|
@@ -4753,8 +4864,8 @@ var import_core10 = require("@tspro/web-music-score/core");
|
|
|
4753
4864
|
|
|
4754
4865
|
@tspro/ts-utils-lib/dist/index.mjs:
|
|
4755
4866
|
(*!
|
|
4756
|
-
* TsUtilsLib v2.
|
|
4757
|
-
* (c) 2023
|
|
4867
|
+
* TsUtilsLib v2.3.0 (esm)
|
|
4868
|
+
* (c) 2023-2025 PahkaSoft
|
|
4758
4869
|
* Licensed under the MIT License
|
|
4759
4870
|
*)
|
|
4760
4871
|
*/
|
package/dist/theory/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* WebMusicScore v5.5.
|
|
1
|
+
/* WebMusicScore v5.5.1 | (c) 2023-2025 PahkaSoft | 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-KKIFSIFK.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-AUOH7S2E.mjs";
|
|
20
20
|
import {
|
|
21
21
|
__publicField
|
|
22
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-7GVRGM3N.mjs";
|
|
23
23
|
|
|
24
24
|
// src/theory/types.ts
|
|
25
25
|
import { MusicError, MusicErrorType } from "@tspro/web-music-score/core";
|