@tmagic/editor 1.0.0-beta.5 → 1.0.0-beta.6

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.
@@ -843,6 +843,9 @@ class Editor$1 extends BaseService {
843
843
  const { node, parent, page } = this.getNodeInfo(id);
844
844
  if (!node)
845
845
  throw new Error("\u83B7\u53D6\u4E0D\u5230\u7EC4\u4EF6\u4FE1\u606F");
846
+ if (node.id === this.state.root?.id) {
847
+ throw new Error("\u4E0D\u80FD\u9009\u6839\u8282\u70B9");
848
+ }
846
849
  this.set("node", node);
847
850
  this.set("page", page || null);
848
851
  this.set("parent", parent || null);
@@ -3712,10 +3715,11 @@ class ScrollViewer$1 {
3712
3715
  event.preventDefault();
3713
3716
  event.stopImmediatePropagation();
3714
3717
  event.stopPropagation();
3715
- } else if (this.keydown)
3718
+ }
3719
+ if (event.code !== Keys.ESCAPE || !this.enter || this.keydown) {
3716
3720
  return;
3721
+ }
3717
3722
  this.keydown = true;
3718
- event.preventDefault();
3719
3723
  this.target.style.cursor = "grab";
3720
3724
  this.container.addEventListener("mousedown", this.mousedownHandler);
3721
3725
  };