@next-core/brick-utils 2.50.3 → 2.51.0

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.
@@ -17690,7 +17690,7 @@
17690
17690
  }, parseBrickProperties(brick.properties)), {}, {
17691
17691
  context: parseContext(brick.context)
17692
17692
  })), {}, {
17693
- children: parseSlots(brick.slots, options)
17693
+ children: parseSlots(childrenToSlots(brick.children, brick.slots), options)
17694
17694
  });
17695
17695
  }
17696
17696
  function parseCondition(condition) {
@@ -17798,6 +17798,29 @@
17798
17798
  });
17799
17799
  }
17800
17800
  }
17801
+ function childrenToSlots(children, originalSlots) {
17802
+ var newSlots = originalSlots;
17803
+ // istanbul ignore next
17804
+ if (process.env.NODE_ENV === "development" && children && !Array.isArray(children)) {
17805
+ // eslint-disable-next-line no-console
17806
+ console.warn("Specified brick children but not array:", "<".concat(typeof children, ">"), children);
17807
+ }
17808
+ if (Array.isArray(children) && !newSlots) {
17809
+ newSlots = {};
17810
+ for (var child of children) {
17811
+ var _slot;
17812
+ var slot = (_slot = child.slot) !== null && _slot !== void 0 ? _slot : "";
17813
+ if (!Object.prototype.hasOwnProperty.call(newSlots, slot)) {
17814
+ newSlots[slot] = {
17815
+ type: "bricks",
17816
+ bricks: []
17817
+ };
17818
+ }
17819
+ newSlots[slot].bricks.push(child);
17820
+ }
17821
+ }
17822
+ return newSlots;
17823
+ }
17801
17824
  function parseSlots(slots, options) {
17802
17825
  if (isObject(slots)) {
17803
17826
  return Object.entries(slots).map(_ref2 => {