@symbo.ls/scratch 2.11.470 → 2.11.497
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/factory.js +59 -72
- package/dist/cjs/index.js +118 -144
- package/dist/cjs/set.js +118 -144
- package/dist/cjs/system/color.js +118 -144
- package/dist/cjs/system/document.js +118 -144
- package/dist/cjs/system/font.js +118 -144
- package/dist/cjs/system/index.js +118 -144
- package/dist/cjs/system/reset.js +118 -144
- package/dist/cjs/system/shadow.js +118 -144
- package/dist/cjs/system/spacing.js +118 -144
- package/dist/cjs/system/svg.js +118 -144
- package/dist/cjs/system/theme.js +118 -144
- package/dist/cjs/system/timing.js +118 -144
- package/dist/cjs/system/typography.js +118 -144
- package/dist/cjs/transforms/index.js +118 -144
- package/dist/cjs/utils/color.js +59 -72
- package/dist/cjs/utils/index.js +118 -144
- package/dist/cjs/utils/sequence.js +118 -144
- package/dist/cjs/utils/sprite.js +59 -72
- package/dist/cjs/utils/var.js +118 -144
- package/package.json +5 -5
|
@@ -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,
|
|
@@ -369,11 +370,11 @@ var require_cjs = __commonJS({
|
|
|
369
370
|
var joinArrays = (...arrays) => {
|
|
370
371
|
return [].concat(...arrays);
|
|
371
372
|
};
|
|
372
|
-
var mergeArray = (arr,
|
|
373
|
-
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.
|
|
373
|
+
var mergeArray = (arr, exclude = []) => {
|
|
374
|
+
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, { exclude }), exclude), {});
|
|
374
375
|
};
|
|
375
376
|
var mergeAndCloneIfArray = (obj) => {
|
|
376
|
-
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.
|
|
377
|
+
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
377
378
|
};
|
|
378
379
|
var cutArrayBeforeValue = (arr, value) => {
|
|
379
380
|
const index = arr.indexOf(value);
|
|
@@ -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
|
};
|
|
@@ -618,8 +625,6 @@ var require_cjs = __commonJS({
|
|
|
618
625
|
createNestedObject: () => createNestedObject,
|
|
619
626
|
createObjectWithoutPrototype: () => createObjectWithoutPrototype,
|
|
620
627
|
deepClone: () => deepClone2,
|
|
621
|
-
deepCloneExclude: () => deepCloneExclude,
|
|
622
|
-
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
623
628
|
deepContains: () => deepContains,
|
|
624
629
|
deepDestringify: () => deepDestringify,
|
|
625
630
|
deepDiff: () => deepDiff,
|
|
@@ -713,78 +718,56 @@ var require_cjs = __commonJS({
|
|
|
713
718
|
}
|
|
714
719
|
return o;
|
|
715
720
|
};
|
|
716
|
-
var
|
|
717
|
-
|
|
718
|
-
return obj.map((x) => deepCloneExclude(x, excludeFrom));
|
|
719
|
-
}
|
|
720
|
-
const o = {};
|
|
721
|
-
for (const k in obj) {
|
|
722
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
|
|
723
|
-
if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
|
|
724
|
-
continue;
|
|
725
|
-
let v = obj[k];
|
|
726
|
-
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
727
|
-
v = mergeArrayExclude(v, excludeFrom);
|
|
728
|
-
}
|
|
729
|
-
if ((0, import_types.isArray)(v)) {
|
|
730
|
-
o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
|
|
731
|
-
} else if ((0, import_types.isObject)(v)) {
|
|
732
|
-
o[k] = deepCloneExclude(v, excludeFrom);
|
|
733
|
-
} else
|
|
734
|
-
o[k] = v;
|
|
735
|
-
}
|
|
736
|
-
return o;
|
|
737
|
-
};
|
|
738
|
-
var mergeArrayExclude = (arr, excl = []) => {
|
|
739
|
-
return arr.reduce((acc, curr) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
|
|
721
|
+
var mergeArrayExclude = (arr, exclude = []) => {
|
|
722
|
+
return arr.reduce((acc, curr) => deepMerge2(acc, deepClone2(curr, { exclude })), {});
|
|
740
723
|
};
|
|
741
|
-
var deepClone2 = (obj,
|
|
742
|
-
|
|
724
|
+
var deepClone2 = (obj, options = {}) => {
|
|
725
|
+
const {
|
|
726
|
+
exclude = [],
|
|
727
|
+
cleanUndefined = false,
|
|
728
|
+
cleanNull = false,
|
|
729
|
+
window: targetWindow,
|
|
730
|
+
visited = /* @__PURE__ */ new WeakMap(),
|
|
731
|
+
handleExtend = false
|
|
732
|
+
} = options;
|
|
733
|
+
if (!(0, import_types.isObjectLike)(obj) || (0, import_node.isDOMNode)(obj)) {
|
|
743
734
|
return obj;
|
|
744
|
-
|
|
735
|
+
}
|
|
736
|
+
if (visited.has(obj)) {
|
|
745
737
|
return visited.get(obj);
|
|
746
|
-
|
|
738
|
+
}
|
|
739
|
+
const clone2 = targetWindow ? (0, import_types.isArray)(obj) ? new targetWindow.Array() : new targetWindow.Object() : (0, import_types.isArray)(obj) ? [] : {};
|
|
747
740
|
visited.set(obj, clone2);
|
|
748
741
|
for (const key in obj) {
|
|
749
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
return clone2;
|
|
763
|
-
};
|
|
764
|
-
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}, visited = /* @__PURE__ */ new WeakSet()) => {
|
|
765
|
-
if ((0, import_types.isObjectLike)(obj)) {
|
|
766
|
-
if (visited.has(obj)) {
|
|
767
|
-
return obj;
|
|
742
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
743
|
+
continue;
|
|
744
|
+
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
745
|
+
continue;
|
|
746
|
+
const value = obj[key];
|
|
747
|
+
if (cleanUndefined && (0, import_types.isUndefined)(value) || cleanNull && (0, import_types.isNull)(value))
|
|
748
|
+
continue;
|
|
749
|
+
if ((0, import_node.isDOMNode)(value)) {
|
|
750
|
+
clone2[key] = value;
|
|
751
|
+
continue;
|
|
768
752
|
}
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
|
|
772
|
-
for (const prop in obj) {
|
|
773
|
-
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
753
|
+
if (handleExtend && key === "extend" && (0, import_types.isArray)(value)) {
|
|
754
|
+
clone2[key] = (0, import_array.mergeArray)(value, exclude);
|
|
774
755
|
continue;
|
|
775
|
-
|
|
776
|
-
if (
|
|
756
|
+
}
|
|
757
|
+
if ((0, import_types.isFunction)(value) && targetWindow) {
|
|
758
|
+
clone2[key] = targetWindow.eval("(" + value.toString() + ")");
|
|
777
759
|
continue;
|
|
778
760
|
}
|
|
779
|
-
if ((0, import_types.isObjectLike)(
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
761
|
+
if ((0, import_types.isObjectLike)(value)) {
|
|
762
|
+
clone2[key] = deepClone2(value, {
|
|
763
|
+
...options,
|
|
764
|
+
visited
|
|
765
|
+
});
|
|
783
766
|
} else {
|
|
784
|
-
|
|
767
|
+
clone2[key] = value;
|
|
785
768
|
}
|
|
786
769
|
}
|
|
787
|
-
return
|
|
770
|
+
return clone2;
|
|
788
771
|
};
|
|
789
772
|
var deepStringify = (obj, stringified = {}) => {
|
|
790
773
|
var _a, _b;
|
|
@@ -1684,6 +1667,7 @@ var require_cjs = __commonJS({
|
|
|
1684
1667
|
checkIfKeyIsProperty: () => checkIfKeyIsProperty,
|
|
1685
1668
|
checkIfSugar: () => checkIfSugar,
|
|
1686
1669
|
extendizeByKey: () => extendizeByKey,
|
|
1670
|
+
extractComponentKeyFromKey: () => extractComponentKeyFromKey,
|
|
1687
1671
|
getCapitalCaseKeys: () => getCapitalCaseKeys,
|
|
1688
1672
|
getChildrenComponentsByKey: () => getChildrenComponentsByKey,
|
|
1689
1673
|
getExtendsInElement: () => getExtendsInElement,
|
|
@@ -1740,11 +1724,14 @@ var require_cjs = __commonJS({
|
|
|
1740
1724
|
}
|
|
1741
1725
|
return !hasComponentAttrs || childProps || extendProps || children || childExtends;
|
|
1742
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
|
+
};
|
|
1743
1730
|
var extendizeByKey = (element, parent, key) => {
|
|
1744
1731
|
const { context } = parent;
|
|
1745
1732
|
const { tag, extend, childExtends } = element;
|
|
1746
1733
|
const isSugar = checkIfSugar(element, parent, key);
|
|
1747
|
-
const extendFromKey =
|
|
1734
|
+
const extendFromKey = extractComponentKeyFromKey(key);
|
|
1748
1735
|
const isExtendKeyComponent = context && context.components[extendFromKey];
|
|
1749
1736
|
if (element === isExtendKeyComponent)
|
|
1750
1737
|
return element;
|
|
@@ -1793,7 +1780,7 @@ var require_cjs = __commonJS({
|
|
|
1793
1780
|
if (newChild === null)
|
|
1794
1781
|
assignChild(null);
|
|
1795
1782
|
else if (!childElem)
|
|
1796
|
-
assignChild((0, import__.
|
|
1783
|
+
assignChild((0, import__.deepClone)(newChild));
|
|
1797
1784
|
else {
|
|
1798
1785
|
const isSugarChildElem = checkIfSugar(childElem, parent, key);
|
|
1799
1786
|
if (isSugarChildElem)
|
|
@@ -1864,7 +1851,7 @@ var require_cjs = __commonJS({
|
|
|
1864
1851
|
if (checkIfKeyIsComponent(key)) {
|
|
1865
1852
|
result.push(key);
|
|
1866
1853
|
}
|
|
1867
|
-
if (key === "extend") {
|
|
1854
|
+
if (key === "extend" || key === "extends") {
|
|
1868
1855
|
if (typeof o[key] === "string") {
|
|
1869
1856
|
result.push(o[key]);
|
|
1870
1857
|
} else if (Array.isArray(o[key])) {
|
|
@@ -2408,6 +2395,7 @@ var require_array = __commonJS({
|
|
|
2408
2395
|
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
2409
2396
|
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
2410
2397
|
arraysEqual: () => arraysEqual,
|
|
2398
|
+
checkIfStringIsInArray: () => checkIfStringIsInArray,
|
|
2411
2399
|
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
2412
2400
|
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
2413
2401
|
filterArrays: () => filterArrays,
|
|
@@ -2454,11 +2442,11 @@ var require_array = __commonJS({
|
|
|
2454
2442
|
var joinArrays = (...arrays) => {
|
|
2455
2443
|
return [].concat(...arrays);
|
|
2456
2444
|
};
|
|
2457
|
-
var mergeArray = (arr,
|
|
2458
|
-
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.
|
|
2445
|
+
var mergeArray = (arr, exclude = []) => {
|
|
2446
|
+
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, { exclude }), exclude), {});
|
|
2459
2447
|
};
|
|
2460
2448
|
var mergeAndCloneIfArray = (obj) => {
|
|
2461
|
-
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.
|
|
2449
|
+
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
2462
2450
|
};
|
|
2463
2451
|
var cutArrayBeforeValue = (arr, value) => {
|
|
2464
2452
|
const index = arr.indexOf(value);
|
|
@@ -2527,6 +2515,11 @@ var require_array = __commonJS({
|
|
|
2527
2515
|
const excludeSet = new Set(excludeArr);
|
|
2528
2516
|
return sourceArr.filter((item) => !excludeSet.has(item));
|
|
2529
2517
|
};
|
|
2518
|
+
var checkIfStringIsInArray = (string, arr) => {
|
|
2519
|
+
if (!string)
|
|
2520
|
+
return;
|
|
2521
|
+
return arr.filter((v) => string.includes(v)).length;
|
|
2522
|
+
};
|
|
2530
2523
|
}
|
|
2531
2524
|
});
|
|
2532
2525
|
|
|
@@ -2581,14 +2574,15 @@ var require_string = __commonJS({
|
|
|
2581
2574
|
2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
|
|
2582
2575
|
3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
|
|
2583
2576
|
};
|
|
2584
|
-
|
|
2577
|
+
function replaceLiteralsWithObjectFields(str, options = {}, forcedState) {
|
|
2585
2578
|
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
|
|
2586
2579
|
return str;
|
|
2587
2580
|
const reg = brackRegex[options.bracketsLength || 2];
|
|
2581
|
+
const obj = forcedState || this.state || {};
|
|
2588
2582
|
return str.replace(reg, (_, parentPath, variable) => {
|
|
2589
2583
|
if (parentPath) {
|
|
2590
2584
|
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
|
|
2591
|
-
let parentState =
|
|
2585
|
+
let parentState = obj;
|
|
2592
2586
|
for (let i = 0; i < parentLevels; i++) {
|
|
2593
2587
|
parentState = parentState.parent;
|
|
2594
2588
|
if (!parentState) {
|
|
@@ -2598,11 +2592,11 @@ var require_string = __commonJS({
|
|
|
2598
2592
|
const value = parentState[variable.trim()];
|
|
2599
2593
|
return value !== void 0 ? `${value}` : "";
|
|
2600
2594
|
} else {
|
|
2601
|
-
const value =
|
|
2595
|
+
const value = obj[variable.trim()];
|
|
2602
2596
|
return value !== void 0 ? `${value}` : "";
|
|
2603
2597
|
}
|
|
2604
2598
|
});
|
|
2605
|
-
}
|
|
2599
|
+
}
|
|
2606
2600
|
var lowercaseFirstLetter = (inputString) => {
|
|
2607
2601
|
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
2608
2602
|
};
|
|
@@ -2707,8 +2701,6 @@ var require_object = __commonJS({
|
|
|
2707
2701
|
createNestedObject: () => createNestedObject,
|
|
2708
2702
|
createObjectWithoutPrototype: () => createObjectWithoutPrototype,
|
|
2709
2703
|
deepClone: () => deepClone2,
|
|
2710
|
-
deepCloneExclude: () => deepCloneExclude,
|
|
2711
|
-
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
2712
2704
|
deepContains: () => deepContains,
|
|
2713
2705
|
deepDestringify: () => deepDestringify,
|
|
2714
2706
|
deepDiff: () => deepDiff,
|
|
@@ -2802,78 +2794,56 @@ var require_object = __commonJS({
|
|
|
2802
2794
|
}
|
|
2803
2795
|
return o;
|
|
2804
2796
|
};
|
|
2805
|
-
var
|
|
2806
|
-
|
|
2807
|
-
return obj.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2808
|
-
}
|
|
2809
|
-
const o = {};
|
|
2810
|
-
for (const k in obj) {
|
|
2811
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
|
|
2812
|
-
if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
|
|
2813
|
-
continue;
|
|
2814
|
-
let v = obj[k];
|
|
2815
|
-
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
2816
|
-
v = mergeArrayExclude(v, excludeFrom);
|
|
2817
|
-
}
|
|
2818
|
-
if ((0, import_types.isArray)(v)) {
|
|
2819
|
-
o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2820
|
-
} else if ((0, import_types.isObject)(v)) {
|
|
2821
|
-
o[k] = deepCloneExclude(v, excludeFrom);
|
|
2822
|
-
} else
|
|
2823
|
-
o[k] = v;
|
|
2824
|
-
}
|
|
2825
|
-
return o;
|
|
2797
|
+
var mergeArrayExclude = (arr, exclude = []) => {
|
|
2798
|
+
return arr.reduce((acc, curr) => deepMerge2(acc, deepClone2(curr, { exclude })), {});
|
|
2826
2799
|
};
|
|
2827
|
-
var
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2800
|
+
var deepClone2 = (obj, options = {}) => {
|
|
2801
|
+
const {
|
|
2802
|
+
exclude = [],
|
|
2803
|
+
cleanUndefined = false,
|
|
2804
|
+
cleanNull = false,
|
|
2805
|
+
window: targetWindow,
|
|
2806
|
+
visited = /* @__PURE__ */ new WeakMap(),
|
|
2807
|
+
handleExtend = false
|
|
2808
|
+
} = options;
|
|
2809
|
+
if (!(0, import_types.isObjectLike)(obj) || (0, import_node.isDOMNode)(obj)) {
|
|
2832
2810
|
return obj;
|
|
2833
|
-
|
|
2811
|
+
}
|
|
2812
|
+
if (visited.has(obj)) {
|
|
2834
2813
|
return visited.get(obj);
|
|
2835
|
-
|
|
2814
|
+
}
|
|
2815
|
+
const clone2 = targetWindow ? (0, import_types.isArray)(obj) ? new targetWindow.Array() : new targetWindow.Object() : (0, import_types.isArray)(obj) ? [] : {};
|
|
2836
2816
|
visited.set(obj, clone2);
|
|
2837
2817
|
for (const key in obj) {
|
|
2838
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
}
|
|
2849
|
-
}
|
|
2850
|
-
}
|
|
2851
|
-
return clone2;
|
|
2852
|
-
};
|
|
2853
|
-
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}, visited = /* @__PURE__ */ new WeakSet()) => {
|
|
2854
|
-
if ((0, import_types.isObjectLike)(obj)) {
|
|
2855
|
-
if (visited.has(obj)) {
|
|
2856
|
-
return obj;
|
|
2818
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
2819
|
+
continue;
|
|
2820
|
+
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
2821
|
+
continue;
|
|
2822
|
+
const value = obj[key];
|
|
2823
|
+
if (cleanUndefined && (0, import_types.isUndefined)(value) || cleanNull && (0, import_types.isNull)(value))
|
|
2824
|
+
continue;
|
|
2825
|
+
if ((0, import_node.isDOMNode)(value)) {
|
|
2826
|
+
clone2[key] = value;
|
|
2827
|
+
continue;
|
|
2857
2828
|
}
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
|
|
2861
|
-
for (const prop in obj) {
|
|
2862
|
-
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
2829
|
+
if (handleExtend && key === "extend" && (0, import_types.isArray)(value)) {
|
|
2830
|
+
clone2[key] = (0, import_array.mergeArray)(value, exclude);
|
|
2863
2831
|
continue;
|
|
2864
|
-
|
|
2865
|
-
if (
|
|
2832
|
+
}
|
|
2833
|
+
if ((0, import_types.isFunction)(value) && targetWindow) {
|
|
2834
|
+
clone2[key] = targetWindow.eval("(" + value.toString() + ")");
|
|
2866
2835
|
continue;
|
|
2867
2836
|
}
|
|
2868
|
-
if ((0, import_types.isObjectLike)(
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2837
|
+
if ((0, import_types.isObjectLike)(value)) {
|
|
2838
|
+
clone2[key] = deepClone2(value, {
|
|
2839
|
+
...options,
|
|
2840
|
+
visited
|
|
2841
|
+
});
|
|
2872
2842
|
} else {
|
|
2873
|
-
|
|
2843
|
+
clone2[key] = value;
|
|
2874
2844
|
}
|
|
2875
2845
|
}
|
|
2876
|
-
return
|
|
2846
|
+
return clone2;
|
|
2877
2847
|
};
|
|
2878
2848
|
var deepStringify = (obj, stringified = {}) => {
|
|
2879
2849
|
var _a, _b;
|
|
@@ -3783,6 +3753,7 @@ var require_component = __commonJS({
|
|
|
3783
3753
|
checkIfKeyIsProperty: () => checkIfKeyIsProperty,
|
|
3784
3754
|
checkIfSugar: () => checkIfSugar,
|
|
3785
3755
|
extendizeByKey: () => extendizeByKey,
|
|
3756
|
+
extractComponentKeyFromKey: () => extractComponentKeyFromKey,
|
|
3786
3757
|
getCapitalCaseKeys: () => getCapitalCaseKeys,
|
|
3787
3758
|
getChildrenComponentsByKey: () => getChildrenComponentsByKey,
|
|
3788
3759
|
getExtendsInElement: () => getExtendsInElement,
|
|
@@ -3839,11 +3810,14 @@ var require_component = __commonJS({
|
|
|
3839
3810
|
}
|
|
3840
3811
|
return !hasComponentAttrs || childProps || extendProps || children || childExtends;
|
|
3841
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
|
+
};
|
|
3842
3816
|
var extendizeByKey = (element, parent, key) => {
|
|
3843
3817
|
const { context } = parent;
|
|
3844
3818
|
const { tag, extend, childExtends } = element;
|
|
3845
3819
|
const isSugar = checkIfSugar(element, parent, key);
|
|
3846
|
-
const extendFromKey =
|
|
3820
|
+
const extendFromKey = extractComponentKeyFromKey(key);
|
|
3847
3821
|
const isExtendKeyComponent = context && context.components[extendFromKey];
|
|
3848
3822
|
if (element === isExtendKeyComponent)
|
|
3849
3823
|
return element;
|
|
@@ -3892,7 +3866,7 @@ var require_component = __commonJS({
|
|
|
3892
3866
|
if (newChild === null)
|
|
3893
3867
|
assignChild(null);
|
|
3894
3868
|
else if (!childElem)
|
|
3895
|
-
assignChild((0, import__.
|
|
3869
|
+
assignChild((0, import__.deepClone)(newChild));
|
|
3896
3870
|
else {
|
|
3897
3871
|
const isSugarChildElem = checkIfSugar(childElem, parent, key);
|
|
3898
3872
|
if (isSugarChildElem)
|
|
@@ -3963,7 +3937,7 @@ var require_component = __commonJS({
|
|
|
3963
3937
|
if (checkIfKeyIsComponent(key)) {
|
|
3964
3938
|
result.push(key);
|
|
3965
3939
|
}
|
|
3966
|
-
if (key === "extend") {
|
|
3940
|
+
if (key === "extend" || key === "extends") {
|
|
3967
3941
|
if (typeof o[key] === "string") {
|
|
3968
3942
|
result.push(o[key]);
|
|
3969
3943
|
} else if (Array.isArray(o[key])) {
|