@symbo.ls/scratch 2.11.453 → 2.11.469

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.
@@ -804,10 +804,10 @@ var require_object = __commonJS({
804
804
  return o;
805
805
  };
806
806
  var deepStringify = (obj, stringified = {}) => {
807
- var _a;
807
+ var _a, _b;
808
808
  if (obj.node || obj.__ref || obj.parent || obj.__element || obj.parse) {
809
- console.warn("Trying to clone element or state at", obj);
810
- obj = (_a = obj.parse) == null ? void 0 : _a.call(obj);
809
+ (obj.__element || ((_a = obj.parent) == null ? void 0 : _a.__element)).warn("Trying to clone element or state at", obj);
810
+ obj = (_b = obj.parse) == null ? void 0 : _b.call(obj);
811
811
  }
812
812
  for (const prop in obj) {
813
813
  const objProp = obj[prop];
@@ -877,7 +877,7 @@ var require_object = __commonJS({
877
877
  if ((0, import_types.isArray)(value)) {
878
878
  str += "[\n";
879
879
  for (const element of value) {
880
- if ((0, import_types.isObject)(element) && element !== null) {
880
+ if ((0, import_types.isObjectLike)(element) && element !== null) {
881
881
  str += `${spaces} ${objectToString(element, indent + 2)},
882
882
  `;
883
883
  } else if ((0, import_types.isString)(element)) {
@@ -1447,9 +1447,11 @@ var require_cookie = __commonJS({
1447
1447
  var cookie_exports = {};
1448
1448
  __export2(cookie_exports, {
1449
1449
  getCookie: () => getCookie,
1450
+ getLocalStorage: () => getLocalStorage,
1450
1451
  isMobile: () => isMobile,
1451
1452
  removeCookie: () => removeCookie,
1452
- setCookie: () => setCookie
1453
+ setCookie: () => setCookie,
1454
+ setLocalStorage: () => setLocalStorage
1453
1455
  });
1454
1456
  module2.exports = __toCommonJS2(cookie_exports);
1455
1457
  var import_types = require_types();
@@ -1483,6 +1485,27 @@ var require_cookie = __commonJS({
1483
1485
  return;
1484
1486
  import_utils7.document.cookie = cname + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
1485
1487
  };
1488
+ function getLocalStorage(key) {
1489
+ let savedJSON;
1490
+ if (window.localStorage) {
1491
+ try {
1492
+ savedJSON = JSON.parse(window.localStorage.getItem(key));
1493
+ } catch (e) {
1494
+ }
1495
+ }
1496
+ if (typeof savedJSON !== "undefined") {
1497
+ return savedJSON;
1498
+ }
1499
+ }
1500
+ function setLocalStorage(key, data) {
1501
+ if (data && window.localStorage) {
1502
+ if (typeof data === "object") {
1503
+ window.localStorage.setItem(key, JSON.stringify(data));
1504
+ } else {
1505
+ window.localStorage.setItem(key, data);
1506
+ }
1507
+ }
1508
+ }
1486
1509
  }
1487
1510
  });
1488
1511
 
@@ -1686,7 +1709,9 @@ var require_component = __commonJS({
1686
1709
  applyKeyComponentAsExtend: () => applyKeyComponentAsExtend,
1687
1710
  checkIfKeyIsComponent: () => checkIfKeyIsComponent,
1688
1711
  checkIfKeyIsProperty: () => checkIfKeyIsProperty,
1712
+ checkIfSugar: () => checkIfSugar,
1689
1713
  extendizeByKey: () => extendizeByKey,
1714
+ getCapitalCaseKeys: () => getCapitalCaseKeys,
1690
1715
  getChildrenComponentsByKey: () => getChildrenComponentsByKey,
1691
1716
  getExtendsInElement: () => getExtendsInElement,
1692
1717
  hasVariantProp: () => hasVariantProp,
@@ -1720,12 +1745,13 @@ var require_component = __commonJS({
1720
1745
  return { ...element, extend };
1721
1746
  };
1722
1747
  var checkIfSugar = (element, parent, key) => {
1748
+ var _a;
1723
1749
  const {
1724
1750
  extend,
1725
1751
  props,
1726
1752
  childExtend,
1727
1753
  extends: extendProps,
1728
- childrenExtends,
1754
+ childExtends,
1729
1755
  childProps,
1730
1756
  children,
1731
1757
  on,
@@ -1734,15 +1760,17 @@ var require_component = __commonJS({
1734
1760
  $propsCollection
1735
1761
  } = element;
1736
1762
  const hasComponentAttrs = extend || childExtend || props || on || $collection || $stateCollection || $propsCollection;
1737
- if (hasComponentAttrs && (childProps || extendProps || children || childrenExtends)) {
1738
- element.error("Sugar component includes params for builtin components");
1763
+ if (hasComponentAttrs && (childProps || extendProps || children || childExtends)) {
1764
+ const logErr = (_a = parent || element) == null ? void 0 : _a.error;
1765
+ if (logErr)
1766
+ logErr.call(element, "Sugar component includes params for builtin components", { verbose: true });
1739
1767
  }
1740
- return !hasComponentAttrs || childProps || extendProps || children || childrenExtends;
1768
+ return !hasComponentAttrs || childProps || extendProps || children || childExtends;
1741
1769
  };
1742
1770
  var extendizeByKey = (element, parent, key) => {
1743
1771
  const { context } = parent;
1744
- const { tag, extend, childrenExtends } = element;
1745
- const isSugar = checkIfSugar(element);
1772
+ const { tag, extend, childExtends } = element;
1773
+ const isSugar = checkIfSugar(element, parent, key);
1746
1774
  const extendFromKey = key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
1747
1775
  const isExtendKeyComponent = context && context.components[extendFromKey];
1748
1776
  if (element === isExtendKeyComponent)
@@ -1753,8 +1781,8 @@ var require_component = __commonJS({
1753
1781
  tag,
1754
1782
  props: { ...element }
1755
1783
  });
1756
- if (childrenExtends)
1757
- newElem.childExtend = childrenExtends;
1784
+ if (childExtends)
1785
+ newElem.childExtend = childExtends;
1758
1786
  return newElem;
1759
1787
  } else if (!extend || extend === true) {
1760
1788
  return {
@@ -1783,23 +1811,24 @@ var require_component = __commonJS({
1783
1811
  const childKey = childElems[i];
1784
1812
  const childElem = element[childKey];
1785
1813
  const newChild = element.props[childKey];
1814
+ const assignChild = (val) => {
1815
+ element[childKey] = val;
1816
+ delete element.props[childKey];
1817
+ };
1786
1818
  if (newChild == null ? void 0 : newChild.ignoreExtend)
1787
1819
  continue;
1788
- if (!childElem)
1789
- element[childKey] = (0, import__.deepCloneWithExtend)(newChild);
1820
+ if (newChild === null)
1821
+ assignChild(null);
1822
+ else if (!childElem)
1823
+ assignChild((0, import__.deepCloneWithExtend)(newChild));
1790
1824
  else {
1791
- const isSugar = checkIfSugar(childElem);
1792
- if (!isSugar)
1825
+ const isSugarChildElem = checkIfSugar(childElem, parent, key);
1826
+ if (isSugarChildElem)
1793
1827
  continue;
1794
- const inheritedChildElem = element[childKey].props;
1795
- if ((0, import__.isObjectLike)(newChild)) {
1796
- (0, import__.overwriteDeep)(inheritedChildElem, newChild);
1797
- } else if ((0, import__.isFunction)(newChild)) {
1798
- element[childKey] = {
1799
- extend: element[childKey],
1800
- props: newChild
1801
- };
1802
- }
1828
+ assignChild({
1829
+ extend: element[childKey],
1830
+ props: newChild
1831
+ });
1803
1832
  }
1804
1833
  }
1805
1834
  };
@@ -2685,10 +2714,10 @@ var require_cjs3 = __commonJS({
2685
2714
  return o;
2686
2715
  };
2687
2716
  var deepStringify = (obj, stringified = {}) => {
2688
- var _a;
2717
+ var _a, _b;
2689
2718
  if (obj.node || obj.__ref || obj.parent || obj.__element || obj.parse) {
2690
- console.warn("Trying to clone element or state at", obj);
2691
- obj = (_a = obj.parse) == null ? void 0 : _a.call(obj);
2719
+ (obj.__element || ((_a = obj.parent) == null ? void 0 : _a.__element)).warn("Trying to clone element or state at", obj);
2720
+ obj = (_b = obj.parse) == null ? void 0 : _b.call(obj);
2692
2721
  }
2693
2722
  for (const prop in obj) {
2694
2723
  const objProp = obj[prop];
@@ -2758,7 +2787,7 @@ var require_cjs3 = __commonJS({
2758
2787
  if ((0, import_types.isArray)(value)) {
2759
2788
  str += "[\n";
2760
2789
  for (const element of value) {
2761
- if ((0, import_types.isObject)(element) && element !== null) {
2790
+ if ((0, import_types.isObjectLike)(element) && element !== null) {
2762
2791
  str += `${spaces} ${objectToString(element, indent + 2)},
2763
2792
  `;
2764
2793
  } else if ((0, import_types.isString)(element)) {
@@ -3322,9 +3351,11 @@ var require_cjs3 = __commonJS({
3322
3351
  var cookie_exports = {};
3323
3352
  __export22(cookie_exports, {
3324
3353
  getCookie: () => getCookie,
3354
+ getLocalStorage: () => getLocalStorage,
3325
3355
  isMobile: () => isMobile,
3326
3356
  removeCookie: () => removeCookie,
3327
- setCookie: () => setCookie
3357
+ setCookie: () => setCookie,
3358
+ setLocalStorage: () => setLocalStorage
3328
3359
  });
3329
3360
  module22.exports = __toCommonJS22(cookie_exports);
3330
3361
  var import_types = require_types2();
@@ -3358,6 +3389,27 @@ var require_cjs3 = __commonJS({
3358
3389
  return;
3359
3390
  import_utils32.document.cookie = cname + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
3360
3391
  };
3392
+ function getLocalStorage(key) {
3393
+ let savedJSON;
3394
+ if (window.localStorage) {
3395
+ try {
3396
+ savedJSON = JSON.parse(window.localStorage.getItem(key));
3397
+ } catch (e) {
3398
+ }
3399
+ }
3400
+ if (typeof savedJSON !== "undefined") {
3401
+ return savedJSON;
3402
+ }
3403
+ }
3404
+ function setLocalStorage(key, data) {
3405
+ if (data && window.localStorage) {
3406
+ if (typeof data === "object") {
3407
+ window.localStorage.setItem(key, JSON.stringify(data));
3408
+ } else {
3409
+ window.localStorage.setItem(key, data);
3410
+ }
3411
+ }
3412
+ }
3361
3413
  }
3362
3414
  });
3363
3415
  var require_tags2 = __commonJS2({
@@ -3557,7 +3609,9 @@ var require_cjs3 = __commonJS({
3557
3609
  applyKeyComponentAsExtend: () => applyKeyComponentAsExtend,
3558
3610
  checkIfKeyIsComponent: () => checkIfKeyIsComponent,
3559
3611
  checkIfKeyIsProperty: () => checkIfKeyIsProperty,
3612
+ checkIfSugar: () => checkIfSugar,
3560
3613
  extendizeByKey: () => extendizeByKey,
3614
+ getCapitalCaseKeys: () => getCapitalCaseKeys,
3561
3615
  getChildrenComponentsByKey: () => getChildrenComponentsByKey,
3562
3616
  getExtendsInElement: () => getExtendsInElement,
3563
3617
  hasVariantProp: () => hasVariantProp,
@@ -3591,12 +3645,13 @@ var require_cjs3 = __commonJS({
3591
3645
  return { ...element, extend };
3592
3646
  };
3593
3647
  var checkIfSugar = (element, parent, key) => {
3648
+ var _a;
3594
3649
  const {
3595
3650
  extend,
3596
3651
  props,
3597
3652
  childExtend,
3598
3653
  extends: extendProps,
3599
- childrenExtends,
3654
+ childExtends,
3600
3655
  childProps,
3601
3656
  children,
3602
3657
  on,
@@ -3605,15 +3660,17 @@ var require_cjs3 = __commonJS({
3605
3660
  $propsCollection
3606
3661
  } = element;
3607
3662
  const hasComponentAttrs = extend || childExtend || props || on || $collection || $stateCollection || $propsCollection;
3608
- if (hasComponentAttrs && (childProps || extendProps || children || childrenExtends)) {
3609
- element.error("Sugar component includes params for builtin components");
3663
+ if (hasComponentAttrs && (childProps || extendProps || children || childExtends)) {
3664
+ const logErr = (_a = parent || element) == null ? void 0 : _a.error;
3665
+ if (logErr)
3666
+ logErr.call(element, "Sugar component includes params for builtin components", { verbose: true });
3610
3667
  }
3611
- return !hasComponentAttrs || childProps || extendProps || children || childrenExtends;
3668
+ return !hasComponentAttrs || childProps || extendProps || children || childExtends;
3612
3669
  };
3613
3670
  var extendizeByKey = (element, parent, key) => {
3614
3671
  const { context } = parent;
3615
- const { tag, extend, childrenExtends } = element;
3616
- const isSugar = checkIfSugar(element);
3672
+ const { tag, extend, childExtends } = element;
3673
+ const isSugar = checkIfSugar(element, parent, key);
3617
3674
  const extendFromKey = key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
3618
3675
  const isExtendKeyComponent = context && context.components[extendFromKey];
3619
3676
  if (element === isExtendKeyComponent)
@@ -3624,8 +3681,8 @@ var require_cjs3 = __commonJS({
3624
3681
  tag,
3625
3682
  props: { ...element }
3626
3683
  });
3627
- if (childrenExtends)
3628
- newElem.childExtend = childrenExtends;
3684
+ if (childExtends)
3685
+ newElem.childExtend = childExtends;
3629
3686
  return newElem;
3630
3687
  } else if (!extend || extend === true) {
3631
3688
  return {
@@ -3654,23 +3711,24 @@ var require_cjs3 = __commonJS({
3654
3711
  const childKey = childElems[i];
3655
3712
  const childElem = element[childKey];
3656
3713
  const newChild = element.props[childKey];
3714
+ const assignChild = (val) => {
3715
+ element[childKey] = val;
3716
+ delete element.props[childKey];
3717
+ };
3657
3718
  if (newChild == null ? void 0 : newChild.ignoreExtend)
3658
3719
  continue;
3659
- if (!childElem)
3660
- element[childKey] = (0, import__.deepCloneWithExtend)(newChild);
3720
+ if (newChild === null)
3721
+ assignChild(null);
3722
+ else if (!childElem)
3723
+ assignChild((0, import__.deepCloneWithExtend)(newChild));
3661
3724
  else {
3662
- const isSugar = checkIfSugar(childElem);
3663
- if (!isSugar)
3725
+ const isSugarChildElem = checkIfSugar(childElem, parent, key);
3726
+ if (isSugarChildElem)
3664
3727
  continue;
3665
- const inheritedChildElem = element[childKey].props;
3666
- if ((0, import__.isObjectLike)(newChild)) {
3667
- (0, import__.overwriteDeep)(inheritedChildElem, newChild);
3668
- } else if ((0, import__.isFunction)(newChild)) {
3669
- element[childKey] = {
3670
- extend: element[childKey],
3671
- props: newChild
3672
- };
3673
- }
3728
+ assignChild({
3729
+ extend: element[childKey],
3730
+ props: newChild
3731
+ });
3674
3732
  }
3675
3733
  }
3676
3734
  };
@@ -4479,7 +4537,7 @@ var CONFIG = {
4479
4537
  useVariable: true,
4480
4538
  useReset: true,
4481
4539
  CSS_VARS,
4482
- ...defaultConfig_exports
4540
+ ...void 0 || defaultConfig_exports
4483
4541
  };
4484
4542
  var cachedConfig = (0, import_utils2.deepClone)(CONFIG);
4485
4543
  var FACTORY = {
@@ -4792,10 +4850,11 @@ var generateSprite = (icons) => {
4792
4850
  return sprite;
4793
4851
  };
4794
4852
  var parseRootAttributes = (htmlString) => {
4795
- if (!(0, import_utils6.isString)(htmlString)) {
4796
- return console.warn(`parseRootAttributes: ${htmlString} is not a string`);
4853
+ const val = htmlString.default || htmlString;
4854
+ if (!(0, import_utils6.isString)(val)) {
4855
+ return console.warn(`parseRootAttributes: ${val} is not a string`);
4797
4856
  }
4798
- const match = htmlString.match(/<svg\s+(.*?)>/);
4857
+ const match = val.match(/<svg\s+(.*?)>/);
4799
4858
  if (!match || !match[1]) {
4800
4859
  return {};
4801
4860
  }
@@ -768,10 +768,10 @@ var require_object = __commonJS({
768
768
  return o;
769
769
  };
770
770
  var deepStringify = (obj, stringified = {}) => {
771
- var _a;
771
+ var _a, _b;
772
772
  if (obj.node || obj.__ref || obj.parent || obj.__element || obj.parse) {
773
- console.warn("Trying to clone element or state at", obj);
774
- obj = (_a = obj.parse) == null ? void 0 : _a.call(obj);
773
+ (obj.__element || ((_a = obj.parent) == null ? void 0 : _a.__element)).warn("Trying to clone element or state at", obj);
774
+ obj = (_b = obj.parse) == null ? void 0 : _b.call(obj);
775
775
  }
776
776
  for (const prop in obj) {
777
777
  const objProp = obj[prop];
@@ -841,7 +841,7 @@ var require_object = __commonJS({
841
841
  if ((0, import_types.isArray)(value)) {
842
842
  str += "[\n";
843
843
  for (const element of value) {
844
- if ((0, import_types.isObject)(element) && element !== null) {
844
+ if ((0, import_types.isObjectLike)(element) && element !== null) {
845
845
  str += `${spaces} ${objectToString(element, indent + 2)},
846
846
  `;
847
847
  } else if ((0, import_types.isString)(element)) {
@@ -1411,9 +1411,11 @@ var require_cookie = __commonJS({
1411
1411
  var cookie_exports = {};
1412
1412
  __export2(cookie_exports, {
1413
1413
  getCookie: () => getCookie,
1414
+ getLocalStorage: () => getLocalStorage,
1414
1415
  isMobile: () => isMobile,
1415
1416
  removeCookie: () => removeCookie,
1416
- setCookie: () => setCookie
1417
+ setCookie: () => setCookie,
1418
+ setLocalStorage: () => setLocalStorage
1417
1419
  });
1418
1420
  module2.exports = __toCommonJS2(cookie_exports);
1419
1421
  var import_types = require_types();
@@ -1447,6 +1449,27 @@ var require_cookie = __commonJS({
1447
1449
  return;
1448
1450
  import_utils4.document.cookie = cname + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
1449
1451
  };
1452
+ function getLocalStorage(key) {
1453
+ let savedJSON;
1454
+ if (window.localStorage) {
1455
+ try {
1456
+ savedJSON = JSON.parse(window.localStorage.getItem(key));
1457
+ } catch (e) {
1458
+ }
1459
+ }
1460
+ if (typeof savedJSON !== "undefined") {
1461
+ return savedJSON;
1462
+ }
1463
+ }
1464
+ function setLocalStorage(key, data) {
1465
+ if (data && window.localStorage) {
1466
+ if (typeof data === "object") {
1467
+ window.localStorage.setItem(key, JSON.stringify(data));
1468
+ } else {
1469
+ window.localStorage.setItem(key, data);
1470
+ }
1471
+ }
1472
+ }
1450
1473
  }
1451
1474
  });
1452
1475
 
@@ -1650,7 +1673,9 @@ var require_component = __commonJS({
1650
1673
  applyKeyComponentAsExtend: () => applyKeyComponentAsExtend,
1651
1674
  checkIfKeyIsComponent: () => checkIfKeyIsComponent,
1652
1675
  checkIfKeyIsProperty: () => checkIfKeyIsProperty,
1676
+ checkIfSugar: () => checkIfSugar,
1653
1677
  extendizeByKey: () => extendizeByKey,
1678
+ getCapitalCaseKeys: () => getCapitalCaseKeys,
1654
1679
  getChildrenComponentsByKey: () => getChildrenComponentsByKey,
1655
1680
  getExtendsInElement: () => getExtendsInElement,
1656
1681
  hasVariantProp: () => hasVariantProp,
@@ -1684,12 +1709,13 @@ var require_component = __commonJS({
1684
1709
  return { ...element, extend };
1685
1710
  };
1686
1711
  var checkIfSugar = (element, parent, key) => {
1712
+ var _a;
1687
1713
  const {
1688
1714
  extend,
1689
1715
  props,
1690
1716
  childExtend,
1691
1717
  extends: extendProps,
1692
- childrenExtends,
1718
+ childExtends,
1693
1719
  childProps,
1694
1720
  children,
1695
1721
  on,
@@ -1698,15 +1724,17 @@ var require_component = __commonJS({
1698
1724
  $propsCollection
1699
1725
  } = element;
1700
1726
  const hasComponentAttrs = extend || childExtend || props || on || $collection || $stateCollection || $propsCollection;
1701
- if (hasComponentAttrs && (childProps || extendProps || children || childrenExtends)) {
1702
- element.error("Sugar component includes params for builtin components");
1727
+ if (hasComponentAttrs && (childProps || extendProps || children || childExtends)) {
1728
+ const logErr = (_a = parent || element) == null ? void 0 : _a.error;
1729
+ if (logErr)
1730
+ logErr.call(element, "Sugar component includes params for builtin components", { verbose: true });
1703
1731
  }
1704
- return !hasComponentAttrs || childProps || extendProps || children || childrenExtends;
1732
+ return !hasComponentAttrs || childProps || extendProps || children || childExtends;
1705
1733
  };
1706
1734
  var extendizeByKey = (element, parent, key) => {
1707
1735
  const { context } = parent;
1708
- const { tag, extend, childrenExtends } = element;
1709
- const isSugar = checkIfSugar(element);
1736
+ const { tag, extend, childExtends } = element;
1737
+ const isSugar = checkIfSugar(element, parent, key);
1710
1738
  const extendFromKey = key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
1711
1739
  const isExtendKeyComponent = context && context.components[extendFromKey];
1712
1740
  if (element === isExtendKeyComponent)
@@ -1717,8 +1745,8 @@ var require_component = __commonJS({
1717
1745
  tag,
1718
1746
  props: { ...element }
1719
1747
  });
1720
- if (childrenExtends)
1721
- newElem.childExtend = childrenExtends;
1748
+ if (childExtends)
1749
+ newElem.childExtend = childExtends;
1722
1750
  return newElem;
1723
1751
  } else if (!extend || extend === true) {
1724
1752
  return {
@@ -1747,23 +1775,24 @@ var require_component = __commonJS({
1747
1775
  const childKey = childElems[i];
1748
1776
  const childElem = element[childKey];
1749
1777
  const newChild = element.props[childKey];
1778
+ const assignChild = (val) => {
1779
+ element[childKey] = val;
1780
+ delete element.props[childKey];
1781
+ };
1750
1782
  if (newChild == null ? void 0 : newChild.ignoreExtend)
1751
1783
  continue;
1752
- if (!childElem)
1753
- element[childKey] = (0, import__.deepCloneWithExtend)(newChild);
1784
+ if (newChild === null)
1785
+ assignChild(null);
1786
+ else if (!childElem)
1787
+ assignChild((0, import__.deepCloneWithExtend)(newChild));
1754
1788
  else {
1755
- const isSugar = checkIfSugar(childElem);
1756
- if (!isSugar)
1789
+ const isSugarChildElem = checkIfSugar(childElem, parent, key);
1790
+ if (isSugarChildElem)
1757
1791
  continue;
1758
- const inheritedChildElem = element[childKey].props;
1759
- if ((0, import__.isObjectLike)(newChild)) {
1760
- (0, import__.overwriteDeep)(inheritedChildElem, newChild);
1761
- } else if ((0, import__.isFunction)(newChild)) {
1762
- element[childKey] = {
1763
- extend: element[childKey],
1764
- props: newChild
1765
- };
1766
- }
1792
+ assignChild({
1793
+ extend: element[childKey],
1794
+ props: newChild
1795
+ });
1767
1796
  }
1768
1797
  }
1769
1798
  };
@@ -2649,10 +2678,10 @@ var require_cjs2 = __commonJS({
2649
2678
  return o;
2650
2679
  };
2651
2680
  var deepStringify = (obj, stringified = {}) => {
2652
- var _a;
2681
+ var _a, _b;
2653
2682
  if (obj.node || obj.__ref || obj.parent || obj.__element || obj.parse) {
2654
- console.warn("Trying to clone element or state at", obj);
2655
- obj = (_a = obj.parse) == null ? void 0 : _a.call(obj);
2683
+ (obj.__element || ((_a = obj.parent) == null ? void 0 : _a.__element)).warn("Trying to clone element or state at", obj);
2684
+ obj = (_b = obj.parse) == null ? void 0 : _b.call(obj);
2656
2685
  }
2657
2686
  for (const prop in obj) {
2658
2687
  const objProp = obj[prop];
@@ -2722,7 +2751,7 @@ var require_cjs2 = __commonJS({
2722
2751
  if ((0, import_types.isArray)(value)) {
2723
2752
  str += "[\n";
2724
2753
  for (const element of value) {
2725
- if ((0, import_types.isObject)(element) && element !== null) {
2754
+ if ((0, import_types.isObjectLike)(element) && element !== null) {
2726
2755
  str += `${spaces} ${objectToString(element, indent + 2)},
2727
2756
  `;
2728
2757
  } else if ((0, import_types.isString)(element)) {
@@ -3286,9 +3315,11 @@ var require_cjs2 = __commonJS({
3286
3315
  var cookie_exports = {};
3287
3316
  __export22(cookie_exports, {
3288
3317
  getCookie: () => getCookie,
3318
+ getLocalStorage: () => getLocalStorage,
3289
3319
  isMobile: () => isMobile,
3290
3320
  removeCookie: () => removeCookie,
3291
- setCookie: () => setCookie
3321
+ setCookie: () => setCookie,
3322
+ setLocalStorage: () => setLocalStorage
3292
3323
  });
3293
3324
  module22.exports = __toCommonJS22(cookie_exports);
3294
3325
  var import_types = require_types2();
@@ -3322,6 +3353,27 @@ var require_cjs2 = __commonJS({
3322
3353
  return;
3323
3354
  import_utils32.document.cookie = cname + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
3324
3355
  };
3356
+ function getLocalStorage(key) {
3357
+ let savedJSON;
3358
+ if (window.localStorage) {
3359
+ try {
3360
+ savedJSON = JSON.parse(window.localStorage.getItem(key));
3361
+ } catch (e) {
3362
+ }
3363
+ }
3364
+ if (typeof savedJSON !== "undefined") {
3365
+ return savedJSON;
3366
+ }
3367
+ }
3368
+ function setLocalStorage(key, data) {
3369
+ if (data && window.localStorage) {
3370
+ if (typeof data === "object") {
3371
+ window.localStorage.setItem(key, JSON.stringify(data));
3372
+ } else {
3373
+ window.localStorage.setItem(key, data);
3374
+ }
3375
+ }
3376
+ }
3325
3377
  }
3326
3378
  });
3327
3379
  var require_tags2 = __commonJS2({
@@ -3521,7 +3573,9 @@ var require_cjs2 = __commonJS({
3521
3573
  applyKeyComponentAsExtend: () => applyKeyComponentAsExtend,
3522
3574
  checkIfKeyIsComponent: () => checkIfKeyIsComponent,
3523
3575
  checkIfKeyIsProperty: () => checkIfKeyIsProperty,
3576
+ checkIfSugar: () => checkIfSugar,
3524
3577
  extendizeByKey: () => extendizeByKey,
3578
+ getCapitalCaseKeys: () => getCapitalCaseKeys,
3525
3579
  getChildrenComponentsByKey: () => getChildrenComponentsByKey,
3526
3580
  getExtendsInElement: () => getExtendsInElement,
3527
3581
  hasVariantProp: () => hasVariantProp,
@@ -3555,12 +3609,13 @@ var require_cjs2 = __commonJS({
3555
3609
  return { ...element, extend };
3556
3610
  };
3557
3611
  var checkIfSugar = (element, parent, key) => {
3612
+ var _a;
3558
3613
  const {
3559
3614
  extend,
3560
3615
  props,
3561
3616
  childExtend,
3562
3617
  extends: extendProps,
3563
- childrenExtends,
3618
+ childExtends,
3564
3619
  childProps,
3565
3620
  children,
3566
3621
  on,
@@ -3569,15 +3624,17 @@ var require_cjs2 = __commonJS({
3569
3624
  $propsCollection
3570
3625
  } = element;
3571
3626
  const hasComponentAttrs = extend || childExtend || props || on || $collection || $stateCollection || $propsCollection;
3572
- if (hasComponentAttrs && (childProps || extendProps || children || childrenExtends)) {
3573
- element.error("Sugar component includes params for builtin components");
3627
+ if (hasComponentAttrs && (childProps || extendProps || children || childExtends)) {
3628
+ const logErr = (_a = parent || element) == null ? void 0 : _a.error;
3629
+ if (logErr)
3630
+ logErr.call(element, "Sugar component includes params for builtin components", { verbose: true });
3574
3631
  }
3575
- return !hasComponentAttrs || childProps || extendProps || children || childrenExtends;
3632
+ return !hasComponentAttrs || childProps || extendProps || children || childExtends;
3576
3633
  };
3577
3634
  var extendizeByKey = (element, parent, key) => {
3578
3635
  const { context } = parent;
3579
- const { tag, extend, childrenExtends } = element;
3580
- const isSugar = checkIfSugar(element);
3636
+ const { tag, extend, childExtends } = element;
3637
+ const isSugar = checkIfSugar(element, parent, key);
3581
3638
  const extendFromKey = key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
3582
3639
  const isExtendKeyComponent = context && context.components[extendFromKey];
3583
3640
  if (element === isExtendKeyComponent)
@@ -3588,8 +3645,8 @@ var require_cjs2 = __commonJS({
3588
3645
  tag,
3589
3646
  props: { ...element }
3590
3647
  });
3591
- if (childrenExtends)
3592
- newElem.childExtend = childrenExtends;
3648
+ if (childExtends)
3649
+ newElem.childExtend = childExtends;
3593
3650
  return newElem;
3594
3651
  } else if (!extend || extend === true) {
3595
3652
  return {
@@ -3618,23 +3675,24 @@ var require_cjs2 = __commonJS({
3618
3675
  const childKey = childElems[i];
3619
3676
  const childElem = element[childKey];
3620
3677
  const newChild = element.props[childKey];
3678
+ const assignChild = (val) => {
3679
+ element[childKey] = val;
3680
+ delete element.props[childKey];
3681
+ };
3621
3682
  if (newChild == null ? void 0 : newChild.ignoreExtend)
3622
3683
  continue;
3623
- if (!childElem)
3624
- element[childKey] = (0, import__.deepCloneWithExtend)(newChild);
3684
+ if (newChild === null)
3685
+ assignChild(null);
3686
+ else if (!childElem)
3687
+ assignChild((0, import__.deepCloneWithExtend)(newChild));
3625
3688
  else {
3626
- const isSugar = checkIfSugar(childElem);
3627
- if (!isSugar)
3689
+ const isSugarChildElem = checkIfSugar(childElem, parent, key);
3690
+ if (isSugarChildElem)
3628
3691
  continue;
3629
- const inheritedChildElem = element[childKey].props;
3630
- if ((0, import__.isObjectLike)(newChild)) {
3631
- (0, import__.overwriteDeep)(inheritedChildElem, newChild);
3632
- } else if ((0, import__.isFunction)(newChild)) {
3633
- element[childKey] = {
3634
- extend: element[childKey],
3635
- props: newChild
3636
- };
3637
- }
3692
+ assignChild({
3693
+ extend: element[childKey],
3694
+ props: newChild
3695
+ });
3638
3696
  }
3639
3697
  }
3640
3698
  };
@@ -4198,7 +4256,7 @@ var CONFIG = {
4198
4256
  useVariable: true,
4199
4257
  useReset: true,
4200
4258
  CSS_VARS,
4201
- ...defaultConfig_exports
4259
+ ...void 0 || defaultConfig_exports
4202
4260
  };
4203
4261
  var cachedConfig = (0, import_utils.deepClone)(CONFIG);
4204
4262
  var FACTORY = {