@symbo.ls/scratch 2.11.523 → 3.0.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/dist/cjs/factory.js +13 -20
- package/dist/cjs/index.js +193 -383
- package/dist/cjs/set.js +132 -282
- package/dist/cjs/system/color.js +61 -142
- package/dist/cjs/system/document.js +28 -84
- package/dist/cjs/system/font.js +29 -88
- package/dist/cjs/system/index.js +135 -285
- package/dist/cjs/system/reset.js +35 -98
- package/dist/cjs/system/shadow.js +77 -173
- package/dist/cjs/system/spacing.js +41 -112
- package/dist/cjs/system/svg.js +34 -94
- package/dist/cjs/system/theme.js +74 -168
- package/dist/cjs/system/timing.js +33 -96
- package/dist/cjs/system/typography.js +41 -110
- package/dist/cjs/transforms/index.js +112 -228
- package/dist/cjs/utils/color.js +22 -85
- package/dist/cjs/utils/font.js +3 -6
- package/dist/cjs/utils/index.js +67 -155
- package/dist/cjs/utils/sequence.js +34 -58
- package/dist/cjs/utils/sprite.js +13 -20
- package/dist/cjs/utils/theme.js +3 -6
- package/dist/cjs/utils/var.js +27 -45
- package/package.json +3 -3
- package/src/system/svg.js +1 -1
- package/src/transforms/index.js +9 -2
- package/src/utils/color.js +1 -2
- package/src/utils/sequence.js +1 -1
|
@@ -51,8 +51,8 @@ var require_cjs = __commonJS({
|
|
|
51
51
|
return to;
|
|
52
52
|
};
|
|
53
53
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
|
|
54
|
-
var
|
|
55
|
-
__export2(
|
|
54
|
+
var index_exports = {};
|
|
55
|
+
__export2(index_exports, {
|
|
56
56
|
arrayzeValue: () => arrayzeValue2,
|
|
57
57
|
copyJavaScriptToClipboard: () => copyJavaScriptToClipboard,
|
|
58
58
|
copyStringToClipboard: () => copyStringToClipboard,
|
|
@@ -73,12 +73,11 @@ var require_cjs = __commonJS({
|
|
|
73
73
|
toTitleCase: () => toTitleCase,
|
|
74
74
|
toggleFullscreen: () => toggleFullscreen
|
|
75
75
|
});
|
|
76
|
-
module2.exports = __toCommonJS2(
|
|
76
|
+
module2.exports = __toCommonJS2(index_exports);
|
|
77
77
|
var window22 = globalThis;
|
|
78
78
|
var document22 = window22.document;
|
|
79
79
|
var isObject2 = (arg) => {
|
|
80
|
-
if (arg === null)
|
|
81
|
-
return false;
|
|
80
|
+
if (arg === null) return false;
|
|
82
81
|
return typeof arg === "object" && arg.constructor === Object;
|
|
83
82
|
};
|
|
84
83
|
var isString2 = (arg) => typeof arg === "string";
|
|
@@ -103,13 +102,11 @@ var require_cjs = __commonJS({
|
|
|
103
102
|
};
|
|
104
103
|
var findClosestNumberInFactory = (val, factory) => {
|
|
105
104
|
val = parseFloat(val);
|
|
106
|
-
if (isObject2(factory))
|
|
107
|
-
factory = Object.values(factory);
|
|
105
|
+
if (isObject2(factory)) factory = Object.values(factory);
|
|
108
106
|
return findClosestNumber(val, factory);
|
|
109
107
|
};
|
|
110
108
|
var formatDate = (timestamp) => {
|
|
111
|
-
if (!timestamp)
|
|
112
|
-
return "";
|
|
109
|
+
if (!timestamp) return "";
|
|
113
110
|
const d = new Date(timestamp);
|
|
114
111
|
const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
|
|
115
112
|
const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
|
|
@@ -176,8 +173,7 @@ var require_cjs = __commonJS({
|
|
|
176
173
|
scriptEle.type = type;
|
|
177
174
|
scriptEle.text = xhr.responseText;
|
|
178
175
|
doc.body.appendChild(scriptEle);
|
|
179
|
-
if (typeof fallback === "function")
|
|
180
|
-
fallback();
|
|
176
|
+
if (typeof fallback === "function") fallback();
|
|
181
177
|
} else {
|
|
182
178
|
throw new Error(`Failed to load the script ${FILE_URL}`);
|
|
183
179
|
}
|
|
@@ -245,60 +241,19 @@ var require_cjs = __commonJS({
|
|
|
245
241
|
);
|
|
246
242
|
var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
247
243
|
var toDescriptionCase = (str = "") => {
|
|
248
|
-
if (typeof str !== "string")
|
|
249
|
-
return;
|
|
244
|
+
if (typeof str !== "string") return;
|
|
250
245
|
const result = str.replace(/([A-Z])/g, " $1");
|
|
251
246
|
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
252
247
|
};
|
|
253
248
|
var arrayzeValue2 = (val) => {
|
|
254
|
-
if (isArray2(val))
|
|
255
|
-
|
|
256
|
-
if (
|
|
257
|
-
|
|
258
|
-
if (isObject2(val))
|
|
259
|
-
return Object.values(val);
|
|
260
|
-
if (isNumber2(val))
|
|
261
|
-
return [val];
|
|
249
|
+
if (isArray2(val)) return val;
|
|
250
|
+
if (isString2(val)) return val.split(" ");
|
|
251
|
+
if (isObject2(val)) return Object.values(val);
|
|
252
|
+
if (isNumber2(val)) return [val];
|
|
262
253
|
};
|
|
263
254
|
}
|
|
264
255
|
});
|
|
265
256
|
|
|
266
|
-
// ../../node_modules/@domql/globals/dist/cjs/index.js
|
|
267
|
-
var require_cjs2 = __commonJS({
|
|
268
|
-
"../../node_modules/@domql/globals/dist/cjs/index.js"(exports, module2) {
|
|
269
|
-
"use strict";
|
|
270
|
-
var __defProp3 = Object.defineProperty;
|
|
271
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
272
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
273
|
-
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
274
|
-
var __export2 = (target, all) => {
|
|
275
|
-
for (var name in all)
|
|
276
|
-
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
277
|
-
};
|
|
278
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
279
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
280
|
-
for (let key of __getOwnPropNames2(from))
|
|
281
|
-
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
282
|
-
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
283
|
-
}
|
|
284
|
-
return to;
|
|
285
|
-
};
|
|
286
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
|
|
287
|
-
var globals_exports = {};
|
|
288
|
-
__export2(globals_exports, {
|
|
289
|
-
document: () => document4,
|
|
290
|
-
global: () => global,
|
|
291
|
-
self: () => self,
|
|
292
|
-
window: () => window4
|
|
293
|
-
});
|
|
294
|
-
module2.exports = __toCommonJS2(globals_exports);
|
|
295
|
-
var global = globalThis;
|
|
296
|
-
var self = globalThis;
|
|
297
|
-
var window4 = globalThis;
|
|
298
|
-
var document4 = window4.document;
|
|
299
|
-
}
|
|
300
|
-
});
|
|
301
|
-
|
|
302
257
|
// src/system/spacing.js
|
|
303
258
|
var spacing_exports = {};
|
|
304
259
|
__export(spacing_exports, {
|
|
@@ -309,35 +264,34 @@ __export(spacing_exports, {
|
|
|
309
264
|
module.exports = __toCommonJS(spacing_exports);
|
|
310
265
|
var import_utils7 = __toESM(require_cjs(), 1);
|
|
311
266
|
|
|
312
|
-
//
|
|
267
|
+
// node_modules/@domql/utils/dist/esm/globals.js
|
|
313
268
|
var window2 = globalThis;
|
|
314
269
|
var document2 = window2.document;
|
|
315
270
|
|
|
316
|
-
//
|
|
271
|
+
// node_modules/@domql/utils/dist/esm/node.js
|
|
317
272
|
var isDOMNode = (obj) => {
|
|
318
273
|
return typeof window2 !== "undefined" && (obj instanceof window2.Node || obj instanceof window2.Window || obj === window2 || obj === document);
|
|
319
274
|
};
|
|
320
275
|
|
|
321
|
-
//
|
|
276
|
+
// node_modules/@domql/utils/dist/esm/types.js
|
|
322
277
|
var isString = (arg) => typeof arg === "string";
|
|
323
278
|
var isFunction = (arg) => typeof arg === "function";
|
|
324
279
|
var isNull = (arg) => arg === null;
|
|
325
280
|
var isArray = (arg) => Array.isArray(arg);
|
|
326
281
|
var isObjectLike = (arg) => {
|
|
327
|
-
if (arg === null)
|
|
328
|
-
return false;
|
|
282
|
+
if (arg === null) return false;
|
|
329
283
|
return typeof arg === "object";
|
|
330
284
|
};
|
|
331
285
|
var isUndefined = (arg) => {
|
|
332
286
|
return arg === void 0;
|
|
333
287
|
};
|
|
334
288
|
|
|
335
|
-
//
|
|
289
|
+
// node_modules/@domql/utils/dist/esm/array.js
|
|
336
290
|
var mergeArray = (arr, exclude = []) => {
|
|
337
291
|
return arr.reduce((a, c) => deepMerge(a, deepClone(c, { exclude }), exclude), {});
|
|
338
292
|
};
|
|
339
293
|
|
|
340
|
-
//
|
|
294
|
+
// node_modules/@domql/utils/dist/esm/object.js
|
|
341
295
|
var __defProp2 = Object.defineProperty;
|
|
342
296
|
var __defProps = Object.defineProperties;
|
|
343
297
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
@@ -360,8 +314,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
360
314
|
var merge = (element, obj, excludeFrom = []) => {
|
|
361
315
|
for (const e in obj) {
|
|
362
316
|
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
|
|
363
|
-
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
364
|
-
continue;
|
|
317
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) continue;
|
|
365
318
|
const elementProp = element[e];
|
|
366
319
|
const objProp = obj[e];
|
|
367
320
|
if (elementProp === void 0) {
|
|
@@ -373,8 +326,7 @@ var merge = (element, obj, excludeFrom = []) => {
|
|
|
373
326
|
var deepMerge = (element, extend, excludeFrom = []) => {
|
|
374
327
|
for (const e in extend) {
|
|
375
328
|
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
|
|
376
|
-
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
377
|
-
continue;
|
|
329
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) continue;
|
|
378
330
|
const elementProp = element[e];
|
|
379
331
|
const extendProp = extend[e];
|
|
380
332
|
if (isObjectLike(elementProp) && isObjectLike(extendProp)) {
|
|
@@ -403,13 +355,10 @@ var deepClone = (obj, options = {}) => {
|
|
|
403
355
|
const clone2 = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
|
|
404
356
|
visited.set(obj, clone2);
|
|
405
357
|
for (const key in obj) {
|
|
406
|
-
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
407
|
-
|
|
408
|
-
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
409
|
-
continue;
|
|
358
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
|
|
359
|
+
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__") continue;
|
|
410
360
|
const value = obj[key];
|
|
411
|
-
if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value))
|
|
412
|
-
continue;
|
|
361
|
+
if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value)) continue;
|
|
413
362
|
if (isDOMNode(value)) {
|
|
414
363
|
clone2[key] = value;
|
|
415
364
|
continue;
|
|
@@ -433,7 +382,7 @@ var deepClone = (obj, options = {}) => {
|
|
|
433
382
|
return clone2;
|
|
434
383
|
};
|
|
435
384
|
|
|
436
|
-
//
|
|
385
|
+
// node_modules/@domql/utils/dist/esm/cookie.js
|
|
437
386
|
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
438
387
|
|
|
439
388
|
// src/defaultConfig/index.js
|
|
@@ -662,9 +611,6 @@ var isScalingUnit = (unit) => {
|
|
|
662
611
|
return unit === "em" || unit === "rem" || unit === "vw" || unit === "vh" || unit === "vmax" || unit === "vmin";
|
|
663
612
|
};
|
|
664
613
|
|
|
665
|
-
// src/utils/color.js
|
|
666
|
-
var import_globals4 = __toESM(require_cjs2(), 1);
|
|
667
|
-
|
|
668
614
|
// src/utils/sequence.js
|
|
669
615
|
var import_utils4 = __toESM(require_cjs(), 1);
|
|
670
616
|
var numToLetterMap = {
|
|
@@ -712,8 +658,7 @@ var setSequenceValue = (props, sequenceProps) => {
|
|
|
712
658
|
var setScalingVar = (key, sequenceProps) => {
|
|
713
659
|
const { base, type, unit } = sequenceProps;
|
|
714
660
|
const defaultVal = (isScalingUnit(unit) ? 1 : base) + unit;
|
|
715
|
-
if (key === 0)
|
|
716
|
-
return defaultVal;
|
|
661
|
+
if (key === 0) return defaultVal;
|
|
717
662
|
const prefix = "--" + (type && type.replace(".", "-"));
|
|
718
663
|
const ratioVar = `${prefix}-ratio`;
|
|
719
664
|
if (key > 0) {
|
|
@@ -750,10 +695,8 @@ var generateSubSequence = (props, sequenceProps) => {
|
|
|
750
695
|
const diffRounded = ~~next - ~~value;
|
|
751
696
|
let arr;
|
|
752
697
|
const [first, middle, second] = getSubratioDifference(value, ratio);
|
|
753
|
-
if (diffRounded > 16)
|
|
754
|
-
|
|
755
|
-
else
|
|
756
|
-
arr = [first, second];
|
|
698
|
+
if (diffRounded > 16) arr = [first, middle, second];
|
|
699
|
+
else arr = [first, second];
|
|
757
700
|
arr.forEach((v, k) => {
|
|
758
701
|
const scaling = ~~(v / base * 1e3) / 1e3;
|
|
759
702
|
const newVar = variable + (k + 1);
|
|
@@ -795,8 +738,7 @@ var generateSequence = (sequenceProps) => {
|
|
|
795
738
|
index: key
|
|
796
739
|
};
|
|
797
740
|
setSequenceValue(props, sequenceProps);
|
|
798
|
-
if (subSequence)
|
|
799
|
-
generateSubSequence(props, sequenceProps);
|
|
741
|
+
if (subSequence) generateSubSequence(props, sequenceProps);
|
|
800
742
|
}
|
|
801
743
|
return sequenceProps;
|
|
802
744
|
};
|
|
@@ -808,13 +750,11 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
808
750
|
unit = UNIT2.default,
|
|
809
751
|
useVariable
|
|
810
752
|
} = sequenceProps;
|
|
811
|
-
if (isString(value) && value.slice(0, 2) === "--")
|
|
812
|
-
return `var(${value})`;
|
|
753
|
+
if (isString(value) && value.slice(0, 2) === "--") return `var(${value})`;
|
|
813
754
|
const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
|
|
814
755
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
815
756
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
816
|
-
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
817
|
-
return value;
|
|
757
|
+
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter) return value;
|
|
818
758
|
const letterVal = value.toUpperCase();
|
|
819
759
|
const isNegative = letterVal.slice(0, 1) === "-" ? "-" : "";
|
|
820
760
|
let absValue = isNegative ? letterVal.slice(1) : letterVal;
|
|
@@ -838,8 +778,7 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
838
778
|
return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
|
|
839
779
|
}
|
|
840
780
|
if (!sequence[absValue] && absValue.length === 2) {
|
|
841
|
-
if (CONFIG2.verbose)
|
|
842
|
-
console.warn(absValue, "- value is not found because `subSequence` is set to false");
|
|
781
|
+
if (CONFIG2.verbose) console.warn(absValue, "- value is not found because `subSequence` is set to false");
|
|
843
782
|
absValue = absValue.slice(0, 1);
|
|
844
783
|
}
|
|
845
784
|
if (useVariable || CONFIG2.useVariable) {
|
|
@@ -847,8 +786,7 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
847
786
|
return isNegative ? `calc(${varValue2} * -1)` : varValue2;
|
|
848
787
|
}
|
|
849
788
|
const sequenceItem = sequence ? sequence[absValue] : null;
|
|
850
|
-
if (!sequenceItem)
|
|
851
|
-
return console.warn("can't find", sequence, absValue);
|
|
789
|
+
if (!sequenceItem) return console.warn("can't find", sequence, absValue);
|
|
852
790
|
if (unit === "ms" || unit === "s") {
|
|
853
791
|
return isNegative + sequenceItem.val + unit;
|
|
854
792
|
}
|
|
@@ -857,12 +795,10 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
857
795
|
var getSequenceValuePropertyPair = (value, propertyName, sequenceProps) => {
|
|
858
796
|
if (typeof value !== "string") {
|
|
859
797
|
const CONFIG2 = getActiveConfig();
|
|
860
|
-
if (CONFIG2.verbose)
|
|
861
|
-
console.warn(propertyName, value, "is not a string");
|
|
798
|
+
if (CONFIG2.verbose) console.warn(propertyName, value, "is not a string");
|
|
862
799
|
return { [propertyName]: value };
|
|
863
800
|
}
|
|
864
|
-
if (value === "-" || value === "")
|
|
865
|
-
return {};
|
|
801
|
+
if (value === "-" || value === "") return {};
|
|
866
802
|
return { [propertyName]: getSequenceValue(value, sequenceProps) };
|
|
867
803
|
};
|
|
868
804
|
|
|
@@ -914,23 +850,19 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
914
850
|
const { mediaRegenerate } = FACTORY2;
|
|
915
851
|
const { sequence, scales } = FACTORY2[media];
|
|
916
852
|
const query = MEDIA2[mediaName];
|
|
917
|
-
if (!query && CONFIG2.verbose)
|
|
918
|
-
console.warn("Can't find media query ", query);
|
|
853
|
+
if (!query && CONFIG2.verbose) console.warn("Can't find media query ", query);
|
|
919
854
|
if (!mediaRegenerate) {
|
|
920
855
|
let underMediaQuery = CSS_VARS2[`@media ${query}`];
|
|
921
|
-
if (!underMediaQuery)
|
|
922
|
-
underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
|
|
856
|
+
if (!underMediaQuery) underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
|
|
923
857
|
applySequenceGlobalVars(underMediaQuery, FACTORY2[media], options);
|
|
924
858
|
return;
|
|
925
859
|
}
|
|
926
860
|
for (const key in sequence) {
|
|
927
861
|
const item = sequence[key];
|
|
928
862
|
const value = (isScalingUnit(unit) ? scales[key] : sequence[key].val) + unit;
|
|
929
|
-
if (!query && CONFIG2.verbose)
|
|
930
|
-
console.warn("Can't find query ", query);
|
|
863
|
+
if (!query && CONFIG2.verbose) console.warn("Can't find query ", query);
|
|
931
864
|
let underMediaQuery = CSS_VARS2[`@media ${query}`];
|
|
932
|
-
if (!underMediaQuery)
|
|
933
|
-
underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
|
|
865
|
+
if (!underMediaQuery) underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
|
|
934
866
|
underMediaQuery[item.variable] = `var(${item.variable + "_" + mediaName})`;
|
|
935
867
|
CSS_VARS2[item.variable + "_" + mediaName] = value;
|
|
936
868
|
}
|
|
@@ -941,8 +873,7 @@ var runThroughMedia = (FACTORY2) => {
|
|
|
941
873
|
for (const prop in FACTORY2) {
|
|
942
874
|
const mediaProps = FACTORY2[prop];
|
|
943
875
|
const isMediaName = prop.slice(0, 1) === "@";
|
|
944
|
-
if (!isMediaName)
|
|
945
|
-
continue;
|
|
876
|
+
if (!isMediaName) continue;
|
|
946
877
|
const {
|
|
947
878
|
type,
|
|
948
879
|
base,
|
|
@@ -979,8 +910,7 @@ var applySpacingSequence = () => {
|
|
|
979
910
|
var getSequence = (sequenceProps) => {
|
|
980
911
|
const CONFIG2 = getActiveConfig();
|
|
981
912
|
const { SPACING: SPACING2 } = CONFIG2;
|
|
982
|
-
if (!sequenceProps)
|
|
983
|
-
return SPACING2;
|
|
913
|
+
if (!sequenceProps) return SPACING2;
|
|
984
914
|
const hasGenerated = Object.keys(sequenceProps.sequence).length > 0;
|
|
985
915
|
return hasGenerated ? sequenceProps : generateSequence(sequenceProps);
|
|
986
916
|
};
|
|
@@ -990,8 +920,7 @@ var getSpacingByKey = (value, propertyName = "padding", sequenceProps) => {
|
|
|
990
920
|
return { [propertyName]: value };
|
|
991
921
|
}
|
|
992
922
|
const stack = (0, import_utils7.arrayzeValue)(value);
|
|
993
|
-
if (!isArray(stack))
|
|
994
|
-
return;
|
|
923
|
+
if (!isArray(stack)) return;
|
|
995
924
|
if (stack.length > 1) {
|
|
996
925
|
let suffix = "";
|
|
997
926
|
if (propertyName === "borderWidth") {
|
package/dist/cjs/system/svg.js
CHANGED
|
@@ -30,44 +30,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
// ../../node_modules/@domql/globals/dist/cjs/index.js
|
|
34
|
-
var require_cjs = __commonJS({
|
|
35
|
-
"../../node_modules/@domql/globals/dist/cjs/index.js"(exports, module2) {
|
|
36
|
-
"use strict";
|
|
37
|
-
var __defProp3 = Object.defineProperty;
|
|
38
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
39
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
40
|
-
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
41
|
-
var __export2 = (target, all) => {
|
|
42
|
-
for (var name in all)
|
|
43
|
-
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
44
|
-
};
|
|
45
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
46
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
47
|
-
for (let key of __getOwnPropNames2(from))
|
|
48
|
-
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
49
|
-
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
50
|
-
}
|
|
51
|
-
return to;
|
|
52
|
-
};
|
|
53
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
|
|
54
|
-
var globals_exports = {};
|
|
55
|
-
__export2(globals_exports, {
|
|
56
|
-
document: () => document5,
|
|
57
|
-
global: () => global,
|
|
58
|
-
self: () => self,
|
|
59
|
-
window: () => window4
|
|
60
|
-
});
|
|
61
|
-
module2.exports = __toCommonJS2(globals_exports);
|
|
62
|
-
var global = globalThis;
|
|
63
|
-
var self = globalThis;
|
|
64
|
-
var window4 = globalThis;
|
|
65
|
-
var document5 = window4.document;
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
|
|
69
33
|
// ../utils/dist/cjs/index.js
|
|
70
|
-
var
|
|
34
|
+
var require_cjs = __commonJS({
|
|
71
35
|
"../utils/dist/cjs/index.js"(exports, module2) {
|
|
72
36
|
"use strict";
|
|
73
37
|
var __defProp3 = Object.defineProperty;
|
|
@@ -87,8 +51,8 @@ var require_cjs2 = __commonJS({
|
|
|
87
51
|
return to;
|
|
88
52
|
};
|
|
89
53
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
|
|
90
|
-
var
|
|
91
|
-
__export2(
|
|
54
|
+
var index_exports = {};
|
|
55
|
+
__export2(index_exports, {
|
|
92
56
|
arrayzeValue: () => arrayzeValue,
|
|
93
57
|
copyJavaScriptToClipboard: () => copyJavaScriptToClipboard,
|
|
94
58
|
copyStringToClipboard: () => copyStringToClipboard,
|
|
@@ -109,12 +73,11 @@ var require_cjs2 = __commonJS({
|
|
|
109
73
|
toTitleCase: () => toTitleCase,
|
|
110
74
|
toggleFullscreen: () => toggleFullscreen
|
|
111
75
|
});
|
|
112
|
-
module2.exports = __toCommonJS2(
|
|
76
|
+
module2.exports = __toCommonJS2(index_exports);
|
|
113
77
|
var window22 = globalThis;
|
|
114
78
|
var document22 = window22.document;
|
|
115
79
|
var isObject2 = (arg) => {
|
|
116
|
-
if (arg === null)
|
|
117
|
-
return false;
|
|
80
|
+
if (arg === null) return false;
|
|
118
81
|
return typeof arg === "object" && arg.constructor === Object;
|
|
119
82
|
};
|
|
120
83
|
var isString2 = (arg) => typeof arg === "string";
|
|
@@ -139,13 +102,11 @@ var require_cjs2 = __commonJS({
|
|
|
139
102
|
};
|
|
140
103
|
var findClosestNumberInFactory = (val, factory) => {
|
|
141
104
|
val = parseFloat(val);
|
|
142
|
-
if (isObject2(factory))
|
|
143
|
-
factory = Object.values(factory);
|
|
105
|
+
if (isObject2(factory)) factory = Object.values(factory);
|
|
144
106
|
return findClosestNumber(val, factory);
|
|
145
107
|
};
|
|
146
108
|
var formatDate = (timestamp) => {
|
|
147
|
-
if (!timestamp)
|
|
148
|
-
return "";
|
|
109
|
+
if (!timestamp) return "";
|
|
149
110
|
const d = new Date(timestamp);
|
|
150
111
|
const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
|
|
151
112
|
const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
|
|
@@ -212,8 +173,7 @@ var require_cjs2 = __commonJS({
|
|
|
212
173
|
scriptEle.type = type;
|
|
213
174
|
scriptEle.text = xhr.responseText;
|
|
214
175
|
doc.body.appendChild(scriptEle);
|
|
215
|
-
if (typeof fallback === "function")
|
|
216
|
-
fallback();
|
|
176
|
+
if (typeof fallback === "function") fallback();
|
|
217
177
|
} else {
|
|
218
178
|
throw new Error(`Failed to load the script ${FILE_URL}`);
|
|
219
179
|
}
|
|
@@ -281,20 +241,15 @@ var require_cjs2 = __commonJS({
|
|
|
281
241
|
);
|
|
282
242
|
var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
283
243
|
var toDescriptionCase = (str = "") => {
|
|
284
|
-
if (typeof str !== "string")
|
|
285
|
-
return;
|
|
244
|
+
if (typeof str !== "string") return;
|
|
286
245
|
const result = str.replace(/([A-Z])/g, " $1");
|
|
287
246
|
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
288
247
|
};
|
|
289
248
|
var arrayzeValue = (val) => {
|
|
290
|
-
if (isArray2(val))
|
|
291
|
-
|
|
292
|
-
if (
|
|
293
|
-
|
|
294
|
-
if (isObject2(val))
|
|
295
|
-
return Object.values(val);
|
|
296
|
-
if (isNumber2(val))
|
|
297
|
-
return [val];
|
|
249
|
+
if (isArray2(val)) return val;
|
|
250
|
+
if (isString2(val)) return val.split(" ");
|
|
251
|
+
if (isObject2(val)) return Object.values(val);
|
|
252
|
+
if (isNumber2(val)) return [val];
|
|
298
253
|
};
|
|
299
254
|
}
|
|
300
255
|
});
|
|
@@ -308,40 +263,35 @@ __export(svg_exports, {
|
|
|
308
263
|
setSvgIcon: () => setSvgIcon
|
|
309
264
|
});
|
|
310
265
|
module.exports = __toCommonJS(svg_exports);
|
|
311
|
-
var import_globals5 = __toESM(require_cjs(), 1);
|
|
312
266
|
|
|
313
|
-
//
|
|
314
|
-
var import_globals4 = __toESM(require_cjs(), 1);
|
|
315
|
-
|
|
316
|
-
// ../../node_modules/@domql/utils/dist/esm/globals.js
|
|
267
|
+
// node_modules/@domql/utils/dist/esm/globals.js
|
|
317
268
|
var window2 = globalThis;
|
|
318
269
|
var document2 = window2.document;
|
|
319
270
|
|
|
320
|
-
//
|
|
271
|
+
// node_modules/@domql/utils/dist/esm/node.js
|
|
321
272
|
var isDOMNode = (obj) => {
|
|
322
273
|
return typeof window2 !== "undefined" && (obj instanceof window2.Node || obj instanceof window2.Window || obj === window2 || obj === document);
|
|
323
274
|
};
|
|
324
275
|
|
|
325
|
-
//
|
|
276
|
+
// node_modules/@domql/utils/dist/esm/types.js
|
|
326
277
|
var isString = (arg) => typeof arg === "string";
|
|
327
278
|
var isFunction = (arg) => typeof arg === "function";
|
|
328
279
|
var isNull = (arg) => arg === null;
|
|
329
280
|
var isArray = (arg) => Array.isArray(arg);
|
|
330
281
|
var isObjectLike = (arg) => {
|
|
331
|
-
if (arg === null)
|
|
332
|
-
return false;
|
|
282
|
+
if (arg === null) return false;
|
|
333
283
|
return typeof arg === "object";
|
|
334
284
|
};
|
|
335
285
|
var isUndefined = (arg) => {
|
|
336
286
|
return arg === void 0;
|
|
337
287
|
};
|
|
338
288
|
|
|
339
|
-
//
|
|
289
|
+
// node_modules/@domql/utils/dist/esm/array.js
|
|
340
290
|
var mergeArray = (arr, exclude = []) => {
|
|
341
291
|
return arr.reduce((a, c) => deepMerge(a, deepClone(c, { exclude }), exclude), {});
|
|
342
292
|
};
|
|
343
293
|
|
|
344
|
-
//
|
|
294
|
+
// node_modules/@domql/utils/dist/esm/object.js
|
|
345
295
|
var __defProp2 = Object.defineProperty;
|
|
346
296
|
var __defProps = Object.defineProperties;
|
|
347
297
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
@@ -364,8 +314,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
364
314
|
var deepMerge = (element, extend, excludeFrom = []) => {
|
|
365
315
|
for (const e in extend) {
|
|
366
316
|
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
|
|
367
|
-
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
368
|
-
continue;
|
|
317
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) continue;
|
|
369
318
|
const elementProp = element[e];
|
|
370
319
|
const extendProp = extend[e];
|
|
371
320
|
if (isObjectLike(elementProp) && isObjectLike(extendProp)) {
|
|
@@ -394,13 +343,10 @@ var deepClone = (obj, options = {}) => {
|
|
|
394
343
|
const clone2 = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
|
|
395
344
|
visited.set(obj, clone2);
|
|
396
345
|
for (const key in obj) {
|
|
397
|
-
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
398
|
-
|
|
399
|
-
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
400
|
-
continue;
|
|
346
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
|
|
347
|
+
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__") continue;
|
|
401
348
|
const value = obj[key];
|
|
402
|
-
if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value))
|
|
403
|
-
continue;
|
|
349
|
+
if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value)) continue;
|
|
404
350
|
if (isDOMNode(value)) {
|
|
405
351
|
clone2[key] = value;
|
|
406
352
|
continue;
|
|
@@ -424,11 +370,11 @@ var deepClone = (obj, options = {}) => {
|
|
|
424
370
|
return clone2;
|
|
425
371
|
};
|
|
426
372
|
|
|
427
|
-
//
|
|
373
|
+
// node_modules/@domql/utils/dist/esm/cookie.js
|
|
428
374
|
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
429
375
|
|
|
430
376
|
// src/utils/sequence.js
|
|
431
|
-
var import_utils4 = __toESM(
|
|
377
|
+
var import_utils4 = __toESM(require_cjs(), 1);
|
|
432
378
|
|
|
433
379
|
// src/defaultConfig/index.js
|
|
434
380
|
var defaultConfig_exports = {};
|
|
@@ -656,10 +602,8 @@ var generateSprite = (icons) => {
|
|
|
656
602
|
const CONFIG2 = getActiveConfig();
|
|
657
603
|
let sprite = "";
|
|
658
604
|
for (const key in icons) {
|
|
659
|
-
if (CONFIG2.__svg_cache[key])
|
|
660
|
-
|
|
661
|
-
else
|
|
662
|
-
CONFIG2.__svg_cache[key] = true;
|
|
605
|
+
if (CONFIG2.__svg_cache[key]) continue;
|
|
606
|
+
else CONFIG2.__svg_cache[key] = true;
|
|
663
607
|
sprite += icons[key];
|
|
664
608
|
}
|
|
665
609
|
return sprite;
|
|
@@ -712,13 +656,12 @@ var convertSvgToSymbol = (key, code) => {
|
|
|
712
656
|
|
|
713
657
|
// src/system/svg.js
|
|
714
658
|
var DEF_OPTIONS = {
|
|
715
|
-
document:
|
|
659
|
+
document: document2
|
|
716
660
|
};
|
|
717
661
|
var setSVG = (val, key) => {
|
|
718
662
|
const CONFIG2 = getActiveConfig();
|
|
719
663
|
if (!val) {
|
|
720
|
-
if (CONFIG2.verbose)
|
|
721
|
-
console.warn("setSVG: val is not defined", key);
|
|
664
|
+
if (CONFIG2.verbose) console.warn("setSVG: val is not defined", key);
|
|
722
665
|
return;
|
|
723
666
|
}
|
|
724
667
|
if (CONFIG2.useSvgSprite) {
|
|
@@ -729,8 +672,7 @@ var setSVG = (val, key) => {
|
|
|
729
672
|
var appendSVGSprite = (LIBRARY, options = DEF_OPTIONS) => {
|
|
730
673
|
const CONFIG2 = getActiveConfig();
|
|
731
674
|
const lib = Object.keys(LIBRARY).length ? {} : CONFIG2.SVG;
|
|
732
|
-
for (const key in LIBRARY)
|
|
733
|
-
lib[key] = CONFIG2.SVG[key];
|
|
675
|
+
for (const key in LIBRARY) lib[key] = CONFIG2.SVG[key];
|
|
734
676
|
appendSVG(lib, options);
|
|
735
677
|
};
|
|
736
678
|
var setSvgIcon = (val, key) => {
|
|
@@ -744,14 +686,12 @@ var setSvgIcon = (val, key) => {
|
|
|
744
686
|
var appendSvgIconsSprite = (LIBRARY, options = DEF_OPTIONS) => {
|
|
745
687
|
const CONFIG2 = getActiveConfig();
|
|
746
688
|
const lib = Object.keys(LIBRARY).length ? {} : CONFIG2.ICONS;
|
|
747
|
-
for (const key in LIBRARY)
|
|
748
|
-
lib[key] = CONFIG2.ICONS[key];
|
|
689
|
+
for (const key in LIBRARY) lib[key] = CONFIG2.ICONS[key];
|
|
749
690
|
appendSVG(lib, options);
|
|
750
691
|
};
|
|
751
692
|
var createSVGSpriteElement = (options = { isRoot: true }) => {
|
|
752
|
-
if (!
|
|
753
|
-
|
|
754
|
-
const svgElem = import_globals5.document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
693
|
+
if (!document2 || !document2.createElementNS) return;
|
|
694
|
+
const svgElem = document2.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
755
695
|
if (options.isRoot) {
|
|
756
696
|
svgElem.setAttribute("aria-hidden", "true");
|
|
757
697
|
svgElem.setAttribute("width", "0");
|
|
@@ -763,7 +703,7 @@ var createSVGSpriteElement = (options = { isRoot: true }) => {
|
|
|
763
703
|
};
|
|
764
704
|
var appendSVG = (lib, options = DEF_OPTIONS) => {
|
|
765
705
|
const CONFIG2 = getActiveConfig();
|
|
766
|
-
const doc = options.document ||
|
|
706
|
+
const doc = options.document || document2;
|
|
767
707
|
if (!doc || !doc.documentElement) {
|
|
768
708
|
if (CONFIG2.verbose) {
|
|
769
709
|
console.warn("To append SVG sprites it should be run in browser environment");
|