slate-react 0.77.3 → 0.77.4-202232614048

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.
@@ -2763,11 +2763,21 @@
2763
2763
  }
2764
2764
 
2765
2765
  if (event.detail === TRIPLE_CLICK && path.length >= 1) {
2766
- var _start2 = slate.Editor.start(editor, [path[0]]);
2766
+ var blockPath = path;
2767
2767
 
2768
- var _end = slate.Editor.end(editor, [path[0]]);
2768
+ if (!slate.Editor.isBlock(editor, node)) {
2769
+ var _block$;
2769
2770
 
2770
- var range = slate.Editor.range(editor, _start2, _end);
2771
+ var block = slate.Editor.above(editor, {
2772
+ match: function match(n) {
2773
+ return slate.Editor.isBlock(editor, n);
2774
+ },
2775
+ at: path
2776
+ });
2777
+ blockPath = (_block$ = block === null || block === void 0 ? void 0 : block[1]) !== null && _block$ !== void 0 ? _block$ : path.slice(0, 1);
2778
+ }
2779
+
2780
+ var range = slate.Editor.range(editor, blockPath);
2771
2781
  slate.Transforms.select(editor, range);
2772
2782
  return;
2773
2783
  }