@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: () => 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: () => toCamelCase2,
|
|
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(timing_exports, {
|
|
|
404
458
|
module.exports = __toCommonJS(timing_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 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
|
|
@@ -1108,6 +1186,9 @@ var applySequenceVars = (FACTORY2, options = {}) => {
|
|
|
1108
1186
|
}
|
|
1109
1187
|
};
|
|
1110
1188
|
|
|
1189
|
+
// src/utils/sprite.js
|
|
1190
|
+
var isDev = isNotProduction();
|
|
1191
|
+
|
|
1111
1192
|
// src/system/timing.js
|
|
1112
1193
|
var applyTimingSequence = () => {
|
|
1113
1194
|
const CONFIG2 = 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: () => 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(typography_exports, {
|
|
|
404
458
|
});
|
|
405
459
|
module.exports = __toCommonJS(typography_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 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
|
|
@@ -1155,6 +1233,9 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
1155
1233
|
}
|
|
1156
1234
|
};
|
|
1157
1235
|
|
|
1236
|
+
// src/utils/sprite.js
|
|
1237
|
+
var isDev = isNotProduction();
|
|
1238
|
+
|
|
1158
1239
|
// src/system/typography.js
|
|
1159
1240
|
var runThroughMedia = (FACTORY2) => {
|
|
1160
1241
|
const CONFIG2 = getActiveConfig();
|
|
@@ -1165,15 +1246,7 @@ var runThroughMedia = (FACTORY2) => {
|
|
|
1165
1246
|
if (!isPropMedia) continue;
|
|
1166
1247
|
const { mediaRegenerate } = FACTORY2;
|
|
1167
1248
|
const mediaName = prop.slice(1);
|
|
1168
|
-
const {
|
|
1169
|
-
type,
|
|
1170
|
-
base,
|
|
1171
|
-
ratio,
|
|
1172
|
-
range,
|
|
1173
|
-
subSequence,
|
|
1174
|
-
h1Matches,
|
|
1175
|
-
unit
|
|
1176
|
-
} = FACTORY2;
|
|
1249
|
+
const { type, base, ratio, range, subSequence, h1Matches, unit } = FACTORY2;
|
|
1177
1250
|
merge(mediaValue, {
|
|
1178
1251
|
type,
|
|
1179
1252
|
base,
|
|
@@ -1203,7 +1276,7 @@ var runThroughMedia = (FACTORY2) => {
|
|
|
1203
1276
|
}
|
|
1204
1277
|
};
|
|
1205
1278
|
var applyHeadings = (props) => {
|
|
1206
|
-
var _a;
|
|
1279
|
+
var _a, _b;
|
|
1207
1280
|
const CONFIG2 = getActiveConfig();
|
|
1208
1281
|
if (props.h1Matches) {
|
|
1209
1282
|
const unit = props.unit;
|
|
@@ -1212,9 +1285,8 @@ var applyHeadings = (props) => {
|
|
|
1212
1285
|
for (const k in HEADINGS) {
|
|
1213
1286
|
const headerName = `h${parseInt(k) + 1}`;
|
|
1214
1287
|
const headerStyle = templates[headerName];
|
|
1215
|
-
if (!HEADINGS[k]) continue;
|
|
1216
1288
|
templates[headerName] = {
|
|
1217
|
-
fontSize: CONFIG2.useVariable ? `var(${(_a = HEADINGS[k]) == null ? void 0 : _a.variable})` : `${HEADINGS[k].scaling}${unit}`,
|
|
1289
|
+
fontSize: CONFIG2.useVariable ? `var(${(_a = HEADINGS[k]) == null ? void 0 : _a.variable})` : `${(_b = HEADINGS[k]) == null ? void 0 : _b.scaling}${unit}`,
|
|
1218
1290
|
margin: headerStyle ? headerStyle.margin : 0,
|
|
1219
1291
|
lineHeight: headerStyle ? headerStyle.lineHeight : props.lineHeight,
|
|
1220
1292
|
letterSpacing: headerStyle ? headerStyle.letterSpacing : props.letterSpacing,
|
|
@@ -1234,10 +1306,6 @@ var applyTypographySequence = () => {
|
|
|
1234
1306
|
var getFontSizeByKey = (value) => {
|
|
1235
1307
|
const CONFIG2 = getActiveConfig();
|
|
1236
1308
|
const { TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
|
|
1237
|
-
return getSequenceValuePropertyPair(
|
|
1238
|
-
value,
|
|
1239
|
-
"fontSize",
|
|
1240
|
-
TYPOGRAPHY2
|
|
1241
|
-
);
|
|
1309
|
+
return getSequenceValuePropertyPair(value, "fontSize", TYPOGRAPHY2);
|
|
1242
1310
|
};
|
|
1243
1311
|
// @preserve-env
|