@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
package/dist/cjs/system/color.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])) {
|
|
@@ -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
|
|
|
@@ -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])) {
|
|
@@ -4034,6 +4072,7 @@ __export(defaultConfig_exports, {
|
|
|
4034
4072
|
ANIMATION: () => ANIMATION,
|
|
4035
4073
|
BREAKPOINTS: () => BREAKPOINTS,
|
|
4036
4074
|
CASES: () => CASES,
|
|
4075
|
+
CLASS: () => CLASS,
|
|
4037
4076
|
COLOR: () => COLOR,
|
|
4038
4077
|
DEVICES: () => DEVICES,
|
|
4039
4078
|
DOCUMENT: () => DOCUMENT,
|
|
@@ -4223,6 +4262,10 @@ var TEMPLATES = {};
|
|
|
4223
4262
|
var defaultProps4 = {};
|
|
4224
4263
|
var GRID = defaultProps4;
|
|
4225
4264
|
|
|
4265
|
+
// src/defaultConfig/class.js
|
|
4266
|
+
var defaultProps5 = {};
|
|
4267
|
+
var CLASS = defaultProps5;
|
|
4268
|
+
|
|
4226
4269
|
// src/defaultConfig/index.js
|
|
4227
4270
|
var RESET = {};
|
|
4228
4271
|
|
package/dist/cjs/system/font.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])) {
|
|
@@ -2190,6 +2217,7 @@ var require_cjs2 = __commonJS({
|
|
|
2190
2217
|
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
2191
2218
|
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
2192
2219
|
arraysEqual: () => arraysEqual,
|
|
2220
|
+
checkIfStringIsInArray: () => checkIfStringIsInArray,
|
|
2193
2221
|
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
2194
2222
|
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
2195
2223
|
filterArrays: () => filterArrays,
|
|
@@ -2309,6 +2337,11 @@ var require_cjs2 = __commonJS({
|
|
|
2309
2337
|
const excludeSet = new Set(excludeArr);
|
|
2310
2338
|
return sourceArr.filter((item) => !excludeSet.has(item));
|
|
2311
2339
|
};
|
|
2340
|
+
var checkIfStringIsInArray = (string, arr) => {
|
|
2341
|
+
if (!string)
|
|
2342
|
+
return;
|
|
2343
|
+
return arr.filter((v) => string.includes(v)).length;
|
|
2344
|
+
};
|
|
2312
2345
|
}
|
|
2313
2346
|
});
|
|
2314
2347
|
var require_string2 = __commonJS2({
|
|
@@ -2361,14 +2394,15 @@ var require_cjs2 = __commonJS({
|
|
|
2361
2394
|
2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
|
|
2362
2395
|
3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
|
|
2363
2396
|
};
|
|
2364
|
-
|
|
2397
|
+
function replaceLiteralsWithObjectFields(str, options = {}, forcedState) {
|
|
2365
2398
|
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
|
|
2366
2399
|
return str;
|
|
2367
2400
|
const reg = brackRegex[options.bracketsLength || 2];
|
|
2401
|
+
const obj = forcedState || this.state || {};
|
|
2368
2402
|
return str.replace(reg, (_, parentPath, variable) => {
|
|
2369
2403
|
if (parentPath) {
|
|
2370
2404
|
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
|
|
2371
|
-
let parentState =
|
|
2405
|
+
let parentState = obj;
|
|
2372
2406
|
for (let i = 0; i < parentLevels; i++) {
|
|
2373
2407
|
parentState = parentState.parent;
|
|
2374
2408
|
if (!parentState) {
|
|
@@ -2378,11 +2412,11 @@ var require_cjs2 = __commonJS({
|
|
|
2378
2412
|
const value = parentState[variable.trim()];
|
|
2379
2413
|
return value !== void 0 ? `${value}` : "";
|
|
2380
2414
|
} else {
|
|
2381
|
-
const value =
|
|
2415
|
+
const value = obj[variable.trim()];
|
|
2382
2416
|
return value !== void 0 ? `${value}` : "";
|
|
2383
2417
|
}
|
|
2384
2418
|
});
|
|
2385
|
-
}
|
|
2419
|
+
}
|
|
2386
2420
|
var lowercaseFirstLetter = (inputString) => {
|
|
2387
2421
|
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
2388
2422
|
};
|
|
@@ -3527,6 +3561,7 @@ var require_cjs2 = __commonJS({
|
|
|
3527
3561
|
checkIfKeyIsProperty: () => checkIfKeyIsProperty,
|
|
3528
3562
|
checkIfSugar: () => checkIfSugar,
|
|
3529
3563
|
extendizeByKey: () => extendizeByKey,
|
|
3564
|
+
extractComponentKeyFromKey: () => extractComponentKeyFromKey,
|
|
3530
3565
|
getCapitalCaseKeys: () => getCapitalCaseKeys,
|
|
3531
3566
|
getChildrenComponentsByKey: () => getChildrenComponentsByKey,
|
|
3532
3567
|
getExtendsInElement: () => getExtendsInElement,
|
|
@@ -3583,11 +3618,14 @@ var require_cjs2 = __commonJS({
|
|
|
3583
3618
|
}
|
|
3584
3619
|
return !hasComponentAttrs || childProps || extendProps || children || childExtends;
|
|
3585
3620
|
};
|
|
3621
|
+
var extractComponentKeyFromKey = (key) => {
|
|
3622
|
+
return key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
|
|
3623
|
+
};
|
|
3586
3624
|
var extendizeByKey = (element, parent, key) => {
|
|
3587
3625
|
const { context } = parent;
|
|
3588
3626
|
const { tag, extend, childExtends } = element;
|
|
3589
3627
|
const isSugar = checkIfSugar(element, parent, key);
|
|
3590
|
-
const extendFromKey =
|
|
3628
|
+
const extendFromKey = extractComponentKeyFromKey(key);
|
|
3591
3629
|
const isExtendKeyComponent = context && context.components[extendFromKey];
|
|
3592
3630
|
if (element === isExtendKeyComponent)
|
|
3593
3631
|
return element;
|
|
@@ -3707,7 +3745,7 @@ var require_cjs2 = __commonJS({
|
|
|
3707
3745
|
if (checkIfKeyIsComponent(key)) {
|
|
3708
3746
|
result.push(key);
|
|
3709
3747
|
}
|
|
3710
|
-
if (key === "extend") {
|
|
3748
|
+
if (key === "extend" || key === "extends") {
|
|
3711
3749
|
if (typeof o[key] === "string") {
|
|
3712
3750
|
result.push(o[key]);
|
|
3713
3751
|
} 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
|
|