@symbo.ls/scratch 3.1.1 → 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 +40 -20
- package/dist/cjs/index.js +131 -72
- package/dist/cjs/set.js +127 -58
- package/dist/cjs/system/color.js +121 -41
- package/dist/cjs/system/document.js +120 -38
- package/dist/cjs/system/font.js +118 -36
- package/dist/cjs/system/index.js +128 -63
- package/dist/cjs/system/reset.js +120 -38
- package/dist/cjs/system/shadow.js +121 -41
- package/dist/cjs/system/spacing.js +120 -38
- package/dist/cjs/system/svg.js +119 -39
- package/dist/cjs/system/theme.js +121 -41
- package/dist/cjs/system/timing.js +118 -36
- package/dist/cjs/system/typography.js +124 -55
- package/dist/cjs/transforms/index.js +123 -43
- package/dist/cjs/utils/color.js +16 -18
- package/dist/cjs/utils/index.js +125 -53
- package/dist/cjs/utils/sequence.js +110 -36
- package/dist/cjs/utils/sprite.js +49 -23
- package/dist/cjs/utils/var.js +110 -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
package/dist/cjs/system/svg.js
CHANGED
|
@@ -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: () => arrayzeValue,
|
|
@@ -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(svg_exports, {
|
|
|
404
458
|
});
|
|
405
459
|
module.exports = __toCommonJS(svg_exports);
|
|
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 deepMerge = (element, extend, excludeFrom = METHODS_EXL) => {
|
|
510
583
|
for (const e in extend) {
|
|
511
|
-
const
|
|
512
|
-
if (!
|
|
584
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
|
|
585
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) {
|
|
513
586
|
continue;
|
|
514
587
|
}
|
|
515
588
|
const elementProp = element[e];
|
|
@@ -531,14 +604,15 @@ var deepClone = (obj, options = {}) => {
|
|
|
531
604
|
visited = /* @__PURE__ */ new WeakMap(),
|
|
532
605
|
handleExtends = false
|
|
533
606
|
} = options;
|
|
607
|
+
const contentWindow = targetWindow || window2 || globalThis;
|
|
534
608
|
if (!isObjectLike(obj) || isDOMNode(obj)) {
|
|
535
609
|
return obj;
|
|
536
610
|
}
|
|
537
611
|
if (visited.has(obj)) {
|
|
538
612
|
return visited.get(obj);
|
|
539
613
|
}
|
|
540
|
-
const
|
|
541
|
-
visited.set(obj,
|
|
614
|
+
const clone2 = contentWindow ? isArray(obj) ? new contentWindow.Array() : new contentWindow.Object() : isArray(obj) ? [] : {};
|
|
615
|
+
visited.set(obj, clone2);
|
|
542
616
|
for (const key in obj) {
|
|
543
617
|
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
|
|
544
618
|
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__") {
|
|
@@ -549,30 +623,34 @@ var deepClone = (obj, options = {}) => {
|
|
|
549
623
|
continue;
|
|
550
624
|
}
|
|
551
625
|
if (isDOMNode(value)) {
|
|
552
|
-
|
|
626
|
+
clone2[key] = value;
|
|
553
627
|
continue;
|
|
554
628
|
}
|
|
555
629
|
if (handleExtends && key === "extends" && isArray(value)) {
|
|
556
|
-
|
|
630
|
+
clone2[key] = unstackArrayOfObjects(value, exclude);
|
|
557
631
|
continue;
|
|
558
632
|
}
|
|
559
|
-
if (isFunction(value) &&
|
|
560
|
-
|
|
633
|
+
if (isFunction(value) && options.window) {
|
|
634
|
+
clone2[key] = contentWindow.eval("(" + value.toString() + ")");
|
|
561
635
|
continue;
|
|
562
636
|
}
|
|
563
637
|
if (isObjectLike(value)) {
|
|
564
|
-
|
|
565
|
-
...options,
|
|
638
|
+
clone2[key] = deepClone(value, __spreadProps(__spreadValues({}, options), {
|
|
566
639
|
visited
|
|
567
|
-
});
|
|
640
|
+
}));
|
|
568
641
|
} else {
|
|
569
|
-
|
|
642
|
+
clone2[key] = value;
|
|
570
643
|
}
|
|
571
644
|
}
|
|
572
|
-
return
|
|
645
|
+
return clone2;
|
|
573
646
|
};
|
|
574
647
|
|
|
575
|
-
// ../../../domql/packages/utils/
|
|
648
|
+
// ../../../domql/packages/utils/dist/esm/env.js
|
|
649
|
+
var NODE_ENV = "development";
|
|
650
|
+
var isProduction = (env = NODE_ENV) => env === "production";
|
|
651
|
+
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
652
|
+
|
|
653
|
+
// ../../../domql/packages/utils/dist/esm/cookie.js
|
|
576
654
|
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
577
655
|
|
|
578
656
|
// ../../../domql/packages/event/dist/esm/keys.js
|
|
@@ -875,8 +953,7 @@ var getActiveConfig = (def) => {
|
|
|
875
953
|
};
|
|
876
954
|
|
|
877
955
|
// src/utils/sprite.js
|
|
878
|
-
var
|
|
879
|
-
var isDev = ENV === "development" || ENV === "testing";
|
|
956
|
+
var isDev = isNotProduction();
|
|
880
957
|
var generateSprite = (icons) => {
|
|
881
958
|
const CONFIG2 = getActiveConfig();
|
|
882
959
|
let sprite = "";
|
|
@@ -898,7 +975,9 @@ var parseRootAttributes = (htmlString) => {
|
|
|
898
975
|
return {};
|
|
899
976
|
}
|
|
900
977
|
const attrString = match[1];
|
|
901
|
-
const attrs = attrString.match(
|
|
978
|
+
const attrs = attrString.match(
|
|
979
|
+
/(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|\s*\/?[>"']))+.)["']?/gm
|
|
980
|
+
);
|
|
902
981
|
return attrs.reduce((acc, attr) => {
|
|
903
982
|
const [key, value] = attr.split("=");
|
|
904
983
|
acc[key] = value.replace(/['"]/g, "");
|
|
@@ -1004,3 +1083,4 @@ var appendSVG = (lib, options = DEF_OPTIONS) => {
|
|
|
1004
1083
|
}
|
|
1005
1084
|
}
|
|
1006
1085
|
};
|
|
1086
|
+
// @preserve-env
|
package/dist/cjs/system/theme.js
CHANGED
|
@@ -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: () => arrayzeValue,
|
|
@@ -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(theme_exports, {
|
|
|
404
458
|
});
|
|
405
459
|
module.exports = __toCommonJS(theme_exports);
|
|
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 isObject = (arg) => {
|
|
418
472
|
if (arg === null) return false;
|
|
419
473
|
return typeof arg === "object" && arg.constructor === Object;
|
|
@@ -431,7 +485,7 @@ var isUndefined = (arg) => {
|
|
|
431
485
|
return arg === void 0;
|
|
432
486
|
};
|
|
433
487
|
|
|
434
|
-
// ../../../domql/packages/utils/array.js
|
|
488
|
+
// ../../../domql/packages/utils/dist/esm/array.js
|
|
435
489
|
var unstackArrayOfObjects = (arr, exclude = []) => {
|
|
436
490
|
return arr.reduce(
|
|
437
491
|
(a, c) => deepMerge(a, deepClone(c, { exclude }), exclude),
|
|
@@ -439,7 +493,7 @@ var unstackArrayOfObjects = (arr, exclude = []) => {
|
|
|
439
493
|
);
|
|
440
494
|
};
|
|
441
495
|
|
|
442
|
-
// ../../../domql/packages/utils/keys.js
|
|
496
|
+
// ../../../domql/packages/utils/dist/esm/keys.js
|
|
443
497
|
var STATE_METHODS = [
|
|
444
498
|
"update",
|
|
445
499
|
"parse",
|
|
@@ -510,11 +564,30 @@ var METHODS_EXL = [
|
|
|
510
564
|
...PROPS_METHODS
|
|
511
565
|
];
|
|
512
566
|
|
|
513
|
-
// ../../../domql/packages/utils/object.js
|
|
567
|
+
// ../../../domql/packages/utils/dist/esm/object.js
|
|
568
|
+
var __defProp2 = Object.defineProperty;
|
|
569
|
+
var __defProps = Object.defineProperties;
|
|
570
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
571
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
572
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
573
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
574
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
575
|
+
var __spreadValues = (a, b) => {
|
|
576
|
+
for (var prop in b || (b = {}))
|
|
577
|
+
if (__hasOwnProp2.call(b, prop))
|
|
578
|
+
__defNormalProp(a, prop, b[prop]);
|
|
579
|
+
if (__getOwnPropSymbols)
|
|
580
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
581
|
+
if (__propIsEnum.call(b, prop))
|
|
582
|
+
__defNormalProp(a, prop, b[prop]);
|
|
583
|
+
}
|
|
584
|
+
return a;
|
|
585
|
+
};
|
|
586
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
514
587
|
var deepMerge = (element, extend, excludeFrom = METHODS_EXL) => {
|
|
515
588
|
for (const e in extend) {
|
|
516
|
-
const
|
|
517
|
-
if (!
|
|
589
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
|
|
590
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) {
|
|
518
591
|
continue;
|
|
519
592
|
}
|
|
520
593
|
const elementProp = element[e];
|
|
@@ -536,14 +609,15 @@ var deepClone = (obj, options = {}) => {
|
|
|
536
609
|
visited = /* @__PURE__ */ new WeakMap(),
|
|
537
610
|
handleExtends = false
|
|
538
611
|
} = options;
|
|
612
|
+
const contentWindow = targetWindow || window2 || globalThis;
|
|
539
613
|
if (!isObjectLike(obj) || isDOMNode(obj)) {
|
|
540
614
|
return obj;
|
|
541
615
|
}
|
|
542
616
|
if (visited.has(obj)) {
|
|
543
617
|
return visited.get(obj);
|
|
544
618
|
}
|
|
545
|
-
const
|
|
546
|
-
visited.set(obj,
|
|
619
|
+
const clone2 = contentWindow ? isArray(obj) ? new contentWindow.Array() : new contentWindow.Object() : isArray(obj) ? [] : {};
|
|
620
|
+
visited.set(obj, clone2);
|
|
547
621
|
for (const key in obj) {
|
|
548
622
|
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
|
|
549
623
|
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__") {
|
|
@@ -554,30 +628,34 @@ var deepClone = (obj, options = {}) => {
|
|
|
554
628
|
continue;
|
|
555
629
|
}
|
|
556
630
|
if (isDOMNode(value)) {
|
|
557
|
-
|
|
631
|
+
clone2[key] = value;
|
|
558
632
|
continue;
|
|
559
633
|
}
|
|
560
634
|
if (handleExtends && key === "extends" && isArray(value)) {
|
|
561
|
-
|
|
635
|
+
clone2[key] = unstackArrayOfObjects(value, exclude);
|
|
562
636
|
continue;
|
|
563
637
|
}
|
|
564
|
-
if (isFunction(value) &&
|
|
565
|
-
|
|
638
|
+
if (isFunction(value) && options.window) {
|
|
639
|
+
clone2[key] = contentWindow.eval("(" + value.toString() + ")");
|
|
566
640
|
continue;
|
|
567
641
|
}
|
|
568
642
|
if (isObjectLike(value)) {
|
|
569
|
-
|
|
570
|
-
...options,
|
|
643
|
+
clone2[key] = deepClone(value, __spreadProps(__spreadValues({}, options), {
|
|
571
644
|
visited
|
|
572
|
-
});
|
|
645
|
+
}));
|
|
573
646
|
} else {
|
|
574
|
-
|
|
647
|
+
clone2[key] = value;
|
|
575
648
|
}
|
|
576
649
|
}
|
|
577
|
-
return
|
|
650
|
+
return clone2;
|
|
578
651
|
};
|
|
579
652
|
|
|
580
|
-
// ../../../domql/packages/utils/
|
|
653
|
+
// ../../../domql/packages/utils/dist/esm/env.js
|
|
654
|
+
var NODE_ENV = "development";
|
|
655
|
+
var isProduction = (env = NODE_ENV) => env === "production";
|
|
656
|
+
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
657
|
+
|
|
658
|
+
// ../../../domql/packages/utils/dist/esm/cookie.js
|
|
581
659
|
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
582
660
|
|
|
583
661
|
// ../../../domql/packages/event/dist/esm/keys.js
|
|
@@ -929,10 +1007,7 @@ var rgbToHSL = (r, g, b) => {
|
|
|
929
1007
|
const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
930
1008
|
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
|
|
931
1009
|
};
|
|
932
|
-
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
|
|
933
|
-
Math.min(k - 3, 9 - k, 1),
|
|
934
|
-
-1
|
|
935
|
-
)) => [f(0), f(8), f(4)];
|
|
1010
|
+
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)];
|
|
936
1011
|
var getColorShade = (col, amt) => {
|
|
937
1012
|
const num = parseInt(col, 16);
|
|
938
1013
|
let r = (num >> 16) + amt;
|
|
@@ -947,7 +1022,8 @@ var getColorShade = (col, amt) => {
|
|
|
947
1022
|
return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
|
|
948
1023
|
};
|
|
949
1024
|
var getRgbTone = (rgb, tone) => {
|
|
950
|
-
if (isString(rgb) && rgb.includes("rgb"))
|
|
1025
|
+
if (isString(rgb) && rgb.includes("rgb"))
|
|
1026
|
+
rgb = colorStringToRgbaArray(rgb).join(", ");
|
|
951
1027
|
if (isString(rgb)) rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
|
|
952
1028
|
if (isNumber(tone)) tone += "";
|
|
953
1029
|
const toHex = rgbArrayToHex(rgb);
|
|
@@ -967,6 +1043,9 @@ var getRgbTone = (rgb, tone) => {
|
|
|
967
1043
|
// src/utils/sequence.js
|
|
968
1044
|
var import_utils5 = __toESM(require_cjs(), 1);
|
|
969
1045
|
|
|
1046
|
+
// src/utils/sprite.js
|
|
1047
|
+
var isDev = isNotProduction();
|
|
1048
|
+
|
|
970
1049
|
// src/system/color.js
|
|
971
1050
|
var getColor = (value, key, config) => {
|
|
972
1051
|
const CONFIG2 = config || getActiveConfig();
|
|
@@ -1194,3 +1273,4 @@ var getMediaTheme = (value, modifier) => {
|
|
|
1194
1273
|
const resolvedTheme = recursiveTheme(themeValue);
|
|
1195
1274
|
return resolvedTheme;
|
|
1196
1275
|
};
|
|
1276
|
+
// @preserve-env
|