@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.
@@ -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_utils25.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
  };
@@ -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
  };
@@ -4253,7 +4311,7 @@ var CONFIG = {
4253
4311
  useVariable: true,
4254
4312
  useReset: true,
4255
4313
  CSS_VARS,
4256
- ...defaultConfig_exports
4314
+ ...void 0 || defaultConfig_exports
4257
4315
  };
4258
4316
  var cachedConfig = (0, import_utils.deepClone)(CONFIG);
4259
4317
  var FACTORY = {
@@ -4693,10 +4751,11 @@ var generateSprite = (icons) => {
4693
4751
  return sprite;
4694
4752
  };
4695
4753
  var parseRootAttributes = (htmlString) => {
4696
- if (!(0, import_utils6.isString)(htmlString)) {
4697
- return console.warn(`parseRootAttributes: ${htmlString} is not a string`);
4754
+ const val = htmlString.default || htmlString;
4755
+ if (!(0, import_utils6.isString)(val)) {
4756
+ return console.warn(`parseRootAttributes: ${val} is not a string`);
4698
4757
  }
4699
- const match = htmlString.match(/<svg\s+(.*?)>/);
4758
+ const match = val.match(/<svg\s+(.*?)>/);
4700
4759
  if (!match || !match[1]) {
4701
4760
  return {};
4702
4761
  }
@@ -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_utils11.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
  };
@@ -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
  };
@@ -4223,7 +4281,7 @@ var CONFIG = {
4223
4281
  useVariable: true,
4224
4282
  useReset: true,
4225
4283
  CSS_VARS,
4226
- ...defaultConfig_exports
4284
+ ...void 0 || defaultConfig_exports
4227
4285
  };
4228
4286
  var cachedConfig = (0, import_utils.deepClone)(CONFIG);
4229
4287
  var FACTORY = {