@micromag/editor 0.3.626 → 0.3.627

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.
Files changed (2) hide show
  1. package/es/index.js +6 -5
  2. package/package.json +2 -2
package/es/index.js CHANGED
@@ -1680,7 +1680,6 @@ function buildTree(flattenedItems) {
1680
1680
  children: []
1681
1681
  });
1682
1682
  });
1683
- console.log('buildTree', flattenedItems);
1684
1683
  var indexes = {};
1685
1684
  // eslint-disable-next-line no-restricted-syntax
1686
1685
  var _iterator = _createForOfIteratorHelper(items),
@@ -1694,7 +1693,9 @@ function buildTree(flattenedItems) {
1694
1693
  var parentId = (_item$parentId = item.parentId) !== null && _item$parentId !== void 0 ? _item$parentId : root.id;
1695
1694
  var parent = (_ref6 = (_nodes$parentId = nodes[parentId]) !== null && _nodes$parentId !== void 0 ? _nodes$parentId : findItem(items, parentId)) !== null && _ref6 !== void 0 ? _ref6 : null;
1696
1695
  if (parent === null) {
1697
- console.error('Parent not found', parentId, nodes);
1696
+ var _ref7, _nodes$parentId2;
1697
+ parentId = root.id;
1698
+ parent = (_ref7 = (_nodes$parentId2 = nodes[parentId]) !== null && _nodes$parentId2 !== void 0 ? _nodes$parentId2 : findItem(items, parentId)) !== null && _ref7 !== void 0 ? _ref7 : null;
1698
1699
  }
1699
1700
  if (typeof indexes[parentId] !== 'undefined') {
1700
1701
  indexes[parentId] += 1;
@@ -1785,9 +1786,9 @@ function setProperty(items, id, property, setter) {
1785
1786
  }
1786
1787
  function countChildren(items) {
1787
1788
  var count = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1788
- return items.reduce(function (acc, _ref7) {
1789
- var _ref7$children = _ref7.children,
1790
- children = _ref7$children === undefined ? [] : _ref7$children;
1789
+ return items.reduce(function (acc, _ref8) {
1790
+ var _ref8$children = _ref8.children,
1791
+ children = _ref8$children === undefined ? [] : _ref8$children;
1791
1792
  if (children.length) {
1792
1793
  return countChildren(children, acc + 1);
1793
1794
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/editor",
3
- "version": "0.3.626",
3
+ "version": "0.3.627",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -91,5 +91,5 @@
91
91
  "access": "public",
92
92
  "registry": "https://registry.npmjs.org/"
93
93
  },
94
- "gitHead": "625f397d200ef20bbb0590d7e05c71215cf165dd"
94
+ "gitHead": "2f317cedb18fc41a6f0325473fcd4527b7ca8eb1"
95
95
  }