mechanica 1.0.19 → 1.0.20

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/editor.js CHANGED
@@ -1371,9 +1371,19 @@ const processBlock = (contentBlock, schema) => {
1371
1371
  passDefaultValue(contentBlock.data, schema.props);
1372
1372
  if (schema.slots) {
1373
1373
  if (Object.keys(schema.slots).join() === "default") {
1374
- contentBlock.children = [];
1374
+ if (contentBlock.children && !Array.isArray(contentBlock.children)) {
1375
+ contentBlock.children = contentBlock.children["default"] ?? [];
1376
+ } else {
1377
+ contentBlock.children = contentBlock.children ?? [];
1378
+ }
1375
1379
  } else {
1376
- contentBlock.children = Object.fromEntries(Object.keys(schema.slots).map((key) => [key, []]));
1380
+ if (contentBlock.children && Array.isArray(contentBlock.children)) {
1381
+ const arr = contentBlock.children;
1382
+ contentBlock.children = Object.fromEntries(Object.keys(schema.slots).map((key) => [key, []]));
1383
+ contentBlock.children["default"] = arr;
1384
+ } else {
1385
+ contentBlock.children = contentBlock.children ?? Object.fromEntries(Object.keys(schema.slots).map((key) => [key, []]));
1386
+ }
1377
1387
  }
1378
1388
  onUpdateBlockChildren(contentBlock);
1379
1389
  }