@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
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,
|
|
@@ -346,11 +347,11 @@ var require_array = __commonJS({
|
|
|
346
347
|
var joinArrays = (...arrays) => {
|
|
347
348
|
return [].concat(...arrays);
|
|
348
349
|
};
|
|
349
|
-
var mergeArray = (arr,
|
|
350
|
-
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.
|
|
350
|
+
var mergeArray = (arr, exclude = []) => {
|
|
351
|
+
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, { exclude }), exclude), {});
|
|
351
352
|
};
|
|
352
353
|
var mergeAndCloneIfArray = (obj) => {
|
|
353
|
-
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.
|
|
354
|
+
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
354
355
|
};
|
|
355
356
|
var cutArrayBeforeValue = (arr, value) => {
|
|
356
357
|
const index = arr.indexOf(value);
|
|
@@ -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
|
};
|
|
@@ -599,8 +606,6 @@ var require_object = __commonJS({
|
|
|
599
606
|
createNestedObject: () => createNestedObject,
|
|
600
607
|
createObjectWithoutPrototype: () => createObjectWithoutPrototype,
|
|
601
608
|
deepClone: () => deepClone2,
|
|
602
|
-
deepCloneExclude: () => deepCloneExclude,
|
|
603
|
-
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
604
609
|
deepContains: () => deepContains,
|
|
605
610
|
deepDestringify: () => deepDestringify,
|
|
606
611
|
deepDiff: () => deepDiff,
|
|
@@ -694,78 +699,56 @@ var require_object = __commonJS({
|
|
|
694
699
|
}
|
|
695
700
|
return o;
|
|
696
701
|
};
|
|
697
|
-
var
|
|
698
|
-
|
|
699
|
-
return obj.map((x) => deepCloneExclude(x, excludeFrom));
|
|
700
|
-
}
|
|
701
|
-
const o = {};
|
|
702
|
-
for (const k in obj) {
|
|
703
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
|
|
704
|
-
if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
|
|
705
|
-
continue;
|
|
706
|
-
let v = obj[k];
|
|
707
|
-
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
708
|
-
v = mergeArrayExclude(v, excludeFrom);
|
|
709
|
-
}
|
|
710
|
-
if ((0, import_types.isArray)(v)) {
|
|
711
|
-
o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
|
|
712
|
-
} else if ((0, import_types.isObject)(v)) {
|
|
713
|
-
o[k] = deepCloneExclude(v, excludeFrom);
|
|
714
|
-
} else
|
|
715
|
-
o[k] = v;
|
|
716
|
-
}
|
|
717
|
-
return o;
|
|
718
|
-
};
|
|
719
|
-
var mergeArrayExclude = (arr, excl = []) => {
|
|
720
|
-
return arr.reduce((acc, curr) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
|
|
702
|
+
var mergeArrayExclude = (arr, exclude = []) => {
|
|
703
|
+
return arr.reduce((acc, curr) => deepMerge2(acc, deepClone2(curr, { exclude })), {});
|
|
721
704
|
};
|
|
722
|
-
var deepClone2 = (obj,
|
|
723
|
-
|
|
705
|
+
var deepClone2 = (obj, options = {}) => {
|
|
706
|
+
const {
|
|
707
|
+
exclude = [],
|
|
708
|
+
cleanUndefined = false,
|
|
709
|
+
cleanNull = false,
|
|
710
|
+
window: targetWindow,
|
|
711
|
+
visited = /* @__PURE__ */ new WeakMap(),
|
|
712
|
+
handleExtend = false
|
|
713
|
+
} = options;
|
|
714
|
+
if (!(0, import_types.isObjectLike)(obj) || (0, import_node.isDOMNode)(obj)) {
|
|
724
715
|
return obj;
|
|
725
|
-
|
|
716
|
+
}
|
|
717
|
+
if (visited.has(obj)) {
|
|
726
718
|
return visited.get(obj);
|
|
727
|
-
|
|
719
|
+
}
|
|
720
|
+
const clone2 = targetWindow ? (0, import_types.isArray)(obj) ? new targetWindow.Array() : new targetWindow.Object() : (0, import_types.isArray)(obj) ? [] : {};
|
|
728
721
|
visited.set(obj, clone2);
|
|
729
722
|
for (const key in obj) {
|
|
730
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
return clone2;
|
|
744
|
-
};
|
|
745
|
-
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}, visited = /* @__PURE__ */ new WeakSet()) => {
|
|
746
|
-
if ((0, import_types.isObjectLike)(obj)) {
|
|
747
|
-
if (visited.has(obj)) {
|
|
748
|
-
return obj;
|
|
723
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
724
|
+
continue;
|
|
725
|
+
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
726
|
+
continue;
|
|
727
|
+
const value = obj[key];
|
|
728
|
+
if (cleanUndefined && (0, import_types.isUndefined)(value) || cleanNull && (0, import_types.isNull)(value))
|
|
729
|
+
continue;
|
|
730
|
+
if ((0, import_node.isDOMNode)(value)) {
|
|
731
|
+
clone2[key] = value;
|
|
732
|
+
continue;
|
|
749
733
|
}
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
|
|
753
|
-
for (const prop in obj) {
|
|
754
|
-
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
734
|
+
if (handleExtend && key === "extend" && (0, import_types.isArray)(value)) {
|
|
735
|
+
clone2[key] = (0, import_array.mergeArray)(value, exclude);
|
|
755
736
|
continue;
|
|
756
|
-
|
|
757
|
-
if (
|
|
737
|
+
}
|
|
738
|
+
if ((0, import_types.isFunction)(value) && targetWindow) {
|
|
739
|
+
clone2[key] = targetWindow.eval("(" + value.toString() + ")");
|
|
758
740
|
continue;
|
|
759
741
|
}
|
|
760
|
-
if ((0, import_types.isObjectLike)(
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
742
|
+
if ((0, import_types.isObjectLike)(value)) {
|
|
743
|
+
clone2[key] = deepClone2(value, {
|
|
744
|
+
...options,
|
|
745
|
+
visited
|
|
746
|
+
});
|
|
764
747
|
} else {
|
|
765
|
-
|
|
748
|
+
clone2[key] = value;
|
|
766
749
|
}
|
|
767
750
|
}
|
|
768
|
-
return
|
|
751
|
+
return clone2;
|
|
769
752
|
};
|
|
770
753
|
var deepStringify = (obj, stringified = {}) => {
|
|
771
754
|
var _a, _b;
|
|
@@ -1675,6 +1658,7 @@ var require_component = __commonJS({
|
|
|
1675
1658
|
checkIfKeyIsProperty: () => checkIfKeyIsProperty,
|
|
1676
1659
|
checkIfSugar: () => checkIfSugar,
|
|
1677
1660
|
extendizeByKey: () => extendizeByKey,
|
|
1661
|
+
extractComponentKeyFromKey: () => extractComponentKeyFromKey,
|
|
1678
1662
|
getCapitalCaseKeys: () => getCapitalCaseKeys,
|
|
1679
1663
|
getChildrenComponentsByKey: () => getChildrenComponentsByKey,
|
|
1680
1664
|
getExtendsInElement: () => getExtendsInElement,
|
|
@@ -1731,11 +1715,14 @@ var require_component = __commonJS({
|
|
|
1731
1715
|
}
|
|
1732
1716
|
return !hasComponentAttrs || childProps || extendProps || children || childExtends;
|
|
1733
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
|
+
};
|
|
1734
1721
|
var extendizeByKey = (element, parent, key) => {
|
|
1735
1722
|
const { context } = parent;
|
|
1736
1723
|
const { tag, extend, childExtends } = element;
|
|
1737
1724
|
const isSugar = checkIfSugar(element, parent, key);
|
|
1738
|
-
const extendFromKey =
|
|
1725
|
+
const extendFromKey = extractComponentKeyFromKey(key);
|
|
1739
1726
|
const isExtendKeyComponent = context && context.components[extendFromKey];
|
|
1740
1727
|
if (element === isExtendKeyComponent)
|
|
1741
1728
|
return element;
|
|
@@ -1784,7 +1771,7 @@ var require_component = __commonJS({
|
|
|
1784
1771
|
if (newChild === null)
|
|
1785
1772
|
assignChild(null);
|
|
1786
1773
|
else if (!childElem)
|
|
1787
|
-
assignChild((0, import__.
|
|
1774
|
+
assignChild((0, import__.deepClone)(newChild));
|
|
1788
1775
|
else {
|
|
1789
1776
|
const isSugarChildElem = checkIfSugar(childElem, parent, key);
|
|
1790
1777
|
if (isSugarChildElem)
|
|
@@ -1855,7 +1842,7 @@ var require_component = __commonJS({
|
|
|
1855
1842
|
if (checkIfKeyIsComponent(key)) {
|
|
1856
1843
|
result.push(key);
|
|
1857
1844
|
}
|
|
1858
|
-
if (key === "extend") {
|
|
1845
|
+
if (key === "extend" || key === "extends") {
|
|
1859
1846
|
if (typeof o[key] === "string") {
|
|
1860
1847
|
result.push(o[key]);
|
|
1861
1848
|
} else if (Array.isArray(o[key])) {
|
|
@@ -2214,6 +2201,7 @@ var require_cjs2 = __commonJS({
|
|
|
2214
2201
|
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
2215
2202
|
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
2216
2203
|
arraysEqual: () => arraysEqual,
|
|
2204
|
+
checkIfStringIsInArray: () => checkIfStringIsInArray,
|
|
2217
2205
|
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
2218
2206
|
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
2219
2207
|
filterArrays: () => filterArrays,
|
|
@@ -2260,11 +2248,11 @@ var require_cjs2 = __commonJS({
|
|
|
2260
2248
|
var joinArrays = (...arrays) => {
|
|
2261
2249
|
return [].concat(...arrays);
|
|
2262
2250
|
};
|
|
2263
|
-
var mergeArray = (arr,
|
|
2264
|
-
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.
|
|
2251
|
+
var mergeArray = (arr, exclude = []) => {
|
|
2252
|
+
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, { exclude }), exclude), {});
|
|
2265
2253
|
};
|
|
2266
2254
|
var mergeAndCloneIfArray = (obj) => {
|
|
2267
|
-
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.
|
|
2255
|
+
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
2268
2256
|
};
|
|
2269
2257
|
var cutArrayBeforeValue = (arr, value) => {
|
|
2270
2258
|
const index = arr.indexOf(value);
|
|
@@ -2333,6 +2321,11 @@ var require_cjs2 = __commonJS({
|
|
|
2333
2321
|
const excludeSet = new Set(excludeArr);
|
|
2334
2322
|
return sourceArr.filter((item) => !excludeSet.has(item));
|
|
2335
2323
|
};
|
|
2324
|
+
var checkIfStringIsInArray = (string, arr) => {
|
|
2325
|
+
if (!string)
|
|
2326
|
+
return;
|
|
2327
|
+
return arr.filter((v) => string.includes(v)).length;
|
|
2328
|
+
};
|
|
2336
2329
|
}
|
|
2337
2330
|
});
|
|
2338
2331
|
var require_string2 = __commonJS2({
|
|
@@ -2385,14 +2378,15 @@ var require_cjs2 = __commonJS({
|
|
|
2385
2378
|
2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
|
|
2386
2379
|
3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
|
|
2387
2380
|
};
|
|
2388
|
-
|
|
2381
|
+
function replaceLiteralsWithObjectFields(str, options = {}, forcedState) {
|
|
2389
2382
|
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
|
|
2390
2383
|
return str;
|
|
2391
2384
|
const reg = brackRegex[options.bracketsLength || 2];
|
|
2385
|
+
const obj = forcedState || this.state || {};
|
|
2392
2386
|
return str.replace(reg, (_, parentPath, variable) => {
|
|
2393
2387
|
if (parentPath) {
|
|
2394
2388
|
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
|
|
2395
|
-
let parentState =
|
|
2389
|
+
let parentState = obj;
|
|
2396
2390
|
for (let i = 0; i < parentLevels; i++) {
|
|
2397
2391
|
parentState = parentState.parent;
|
|
2398
2392
|
if (!parentState) {
|
|
@@ -2402,11 +2396,11 @@ var require_cjs2 = __commonJS({
|
|
|
2402
2396
|
const value = parentState[variable.trim()];
|
|
2403
2397
|
return value !== void 0 ? `${value}` : "";
|
|
2404
2398
|
} else {
|
|
2405
|
-
const value =
|
|
2399
|
+
const value = obj[variable.trim()];
|
|
2406
2400
|
return value !== void 0 ? `${value}` : "";
|
|
2407
2401
|
}
|
|
2408
2402
|
});
|
|
2409
|
-
}
|
|
2403
|
+
}
|
|
2410
2404
|
var lowercaseFirstLetter = (inputString) => {
|
|
2411
2405
|
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
2412
2406
|
};
|
|
@@ -2509,8 +2503,6 @@ var require_cjs2 = __commonJS({
|
|
|
2509
2503
|
createNestedObject: () => createNestedObject,
|
|
2510
2504
|
createObjectWithoutPrototype: () => createObjectWithoutPrototype,
|
|
2511
2505
|
deepClone: () => deepClone2,
|
|
2512
|
-
deepCloneExclude: () => deepCloneExclude,
|
|
2513
|
-
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
2514
2506
|
deepContains: () => deepContains,
|
|
2515
2507
|
deepDestringify: () => deepDestringify,
|
|
2516
2508
|
deepDiff: () => deepDiff,
|
|
@@ -2604,78 +2596,56 @@ var require_cjs2 = __commonJS({
|
|
|
2604
2596
|
}
|
|
2605
2597
|
return o;
|
|
2606
2598
|
};
|
|
2607
|
-
var
|
|
2608
|
-
|
|
2609
|
-
return obj.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2610
|
-
}
|
|
2611
|
-
const o = {};
|
|
2612
|
-
for (const k in obj) {
|
|
2613
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
|
|
2614
|
-
if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
|
|
2615
|
-
continue;
|
|
2616
|
-
let v = obj[k];
|
|
2617
|
-
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
2618
|
-
v = mergeArrayExclude(v, excludeFrom);
|
|
2619
|
-
}
|
|
2620
|
-
if ((0, import_types.isArray)(v)) {
|
|
2621
|
-
o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2622
|
-
} else if ((0, import_types.isObject)(v)) {
|
|
2623
|
-
o[k] = deepCloneExclude(v, excludeFrom);
|
|
2624
|
-
} else
|
|
2625
|
-
o[k] = v;
|
|
2626
|
-
}
|
|
2627
|
-
return o;
|
|
2628
|
-
};
|
|
2629
|
-
var mergeArrayExclude = (arr, excl = []) => {
|
|
2630
|
-
return arr.reduce((acc, curr) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
|
|
2599
|
+
var mergeArrayExclude = (arr, exclude = []) => {
|
|
2600
|
+
return arr.reduce((acc, curr) => deepMerge2(acc, deepClone2(curr, { exclude })), {});
|
|
2631
2601
|
};
|
|
2632
|
-
var deepClone2 = (obj,
|
|
2633
|
-
|
|
2602
|
+
var deepClone2 = (obj, options = {}) => {
|
|
2603
|
+
const {
|
|
2604
|
+
exclude = [],
|
|
2605
|
+
cleanUndefined = false,
|
|
2606
|
+
cleanNull = false,
|
|
2607
|
+
window: targetWindow,
|
|
2608
|
+
visited = /* @__PURE__ */ new WeakMap(),
|
|
2609
|
+
handleExtend = false
|
|
2610
|
+
} = options;
|
|
2611
|
+
if (!(0, import_types.isObjectLike)(obj) || (0, import_node.isDOMNode)(obj)) {
|
|
2634
2612
|
return obj;
|
|
2635
|
-
|
|
2613
|
+
}
|
|
2614
|
+
if (visited.has(obj)) {
|
|
2636
2615
|
return visited.get(obj);
|
|
2637
|
-
|
|
2616
|
+
}
|
|
2617
|
+
const clone2 = targetWindow ? (0, import_types.isArray)(obj) ? new targetWindow.Array() : new targetWindow.Object() : (0, import_types.isArray)(obj) ? [] : {};
|
|
2638
2618
|
visited.set(obj, clone2);
|
|
2639
2619
|
for (const key in obj) {
|
|
2640
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
}
|
|
2651
|
-
}
|
|
2652
|
-
}
|
|
2653
|
-
return clone2;
|
|
2654
|
-
};
|
|
2655
|
-
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}, visited = /* @__PURE__ */ new WeakSet()) => {
|
|
2656
|
-
if ((0, import_types.isObjectLike)(obj)) {
|
|
2657
|
-
if (visited.has(obj)) {
|
|
2658
|
-
return obj;
|
|
2620
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
2621
|
+
continue;
|
|
2622
|
+
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
2623
|
+
continue;
|
|
2624
|
+
const value = obj[key];
|
|
2625
|
+
if (cleanUndefined && (0, import_types.isUndefined)(value) || cleanNull && (0, import_types.isNull)(value))
|
|
2626
|
+
continue;
|
|
2627
|
+
if ((0, import_node.isDOMNode)(value)) {
|
|
2628
|
+
clone2[key] = value;
|
|
2629
|
+
continue;
|
|
2659
2630
|
}
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
|
|
2663
|
-
for (const prop in obj) {
|
|
2664
|
-
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
2631
|
+
if (handleExtend && key === "extend" && (0, import_types.isArray)(value)) {
|
|
2632
|
+
clone2[key] = (0, import_array.mergeArray)(value, exclude);
|
|
2665
2633
|
continue;
|
|
2666
|
-
|
|
2667
|
-
if (
|
|
2634
|
+
}
|
|
2635
|
+
if ((0, import_types.isFunction)(value) && targetWindow) {
|
|
2636
|
+
clone2[key] = targetWindow.eval("(" + value.toString() + ")");
|
|
2668
2637
|
continue;
|
|
2669
2638
|
}
|
|
2670
|
-
if ((0, import_types.isObjectLike)(
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2639
|
+
if ((0, import_types.isObjectLike)(value)) {
|
|
2640
|
+
clone2[key] = deepClone2(value, {
|
|
2641
|
+
...options,
|
|
2642
|
+
visited
|
|
2643
|
+
});
|
|
2674
2644
|
} else {
|
|
2675
|
-
|
|
2645
|
+
clone2[key] = value;
|
|
2676
2646
|
}
|
|
2677
2647
|
}
|
|
2678
|
-
return
|
|
2648
|
+
return clone2;
|
|
2679
2649
|
};
|
|
2680
2650
|
var deepStringify = (obj, stringified = {}) => {
|
|
2681
2651
|
var _a, _b;
|
|
@@ -3575,6 +3545,7 @@ var require_cjs2 = __commonJS({
|
|
|
3575
3545
|
checkIfKeyIsProperty: () => checkIfKeyIsProperty,
|
|
3576
3546
|
checkIfSugar: () => checkIfSugar,
|
|
3577
3547
|
extendizeByKey: () => extendizeByKey,
|
|
3548
|
+
extractComponentKeyFromKey: () => extractComponentKeyFromKey,
|
|
3578
3549
|
getCapitalCaseKeys: () => getCapitalCaseKeys,
|
|
3579
3550
|
getChildrenComponentsByKey: () => getChildrenComponentsByKey,
|
|
3580
3551
|
getExtendsInElement: () => getExtendsInElement,
|
|
@@ -3631,11 +3602,14 @@ var require_cjs2 = __commonJS({
|
|
|
3631
3602
|
}
|
|
3632
3603
|
return !hasComponentAttrs || childProps || extendProps || children || childExtends;
|
|
3633
3604
|
};
|
|
3605
|
+
var extractComponentKeyFromKey = (key) => {
|
|
3606
|
+
return key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
|
|
3607
|
+
};
|
|
3634
3608
|
var extendizeByKey = (element, parent, key) => {
|
|
3635
3609
|
const { context } = parent;
|
|
3636
3610
|
const { tag, extend, childExtends } = element;
|
|
3637
3611
|
const isSugar = checkIfSugar(element, parent, key);
|
|
3638
|
-
const extendFromKey =
|
|
3612
|
+
const extendFromKey = extractComponentKeyFromKey(key);
|
|
3639
3613
|
const isExtendKeyComponent = context && context.components[extendFromKey];
|
|
3640
3614
|
if (element === isExtendKeyComponent)
|
|
3641
3615
|
return element;
|
|
@@ -3684,7 +3658,7 @@ var require_cjs2 = __commonJS({
|
|
|
3684
3658
|
if (newChild === null)
|
|
3685
3659
|
assignChild(null);
|
|
3686
3660
|
else if (!childElem)
|
|
3687
|
-
assignChild((0, import__.
|
|
3661
|
+
assignChild((0, import__.deepClone)(newChild));
|
|
3688
3662
|
else {
|
|
3689
3663
|
const isSugarChildElem = checkIfSugar(childElem, parent, key);
|
|
3690
3664
|
if (isSugarChildElem)
|
|
@@ -3755,7 +3729,7 @@ var require_cjs2 = __commonJS({
|
|
|
3755
3729
|
if (checkIfKeyIsComponent(key)) {
|
|
3756
3730
|
result.push(key);
|
|
3757
3731
|
}
|
|
3758
|
-
if (key === "extend") {
|
|
3732
|
+
if (key === "extend" || key === "extends") {
|
|
3759
3733
|
if (typeof o[key] === "string") {
|
|
3760
3734
|
result.push(o[key]);
|
|
3761
3735
|
} else if (Array.isArray(o[key])) {
|