slate-react 0.145.1 → 0.146.1-20261019005723
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 +2 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/slate-react.js +21 -18
- package/dist/slate-react.min.js +1 -1
- package/package.json +4 -4
package/dist/index.es.js
CHANGED
|
@@ -4573,13 +4573,14 @@ const defaultDecorate = () => [];
|
|
|
4573
4573
|
* A default implement to scroll dom range into view.
|
|
4574
4574
|
*/
|
|
4575
4575
|
const defaultScrollSelectionIntoView = (editor, domRange) => {
|
|
4576
|
+
var _ReactEditor$resolveD;
|
|
4576
4577
|
// Scroll to the focus point of the selection, in case the selection is expanded
|
|
4577
4578
|
const {
|
|
4578
4579
|
selection
|
|
4579
4580
|
} = editor;
|
|
4580
4581
|
const isBackward = !!selection && Range.isBackward(selection);
|
|
4581
4582
|
const unhung = selection && !isBackward && Range.isExpanded(selection) ? Editor.unhangRange(editor, selection) : selection;
|
|
4582
|
-
const domFocusPoint = unhung && selection && !Range.equals(unhung, selection) ? ReactEditor.
|
|
4583
|
+
const domFocusPoint = unhung && selection && !Range.equals(unhung, selection) ? (_ReactEditor$resolveD = ReactEditor.resolveDOMRange(editor, unhung)) !== null && _ReactEditor$resolveD !== void 0 ? _ReactEditor$resolveD : domRange.cloneRange() : domRange.cloneRange();
|
|
4583
4584
|
domFocusPoint.collapse(isBackward);
|
|
4584
4585
|
if (domFocusPoint.getBoundingClientRect) {
|
|
4585
4586
|
const leafEl = domFocusPoint.startContainer.parentElement;
|