slate 0.78.0 → 0.80.0-202242521812

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/index.es.js CHANGED
@@ -2222,8 +2222,8 @@ var Node = {
2222
2222
  /**
2223
2223
  * Return a generator of all the ancestor nodes above a specific path.
2224
2224
  *
2225
- * By default the order is bottom-up, from lowest to highest ancestor in
2226
- * the tree, but you can pass the `reverse: true` option to go top-down.
2225
+ * By default the order is top-down, from highest to lowest ancestor in
2226
+ * the tree, but you can pass the `reverse: true` option to go bottom-up.
2227
2227
  */
2228
2228
  *ancestors(root, path) {
2229
2229
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
@@ -2507,7 +2507,7 @@ var Node = {
2507
2507
  /**
2508
2508
  * Return a generator of the in a branch of the tree, from a specific path.
2509
2509
  *
2510
- * By default the order is top-down, from lowest to highest node in the tree,
2510
+ * By default the order is top-down, from highest to lowest node in the tree,
2511
2511
  * but you can pass the `reverse: true` option to go bottom-up.
2512
2512
  */
2513
2513
  *levels(root, path) {
@@ -2846,7 +2846,7 @@ var Path = {
2846
2846
  /**
2847
2847
  * Get a list of ancestor paths for a given path.
2848
2848
  *
2849
- * The paths are sorted from deepest to shallowest ancestor. However, if the
2849
+ * The paths are sorted from shallowest to deepest ancestor. However, if the
2850
2850
  * `reverse: true` option is passed, they are reversed.
2851
2851
  */
2852
2852
  ancestors(path) {
@@ -5882,12 +5882,16 @@ var TextTransforms = {
5882
5882
  return;
5883
5883
  }
5884
5884
 
5885
- var pointRef = Editor.pointRef(editor, end);
5885
+ var start = Range.start(at);
5886
+ var startRef = Editor.pointRef(editor, start);
5887
+ var endRef = Editor.pointRef(editor, end);
5886
5888
  Transforms.delete(editor, {
5887
5889
  at,
5888
5890
  voids
5889
5891
  });
5890
- at = pointRef.unref();
5892
+ var startPoint = startRef.unref();
5893
+ var endPoint = endRef.unref();
5894
+ at = startPoint || endPoint;
5891
5895
  Transforms.setSelection(editor, {
5892
5896
  anchor: at,
5893
5897
  focus: at