@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/audio/index.js
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
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -104,6 +104,11 @@ __export2(assert_exports, {
|
|
|
104
104
|
isNumber: () => isNumber2,
|
|
105
105
|
isNumberBetween: () => isNumberBetween2,
|
|
106
106
|
isNumberBetweenExclusive: () => isNumberBetweenExclusive2,
|
|
107
|
+
isNumberEq: () => isNumberEq2,
|
|
108
|
+
isNumberGt: () => isNumberGt2,
|
|
109
|
+
isNumberGte: () => isNumberGte2,
|
|
110
|
+
isNumberLt: () => isNumberLt2,
|
|
111
|
+
isNumberLte: () => isNumberLte2,
|
|
107
112
|
isNumberOrUndefined: () => isNumberOrUndefined2,
|
|
108
113
|
isNumericString: () => isNumericString2,
|
|
109
114
|
isObject: () => isObject2,
|
|
@@ -115,6 +120,7 @@ __export2(assert_exports, {
|
|
|
115
120
|
isPosZero: () => isPosZero2,
|
|
116
121
|
isPowerOfTwo: () => isPowerOfTwo2,
|
|
117
122
|
isSafeInteger: () => isSafeInteger2,
|
|
123
|
+
isSafeNumber: () => isSafeNumber2,
|
|
118
124
|
isStrictEqual: () => isStrictEqual2,
|
|
119
125
|
isString: () => isString2,
|
|
120
126
|
isStringOrUndefined: () => isStringOrUndefined2,
|
|
@@ -138,6 +144,9 @@ __export2(str_exports, {
|
|
|
138
144
|
removeAt: () => removeAt,
|
|
139
145
|
repeatString: () => repeatString,
|
|
140
146
|
replaceAt: () => replaceAt,
|
|
147
|
+
splitByCaps: () => splitByCaps,
|
|
148
|
+
splitByChars: () => splitByChars,
|
|
149
|
+
splitByStrings: () => splitByStrings,
|
|
141
150
|
stringify: () => stringify,
|
|
142
151
|
toCharArray: () => toCharArray
|
|
143
152
|
});
|
|
@@ -202,6 +211,11 @@ __export2(guard_exports, {
|
|
|
202
211
|
isNumber: () => isNumber,
|
|
203
212
|
isNumberBetween: () => isNumberBetween,
|
|
204
213
|
isNumberBetweenExclusive: () => isNumberBetweenExclusive,
|
|
214
|
+
isNumberEq: () => isNumberEq,
|
|
215
|
+
isNumberGt: () => isNumberGt,
|
|
216
|
+
isNumberGte: () => isNumberGte,
|
|
217
|
+
isNumberLt: () => isNumberLt,
|
|
218
|
+
isNumberLte: () => isNumberLte,
|
|
205
219
|
isNumberOrUndefined: () => isNumberOrUndefined,
|
|
206
220
|
isNumericString: () => isNumericString,
|
|
207
221
|
isObject: () => isObject,
|
|
@@ -213,6 +227,7 @@ __export2(guard_exports, {
|
|
|
213
227
|
isPosZero: () => isPosZero,
|
|
214
228
|
isPowerOfTwo: () => isPowerOfTwo,
|
|
215
229
|
isSafeInteger: () => isSafeInteger,
|
|
230
|
+
isSafeNumber: () => isSafeNumber,
|
|
216
231
|
isStrictEqual: () => isStrictEqual,
|
|
217
232
|
isString: () => isString,
|
|
218
233
|
isStringOrUndefined: () => isStringOrUndefined,
|
|
@@ -364,9 +379,33 @@ function isBigInt(val) {
|
|
|
364
379
|
function isNumber(val) {
|
|
365
380
|
return typeof val === "number";
|
|
366
381
|
}
|
|
382
|
+
function isSafeNumber(val) {
|
|
383
|
+
return isNumber(val) && Number.isSafeInteger(val);
|
|
384
|
+
}
|
|
367
385
|
function isNumberOrUndefined(val) {
|
|
368
386
|
return typeof val === "number" || val === void 0;
|
|
369
387
|
}
|
|
388
|
+
function isNumberEq(val, ref) {
|
|
389
|
+
return isNumber(val) && val === ref;
|
|
390
|
+
}
|
|
391
|
+
function isNumberGt(val, ref) {
|
|
392
|
+
return isNumber(val) && isNumber(ref) && val > ref;
|
|
393
|
+
}
|
|
394
|
+
function isNumberGte(val, ref) {
|
|
395
|
+
return isNumber(val) && isNumber(ref) && val >= ref;
|
|
396
|
+
}
|
|
397
|
+
function isNumberLt(val, ref) {
|
|
398
|
+
return isNumber(val) && isNumber(ref) && val < ref;
|
|
399
|
+
}
|
|
400
|
+
function isNumberLte(val, ref) {
|
|
401
|
+
return isNumber(val) && isNumber(ref) && val <= ref;
|
|
402
|
+
}
|
|
403
|
+
function isNumberBetween(val, min, max) {
|
|
404
|
+
return isNumber(val) && isNumber(min) && isNumber(max) && val >= min && val <= max;
|
|
405
|
+
}
|
|
406
|
+
function isNumberBetweenExclusive(val, min, max) {
|
|
407
|
+
return isNumber(val) && isNumber(min) && isNumber(max) && val > min && val < max;
|
|
408
|
+
}
|
|
370
409
|
function isFinite2(val) {
|
|
371
410
|
return typeof val === "number" && Number.isFinite(val);
|
|
372
411
|
}
|
|
@@ -403,12 +442,6 @@ function isIntegerBetween(val, min, max) {
|
|
|
403
442
|
function isIntegerBetweenExclusive(val, min, max) {
|
|
404
443
|
return isInteger(val) && isNumber(min) && isNumber(max) && val > min && val < max;
|
|
405
444
|
}
|
|
406
|
-
function isNumberBetween(val, min, max) {
|
|
407
|
-
return isNumber(val) && isNumber(min) && isNumber(max) && val >= min && val <= max;
|
|
408
|
-
}
|
|
409
|
-
function isNumberBetweenExclusive(val, min, max) {
|
|
410
|
-
return isNumber(val) && isNumber(min) && isNumber(max) && val > min && val < max;
|
|
411
|
-
}
|
|
412
445
|
function isNaNValue(val) {
|
|
413
446
|
return typeof val === "number" && Number.isNaN(val);
|
|
414
447
|
}
|
|
@@ -674,6 +707,18 @@ function stringify(value, maxDepth = 5, seen = /* @__PURE__ */ new WeakSet()) {
|
|
|
674
707
|
}
|
|
675
708
|
return String(value);
|
|
676
709
|
}
|
|
710
|
+
function splitByCaps(str2) {
|
|
711
|
+
return str2.split(/(?=[A-Z])/).filter((x) => !!x);
|
|
712
|
+
}
|
|
713
|
+
function splitByStrings(str2, ...splitters) {
|
|
714
|
+
if (splitters.length === 0) return [str2];
|
|
715
|
+
const escaped = splitters.map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
716
|
+
const regex = new RegExp(escaped.join("|"), "g");
|
|
717
|
+
return str2.split(regex);
|
|
718
|
+
}
|
|
719
|
+
function splitByChars(str2, splitters) {
|
|
720
|
+
return splitByStrings(str2, ...splitters.split(""));
|
|
721
|
+
}
|
|
677
722
|
var fmt = stringify;
|
|
678
723
|
var errorConstructor = Error;
|
|
679
724
|
function setErrorClass(errorClass) {
|
|
@@ -891,11 +936,51 @@ function isNumber2(val, msg) {
|
|
|
891
936
|
_fail(`Expected ${fmt(val)} to be number`, msg);
|
|
892
937
|
return val;
|
|
893
938
|
}
|
|
939
|
+
function isSafeNumber2(val, msg) {
|
|
940
|
+
if (!guard_exports.isSafeNumber(val))
|
|
941
|
+
_fail(`Expected ${fmt(val)} to be safe number`, msg);
|
|
942
|
+
return val;
|
|
943
|
+
}
|
|
894
944
|
function isNumberOrUndefined2(val, msg) {
|
|
895
945
|
if (!guard_exports.isNumberOrUndefined(val))
|
|
896
946
|
_fail(`Expected ${fmt(val)} to be number or undefined`, msg);
|
|
897
947
|
return val;
|
|
898
948
|
}
|
|
949
|
+
function isNumberEq2(val, ref, msg) {
|
|
950
|
+
if (!guard_exports.isNumberEq(val, ref))
|
|
951
|
+
_fail(`Expected ${fmt(val)} to be number equal to ${fmt(ref)}`, msg);
|
|
952
|
+
return val;
|
|
953
|
+
}
|
|
954
|
+
function isNumberGt2(val, ref, msg) {
|
|
955
|
+
if (!guard_exports.isNumberGt(val, ref))
|
|
956
|
+
_fail(`Expected ${fmt(val)} to be number > ${fmt(ref)}`, msg);
|
|
957
|
+
return val;
|
|
958
|
+
}
|
|
959
|
+
function isNumberGte2(val, ref, msg) {
|
|
960
|
+
if (!guard_exports.isNumberGte(val, ref))
|
|
961
|
+
_fail(`Expected ${fmt(val)} to be number >= ${fmt(ref)}`, msg);
|
|
962
|
+
return val;
|
|
963
|
+
}
|
|
964
|
+
function isNumberLt2(val, ref, msg) {
|
|
965
|
+
if (!guard_exports.isNumberLt(val, ref))
|
|
966
|
+
_fail(`Expected ${fmt(val)} to be number < ${fmt(ref)}`, msg);
|
|
967
|
+
return val;
|
|
968
|
+
}
|
|
969
|
+
function isNumberLte2(val, ref, msg) {
|
|
970
|
+
if (!guard_exports.isNumberLte(val, ref))
|
|
971
|
+
_fail(`Expected ${fmt(val)} to be number <= ${fmt(ref)}`, msg);
|
|
972
|
+
return val;
|
|
973
|
+
}
|
|
974
|
+
function isNumberBetween2(val, min, max, msg) {
|
|
975
|
+
if (!guard_exports.isNumberBetween(val, min, max))
|
|
976
|
+
_fail(`Expected number ${fmt(min)} <= ${fmt(val)} <= ${fmt(max)}`, msg);
|
|
977
|
+
return val;
|
|
978
|
+
}
|
|
979
|
+
function isNumberBetweenExclusive2(val, min, max, msg) {
|
|
980
|
+
if (!guard_exports.isNumberBetweenExclusive(val, min, max))
|
|
981
|
+
_fail(`Expected number ${fmt(min)} < ${fmt(val)} < ${fmt(max)}`, msg);
|
|
982
|
+
return val;
|
|
983
|
+
}
|
|
899
984
|
function isFinite3(val, msg) {
|
|
900
985
|
if (!guard_exports.isFinite(val))
|
|
901
986
|
_fail(`Expected ${fmt(val)} to be finite`, msg);
|
|
@@ -956,16 +1041,6 @@ function isIntegerBetweenExclusive2(val, min, max, msg) {
|
|
|
956
1041
|
_fail(`Expected integer ${fmt(min)} < ${fmt(val)} < ${fmt(max)}`, msg);
|
|
957
1042
|
return val;
|
|
958
1043
|
}
|
|
959
|
-
function isNumberBetween2(val, min, max, msg) {
|
|
960
|
-
if (!guard_exports.isNumberBetween(val, min, max))
|
|
961
|
-
_fail(`Expected number ${fmt(min)} <= ${fmt(val)} <= ${fmt(max)}`, msg);
|
|
962
|
-
return val;
|
|
963
|
-
}
|
|
964
|
-
function isNumberBetweenExclusive2(val, min, max, msg) {
|
|
965
|
-
if (!guard_exports.isNumberBetweenExclusive(val, min, max))
|
|
966
|
-
_fail(`Expected number ${fmt(min)} < ${fmt(val)} < ${fmt(max)}`, msg);
|
|
967
|
-
return val;
|
|
968
|
-
}
|
|
969
1044
|
function isNaNValue2(val, msg) {
|
|
970
1045
|
if (!guard_exports.isNaNValue(val))
|
|
971
1046
|
_fail(`Expected ${fmt(val)} to be NaN`, msg);
|
|
@@ -1086,7 +1161,9 @@ var _consent;
|
|
|
1086
1161
|
var _expires;
|
|
1087
1162
|
var str = _read(ConsentCookieName);
|
|
1088
1163
|
_consent = str === "accept" || str === "decline" ? str : void 0;
|
|
1089
|
-
function
|
|
1164
|
+
function _getCookieList() {
|
|
1165
|
+
if (typeof document === "undefined")
|
|
1166
|
+
return [];
|
|
1090
1167
|
let s = document.cookie;
|
|
1091
1168
|
return s.split(";").map((c) => c.trim());
|
|
1092
1169
|
}
|
|
@@ -1095,15 +1172,17 @@ function _save(name, value) {
|
|
|
1095
1172
|
if (_expires) {
|
|
1096
1173
|
cookie += "expires=" + _expires.toUTCString() + ";";
|
|
1097
1174
|
}
|
|
1098
|
-
document
|
|
1175
|
+
if (typeof document !== "undefined")
|
|
1176
|
+
document.cookie = cookie;
|
|
1099
1177
|
return value;
|
|
1100
1178
|
}
|
|
1101
1179
|
function _read(name, defaultValue) {
|
|
1102
|
-
let str2 =
|
|
1180
|
+
let str2 = _getCookieList().find((c) => c.startsWith(name + "="));
|
|
1103
1181
|
return str2 === void 0 ? defaultValue : str2.substring(name.length + 1);
|
|
1104
1182
|
}
|
|
1105
1183
|
function _erase(name) {
|
|
1106
|
-
|
|
1184
|
+
if (typeof document !== "undefined")
|
|
1185
|
+
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 UTC;";
|
|
1107
1186
|
}
|
|
1108
1187
|
function setExpireDays(days) {
|
|
1109
1188
|
_expires = /* @__PURE__ */ new Date();
|
|
@@ -1153,7 +1232,8 @@ function erase(name) {
|
|
|
1153
1232
|
_erase(name);
|
|
1154
1233
|
}
|
|
1155
1234
|
function eraseAll() {
|
|
1156
|
-
|
|
1235
|
+
if (typeof document !== "undefined")
|
|
1236
|
+
document.cookie.split(";").forEach((c) => erase(c.trim().split("=")[0]));
|
|
1157
1237
|
}
|
|
1158
1238
|
var device_exports = {};
|
|
1159
1239
|
__export2(device_exports, {
|
|
@@ -1169,12 +1249,16 @@ __export2(device_exports, {
|
|
|
1169
1249
|
toPx: () => toPx
|
|
1170
1250
|
});
|
|
1171
1251
|
function getDPI() {
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1252
|
+
try {
|
|
1253
|
+
let el = document.createElement("div");
|
|
1254
|
+
el.style.width = "1in";
|
|
1255
|
+
document.body.appendChild(el);
|
|
1256
|
+
let dpi = el.offsetWidth;
|
|
1257
|
+
el.remove();
|
|
1258
|
+
return dpi || 96;
|
|
1259
|
+
} catch (e) {
|
|
1260
|
+
return 96;
|
|
1261
|
+
}
|
|
1178
1262
|
}
|
|
1179
1263
|
function getScrollBarWidth() {
|
|
1180
1264
|
try {
|
|
@@ -1197,18 +1281,23 @@ function getScrollBarWidth() {
|
|
|
1197
1281
|
}
|
|
1198
1282
|
}
|
|
1199
1283
|
function getSystemFontSize() {
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1284
|
+
try {
|
|
1285
|
+
let tmpDiv = document.createElement("div");
|
|
1286
|
+
tmpDiv.style.cssText = "display:inline-block; padding:0; line-height:1; position:absolute; visibility:hidden; font-size:1em";
|
|
1287
|
+
tmpDiv.appendChild(document.createTextNode("M"));
|
|
1288
|
+
document.body.appendChild(tmpDiv);
|
|
1289
|
+
let fontsize = tmpDiv.offsetHeight;
|
|
1290
|
+
document.body.removeChild(tmpDiv);
|
|
1291
|
+
return fontsize;
|
|
1292
|
+
} catch (e) {
|
|
1293
|
+
return 16;
|
|
1294
|
+
}
|
|
1207
1295
|
}
|
|
1208
1296
|
function getIsTouchDevice() {
|
|
1209
|
-
if (
|
|
1297
|
+
if (typeof window === "undefined")
|
|
1298
|
+
return false;
|
|
1299
|
+
if ("ontouchstart" in window || "DocumentTouch" in window || "createTouch" in document && "createTouchList" in document)
|
|
1210
1300
|
return true;
|
|
1211
|
-
}
|
|
1212
1301
|
var prefixes = " -webkit- -moz- -o- -ms- ".split(" ");
|
|
1213
1302
|
var mq = function(query2) {
|
|
1214
1303
|
return window.matchMedia(query2).matches;
|
|
@@ -1221,7 +1310,10 @@ function getIsMobileDevice() {
|
|
|
1221
1310
|
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));
|
|
1222
1311
|
}
|
|
1223
1312
|
function getHostAddress() {
|
|
1224
|
-
|
|
1313
|
+
if (typeof location === "undefined" || !location.host) {
|
|
1314
|
+
return "localhost";
|
|
1315
|
+
}
|
|
1316
|
+
return `${location.protocol}//${location.host}`;
|
|
1225
1317
|
}
|
|
1226
1318
|
var UnitRegExp = /^(mm|cm|in|inch|px|em)$/;
|
|
1227
1319
|
var ValueUnitRegExp = /^([0-9\\.]+)(.*)$/;
|
|
@@ -1367,6 +1459,7 @@ __export2(dom_exports, {
|
|
|
1367
1459
|
getPadding: () => getPadding,
|
|
1368
1460
|
getWidth: () => getWidth,
|
|
1369
1461
|
hasClass: () => hasClass,
|
|
1462
|
+
injectCss: () => injectCss,
|
|
1370
1463
|
removeClass: () => removeClass,
|
|
1371
1464
|
removeFromParent: () => removeFromParent,
|
|
1372
1465
|
setHeight: () => setHeight,
|
|
@@ -1376,6 +1469,10 @@ __export2(dom_exports, {
|
|
|
1376
1469
|
setWidth: () => setWidth,
|
|
1377
1470
|
styleLayoutChanged: () => styleLayoutChanged
|
|
1378
1471
|
});
|
|
1472
|
+
function _getElemById(id) {
|
|
1473
|
+
var _a;
|
|
1474
|
+
return typeof document === "undefined" ? void 0 : (_a = document.getElementById(id)) != null ? _a : void 0;
|
|
1475
|
+
}
|
|
1379
1476
|
function toPx2(value) {
|
|
1380
1477
|
return value === void 0 ? void 0 : device_exports.toPx(value);
|
|
1381
1478
|
}
|
|
@@ -1412,12 +1509,17 @@ function setOffset(el, left, top, unit = "px") {
|
|
|
1412
1509
|
el.style.top = top + unit;
|
|
1413
1510
|
}
|
|
1414
1511
|
function getOffset(el) {
|
|
1415
|
-
let
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
top
|
|
1419
|
-
|
|
1420
|
-
|
|
1512
|
+
let { left, top } = el.getBoundingClientRect();
|
|
1513
|
+
if (typeof window !== "undefined") {
|
|
1514
|
+
left += window.pageXOffset;
|
|
1515
|
+
top += window.pageYOffset;
|
|
1516
|
+
}
|
|
1517
|
+
if (typeof document !== "undefined") {
|
|
1518
|
+
let de = document.documentElement;
|
|
1519
|
+
left -= de.clientLeft;
|
|
1520
|
+
top -= de.clientTop;
|
|
1521
|
+
}
|
|
1522
|
+
return { left, top };
|
|
1421
1523
|
}
|
|
1422
1524
|
function getWidth(el) {
|
|
1423
1525
|
if (el instanceof Window) {
|
|
@@ -1457,11 +1559,11 @@ function setRect(el, left, top, width, height, unit = "px") {
|
|
|
1457
1559
|
el.style.height = height + unit;
|
|
1458
1560
|
}
|
|
1459
1561
|
function getButton(btn) {
|
|
1460
|
-
let el = typeof btn === "string" ?
|
|
1562
|
+
let el = typeof btn === "string" ? _getElemById(btn) : btn;
|
|
1461
1563
|
return el instanceof HTMLButtonElement ? el : void 0;
|
|
1462
1564
|
}
|
|
1463
1565
|
function getCanvas(canvas2) {
|
|
1464
|
-
let el = typeof canvas2 === "string" ?
|
|
1566
|
+
let el = typeof canvas2 === "string" ? _getElemById(canvas2) : canvas2;
|
|
1465
1567
|
return el instanceof HTMLCanvasElement ? el : void 0;
|
|
1466
1568
|
}
|
|
1467
1569
|
function getPadding(style) {
|
|
@@ -1535,14 +1637,23 @@ function styleLayoutChanged(style1, style2) {
|
|
|
1535
1637
|
}
|
|
1536
1638
|
var canvas;
|
|
1537
1639
|
function getCanvasTextWidth(text, font) {
|
|
1538
|
-
canvas
|
|
1539
|
-
|
|
1540
|
-
|
|
1640
|
+
if (!canvas && typeof document !== "undefined")
|
|
1641
|
+
canvas = document.createElement("canvas");
|
|
1642
|
+
let ctx = canvas == null ? void 0 : canvas.getContext("2d");
|
|
1643
|
+
if (!ctx)
|
|
1541
1644
|
return 0;
|
|
1542
|
-
}
|
|
1543
1645
|
ctx.font = font;
|
|
1544
1646
|
return ctx.measureText(text).width;
|
|
1545
1647
|
}
|
|
1648
|
+
function injectCss(styleId, styleCss) {
|
|
1649
|
+
if (styleId === "" || styleCss === "") return;
|
|
1650
|
+
if (typeof document === "undefined") return;
|
|
1651
|
+
if (document.getElementById(styleId)) return;
|
|
1652
|
+
const style = document.createElement("style");
|
|
1653
|
+
style.id = styleId;
|
|
1654
|
+
style.textContent = styleCss;
|
|
1655
|
+
document.head.appendChild(style);
|
|
1656
|
+
}
|
|
1546
1657
|
var math_exports = {};
|
|
1547
1658
|
__export2(math_exports, {
|
|
1548
1659
|
avg: () => avg,
|
|
@@ -1749,8 +1860,8 @@ function isMuted() {
|
|
|
1749
1860
|
|
|
1750
1861
|
@tspro/ts-utils-lib/dist/index.mjs:
|
|
1751
1862
|
(*!
|
|
1752
|
-
* TsUtilsLib v2.
|
|
1753
|
-
* (c) 2023
|
|
1863
|
+
* TsUtilsLib v2.3.0 (esm)
|
|
1864
|
+
* (c) 2023-2025 PahkaSoft
|
|
1754
1865
|
* Licensed under the MIT License
|
|
1755
1866
|
*)
|
|
1756
1867
|
*/
|
package/dist/audio/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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
|
linearToDecibels
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-FLBNOYUN.mjs";
|
|
5
5
|
import {
|
|
6
6
|
guard_exports,
|
|
7
7
|
utils_exports
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-AUOH7S2E.mjs";
|
|
9
|
+
import "../chunk-7GVRGM3N.mjs";
|
|
10
10
|
|
|
11
11
|
// src/audio/index.ts
|
|
12
12
|
import { Note, PitchNotation, SymbolSet } from "@tspro/web-music-score/theory";
|
package/dist/audio-cg/index.js
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
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __defProps = Object.defineProperties;
|