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.
package/dist/index.js CHANGED
@@ -1853,11 +1853,21 @@ var Editable$1 = function Editable(props) {
1853
1853
  }
1854
1854
 
1855
1855
  if (event.detail === TRIPLE_CLICK && path.length >= 1) {
1856
- var _start2 = slate.Editor.start(editor, [path[0]]);
1856
+ var blockPath = path;
1857
1857
 
1858
- var _end = slate.Editor.end(editor, [path[0]]);
1858
+ if (!slate.Editor.isBlock(editor, node)) {
1859
+ var _block$;
1859
1860
 
1860
- var range = slate.Editor.range(editor, _start2, _end);
1861
+ var block = slate.Editor.above(editor, {
1862
+ match: function match(n) {
1863
+ return slate.Editor.isBlock(editor, n);
1864
+ },
1865
+ at: path
1866
+ });
1867
+ blockPath = (_block$ = block === null || block === void 0 ? void 0 : block[1]) !== null && _block$ !== void 0 ? _block$ : path.slice(0, 1);
1868
+ }
1869
+
1870
+ var range = slate.Editor.range(editor, blockPath);
1861
1871
  slate.Transforms.select(editor, range);
1862
1872
  return;
1863
1873
  }