@tmagic/editor 1.0.0-beta.1 → 1.0.0-beta.2

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.
@@ -937,9 +937,6 @@ class Editor$1 extends BaseService {
937
937
  if (!info.node)
938
938
  throw new Error(`\u83B7\u53D6\u4E0D\u5230id\u4E3A${config2.id}\u7684\u8282\u70B9`);
939
939
  const node = cloneDeep(toRaw(info.node));
940
- const { parent } = info;
941
- if (!parent)
942
- throw new Error("\u83B7\u53D6\u4E0D\u5230\u7236\u7EA7\u8282\u70B9");
943
940
  let newConfig = await this.toggleFixedPosition(toRaw(config2), node, this.get("root"));
944
941
  defaults(newConfig, node);
945
942
  if (!newConfig.type)
@@ -948,6 +945,9 @@ class Editor$1 extends BaseService {
948
945
  this.set("root", newConfig);
949
946
  return newConfig;
950
947
  }
948
+ const { parent } = info;
949
+ if (!parent)
950
+ throw new Error("\u83B7\u53D6\u4E0D\u5230\u7236\u7EA7\u8282\u70B9");
951
951
  const parentNodeItems = parent.items;
952
952
  const index = getNodeIndex(newConfig, parent);
953
953
  if (!parentNodeItems || typeof index === "undefined" || index === -1)