UNPKG

@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.

1 lines 837 B
{"version":3,"file":"get-dom-range.cjs","sources":["../../../src/slate/utils/get-dom-range.ts"],"sourcesContent":["import type { Editor as SlateEditor, Range as SlateRange } from \"slate\";\nimport { ReactEditor } from \"slate-react\";\n\nexport function getDOMRange(\n editor: SlateEditor,\n range: SlateRange\n): Range | undefined {\n try {\n return ReactEditor.toDOMRange(editor, range);\n } catch (error) {\n return getDOMRange(editor, {\n anchor: range.anchor,\n focus: range.anchor,\n });\n }\n}\n"],"names":["ReactEditor"],"mappings":";;;;AAGgB,SAAA,WAAA,CACd,QACA,KACmB,EAAA;AACnB,EAAI,IAAA;AACF,IAAO,OAAAA,sBAAA,CAAY,UAAW,CAAA,MAAA,EAAQ,KAAK,CAAA,CAAA;AAAA,WACpC,KAAP,EAAA;AACA,IAAA,OAAO,YAAY,MAAQ,EAAA;AAAA,MACzB,QAAQ,KAAM,CAAA,MAAA;AAAA,MACd,OAAO,KAAM,CAAA,MAAA;AAAA,KACd,CAAA,CAAA;AAAA,GACH;AACF;;;;"}