@symbo.ls/scratch 2.11.475 → 2.11.500
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/index.js +5 -0
- package/dist/cjs/factory.js +38 -6
- package/dist/cjs/index.js +56 -12
- package/dist/cjs/set.js +55 -12
- package/dist/cjs/system/color.js +55 -12
- package/dist/cjs/system/document.js +55 -12
- package/dist/cjs/system/font.js +55 -12
- package/dist/cjs/system/index.js +55 -12
- package/dist/cjs/system/reset.js +55 -12
- package/dist/cjs/system/shadow.js +55 -12
- package/dist/cjs/system/spacing.js +55 -12
- package/dist/cjs/system/svg.js +55 -12
- package/dist/cjs/system/theme.js +55 -12
- package/dist/cjs/system/timing.js +55 -12
- package/dist/cjs/system/typography.js +55 -12
- package/dist/cjs/transforms/index.js +55 -12
- package/dist/cjs/utils/color.js +33 -6
- package/dist/cjs/utils/index.js +55 -12
- package/dist/cjs/utils/sequence.js +55 -12
- package/dist/cjs/utils/sprite.js +38 -6
- package/dist/cjs/utils/var.js +55 -12
- package/package.json +3 -3
- package/src/defaultConfig/index.js +1 -0
|
@@ -323,6 +323,7 @@ var require_cjs = __commonJS({
|
|
|
323
323
|
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
324
324
|
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
325
325
|
arraysEqual: () => arraysEqual,
|
|
326
|
+
checkIfStringIsInArray: () => checkIfStringIsInArray,
|
|
326
327
|
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
327
328
|
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
328
329
|
filterArrays: () => filterArrays,
|
|
@@ -442,6 +443,11 @@ var require_cjs = __commonJS({
|
|
|
442
443
|
const excludeSet = new Set(excludeArr);
|
|
443
444
|
return sourceArr.filter((item) => !excludeSet.has(item));
|
|
444
445
|
};
|
|
446
|
+
var checkIfStringIsInArray = (string, arr) => {
|
|
447
|
+
if (!string)
|
|
448
|
+
return;
|
|
449
|
+
return arr.filter((v) => string.includes(v)).length;
|
|
450
|
+
};
|
|
445
451
|
}
|
|
446
452
|
});
|
|
447
453
|
var require_string2 = __commonJS2({
|
|
@@ -494,14 +500,15 @@ var require_cjs = __commonJS({
|
|
|
494
500
|
2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
|
|
495
501
|
3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
|
|
496
502
|
};
|
|
497
|
-
|
|
503
|
+
function replaceLiteralsWithObjectFields(str, options = {}, forcedState) {
|
|
498
504
|
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
|
|
499
505
|
return str;
|
|
500
506
|
const reg = brackRegex[options.bracketsLength || 2];
|
|
507
|
+
const obj = forcedState || this.state || {};
|
|
501
508
|
return str.replace(reg, (_, parentPath, variable) => {
|
|
502
509
|
if (parentPath) {
|
|
503
510
|
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
|
|
504
|
-
let parentState =
|
|
511
|
+
let parentState = obj;
|
|
505
512
|
for (let i = 0; i < parentLevels; i++) {
|
|
506
513
|
parentState = parentState.parent;
|
|
507
514
|
if (!parentState) {
|
|
@@ -511,11 +518,11 @@ var require_cjs = __commonJS({
|
|
|
511
518
|
const value = parentState[variable.trim()];
|
|
512
519
|
return value !== void 0 ? `${value}` : "";
|
|
513
520
|
} else {
|
|
514
|
-
const value =
|
|
521
|
+
const value = obj[variable.trim()];
|
|
515
522
|
return value !== void 0 ? `${value}` : "";
|
|
516
523
|
}
|
|
517
524
|
});
|
|
518
|
-
}
|
|
525
|
+
}
|
|
519
526
|
var lowercaseFirstLetter = (inputString) => {
|
|
520
527
|
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
521
528
|
};
|
|
@@ -1660,6 +1667,7 @@ var require_cjs = __commonJS({
|
|
|
1660
1667
|
checkIfKeyIsProperty: () => checkIfKeyIsProperty,
|
|
1661
1668
|
checkIfSugar: () => checkIfSugar,
|
|
1662
1669
|
extendizeByKey: () => extendizeByKey,
|
|
1670
|
+
extractComponentKeyFromKey: () => extractComponentKeyFromKey,
|
|
1663
1671
|
getCapitalCaseKeys: () => getCapitalCaseKeys,
|
|
1664
1672
|
getChildrenComponentsByKey: () => getChildrenComponentsByKey,
|
|
1665
1673
|
getExtendsInElement: () => getExtendsInElement,
|
|
@@ -1716,11 +1724,14 @@ var require_cjs = __commonJS({
|
|
|
1716
1724
|
}
|
|
1717
1725
|
return !hasComponentAttrs || childProps || extendProps || children || childExtends;
|
|
1718
1726
|
};
|
|
1727
|
+
var extractComponentKeyFromKey = (key) => {
|
|
1728
|
+
return key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
|
|
1729
|
+
};
|
|
1719
1730
|
var extendizeByKey = (element, parent, key) => {
|
|
1720
1731
|
const { context } = parent;
|
|
1721
1732
|
const { tag, extend, childExtends } = element;
|
|
1722
1733
|
const isSugar = checkIfSugar(element, parent, key);
|
|
1723
|
-
const extendFromKey =
|
|
1734
|
+
const extendFromKey = extractComponentKeyFromKey(key);
|
|
1724
1735
|
const isExtendKeyComponent = context && context.components[extendFromKey];
|
|
1725
1736
|
if (element === isExtendKeyComponent)
|
|
1726
1737
|
return element;
|
|
@@ -1840,7 +1851,7 @@ var require_cjs = __commonJS({
|
|
|
1840
1851
|
if (checkIfKeyIsComponent(key)) {
|
|
1841
1852
|
result.push(key);
|
|
1842
1853
|
}
|
|
1843
|
-
if (key === "extend") {
|
|
1854
|
+
if (key === "extend" || key === "extends") {
|
|
1844
1855
|
if (typeof o[key] === "string") {
|
|
1845
1856
|
result.push(o[key]);
|
|
1846
1857
|
} else if (Array.isArray(o[key])) {
|
|
@@ -2384,6 +2395,7 @@ var require_array = __commonJS({
|
|
|
2384
2395
|
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
2385
2396
|
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
2386
2397
|
arraysEqual: () => arraysEqual,
|
|
2398
|
+
checkIfStringIsInArray: () => checkIfStringIsInArray,
|
|
2387
2399
|
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
2388
2400
|
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
2389
2401
|
filterArrays: () => filterArrays,
|
|
@@ -2503,6 +2515,11 @@ var require_array = __commonJS({
|
|
|
2503
2515
|
const excludeSet = new Set(excludeArr);
|
|
2504
2516
|
return sourceArr.filter((item) => !excludeSet.has(item));
|
|
2505
2517
|
};
|
|
2518
|
+
var checkIfStringIsInArray = (string, arr) => {
|
|
2519
|
+
if (!string)
|
|
2520
|
+
return;
|
|
2521
|
+
return arr.filter((v) => string.includes(v)).length;
|
|
2522
|
+
};
|
|
2506
2523
|
}
|
|
2507
2524
|
});
|
|
2508
2525
|
|
|
@@ -2557,14 +2574,15 @@ var require_string = __commonJS({
|
|
|
2557
2574
|
2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
|
|
2558
2575
|
3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
|
|
2559
2576
|
};
|
|
2560
|
-
|
|
2577
|
+
function replaceLiteralsWithObjectFields(str, options = {}, forcedState) {
|
|
2561
2578
|
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
|
|
2562
2579
|
return str;
|
|
2563
2580
|
const reg = brackRegex[options.bracketsLength || 2];
|
|
2581
|
+
const obj = forcedState || this.state || {};
|
|
2564
2582
|
return str.replace(reg, (_, parentPath, variable) => {
|
|
2565
2583
|
if (parentPath) {
|
|
2566
2584
|
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
|
|
2567
|
-
let parentState =
|
|
2585
|
+
let parentState = obj;
|
|
2568
2586
|
for (let i = 0; i < parentLevels; i++) {
|
|
2569
2587
|
parentState = parentState.parent;
|
|
2570
2588
|
if (!parentState) {
|
|
@@ -2574,11 +2592,11 @@ var require_string = __commonJS({
|
|
|
2574
2592
|
const value = parentState[variable.trim()];
|
|
2575
2593
|
return value !== void 0 ? `${value}` : "";
|
|
2576
2594
|
} else {
|
|
2577
|
-
const value =
|
|
2595
|
+
const value = obj[variable.trim()];
|
|
2578
2596
|
return value !== void 0 ? `${value}` : "";
|
|
2579
2597
|
}
|
|
2580
2598
|
});
|
|
2581
|
-
}
|
|
2599
|
+
}
|
|
2582
2600
|
var lowercaseFirstLetter = (inputString) => {
|
|
2583
2601
|
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
2584
2602
|
};
|
|
@@ -3735,6 +3753,7 @@ var require_component = __commonJS({
|
|
|
3735
3753
|
checkIfKeyIsProperty: () => checkIfKeyIsProperty,
|
|
3736
3754
|
checkIfSugar: () => checkIfSugar,
|
|
3737
3755
|
extendizeByKey: () => extendizeByKey,
|
|
3756
|
+
extractComponentKeyFromKey: () => extractComponentKeyFromKey,
|
|
3738
3757
|
getCapitalCaseKeys: () => getCapitalCaseKeys,
|
|
3739
3758
|
getChildrenComponentsByKey: () => getChildrenComponentsByKey,
|
|
3740
3759
|
getExtendsInElement: () => getExtendsInElement,
|
|
@@ -3791,11 +3810,14 @@ var require_component = __commonJS({
|
|
|
3791
3810
|
}
|
|
3792
3811
|
return !hasComponentAttrs || childProps || extendProps || children || childExtends;
|
|
3793
3812
|
};
|
|
3813
|
+
var extractComponentKeyFromKey = (key) => {
|
|
3814
|
+
return key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
|
|
3815
|
+
};
|
|
3794
3816
|
var extendizeByKey = (element, parent, key) => {
|
|
3795
3817
|
const { context } = parent;
|
|
3796
3818
|
const { tag, extend, childExtends } = element;
|
|
3797
3819
|
const isSugar = checkIfSugar(element, parent, key);
|
|
3798
|
-
const extendFromKey =
|
|
3820
|
+
const extendFromKey = extractComponentKeyFromKey(key);
|
|
3799
3821
|
const isExtendKeyComponent = context && context.components[extendFromKey];
|
|
3800
3822
|
if (element === isExtendKeyComponent)
|
|
3801
3823
|
return element;
|
|
@@ -3805,6 +3827,22 @@ var require_component = __commonJS({
|
|
|
3805
3827
|
tag,
|
|
3806
3828
|
props: { ...element }
|
|
3807
3829
|
});
|
|
3830
|
+
if (newElem.props.data) {
|
|
3831
|
+
newElem.data = newElem.props.data;
|
|
3832
|
+
delete newElem.props.data;
|
|
3833
|
+
}
|
|
3834
|
+
if (newElem.props.state) {
|
|
3835
|
+
newElem.state = newElem.props.state;
|
|
3836
|
+
delete newElem.props.state;
|
|
3837
|
+
}
|
|
3838
|
+
if (newElem.props.attr) {
|
|
3839
|
+
newElem.attr = newElem.props.attr;
|
|
3840
|
+
delete newElem.props.attr;
|
|
3841
|
+
}
|
|
3842
|
+
if (newElem.props.if) {
|
|
3843
|
+
newElem.if = newElem.props.if;
|
|
3844
|
+
delete newElem.props.if;
|
|
3845
|
+
}
|
|
3808
3846
|
if (childExtends)
|
|
3809
3847
|
newElem.childExtend = childExtends;
|
|
3810
3848
|
return newElem;
|
|
@@ -3915,7 +3953,7 @@ var require_component = __commonJS({
|
|
|
3915
3953
|
if (checkIfKeyIsComponent(key)) {
|
|
3916
3954
|
result.push(key);
|
|
3917
3955
|
}
|
|
3918
|
-
if (key === "extend") {
|
|
3956
|
+
if (key === "extend" || key === "extends") {
|
|
3919
3957
|
if (typeof o[key] === "string") {
|
|
3920
3958
|
result.push(o[key]);
|
|
3921
3959
|
} else if (Array.isArray(o[key])) {
|
|
@@ -4037,6 +4075,7 @@ __export(defaultConfig_exports, {
|
|
|
4037
4075
|
ANIMATION: () => ANIMATION,
|
|
4038
4076
|
BREAKPOINTS: () => BREAKPOINTS,
|
|
4039
4077
|
CASES: () => CASES,
|
|
4078
|
+
CLASS: () => CLASS,
|
|
4040
4079
|
COLOR: () => COLOR,
|
|
4041
4080
|
DEVICES: () => DEVICES,
|
|
4042
4081
|
DOCUMENT: () => DOCUMENT,
|
|
@@ -4226,6 +4265,10 @@ var TEMPLATES = {};
|
|
|
4226
4265
|
var defaultProps4 = {};
|
|
4227
4266
|
var GRID = defaultProps4;
|
|
4228
4267
|
|
|
4268
|
+
// src/defaultConfig/class.js
|
|
4269
|
+
var defaultProps5 = {};
|
|
4270
|
+
var CLASS = defaultProps5;
|
|
4271
|
+
|
|
4229
4272
|
// src/defaultConfig/index.js
|
|
4230
4273
|
var RESET = {};
|
|
4231
4274
|
|
package/dist/cjs/system/svg.js
CHANGED
|
@@ -336,6 +336,7 @@ var require_array = __commonJS({
|
|
|
336
336
|
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
337
337
|
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
338
338
|
arraysEqual: () => arraysEqual,
|
|
339
|
+
checkIfStringIsInArray: () => checkIfStringIsInArray,
|
|
339
340
|
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
340
341
|
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
341
342
|
filterArrays: () => filterArrays,
|
|
@@ -455,6 +456,11 @@ var require_array = __commonJS({
|
|
|
455
456
|
const excludeSet = new Set(excludeArr);
|
|
456
457
|
return sourceArr.filter((item) => !excludeSet.has(item));
|
|
457
458
|
};
|
|
459
|
+
var checkIfStringIsInArray = (string, arr) => {
|
|
460
|
+
if (!string)
|
|
461
|
+
return;
|
|
462
|
+
return arr.filter((v) => string.includes(v)).length;
|
|
463
|
+
};
|
|
458
464
|
}
|
|
459
465
|
});
|
|
460
466
|
|
|
@@ -509,14 +515,15 @@ var require_string = __commonJS({
|
|
|
509
515
|
2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
|
|
510
516
|
3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
|
|
511
517
|
};
|
|
512
|
-
|
|
518
|
+
function replaceLiteralsWithObjectFields(str, options = {}, forcedState) {
|
|
513
519
|
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
|
|
514
520
|
return str;
|
|
515
521
|
const reg = brackRegex[options.bracketsLength || 2];
|
|
522
|
+
const obj = forcedState || this.state || {};
|
|
516
523
|
return str.replace(reg, (_, parentPath, variable) => {
|
|
517
524
|
if (parentPath) {
|
|
518
525
|
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
|
|
519
|
-
let parentState =
|
|
526
|
+
let parentState = obj;
|
|
520
527
|
for (let i = 0; i < parentLevels; i++) {
|
|
521
528
|
parentState = parentState.parent;
|
|
522
529
|
if (!parentState) {
|
|
@@ -526,11 +533,11 @@ var require_string = __commonJS({
|
|
|
526
533
|
const value = parentState[variable.trim()];
|
|
527
534
|
return value !== void 0 ? `${value}` : "";
|
|
528
535
|
} else {
|
|
529
|
-
const value =
|
|
536
|
+
const value = obj[variable.trim()];
|
|
530
537
|
return value !== void 0 ? `${value}` : "";
|
|
531
538
|
}
|
|
532
539
|
});
|
|
533
|
-
}
|
|
540
|
+
}
|
|
534
541
|
var lowercaseFirstLetter = (inputString) => {
|
|
535
542
|
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
536
543
|
};
|
|
@@ -1687,6 +1694,7 @@ var require_component = __commonJS({
|
|
|
1687
1694
|
checkIfKeyIsProperty: () => checkIfKeyIsProperty,
|
|
1688
1695
|
checkIfSugar: () => checkIfSugar,
|
|
1689
1696
|
extendizeByKey: () => extendizeByKey,
|
|
1697
|
+
extractComponentKeyFromKey: () => extractComponentKeyFromKey,
|
|
1690
1698
|
getCapitalCaseKeys: () => getCapitalCaseKeys,
|
|
1691
1699
|
getChildrenComponentsByKey: () => getChildrenComponentsByKey,
|
|
1692
1700
|
getExtendsInElement: () => getExtendsInElement,
|
|
@@ -1743,11 +1751,14 @@ var require_component = __commonJS({
|
|
|
1743
1751
|
}
|
|
1744
1752
|
return !hasComponentAttrs || childProps || extendProps || children || childExtends;
|
|
1745
1753
|
};
|
|
1754
|
+
var extractComponentKeyFromKey = (key) => {
|
|
1755
|
+
return key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
|
|
1756
|
+
};
|
|
1746
1757
|
var extendizeByKey = (element, parent, key) => {
|
|
1747
1758
|
const { context } = parent;
|
|
1748
1759
|
const { tag, extend, childExtends } = element;
|
|
1749
1760
|
const isSugar = checkIfSugar(element, parent, key);
|
|
1750
|
-
const extendFromKey =
|
|
1761
|
+
const extendFromKey = extractComponentKeyFromKey(key);
|
|
1751
1762
|
const isExtendKeyComponent = context && context.components[extendFromKey];
|
|
1752
1763
|
if (element === isExtendKeyComponent)
|
|
1753
1764
|
return element;
|
|
@@ -1757,6 +1768,22 @@ var require_component = __commonJS({
|
|
|
1757
1768
|
tag,
|
|
1758
1769
|
props: { ...element }
|
|
1759
1770
|
});
|
|
1771
|
+
if (newElem.props.data) {
|
|
1772
|
+
newElem.data = newElem.props.data;
|
|
1773
|
+
delete newElem.props.data;
|
|
1774
|
+
}
|
|
1775
|
+
if (newElem.props.state) {
|
|
1776
|
+
newElem.state = newElem.props.state;
|
|
1777
|
+
delete newElem.props.state;
|
|
1778
|
+
}
|
|
1779
|
+
if (newElem.props.attr) {
|
|
1780
|
+
newElem.attr = newElem.props.attr;
|
|
1781
|
+
delete newElem.props.attr;
|
|
1782
|
+
}
|
|
1783
|
+
if (newElem.props.if) {
|
|
1784
|
+
newElem.if = newElem.props.if;
|
|
1785
|
+
delete newElem.props.if;
|
|
1786
|
+
}
|
|
1760
1787
|
if (childExtends)
|
|
1761
1788
|
newElem.childExtend = childExtends;
|
|
1762
1789
|
return newElem;
|
|
@@ -1867,7 +1894,7 @@ var require_component = __commonJS({
|
|
|
1867
1894
|
if (checkIfKeyIsComponent(key)) {
|
|
1868
1895
|
result.push(key);
|
|
1869
1896
|
}
|
|
1870
|
-
if (key === "extend") {
|
|
1897
|
+
if (key === "extend" || key === "extends") {
|
|
1871
1898
|
if (typeof o[key] === "string") {
|
|
1872
1899
|
result.push(o[key]);
|
|
1873
1900
|
} else if (Array.isArray(o[key])) {
|
|
@@ -2226,6 +2253,7 @@ var require_cjs3 = __commonJS({
|
|
|
2226
2253
|
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
2227
2254
|
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
2228
2255
|
arraysEqual: () => arraysEqual,
|
|
2256
|
+
checkIfStringIsInArray: () => checkIfStringIsInArray,
|
|
2229
2257
|
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
2230
2258
|
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
2231
2259
|
filterArrays: () => filterArrays,
|
|
@@ -2345,6 +2373,11 @@ var require_cjs3 = __commonJS({
|
|
|
2345
2373
|
const excludeSet = new Set(excludeArr);
|
|
2346
2374
|
return sourceArr.filter((item) => !excludeSet.has(item));
|
|
2347
2375
|
};
|
|
2376
|
+
var checkIfStringIsInArray = (string, arr) => {
|
|
2377
|
+
if (!string)
|
|
2378
|
+
return;
|
|
2379
|
+
return arr.filter((v) => string.includes(v)).length;
|
|
2380
|
+
};
|
|
2348
2381
|
}
|
|
2349
2382
|
});
|
|
2350
2383
|
var require_string2 = __commonJS2({
|
|
@@ -2397,14 +2430,15 @@ var require_cjs3 = __commonJS({
|
|
|
2397
2430
|
2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
|
|
2398
2431
|
3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
|
|
2399
2432
|
};
|
|
2400
|
-
|
|
2433
|
+
function replaceLiteralsWithObjectFields(str, options = {}, forcedState) {
|
|
2401
2434
|
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
|
|
2402
2435
|
return str;
|
|
2403
2436
|
const reg = brackRegex[options.bracketsLength || 2];
|
|
2437
|
+
const obj = forcedState || this.state || {};
|
|
2404
2438
|
return str.replace(reg, (_, parentPath, variable) => {
|
|
2405
2439
|
if (parentPath) {
|
|
2406
2440
|
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
|
|
2407
|
-
let parentState =
|
|
2441
|
+
let parentState = obj;
|
|
2408
2442
|
for (let i = 0; i < parentLevels; i++) {
|
|
2409
2443
|
parentState = parentState.parent;
|
|
2410
2444
|
if (!parentState) {
|
|
@@ -2414,11 +2448,11 @@ var require_cjs3 = __commonJS({
|
|
|
2414
2448
|
const value = parentState[variable.trim()];
|
|
2415
2449
|
return value !== void 0 ? `${value}` : "";
|
|
2416
2450
|
} else {
|
|
2417
|
-
const value =
|
|
2451
|
+
const value = obj[variable.trim()];
|
|
2418
2452
|
return value !== void 0 ? `${value}` : "";
|
|
2419
2453
|
}
|
|
2420
2454
|
});
|
|
2421
|
-
}
|
|
2455
|
+
}
|
|
2422
2456
|
var lowercaseFirstLetter = (inputString) => {
|
|
2423
2457
|
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
2424
2458
|
};
|
|
@@ -3563,6 +3597,7 @@ var require_cjs3 = __commonJS({
|
|
|
3563
3597
|
checkIfKeyIsProperty: () => checkIfKeyIsProperty,
|
|
3564
3598
|
checkIfSugar: () => checkIfSugar,
|
|
3565
3599
|
extendizeByKey: () => extendizeByKey,
|
|
3600
|
+
extractComponentKeyFromKey: () => extractComponentKeyFromKey,
|
|
3566
3601
|
getCapitalCaseKeys: () => getCapitalCaseKeys,
|
|
3567
3602
|
getChildrenComponentsByKey: () => getChildrenComponentsByKey,
|
|
3568
3603
|
getExtendsInElement: () => getExtendsInElement,
|
|
@@ -3619,11 +3654,14 @@ var require_cjs3 = __commonJS({
|
|
|
3619
3654
|
}
|
|
3620
3655
|
return !hasComponentAttrs || childProps || extendProps || children || childExtends;
|
|
3621
3656
|
};
|
|
3657
|
+
var extractComponentKeyFromKey = (key) => {
|
|
3658
|
+
return key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
|
|
3659
|
+
};
|
|
3622
3660
|
var extendizeByKey = (element, parent, key) => {
|
|
3623
3661
|
const { context } = parent;
|
|
3624
3662
|
const { tag, extend, childExtends } = element;
|
|
3625
3663
|
const isSugar = checkIfSugar(element, parent, key);
|
|
3626
|
-
const extendFromKey =
|
|
3664
|
+
const extendFromKey = extractComponentKeyFromKey(key);
|
|
3627
3665
|
const isExtendKeyComponent = context && context.components[extendFromKey];
|
|
3628
3666
|
if (element === isExtendKeyComponent)
|
|
3629
3667
|
return element;
|
|
@@ -3743,7 +3781,7 @@ var require_cjs3 = __commonJS({
|
|
|
3743
3781
|
if (checkIfKeyIsComponent(key)) {
|
|
3744
3782
|
result.push(key);
|
|
3745
3783
|
}
|
|
3746
|
-
if (key === "extend") {
|
|
3784
|
+
if (key === "extend" || key === "extends") {
|
|
3747
3785
|
if (typeof o[key] === "string") {
|
|
3748
3786
|
result.push(o[key]);
|
|
3749
3787
|
} else if (Array.isArray(o[key])) {
|
|
@@ -4045,6 +4083,7 @@ __export(defaultConfig_exports, {
|
|
|
4045
4083
|
ANIMATION: () => ANIMATION,
|
|
4046
4084
|
BREAKPOINTS: () => BREAKPOINTS,
|
|
4047
4085
|
CASES: () => CASES,
|
|
4086
|
+
CLASS: () => CLASS,
|
|
4048
4087
|
COLOR: () => COLOR,
|
|
4049
4088
|
DEVICES: () => DEVICES,
|
|
4050
4089
|
DOCUMENT: () => DOCUMENT,
|
|
@@ -4234,6 +4273,10 @@ var TEMPLATES = {};
|
|
|
4234
4273
|
var defaultProps4 = {};
|
|
4235
4274
|
var GRID = defaultProps4;
|
|
4236
4275
|
|
|
4276
|
+
// src/defaultConfig/class.js
|
|
4277
|
+
var defaultProps5 = {};
|
|
4278
|
+
var CLASS = defaultProps5;
|
|
4279
|
+
|
|
4237
4280
|
// src/defaultConfig/index.js
|
|
4238
4281
|
var RESET = {};
|
|
4239
4282
|
|
package/dist/cjs/system/theme.js
CHANGED
|
@@ -300,6 +300,7 @@ var require_array = __commonJS({
|
|
|
300
300
|
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
301
301
|
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
302
302
|
arraysEqual: () => arraysEqual,
|
|
303
|
+
checkIfStringIsInArray: () => checkIfStringIsInArray,
|
|
303
304
|
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
304
305
|
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
305
306
|
filterArrays: () => filterArrays,
|
|
@@ -419,6 +420,11 @@ var require_array = __commonJS({
|
|
|
419
420
|
const excludeSet = new Set(excludeArr);
|
|
420
421
|
return sourceArr.filter((item) => !excludeSet.has(item));
|
|
421
422
|
};
|
|
423
|
+
var checkIfStringIsInArray = (string, arr) => {
|
|
424
|
+
if (!string)
|
|
425
|
+
return;
|
|
426
|
+
return arr.filter((v) => string.includes(v)).length;
|
|
427
|
+
};
|
|
422
428
|
}
|
|
423
429
|
});
|
|
424
430
|
|
|
@@ -473,14 +479,15 @@ var require_string = __commonJS({
|
|
|
473
479
|
2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
|
|
474
480
|
3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
|
|
475
481
|
};
|
|
476
|
-
|
|
482
|
+
function replaceLiteralsWithObjectFields(str, options = {}, forcedState) {
|
|
477
483
|
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
|
|
478
484
|
return str;
|
|
479
485
|
const reg = brackRegex[options.bracketsLength || 2];
|
|
486
|
+
const obj = forcedState || this.state || {};
|
|
480
487
|
return str.replace(reg, (_, parentPath, variable) => {
|
|
481
488
|
if (parentPath) {
|
|
482
489
|
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
|
|
483
|
-
let parentState =
|
|
490
|
+
let parentState = obj;
|
|
484
491
|
for (let i = 0; i < parentLevels; i++) {
|
|
485
492
|
parentState = parentState.parent;
|
|
486
493
|
if (!parentState) {
|
|
@@ -490,11 +497,11 @@ var require_string = __commonJS({
|
|
|
490
497
|
const value = parentState[variable.trim()];
|
|
491
498
|
return value !== void 0 ? `${value}` : "";
|
|
492
499
|
} else {
|
|
493
|
-
const value =
|
|
500
|
+
const value = obj[variable.trim()];
|
|
494
501
|
return value !== void 0 ? `${value}` : "";
|
|
495
502
|
}
|
|
496
503
|
});
|
|
497
|
-
}
|
|
504
|
+
}
|
|
498
505
|
var lowercaseFirstLetter = (inputString) => {
|
|
499
506
|
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
500
507
|
};
|
|
@@ -1651,6 +1658,7 @@ var require_component = __commonJS({
|
|
|
1651
1658
|
checkIfKeyIsProperty: () => checkIfKeyIsProperty,
|
|
1652
1659
|
checkIfSugar: () => checkIfSugar,
|
|
1653
1660
|
extendizeByKey: () => extendizeByKey,
|
|
1661
|
+
extractComponentKeyFromKey: () => extractComponentKeyFromKey,
|
|
1654
1662
|
getCapitalCaseKeys: () => getCapitalCaseKeys,
|
|
1655
1663
|
getChildrenComponentsByKey: () => getChildrenComponentsByKey,
|
|
1656
1664
|
getExtendsInElement: () => getExtendsInElement,
|
|
@@ -1707,11 +1715,14 @@ var require_component = __commonJS({
|
|
|
1707
1715
|
}
|
|
1708
1716
|
return !hasComponentAttrs || childProps || extendProps || children || childExtends;
|
|
1709
1717
|
};
|
|
1718
|
+
var extractComponentKeyFromKey = (key) => {
|
|
1719
|
+
return key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
|
|
1720
|
+
};
|
|
1710
1721
|
var extendizeByKey = (element, parent, key) => {
|
|
1711
1722
|
const { context } = parent;
|
|
1712
1723
|
const { tag, extend, childExtends } = element;
|
|
1713
1724
|
const isSugar = checkIfSugar(element, parent, key);
|
|
1714
|
-
const extendFromKey =
|
|
1725
|
+
const extendFromKey = extractComponentKeyFromKey(key);
|
|
1715
1726
|
const isExtendKeyComponent = context && context.components[extendFromKey];
|
|
1716
1727
|
if (element === isExtendKeyComponent)
|
|
1717
1728
|
return element;
|
|
@@ -1721,6 +1732,22 @@ var require_component = __commonJS({
|
|
|
1721
1732
|
tag,
|
|
1722
1733
|
props: { ...element }
|
|
1723
1734
|
});
|
|
1735
|
+
if (newElem.props.data) {
|
|
1736
|
+
newElem.data = newElem.props.data;
|
|
1737
|
+
delete newElem.props.data;
|
|
1738
|
+
}
|
|
1739
|
+
if (newElem.props.state) {
|
|
1740
|
+
newElem.state = newElem.props.state;
|
|
1741
|
+
delete newElem.props.state;
|
|
1742
|
+
}
|
|
1743
|
+
if (newElem.props.attr) {
|
|
1744
|
+
newElem.attr = newElem.props.attr;
|
|
1745
|
+
delete newElem.props.attr;
|
|
1746
|
+
}
|
|
1747
|
+
if (newElem.props.if) {
|
|
1748
|
+
newElem.if = newElem.props.if;
|
|
1749
|
+
delete newElem.props.if;
|
|
1750
|
+
}
|
|
1724
1751
|
if (childExtends)
|
|
1725
1752
|
newElem.childExtend = childExtends;
|
|
1726
1753
|
return newElem;
|
|
@@ -1831,7 +1858,7 @@ var require_component = __commonJS({
|
|
|
1831
1858
|
if (checkIfKeyIsComponent(key)) {
|
|
1832
1859
|
result.push(key);
|
|
1833
1860
|
}
|
|
1834
|
-
if (key === "extend") {
|
|
1861
|
+
if (key === "extend" || key === "extends") {
|
|
1835
1862
|
if (typeof o[key] === "string") {
|
|
1836
1863
|
result.push(o[key]);
|
|
1837
1864
|
} else if (Array.isArray(o[key])) {
|
|
@@ -2226,6 +2253,7 @@ var require_cjs3 = __commonJS({
|
|
|
2226
2253
|
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
2227
2254
|
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
2228
2255
|
arraysEqual: () => arraysEqual,
|
|
2256
|
+
checkIfStringIsInArray: () => checkIfStringIsInArray,
|
|
2229
2257
|
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
2230
2258
|
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
2231
2259
|
filterArrays: () => filterArrays,
|
|
@@ -2345,6 +2373,11 @@ var require_cjs3 = __commonJS({
|
|
|
2345
2373
|
const excludeSet = new Set(excludeArr);
|
|
2346
2374
|
return sourceArr.filter((item) => !excludeSet.has(item));
|
|
2347
2375
|
};
|
|
2376
|
+
var checkIfStringIsInArray = (string, arr) => {
|
|
2377
|
+
if (!string)
|
|
2378
|
+
return;
|
|
2379
|
+
return arr.filter((v) => string.includes(v)).length;
|
|
2380
|
+
};
|
|
2348
2381
|
}
|
|
2349
2382
|
});
|
|
2350
2383
|
var require_string2 = __commonJS2({
|
|
@@ -2397,14 +2430,15 @@ var require_cjs3 = __commonJS({
|
|
|
2397
2430
|
2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
|
|
2398
2431
|
3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
|
|
2399
2432
|
};
|
|
2400
|
-
|
|
2433
|
+
function replaceLiteralsWithObjectFields(str, options = {}, forcedState) {
|
|
2401
2434
|
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
|
|
2402
2435
|
return str;
|
|
2403
2436
|
const reg = brackRegex[options.bracketsLength || 2];
|
|
2437
|
+
const obj = forcedState || this.state || {};
|
|
2404
2438
|
return str.replace(reg, (_, parentPath, variable) => {
|
|
2405
2439
|
if (parentPath) {
|
|
2406
2440
|
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
|
|
2407
|
-
let parentState =
|
|
2441
|
+
let parentState = obj;
|
|
2408
2442
|
for (let i = 0; i < parentLevels; i++) {
|
|
2409
2443
|
parentState = parentState.parent;
|
|
2410
2444
|
if (!parentState) {
|
|
@@ -2414,11 +2448,11 @@ var require_cjs3 = __commonJS({
|
|
|
2414
2448
|
const value = parentState[variable.trim()];
|
|
2415
2449
|
return value !== void 0 ? `${value}` : "";
|
|
2416
2450
|
} else {
|
|
2417
|
-
const value =
|
|
2451
|
+
const value = obj[variable.trim()];
|
|
2418
2452
|
return value !== void 0 ? `${value}` : "";
|
|
2419
2453
|
}
|
|
2420
2454
|
});
|
|
2421
|
-
}
|
|
2455
|
+
}
|
|
2422
2456
|
var lowercaseFirstLetter = (inputString) => {
|
|
2423
2457
|
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
2424
2458
|
};
|
|
@@ -3563,6 +3597,7 @@ var require_cjs3 = __commonJS({
|
|
|
3563
3597
|
checkIfKeyIsProperty: () => checkIfKeyIsProperty,
|
|
3564
3598
|
checkIfSugar: () => checkIfSugar,
|
|
3565
3599
|
extendizeByKey: () => extendizeByKey,
|
|
3600
|
+
extractComponentKeyFromKey: () => extractComponentKeyFromKey,
|
|
3566
3601
|
getCapitalCaseKeys: () => getCapitalCaseKeys,
|
|
3567
3602
|
getChildrenComponentsByKey: () => getChildrenComponentsByKey,
|
|
3568
3603
|
getExtendsInElement: () => getExtendsInElement,
|
|
@@ -3619,11 +3654,14 @@ var require_cjs3 = __commonJS({
|
|
|
3619
3654
|
}
|
|
3620
3655
|
return !hasComponentAttrs || childProps || extendProps || children || childExtends;
|
|
3621
3656
|
};
|
|
3657
|
+
var extractComponentKeyFromKey = (key) => {
|
|
3658
|
+
return key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
|
|
3659
|
+
};
|
|
3622
3660
|
var extendizeByKey = (element, parent, key) => {
|
|
3623
3661
|
const { context } = parent;
|
|
3624
3662
|
const { tag, extend, childExtends } = element;
|
|
3625
3663
|
const isSugar = checkIfSugar(element, parent, key);
|
|
3626
|
-
const extendFromKey =
|
|
3664
|
+
const extendFromKey = extractComponentKeyFromKey(key);
|
|
3627
3665
|
const isExtendKeyComponent = context && context.components[extendFromKey];
|
|
3628
3666
|
if (element === isExtendKeyComponent)
|
|
3629
3667
|
return element;
|
|
@@ -3743,7 +3781,7 @@ var require_cjs3 = __commonJS({
|
|
|
3743
3781
|
if (checkIfKeyIsComponent(key)) {
|
|
3744
3782
|
result.push(key);
|
|
3745
3783
|
}
|
|
3746
|
-
if (key === "extend") {
|
|
3784
|
+
if (key === "extend" || key === "extends") {
|
|
3747
3785
|
if (typeof o[key] === "string") {
|
|
3748
3786
|
result.push(o[key]);
|
|
3749
3787
|
} else if (Array.isArray(o[key])) {
|
|
@@ -4039,6 +4077,7 @@ __export(defaultConfig_exports, {
|
|
|
4039
4077
|
ANIMATION: () => ANIMATION,
|
|
4040
4078
|
BREAKPOINTS: () => BREAKPOINTS,
|
|
4041
4079
|
CASES: () => CASES,
|
|
4080
|
+
CLASS: () => CLASS,
|
|
4042
4081
|
COLOR: () => COLOR,
|
|
4043
4082
|
DEVICES: () => DEVICES,
|
|
4044
4083
|
DOCUMENT: () => DOCUMENT,
|
|
@@ -4228,6 +4267,10 @@ var TEMPLATES = {};
|
|
|
4228
4267
|
var defaultProps4 = {};
|
|
4229
4268
|
var GRID = defaultProps4;
|
|
4230
4269
|
|
|
4270
|
+
// src/defaultConfig/class.js
|
|
4271
|
+
var defaultProps5 = {};
|
|
4272
|
+
var CLASS = defaultProps5;
|
|
4273
|
+
|
|
4231
4274
|
// src/defaultConfig/index.js
|
|
4232
4275
|
var RESET = {};
|
|
4233
4276
|
|