@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
|
@@ -20,7 +20,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/defaultConfig/icons.js
|
|
21
21
|
var icons_exports = {};
|
|
22
22
|
__export(icons_exports, {
|
|
23
|
-
ICONS: () => ICONS
|
|
23
|
+
ICONS: () => ICONS,
|
|
24
|
+
SEMANTIC_ICONS: () => SEMANTIC_ICONS
|
|
24
25
|
});
|
|
25
26
|
module.exports = __toCommonJS(icons_exports);
|
|
26
27
|
var ICONS = {};
|
|
28
|
+
var SEMANTIC_ICONS = {};
|
|
@@ -35,6 +35,7 @@ __export(defaultConfig_exports, {
|
|
|
35
35
|
ICONS: () => ICONS,
|
|
36
36
|
MEDIA: () => MEDIA,
|
|
37
37
|
RESET: () => RESET,
|
|
38
|
+
SEMANTIC_ICONS: () => SEMANTIC_ICONS,
|
|
38
39
|
SEQUENCE: () => SEQUENCE,
|
|
39
40
|
SHADOW: () => SHADOW,
|
|
40
41
|
SPACING: () => SPACING,
|
|
@@ -147,6 +148,7 @@ var SHADOW = {};
|
|
|
147
148
|
|
|
148
149
|
// src/defaultConfig/icons.js
|
|
149
150
|
var ICONS = {};
|
|
151
|
+
var SEMANTIC_ICONS = {};
|
|
150
152
|
|
|
151
153
|
// src/defaultConfig/timing.js
|
|
152
154
|
var defaultProps3 = {
|
package/dist/cjs/factory.js
CHANGED
|
@@ -130,7 +130,7 @@ var require_globals = __commonJS({
|
|
|
130
130
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
131
131
|
var globals_exports = {};
|
|
132
132
|
__export2(globals_exports, {
|
|
133
|
-
document: () =>
|
|
133
|
+
document: () => document,
|
|
134
134
|
global: () => global,
|
|
135
135
|
self: () => self,
|
|
136
136
|
window: () => window
|
|
@@ -139,7 +139,7 @@ var require_globals = __commonJS({
|
|
|
139
139
|
var global = globalThis;
|
|
140
140
|
var self = globalThis;
|
|
141
141
|
var window = globalThis;
|
|
142
|
-
var
|
|
142
|
+
var document = window.document;
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
145
|
|
|
@@ -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_globals.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_utils2 = 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_utils2.document) || (0, import_types.isUndefined)(import_utils2.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_utils2.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_utils2.document) || (0, import_types.isUndefined)(import_utils2.document.cookie))
|
|
1133
1157
|
return;
|
|
1134
1158
|
const name = `${cname}=`;
|
|
1135
|
-
const decodedCookie = decodeURIComponent(document.cookie);
|
|
1159
|
+
const decodedCookie = decodeURIComponent(import_utils2.document.cookie);
|
|
1136
1160
|
const ca = decodedCookie.split(";");
|
|
1137
1161
|
for (let i = 0; i < ca.length; i++) {
|
|
1138
1162
|
let c = ca[i];
|
|
@@ -1380,6 +1404,7 @@ __export(defaultConfig_exports, {
|
|
|
1380
1404
|
ICONS: () => ICONS,
|
|
1381
1405
|
MEDIA: () => MEDIA,
|
|
1382
1406
|
RESET: () => RESET,
|
|
1407
|
+
SEMANTIC_ICONS: () => SEMANTIC_ICONS,
|
|
1383
1408
|
SEQUENCE: () => SEQUENCE,
|
|
1384
1409
|
SHADOW: () => SHADOW,
|
|
1385
1410
|
SPACING: () => SPACING,
|
|
@@ -1491,6 +1516,7 @@ var SHADOW = {};
|
|
|
1491
1516
|
|
|
1492
1517
|
// src/defaultConfig/icons.js
|
|
1493
1518
|
var ICONS = {};
|
|
1519
|
+
var SEMANTIC_ICONS = {};
|
|
1494
1520
|
|
|
1495
1521
|
// src/defaultConfig/timing.js
|
|
1496
1522
|
var defaultProps3 = {
|
|
@@ -1577,7 +1603,7 @@ var activateConfig = (def) => {
|
|
|
1577
1603
|
return FACTORY[def || FACTORY.active];
|
|
1578
1604
|
};
|
|
1579
1605
|
var getActiveConfig = (def) => {
|
|
1580
|
-
return FACTORY[def || FACTORY.active];
|
|
1606
|
+
return FACTORY[def || FACTORY.active] || CONFIG;
|
|
1581
1607
|
};
|
|
1582
1608
|
var setActiveConfig = (newConfig) => {
|
|
1583
1609
|
if (!(0, import_utils.isObject)(newConfig))
|
package/dist/cjs/index.js
CHANGED
|
@@ -329,6 +329,7 @@ var require_array = __commonJS({
|
|
|
329
329
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
330
330
|
var array_exports = {};
|
|
331
331
|
__export2(array_exports, {
|
|
332
|
+
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
332
333
|
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
333
334
|
createNestedObject: () => createNestedObject,
|
|
334
335
|
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
@@ -340,6 +341,7 @@ var require_array = __commonJS({
|
|
|
340
341
|
removeFromArray: () => removeFromArray,
|
|
341
342
|
removeValueFromArray: () => removeValueFromArray,
|
|
342
343
|
removeValueFromArrayAll: () => removeValueFromArrayAll,
|
|
344
|
+
reorderArrayByValues: () => reorderArrayByValues,
|
|
343
345
|
swapItemsInArray: () => swapItemsInArray
|
|
344
346
|
});
|
|
345
347
|
module2.exports = __toCommonJS2(array_exports);
|
|
@@ -424,6 +426,27 @@ var require_array = __commonJS({
|
|
|
424
426
|
var removeValueFromArrayAll = (arr, value) => {
|
|
425
427
|
return arr.filter((item) => item !== value);
|
|
426
428
|
};
|
|
429
|
+
var addItemAfterEveryElement = (array, item) => {
|
|
430
|
+
const result = [];
|
|
431
|
+
for (let i = 0; i < array.length; i++) {
|
|
432
|
+
result.push(array[i]);
|
|
433
|
+
if (i < array.length - 1) {
|
|
434
|
+
result.push(item);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
return result;
|
|
438
|
+
};
|
|
439
|
+
var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
|
|
440
|
+
const newArray = [...array];
|
|
441
|
+
const indexToMove = newArray.indexOf(valueToMove);
|
|
442
|
+
const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
|
|
443
|
+
if (indexToMove !== -1 && indexToInsertBefore !== -1) {
|
|
444
|
+
const removedItem = newArray.splice(indexToMove, 1)[0];
|
|
445
|
+
const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
|
|
446
|
+
newArray.splice(insertIndex, 0, removedItem);
|
|
447
|
+
}
|
|
448
|
+
return newArray;
|
|
449
|
+
};
|
|
427
450
|
}
|
|
428
451
|
});
|
|
429
452
|
|
|
@@ -700,7 +723,7 @@ var require_object = __commonJS({
|
|
|
700
723
|
}
|
|
701
724
|
return stringified;
|
|
702
725
|
};
|
|
703
|
-
var objectToString = (obj, indent = 0) => {
|
|
726
|
+
var objectToString = (obj = {}, indent = 0) => {
|
|
704
727
|
const spaces = " ".repeat(indent);
|
|
705
728
|
let str = "{\n";
|
|
706
729
|
for (const [key, value] of Object.entries(obj)) {
|
|
@@ -767,7 +790,7 @@ var require_object = __commonJS({
|
|
|
767
790
|
continue;
|
|
768
791
|
const objProp = obj[prop];
|
|
769
792
|
if ((0, import_types.isString)(objProp)) {
|
|
770
|
-
if ((objProp.includes("=>") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
|
|
793
|
+
if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
|
|
771
794
|
try {
|
|
772
795
|
const evalProp = import_globals3.window.eval(`(${objProp})`);
|
|
773
796
|
destringified[prop] = evalProp;
|
|
@@ -1155,20 +1178,21 @@ var require_cookie = __commonJS({
|
|
|
1155
1178
|
});
|
|
1156
1179
|
module2.exports = __toCommonJS2(cookie_exports);
|
|
1157
1180
|
var import_types = require_types();
|
|
1181
|
+
var import_utils27 = require_cjs2();
|
|
1158
1182
|
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
1159
1183
|
var setCookie = (cname, cvalue, exdays = 365) => {
|
|
1160
|
-
if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
|
|
1184
|
+
if ((0, import_types.isUndefined)(import_utils27.document) || (0, import_types.isUndefined)(import_utils27.document.cookie))
|
|
1161
1185
|
return;
|
|
1162
1186
|
const d = /* @__PURE__ */ new Date();
|
|
1163
1187
|
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
|
|
1164
1188
|
const expires = `expires=${d.toUTCString()}`;
|
|
1165
|
-
document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
1189
|
+
import_utils27.document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
1166
1190
|
};
|
|
1167
1191
|
var getCookie = (cname) => {
|
|
1168
|
-
if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
|
|
1192
|
+
if ((0, import_types.isUndefined)(import_utils27.document) || (0, import_types.isUndefined)(import_utils27.document.cookie))
|
|
1169
1193
|
return;
|
|
1170
1194
|
const name = `${cname}=`;
|
|
1171
|
-
const decodedCookie = decodeURIComponent(document.cookie);
|
|
1195
|
+
const decodedCookie = decodeURIComponent(import_utils27.document.cookie);
|
|
1172
1196
|
const ca = decodedCookie.split(";");
|
|
1173
1197
|
for (let i = 0; i < ca.length; i++) {
|
|
1174
1198
|
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
|
};
|
|
@@ -2854,6 +2916,7 @@ __export(src_exports, {
|
|
|
2854
2916
|
ICONS: () => ICONS,
|
|
2855
2917
|
MEDIA: () => MEDIA,
|
|
2856
2918
|
RESET: () => RESET,
|
|
2919
|
+
SEMANTIC_ICONS: () => SEMANTIC_ICONS,
|
|
2857
2920
|
SEQUENCE: () => SEQUENCE,
|
|
2858
2921
|
SHADOW: () => SHADOW,
|
|
2859
2922
|
SPACING: () => SPACING,
|
|
@@ -2866,8 +2929,8 @@ __export(src_exports, {
|
|
|
2866
2929
|
UNIT: () => UNIT,
|
|
2867
2930
|
VALUE_TRANSFORMERS: () => VALUE_TRANSFORMERS,
|
|
2868
2931
|
activateConfig: () => activateConfig,
|
|
2869
|
-
appendIconsSprite: () => appendIconsSprite,
|
|
2870
2932
|
appendSVGSprite: () => appendSVGSprite,
|
|
2933
|
+
appendSvgIconsSprite: () => appendSvgIconsSprite,
|
|
2871
2934
|
applyDocument: () => applyDocument,
|
|
2872
2935
|
applyHeadings: () => applyHeadings,
|
|
2873
2936
|
applyMediaSequenceVars: () => applyMediaSequenceVars,
|
|
@@ -2936,13 +2999,13 @@ __export(src_exports, {
|
|
|
2936
2999
|
setFont: () => setFont,
|
|
2937
3000
|
setFontFamily: () => setFontFamily,
|
|
2938
3001
|
setGradient: () => setGradient,
|
|
2939
|
-
setIcon: () => setIcon,
|
|
2940
3002
|
setInCustomFontMedia: () => setInCustomFontMedia,
|
|
2941
3003
|
setMediaTheme: () => setMediaTheme,
|
|
2942
3004
|
setSVG: () => setSVG,
|
|
2943
3005
|
setScalingVar: () => setScalingVar,
|
|
2944
3006
|
setShadow: () => setShadow,
|
|
2945
3007
|
setSubScalingVar: () => setSubScalingVar,
|
|
3008
|
+
setSvgIcon: () => setSvgIcon,
|
|
2946
3009
|
setTheme: () => setTheme,
|
|
2947
3010
|
setValue: () => setValue,
|
|
2948
3011
|
setVariables: () => setVariables,
|
|
@@ -3244,6 +3307,7 @@ __export(defaultConfig_exports, {
|
|
|
3244
3307
|
ICONS: () => ICONS,
|
|
3245
3308
|
MEDIA: () => MEDIA,
|
|
3246
3309
|
RESET: () => RESET,
|
|
3310
|
+
SEMANTIC_ICONS: () => SEMANTIC_ICONS,
|
|
3247
3311
|
SEQUENCE: () => SEQUENCE,
|
|
3248
3312
|
SHADOW: () => SHADOW,
|
|
3249
3313
|
SPACING: () => SPACING,
|
|
@@ -3355,6 +3419,7 @@ var SHADOW = {};
|
|
|
3355
3419
|
|
|
3356
3420
|
// src/defaultConfig/icons.js
|
|
3357
3421
|
var ICONS = {};
|
|
3422
|
+
var SEMANTIC_ICONS = {};
|
|
3358
3423
|
|
|
3359
3424
|
// src/defaultConfig/timing.js
|
|
3360
3425
|
var defaultProps3 = {
|
|
@@ -3441,7 +3506,7 @@ var activateConfig = (def) => {
|
|
|
3441
3506
|
return FACTORY[def || FACTORY.active];
|
|
3442
3507
|
};
|
|
3443
3508
|
var getActiveConfig = (def) => {
|
|
3444
|
-
return FACTORY[def || FACTORY.active];
|
|
3509
|
+
return FACTORY[def || FACTORY.active] || CONFIG;
|
|
3445
3510
|
};
|
|
3446
3511
|
var setActiveConfig = (newConfig) => {
|
|
3447
3512
|
if (!(0, import_utils2.isObject)(newConfig))
|
|
@@ -3798,8 +3863,8 @@ var convertSvgToSymbol = (key, code) => {
|
|
|
3798
3863
|
// src/system/index.js
|
|
3799
3864
|
var system_exports = {};
|
|
3800
3865
|
__export(system_exports, {
|
|
3801
|
-
appendIconsSprite: () => appendIconsSprite,
|
|
3802
3866
|
appendSVGSprite: () => appendSVGSprite,
|
|
3867
|
+
appendSvgIconsSprite: () => appendSvgIconsSprite,
|
|
3803
3868
|
applyDocument: () => applyDocument,
|
|
3804
3869
|
applyHeadings: () => applyHeadings,
|
|
3805
3870
|
applyReset: () => applyReset,
|
|
@@ -3822,10 +3887,10 @@ __export(system_exports, {
|
|
|
3822
3887
|
setFont: () => setFont,
|
|
3823
3888
|
setFontFamily: () => setFontFamily,
|
|
3824
3889
|
setGradient: () => setGradient,
|
|
3825
|
-
setIcon: () => setIcon,
|
|
3826
3890
|
setMediaTheme: () => setMediaTheme,
|
|
3827
3891
|
setSVG: () => setSVG,
|
|
3828
3892
|
setShadow: () => setShadow,
|
|
3893
|
+
setSvgIcon: () => setSvgIcon,
|
|
3829
3894
|
setTheme: () => setTheme
|
|
3830
3895
|
});
|
|
3831
3896
|
|
|
@@ -4565,14 +4630,15 @@ var appendSVGSprite = (LIBRARY, options = DEF_OPTIONS) => {
|
|
|
4565
4630
|
lib[key] = CONFIG2.SVG[key];
|
|
4566
4631
|
appendSVG(lib, options);
|
|
4567
4632
|
};
|
|
4568
|
-
var
|
|
4633
|
+
var setSvgIcon = (val, key) => {
|
|
4634
|
+
var _a;
|
|
4569
4635
|
const CONFIG2 = getActiveConfig();
|
|
4570
|
-
if (CONFIG2.useIconSprite) {
|
|
4636
|
+
if (CONFIG2.useIconSprite && !((_a = CONFIG2.SEMANTIC_ICONS) == null ? void 0 : _a[key])) {
|
|
4571
4637
|
return setSVG(val, key);
|
|
4572
4638
|
}
|
|
4573
4639
|
return val;
|
|
4574
4640
|
};
|
|
4575
|
-
var
|
|
4641
|
+
var appendSvgIconsSprite = (LIBRARY, options = DEF_OPTIONS) => {
|
|
4576
4642
|
const CONFIG2 = getActiveConfig();
|
|
4577
4643
|
const lib = Object.keys(LIBRARY).length ? {} : CONFIG2.ICONS;
|
|
4578
4644
|
for (const key in LIBRARY)
|
|
@@ -4824,7 +4890,8 @@ var VALUE_TRANSFORMERS = {
|
|
|
4824
4890
|
font: setFont,
|
|
4825
4891
|
font_family: setFontFamily,
|
|
4826
4892
|
theme: setTheme,
|
|
4827
|
-
icons:
|
|
4893
|
+
icons: setSvgIcon,
|
|
4894
|
+
semantic_icons: setSameValue,
|
|
4828
4895
|
svg: setSVG,
|
|
4829
4896
|
svg_data: setSameValue,
|
|
4830
4897
|
typography: setSameValue,
|
|
@@ -4872,6 +4939,7 @@ var set = (recivedConfig, options = SET_OPTIONS) => {
|
|
|
4872
4939
|
globalTheme,
|
|
4873
4940
|
useDocumentTheme,
|
|
4874
4941
|
useDefaultConfig,
|
|
4942
|
+
SEMANTIC_ICONS: SEMANTIC_ICONS2,
|
|
4875
4943
|
...config
|
|
4876
4944
|
} = recivedConfig;
|
|
4877
4945
|
if (options.newConfig) {
|
|
@@ -4895,15 +4963,20 @@ var set = (recivedConfig, options = SET_OPTIONS) => {
|
|
|
4895
4963
|
CONFIG2.globalTheme = globalTheme;
|
|
4896
4964
|
if (useDefaultConfig !== void 0)
|
|
4897
4965
|
CONFIG2.useDefaultConfig = useDefaultConfig;
|
|
4966
|
+
if (SEMANTIC_ICONS2 !== void 0)
|
|
4967
|
+
CONFIG2.SEMANTIC_ICONS = SEMANTIC_ICONS2;
|
|
4898
4968
|
if (CONFIG2.verbose)
|
|
4899
4969
|
console.log(CONFIG2);
|
|
4900
4970
|
if (!CONFIG2.__svg_cache)
|
|
4901
4971
|
CONFIG2.__svg_cache = {};
|
|
4902
4972
|
const keys = Object.keys(config);
|
|
4903
4973
|
keys.map((key) => setEach(key, config[key]));
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4974
|
+
if (config.TYPOGRAPHY)
|
|
4975
|
+
applyTypographySequence();
|
|
4976
|
+
if (config.SPACING)
|
|
4977
|
+
applySpacingSequence();
|
|
4978
|
+
if (config.TIMING)
|
|
4979
|
+
applyTimingSequence();
|
|
4907
4980
|
applyDocument();
|
|
4908
4981
|
applyReset();
|
|
4909
4982
|
return CONFIG2;
|