@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/pieces/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;
|
package/dist/pieces/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* WebMusicScore v5.5.
|
|
2
|
-
import "../chunk-
|
|
1
|
+
/* WebMusicScore v5.5.1 | (c) 2023-2025 PahkaSoft | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
|
|
2
|
+
import "../chunk-7GVRGM3N.mjs";
|
|
3
3
|
|
|
4
4
|
// src/pieces/andante-diabelli.ts
|
|
5
5
|
import { DocumentBuilder } from "@tspro/web-music-score/score";
|
package/dist/react-ui/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 __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -112,6 +112,11 @@ __export2(assert_exports, {
|
|
|
112
112
|
isNumber: () => isNumber2,
|
|
113
113
|
isNumberBetween: () => isNumberBetween2,
|
|
114
114
|
isNumberBetweenExclusive: () => isNumberBetweenExclusive2,
|
|
115
|
+
isNumberEq: () => isNumberEq2,
|
|
116
|
+
isNumberGt: () => isNumberGt2,
|
|
117
|
+
isNumberGte: () => isNumberGte2,
|
|
118
|
+
isNumberLt: () => isNumberLt2,
|
|
119
|
+
isNumberLte: () => isNumberLte2,
|
|
115
120
|
isNumberOrUndefined: () => isNumberOrUndefined2,
|
|
116
121
|
isNumericString: () => isNumericString2,
|
|
117
122
|
isObject: () => isObject2,
|
|
@@ -123,6 +128,7 @@ __export2(assert_exports, {
|
|
|
123
128
|
isPosZero: () => isPosZero2,
|
|
124
129
|
isPowerOfTwo: () => isPowerOfTwo2,
|
|
125
130
|
isSafeInteger: () => isSafeInteger2,
|
|
131
|
+
isSafeNumber: () => isSafeNumber2,
|
|
126
132
|
isStrictEqual: () => isStrictEqual2,
|
|
127
133
|
isString: () => isString2,
|
|
128
134
|
isStringOrUndefined: () => isStringOrUndefined2,
|
|
@@ -146,6 +152,9 @@ __export2(str_exports, {
|
|
|
146
152
|
removeAt: () => removeAt,
|
|
147
153
|
repeatString: () => repeatString,
|
|
148
154
|
replaceAt: () => replaceAt,
|
|
155
|
+
splitByCaps: () => splitByCaps,
|
|
156
|
+
splitByChars: () => splitByChars,
|
|
157
|
+
splitByStrings: () => splitByStrings,
|
|
149
158
|
stringify: () => stringify,
|
|
150
159
|
toCharArray: () => toCharArray
|
|
151
160
|
});
|
|
@@ -210,6 +219,11 @@ __export2(guard_exports, {
|
|
|
210
219
|
isNumber: () => isNumber,
|
|
211
220
|
isNumberBetween: () => isNumberBetween,
|
|
212
221
|
isNumberBetweenExclusive: () => isNumberBetweenExclusive,
|
|
222
|
+
isNumberEq: () => isNumberEq,
|
|
223
|
+
isNumberGt: () => isNumberGt,
|
|
224
|
+
isNumberGte: () => isNumberGte,
|
|
225
|
+
isNumberLt: () => isNumberLt,
|
|
226
|
+
isNumberLte: () => isNumberLte,
|
|
213
227
|
isNumberOrUndefined: () => isNumberOrUndefined,
|
|
214
228
|
isNumericString: () => isNumericString,
|
|
215
229
|
isObject: () => isObject,
|
|
@@ -221,6 +235,7 @@ __export2(guard_exports, {
|
|
|
221
235
|
isPosZero: () => isPosZero,
|
|
222
236
|
isPowerOfTwo: () => isPowerOfTwo,
|
|
223
237
|
isSafeInteger: () => isSafeInteger,
|
|
238
|
+
isSafeNumber: () => isSafeNumber,
|
|
224
239
|
isStrictEqual: () => isStrictEqual,
|
|
225
240
|
isString: () => isString,
|
|
226
241
|
isStringOrUndefined: () => isStringOrUndefined,
|
|
@@ -372,9 +387,33 @@ function isBigInt(val) {
|
|
|
372
387
|
function isNumber(val) {
|
|
373
388
|
return typeof val === "number";
|
|
374
389
|
}
|
|
390
|
+
function isSafeNumber(val) {
|
|
391
|
+
return isNumber(val) && Number.isSafeInteger(val);
|
|
392
|
+
}
|
|
375
393
|
function isNumberOrUndefined(val) {
|
|
376
394
|
return typeof val === "number" || val === void 0;
|
|
377
395
|
}
|
|
396
|
+
function isNumberEq(val, ref) {
|
|
397
|
+
return isNumber(val) && val === ref;
|
|
398
|
+
}
|
|
399
|
+
function isNumberGt(val, ref) {
|
|
400
|
+
return isNumber(val) && isNumber(ref) && val > ref;
|
|
401
|
+
}
|
|
402
|
+
function isNumberGte(val, ref) {
|
|
403
|
+
return isNumber(val) && isNumber(ref) && val >= ref;
|
|
404
|
+
}
|
|
405
|
+
function isNumberLt(val, ref) {
|
|
406
|
+
return isNumber(val) && isNumber(ref) && val < ref;
|
|
407
|
+
}
|
|
408
|
+
function isNumberLte(val, ref) {
|
|
409
|
+
return isNumber(val) && isNumber(ref) && val <= ref;
|
|
410
|
+
}
|
|
411
|
+
function isNumberBetween(val, min, max) {
|
|
412
|
+
return isNumber(val) && isNumber(min) && isNumber(max) && val >= min && val <= max;
|
|
413
|
+
}
|
|
414
|
+
function isNumberBetweenExclusive(val, min, max) {
|
|
415
|
+
return isNumber(val) && isNumber(min) && isNumber(max) && val > min && val < max;
|
|
416
|
+
}
|
|
378
417
|
function isFinite2(val) {
|
|
379
418
|
return typeof val === "number" && Number.isFinite(val);
|
|
380
419
|
}
|
|
@@ -411,12 +450,6 @@ function isIntegerBetween(val, min, max) {
|
|
|
411
450
|
function isIntegerBetweenExclusive(val, min, max) {
|
|
412
451
|
return isInteger(val) && isNumber(min) && isNumber(max) && val > min && val < max;
|
|
413
452
|
}
|
|
414
|
-
function isNumberBetween(val, min, max) {
|
|
415
|
-
return isNumber(val) && isNumber(min) && isNumber(max) && val >= min && val <= max;
|
|
416
|
-
}
|
|
417
|
-
function isNumberBetweenExclusive(val, min, max) {
|
|
418
|
-
return isNumber(val) && isNumber(min) && isNumber(max) && val > min && val < max;
|
|
419
|
-
}
|
|
420
453
|
function isNaNValue(val) {
|
|
421
454
|
return typeof val === "number" && Number.isNaN(val);
|
|
422
455
|
}
|
|
@@ -682,6 +715,18 @@ function stringify(value, maxDepth = 5, seen = /* @__PURE__ */ new WeakSet()) {
|
|
|
682
715
|
}
|
|
683
716
|
return String(value);
|
|
684
717
|
}
|
|
718
|
+
function splitByCaps(str2) {
|
|
719
|
+
return str2.split(/(?=[A-Z])/).filter((x) => !!x);
|
|
720
|
+
}
|
|
721
|
+
function splitByStrings(str2, ...splitters) {
|
|
722
|
+
if (splitters.length === 0) return [str2];
|
|
723
|
+
const escaped = splitters.map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
724
|
+
const regex = new RegExp(escaped.join("|"), "g");
|
|
725
|
+
return str2.split(regex);
|
|
726
|
+
}
|
|
727
|
+
function splitByChars(str2, splitters) {
|
|
728
|
+
return splitByStrings(str2, ...splitters.split(""));
|
|
729
|
+
}
|
|
685
730
|
var fmt = stringify;
|
|
686
731
|
var errorConstructor = Error;
|
|
687
732
|
function setErrorClass(errorClass) {
|
|
@@ -899,11 +944,51 @@ function isNumber2(val, msg) {
|
|
|
899
944
|
_fail(`Expected ${fmt(val)} to be number`, msg);
|
|
900
945
|
return val;
|
|
901
946
|
}
|
|
947
|
+
function isSafeNumber2(val, msg) {
|
|
948
|
+
if (!guard_exports.isSafeNumber(val))
|
|
949
|
+
_fail(`Expected ${fmt(val)} to be safe number`, msg);
|
|
950
|
+
return val;
|
|
951
|
+
}
|
|
902
952
|
function isNumberOrUndefined2(val, msg) {
|
|
903
953
|
if (!guard_exports.isNumberOrUndefined(val))
|
|
904
954
|
_fail(`Expected ${fmt(val)} to be number or undefined`, msg);
|
|
905
955
|
return val;
|
|
906
956
|
}
|
|
957
|
+
function isNumberEq2(val, ref, msg) {
|
|
958
|
+
if (!guard_exports.isNumberEq(val, ref))
|
|
959
|
+
_fail(`Expected ${fmt(val)} to be number equal to ${fmt(ref)}`, msg);
|
|
960
|
+
return val;
|
|
961
|
+
}
|
|
962
|
+
function isNumberGt2(val, ref, msg) {
|
|
963
|
+
if (!guard_exports.isNumberGt(val, ref))
|
|
964
|
+
_fail(`Expected ${fmt(val)} to be number > ${fmt(ref)}`, msg);
|
|
965
|
+
return val;
|
|
966
|
+
}
|
|
967
|
+
function isNumberGte2(val, ref, msg) {
|
|
968
|
+
if (!guard_exports.isNumberGte(val, ref))
|
|
969
|
+
_fail(`Expected ${fmt(val)} to be number >= ${fmt(ref)}`, msg);
|
|
970
|
+
return val;
|
|
971
|
+
}
|
|
972
|
+
function isNumberLt2(val, ref, msg) {
|
|
973
|
+
if (!guard_exports.isNumberLt(val, ref))
|
|
974
|
+
_fail(`Expected ${fmt(val)} to be number < ${fmt(ref)}`, msg);
|
|
975
|
+
return val;
|
|
976
|
+
}
|
|
977
|
+
function isNumberLte2(val, ref, msg) {
|
|
978
|
+
if (!guard_exports.isNumberLte(val, ref))
|
|
979
|
+
_fail(`Expected ${fmt(val)} to be number <= ${fmt(ref)}`, msg);
|
|
980
|
+
return val;
|
|
981
|
+
}
|
|
982
|
+
function isNumberBetween2(val, min, max, msg) {
|
|
983
|
+
if (!guard_exports.isNumberBetween(val, min, max))
|
|
984
|
+
_fail(`Expected number ${fmt(min)} <= ${fmt(val)} <= ${fmt(max)}`, msg);
|
|
985
|
+
return val;
|
|
986
|
+
}
|
|
987
|
+
function isNumberBetweenExclusive2(val, min, max, msg) {
|
|
988
|
+
if (!guard_exports.isNumberBetweenExclusive(val, min, max))
|
|
989
|
+
_fail(`Expected number ${fmt(min)} < ${fmt(val)} < ${fmt(max)}`, msg);
|
|
990
|
+
return val;
|
|
991
|
+
}
|
|
907
992
|
function isFinite3(val, msg) {
|
|
908
993
|
if (!guard_exports.isFinite(val))
|
|
909
994
|
_fail(`Expected ${fmt(val)} to be finite`, msg);
|
|
@@ -964,16 +1049,6 @@ function isIntegerBetweenExclusive2(val, min, max, msg) {
|
|
|
964
1049
|
_fail(`Expected integer ${fmt(min)} < ${fmt(val)} < ${fmt(max)}`, msg);
|
|
965
1050
|
return val;
|
|
966
1051
|
}
|
|
967
|
-
function isNumberBetween2(val, min, max, msg) {
|
|
968
|
-
if (!guard_exports.isNumberBetween(val, min, max))
|
|
969
|
-
_fail(`Expected number ${fmt(min)} <= ${fmt(val)} <= ${fmt(max)}`, msg);
|
|
970
|
-
return val;
|
|
971
|
-
}
|
|
972
|
-
function isNumberBetweenExclusive2(val, min, max, msg) {
|
|
973
|
-
if (!guard_exports.isNumberBetweenExclusive(val, min, max))
|
|
974
|
-
_fail(`Expected number ${fmt(min)} < ${fmt(val)} < ${fmt(max)}`, msg);
|
|
975
|
-
return val;
|
|
976
|
-
}
|
|
977
1052
|
function isNaNValue2(val, msg) {
|
|
978
1053
|
if (!guard_exports.isNaNValue(val))
|
|
979
1054
|
_fail(`Expected ${fmt(val)} to be NaN`, msg);
|
|
@@ -1094,7 +1169,9 @@ var _consent;
|
|
|
1094
1169
|
var _expires;
|
|
1095
1170
|
var str = _read(ConsentCookieName);
|
|
1096
1171
|
_consent = str === "accept" || str === "decline" ? str : void 0;
|
|
1097
|
-
function
|
|
1172
|
+
function _getCookieList() {
|
|
1173
|
+
if (typeof document === "undefined")
|
|
1174
|
+
return [];
|
|
1098
1175
|
let s = document.cookie;
|
|
1099
1176
|
return s.split(";").map((c) => c.trim());
|
|
1100
1177
|
}
|
|
@@ -1103,15 +1180,17 @@ function _save(name, value) {
|
|
|
1103
1180
|
if (_expires) {
|
|
1104
1181
|
cookie += "expires=" + _expires.toUTCString() + ";";
|
|
1105
1182
|
}
|
|
1106
|
-
document
|
|
1183
|
+
if (typeof document !== "undefined")
|
|
1184
|
+
document.cookie = cookie;
|
|
1107
1185
|
return value;
|
|
1108
1186
|
}
|
|
1109
1187
|
function _read(name, defaultValue) {
|
|
1110
|
-
let str2 =
|
|
1188
|
+
let str2 = _getCookieList().find((c) => c.startsWith(name + "="));
|
|
1111
1189
|
return str2 === void 0 ? defaultValue : str2.substring(name.length + 1);
|
|
1112
1190
|
}
|
|
1113
1191
|
function _erase(name) {
|
|
1114
|
-
|
|
1192
|
+
if (typeof document !== "undefined")
|
|
1193
|
+
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 UTC;";
|
|
1115
1194
|
}
|
|
1116
1195
|
function setExpireDays(days) {
|
|
1117
1196
|
_expires = /* @__PURE__ */ new Date();
|
|
@@ -1161,7 +1240,8 @@ function erase(name) {
|
|
|
1161
1240
|
_erase(name);
|
|
1162
1241
|
}
|
|
1163
1242
|
function eraseAll() {
|
|
1164
|
-
|
|
1243
|
+
if (typeof document !== "undefined")
|
|
1244
|
+
document.cookie.split(";").forEach((c) => erase(c.trim().split("=")[0]));
|
|
1165
1245
|
}
|
|
1166
1246
|
var device_exports = {};
|
|
1167
1247
|
__export2(device_exports, {
|
|
@@ -1177,12 +1257,16 @@ __export2(device_exports, {
|
|
|
1177
1257
|
toPx: () => toPx
|
|
1178
1258
|
});
|
|
1179
1259
|
function getDPI() {
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1260
|
+
try {
|
|
1261
|
+
let el = document.createElement("div");
|
|
1262
|
+
el.style.width = "1in";
|
|
1263
|
+
document.body.appendChild(el);
|
|
1264
|
+
let dpi = el.offsetWidth;
|
|
1265
|
+
el.remove();
|
|
1266
|
+
return dpi || 96;
|
|
1267
|
+
} catch (e) {
|
|
1268
|
+
return 96;
|
|
1269
|
+
}
|
|
1186
1270
|
}
|
|
1187
1271
|
function getScrollBarWidth() {
|
|
1188
1272
|
try {
|
|
@@ -1205,18 +1289,23 @@ function getScrollBarWidth() {
|
|
|
1205
1289
|
}
|
|
1206
1290
|
}
|
|
1207
1291
|
function getSystemFontSize() {
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1292
|
+
try {
|
|
1293
|
+
let tmpDiv = document.createElement("div");
|
|
1294
|
+
tmpDiv.style.cssText = "display:inline-block; padding:0; line-height:1; position:absolute; visibility:hidden; font-size:1em";
|
|
1295
|
+
tmpDiv.appendChild(document.createTextNode("M"));
|
|
1296
|
+
document.body.appendChild(tmpDiv);
|
|
1297
|
+
let fontsize = tmpDiv.offsetHeight;
|
|
1298
|
+
document.body.removeChild(tmpDiv);
|
|
1299
|
+
return fontsize;
|
|
1300
|
+
} catch (e) {
|
|
1301
|
+
return 16;
|
|
1302
|
+
}
|
|
1215
1303
|
}
|
|
1216
1304
|
function getIsTouchDevice() {
|
|
1217
|
-
if (
|
|
1305
|
+
if (typeof window === "undefined")
|
|
1306
|
+
return false;
|
|
1307
|
+
if ("ontouchstart" in window || "DocumentTouch" in window || "createTouch" in document && "createTouchList" in document)
|
|
1218
1308
|
return true;
|
|
1219
|
-
}
|
|
1220
1309
|
var prefixes = " -webkit- -moz- -o- -ms- ".split(" ");
|
|
1221
1310
|
var mq = function(query2) {
|
|
1222
1311
|
return window.matchMedia(query2).matches;
|
|
@@ -1229,7 +1318,10 @@ function getIsMobileDevice() {
|
|
|
1229
1318
|
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));
|
|
1230
1319
|
}
|
|
1231
1320
|
function getHostAddress() {
|
|
1232
|
-
|
|
1321
|
+
if (typeof location === "undefined" || !location.host) {
|
|
1322
|
+
return "localhost";
|
|
1323
|
+
}
|
|
1324
|
+
return `${location.protocol}//${location.host}`;
|
|
1233
1325
|
}
|
|
1234
1326
|
var UnitRegExp = /^(mm|cm|in|inch|px|em)$/;
|
|
1235
1327
|
var ValueUnitRegExp = /^([0-9\\.]+)(.*)$/;
|
|
@@ -1375,6 +1467,7 @@ __export2(dom_exports, {
|
|
|
1375
1467
|
getPadding: () => getPadding,
|
|
1376
1468
|
getWidth: () => getWidth,
|
|
1377
1469
|
hasClass: () => hasClass,
|
|
1470
|
+
injectCss: () => injectCss,
|
|
1378
1471
|
removeClass: () => removeClass,
|
|
1379
1472
|
removeFromParent: () => removeFromParent,
|
|
1380
1473
|
setHeight: () => setHeight,
|
|
@@ -1384,6 +1477,10 @@ __export2(dom_exports, {
|
|
|
1384
1477
|
setWidth: () => setWidth,
|
|
1385
1478
|
styleLayoutChanged: () => styleLayoutChanged
|
|
1386
1479
|
});
|
|
1480
|
+
function _getElemById(id) {
|
|
1481
|
+
var _a;
|
|
1482
|
+
return typeof document === "undefined" ? void 0 : (_a = document.getElementById(id)) != null ? _a : void 0;
|
|
1483
|
+
}
|
|
1387
1484
|
function toPx2(value) {
|
|
1388
1485
|
return value === void 0 ? void 0 : device_exports.toPx(value);
|
|
1389
1486
|
}
|
|
@@ -1420,12 +1517,17 @@ function setOffset(el, left, top, unit = "px") {
|
|
|
1420
1517
|
el.style.top = top + unit;
|
|
1421
1518
|
}
|
|
1422
1519
|
function getOffset(el) {
|
|
1423
|
-
let
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
top
|
|
1427
|
-
|
|
1428
|
-
|
|
1520
|
+
let { left, top } = el.getBoundingClientRect();
|
|
1521
|
+
if (typeof window !== "undefined") {
|
|
1522
|
+
left += window.pageXOffset;
|
|
1523
|
+
top += window.pageYOffset;
|
|
1524
|
+
}
|
|
1525
|
+
if (typeof document !== "undefined") {
|
|
1526
|
+
let de = document.documentElement;
|
|
1527
|
+
left -= de.clientLeft;
|
|
1528
|
+
top -= de.clientTop;
|
|
1529
|
+
}
|
|
1530
|
+
return { left, top };
|
|
1429
1531
|
}
|
|
1430
1532
|
function getWidth(el) {
|
|
1431
1533
|
if (el instanceof Window) {
|
|
@@ -1465,11 +1567,11 @@ function setRect(el, left, top, width, height, unit = "px") {
|
|
|
1465
1567
|
el.style.height = height + unit;
|
|
1466
1568
|
}
|
|
1467
1569
|
function getButton(btn) {
|
|
1468
|
-
let el = typeof btn === "string" ?
|
|
1570
|
+
let el = typeof btn === "string" ? _getElemById(btn) : btn;
|
|
1469
1571
|
return el instanceof HTMLButtonElement ? el : void 0;
|
|
1470
1572
|
}
|
|
1471
1573
|
function getCanvas(canvas2) {
|
|
1472
|
-
let el = typeof canvas2 === "string" ?
|
|
1574
|
+
let el = typeof canvas2 === "string" ? _getElemById(canvas2) : canvas2;
|
|
1473
1575
|
return el instanceof HTMLCanvasElement ? el : void 0;
|
|
1474
1576
|
}
|
|
1475
1577
|
function getPadding(style) {
|
|
@@ -1543,14 +1645,23 @@ function styleLayoutChanged(style1, style2) {
|
|
|
1543
1645
|
}
|
|
1544
1646
|
var canvas;
|
|
1545
1647
|
function getCanvasTextWidth(text, font) {
|
|
1546
|
-
canvas
|
|
1547
|
-
|
|
1548
|
-
|
|
1648
|
+
if (!canvas && typeof document !== "undefined")
|
|
1649
|
+
canvas = document.createElement("canvas");
|
|
1650
|
+
let ctx = canvas == null ? void 0 : canvas.getContext("2d");
|
|
1651
|
+
if (!ctx)
|
|
1549
1652
|
return 0;
|
|
1550
|
-
}
|
|
1551
1653
|
ctx.font = font;
|
|
1552
1654
|
return ctx.measureText(text).width;
|
|
1553
1655
|
}
|
|
1656
|
+
function injectCss(styleId, styleCss) {
|
|
1657
|
+
if (styleId === "" || styleCss === "") return;
|
|
1658
|
+
if (typeof document === "undefined") return;
|
|
1659
|
+
if (document.getElementById(styleId)) return;
|
|
1660
|
+
const style = document.createElement("style");
|
|
1661
|
+
style.id = styleId;
|
|
1662
|
+
style.textContent = styleCss;
|
|
1663
|
+
document.head.appendChild(style);
|
|
1664
|
+
}
|
|
1554
1665
|
var math_exports = {};
|
|
1555
1666
|
__export2(math_exports, {
|
|
1556
1667
|
avg: () => avg,
|
|
@@ -2841,8 +2952,8 @@ var import_core3 = require("@tspro/web-music-score/core");
|
|
|
2841
2952
|
|
|
2842
2953
|
@tspro/ts-utils-lib/dist/index.mjs:
|
|
2843
2954
|
(*!
|
|
2844
|
-
* TsUtilsLib v2.
|
|
2845
|
-
* (c) 2023
|
|
2955
|
+
* TsUtilsLib v2.3.0 (esm)
|
|
2956
|
+
* (c) 2023-2025 PahkaSoft
|
|
2846
2957
|
* Licensed under the MIT License
|
|
2847
2958
|
*)
|
|
2848
2959
|
*/
|
package/dist/react-ui/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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
|
Rect,
|
|
4
4
|
device_exports,
|
|
5
5
|
guard_exports,
|
|
6
6
|
utils_exports
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-AUOH7S2E.mjs";
|
|
8
8
|
import {
|
|
9
9
|
__publicField
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-7GVRGM3N.mjs";
|
|
11
11
|
|
|
12
12
|
// src/react-ui/circle-of-fifths.tsx
|
|
13
13
|
import * as React from "react";
|