@liveblocks/react-ui
Version:
A set of React pre-built components for the Liveblocks products. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.
26 lines (22 loc) • 491 B
JavaScript
;
var slateReact = require('slate-react');
const MAX_RETRIES = 3;
function getDOMRange(editor, range, retries = MAX_RETRIES) {
if (retries <= 0) {
return;
}
try {
return slateReact.ReactEditor.toDOMRange(editor, range);
} catch (error) {
return getDOMRange(
editor,
{
anchor: range.anchor,
focus: range.anchor
},
retries - 1
);
}
}
exports.getDOMRange = getDOMRange;
//# sourceMappingURL=get-dom-range.cjs.map