@symbo.ls/scratch 2.11.375 → 2.11.394
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/defaultConfig/icons.js +3 -1
- package/dist/cjs/defaultConfig/index.js +2 -0
- package/dist/cjs/factory.js +35 -9
- package/dist/cjs/index.js +97 -24
- package/dist/cjs/set.js +91 -19
- package/dist/cjs/system/color.js +77 -13
- package/dist/cjs/system/document.js +77 -13
- package/dist/cjs/system/font.js +77 -13
- package/dist/cjs/system/index.js +83 -18
- package/dist/cjs/system/reset.js +77 -13
- package/dist/cjs/system/shadow.js +77 -13
- package/dist/cjs/system/spacing.js +77 -13
- package/dist/cjs/system/svg.js +84 -19
- package/dist/cjs/system/theme.js +77 -13
- package/dist/cjs/system/timing.js +77 -13
- package/dist/cjs/system/typography.js +77 -13
- package/dist/cjs/transforms/index.js +77 -13
- package/dist/cjs/utils/color.js +34 -10
- package/dist/cjs/utils/index.js +77 -13
- package/dist/cjs/utils/sequence.js +77 -13
- package/dist/cjs/utils/sprite.js +35 -9
- package/dist/cjs/utils/var.js +77 -13
- package/package.json +2 -2
- package/src/defaultConfig/icons.js +1 -0
- package/src/factory.js +1 -1
- package/src/set.js +8 -5
- package/src/system/svg.js +3 -3
package/dist/cjs/system/index.js
CHANGED
|
@@ -293,6 +293,7 @@ var require_array = __commonJS({
|
|
|
293
293
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
294
294
|
var array_exports = {};
|
|
295
295
|
__export2(array_exports, {
|
|
296
|
+
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
296
297
|
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
297
298
|
createNestedObject: () => createNestedObject,
|
|
298
299
|
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
@@ -304,6 +305,7 @@ var require_array = __commonJS({
|
|
|
304
305
|
removeFromArray: () => removeFromArray,
|
|
305
306
|
removeValueFromArray: () => removeValueFromArray,
|
|
306
307
|
removeValueFromArrayAll: () => removeValueFromArrayAll,
|
|
308
|
+
reorderArrayByValues: () => reorderArrayByValues,
|
|
307
309
|
swapItemsInArray: () => swapItemsInArray
|
|
308
310
|
});
|
|
309
311
|
module2.exports = __toCommonJS2(array_exports);
|
|
@@ -388,6 +390,27 @@ var require_array = __commonJS({
|
|
|
388
390
|
var removeValueFromArrayAll = (arr, value) => {
|
|
389
391
|
return arr.filter((item) => item !== value);
|
|
390
392
|
};
|
|
393
|
+
var addItemAfterEveryElement = (array, item) => {
|
|
394
|
+
const result = [];
|
|
395
|
+
for (let i = 0; i < array.length; i++) {
|
|
396
|
+
result.push(array[i]);
|
|
397
|
+
if (i < array.length - 1) {
|
|
398
|
+
result.push(item);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
return result;
|
|
402
|
+
};
|
|
403
|
+
var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
|
|
404
|
+
const newArray = [...array];
|
|
405
|
+
const indexToMove = newArray.indexOf(valueToMove);
|
|
406
|
+
const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
|
|
407
|
+
if (indexToMove !== -1 && indexToInsertBefore !== -1) {
|
|
408
|
+
const removedItem = newArray.splice(indexToMove, 1)[0];
|
|
409
|
+
const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
|
|
410
|
+
newArray.splice(insertIndex, 0, removedItem);
|
|
411
|
+
}
|
|
412
|
+
return newArray;
|
|
413
|
+
};
|
|
391
414
|
}
|
|
392
415
|
});
|
|
393
416
|
|
|
@@ -664,7 +687,7 @@ var require_object = __commonJS({
|
|
|
664
687
|
}
|
|
665
688
|
return stringified;
|
|
666
689
|
};
|
|
667
|
-
var objectToString = (obj, indent = 0) => {
|
|
690
|
+
var objectToString = (obj = {}, indent = 0) => {
|
|
668
691
|
const spaces = " ".repeat(indent);
|
|
669
692
|
let str = "{\n";
|
|
670
693
|
for (const [key, value] of Object.entries(obj)) {
|
|
@@ -731,7 +754,7 @@ var require_object = __commonJS({
|
|
|
731
754
|
continue;
|
|
732
755
|
const objProp = obj[prop];
|
|
733
756
|
if ((0, import_types.isString)(objProp)) {
|
|
734
|
-
if ((objProp.includes("=>") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
|
|
757
|
+
if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
|
|
735
758
|
try {
|
|
736
759
|
const evalProp = import_globals3.window.eval(`(${objProp})`);
|
|
737
760
|
destringified[prop] = evalProp;
|
|
@@ -1119,20 +1142,21 @@ var require_cookie = __commonJS({
|
|
|
1119
1142
|
});
|
|
1120
1143
|
module2.exports = __toCommonJS2(cookie_exports);
|
|
1121
1144
|
var import_types = require_types();
|
|
1145
|
+
var import_utils25 = require_cjs();
|
|
1122
1146
|
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
1123
1147
|
var setCookie = (cname, cvalue, exdays = 365) => {
|
|
1124
|
-
if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
|
|
1148
|
+
if ((0, import_types.isUndefined)(import_utils25.document) || (0, import_types.isUndefined)(import_utils25.document.cookie))
|
|
1125
1149
|
return;
|
|
1126
1150
|
const d = /* @__PURE__ */ new Date();
|
|
1127
1151
|
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
|
|
1128
1152
|
const expires = `expires=${d.toUTCString()}`;
|
|
1129
|
-
document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
1153
|
+
import_utils25.document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
1130
1154
|
};
|
|
1131
1155
|
var getCookie = (cname) => {
|
|
1132
|
-
if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
|
|
1156
|
+
if ((0, import_types.isUndefined)(import_utils25.document) || (0, import_types.isUndefined)(import_utils25.document.cookie))
|
|
1133
1157
|
return;
|
|
1134
1158
|
const name = `${cname}=`;
|
|
1135
|
-
const decodedCookie = decodeURIComponent(document.cookie);
|
|
1159
|
+
const decodedCookie = decodeURIComponent(import_utils25.document.cookie);
|
|
1136
1160
|
const ca = decodedCookie.split(";");
|
|
1137
1161
|
for (let i = 0; i < ca.length; i++) {
|
|
1138
1162
|
let c = ca[i];
|
|
@@ -1671,6 +1695,7 @@ var require_cjs3 = __commonJS({
|
|
|
1671
1695
|
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1672
1696
|
var array_exports = {};
|
|
1673
1697
|
__export22(array_exports, {
|
|
1698
|
+
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
1674
1699
|
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
1675
1700
|
createNestedObject: () => createNestedObject,
|
|
1676
1701
|
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
@@ -1682,6 +1707,7 @@ var require_cjs3 = __commonJS({
|
|
|
1682
1707
|
removeFromArray: () => removeFromArray,
|
|
1683
1708
|
removeValueFromArray: () => removeValueFromArray,
|
|
1684
1709
|
removeValueFromArrayAll: () => removeValueFromArrayAll,
|
|
1710
|
+
reorderArrayByValues: () => reorderArrayByValues,
|
|
1685
1711
|
swapItemsInArray: () => swapItemsInArray
|
|
1686
1712
|
});
|
|
1687
1713
|
module22.exports = __toCommonJS22(array_exports);
|
|
@@ -1766,6 +1792,27 @@ var require_cjs3 = __commonJS({
|
|
|
1766
1792
|
var removeValueFromArrayAll = (arr, value) => {
|
|
1767
1793
|
return arr.filter((item) => item !== value);
|
|
1768
1794
|
};
|
|
1795
|
+
var addItemAfterEveryElement = (array, item) => {
|
|
1796
|
+
const result = [];
|
|
1797
|
+
for (let i = 0; i < array.length; i++) {
|
|
1798
|
+
result.push(array[i]);
|
|
1799
|
+
if (i < array.length - 1) {
|
|
1800
|
+
result.push(item);
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
return result;
|
|
1804
|
+
};
|
|
1805
|
+
var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
|
|
1806
|
+
const newArray = [...array];
|
|
1807
|
+
const indexToMove = newArray.indexOf(valueToMove);
|
|
1808
|
+
const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
|
|
1809
|
+
if (indexToMove !== -1 && indexToInsertBefore !== -1) {
|
|
1810
|
+
const removedItem = newArray.splice(indexToMove, 1)[0];
|
|
1811
|
+
const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
|
|
1812
|
+
newArray.splice(insertIndex, 0, removedItem);
|
|
1813
|
+
}
|
|
1814
|
+
return newArray;
|
|
1815
|
+
};
|
|
1769
1816
|
}
|
|
1770
1817
|
});
|
|
1771
1818
|
var require_string2 = __commonJS2({
|
|
@@ -2038,7 +2085,7 @@ var require_cjs3 = __commonJS({
|
|
|
2038
2085
|
}
|
|
2039
2086
|
return stringified;
|
|
2040
2087
|
};
|
|
2041
|
-
var objectToString = (obj, indent = 0) => {
|
|
2088
|
+
var objectToString = (obj = {}, indent = 0) => {
|
|
2042
2089
|
const spaces = " ".repeat(indent);
|
|
2043
2090
|
let str = "{\n";
|
|
2044
2091
|
for (const [key, value] of Object.entries(obj)) {
|
|
@@ -2105,7 +2152,7 @@ var require_cjs3 = __commonJS({
|
|
|
2105
2152
|
continue;
|
|
2106
2153
|
const objProp = obj[prop];
|
|
2107
2154
|
if ((0, import_types.isString)(objProp)) {
|
|
2108
|
-
if ((objProp.includes("=>") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
|
|
2155
|
+
if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
|
|
2109
2156
|
try {
|
|
2110
2157
|
const evalProp = import_globals3.window.eval(`(${objProp})`);
|
|
2111
2158
|
destringified[prop] = evalProp;
|
|
@@ -2487,20 +2534,21 @@ var require_cjs3 = __commonJS({
|
|
|
2487
2534
|
});
|
|
2488
2535
|
module22.exports = __toCommonJS22(cookie_exports);
|
|
2489
2536
|
var import_types = require_types2();
|
|
2537
|
+
var import_utils32 = require_cjs4();
|
|
2490
2538
|
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
2491
2539
|
var setCookie = (cname, cvalue, exdays = 365) => {
|
|
2492
|
-
if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
|
|
2540
|
+
if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
|
|
2493
2541
|
return;
|
|
2494
2542
|
const d = /* @__PURE__ */ new Date();
|
|
2495
2543
|
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
|
|
2496
2544
|
const expires = `expires=${d.toUTCString()}`;
|
|
2497
|
-
document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
2545
|
+
import_utils32.document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
2498
2546
|
};
|
|
2499
2547
|
var getCookie = (cname) => {
|
|
2500
|
-
if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
|
|
2548
|
+
if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
|
|
2501
2549
|
return;
|
|
2502
2550
|
const name = `${cname}=`;
|
|
2503
|
-
const decodedCookie = decodeURIComponent(document.cookie);
|
|
2551
|
+
const decodedCookie = decodeURIComponent(import_utils32.document.cookie);
|
|
2504
2552
|
const ca = decodedCookie.split(";");
|
|
2505
2553
|
for (let i = 0; i < ca.length; i++) {
|
|
2506
2554
|
let c = ca[i];
|
|
@@ -2720,6 +2768,7 @@ var require_cjs3 = __commonJS({
|
|
|
2720
2768
|
findClosestNumber: () => findClosestNumber,
|
|
2721
2769
|
findClosestNumberInFactory: () => findClosestNumberInFactory,
|
|
2722
2770
|
formatDate: () => formatDate,
|
|
2771
|
+
loadJavascript: () => loadJavascript,
|
|
2723
2772
|
loadJavascriptFile: () => loadJavascriptFile,
|
|
2724
2773
|
removeChars: () => removeChars,
|
|
2725
2774
|
toCamelCase: () => toCamelCase2,
|
|
@@ -2791,6 +2840,17 @@ var require_cjs3 = __commonJS({
|
|
|
2791
2840
|
}
|
|
2792
2841
|
});
|
|
2793
2842
|
};
|
|
2843
|
+
var loadJavascript = (body, async = true, doc = document, type = "text/javascript") => {
|
|
2844
|
+
try {
|
|
2845
|
+
const scriptEle = doc.createElement("script");
|
|
2846
|
+
scriptEle.type = type;
|
|
2847
|
+
scriptEle.async = async;
|
|
2848
|
+
scriptEle.innerHTML = body;
|
|
2849
|
+
doc.body.appendChild(scriptEle);
|
|
2850
|
+
} catch (error) {
|
|
2851
|
+
console.warn(error);
|
|
2852
|
+
}
|
|
2853
|
+
};
|
|
2794
2854
|
var copyStringToClipboard = (str) => {
|
|
2795
2855
|
const el = document.createElement("textarea");
|
|
2796
2856
|
el.value = str;
|
|
@@ -2817,6 +2877,8 @@ var require_cjs3 = __commonJS({
|
|
|
2817
2877
|
);
|
|
2818
2878
|
var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
2819
2879
|
var toDescriptionCase = (str = "") => {
|
|
2880
|
+
if (typeof str !== "string")
|
|
2881
|
+
return;
|
|
2820
2882
|
const result = str.replace(/([A-Z])/g, " $1");
|
|
2821
2883
|
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
2822
2884
|
};
|
|
@@ -2836,8 +2898,8 @@ var require_cjs3 = __commonJS({
|
|
|
2836
2898
|
// src/system/index.js
|
|
2837
2899
|
var system_exports = {};
|
|
2838
2900
|
__export(system_exports, {
|
|
2839
|
-
appendIconsSprite: () => appendIconsSprite,
|
|
2840
2901
|
appendSVGSprite: () => appendSVGSprite,
|
|
2902
|
+
appendSvgIconsSprite: () => appendSvgIconsSprite,
|
|
2841
2903
|
applyDocument: () => applyDocument,
|
|
2842
2904
|
applyHeadings: () => applyHeadings,
|
|
2843
2905
|
applyReset: () => applyReset,
|
|
@@ -2860,10 +2922,10 @@ __export(system_exports, {
|
|
|
2860
2922
|
setFont: () => setFont,
|
|
2861
2923
|
setFontFamily: () => setFontFamily,
|
|
2862
2924
|
setGradient: () => setGradient,
|
|
2863
|
-
setIcon: () => setIcon,
|
|
2864
2925
|
setMediaTheme: () => setMediaTheme,
|
|
2865
2926
|
setSVG: () => setSVG,
|
|
2866
2927
|
setShadow: () => setShadow,
|
|
2928
|
+
setSvgIcon: () => setSvgIcon,
|
|
2867
2929
|
setTheme: () => setTheme
|
|
2868
2930
|
});
|
|
2869
2931
|
module.exports = __toCommonJS(system_exports);
|
|
@@ -2892,6 +2954,7 @@ __export(defaultConfig_exports, {
|
|
|
2892
2954
|
ICONS: () => ICONS,
|
|
2893
2955
|
MEDIA: () => MEDIA,
|
|
2894
2956
|
RESET: () => RESET,
|
|
2957
|
+
SEMANTIC_ICONS: () => SEMANTIC_ICONS,
|
|
2895
2958
|
SEQUENCE: () => SEQUENCE,
|
|
2896
2959
|
SHADOW: () => SHADOW,
|
|
2897
2960
|
SPACING: () => SPACING,
|
|
@@ -3003,6 +3066,7 @@ var SHADOW = {};
|
|
|
3003
3066
|
|
|
3004
3067
|
// src/defaultConfig/icons.js
|
|
3005
3068
|
var ICONS = {};
|
|
3069
|
+
var SEMANTIC_ICONS = {};
|
|
3006
3070
|
|
|
3007
3071
|
// src/defaultConfig/timing.js
|
|
3008
3072
|
var defaultProps3 = {
|
|
@@ -3083,7 +3147,7 @@ var FACTORY = {
|
|
|
3083
3147
|
0: CONFIG
|
|
3084
3148
|
};
|
|
3085
3149
|
var getActiveConfig = (def) => {
|
|
3086
|
-
return FACTORY[def || FACTORY.active];
|
|
3150
|
+
return FACTORY[def || FACTORY.active] || CONFIG;
|
|
3087
3151
|
};
|
|
3088
3152
|
|
|
3089
3153
|
// src/utils/unit.js
|
|
@@ -4292,14 +4356,15 @@ var appendSVGSprite = (LIBRARY, options = DEF_OPTIONS) => {
|
|
|
4292
4356
|
lib[key] = CONFIG2.SVG[key];
|
|
4293
4357
|
appendSVG(lib, options);
|
|
4294
4358
|
};
|
|
4295
|
-
var
|
|
4359
|
+
var setSvgIcon = (val, key) => {
|
|
4360
|
+
var _a;
|
|
4296
4361
|
const CONFIG2 = getActiveConfig();
|
|
4297
|
-
if (CONFIG2.useIconSprite) {
|
|
4362
|
+
if (CONFIG2.useIconSprite && !((_a = CONFIG2.SEMANTIC_ICONS) == null ? void 0 : _a[key])) {
|
|
4298
4363
|
return setSVG(val, key);
|
|
4299
4364
|
}
|
|
4300
4365
|
return val;
|
|
4301
4366
|
};
|
|
4302
|
-
var
|
|
4367
|
+
var appendSvgIconsSprite = (LIBRARY, options = DEF_OPTIONS) => {
|
|
4303
4368
|
const CONFIG2 = getActiveConfig();
|
|
4304
4369
|
const lib = Object.keys(LIBRARY).length ? {} : CONFIG2.ICONS;
|
|
4305
4370
|
for (const key in LIBRARY)
|
package/dist/cjs/system/reset.js
CHANGED
|
@@ -293,6 +293,7 @@ var require_array = __commonJS({
|
|
|
293
293
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
294
294
|
var array_exports = {};
|
|
295
295
|
__export2(array_exports, {
|
|
296
|
+
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
296
297
|
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
297
298
|
createNestedObject: () => createNestedObject,
|
|
298
299
|
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
@@ -304,6 +305,7 @@ var require_array = __commonJS({
|
|
|
304
305
|
removeFromArray: () => removeFromArray,
|
|
305
306
|
removeValueFromArray: () => removeValueFromArray,
|
|
306
307
|
removeValueFromArrayAll: () => removeValueFromArrayAll,
|
|
308
|
+
reorderArrayByValues: () => reorderArrayByValues,
|
|
307
309
|
swapItemsInArray: () => swapItemsInArray
|
|
308
310
|
});
|
|
309
311
|
module2.exports = __toCommonJS2(array_exports);
|
|
@@ -388,6 +390,27 @@ var require_array = __commonJS({
|
|
|
388
390
|
var removeValueFromArrayAll = (arr, value) => {
|
|
389
391
|
return arr.filter((item) => item !== value);
|
|
390
392
|
};
|
|
393
|
+
var addItemAfterEveryElement = (array, item) => {
|
|
394
|
+
const result = [];
|
|
395
|
+
for (let i = 0; i < array.length; i++) {
|
|
396
|
+
result.push(array[i]);
|
|
397
|
+
if (i < array.length - 1) {
|
|
398
|
+
result.push(item);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
return result;
|
|
402
|
+
};
|
|
403
|
+
var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
|
|
404
|
+
const newArray = [...array];
|
|
405
|
+
const indexToMove = newArray.indexOf(valueToMove);
|
|
406
|
+
const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
|
|
407
|
+
if (indexToMove !== -1 && indexToInsertBefore !== -1) {
|
|
408
|
+
const removedItem = newArray.splice(indexToMove, 1)[0];
|
|
409
|
+
const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
|
|
410
|
+
newArray.splice(insertIndex, 0, removedItem);
|
|
411
|
+
}
|
|
412
|
+
return newArray;
|
|
413
|
+
};
|
|
391
414
|
}
|
|
392
415
|
});
|
|
393
416
|
|
|
@@ -664,7 +687,7 @@ var require_object = __commonJS({
|
|
|
664
687
|
}
|
|
665
688
|
return stringified;
|
|
666
689
|
};
|
|
667
|
-
var objectToString = (obj, indent = 0) => {
|
|
690
|
+
var objectToString = (obj = {}, indent = 0) => {
|
|
668
691
|
const spaces = " ".repeat(indent);
|
|
669
692
|
let str = "{\n";
|
|
670
693
|
for (const [key, value] of Object.entries(obj)) {
|
|
@@ -731,7 +754,7 @@ var require_object = __commonJS({
|
|
|
731
754
|
continue;
|
|
732
755
|
const objProp = obj[prop];
|
|
733
756
|
if ((0, import_types.isString)(objProp)) {
|
|
734
|
-
if ((objProp.includes("=>") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
|
|
757
|
+
if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
|
|
735
758
|
try {
|
|
736
759
|
const evalProp = import_globals2.window.eval(`(${objProp})`);
|
|
737
760
|
destringified[prop] = evalProp;
|
|
@@ -1119,20 +1142,21 @@ var require_cookie = __commonJS({
|
|
|
1119
1142
|
});
|
|
1120
1143
|
module2.exports = __toCommonJS2(cookie_exports);
|
|
1121
1144
|
var import_types = require_types();
|
|
1145
|
+
var import_utils11 = require_cjs();
|
|
1122
1146
|
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
1123
1147
|
var setCookie = (cname, cvalue, exdays = 365) => {
|
|
1124
|
-
if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
|
|
1148
|
+
if ((0, import_types.isUndefined)(import_utils11.document) || (0, import_types.isUndefined)(import_utils11.document.cookie))
|
|
1125
1149
|
return;
|
|
1126
1150
|
const d = /* @__PURE__ */ new Date();
|
|
1127
1151
|
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
|
|
1128
1152
|
const expires = `expires=${d.toUTCString()}`;
|
|
1129
|
-
document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
1153
|
+
import_utils11.document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
1130
1154
|
};
|
|
1131
1155
|
var getCookie = (cname) => {
|
|
1132
|
-
if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
|
|
1156
|
+
if ((0, import_types.isUndefined)(import_utils11.document) || (0, import_types.isUndefined)(import_utils11.document.cookie))
|
|
1133
1157
|
return;
|
|
1134
1158
|
const name = `${cname}=`;
|
|
1135
|
-
const decodedCookie = decodeURIComponent(document.cookie);
|
|
1159
|
+
const decodedCookie = decodeURIComponent(import_utils11.document.cookie);
|
|
1136
1160
|
const ca = decodedCookie.split(";");
|
|
1137
1161
|
for (let i = 0; i < ca.length; i++) {
|
|
1138
1162
|
let c = ca[i];
|
|
@@ -1671,6 +1695,7 @@ var require_cjs3 = __commonJS({
|
|
|
1671
1695
|
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1672
1696
|
var array_exports = {};
|
|
1673
1697
|
__export22(array_exports, {
|
|
1698
|
+
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
1674
1699
|
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
1675
1700
|
createNestedObject: () => createNestedObject,
|
|
1676
1701
|
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
@@ -1682,6 +1707,7 @@ var require_cjs3 = __commonJS({
|
|
|
1682
1707
|
removeFromArray: () => removeFromArray,
|
|
1683
1708
|
removeValueFromArray: () => removeValueFromArray,
|
|
1684
1709
|
removeValueFromArrayAll: () => removeValueFromArrayAll,
|
|
1710
|
+
reorderArrayByValues: () => reorderArrayByValues,
|
|
1685
1711
|
swapItemsInArray: () => swapItemsInArray
|
|
1686
1712
|
});
|
|
1687
1713
|
module22.exports = __toCommonJS22(array_exports);
|
|
@@ -1766,6 +1792,27 @@ var require_cjs3 = __commonJS({
|
|
|
1766
1792
|
var removeValueFromArrayAll = (arr, value) => {
|
|
1767
1793
|
return arr.filter((item) => item !== value);
|
|
1768
1794
|
};
|
|
1795
|
+
var addItemAfterEveryElement = (array, item) => {
|
|
1796
|
+
const result = [];
|
|
1797
|
+
for (let i = 0; i < array.length; i++) {
|
|
1798
|
+
result.push(array[i]);
|
|
1799
|
+
if (i < array.length - 1) {
|
|
1800
|
+
result.push(item);
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
return result;
|
|
1804
|
+
};
|
|
1805
|
+
var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
|
|
1806
|
+
const newArray = [...array];
|
|
1807
|
+
const indexToMove = newArray.indexOf(valueToMove);
|
|
1808
|
+
const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
|
|
1809
|
+
if (indexToMove !== -1 && indexToInsertBefore !== -1) {
|
|
1810
|
+
const removedItem = newArray.splice(indexToMove, 1)[0];
|
|
1811
|
+
const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
|
|
1812
|
+
newArray.splice(insertIndex, 0, removedItem);
|
|
1813
|
+
}
|
|
1814
|
+
return newArray;
|
|
1815
|
+
};
|
|
1769
1816
|
}
|
|
1770
1817
|
});
|
|
1771
1818
|
var require_string2 = __commonJS2({
|
|
@@ -2038,7 +2085,7 @@ var require_cjs3 = __commonJS({
|
|
|
2038
2085
|
}
|
|
2039
2086
|
return stringified;
|
|
2040
2087
|
};
|
|
2041
|
-
var objectToString = (obj, indent = 0) => {
|
|
2088
|
+
var objectToString = (obj = {}, indent = 0) => {
|
|
2042
2089
|
const spaces = " ".repeat(indent);
|
|
2043
2090
|
let str = "{\n";
|
|
2044
2091
|
for (const [key, value] of Object.entries(obj)) {
|
|
@@ -2105,7 +2152,7 @@ var require_cjs3 = __commonJS({
|
|
|
2105
2152
|
continue;
|
|
2106
2153
|
const objProp = obj[prop];
|
|
2107
2154
|
if ((0, import_types.isString)(objProp)) {
|
|
2108
|
-
if ((objProp.includes("=>") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
|
|
2155
|
+
if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
|
|
2109
2156
|
try {
|
|
2110
2157
|
const evalProp = import_globals2.window.eval(`(${objProp})`);
|
|
2111
2158
|
destringified[prop] = evalProp;
|
|
@@ -2487,20 +2534,21 @@ var require_cjs3 = __commonJS({
|
|
|
2487
2534
|
});
|
|
2488
2535
|
module22.exports = __toCommonJS22(cookie_exports);
|
|
2489
2536
|
var import_types = require_types2();
|
|
2537
|
+
var import_utils32 = require_cjs4();
|
|
2490
2538
|
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
2491
2539
|
var setCookie = (cname, cvalue, exdays = 365) => {
|
|
2492
|
-
if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
|
|
2540
|
+
if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
|
|
2493
2541
|
return;
|
|
2494
2542
|
const d = /* @__PURE__ */ new Date();
|
|
2495
2543
|
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
|
|
2496
2544
|
const expires = `expires=${d.toUTCString()}`;
|
|
2497
|
-
document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
2545
|
+
import_utils32.document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
2498
2546
|
};
|
|
2499
2547
|
var getCookie = (cname) => {
|
|
2500
|
-
if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
|
|
2548
|
+
if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
|
|
2501
2549
|
return;
|
|
2502
2550
|
const name = `${cname}=`;
|
|
2503
|
-
const decodedCookie = decodeURIComponent(document.cookie);
|
|
2551
|
+
const decodedCookie = decodeURIComponent(import_utils32.document.cookie);
|
|
2504
2552
|
const ca = decodedCookie.split(";");
|
|
2505
2553
|
for (let i = 0; i < ca.length; i++) {
|
|
2506
2554
|
let c = ca[i];
|
|
@@ -2720,6 +2768,7 @@ var require_cjs3 = __commonJS({
|
|
|
2720
2768
|
findClosestNumber: () => findClosestNumber,
|
|
2721
2769
|
findClosestNumberInFactory: () => findClosestNumberInFactory,
|
|
2722
2770
|
formatDate: () => formatDate,
|
|
2771
|
+
loadJavascript: () => loadJavascript,
|
|
2723
2772
|
loadJavascriptFile: () => loadJavascriptFile,
|
|
2724
2773
|
removeChars: () => removeChars,
|
|
2725
2774
|
toCamelCase: () => toCamelCase,
|
|
@@ -2791,6 +2840,17 @@ var require_cjs3 = __commonJS({
|
|
|
2791
2840
|
}
|
|
2792
2841
|
});
|
|
2793
2842
|
};
|
|
2843
|
+
var loadJavascript = (body, async = true, doc = document, type = "text/javascript") => {
|
|
2844
|
+
try {
|
|
2845
|
+
const scriptEle = doc.createElement("script");
|
|
2846
|
+
scriptEle.type = type;
|
|
2847
|
+
scriptEle.async = async;
|
|
2848
|
+
scriptEle.innerHTML = body;
|
|
2849
|
+
doc.body.appendChild(scriptEle);
|
|
2850
|
+
} catch (error) {
|
|
2851
|
+
console.warn(error);
|
|
2852
|
+
}
|
|
2853
|
+
};
|
|
2794
2854
|
var copyStringToClipboard = (str) => {
|
|
2795
2855
|
const el = document.createElement("textarea");
|
|
2796
2856
|
el.value = str;
|
|
@@ -2817,6 +2877,8 @@ var require_cjs3 = __commonJS({
|
|
|
2817
2877
|
);
|
|
2818
2878
|
var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
2819
2879
|
var toDescriptionCase = (str = "") => {
|
|
2880
|
+
if (typeof str !== "string")
|
|
2881
|
+
return;
|
|
2820
2882
|
const result = str.replace(/([A-Z])/g, " $1");
|
|
2821
2883
|
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
2822
2884
|
};
|
|
@@ -2862,6 +2924,7 @@ __export(defaultConfig_exports, {
|
|
|
2862
2924
|
ICONS: () => ICONS,
|
|
2863
2925
|
MEDIA: () => MEDIA,
|
|
2864
2926
|
RESET: () => RESET,
|
|
2927
|
+
SEMANTIC_ICONS: () => SEMANTIC_ICONS,
|
|
2865
2928
|
SEQUENCE: () => SEQUENCE,
|
|
2866
2929
|
SHADOW: () => SHADOW,
|
|
2867
2930
|
SPACING: () => SPACING,
|
|
@@ -2973,6 +3036,7 @@ var SHADOW = {};
|
|
|
2973
3036
|
|
|
2974
3037
|
// src/defaultConfig/icons.js
|
|
2975
3038
|
var ICONS = {};
|
|
3039
|
+
var SEMANTIC_ICONS = {};
|
|
2976
3040
|
|
|
2977
3041
|
// src/defaultConfig/timing.js
|
|
2978
3042
|
var defaultProps3 = {
|
|
@@ -3053,7 +3117,7 @@ var FACTORY = {
|
|
|
3053
3117
|
0: CONFIG
|
|
3054
3118
|
};
|
|
3055
3119
|
var getActiveConfig = (def) => {
|
|
3056
|
-
return FACTORY[def || FACTORY.active];
|
|
3120
|
+
return FACTORY[def || FACTORY.active] || CONFIG;
|
|
3057
3121
|
};
|
|
3058
3122
|
|
|
3059
3123
|
// src/system/color.js
|