slate 0.132.0 → 0.133.1

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/slate.js CHANGED
@@ -5477,17 +5477,21 @@
5477
5477
  } else {
5478
5478
  var _Range$edges = Range.edges(at),
5479
5479
  _Range$edges2 = _slicedToArray(_Range$edges, 2),
5480
+ start = _Range$edges2[0],
5480
5481
  end = _Range$edges2[1];
5481
5482
  if (!voids && Editor["void"](editor, {
5482
5483
  at: end
5483
5484
  })) {
5484
5485
  return;
5485
5486
  }
5486
- var pointRef = Editor.pointRef(editor, end);
5487
+ var _startRef = Editor.pointRef(editor, start);
5488
+ var _endRef = Editor.pointRef(editor, end);
5487
5489
  Transforms["delete"](editor, {
5488
5490
  at: at
5489
5491
  });
5490
- at = pointRef.unref();
5492
+ var startPoint = _startRef.unref();
5493
+ var endPoint = _endRef.unref();
5494
+ at = endPoint !== null && endPoint !== void 0 ? endPoint : startPoint;
5491
5495
  }
5492
5496
  } else if (Location.isPath(at)) {
5493
5497
  at = Editor.start(editor, at);
@@ -5890,14 +5894,24 @@
5890
5894
  if (Range.isCollapsed(at)) {
5891
5895
  at = at.anchor;
5892
5896
  } else {
5897
+ var _ref, _ref2;
5893
5898
  var _Range$edges = Range.edges(at),
5894
5899
  _Range$edges2 = _slicedToArray(_Range$edges, 2),
5900
+ start = _Range$edges2[0],
5895
5901
  end = _Range$edges2[1];
5896
- var pointRef = Editor.pointRef(editor, end);
5902
+ var startRef = Editor.pointRef(editor, start);
5903
+ var endRef = Editor.pointRef(editor, end);
5904
+ var before = Editor.before(editor, start, {
5905
+ voids: voids
5906
+ });
5907
+ var beforeRef = before && Editor.pointRef(editor, before);
5897
5908
  Transforms["delete"](editor, {
5898
5909
  at: at
5899
5910
  });
5900
- at = pointRef.unref();
5911
+ var startPoint = startRef.unref();
5912
+ var endPoint = endRef.unref();
5913
+ var beforePoint = beforeRef ? beforeRef.unref() : null;
5914
+ at = (_ref = (_ref2 = endPoint !== null && endPoint !== void 0 ? endPoint : startPoint) !== null && _ref2 !== void 0 ? _ref2 : beforePoint) !== null && _ref !== void 0 ? _ref : Editor.start(editor, []);
5901
5915
  }
5902
5916
  }
5903
5917
  if (Location.isPoint(at)) {
@@ -5972,9 +5986,9 @@
5972
5986
  if (Node.isText(node)) {
5973
5987
  newDirtyPaths.push(path);
5974
5988
  } else {
5975
- newDirtyPaths.push.apply(newDirtyPaths, _toConsumableArray(Array.from(Node.nodes(node), function (_ref) {
5976
- var _ref2 = _slicedToArray(_ref, 2),
5977
- p = _ref2[1];
5989
+ newDirtyPaths.push.apply(newDirtyPaths, _toConsumableArray(Array.from(Node.nodes(node), function (_ref3) {
5990
+ var _ref4 = _slicedToArray(_ref3, 2),
5991
+ p = _ref4[1];
5978
5992
  return path.concat(p);
5979
5993
  })));
5980
5994
  }