@symbo.ls/scratch 3.1.2 → 3.2.3
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/dist/cjs/factory.js +39 -20
- package/dist/cjs/index.js +130 -72
- package/dist/cjs/set.js +126 -58
- package/dist/cjs/system/color.js +120 -41
- package/dist/cjs/system/document.js +119 -38
- package/dist/cjs/system/font.js +117 -36
- package/dist/cjs/system/index.js +127 -63
- package/dist/cjs/system/reset.js +119 -38
- package/dist/cjs/system/shadow.js +120 -41
- package/dist/cjs/system/spacing.js +119 -38
- package/dist/cjs/system/svg.js +118 -39
- package/dist/cjs/system/theme.js +120 -41
- package/dist/cjs/system/timing.js +117 -36
- package/dist/cjs/system/typography.js +123 -55
- package/dist/cjs/transforms/index.js +122 -43
- package/dist/cjs/utils/color.js +15 -18
- package/dist/cjs/utils/index.js +124 -53
- package/dist/cjs/utils/sequence.js +109 -36
- package/dist/cjs/utils/sprite.js +48 -23
- package/dist/cjs/utils/var.js +109 -36
- package/package.json +7 -7
- package/src/system/typography.js +12 -20
- package/src/utils/color.js +42 -31
- package/src/utils/sprite.js +12 -8
|
@@ -34,23 +34,23 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
34
34
|
var require_cjs = __commonJS({
|
|
35
35
|
"../utils/dist/cjs/index.js"(exports, module2) {
|
|
36
36
|
"use strict";
|
|
37
|
-
var
|
|
37
|
+
var __defProp3 = Object.defineProperty;
|
|
38
38
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
39
39
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
40
|
-
var
|
|
40
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
41
41
|
var __export2 = (target, all) => {
|
|
42
42
|
for (var name in all)
|
|
43
|
-
|
|
43
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
44
44
|
};
|
|
45
45
|
var __copyProps2 = (to, from, except, desc) => {
|
|
46
46
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
47
47
|
for (let key of __getOwnPropNames2(from))
|
|
48
|
-
if (!
|
|
49
|
-
|
|
48
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
49
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
50
50
|
}
|
|
51
51
|
return to;
|
|
52
52
|
};
|
|
53
|
-
var __toCommonJS2 = (mod) => __copyProps2(
|
|
53
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
|
|
54
54
|
var index_exports = {};
|
|
55
55
|
__export2(index_exports, {
|
|
56
56
|
arrayzeValue: () => arrayzeValue2,
|
|
@@ -66,6 +66,8 @@ var require_cjs = __commonJS({
|
|
|
66
66
|
loadJavascriptFile: () => loadJavascriptFile,
|
|
67
67
|
loadJavascriptFileEmbedSync: () => loadJavascriptFileEmbedSync,
|
|
68
68
|
loadJavascriptFileSync: () => loadJavascriptFileSync,
|
|
69
|
+
loadRemoteCSS: () => loadRemoteCSS,
|
|
70
|
+
loadRemoteScript: () => loadRemoteScript,
|
|
69
71
|
removeChars: () => removeChars,
|
|
70
72
|
toCamelCase: () => toCamelCase,
|
|
71
73
|
toDashCase: () => toDashCase2,
|
|
@@ -273,10 +275,12 @@ var require_cjs = __commonJS({
|
|
|
273
275
|
});
|
|
274
276
|
});
|
|
275
277
|
scriptEle.addEventListener("error", (ev) => {
|
|
276
|
-
reject(
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
278
|
+
reject(
|
|
279
|
+
new Error({
|
|
280
|
+
status: false,
|
|
281
|
+
message: `Failed to load the script ${FILE_URL}`
|
|
282
|
+
})
|
|
283
|
+
);
|
|
280
284
|
});
|
|
281
285
|
doc.body.appendChild(scriptEle);
|
|
282
286
|
} catch (error) {
|
|
@@ -347,6 +351,59 @@ var require_cjs = __commonJS({
|
|
|
347
351
|
console.warn(error);
|
|
348
352
|
}
|
|
349
353
|
};
|
|
354
|
+
function loadRemoteScript(url, options = {}) {
|
|
355
|
+
const { window: window4 = globalThis } = options;
|
|
356
|
+
const { document: document4 = window4.document } = options;
|
|
357
|
+
return new Promise((resolve, reject) => {
|
|
358
|
+
const existingScript = document4.querySelector(`script[src="${url}"]`);
|
|
359
|
+
if (existingScript) {
|
|
360
|
+
return resolve(existingScript);
|
|
361
|
+
}
|
|
362
|
+
const script = document4.createElement("script");
|
|
363
|
+
script.src = url;
|
|
364
|
+
script.async = options.async === true;
|
|
365
|
+
script.type = options.type || "text/javascript";
|
|
366
|
+
if (options.id) script.id = options.id;
|
|
367
|
+
if (options.integrity) script.integrity = options.integrity;
|
|
368
|
+
if (options.crossOrigin) script.crossOrigin = options.crossOrigin;
|
|
369
|
+
script.onload = () => {
|
|
370
|
+
script.onerror = script.onload = null;
|
|
371
|
+
resolve(script);
|
|
372
|
+
};
|
|
373
|
+
script.onerror = () => {
|
|
374
|
+
script.onerror = script.onload = null;
|
|
375
|
+
reject(new Error(`Failed to load script: ${url}`));
|
|
376
|
+
};
|
|
377
|
+
document4.head.appendChild(script);
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
async function loadRemoteCSS(url, options = {}) {
|
|
381
|
+
const { window: window4 = globalThis } = options;
|
|
382
|
+
const { document: document4 = window4.document } = options;
|
|
383
|
+
return new Promise((resolve, reject) => {
|
|
384
|
+
const existingLink = document4.querySelector(`link[href="${url}"]`);
|
|
385
|
+
if (existingLink) {
|
|
386
|
+
return resolve(existingLink);
|
|
387
|
+
}
|
|
388
|
+
const link = document4.createElement("link");
|
|
389
|
+
link.href = url;
|
|
390
|
+
link.rel = options.rel || "stylesheet";
|
|
391
|
+
link.type = "text/css";
|
|
392
|
+
link.media = options.media || "all";
|
|
393
|
+
if (options.id) link.id = options.id;
|
|
394
|
+
if (options.integrity) link.integrity = options.integrity;
|
|
395
|
+
if (options.crossOrigin) link.crossOrigin = options.crossOrigin;
|
|
396
|
+
link.onload = () => {
|
|
397
|
+
link.onerror = link.onload = null;
|
|
398
|
+
resolve(link);
|
|
399
|
+
};
|
|
400
|
+
link.onerror = () => {
|
|
401
|
+
link.onerror = link.onload = null;
|
|
402
|
+
reject(new Error(`Failed to load stylesheet: ${url}`));
|
|
403
|
+
};
|
|
404
|
+
document4.head.appendChild(link);
|
|
405
|
+
});
|
|
406
|
+
}
|
|
350
407
|
var isPhoto = (format) => ["jpeg", "gif", "jpg", "png", "tiff", "woff"].includes(format);
|
|
351
408
|
var copyStringToClipboard = async (str) => {
|
|
352
409
|
try {
|
|
@@ -373,12 +430,9 @@ var require_cjs = __commonJS({
|
|
|
373
430
|
return index === 0 ? word.toLowerCase() : word.toUpperCase();
|
|
374
431
|
}).replaceAll(/\s+/g, "");
|
|
375
432
|
};
|
|
376
|
-
var toTitleCase = (str) => str && str.replace(
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
|
380
|
-
}
|
|
381
|
-
);
|
|
433
|
+
var toTitleCase = (str) => str && str.replace(/\w\S*/g, (txt) => {
|
|
434
|
+
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
|
435
|
+
});
|
|
382
436
|
var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
383
437
|
var toDescriptionCase = (str = "") => {
|
|
384
438
|
if (typeof str !== "string") return;
|
|
@@ -402,16 +456,16 @@ __export(shadow_exports, {
|
|
|
402
456
|
});
|
|
403
457
|
module.exports = __toCommonJS(shadow_exports);
|
|
404
458
|
|
|
405
|
-
// ../../../domql/packages/utils/globals.js
|
|
459
|
+
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
406
460
|
var window2 = globalThis;
|
|
407
461
|
var document2 = window2.document;
|
|
408
462
|
|
|
409
|
-
// ../../../domql/packages/utils/node.js
|
|
463
|
+
// ../../../domql/packages/utils/dist/esm/node.js
|
|
410
464
|
var isDOMNode = (obj) => {
|
|
411
465
|
return typeof window2 !== "undefined" && (obj instanceof window2.Node || obj instanceof window2.Window || obj === window2 || obj === document);
|
|
412
466
|
};
|
|
413
467
|
|
|
414
|
-
// ../../../domql/packages/utils/types.js
|
|
468
|
+
// ../../../domql/packages/utils/dist/esm/types.js
|
|
415
469
|
var isObject = (arg) => {
|
|
416
470
|
if (arg === null) return false;
|
|
417
471
|
return typeof arg === "object" && arg.constructor === Object;
|
|
@@ -429,7 +483,7 @@ var isUndefined = (arg) => {
|
|
|
429
483
|
return arg === void 0;
|
|
430
484
|
};
|
|
431
485
|
|
|
432
|
-
// ../../../domql/packages/utils/array.js
|
|
486
|
+
// ../../../domql/packages/utils/dist/esm/array.js
|
|
433
487
|
var unstackArrayOfObjects = (arr, exclude = []) => {
|
|
434
488
|
return arr.reduce(
|
|
435
489
|
(a, c) => deepMerge(a, deepClone(c, { exclude }), exclude),
|
|
@@ -437,7 +491,7 @@ var unstackArrayOfObjects = (arr, exclude = []) => {
|
|
|
437
491
|
);
|
|
438
492
|
};
|
|
439
493
|
|
|
440
|
-
// ../../../domql/packages/utils/keys.js
|
|
494
|
+
// ../../../domql/packages/utils/dist/esm/keys.js
|
|
441
495
|
var STATE_METHODS = [
|
|
442
496
|
"update",
|
|
443
497
|
"parse",
|
|
@@ -508,11 +562,30 @@ var METHODS_EXL = [
|
|
|
508
562
|
...PROPS_METHODS
|
|
509
563
|
];
|
|
510
564
|
|
|
511
|
-
// ../../../domql/packages/utils/object.js
|
|
565
|
+
// ../../../domql/packages/utils/dist/esm/object.js
|
|
566
|
+
var __defProp2 = Object.defineProperty;
|
|
567
|
+
var __defProps = Object.defineProperties;
|
|
568
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
569
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
570
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
571
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
572
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
573
|
+
var __spreadValues = (a, b) => {
|
|
574
|
+
for (var prop in b || (b = {}))
|
|
575
|
+
if (__hasOwnProp2.call(b, prop))
|
|
576
|
+
__defNormalProp(a, prop, b[prop]);
|
|
577
|
+
if (__getOwnPropSymbols)
|
|
578
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
579
|
+
if (__propIsEnum.call(b, prop))
|
|
580
|
+
__defNormalProp(a, prop, b[prop]);
|
|
581
|
+
}
|
|
582
|
+
return a;
|
|
583
|
+
};
|
|
584
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
512
585
|
var deepMerge = (element, extend, excludeFrom = METHODS_EXL) => {
|
|
513
586
|
for (const e in extend) {
|
|
514
|
-
const
|
|
515
|
-
if (!
|
|
587
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
|
|
588
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) {
|
|
516
589
|
continue;
|
|
517
590
|
}
|
|
518
591
|
const elementProp = element[e];
|
|
@@ -534,14 +607,15 @@ var deepClone = (obj, options = {}) => {
|
|
|
534
607
|
visited = /* @__PURE__ */ new WeakMap(),
|
|
535
608
|
handleExtends = false
|
|
536
609
|
} = options;
|
|
610
|
+
const contentWindow = targetWindow || window2 || globalThis;
|
|
537
611
|
if (!isObjectLike(obj) || isDOMNode(obj)) {
|
|
538
612
|
return obj;
|
|
539
613
|
}
|
|
540
614
|
if (visited.has(obj)) {
|
|
541
615
|
return visited.get(obj);
|
|
542
616
|
}
|
|
543
|
-
const
|
|
544
|
-
visited.set(obj,
|
|
617
|
+
const clone2 = contentWindow ? isArray(obj) ? new contentWindow.Array() : new contentWindow.Object() : isArray(obj) ? [] : {};
|
|
618
|
+
visited.set(obj, clone2);
|
|
545
619
|
for (const key in obj) {
|
|
546
620
|
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
|
|
547
621
|
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__") {
|
|
@@ -552,30 +626,34 @@ var deepClone = (obj, options = {}) => {
|
|
|
552
626
|
continue;
|
|
553
627
|
}
|
|
554
628
|
if (isDOMNode(value)) {
|
|
555
|
-
|
|
629
|
+
clone2[key] = value;
|
|
556
630
|
continue;
|
|
557
631
|
}
|
|
558
632
|
if (handleExtends && key === "extends" && isArray(value)) {
|
|
559
|
-
|
|
633
|
+
clone2[key] = unstackArrayOfObjects(value, exclude);
|
|
560
634
|
continue;
|
|
561
635
|
}
|
|
562
|
-
if (isFunction(value) &&
|
|
563
|
-
|
|
636
|
+
if (isFunction(value) && options.window) {
|
|
637
|
+
clone2[key] = contentWindow.eval("(" + value.toString() + ")");
|
|
564
638
|
continue;
|
|
565
639
|
}
|
|
566
640
|
if (isObjectLike(value)) {
|
|
567
|
-
|
|
568
|
-
...options,
|
|
641
|
+
clone2[key] = deepClone(value, __spreadProps(__spreadValues({}, options), {
|
|
569
642
|
visited
|
|
570
|
-
});
|
|
643
|
+
}));
|
|
571
644
|
} else {
|
|
572
|
-
|
|
645
|
+
clone2[key] = value;
|
|
573
646
|
}
|
|
574
647
|
}
|
|
575
|
-
return
|
|
648
|
+
return clone2;
|
|
576
649
|
};
|
|
577
650
|
|
|
578
|
-
// ../../../domql/packages/utils/
|
|
651
|
+
// ../../../domql/packages/utils/dist/esm/env.js
|
|
652
|
+
var NODE_ENV = "development";
|
|
653
|
+
var isProduction = (env = NODE_ENV) => env === "production";
|
|
654
|
+
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
655
|
+
|
|
656
|
+
// ../../../domql/packages/utils/dist/esm/cookie.js
|
|
579
657
|
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
580
658
|
|
|
581
659
|
// ../../../domql/packages/event/dist/esm/keys.js
|
|
@@ -932,10 +1010,7 @@ var rgbToHSL = (r, g, b) => {
|
|
|
932
1010
|
const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
933
1011
|
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
|
|
934
1012
|
};
|
|
935
|
-
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
|
|
936
|
-
Math.min(k - 3, 9 - k, 1),
|
|
937
|
-
-1
|
|
938
|
-
)) => [f(0), f(8), f(4)];
|
|
1013
|
+
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1)) => [f(0), f(8), f(4)];
|
|
939
1014
|
var getColorShade = (col, amt) => {
|
|
940
1015
|
const num = parseInt(col, 16);
|
|
941
1016
|
let r = (num >> 16) + amt;
|
|
@@ -950,7 +1025,8 @@ var getColorShade = (col, amt) => {
|
|
|
950
1025
|
return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
|
|
951
1026
|
};
|
|
952
1027
|
var getRgbTone = (rgb, tone) => {
|
|
953
|
-
if (isString(rgb) && rgb.includes("rgb"))
|
|
1028
|
+
if (isString(rgb) && rgb.includes("rgb"))
|
|
1029
|
+
rgb = colorStringToRgbaArray(rgb).join(", ");
|
|
954
1030
|
if (isString(rgb)) rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
|
|
955
1031
|
if (isNumber(tone)) tone += "";
|
|
956
1032
|
const toHex = rgbArrayToHex(rgb);
|
|
@@ -1155,6 +1231,9 @@ var getSequenceValuePropertyPair = (value, propertyName, sequenceProps) => {
|
|
|
1155
1231
|
return { [propertyName]: getSequenceValue(value, sequenceProps) };
|
|
1156
1232
|
};
|
|
1157
1233
|
|
|
1234
|
+
// src/utils/sprite.js
|
|
1235
|
+
var isDev = isNotProduction();
|
|
1236
|
+
|
|
1158
1237
|
// src/system/color.js
|
|
1159
1238
|
var getColor = (value, key, config) => {
|
|
1160
1239
|
const CONFIG2 = config || getActiveConfig();
|
|
@@ -34,23 +34,23 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
34
34
|
var require_cjs = __commonJS({
|
|
35
35
|
"../utils/dist/cjs/index.js"(exports, module2) {
|
|
36
36
|
"use strict";
|
|
37
|
-
var
|
|
37
|
+
var __defProp3 = Object.defineProperty;
|
|
38
38
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
39
39
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
40
|
-
var
|
|
40
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
41
41
|
var __export2 = (target, all) => {
|
|
42
42
|
for (var name in all)
|
|
43
|
-
|
|
43
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
44
44
|
};
|
|
45
45
|
var __copyProps2 = (to, from, except, desc) => {
|
|
46
46
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
47
47
|
for (let key of __getOwnPropNames2(from))
|
|
48
|
-
if (!
|
|
49
|
-
|
|
48
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
49
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
50
50
|
}
|
|
51
51
|
return to;
|
|
52
52
|
};
|
|
53
|
-
var __toCommonJS2 = (mod) => __copyProps2(
|
|
53
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
|
|
54
54
|
var index_exports = {};
|
|
55
55
|
__export2(index_exports, {
|
|
56
56
|
arrayzeValue: () => arrayzeValue2,
|
|
@@ -66,6 +66,8 @@ var require_cjs = __commonJS({
|
|
|
66
66
|
loadJavascriptFile: () => loadJavascriptFile,
|
|
67
67
|
loadJavascriptFileEmbedSync: () => loadJavascriptFileEmbedSync,
|
|
68
68
|
loadJavascriptFileSync: () => loadJavascriptFileSync,
|
|
69
|
+
loadRemoteCSS: () => loadRemoteCSS,
|
|
70
|
+
loadRemoteScript: () => loadRemoteScript,
|
|
69
71
|
removeChars: () => removeChars,
|
|
70
72
|
toCamelCase: () => toCamelCase,
|
|
71
73
|
toDashCase: () => toDashCase2,
|
|
@@ -273,10 +275,12 @@ var require_cjs = __commonJS({
|
|
|
273
275
|
});
|
|
274
276
|
});
|
|
275
277
|
scriptEle.addEventListener("error", (ev) => {
|
|
276
|
-
reject(
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
278
|
+
reject(
|
|
279
|
+
new Error({
|
|
280
|
+
status: false,
|
|
281
|
+
message: `Failed to load the script ${FILE_URL}`
|
|
282
|
+
})
|
|
283
|
+
);
|
|
280
284
|
});
|
|
281
285
|
doc.body.appendChild(scriptEle);
|
|
282
286
|
} catch (error) {
|
|
@@ -347,6 +351,59 @@ var require_cjs = __commonJS({
|
|
|
347
351
|
console.warn(error);
|
|
348
352
|
}
|
|
349
353
|
};
|
|
354
|
+
function loadRemoteScript(url, options = {}) {
|
|
355
|
+
const { window: window4 = globalThis } = options;
|
|
356
|
+
const { document: document4 = window4.document } = options;
|
|
357
|
+
return new Promise((resolve, reject) => {
|
|
358
|
+
const existingScript = document4.querySelector(`script[src="${url}"]`);
|
|
359
|
+
if (existingScript) {
|
|
360
|
+
return resolve(existingScript);
|
|
361
|
+
}
|
|
362
|
+
const script = document4.createElement("script");
|
|
363
|
+
script.src = url;
|
|
364
|
+
script.async = options.async === true;
|
|
365
|
+
script.type = options.type || "text/javascript";
|
|
366
|
+
if (options.id) script.id = options.id;
|
|
367
|
+
if (options.integrity) script.integrity = options.integrity;
|
|
368
|
+
if (options.crossOrigin) script.crossOrigin = options.crossOrigin;
|
|
369
|
+
script.onload = () => {
|
|
370
|
+
script.onerror = script.onload = null;
|
|
371
|
+
resolve(script);
|
|
372
|
+
};
|
|
373
|
+
script.onerror = () => {
|
|
374
|
+
script.onerror = script.onload = null;
|
|
375
|
+
reject(new Error(`Failed to load script: ${url}`));
|
|
376
|
+
};
|
|
377
|
+
document4.head.appendChild(script);
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
async function loadRemoteCSS(url, options = {}) {
|
|
381
|
+
const { window: window4 = globalThis } = options;
|
|
382
|
+
const { document: document4 = window4.document } = options;
|
|
383
|
+
return new Promise((resolve, reject) => {
|
|
384
|
+
const existingLink = document4.querySelector(`link[href="${url}"]`);
|
|
385
|
+
if (existingLink) {
|
|
386
|
+
return resolve(existingLink);
|
|
387
|
+
}
|
|
388
|
+
const link = document4.createElement("link");
|
|
389
|
+
link.href = url;
|
|
390
|
+
link.rel = options.rel || "stylesheet";
|
|
391
|
+
link.type = "text/css";
|
|
392
|
+
link.media = options.media || "all";
|
|
393
|
+
if (options.id) link.id = options.id;
|
|
394
|
+
if (options.integrity) link.integrity = options.integrity;
|
|
395
|
+
if (options.crossOrigin) link.crossOrigin = options.crossOrigin;
|
|
396
|
+
link.onload = () => {
|
|
397
|
+
link.onerror = link.onload = null;
|
|
398
|
+
resolve(link);
|
|
399
|
+
};
|
|
400
|
+
link.onerror = () => {
|
|
401
|
+
link.onerror = link.onload = null;
|
|
402
|
+
reject(new Error(`Failed to load stylesheet: ${url}`));
|
|
403
|
+
};
|
|
404
|
+
document4.head.appendChild(link);
|
|
405
|
+
});
|
|
406
|
+
}
|
|
350
407
|
var isPhoto = (format) => ["jpeg", "gif", "jpg", "png", "tiff", "woff"].includes(format);
|
|
351
408
|
var copyStringToClipboard = async (str) => {
|
|
352
409
|
try {
|
|
@@ -373,12 +430,9 @@ var require_cjs = __commonJS({
|
|
|
373
430
|
return index === 0 ? word.toLowerCase() : word.toUpperCase();
|
|
374
431
|
}).replaceAll(/\s+/g, "");
|
|
375
432
|
};
|
|
376
|
-
var toTitleCase = (str) => str && str.replace(
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
|
380
|
-
}
|
|
381
|
-
);
|
|
433
|
+
var toTitleCase = (str) => str && str.replace(/\w\S*/g, (txt) => {
|
|
434
|
+
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
|
435
|
+
});
|
|
382
436
|
var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
383
437
|
var toDescriptionCase = (str = "") => {
|
|
384
438
|
if (typeof str !== "string") return;
|
|
@@ -404,16 +458,16 @@ __export(spacing_exports, {
|
|
|
404
458
|
module.exports = __toCommonJS(spacing_exports);
|
|
405
459
|
var import_utils8 = __toESM(require_cjs(), 1);
|
|
406
460
|
|
|
407
|
-
// ../../../domql/packages/utils/globals.js
|
|
461
|
+
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
408
462
|
var window2 = globalThis;
|
|
409
463
|
var document2 = window2.document;
|
|
410
464
|
|
|
411
|
-
// ../../../domql/packages/utils/node.js
|
|
465
|
+
// ../../../domql/packages/utils/dist/esm/node.js
|
|
412
466
|
var isDOMNode = (obj) => {
|
|
413
467
|
return typeof window2 !== "undefined" && (obj instanceof window2.Node || obj instanceof window2.Window || obj === window2 || obj === document);
|
|
414
468
|
};
|
|
415
469
|
|
|
416
|
-
// ../../../domql/packages/utils/types.js
|
|
470
|
+
// ../../../domql/packages/utils/dist/esm/types.js
|
|
417
471
|
var isString = (arg) => typeof arg === "string";
|
|
418
472
|
var isFunction = (arg) => typeof arg === "function";
|
|
419
473
|
var isNull = (arg) => arg === null;
|
|
@@ -426,7 +480,7 @@ var isUndefined = (arg) => {
|
|
|
426
480
|
return arg === void 0;
|
|
427
481
|
};
|
|
428
482
|
|
|
429
|
-
// ../../../domql/packages/utils/array.js
|
|
483
|
+
// ../../../domql/packages/utils/dist/esm/array.js
|
|
430
484
|
var unstackArrayOfObjects = (arr, exclude = []) => {
|
|
431
485
|
return arr.reduce(
|
|
432
486
|
(a, c) => deepMerge(a, deepClone(c, { exclude }), exclude),
|
|
@@ -434,7 +488,7 @@ var unstackArrayOfObjects = (arr, exclude = []) => {
|
|
|
434
488
|
);
|
|
435
489
|
};
|
|
436
490
|
|
|
437
|
-
// ../../../domql/packages/utils/keys.js
|
|
491
|
+
// ../../../domql/packages/utils/dist/esm/keys.js
|
|
438
492
|
var STATE_METHODS = [
|
|
439
493
|
"update",
|
|
440
494
|
"parse",
|
|
@@ -505,11 +559,30 @@ var METHODS_EXL = [
|
|
|
505
559
|
...PROPS_METHODS
|
|
506
560
|
];
|
|
507
561
|
|
|
508
|
-
// ../../../domql/packages/utils/object.js
|
|
562
|
+
// ../../../domql/packages/utils/dist/esm/object.js
|
|
563
|
+
var __defProp2 = Object.defineProperty;
|
|
564
|
+
var __defProps = Object.defineProperties;
|
|
565
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
566
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
567
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
568
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
569
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
570
|
+
var __spreadValues = (a, b) => {
|
|
571
|
+
for (var prop in b || (b = {}))
|
|
572
|
+
if (__hasOwnProp2.call(b, prop))
|
|
573
|
+
__defNormalProp(a, prop, b[prop]);
|
|
574
|
+
if (__getOwnPropSymbols)
|
|
575
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
576
|
+
if (__propIsEnum.call(b, prop))
|
|
577
|
+
__defNormalProp(a, prop, b[prop]);
|
|
578
|
+
}
|
|
579
|
+
return a;
|
|
580
|
+
};
|
|
581
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
509
582
|
var merge = (element, obj, excludeFrom = []) => {
|
|
510
583
|
for (const e in obj) {
|
|
511
|
-
const
|
|
512
|
-
if (!
|
|
584
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
|
|
585
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) {
|
|
513
586
|
continue;
|
|
514
587
|
}
|
|
515
588
|
const elementProp = element[e];
|
|
@@ -522,8 +595,8 @@ var merge = (element, obj, excludeFrom = []) => {
|
|
|
522
595
|
};
|
|
523
596
|
var deepMerge = (element, extend, excludeFrom = METHODS_EXL) => {
|
|
524
597
|
for (const e in extend) {
|
|
525
|
-
const
|
|
526
|
-
if (!
|
|
598
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
|
|
599
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) {
|
|
527
600
|
continue;
|
|
528
601
|
}
|
|
529
602
|
const elementProp = element[e];
|
|
@@ -545,14 +618,15 @@ var deepClone = (obj, options = {}) => {
|
|
|
545
618
|
visited = /* @__PURE__ */ new WeakMap(),
|
|
546
619
|
handleExtends = false
|
|
547
620
|
} = options;
|
|
621
|
+
const contentWindow = targetWindow || window2 || globalThis;
|
|
548
622
|
if (!isObjectLike(obj) || isDOMNode(obj)) {
|
|
549
623
|
return obj;
|
|
550
624
|
}
|
|
551
625
|
if (visited.has(obj)) {
|
|
552
626
|
return visited.get(obj);
|
|
553
627
|
}
|
|
554
|
-
const
|
|
555
|
-
visited.set(obj,
|
|
628
|
+
const clone2 = contentWindow ? isArray(obj) ? new contentWindow.Array() : new contentWindow.Object() : isArray(obj) ? [] : {};
|
|
629
|
+
visited.set(obj, clone2);
|
|
556
630
|
for (const key in obj) {
|
|
557
631
|
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
|
|
558
632
|
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__") {
|
|
@@ -563,30 +637,34 @@ var deepClone = (obj, options = {}) => {
|
|
|
563
637
|
continue;
|
|
564
638
|
}
|
|
565
639
|
if (isDOMNode(value)) {
|
|
566
|
-
|
|
640
|
+
clone2[key] = value;
|
|
567
641
|
continue;
|
|
568
642
|
}
|
|
569
643
|
if (handleExtends && key === "extends" && isArray(value)) {
|
|
570
|
-
|
|
644
|
+
clone2[key] = unstackArrayOfObjects(value, exclude);
|
|
571
645
|
continue;
|
|
572
646
|
}
|
|
573
|
-
if (isFunction(value) &&
|
|
574
|
-
|
|
647
|
+
if (isFunction(value) && options.window) {
|
|
648
|
+
clone2[key] = contentWindow.eval("(" + value.toString() + ")");
|
|
575
649
|
continue;
|
|
576
650
|
}
|
|
577
651
|
if (isObjectLike(value)) {
|
|
578
|
-
|
|
579
|
-
...options,
|
|
652
|
+
clone2[key] = deepClone(value, __spreadProps(__spreadValues({}, options), {
|
|
580
653
|
visited
|
|
581
|
-
});
|
|
654
|
+
}));
|
|
582
655
|
} else {
|
|
583
|
-
|
|
656
|
+
clone2[key] = value;
|
|
584
657
|
}
|
|
585
658
|
}
|
|
586
|
-
return
|
|
659
|
+
return clone2;
|
|
587
660
|
};
|
|
588
661
|
|
|
589
|
-
// ../../../domql/packages/utils/
|
|
662
|
+
// ../../../domql/packages/utils/dist/esm/env.js
|
|
663
|
+
var NODE_ENV = "development";
|
|
664
|
+
var isProduction = (env = NODE_ENV) => env === "production";
|
|
665
|
+
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
666
|
+
|
|
667
|
+
// ../../../domql/packages/utils/dist/esm/cookie.js
|
|
590
668
|
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
591
669
|
|
|
592
670
|
// ../../../domql/packages/event/dist/esm/keys.js
|
|
@@ -1147,6 +1225,9 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
1147
1225
|
}
|
|
1148
1226
|
};
|
|
1149
1227
|
|
|
1228
|
+
// src/utils/sprite.js
|
|
1229
|
+
var isDev = isNotProduction();
|
|
1230
|
+
|
|
1150
1231
|
// src/system/spacing.js
|
|
1151
1232
|
var runThroughMedia = (FACTORY2) => {
|
|
1152
1233
|
for (const prop in FACTORY2) {
|