slate-react 0.110.2 → 0.110.3
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/components/editable.d.ts.map +1 -1
- package/dist/hooks/android-input-manager/android-input-manager.d.ts.map +1 -1
- package/dist/hooks/use-children.d.ts.map +1 -1
- package/dist/index.es.js +49 -26
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +51 -28
- package/dist/index.js.map +1 -1
- package/dist/plugin/with-react.d.ts.map +1 -1
- package/dist/slate-react.js +51 -28
- package/dist/slate-react.min.js +1 -1
- package/dist/utils/weak-maps.d.ts +1 -0
- package/dist/utils/weak-maps.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/arrayWithHoles.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/arrayLikeToArray.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/nonIterableRest.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/slicedToArray.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/objectWithoutProperties.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/typeof.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/toPrimitive.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/toPropertyKey.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/defineProperty.js","../src/hooks/use-slate-static.tsx","../src/utils/environment.ts","../src/utils/weak-maps.ts","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/iterableToArray.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/nonIterableSpread.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/toConsumableArray.js","../src/utils/dom.ts","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/createClass.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/classCallCheck.js","../src/utils/key.ts","../src/plugin/react-editor.ts","../src/utils/diff-text.ts","../src/hooks/android-input-manager/android-input-manager.ts","../src/hooks/use-is-mounted.tsx","../src/hooks/use-isomorphic-layout-effect.ts","../src/hooks/use-mutation-observer.ts","../src/hooks/android-input-manager/use-android-input-manager.ts","../src/utils/range-list.ts","../src/components/string.tsx","../src/components/leaf.tsx","../src/components/text.tsx","../src/components/element.tsx","../src/hooks/use-decorate.ts","../src/hooks/use-selected.ts","../src/hooks/use-children.tsx","../src/hooks/use-read-only.ts","../src/hooks/use-slate.tsx","../src/hooks/use-track-user-input.ts","../src/utils/constants.ts","../src/utils/hotkeys.ts","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/assertThisInitialized.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/setPrototypeOf.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/inherits.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/getPrototypeOf.js","../src/components/restore-dom/restore-dom-manager.ts","../src/components/restore-dom/restore-dom.tsx","../src/hooks/use-composing.ts","../src/components/editable.tsx","../src/hooks/use-focused.ts","../src/hooks/use-slate-selector.tsx","../src/components/slate.tsx","../src/hooks/use-editor.tsx","../src/hooks/use-slate-selection.tsx","../src/utils/lines.ts","../src/plugin/with-react.ts"],"sourcesContent":["function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\nmodule.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\nmodule.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nmodule.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\nmodule.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nmodule.exports = _nonIterableRest, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayWithHoles = require(\"./arrayWithHoles.js\");\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit.js\");\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\nvar nonIterableRest = require(\"./nonIterableRest.js\");\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\nmodule.exports = _slicedToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nmodule.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var objectWithoutPropertiesLoose = require(\"./objectWithoutPropertiesLoose.js\");\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nmodule.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nmodule.exports = _toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}\nmodule.exports = _toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","import { createContext, useContext } from 'react'\nimport { Editor } from 'slate'\nimport { ReactEditor } from '../plugin/react-editor'\n\n/**\n * A React context for sharing the editor object.\n */\n\nexport const EditorContext = createContext<ReactEditor | null>(null)\n\n/**\n * Get the current editor object from the React context.\n */\n\nexport const useSlateStatic = (): Editor => {\n const editor = useContext(EditorContext)\n\n if (!editor) {\n throw new Error(\n `The \\`useSlateStatic\\` hook must be used inside the <Slate> component's context.`\n )\n }\n\n return editor\n}\n","import React from 'react'\n\nexport const REACT_MAJOR_VERSION = parseInt(React.version.split('.')[0], 10)\n\nexport const IS_IOS =\n typeof navigator !== 'undefined' &&\n typeof window !== 'undefined' &&\n /iPad|iPhone|iPod/.test(navigator.userAgent) &&\n !window.MSStream\n\nexport const IS_APPLE =\n typeof navigator !== 'undefined' && /Mac OS X/.test(navigator.userAgent)\n\nexport const IS_ANDROID =\n typeof navigator !== 'undefined' && /Android/.test(navigator.userAgent)\n\nexport const IS_FIREFOX =\n typeof navigator !== 'undefined' &&\n /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent)\n\nexport const IS_WEBKIT =\n typeof navigator !== 'undefined' &&\n /AppleWebKit(?!.*Chrome)/i.test(navigator.userAgent)\n\n// \"modern\" Edge was released at 79.x\nexport const IS_EDGE_LEGACY =\n typeof navigator !== 'undefined' &&\n /Edge?\\/(?:[0-6][0-9]|[0-7][0-8])(?:\\.)/i.test(navigator.userAgent)\n\nexport const IS_CHROME =\n typeof navigator !== 'undefined' && /Chrome/i.test(navigator.userAgent)\n\n// Native `beforeInput` events don't work well with react on Chrome 75\n// and older, Chrome 76+ can use `beforeInput` though.\nexport const IS_CHROME_LEGACY =\n typeof navigator !== 'undefined' &&\n /Chrome?\\/(?:[0-7][0-5]|[0-6][0-9])(?:\\.)/i.test(navigator.userAgent)\n\nexport const IS_ANDROID_CHROME_LEGACY =\n IS_ANDROID &&\n typeof navigator !== 'undefined' &&\n /Chrome?\\/(?:[0-5]?\\d)(?:\\.)/i.test(navigator.userAgent)\n\n// Firefox did not support `beforeInput` until `v87`.\nexport const IS_FIREFOX_LEGACY =\n typeof navigator !== 'undefined' &&\n /^(?!.*Seamonkey)(?=.*Firefox\\/(?:[0-7][0-9]|[0-8][0-6])(?:\\.)).*/i.test(\n navigator.userAgent\n )\n\n// UC mobile browser\nexport const IS_UC_MOBILE =\n typeof navigator !== 'undefined' && /.*UCBrowser/.test(navigator.userAgent)\n\n// Wechat browser (not including mac wechat)\nexport const IS_WECHATBROWSER =\n typeof navigator !== 'undefined' &&\n /.*Wechat/.test(navigator.userAgent) &&\n !/.*MacWechat/.test(navigator.userAgent) // avoid lookbehind (buggy in safari < 16.4)\n\n// Check if DOM is available as React does internally.\n// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js\nexport const CAN_USE_DOM = !!(\n typeof window !== 'undefined' &&\n typeof window.document !== 'undefined' &&\n typeof window.document.createElement !== 'undefined'\n)\n\n// Check if the browser is Safari and older than 17\nexport const IS_SAFARI_LEGACY =\n typeof navigator !== 'undefined' &&\n /Safari/.test(navigator.userAgent) &&\n /Version\\/(\\d+)/.test(navigator.userAgent) &&\n (navigator.userAgent.match(/Version\\/(\\d+)/)?.[1]\n ? parseInt(navigator.userAgent.match(/Version\\/(\\d+)/)?.[1]!, 10) < 17\n : false)\n\n// COMPAT: Firefox/Edge Legacy don't support the `beforeinput` event\n// Chrome Legacy doesn't support `beforeinput` correctly\nexport const HAS_BEFORE_INPUT_SUPPORT =\n (!IS_CHROME_LEGACY || !IS_ANDROID_CHROME_LEGACY) &&\n !IS_EDGE_LEGACY &&\n // globalThis is undefined in older browsers\n typeof globalThis !== 'undefined' &&\n globalThis.InputEvent &&\n // @ts-ignore The `getTargetRanges` property isn't recognized.\n typeof globalThis.InputEvent.prototype.getTargetRanges === 'function'\n","import { Ancestor, Editor, Node, Operation, Range, RangeRef, Text } from 'slate'\nimport { Action } from '../hooks/android-input-manager/android-input-manager'\nimport { TextDiff } from './diff-text'\nimport { Key } from './key'\n\n/**\n * Two weak maps that allow us rebuild a path given a node. They are populated\n * at render time such that after a render occurs we can always backtrack.\n */\n\nexport const NODE_TO_INDEX: WeakMap<Node, number> = new WeakMap()\nexport const NODE_TO_PARENT: WeakMap<Node, Ancestor> = new WeakMap()\n\n/**\n * Weak maps that allow us to go between Slate nodes and DOM nodes. These\n * are used to resolve DOM event-related logic into Slate actions.\n */\nexport const EDITOR_TO_WINDOW: WeakMap<Editor, Window> = new WeakMap()\nexport const EDITOR_TO_ELEMENT: WeakMap<Editor, HTMLElement> = new WeakMap()\nexport const EDITOR_TO_PLACEHOLDER: WeakMap<Editor, string> = new WeakMap()\nexport const EDITOR_TO_PLACEHOLDER_ELEMENT: WeakMap<Editor, HTMLElement> =\n new WeakMap()\nexport const ELEMENT_TO_NODE: WeakMap<HTMLElement, Node> = new WeakMap()\nexport const NODE_TO_ELEMENT: WeakMap<Node, HTMLElement> = new WeakMap()\nexport const NODE_TO_KEY: WeakMap<Node, Key> = new WeakMap()\nexport const EDITOR_TO_KEY_TO_ELEMENT: WeakMap<\n Editor,\n WeakMap<Key, HTMLElement>\n> = new WeakMap()\n\n/**\n * Weak maps for storing editor-related state.\n */\n\nexport const IS_READ_ONLY: WeakMap<Editor, boolean> = new WeakMap()\nexport const IS_FOCUSED: WeakMap<Editor, boolean> = new WeakMap()\nexport const IS_COMPOSING: WeakMap<Editor, boolean> = new WeakMap()\n\nexport const EDITOR_TO_USER_SELECTION: WeakMap<Editor, RangeRef | null> =\n new WeakMap()\n\n/**\n * Weak map for associating the context `onChange` context with the plugin.\n */\n\nexport const EDITOR_TO_ON_CHANGE = new WeakMap<\n Editor,\n (options?: { operation?: Operation }) => void\n>()\n\n/**\n * Weak maps for saving pending state on composition stage.\n */\n\nexport const EDITOR_TO_SCHEDULE_FLUSH: WeakMap<Editor, () => void> =\n new WeakMap()\n\nexport const EDITOR_TO_PENDING_INSERTION_MARKS: WeakMap<\n Editor,\n Partial<Text> | null\n> = new WeakMap()\n\nexport const EDITOR_TO_USER_MARKS: WeakMap<Editor, Partial<Text> | null> =\n new WeakMap()\n\n/**\n * Android input handling specific weak-maps\n */\n\nexport const EDITOR_TO_PENDING_DIFFS: WeakMap<Editor, TextDiff[]> =\n new WeakMap()\n\nexport const EDITOR_TO_PENDING_ACTION: WeakMap<Editor, Action | null> =\n new WeakMap()\n\nexport const EDITOR_TO_PENDING_SELECTION: WeakMap<Editor, Range | null> =\n new WeakMap()\n\nexport const EDITOR_TO_FORCE_RENDER: WeakMap<Editor, () => void> = new WeakMap()\n\n/**\n * Symbols.\n */\n\nexport const PLACEHOLDER_SYMBOL = Symbol('placeholder') as unknown as string\nexport const MARK_PLACEHOLDER_SYMBOL = Symbol(\n 'mark-placeholder'\n) as unknown as string\n","var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}\nmodule.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nmodule.exports = _iterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nmodule.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayWithoutHoles = require(\"./arrayWithoutHoles.js\");\nvar iterableToArray = require(\"./iterableToArray.js\");\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\nvar nonIterableSpread = require(\"./nonIterableSpread.js\");\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\nmodule.exports = _toConsumableArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","/**\n * Types.\n */\n\n// COMPAT: This is required to prevent TypeScript aliases from doing some very\n// weird things for Slate's types with the same name as globals. (2019/11/27)\n// https://github.com/microsoft/TypeScript/issues/35002\nimport DOMNode = globalThis.Node\nimport DOMComment = globalThis.Comment\nimport DOMElement = globalThis.Element\nimport DOMText = globalThis.Text\nimport DOMRange = globalThis.Range\nimport DOMSelection = globalThis.Selection\nimport DOMStaticRange = globalThis.StaticRange\nimport { ReactEditor } from '../plugin/react-editor'\n\nexport {\n DOMNode,\n DOMComment,\n DOMElement,\n DOMText,\n DOMRange,\n DOMSelection,\n DOMStaticRange,\n}\n\ndeclare global {\n interface Window {\n Selection: (typeof Selection)['constructor']\n DataTransfer: (typeof DataTransfer)['constructor']\n Node: (typeof Node)['constructor']\n }\n}\n\nexport type DOMPoint = [Node, number]\n\n/**\n * Returns the host window of a DOM node\n */\n\nexport const getDefaultView = (value: any): Window | null => {\n return (\n (value && value.ownerDocument && value.ownerDocument.defaultView) || null\n )\n}\n\n/**\n * Check if a DOM node is a comment node.\n */\n\nexport const isDOMComment = (value: any): value is DOMComment => {\n return isDOMNode(value) && value.nodeType === 8\n}\n\n/**\n * Check if a DOM node is an element node.\n */\n\nexport const isDOMElement = (value: any): value is DOMElement => {\n return isDOMNode(value) && value.nodeType === 1\n}\n\n/**\n * Check if a value is a DOM node.\n */\n\nexport const isDOMNode = (value: any): value is DOMNode => {\n const window = getDefaultView(value)\n return !!window && value instanceof window.Node\n}\n\n/**\n * Check if a value is a DOM selection.\n */\n\nexport const isDOMSelection = (value: any): value is DOMSelection => {\n const window = value && value.anchorNode && getDefaultView(value.anchorNode)\n return !!window && value instanceof window.Selection\n}\n\n/**\n * Check if a DOM node is an element node.\n */\n\nexport const isDOMText = (value: any): value is DOMText => {\n return isDOMNode(value) && value.nodeType === 3\n}\n\n/**\n * Checks whether a paste event is a plaintext-only event.\n */\n\nexport const isPlainTextOnlyPaste = (event: ClipboardEvent) => {\n return (\n event.clipboardData &&\n event.clipboardData.getData('text/plain') !== '' &&\n event.clipboardData.types.length === 1\n )\n}\n\n/**\n * Normalize a DOM point so that it always refers to a text node.\n */\n\nexport const normalizeDOMPoint = (domPoint: DOMPoint): DOMPoint => {\n let [node, offset] = domPoint\n\n // If it's an element node, its offset refers to the index of its children\n // including comment nodes, so try to find the right text child node.\n if (isDOMElement(node) && node.childNodes.length) {\n let isLast = offset === node.childNodes.length\n let index = isLast ? offset - 1 : offset\n ;[node, index] = getEditableChildAndIndex(\n node,\n index,\n isLast ? 'backward' : 'forward'\n )\n // If the editable child found is in front of input offset, we instead seek to its end\n isLast = index < offset\n\n // If the node has children, traverse until we have a leaf node. Leaf nodes\n // can be either text nodes, or other void DOM nodes.\n while (isDOMElement(node) && node.childNodes.length) {\n const i = isLast ? node.childNodes.length - 1 : 0\n node = getEditableChild(node, i, isLast ? 'backward' : 'forward')\n }\n\n // Determine the new offset inside the text node.\n offset = isLast && node.textContent != null ? node.textContent.length : 0\n }\n\n // Return the node and offset.\n return [node, offset]\n}\n\n/**\n * Determines whether the active element is nested within a shadowRoot\n */\n\nexport const hasShadowRoot = (node: Node | null) => {\n let parent = node && node.parentNode\n while (parent) {\n if (parent.toString() === '[object ShadowRoot]') {\n return true\n }\n parent = parent.parentNode\n }\n return false\n}\n\n/**\n * Get the nearest editable child and index at `index` in a `parent`, preferring\n * `direction`.\n */\n\nexport const getEditableChildAndIndex = (\n parent: DOMElement,\n index: number,\n direction: 'forward' | 'backward'\n): [DOMNode, number] => {\n const { childNodes } = parent\n let child = childNodes[index]\n let i = index\n let triedForward = false\n let triedBackward = false\n\n // While the child is a comment node, or an element node with no children,\n // keep iterating to find a sibling non-void, non-comment node.\n while (\n isDOMComment(child) ||\n (isDOMElement(child) && child.childNodes.length === 0) ||\n (isDOMElement(child) && child.getAttribute('contenteditable') === 'false')\n ) {\n if (triedForward && triedBackward) {\n break\n }\n\n if (i >= childNodes.length) {\n triedForward = true\n i = index - 1\n direction = 'backward'\n continue\n }\n\n if (i < 0) {\n triedBackward = true\n i = index + 1\n direction = 'forward'\n continue\n }\n\n child = childNodes[i]\n index = i\n i += direction === 'forward' ? 1 : -1\n }\n\n return [child, index]\n}\n\n/**\n * Get the nearest editable child at `index` in a `parent`, preferring\n * `direction`.\n */\n\nexport const getEditableChild = (\n parent: DOMElement,\n index: number,\n direction: 'forward' | 'backward'\n): DOMNode => {\n const [child] = getEditableChildAndIndex(parent, index, direction)\n return child\n}\n\n/**\n * Get a plaintext representation of the content of a node, accounting for block\n * elements which get a newline appended.\n *\n * The domNode must be attached to the DOM.\n */\n\nexport const getPlainText = (domNode: DOMNode) => {\n let text = ''\n\n if (isDOMText(domNode) && domNode.nodeValue) {\n return domNode.nodeValue\n }\n\n if (isDOMElement(domNode)) {\n for (const childNode of Array.from(domNode.childNodes)) {\n text += getPlainText(childNode)\n }\n\n const display = getComputedStyle(domNode).getPropertyValue('display')\n\n if (display === 'block' || display === 'list' || domNode.tagName === 'BR') {\n text += '\\n'\n }\n }\n\n return text\n}\n\n/**\n * Get x-slate-fragment attribute from data-slate-fragment\n */\nconst catchSlateFragment = /data-slate-fragment=\"(.+?)\"/m\nexport const getSlateFragmentAttribute = (\n dataTransfer: DataTransfer\n): string | void => {\n const htmlData = dataTransfer.getData('text/html')\n const [, fragment] = htmlData.match(catchSlateFragment) || []\n return fragment\n}\n\n/**\n * Get the x-slate-fragment attribute that exist in text/html data\n * and append it to the DataTransfer object\n */\nexport const getClipboardData = (\n dataTransfer: DataTransfer,\n clipboardFormatKey = 'x-slate-fragment'\n): DataTransfer => {\n if (!dataTransfer.getData(`application/${clipboardFormatKey}`)) {\n const fragment = getSlateFragmentAttribute(dataTransfer)\n if (fragment) {\n const clipboardData = new DataTransfer()\n dataTransfer.types.forEach(type => {\n clipboardData.setData(type, dataTransfer.getData(type))\n })\n clipboardData.setData(`application/${clipboardFormatKey}`, fragment)\n return clipboardData\n }\n }\n return dataTransfer\n}\n\n/**\n * Get the dom selection from Shadow Root if possible, otherwise from the document\n */\nexport const getSelection = (root: Document | ShadowRoot): Selection | null => {\n if (root.getSelection != null) {\n return root.getSelection()\n }\n return document.getSelection()\n}\n\n/**\n * Check whether a mutation originates from a editable element inside the editor.\n */\n\nexport const isTrackedMutation = (\n editor: ReactEditor,\n mutation: MutationRecord,\n batch: MutationRecord[]\n): boolean => {\n const { target } = mutation\n if (isDOMElement(target) && target.matches('[contentEditable=\"false\"]')) {\n return false\n }\n\n const { document } = ReactEditor.getWindow(editor)\n if (document.contains(target)) {\n return ReactEditor.hasDOMNode(editor, target, { editable: true })\n }\n\n const parentMutation = batch.find(({ addedNodes, removedNodes }) => {\n for (const node of addedNodes) {\n if (node === target || node.contains(target)) {\n return true\n }\n }\n\n for (const node of removedNodes) {\n if (node === target || node.contains(target)) {\n return true\n }\n }\n })\n\n if (!parentMutation || parentMutation === mutation) {\n return false\n }\n\n // Target add/remove is tracked. Track the mutation if we track the parent mutation.\n return isTrackedMutation(editor, parentMutation, batch)\n}\n\n/**\n * Retrieves the deepest active element in the DOM, considering nested shadow DOMs.\n */\nexport const getActiveElement = () => {\n let activeElement = document.activeElement\n\n while (activeElement?.shadowRoot && activeElement.shadowRoot?.activeElement) {\n activeElement = activeElement?.shadowRoot?.activeElement\n }\n\n return activeElement\n}\n\n/**\n * @returns `true` if `otherNode` is before `node` in the document; otherwise, `false`.\n */\nexport const isBefore = (node: DOMNode, otherNode: DOMNode): boolean =>\n Boolean(\n node.compareDocumentPosition(otherNode) &\n DOMNode.DOCUMENT_POSITION_PRECEDING\n )\n\n/**\n * @returns `true` if `otherNode` is after `node` in the document; otherwise, `false`.\n */\nexport const isAfter = (node: DOMNode, otherNode: DOMNode): boolean =>\n Boolean(\n node.compareDocumentPosition(otherNode) &\n DOMNode.DOCUMENT_POSITION_FOLLOWING\n )\n","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nmodule.exports = _createClass, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nmodule.exports = _classCallCheck, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","/**\n * An auto-incrementing identifier for keys.\n */\n\nlet n = 0\n\n/**\n * A class that keeps track of a key string. We use a full class here because we\n * want to be able to use them as keys in `WeakMap` objects.\n */\n\nexport class Key {\n id: string\n\n constructor() {\n this.id = `${n++}`\n }\n}\n","import {\n BaseEditor,\n Editor,\n Element,\n Node,\n Path,\n Point,\n Range,\n Scrubber,\n Transforms,\n} from 'slate'\nimport { TextDiff } from '../utils/diff-text'\nimport {\n DOMElement,\n DOMNode,\n DOMPoint,\n DOMRange,\n DOMSelection,\n DOMStaticRange,\n DOMText,\n getSelection,\n hasShadowRoot,\n isAfter,\n isBefore,\n isDOMElement,\n isDOMNode,\n isDOMSelection,\n normalizeDOMPoint,\n} from '../utils/dom'\nimport { IS_ANDROID, IS_CHROME, IS_FIREFOX } from '../utils/environment'\n\nimport { Key } from '../utils/key'\nimport {\n EDITOR_TO_ELEMENT,\n EDITOR_TO_KEY_TO_ELEMENT,\n EDITOR_TO_PENDING_DIFFS,\n EDITOR_TO_SCHEDULE_FLUSH,\n EDITOR_TO_WINDOW,\n ELEMENT_TO_NODE,\n IS_COMPOSING,\n IS_FOCUSED,\n IS_READ_ONLY,\n NODE_TO_INDEX,\n NODE_TO_KEY,\n NODE_TO_PARENT,\n} from '../utils/weak-maps'\n\n/**\n * A React and DOM-specific version of the `Editor` interface.\n */\n\nexport interface ReactEditor extends BaseEditor {\n hasEditableTarget: (\n editor: ReactEditor,\n target: EventTarget | null\n ) => target is DOMNode\n hasRange: (editor: ReactEditor, range: Range) => boolean\n hasSelectableTarget: (\n editor: ReactEditor,\n target: EventTarget | null\n ) => boolean\n hasTarget: (\n editor: ReactEditor,\n target: EventTarget | null\n ) => target is DOMNode\n insertData: (data: DataTransfer) => void\n insertFragmentData: (data: DataTransfer) => boolean\n insertTextData: (data: DataTransfer) => boolean\n isTargetInsideNonReadonlyVoid: (\n editor: ReactEditor,\n target: EventTarget | null\n ) => boolean\n setFragmentData: (\n data: DataTransfer,\n originEvent?: 'drag' | 'copy' | 'cut'\n ) => void\n}\n\nexport interface ReactEditorInterface {\n /**\n * Experimental and android specific: Get pending diffs\n */\n androidPendingDiffs: (editor: Editor) => TextDiff[] | undefined\n\n /**\n * Experimental and android specific: Flush all pending diffs and cancel composition at the next possible time.\n */\n androidScheduleFlush: (editor: Editor) => void\n\n /**\n * Blur the editor.\n */\n blur: (editor: ReactEditor) => void\n\n /**\n * Deselect the editor.\n */\n deselect: (editor: ReactEditor) => void\n\n /**\n * Find the DOM node that implements DocumentOrShadowRoot for the editor.\n */\n findDocumentOrShadowRoot: (editor: ReactEditor) => Document | ShadowRoot\n\n /**\n * Get the target range from a DOM `event`.\n */\n findEventRange: (editor: ReactEditor, event: any) => Range\n\n /**\n * Find a key for a Slate node.\n */\n findKey: (editor: ReactEditor, node: Node) => Key\n\n /**\n * Find the path of Slate node.\n */\n findPath: (editor: ReactEditor, node: Node) => Path\n\n /**\n * Focus the editor.\n */\n focus: (editor: ReactEditor, options?: { retries: number }) => void\n\n /**\n * Return the host window of the current editor.\n */\n getWindow: (editor: ReactEditor) => Window\n\n /**\n * Check if a DOM node is within the editor.\n */\n hasDOMNode: (\n editor: ReactEditor,\n target: DOMNode,\n options?: { editable?: boolean }\n ) => boolean\n\n /**\n * Check if the target is editable and in the editor.\n */\n hasEditableTarget: (\n editor: ReactEditor,\n target: EventTarget | null\n ) => target is DOMNode\n\n /**\n *\n */\n hasRange: (editor: ReactEditor, range: Range) => boolean\n\n /**\n * Check if the target can be selectable\n */\n hasSelectableTarget: (\n editor: ReactEditor,\n target: EventTarget | null\n ) => boolean\n\n /**\n * Check if the target is in the editor.\n */\n hasTarget: (\n editor: ReactEditor,\n target: EventTarget | null\n ) => target is DOMNode\n\n /**\n * Insert data from a `DataTransfer` into the editor.\n */\n insertData: (editor: ReactEditor, data: DataTransfer) => void\n\n /**\n * Insert fragment data from a `DataTransfer` into the editor.\n */\n insertFragmentData: (editor: ReactEditor, data: DataTransfer) => boolean\n\n /**\n * Insert text data from a `DataTransfer` into the editor.\n */\n insertTextData: (editor: ReactEditor, data: DataTransfer) => boolean\n\n /**\n * Check if the user is currently composing inside the editor.\n */\n isComposing: (editor: ReactEditor) => boolean\n\n /**\n * Check if the editor is focused.\n */\n isFocused: (editor: ReactEditor) => boolean\n\n /**\n * Check if the editor is in read-only mode.\n */\n isReadOnly: (editor: ReactEditor) => boolean\n\n /**\n * Check if the target is inside void and in an non-readonly editor.\n */\n isTargetInsideNonReadonlyVoid: (\n editor: ReactEditor,\n target: EventTarget | null\n ) => boolean\n\n /**\n * Sets data from the currently selected fragment on a `DataTransfer`.\n */\n setFragmentData: (\n editor: ReactEditor,\n data: DataTransfer,\n originEvent?: 'drag' | 'copy' | 'cut'\n ) => void\n\n /**\n * Find the native DOM element from a Slate node.\n */\n toDOMNode: (editor: ReactEditor, node: Node) => HTMLElement\n\n /**\n * Find a native DOM selection point from a Slate point.\n */\n toDOMPoint: (editor: ReactEditor, point: Point) => DOMPoint\n\n /**\n * Find a native DOM range from a Slate `range`.\n *\n * Notice: the returned range will always be ordinal regardless of the direction of Slate `range` due to DOM API limit.\n *\n * there is no way to create a reverse DOM Range using Range.setStart/setEnd\n * according to https://dom.spec.whatwg.org/#concept-range-bp-set.\n */\n toDOMRange: (editor: ReactEditor, range: Range) => DOMRange\n\n /**\n * Find a Slate node from a native DOM `element`.\n */\n toSlateNode: (editor: ReactEditor, domNode: DOMNode) => Node\n\n /**\n * Find a Slate point from a DOM selection's `domNode` and `domOffset`.\n */\n toSlatePoint: <T extends boolean>(\n editor: ReactEditor,\n domPoint: DOMPoint,\n options: {\n exactMatch: boolean\n suppressThrow: T\n /**\n * The direction to search for Slate leaf nodes if `domPoint` is\n * non-editable and non-void.\n */\n searchDirection?: 'forward' | 'backward'\n }\n ) => T extends true ? Point | null : Point\n\n /**\n * Find a Slate range from a DOM range or selection.\n */\n toSlateRange: <T extends boolean>(\n editor: ReactEditor,\n domRange: DOMRange | DOMStaticRange | DOMSelection,\n options: {\n exactMatch: boolean\n suppressThrow: T\n }\n ) => T extends true ? Range | null : Range\n}\n\n// eslint-disable-next-line no-redeclare\nexport const ReactEditor: ReactEditorInterface = {\n androidPendingDiffs: editor => EDITOR_TO_PENDING_DIFFS.get(editor),\n\n androidScheduleFlush: editor => {\n EDITOR_TO_SCHEDULE_FLUSH.get(editor)?.()\n },\n\n blur: editor => {\n const el = ReactEditor.toDOMNode(editor, editor)\n const root = ReactEditor.findDocumentOrShadowRoot(editor)\n IS_FOCUSED.set(editor, false)\n\n if (root.activeElement === el) {\n el.blur()\n }\n },\n\n deselect: editor => {\n const { selection } = editor\n const root = ReactEditor.findDocumentOrShadowRoot(editor)\n const domSelection = getSelection(root)\n\n if (domSelection && domSelection.rangeCount > 0) {\n domSelection.removeAllRanges()\n }\n\n if (selection) {\n Transforms.deselect(editor)\n }\n },\n\n findDocumentOrShadowRoot: editor => {\n const el = ReactEditor.toDOMNode(editor, editor)\n const root = el.getRootNode()\n\n if (root instanceof Document || root instanceof ShadowRoot) {\n return root\n }\n\n return el.ownerDocument\n },\n\n findEventRange: (editor, event) => {\n if ('nativeEvent' in event) {\n event = event.nativeEvent\n }\n\n const { clientX: x, clientY: y, target } = event\n\n if (x == null || y == null) {\n throw new Error(`Cannot resolve a Slate range from a DOM event: ${event}`)\n }\n\n const node = ReactEditor.toSlateNode(editor, event.target)\n const path = ReactEditor.findPath(editor, node)\n\n // If the drop target is inside a void node, move it into either the\n // next or previous node, depending on which side the `x` and `y`\n // coordinates are closest to.\n if (Element.isElement(node) && Editor.isVoid(editor, node)) {\n const rect = target.getBoundingClientRect()\n const isPrev = editor.isInline(node)\n ? x - rect.left < rect.left + rect.width - x\n : y - rect.top < rect.top + rect.height - y\n\n const edge = Editor.point(editor, path, {\n edge: isPrev ? 'start' : 'end',\n })\n const point = isPrev\n ? Editor.before(editor, edge)\n : Editor.after(editor, edge)\n\n if (point) {\n const range = Editor.range(editor, point)\n return range\n }\n }\n\n // Else resolve a range from the caret position where the drop occured.\n let domRange\n const { document } = ReactEditor.getWindow(editor)\n\n // COMPAT: In Firefox, `caretRangeFromPoint` doesn't exist. (2016/07/25)\n if (document.caretRangeFromPoint) {\n domRange = document.caretRangeFromPoint(x, y)\n } else {\n const position = document.caretPositionFromPoint(x, y)\n\n if (position) {\n domRange = document.createRange()\n domRange.setStart(position.offsetNode, position.offset)\n domRange.setEnd(position.offsetNode, position.offset)\n }\n }\n\n if (!domRange) {\n throw new Error(`Cannot resolve a Slate range from a DOM event: ${event}`)\n }\n\n // Resolve a Slate range from the DOM range.\n const range = ReactEditor.toSlateRange(editor, domRange, {\n exactMatch: false,\n suppressThrow: false,\n })\n return range\n },\n\n findKey: (editor, node) => {\n let key = NODE_TO_KEY.get(node)\n\n if (!key) {\n key = new Key()\n NODE_TO_KEY.set(node, key)\n }\n\n return key\n },\n\n findPath: (editor, node) => {\n const path: Path = []\n let child = node\n\n while (true) {\n const parent = NODE_TO_PARENT.get(child)\n\n if (parent == null) {\n if (Editor.isEditor(child)) {\n return path\n } else {\n break\n }\n }\n\n const i = NODE_TO_INDEX.get(child)\n\n if (i == null) {\n break\n }\n\n path.unshift(i)\n child = parent\n }\n\n throw new Error(\n `Unable to find the path for Slate node: ${Scrubber.stringify(node)}`\n )\n },\n\n focus: (editor, options = { retries: 5 }) => {\n // Return if already focused\n if (IS_FOCUSED.get(editor)) {\n return\n }\n\n // Retry setting focus if the editor has pending operations.\n // The DOM (selection) is unstable while changes are applied.\n // Retry until retries are exhausted or editor is focused.\n if (options.retries <= 0) {\n throw new Error(\n 'Could not set focus, editor seems stuck with pending operations'\n )\n }\n if (editor.operations.length > 0) {\n setTimeout(() => {\n ReactEditor.focus(editor, { retries: options.retries - 1 })\n }, 10)\n return\n }\n\n const el = ReactEditor.toDOMNode(editor, editor)\n const root = ReactEditor.findDocumentOrShadowRoot(editor)\n if (root.activeElement !== el) {\n // Ensure that the DOM selection state is set to the editor's selection\n if (editor.selection && root instanceof Document) {\n const domSelection = getSelection(root)\n const domRange = ReactEditor.toDOMRange(editor, editor.selection)\n domSelection?.removeAllRanges()\n domSelection?.addRange(domRange)\n }\n // Create a new selection in the top of the document if missing\n if (!editor.selection) {\n Transforms.select(editor, Editor.start(editor, []))\n }\n // IS_FOCUSED should be set before calling el.focus() to ensure that\n // FocusedContext is updated to the correct value\n IS_FOCUSED.set(editor, true)\n el.focus({ preventScroll: true })\n }\n },\n\n getWindow: editor => {\n const window = EDITOR_TO_WINDOW.get(editor)\n if (!window) {\n throw new Error('Unable to find a host window element for this editor')\n }\n return window\n },\n\n hasDOMNode: (editor, target, options = {}) => {\n const { editable = false } = options\n const editorEl = ReactEditor.toDOMNode(editor, editor)\n let targetEl\n\n // COMPAT: In Firefox, reading `target.nodeType` will throw an error if\n // target is originating from an internal \"restricted\" element (e.g. a\n // stepper arrow on a number input). (2018/05/04)\n // https://github.com/ianstormtaylor/slate/issues/1819\n try {\n targetEl = (\n isDOMElement(target) ? target : target.parentElement\n ) as HTMLElement\n } catch (err) {\n if (\n err instanceof Error &&\n !err.message.includes('Permission denied to access property \"nodeType\"')\n ) {\n throw err\n }\n }\n\n if (!targetEl) {\n return false\n }\n\n return (\n targetEl.closest(`[data-slate-editor]`) === editorEl &&\n (!editable || targetEl.isContentEditable\n ? true\n : (typeof targetEl.isContentEditable === 'boolean' && // isContentEditable exists only on HTMLElement, and on other nodes it will be undefined\n // this is the core logic that lets you know you got the right editor.selection instead of null when editor is contenteditable=\"false\"(readOnly)\n targetEl.closest('[contenteditable=\"false\"]') === editorEl) ||\n !!targetEl.getAttribute('data-slate-zero-width'))\n )\n },\n\n hasEditableTarget: (editor, target): target is DOMNode =>\n isDOMNode(target) &&\n ReactEditor.hasDOMNode(editor, target, { editable: true }),\n\n hasRange: (editor, range) => {\n const { anchor, focus } = range\n return (\n Editor.hasPath(editor, anchor.path) && Editor.hasPath(editor, focus.path)\n )\n },\n\n hasSelectableTarget: (editor, target) =>\n ReactEditor.hasEditableTarget(editor, target) ||\n ReactEditor.isTargetInsideNonReadonlyVoid(editor, target),\n\n hasTarget: (editor, target): target is DOMNode =>\n isDOMNode(target) && ReactEditor.hasDOMNode(editor, target),\n\n insertData: (editor, data) => {\n editor.insertData(data)\n },\n\n insertFragmentData: (editor, data) => editor.insertFragmentData(data),\n\n insertTextData: (editor, data) => editor.insertTextData(data),\n\n isComposing: editor => {\n return !!IS_COMPOSING.get(editor)\n },\n\n isFocused: editor => !!IS_FOCUSED.get(editor),\n\n isReadOnly: editor => !!IS_READ_ONLY.get(editor),\n\n isTargetInsideNonReadonlyVoid: (editor, target) => {\n if (IS_READ_ONLY.get(editor)) return false\n\n const slateNode =\n ReactEditor.hasTarget(editor, target) &&\n ReactEditor.toSlateNode(editor, target)\n return Element.isElement(slateNode) && Editor.isVoid(editor, slateNode)\n },\n\n setFragmentData: (editor, data, originEvent) =>\n editor.setFragmentData(data, originEvent),\n\n toDOMNode: (editor, node) => {\n const KEY_TO_ELEMENT = EDITOR_TO_KEY_TO_ELEMENT.get(editor)\n const domNode = Editor.isEditor(node)\n ? EDITOR_TO_ELEMENT.get(editor)\n : KEY_TO_ELEMENT?.get(ReactEditor.findKey(editor, node))\n\n if (!domNode) {\n throw new Error(\n `Cannot resolve a DOM node from Slate node: ${Scrubber.stringify(node)}`\n )\n }\n\n return domNode\n },\n\n toDOMPoint: (editor, point) => {\n const [node] = Editor.node(editor, point.path)\n const el = ReactEditor.toDOMNode(editor, node)\n let domPoint: DOMPoint | undefined\n\n // If we're inside a void node, force the offset to 0, otherwise the zero\n // width spacing character will result in an incorrect offset of 1\n if (Editor.void(editor, { at: point })) {\n point = { path: point.path, offset: 0 }\n }\n\n // For each leaf, we need to isolate its content, which means filtering\n // to its direct text and zero-width spans. (We have to filter out any\n // other siblings that may have been rendered alongside them.)\n const selector = `[data-slate-string], [data-slate-zero-width]`\n const texts = Array.from(el.querySelectorAll(selector))\n let start = 0\n\n for (let i = 0; i < texts.length; i++) {\n const text = texts[i]\n const domNode = text.childNodes[0] as HTMLElement\n\n if (domNode == null || domNode.textContent == null) {\n continue\n }\n\n const { length } = domNode.textContent\n const attr = text.getAttribute('data-slate-length')\n const trueLength = attr == null ? length : parseInt(attr, 10)\n const end = start + trueLength\n\n // Prefer putting the selection inside the mark placeholder to ensure\n // composed text is displayed with the correct marks.\n const nextText = texts[i + 1]\n if (\n point.offset === end &&\n nextText?.hasAttribute('data-slate-mark-placeholder')\n ) {\n const domText = nextText.childNodes[0]\n\n domPoint = [\n // COMPAT: If we don't explicity set the dom point to be on the actual\n // dom text element, chrome will put the selection behind the actual dom\n // text element, causing domRange.getBoundingClientRect() calls on a collapsed\n // selection to return incorrect zero values (https://bugs.chromium.org/p/chromium/issues/detail?id=435438)\n // which will cause issues when scrolling to it.\n domText instanceof DOMText ? domText : nextText,\n nextText.textContent?.startsWith('\\uFEFF') ? 1 : 0,\n ]\n break\n }\n\n if (point.offset <= end) {\n const offset = Math.min(length, Math.max(0, point.offset - start))\n domPoint = [domNode, offset]\n break\n }\n\n start = end\n }\n\n if (!domPoint) {\n throw new Error(\n `Cannot resolve a DOM point from Slate point: ${Scrubber.stringify(\n point\n )}`\n )\n }\n\n return domPoint\n },\n\n toDOMRange: (editor, range) => {\n const { anchor, focus } = range\n const isBackward = Range.isBackward(range)\n const domAnchor = ReactEditor.toDOMPoint(editor, anchor)\n const domFocus = Range.isCollapsed(range)\n ? domAnchor\n : ReactEditor.toDOMPoint(editor, focus)\n\n const window = ReactEditor.getWindow(editor)\n const domRange = window.document.createRange()\n const [startNode, startOffset] = isBackward ? domFocus : domAnchor\n const [endNode, endOffset] = isBackward ? domAnchor : domFocus\n\n // A slate Point at zero-width Leaf always has an offset of 0 but a native DOM selection at\n // zero-width node has an offset of 1 so we have to check if we are in a zero-width node and\n // adjust the offset accordingly.\n const startEl = (\n isDOMElement(startNode) ? startNode : startNode.parentElement\n ) as HTMLElement\n const isStartAtZeroWidth = !!startEl.getAttribute('data-slate-zero-width')\n const endEl = (\n isDOMElement(endNode) ? endNode : endNode.parentElement\n ) as HTMLElement\n const isEndAtZeroWidth = !!endEl.getAttribute('data-slate-zero-width')\n\n domRange.setStart(startNode, isStartAtZeroWidth ? 1 : startOffset)\n domRange.setEnd(endNode, isEndAtZeroWidth ? 1 : endOffset)\n return domRange\n },\n\n toSlateNode: (editor, domNode) => {\n let domEl = isDOMElement(domNode) ? domNode : domNode.parentElement\n\n if (domEl && !domEl.hasAttribute('data-slate-node')) {\n domEl = domEl.closest(`[data-slate-node]`)\n }\n\n const node = domEl ? ELEMENT_TO_NODE.get(domEl as HTMLElement) : null\n\n if (!node) {\n throw new Error(`Cannot resolve a Slate node from DOM node: ${domEl}`)\n }\n\n return node\n },\n\n toSlatePoint: <T extends boolean>(\n editor: ReactEditor,\n domPoint: DOMPoint,\n options: {\n exactMatch: boolean\n suppressThrow: T\n searchDirection?: 'forward' | 'backward'\n }\n ): T extends true ? Point | null : Point => {\n const { exactMatch, suppressThrow, searchDirection = 'backward' } = options\n const [nearestNode, nearestOffset] = exactMatch\n ? domPoint\n : normalizeDOMPoint(domPoint)\n const parentNode = nearestNode.parentNode as DOMElement\n let textNode: DOMElement | null = null\n let offset = 0\n\n if (parentNode) {\n const editorEl = ReactEditor.toDOMNode(editor, editor)\n const potentialVoidNode = parentNode.closest('[data-slate-void=\"true\"]')\n // Need to ensure that the closest void node is actually a void node\n // within this editor, and not a void node within some parent editor. This can happen\n // if this editor is within a void node of another editor (\"nested editors\", like in\n // the \"Editable Voids\" example on the docs site).\n const voidNode =\n potentialVoidNode && editorEl.contains(potentialVoidNode)\n ? potentialVoidNode\n : null\n const potentialNonEditableNode = parentNode.closest(\n '[contenteditable=\"false\"]'\n )\n const nonEditableNode =\n potentialNonEditableNode && editorEl.contains(potentialNonEditableNode)\n ? potentialNonEditableNode\n : null\n let leafNode = parentNode.closest('[data-slate-leaf]')\n let domNode: DOMElement | null = null\n\n // Calculate how far into the text node the `nearestNode` is, so that we\n // can determine what the offset relative to the text node is.\n if (leafNode) {\n textNode = leafNode.closest('[data-slate-node=\"text\"]')\n\n if (textNode) {\n const window = ReactEditor.getWindow(editor)\n const range = window.document.createRange()\n range.setStart(textNode, 0)\n range.setEnd(nearestNode, nearestOffset)\n\n const contents = range.cloneContents()\n const removals = [\n ...Array.prototype.slice.call(\n contents.querySelectorAll('[data-slate-zero-width]')\n ),\n ...Array.prototype.slice.call(\n contents.querySelectorAll('[contenteditable=false]')\n ),\n ]\n\n removals.forEach(el => {\n // COMPAT: While composing at the start of a text node, some keyboards put\n // the text content inside the zero width space.\n if (\n IS_ANDROID &&\n !exactMatch &&\n el.hasAttribute('data-slate-zero-width') &&\n el.textContent.length > 0 &&\n el.textContext !== '\\uFEFF'\n ) {\n if (el.textContent.startsWith('\\uFEFF')) {\n el.textContent = el.textContent.slice(1)\n }\n\n return\n }\n\n el!.parentNode!.removeChild(el)\n })\n\n // COMPAT: Edge has a bug where Range.prototype.toString() will\n // convert \\n into \\r\\n. The bug causes a loop when slate-react\n // attempts to reposition its cursor to match the native position. Use\n // textContent.length instead.\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10291116/\n offset = contents.textContent!.length\n domNode = textNode\n }\n } else if (voidNode) {\n // For void nodes, the element with the offset key will be a cousin, not an\n // ancestor, so find it by going down from the nearest void parent and taking the\n // first one that isn't inside a nested editor.\n const leafNodes = voidNode.querySelectorAll('[data-slate-leaf]')\n for (let index = 0; index < leafNodes.length; index++) {\n const current = leafNodes[index]\n if (ReactEditor.hasDOMNode(editor, current)) {\n leafNode = current\n break\n }\n }\n\n // COMPAT: In read-only editors the leaf is not rendered.\n if (!leafNode) {\n offset = 1\n } else {\n textNode = leafNode.closest('[data-slate-node=\"text\"]')!\n domNode = leafNode\n offset = domNode.textContent!.length\n domNode.querySelectorAll('[data-slate-zero-width]').forEach(el => {\n offset -= el.textContent!.length\n })\n }\n } else if (nonEditableNode) {\n // Find the edge of the nearest leaf in `searchDirection`\n const getLeafNodes = (node: DOMElement | null | undefined) =>\n node\n ? node.querySelectorAll(\n // Exclude leaf nodes in nested editors\n '[data-slate-leaf]:not(:scope [data-slate-editor] [data-slate-leaf])'\n )\n : []\n const elementNode = nonEditableNode.closest(\n '[data-slate-node=\"element\"]'\n )\n\n if (searchDirection === 'forward') {\n const leafNodes = [\n ...getLeafNodes(elementNode),\n ...getLeafNodes(elementNode?.nextElementSibling),\n ]\n leafNode =\n leafNodes.find(leaf => isAfter(nonEditableNode, leaf)) ?? null\n } else {\n const leafNodes = [\n ...getLeafNodes(elementNode?.previousElementSibling),\n ...getLeafNodes(elementNode),\n ]\n leafNode =\n leafNodes.findLast(leaf => isBefore(nonEditableNode, leaf)) ?? null\n }\n\n if (leafNode) {\n textNode = leafNode.closest('[data-slate-node=\"text\"]')!\n domNode = leafNode\n if (searchDirection === 'forward') {\n offset = 0\n } else {\n offset = domNode.textContent!.length\n domNode.querySelectorAll('[data-slate-zero-width]').forEach(el => {\n offset -= el.textContent!.length\n })\n }\n }\n }\n\n if (\n domNode &&\n offset === domNode.textContent!.length &&\n // COMPAT: Android IMEs might remove the zero width space while composing,\n // and we don't add it for line-breaks.\n IS_ANDROID &&\n domNode.getAttribute('data-slate-zero-width') === 'z' &&\n domNode.textContent?.startsWith('\\uFEFF') &&\n // COMPAT: If the parent node is a Slate zero-width space, editor is\n // because the text node should have no characters. However, during IME\n // composition the ASCII characters will be prepended to the zero-width\n // space, so subtract 1 from the offset to account for the zero-width\n // space character.\n (parentNode.hasAttribute('data-slate-zero-width') ||\n // COMPAT: In Firefox, `range.cloneContents()` returns an extra trailing '\\n'\n // when the document ends with a new-line character. This results in the offset\n // length being off by one, so we need to subtract one to account for this.\n (IS_FIREFOX && domNode.textContent?.endsWith('\\n\\n')))\n ) {\n offset--\n }\n }\n\n if (IS_ANDROID && !textNode && !exactMatch) {\n const node = parentNode.hasAttribute('data-slate-node')\n ? parentNode\n : parentNode.closest('[data-slate-node]')\n\n if (node && ReactEditor.hasDOMNode(editor, node, { editable: true })) {\n const slateNode = ReactEditor.toSlateNode(editor, node)\n let { path, offset } = Editor.start(\n editor,\n ReactEditor.findPath(editor, slateNode)\n )\n\n if (!node.querySelector('[data-slate-leaf]')) {\n offset = nearestOffset\n }\n\n return { path, offset } as T extends true ? Point | null : Point\n }\n }\n\n if (!textNode) {\n if (suppressThrow) {\n return null as T extends true ? Point | null : Point\n }\n throw new Error(\n `Cannot resolve a Slate point from DOM point: ${domPoint}`\n )\n }\n\n // COMPAT: If someone is clicking from one Slate editor into another,\n // the select event fires twice, once for the old editor's `element`\n // first, and then afterwards for the correct `element`. (2017/03/03)\n const slateNode = ReactEditor.toSlateNode(editor, textNode!)\n const path = ReactEditor.findPath(editor, slateNode)\n return { path, offset } as T extends true ? Point | null : Point\n },\n\n toSlateRange: <T extends boolean>(\n editor: ReactEditor,\n domRange: DOMRange | DOMStaticRange | DOMSelection,\n options: {\n exactMatch: boolean\n suppressThrow: T\n }\n ): T extends true ? Range | null : Range => {\n const { exactMatch, suppressThrow } = options\n const el = isDOMSelection(domRange)\n ? domRange.anchorNode\n : domRange.startContainer\n let anchorNode\n let anchorOffset\n let focusNode\n let focusOffset\n let isCollapsed\n\n if (el) {\n if (isDOMSelection(domRange)) {\n // COMPAT: In firefox the normal seletion way does not work\n // (https://github.com/ianstormtaylor/slate/pull/5486#issue-1820720223)\n if (IS_FIREFOX && domRange.rangeCount > 1) {\n focusNode = domRange.focusNode // Focus node works fine\n const firstRange = domRange.getRangeAt(0)\n const lastRange = domRange.getRangeAt(domRange.rangeCount - 1)\n\n // Here we are in the contenteditable mode of a table in firefox\n if (\n focusNode instanceof HTMLTableRowElement &&\n firstRange.startContainer instanceof HTMLTableRowElement &&\n lastRange.startContainer instanceof HTMLTableRowElement\n ) {\n // HTMLElement, becouse Element is a slate element\n function getLastChildren(element: HTMLElement): HTMLElement {\n if (element.childElementCount > 0) {\n return getLastChildren(<HTMLElement>element.children[0])\n } else {\n return element\n }\n }\n\n const firstNodeRow = <HTMLTableRowElement>firstRange.startContainer\n const lastNodeRow = <HTMLTableRowElement>lastRange.startContainer\n\n // This should never fail as \"The HTMLElement interface represents any HTML element.\"\n const firstNode = getLastChildren(\n <HTMLElement>firstNodeRow.children[firstRange.startOffset]\n )\n const lastNode = getLastChildren(\n <HTMLElement>lastNodeRow.children[lastRange.startOffset]\n )\n\n // Zero, as we allways take the right one as the anchor point\n focusOffset = 0\n\n if (lastNode.childNodes.length > 0) {\n anchorNode = lastNode.childNodes[0]\n } else {\n anchorNode = lastNode\n }\n\n if (firstNode.childNodes.length > 0) {\n focusNode = firstNode.childNodes[0]\n } else {\n focusNode = firstNode\n }\n\n if (lastNode instanceof HTMLElement) {\n anchorOffset = (<HTMLElement>lastNode).innerHTML.length\n } else {\n // Fallback option\n anchorOffset = 0\n }\n } else {\n // This is the read only mode of a firefox table\n // Right to left\n if (firstRange.startContainer === focusNode) {\n anchorNode = lastRange.endContainer\n anchorOffset = lastRange.endOffset\n focusOffset = firstRange.startOffset\n } else {\n // Left to right\n anchorNode = firstRange.startContainer\n anchorOffset = firstRange.endOffset\n focusOffset = lastRange.startOffset\n }\n }\n } else {\n anchorNode = domRange.anchorNode\n anchorOffset = domRange.anchorOffset\n focusNode = domRange.focusNode\n focusOffset = domRange.focusOffset\n }\n\n // COMPAT: There's a bug in chrome that always returns `true` for\n // `isCollapsed` for a Selection that comes from a ShadowRoot.\n // (2020/08/08)\n // https://bugs.chromium.org/p/chromium/issues/detail?id=447523\n // IsCollapsed might not work in firefox, but this will\n if ((IS_CHROME && hasShadowRoot(anchorNode)) || IS_FIREFOX) {\n isCollapsed =\n domRange.anchorNode === domRange.focusNode &&\n domRange.anchorOffset === domRange.focusOffset\n } else {\n isCollapsed = domRange.isCollapsed\n }\n } else {\n anchorNode = domRange.startContainer\n anchorOffset = domRange.startOffset\n focusNode = domRange.endContainer\n focusOffset = domRange.endOffset\n isCollapsed = domRange.collapsed\n }\n }\n\n if (\n anchorNode == null ||\n focusNode == null ||\n anchorOffset == null ||\n focusOffset == null\n ) {\n throw new Error(\n `Cannot resolve a Slate range from DOM range: ${domRange}`\n )\n }\n\n // COMPAT: Firefox sometimes includes an extra \\n (rendered by TextString\n // when isTrailing is true) in the focusOffset, resulting in an invalid\n // Slate point. (2023/11/01)\n if (\n IS_FIREFOX &&\n focusNode.textContent?.endsWith('\\n\\n') &&\n focusOffset === focusNode.textContent.length\n ) {\n focusOffset--\n }\n\n const anchor = ReactEditor.toSlatePoint(\n editor,\n [anchorNode, anchorOffset],\n {\n exactMatch,\n suppressThrow,\n }\n )\n if (!anchor) {\n return null as T extends true ? Range | null : Range\n }\n\n const focusBeforeAnchor =\n isBefore(anchorNode, focusNode) ||\n (anchorNode === focusNode && focusOffset < anchorOffset)\n const focus = isCollapsed\n ? anchor\n : ReactEditor.toSlatePoint(editor, [focusNode, focusOffset], {\n exactMatch,\n suppressThrow,\n searchDirection: focusBeforeAnchor ? 'forward' : 'backward',\n })\n if (!focus) {\n return null as T extends true ? Range | null : Range\n }\n\n let range: Range = { anchor: anchor as Point, focus: focus as Point }\n // if the selection is a hanging range that ends in a void\n // and the DOM focus is an Element\n // (meaning that the selection ends before the element)\n // unhang the range to avoid mistakenly including the void\n if (\n Range.isExpanded(range) &&\n Range.isForward(range) &&\n isDOMElement(focusNode) &&\n Editor.void(editor, { at: range.focus, mode: 'highest' })\n ) {\n range = Editor.unhangRange(editor, range, { voids: true })\n }\n\n return range as unknown as T extends true ? Range | null : Range\n },\n}\n","import {\n Editor,\n Node,\n Operation,\n Path,\n Point,\n Range,\n Text,\n Element,\n} from 'slate'\nimport { EDITOR_TO_PENDING_DIFFS } from './weak-maps'\n\nexport type StringDiff = {\n start: number\n end: number\n text: string\n}\n\nexport type TextDiff = {\n id: number\n path: Path\n diff: StringDiff\n}\n\n/**\n * Check whether a text diff was applied in a way we can perform the pending action on /\n * recover the pending selection.\n */\nexport function verifyDiffState(editor: Editor, textDiff: TextDiff): boolean {\n const { path, diff } = textDiff\n if (!Editor.hasPath(editor, path)) {\n return false\n }\n\n const node = Node.get(editor, path)\n if (!Text.isText(node)) {\n return false\n }\n\n if (diff.start !== node.text.length || diff.text.length === 0) {\n return (\n node.text.slice(diff.start, diff.start + diff.text.length) === diff.text\n )\n }\n\n const nextPath = Path.next(path)\n if (!Editor.hasPath(editor, nextPath)) {\n return false\n }\n\n const nextNode = Node.get(editor, nextPath)\n return Text.isText(nextNode) && nextNode.text.startsWith(diff.text)\n}\n\nexport function applyStringDiff(text: string, ...diffs: StringDiff[]) {\n return diffs.reduce(\n (text, diff) =>\n text.slice(0, diff.start) + diff.text + text.slice(diff.end),\n text\n )\n}\n\nfunction longestCommonPrefixLength(str: string, another: string) {\n const length = Math.min(str.length, another.length)\n\n for (let i = 0; i < length; i++) {\n if (str.charAt(i) !== another.charAt(i)) {\n return i\n }\n }\n\n return length\n}\n\nfunction longestCommonSuffixLength(\n str: string,\n another: string,\n max: number\n): number {\n const length = Math.min(str.length, another.length, max)\n\n for (let i = 0; i < length; i++) {\n if (\n str.charAt(str.length - i - 1) !== another.charAt(another.length - i - 1)\n ) {\n return i\n }\n }\n\n return length\n}\n\n/**\n * Remove redundant changes from the diff so that it spans the minimal possible range\n */\nexport function normalizeStringDiff(targetText: string, diff: StringDiff) {\n const { start, end, text } = diff\n const removedText = targetText.slice(start, end)\n\n const prefixLength = longestCommonPrefixLength(removedText, text)\n const max = Math.min(\n removedText.length - prefixLength,\n text.length - prefixLength\n )\n const suffixLength = longestCommonSuffixLength(removedText, text, max)\n\n const normalized: StringDiff = {\n start: start + prefixLength,\n end: end - suffixLength,\n text: text.slice(prefixLength, text.length - suffixLength),\n }\n\n if (normalized.start === normalized.end && normalized.text.length === 0) {\n return null\n }\n\n return normalized\n}\n\n/**\n * Return a string diff that is equivalent to applying b after a spanning the range of\n * both changes\n */\nexport function mergeStringDiffs(\n targetText: string,\n a: StringDiff,\n b: StringDiff\n): StringDiff | null {\n const start = Math.min(a.start, b.start)\n const overlap = Math.max(\n 0,\n Math.min(a.start + a.text.length, b.end) - b.start\n )\n\n const applied = applyStringDiff(targetText, a, b)\n const sliceEnd = Math.max(\n b.start + b.text.length,\n a.start +\n a.text.length +\n (a.start + a.text.length > b.start ? b.text.length : 0) -\n overlap\n )\n\n const text = applied.slice(start, sliceEnd)\n const end = Math.max(a.end, b.end - a.text.length + (a.end - a.start))\n return normalizeStringDiff(targetText, { start, end, text })\n}\n\n/**\n * Get the slate range the text diff spans.\n */\nexport function targetRange(textDiff: TextDiff): Range {\n const { path, diff } = textDiff\n return {\n anchor: { path, offset: diff.start },\n focus: { path, offset: diff.end },\n }\n}\n\n/**\n * Normalize a 'pending point' a.k.a a point based on the dom state before applying\n * the pending diffs. Since the pending diffs might have been inserted with different\n * marks we have to 'walk' the offset from the starting position to ensure we still\n * have a valid point inside the document\n */\nexport function normalizePoint(editor: Editor, point: Point): Point | null {\n let { path, offset } = point\n if (!Editor.hasPath(editor, path)) {\n return null\n }\n\n let leaf = Node.get(editor, path)\n if (!Text.isText(leaf)) {\n return null\n }\n\n const parentBlock = Editor.above(editor, {\n match: n => Element.isElement(n) && Editor.isBlock(editor, n),\n at: path,\n })\n\n if (!parentBlock) {\n return null\n }\n\n while (offset > leaf.text.length) {\n const entry = Editor.next(editor, { at: path, match: Text.isText })\n if (!entry || !Path.isDescendant(entry[1], parentBlock[1])) {\n return null\n }\n\n offset -= leaf.text.length\n leaf = entry[0]\n path = entry[1]\n }\n\n return { path, offset }\n}\n\n/**\n * Normalize a 'pending selection' to ensure it's valid in the current document state.\n */\nexport function normalizeRange(editor: Editor, range: Range): Range | null {\n const anchor = normalizePoint(editor, range.anchor)\n if (!anchor) {\n return null\n }\n\n if (Range.isCollapsed(range)) {\n return { anchor, focus: anchor }\n }\n\n const focus = normalizePoint(editor, range.focus)\n if (!focus) {\n return null\n }\n\n return { anchor, focus }\n}\n\nexport function transformPendingPoint(\n editor: Editor,\n point: Point,\n op: Operation\n): Point | null {\n const pendingDiffs = EDITOR_TO_PENDING_DIFFS.get(editor)\n const textDiff = pendingDiffs?.find(({ path }) =>\n Path.equals(path, point.path)\n )\n\n if (!textDiff || point.offset <= textDiff.diff.start) {\n return Point.transform(point, op, { affinity: 'backward' })\n }\n\n const { diff } = textDiff\n // Point references location inside the diff => transform the point based on the location\n // the diff will be applied to and add the offset inside the diff.\n if (point.offset <= diff.start + diff.text.length) {\n const anchor = { path: point.path, offset: diff.start }\n const transformed = Point.transform(anchor, op, {\n affinity: 'backward',\n })\n\n if (!transformed) {\n return null\n }\n\n return {\n path: transformed.path,\n offset: transformed.offset + point.offset - diff.start,\n }\n }\n\n // Point references location after the diff\n const anchor = {\n path: point.path,\n offset: point.offset - diff.text.length + diff.end - diff.start,\n }\n const transformed = Point.transform(anchor, op, {\n affinity: 'backward',\n })\n if (!transformed) {\n return null\n }\n\n if (\n op.type === 'split_node' &&\n Path.equals(op.path, point.path) &&\n anchor.offset < op.position &&\n diff.start < op.position\n ) {\n return transformed\n }\n\n return {\n path: transformed.path,\n offset: transformed.offset + diff.text.length - diff.end + diff.start,\n }\n}\n\nexport function transformPendingRange(\n editor: Editor,\n range: Range,\n op: Operation\n): Range | null {\n const anchor = transformPendingPoint(editor, range.anchor, op)\n if (!anchor) {\n return null\n }\n\n if (Range.isCollapsed(range)) {\n return { anchor, focus: anchor }\n }\n\n const focus = transformPendingPoint(editor, range.focus, op)\n if (!focus) {\n return null\n }\n\n return { anchor, focus }\n}\n\nexport function transformTextDiff(\n textDiff: TextDiff,\n op: Operation\n): TextDiff | null {\n const { path, diff, id } = textDiff\n\n switch (op.type) {\n case 'insert_text': {\n if (!Path.equals(op.path, path) || op.offset >= diff.end) {\n return textDiff\n }\n\n if (op.offset <= diff.start) {\n return {\n diff: {\n start: op.text.length + diff.start,\n end: op.text.length + diff.end,\n text: diff.text,\n },\n id,\n path,\n }\n }\n\n return {\n diff: {\n start: diff.start,\n end: diff.end + op.text.length,\n text: diff.text,\n },\n id,\n path,\n }\n }\n case 'remove_text': {\n if (!Path.equals(op.path, path) || op.offset >= diff.end) {\n return textDiff\n }\n\n if (op.offset + op.text.length <= diff.start) {\n return {\n diff: {\n start: diff.start - op.text.length,\n end: diff.end - op.text.length,\n text: diff.text,\n },\n id,\n path,\n }\n }\n\n return {\n diff: {\n start: diff.start,\n end: diff.end - op.text.length,\n text: diff.text,\n },\n id,\n path,\n }\n }\n case 'split_node': {\n if (!Path.equals(op.path, path) || op.position >= diff.end) {\n return {\n diff,\n id,\n path: Path.transform(path, op, { affinity: 'backward' })!,\n }\n }\n\n if (op.position > diff.start) {\n return {\n diff: {\n start: diff.start,\n end: Math.min(op.position, diff.end),\n text: diff.text,\n },\n id,\n path,\n }\n }\n\n return {\n diff: {\n start: diff.start - op.position,\n end: diff.end - op.position,\n text: diff.text,\n },\n id,\n path: Path.transform(path, op, { affinity: 'forward' })!,\n }\n }\n case 'merge_node': {\n if (!Path.equals(op.path, path)) {\n return {\n diff,\n id,\n path: Path.transform(path, op)!,\n }\n }\n\n return {\n diff: {\n start: diff.start + op.position,\n end: diff.end + op.position,\n text: diff.text,\n },\n id,\n path: Path.transform(path, op)!,\n }\n }\n }\n\n const newPath = Path.transform(path, op)\n if (!newPath) {\n return null\n }\n\n return {\n diff,\n path: newPath,\n id,\n }\n}\n","import { DebouncedFunc } from 'lodash'\nimport { Editor, Node, Path, Point, Range, Text, Transforms } from 'slate'\nimport { ReactEditor } from '../../plugin/react-editor'\nimport {\n applyStringDiff,\n mergeStringDiffs,\n normalizePoint,\n normalizeRange,\n normalizeStringDiff,\n StringDiff,\n targetRange,\n TextDiff,\n verifyDiffState,\n} from '../../utils/diff-text'\nimport { isDOMSelection, isTrackedMutation } from '../../utils/dom'\nimport {\n EDITOR_TO_FORCE_RENDER,\n EDITOR_TO_PENDING_ACTION,\n EDITOR_TO_PENDING_DIFFS,\n EDITOR_TO_PENDING_INSERTION_MARKS,\n EDITOR_TO_PENDING_SELECTION,\n EDITOR_TO_PLACEHOLDER_ELEMENT,\n EDITOR_TO_USER_MARKS,\n IS_COMPOSING,\n} from '../../utils/weak-maps'\n\nexport type Action = { at?: Point | Range; run: () => void }\n\n// https://github.com/facebook/draft-js/blob/main/src/component/handlers/composition/DraftEditorCompositionHandler.js#L41\n// When using keyboard English association function, conpositionEnd triggered too fast, resulting in after `insertText` still maintain association state.\nconst RESOLVE_DELAY = 25\n\n// Time with no user interaction before the current user action is considered as done.\nconst FLUSH_DELAY = 200\n\n// Replace with `const debug = console.log` to debug\nconst debug = (..._: unknown[]) => {}\n\n// Type guard to check if a value is a DataTransfer\nconst isDataTransfer = (value: any): value is DataTransfer =>\n value?.constructor.name === 'DataTransfer'\n\nexport type CreateAndroidInputManagerOptions = {\n editor: ReactEditor\n\n scheduleOnDOMSelectionChange: DebouncedFunc<() => void>\n onDOMSelectionChange: DebouncedFunc<() => void>\n}\n\nexport type AndroidInputManager = {\n flush: () => void\n scheduleFlush: () => void\n\n hasPendingDiffs: () => boolean\n hasPendingAction: () => boolean\n hasPendingChanges: () => boolean\n isFlushing: () => boolean | 'action'\n\n handleUserSelect: (range: Range | null) => void\n handleCompositionEnd: (event: React.CompositionEvent<HTMLDivElement>) => void\n handleCompositionStart: (\n event: React.CompositionEvent<HTMLDivElement>\n ) => void\n handleDOMBeforeInput: (event: InputEvent) => void\n handleKeyDown: (event: React.KeyboardEvent<HTMLDivElement>) => void\n\n handleDomMutations: (mutations: MutationRecord[]) => void\n handleInput: () => void\n}\n\nexport function createAndroidInputManager({\n editor,\n scheduleOnDOMSelectionChange,\n onDOMSelectionChange,\n}: CreateAndroidInputManagerOptions): AndroidInputManager {\n let flushing: 'action' | boolean = false\n let compositionEndTimeoutId: ReturnType<typeof setTimeout> | null = null\n let flushTimeoutId: ReturnType<typeof setTimeout> | null = null\n let actionTimeoutId: ReturnType<typeof setTimeout> | null = null\n\n let idCounter = 0\n let insertPositionHint: StringDiff | null | false = false\n\n const applyPendingSelection = () => {\n const pendingSelection = EDITOR_TO_PENDING_SELECTION.get(editor)\n EDITOR_TO_PENDING_SELECTION.delete(editor)\n\n if (pendingSelection) {\n const { selection } = editor\n const normalized = normalizeRange(editor, pendingSelection)\n\n debug('apply pending selection', pendingSelection, normalized)\n\n if (normalized && (!selection || !Range.equals(normalized, selection))) {\n Transforms.select(editor, normalized)\n }\n }\n }\n\n const performAction = () => {\n const action = EDITOR_TO_PENDING_ACTION.get(editor)\n EDITOR_TO_PENDING_ACTION.delete(editor)\n if (!action) {\n return\n }\n\n if (action.at) {\n const target = Point.isPoint(action.at)\n ? normalizePoint(editor, action.at)\n : normalizeRange(editor, action.at)\n\n if (!target) {\n return\n }\n\n const targetRange = Editor.range(editor, target)\n if (!editor.selection || !Range.equals(editor.selection, targetRange)) {\n Transforms.select(editor, target)\n }\n }\n\n action.run()\n }\n\n const flush = () => {\n if (flushTimeoutId) {\n clearTimeout(flushTimeoutId)\n flushTimeoutId = null\n }\n\n if (actionTimeoutId) {\n clearTimeout(actionTimeoutId)\n actionTimeoutId = null\n }\n\n if (!hasPendingDiffs() && !hasPendingAction()) {\n applyPendingSelection()\n return\n }\n\n if (!flushing) {\n flushing = true\n setTimeout(() => (flushing = false))\n }\n\n if (hasPendingAction()) {\n flushing = 'action'\n }\n\n const selectionRef =\n editor.selection &&\n Editor.rangeRef(editor, editor.selection, { affinity: 'forward' })\n EDITOR_TO_USER_MARKS.set(editor, editor.marks)\n\n debug(\n 'flush',\n EDITOR_TO_PENDING_ACTION.get(editor),\n EDITOR_TO_PENDING_DIFFS.get(editor)\n )\n\n let scheduleSelectionChange = hasPendingDiffs()\n\n let diff: TextDiff | undefined\n while ((diff = EDITOR_TO_PENDING_DIFFS.get(editor)?.[0])) {\n const pendingMarks = EDITOR_TO_PENDING_INSERTION_MARKS.get(editor)\n\n if (pendingMarks !== undefined) {\n EDITOR_TO_PENDING_INSERTION_MARKS.delete(editor)\n editor.marks = pendingMarks\n }\n\n if (pendingMarks && insertPositionHint === false) {\n insertPositionHint = null\n debug('insert after mark placeholder')\n }\n\n const range = targetRange(diff)\n if (!editor.selection || !Range.equals(editor.selection, range)) {\n Transforms.select(editor, range)\n }\n\n if (diff.diff.text) {\n Editor.insertText(editor, diff.diff.text)\n } else {\n Editor.deleteFragment(editor)\n }\n\n // Remove diff only after we have applied it to account for it when transforming\n // pending ranges.\n EDITOR_TO_PENDING_DIFFS.set(\n editor,\n EDITOR_TO_PENDING_DIFFS.get(editor)?.filter(\n ({ id }) => id !== diff!.id\n )!\n )\n\n if (!verifyDiffState(editor, diff)) {\n debug('invalid diff state')\n scheduleSelectionChange = false\n EDITOR_TO_PENDING_ACTION.delete(editor)\n EDITOR_TO_USER_MARKS.delete(editor)\n flushing = 'action'\n\n // Ensure we don't restore the pending user (dom) selection\n // since the document and dom state do not match.\n EDITOR_TO_PENDING_SELECTION.delete(editor)\n scheduleOnDOMSelectionChange.cancel()\n onDOMSelectionChange.cancel()\n selectionRef?.unref()\n }\n }\n\n const selection = selectionRef?.unref()\n if (\n selection &&\n !EDITOR_TO_PENDING_SELECTION.get(editor) &&\n (!editor.selection || !Range.equals(selection, editor.selection))\n ) {\n Transforms.select(editor, selection)\n }\n\n if (hasPendingAction()) {\n performAction()\n return\n }\n\n // COMPAT: The selectionChange event is fired after the action is performed,\n // so we have to manually schedule it to ensure we don't 'throw away' the selection\n // while rendering if we have pending changes.\n if (scheduleSelectionChange) {\n debug('scheduleOnDOMSelectionChange pending changes')\n scheduleOnDOMSelectionChange()\n }\n\n scheduleOnDOMSelectionChange.flush()\n onDOMSelectionChange.flush()\n\n applyPendingSelection()\n\n const userMarks = EDITOR_TO_USER_MARKS.get(editor)\n EDITOR_TO_USER_MARKS.delete(editor)\n if (userMarks !== undefined) {\n editor.marks = userMarks\n editor.onChange()\n }\n }\n\n const handleCompositionEnd = (\n _event: React.CompositionEvent<HTMLDivElement>\n ) => {\n if (compositionEndTimeoutId) {\n clearTimeout(compositionEndTimeoutId)\n }\n\n compositionEndTimeoutId = setTimeout(() => {\n IS_COMPOSING.set(editor, false)\n flush()\n }, RESOLVE_DELAY)\n }\n\n const handleCompositionStart = (\n _event: React.CompositionEvent<HTMLDivElement>\n ) => {\n debug('composition start')\n\n IS_COMPOSING.set(editor, true)\n\n if (compositionEndTimeoutId) {\n clearTimeout(compositionEndTimeoutId)\n compositionEndTimeoutId = null\n }\n }\n\n const updatePlaceholderVisibility = (forceHide = false) => {\n const placeholderElement = EDITOR_TO_PLACEHOLDER_ELEMENT.get(editor)\n if (!placeholderElement) {\n return\n }\n\n if (hasPendingDiffs() || forceHide) {\n placeholderElement.style.display = 'none'\n return\n }\n\n placeholderElement.style.removeProperty('display')\n }\n\n const storeDiff = (path: Path, diff: StringDiff) => {\n debug('storeDiff', path, diff)\n\n const pendingDiffs = EDITOR_TO_PENDING_DIFFS.get(editor) ?? []\n EDITOR_TO_PENDING_DIFFS.set(editor, pendingDiffs)\n\n const target = Node.leaf(editor, path)\n const idx = pendingDiffs.findIndex(change => Path.equals(change.path, path))\n if (idx < 0) {\n const normalized = normalizeStringDiff(target.text, diff)\n if (normalized) {\n pendingDiffs.push({ path, diff, id: idCounter++ })\n }\n\n updatePlaceholderVisibility()\n return\n }\n\n const merged = mergeStringDiffs(target.text, pendingDiffs[idx].diff, diff)\n if (!merged) {\n pendingDiffs.splice(idx, 1)\n updatePlaceholderVisibility()\n return\n }\n\n pendingDiffs[idx] = {\n ...pendingDiffs[idx],\n diff: merged,\n }\n }\n\n const scheduleAction = (\n run: () => void,\n { at }: { at?: Point | Range } = {}\n ): void => {\n insertPositionHint = false\n debug('scheduleAction', { at, run })\n\n EDITOR_TO_PENDING_SELECTION.delete(editor)\n scheduleOnDOMSelectionChange.cancel()\n onDOMSelectionChange.cancel()\n\n if (hasPendingAction()) {\n flush()\n }\n\n EDITOR_TO_PENDING_ACTION.set(editor, { at, run })\n\n // COMPAT: When deleting before a non-contenteditable element chrome only fires a beforeinput,\n // (no input) and doesn't perform any dom mutations. Without a flush timeout we would never flush\n // in this case and thus never actually perform the action.\n actionTimeoutId = setTimeout(flush)\n }\n\n const handleDOMBeforeInput = (event: InputEvent): void => {\n if (flushTimeoutId) {\n clearTimeout(flushTimeoutId)\n flushTimeoutId = null\n }\n\n const { inputType: type } = event\n let targetRange: Range | null = null\n const data: DataTransfer | string | undefined =\n (event as any).dataTransfer || event.data || undefined\n\n if (\n insertPositionHint !== false &&\n type !== 'insertText' &&\n type !== 'insertCompositionText'\n ) {\n insertPositionHint = false\n }\n\n let [nativeTargetRange] = (event as any).getTargetRanges()\n if (nativeTargetRange) {\n targetRange = ReactEditor.toSlateRange(editor, nativeTargetRange, {\n exactMatch: false,\n suppressThrow: true,\n })\n }\n\n // COMPAT: SelectionChange event is fired after the action is performed, so we\n // have to manually get the selection here to ensure it's up-to-date.\n const window = ReactEditor.getWindow(editor)\n const domSelection = window.getSelection()\n if (!targetRange && domSelection) {\n nativeTargetRange = domSelection\n targetRange = ReactEditor.toSlateRange(editor, domSelection, {\n exactMatch: false,\n suppressThrow: true,\n })\n }\n\n targetRange = targetRange ?? editor.selection\n if (!targetRange) {\n return\n }\n\n // By default, the input manager tries to store text diffs so that we can\n // defer flushing them at a later point in time. We don't want to flush\n // for every input event as this can be expensive. However, there are some\n // scenarios where we cannot safely store the text diff and must instead\n // schedule an action to let Slate normalize the editor state.\n let canStoreDiff = true\n\n if (type.startsWith('delete')) {\n if (Range.isExpanded(targetRange)) {\n const [start, end] = Range.edges(targetRange)\n const leaf = Node.leaf(editor, start.path)\n\n if (leaf.text.length === start.offset && end.offset === 0) {\n const next = Editor.next(editor, {\n at: start.path,\n match: Text.isText,\n })\n if (next && Path.equals(next[1], end.path)) {\n targetRange = { anchor: end, focus: end }\n }\n }\n }\n\n const direction = type.endsWith('Backward') ? 'backward' : 'forward'\n const [start, end] = Range.edges(targetRange)\n const [leaf, path] = Editor.leaf(editor, start.path)\n\n const diff = {\n text: '',\n start: start.offset,\n end: end.offset,\n }\n const pendingDiffs = EDITOR_TO_PENDING_DIFFS.get(editor)\n const relevantPendingDiffs = pendingDiffs?.find(change =>\n Path.equals(change.path, path)\n )\n const diffs = relevantPendingDiffs\n ? [relevantPendingDiffs.diff, diff]\n : [diff]\n const text = applyStringDiff(leaf.text, ...diffs)\n\n if (text.length === 0) {\n // Text leaf will be removed, so we need to schedule an\n // action to remove it so that Slate can normalize instead\n // of storing as a diff\n canStoreDiff = false\n }\n\n if (Range.isExpanded(targetRange)) {\n if (\n canStoreDiff &&\n Path.equals(targetRange.anchor.path, targetRange.focus.path)\n ) {\n const point = { path: targetRange.anchor.path, offset: start.offset }\n const range = Editor.range(editor, point, point)\n handleUserSelect(range)\n\n return storeDiff(targetRange.anchor.path, {\n text: '',\n end: end.offset,\n start: start.offset,\n })\n }\n\n return scheduleAction(\n () => Editor.deleteFragment(editor, { direction }),\n { at: targetRange }\n )\n }\n }\n\n switch (type) {\n case 'deleteByComposition':\n case 'deleteByCut':\n case 'deleteByDrag': {\n return scheduleAction(() => Editor.deleteFragment(editor), {\n at: targetRange,\n })\n }\n\n case 'deleteContent':\n case 'deleteContentForward': {\n const { anchor } = targetRange\n if (canStoreDiff && Range.isCollapsed(targetRange)) {\n const targetNode = Node.leaf(editor, anchor.path)\n\n if (anchor.offset < targetNode.text.length) {\n return storeDiff(anchor.path, {\n text: '',\n start: anchor.offset,\n end: anchor.offset + 1,\n })\n }\n }\n\n return scheduleAction(() => Editor.deleteForward(editor), {\n at: targetRange,\n })\n }\n\n case 'deleteContentBackward': {\n const { anchor } = targetRange\n\n // If we have a mismatch between the native and slate selection being collapsed\n // we are most likely deleting a zero-width placeholder and thus should perform it\n // as an action to ensure correct behavior (mostly happens with mark placeholders)\n const nativeCollapsed = isDOMSelection(nativeTargetRange)\n ? nativeTargetRange.isCollapsed\n : !!nativeTargetRange?.collapsed\n\n if (\n canStoreDiff &&\n nativeCollapsed &&\n Range.isCollapsed(targetRange) &&\n anchor.offset > 0\n ) {\n return storeDiff(anchor.path, {\n text: '',\n start: anchor.offset - 1,\n end: anchor.offset,\n })\n }\n\n return scheduleAction(() => Editor.deleteBackward(editor), {\n at: targetRange,\n })\n }\n\n case 'deleteEntireSoftLine': {\n return scheduleAction(\n () => {\n Editor.deleteBackward(editor, { unit: 'line' })\n Editor.deleteForward(editor, { unit: 'line' })\n },\n { at: targetRange }\n )\n }\n\n case 'deleteHardLineBackward': {\n return scheduleAction(\n () => Editor.deleteBackward(editor, { unit: 'block' }),\n { at: targetRange }\n )\n }\n\n case 'deleteSoftLineBackward': {\n return scheduleAction(\n () => Editor.deleteBackward(editor, { unit: 'line' }),\n { at: targetRange }\n )\n }\n\n case 'deleteHardLineForward': {\n return scheduleAction(\n () => Editor.deleteForward(editor, { unit: 'block' }),\n { at: targetRange }\n )\n }\n\n case 'deleteSoftLineForward': {\n return scheduleAction(\n () => Editor.deleteForward(editor, { unit: 'line' }),\n { at: targetRange }\n )\n }\n\n case 'deleteWordBackward': {\n return scheduleAction(\n () => Editor.deleteBackward(editor, { unit: 'word' }),\n { at: targetRange }\n )\n }\n\n case 'deleteWordForward': {\n return scheduleAction(\n () => Editor.deleteForward(editor, { unit: 'word' }),\n { at: targetRange }\n )\n }\n\n case 'insertLineBreak': {\n return scheduleAction(() => Editor.insertSoftBreak(editor), {\n at: targetRange,\n })\n }\n\n case 'insertParagraph': {\n return scheduleAction(() => Editor.insertBreak(editor), {\n at: targetRange,\n })\n }\n case 'insertCompositionText':\n case 'deleteCompositionText':\n case 'insertFromComposition':\n case 'insertFromDrop':\n case 'insertFromPaste':\n case 'insertFromYank':\n case 'insertReplacementText':\n case 'insertText': {\n if (isDataTransfer(data)) {\n return scheduleAction(() => ReactEditor.insertData(editor, data), {\n at: targetRange,\n })\n }\n\n let text = data ?? ''\n\n // COMPAT: If we are writing inside a placeholder, the ime inserts the text inside\n // the placeholder itself and thus includes the zero-width space inside edit events.\n if (EDITOR_TO_PENDING_INSERTION_MARKS.get(editor)) {\n text = text.replace('\\uFEFF', '')\n }\n\n // Pastes from the Android clipboard will generate `insertText` events.\n // If the copied text contains any newlines, Android will append an\n // extra newline to the end of the copied text.\n if (type === 'insertText' && /.*\\n.*\\n$/.test(text)) {\n text = text.slice(0, -1)\n }\n\n // If the text includes a newline, split it at newlines and paste each component\n // string, with soft breaks in between each.\n if (text.includes('\\n')) {\n return scheduleAction(\n () => {\n const parts = text.split('\\n')\n parts.forEach((line, i) => {\n if (line) {\n Editor.insertText(editor, line)\n }\n if (i !== parts.length - 1) {\n Editor.insertSoftBreak(editor)\n }\n })\n },\n {\n at: targetRange,\n }\n )\n }\n\n if (Path.equals(targetRange.anchor.path, targetRange.focus.path)) {\n const [start, end] = Range.edges(targetRange)\n\n const diff = {\n start: start.offset,\n end: end.offset,\n text,\n }\n\n // COMPAT: Swiftkey has a weird bug where the target range of the 2nd word\n // inserted after a mark placeholder is inserted with an anchor offset off by 1.\n // So writing 'some text' will result in 'some ttext'. Luckily all 'normal' insert\n // text events are fired with the correct target ranges, only the final 'insertComposition'\n // isn't, so we can adjust the target range start offset if we are confident this is the\n // swiftkey insert causing the issue.\n if (text && insertPositionHint && type === 'insertCompositionText') {\n const hintPosition =\n insertPositionHint.start + insertPositionHint.text.search(/\\S|$/)\n const diffPosition = diff.start + diff.text.search(/\\S|$/)\n\n if (\n diffPosition === hintPosition + 1 &&\n diff.end ===\n insertPositionHint.start + insertPositionHint.text.length\n ) {\n debug('adjusting swiftKey insert position using hint')\n diff.start -= 1\n insertPositionHint = null\n scheduleFlush()\n } else {\n insertPositionHint = false\n }\n } else if (type === 'insertText') {\n if (insertPositionHint === null) {\n insertPositionHint = diff\n } else if (\n insertPositionHint &&\n Range.isCollapsed(targetRange) &&\n insertPositionHint.end + insertPositionHint.text.length ===\n start.offset\n ) {\n insertPositionHint = {\n ...insertPositionHint,\n text: insertPositionHint.text + text,\n }\n } else {\n insertPositionHint = false\n }\n } else {\n insertPositionHint = false\n }\n\n if (canStoreDiff) {\n storeDiff(start.path, diff)\n return\n }\n }\n\n return scheduleAction(() => Editor.insertText(editor, text), {\n at: targetRange,\n })\n }\n }\n }\n\n const hasPendingAction = () => {\n return !!EDITOR_TO_PENDING_ACTION.get(editor)\n }\n\n const hasPendingDiffs = () => {\n return !!EDITOR_TO_PENDING_DIFFS.get(editor)?.length\n }\n\n const hasPendingChanges = () => {\n return hasPendingAction() || hasPendingDiffs()\n }\n\n const isFlushing = () => {\n return flushing\n }\n\n const handleUserSelect = (range: Range | null) => {\n EDITOR_TO_PENDING_SELECTION.set(editor, range)\n\n if (flushTimeoutId) {\n clearTimeout(flushTimeoutId)\n flushTimeoutId = null\n }\n\n const { selection } = editor\n if (!range) {\n return\n }\n\n const pathChanged =\n !selection || !Path.equals(selection.anchor.path, range.anchor.path)\n const parentPathChanged =\n !selection ||\n !Path.equals(\n selection.anchor.path.slice(0, -1),\n range.anchor.path.slice(0, -1)\n )\n\n if ((pathChanged && insertPositionHint) || parentPathChanged) {\n insertPositionHint = false\n }\n\n if (pathChanged || hasPendingDiffs()) {\n flushTimeoutId = setTimeout(flush, FLUSH_DELAY)\n }\n }\n\n const handleInput = () => {\n if (hasPendingAction() || !hasPendingDiffs()) {\n debug('flush input')\n flush()\n }\n }\n\n const handleKeyDown = (_: React.KeyboardEvent) => {\n // COMPAT: Swiftkey closes the keyboard when typing inside a empty node\n // directly next to a non-contenteditable element (= the placeholder).\n // The only event fired soon enough for us to allow hiding the placeholder\n // without swiftkey picking it up is the keydown event, so we have to hide it\n // here. See https://github.com/ianstormtaylor/slate/pull/4988#issuecomment-1201050535\n if (!hasPendingDiffs()) {\n updatePlaceholderVisibility(true)\n setTimeout(updatePlaceholderVisibility)\n }\n }\n\n const scheduleFlush = () => {\n if (!hasPendingAction()) {\n actionTimeoutId = setTimeout(flush)\n }\n }\n\n const handleDomMutations = (mutations: MutationRecord[]) => {\n if (hasPendingDiffs() || hasPendingAction()) {\n return\n }\n\n if (\n mutations.some(mutation => isTrackedMutation(editor, mutation, mutations))\n ) {\n // Cause a re-render to restore the dom state if we encounter tracked mutations without\n // a corresponding pending action.\n EDITOR_TO_FORCE_RENDER.get(editor)?.()\n }\n }\n\n return {\n flush,\n scheduleFlush,\n\n hasPendingDiffs,\n hasPendingAction,\n hasPendingChanges,\n\n isFlushing,\n\n handleUserSelect,\n handleCompositionEnd,\n handleCompositionStart,\n handleDOMBeforeInput,\n handleKeyDown,\n\n handleDomMutations,\n handleInput,\n }\n}\n","import { useEffect, useRef } from 'react'\n\nexport function useIsMounted() {\n const isMountedRef = useRef(false)\n\n useEffect(() => {\n isMountedRef.current = true\n return () => {\n isMountedRef.current = false\n }\n }, [])\n\n return isMountedRef.current\n}\n","import { useLayoutEffect, useEffect } from 'react'\nimport { CAN_USE_DOM } from '../utils/environment'\n\n/**\n * Prevent warning on SSR by falling back to useEffect when DOM isn't available\n */\n\nexport const useIsomorphicLayoutEffect = CAN_USE_DOM\n ? useLayoutEffect\n : useEffect\n","import { RefObject, useEffect, useState } from 'react'\nimport { useIsomorphicLayoutEffect } from './use-isomorphic-layout-effect'\n\nexport function useMutationObserver(\n node: RefObject<HTMLElement>,\n callback: MutationCallback,\n options: MutationObserverInit\n) {\n const [mutationObserver] = useState(() => new MutationObserver(callback))\n\n useIsomorphicLayoutEffect(() => {\n // Discard mutations caused during render phase. This works due to react calling\n // useLayoutEffect synchronously after the render phase before the next tick.\n mutationObserver.takeRecords()\n })\n\n useEffect(() => {\n if (!node.current) {\n throw new Error('Failed to attach MutationObserver, `node` is undefined')\n }\n\n mutationObserver.observe(node.current, options)\n return () => mutationObserver.disconnect()\n }, [mutationObserver, node, options])\n}\n","import { RefObject, useState } from 'react'\nimport { useSlateStatic } from '../use-slate-static'\nimport { IS_ANDROID } from '../../utils/environment'\nimport { EDITOR_TO_SCHEDULE_FLUSH } from '../../utils/weak-maps'\nimport {\n createAndroidInputManager,\n CreateAndroidInputManagerOptions,\n} from './android-input-manager'\nimport { useIsMounted } from '../use-is-mounted'\nimport { useMutationObserver } from '../use-mutation-observer'\n\ntype UseAndroidInputManagerOptions = {\n node: RefObject<HTMLElement>\n} & Omit<\n CreateAndroidInputManagerOptions,\n 'editor' | 'onUserInput' | 'receivedUserInput'\n>\n\nconst MUTATION_OBSERVER_CONFIG: MutationObserverInit = {\n subtree: true,\n childList: true,\n characterData: true,\n}\n\nexport const useAndroidInputManager = !IS_ANDROID\n ? () => null\n : ({ node, ...options }: UseAndroidInputManagerOptions) => {\n if (!IS_ANDROID) {\n return null\n }\n\n const editor = useSlateStatic()\n const isMounted = useIsMounted()\n\n const [inputManager] = useState(() =>\n createAndroidInputManager({\n editor,\n ...options,\n })\n )\n\n useMutationObserver(\n node,\n inputManager.handleDomMutations,\n MUTATION_OBSERVER_CONFIG\n )\n\n EDITOR_TO_SCHEDULE_FLUSH.set(editor, inputManager.scheduleFlush)\n if (isMounted) {\n inputManager.flush()\n }\n\n return inputManager\n }\n","import { Range } from 'slate'\nimport { PLACEHOLDER_SYMBOL } from './weak-maps'\n\nexport const shallowCompare = (\n obj1: { [key: string]: unknown },\n obj2: { [key: string]: unknown }\n) =>\n Object.keys(obj1).length === Object.keys(obj2).length &&\n Object.keys(obj1).every(\n key => obj2.hasOwnProperty(key) && obj1[key] === obj2[key]\n )\n\nconst isDecorationFlagsEqual = (range: Range, other: Range) => {\n const { anchor: rangeAnchor, focus: rangeFocus, ...rangeOwnProps } = range\n const { anchor: otherAnchor, focus: otherFocus, ...otherOwnProps } = other\n\n return (\n range[PLACEHOLDER_SYMBOL] === other[PLACEHOLDER_SYMBOL] &&\n shallowCompare(rangeOwnProps, otherOwnProps)\n )\n}\n\n/**\n * Check if a list of decorator ranges are equal to another.\n *\n * PERF: this requires the two lists to also have the ranges inside them in the\n * same order, but this is an okay constraint for us since decorations are\n * kept in order, and the odd case where they aren't is okay to re-render for.\n */\n\nexport const isElementDecorationsEqual = (\n list: Range[],\n another: Range[]\n): boolean => {\n if (list.length !== another.length) {\n return false\n }\n\n for (let i = 0; i < list.length; i++) {\n const range = list[i]\n const other = another[i]\n\n if (!Range.equals(range, other) || !isDecorationFlagsEqual(range, other)) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Check if a list of decorator ranges are equal to another.\n *\n * PERF: this requires the two lists to also have the ranges inside them in the\n * same order, but this is an okay constraint for us since decorations are\n * kept in order, and the odd case where they aren't is okay to re-render for.\n */\n\nexport const isTextDecorationsEqual = (\n list: Range[],\n another: Range[]\n): boolean => {\n if (list.length !== another.length) {\n return false\n }\n\n for (let i = 0; i < list.length; i++) {\n const range = list[i]\n const other = another[i]\n\n // compare only offsets because paths doesn't matter for text\n if (\n range.anchor.offset !== other.anchor.offset ||\n range.focus.offset !== other.focus.offset ||\n !isDecorationFlagsEqual(range, other)\n ) {\n return false\n }\n }\n\n return true\n}\n","import React, { forwardRef, memo, useRef, useState } from 'react'\nimport { Editor, Text, Path, Element, Node } from 'slate'\n\nimport { ReactEditor, useSlateStatic } from '..'\nimport { useIsomorphicLayoutEffect } from '../hooks/use-isomorphic-layout-effect'\nimport { IS_ANDROID, IS_IOS } from '../utils/environment'\nimport { MARK_PLACEHOLDER_SYMBOL } from '../utils/weak-maps'\n\n/**\n * Leaf content strings.\n */\n\nconst String = (props: {\n isLast: boolean\n leaf: Text\n parent: Element\n text: Text\n}) => {\n const { isLast, leaf, parent, text } = props\n const editor = useSlateStatic()\n const path = ReactEditor.findPath(editor, text)\n const parentPath = Path.parent(path)\n const isMarkPlaceholder = Boolean(leaf[MARK_PLACEHOLDER_SYMBOL])\n\n // COMPAT: Render text inside void nodes with a zero-width space.\n // So the node can contain selection but the text is not visible.\n if (editor.isVoid(parent)) {\n return <ZeroWidthString length={Node.string(parent).length} />\n }\n\n // COMPAT: If this is the last text node in an empty block, render a zero-\n // width space that will convert into a line break when copying and pasting\n // to support expected plain text.\n if (\n leaf.text === '' &&\n parent.children[parent.children.length - 1] === text &&\n !editor.isInline(parent) &&\n Editor.string(editor, parentPath) === ''\n ) {\n return <ZeroWidthString isLineBreak isMarkPlaceholder={isMarkPlaceholder} />\n }\n\n // COMPAT: If the text is empty, it's because it's on the edge of an inline\n // node, so we render a zero-width space so that the selection can be\n // inserted next to it still.\n if (leaf.text === '') {\n return <ZeroWidthString isMarkPlaceholder={isMarkPlaceholder} />\n }\n\n // COMPAT: Browsers will collapse trailing new lines at the end of blocks,\n // so we need to add an extra trailing new lines to prevent that.\n if (isLast && leaf.text.slice(-1) === '\\n') {\n return <TextString isTrailing text={leaf.text} />\n }\n\n return <TextString text={leaf.text} />\n}\n\n/**\n * Leaf strings with text in them.\n */\nconst TextString = (props: { text: string; isTrailing?: boolean }) => {\n const { text, isTrailing = false } = props\n const ref = useRef<HTMLSpanElement>(null)\n const getTextContent = () => {\n return `${text ?? ''}${isTrailing ? '\\n' : ''}`\n }\n const [initialText] = useState(getTextContent)\n\n // This is the actual text rendering boundary where we interface with the DOM\n // The text is not rendered as part of the virtual DOM, as since we handle basic character insertions natively,\n // updating the DOM is not a one way dataflow anymore. What we need here is not reconciliation and diffing\n // with previous version of the virtual DOM, but rather diffing with the actual DOM element, and replace the DOM <span> content\n // exactly if and only if its current content does not match our current virtual DOM.\n // Otherwise the DOM TextNode would always be replaced by React as the user types, which interferes with native text features,\n // eg makes native spellcheck opt out from checking the text node.\n\n // useLayoutEffect: updating our span before browser paint\n useIsomorphicLayoutEffect(() => {\n // null coalescing text to make sure we're not outputing \"null\" as a string in the extreme case it is nullish at runtime\n const textWithTrailing = getTextContent()\n\n if (ref.current && ref.current.textContent !== textWithTrailing) {\n ref.current.textContent = textWithTrailing\n }\n\n // intentionally not specifying dependencies, so that this effect runs on every render\n // as this effectively replaces \"specifying the text in the virtual DOM under the <span> below\" on each render\n })\n\n // We intentionally render a memoized <span> that only receives the initial text content when the component is mounted.\n // We defer to the layout effect above to update the `textContent` of the span element when needed.\n return <MemoizedText ref={ref}>{initialText}</MemoizedText>\n}\n\nconst MemoizedText = memo(\n forwardRef<HTMLSpanElement, { children: string }>((props, ref) => {\n return (\n <span data-slate-string ref={ref}>\n {props.children}\n </span>\n )\n })\n)\n\n/**\n * Leaf strings without text, render as zero-width strings.\n */\n\nexport const ZeroWidthString = (props: {\n length?: number\n isLineBreak?: boolean\n isMarkPlaceholder?: boolean\n}) => {\n const { length = 0, isLineBreak = false, isMarkPlaceholder = false } = props\n\n const attributes: {\n 'data-slate-zero-width': string\n 'data-slate-length': number\n 'data-slate-mark-placeholder'?: boolean\n } = {\n 'data-slate-zero-width': isLineBreak ? 'n' : 'z',\n 'data-slate-length': length,\n }\n\n if (isMarkPlaceholder) {\n attributes['data-slate-mark-placeholder'] = true\n }\n\n return (\n <span {...attributes}>\n {!(IS_ANDROID || IS_IOS) || !isLineBreak ? '\\uFEFF' : null}\n {isLineBreak ? <br /> : null}\n </span>\n )\n}\n\nexport default String\n","import React, {\n useRef,\n useCallback,\n MutableRefObject,\n useState,\n useEffect,\n} from 'react'\nimport { JSX } from 'react'\nimport { Element, Text } from 'slate'\nimport { ResizeObserver as ResizeObserverPolyfill } from '@juggle/resize-observer'\nimport String from './string'\nimport {\n PLACEHOLDER_SYMBOL,\n EDITOR_TO_PLACEHOLDER_ELEMENT,\n EDITOR_TO_FORCE_RENDER,\n} from '../utils/weak-maps'\nimport { RenderLeafProps, RenderPlaceholderProps } from './editable'\nimport { useSlateStatic } from '../hooks/use-slate-static'\nimport { IS_WEBKIT, IS_ANDROID } from '../utils/environment'\n\n// Delay the placeholder on Android to prevent the keyboard from closing.\n// (https://github.com/ianstormtaylor/slate/pull/5368)\nconst PLACEHOLDER_DELAY = IS_ANDROID ? 300 : 0\n\nfunction disconnectPlaceholderResizeObserver(\n placeholderResizeObserver: MutableRefObject<ResizeObserver | null>,\n releaseObserver: boolean\n) {\n if (placeholderResizeObserver.current) {\n placeholderResizeObserver.current.disconnect()\n if (releaseObserver) {\n placeholderResizeObserver.current = null\n }\n }\n}\n\ntype TimerId = ReturnType<typeof setTimeout> | null\n\nfunction clearTimeoutRef(timeoutRef: MutableRefObject<TimerId>) {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current)\n timeoutRef.current = null\n }\n}\n\n/**\n * Individual leaves in a text node with unique formatting.\n */\nconst Leaf = (props: {\n isLast: boolean\n leaf: Text\n parent: Element\n renderPlaceholder: (props: RenderPlaceholderProps) => JSX.Element\n renderLeaf?: (props: RenderLeafProps) => JSX.Element\n text: Text\n}) => {\n const {\n leaf,\n isLast,\n text,\n parent,\n renderPlaceholder,\n renderLeaf = (props: RenderLeafProps) => <DefaultLeaf {...props} />,\n } = props\n\n const editor = useSlateStatic()\n const placeholderResizeObserver = useRef<ResizeObserver | null>(null)\n const placeholderRef = useRef<HTMLElement | null>(null)\n const [showPlaceholder, setShowPlaceholder] = useState(false)\n const showPlaceholderTimeoutRef = useRef<TimerId>(null)\n\n const callbackPlaceholderRef = useCallback(\n (placeholderEl: HTMLElement | null) => {\n disconnectPlaceholderResizeObserver(\n placeholderResizeObserver,\n placeholderEl == null\n )\n\n if (placeholderEl == null) {\n EDITOR_TO_PLACEHOLDER_ELEMENT.delete(editor)\n leaf.onPlaceholderResize?.(null)\n } else {\n EDITOR_TO_PLACEHOLDER_ELEMENT.set(editor, placeholderEl)\n\n if (!placeholderResizeObserver.current) {\n // Create a new observer and observe the placeholder element.\n const ResizeObserver = window.ResizeObserver || ResizeObserverPolyfill\n placeholderResizeObserver.current = new ResizeObserver(() => {\n leaf.onPlaceholderResize?.(placeholderEl)\n })\n }\n placeholderResizeObserver.current.observe(placeholderEl)\n placeholderRef.current = placeholderEl\n }\n },\n [placeholderRef, leaf, editor]\n )\n\n let children = (\n <String isLast={isLast} leaf={leaf} parent={parent} text={text} />\n )\n\n const leafIsPlaceholder = Boolean(leaf[PLACEHOLDER_SYMBOL])\n useEffect(() => {\n if (leafIsPlaceholder) {\n if (!showPlaceholderTimeoutRef.current) {\n // Delay the placeholder, so it will not render in a selection\n showPlaceholderTimeoutRef.current = setTimeout(() => {\n setShowPlaceholder(true)\n showPlaceholderTimeoutRef.current = null\n }, PLACEHOLDER_DELAY)\n }\n } else {\n clearTimeoutRef(showPlaceholderTimeoutRef)\n setShowPlaceholder(false)\n }\n return () => clearTimeoutRef(showPlaceholderTimeoutRef)\n }, [leafIsPlaceholder, setShowPlaceholder])\n\n if (leafIsPlaceholder && showPlaceholder) {\n const placeholderProps: RenderPlaceholderProps = {\n children: leaf.placeholder,\n attributes: {\n 'data-slate-placeholder': true,\n style: {\n position: 'absolute',\n top: 0,\n pointerEvents: 'none',\n width: '100%',\n maxWidth: '100%',\n display: 'block',\n opacity: '0.333',\n userSelect: 'none',\n textDecoration: 'none',\n // Fixes https://github.com/udecode/plate/issues/2315\n WebkitUserModify: IS_WEBKIT ? 'inherit' : undefined,\n },\n contentEditable: false,\n ref: callbackPlaceholderRef,\n },\n }\n\n children = (\n <React.Fragment>\n {renderPlaceholder(placeholderProps)}\n {children}\n </React.Fragment>\n )\n }\n\n // COMPAT: Having the `data-` attributes on these leaf elements ensures that\n // in certain misbehaving browsers they aren't weirdly cloned/destroyed by\n // contenteditable behaviors. (2019/05/08)\n const attributes: {\n 'data-slate-leaf': true\n } = {\n 'data-slate-leaf': true,\n }\n\n return renderLeaf({ attributes, children, leaf, text })\n}\n\nconst MemoizedLeaf = React.memo(Leaf, (prev, next) => {\n return (\n next.parent === prev.parent &&\n next.isLast === prev.isLast &&\n next.renderLeaf === prev.renderLeaf &&\n next.renderPlaceholder === prev.renderPlaceholder &&\n next.text === prev.text &&\n Text.equals(next.leaf, prev.leaf) &&\n next.leaf[PLACEHOLDER_SYMBOL] === prev.leaf[PLACEHOLDER_SYMBOL]\n )\n})\n\nexport const DefaultLeaf = (props: RenderLeafProps) => {\n const { attributes, children } = props\n return <span {...attributes}>{children}</span>\n}\n\nexport default MemoizedLeaf\n","import React, { useCallback, useRef } from 'react'\nimport { Element, Range, Text as SlateText } from 'slate'\nimport { ReactEditor, useSlateStatic } from '..'\nimport { isTextDecorationsEqual } from '../utils/range-list'\nimport {\n EDITOR_TO_KEY_TO_ELEMENT,\n ELEMENT_TO_NODE,\n NODE_TO_ELEMENT,\n} from '../utils/weak-maps'\nimport { RenderLeafProps, RenderPlaceholderProps } from './editable'\nimport Leaf from './leaf'\n\n/**\n * Text.\n */\n\nconst Text = (props: {\n decorations: Range[]\n isLast: boolean\n parent: Element\n renderPlaceholder: (props: RenderPlaceholderProps) => JSX.Element\n renderLeaf?: (props: RenderLeafProps) => JSX.Element\n text: SlateText\n}) => {\n const { decorations, isLast, parent, renderPlaceholder, renderLeaf, text } =\n props\n const editor = useSlateStatic()\n const ref = useRef<HTMLSpanElement | null>(null)\n const leaves = SlateText.decorations(text, decorations)\n const key = ReactEditor.findKey(editor, text)\n const children = []\n\n for (let i = 0; i < leaves.length; i++) {\n const leaf = leaves[i]\n\n children.push(\n <Leaf\n isLast={isLast && i === leaves.length - 1}\n key={`${key.id}-${i}`}\n renderPlaceholder={renderPlaceholder}\n leaf={leaf}\n text={text}\n parent={parent}\n renderLeaf={renderLeaf}\n />\n )\n }\n\n // Update element-related weak maps with the DOM element ref.\n const callbackRef = useCallback(\n (span: HTMLSpanElement | null) => {\n const KEY_TO_ELEMENT = EDITOR_TO_KEY_TO_ELEMENT.get(editor)\n if (span) {\n KEY_TO_ELEMENT?.set(key, span)\n NODE_TO_ELEMENT.set(text, span)\n ELEMENT_TO_NODE.set(span, text)\n } else {\n KEY_TO_ELEMENT?.delete(key)\n NODE_TO_ELEMENT.delete(text)\n if (ref.current) {\n ELEMENT_TO_NODE.delete(ref.current)\n }\n }\n ref.current = span\n },\n [ref, editor, key, text]\n )\n return (\n <span data-slate-node=\"text\" ref={callbackRef}>\n {children}\n </span>\n )\n}\n\nconst MemoizedText = React.memo(Text, (prev, next) => {\n return (\n next.parent === prev.parent &&\n next.isLast === prev.isLast &&\n next.renderLeaf === prev.renderLeaf &&\n next.renderPlaceholder === prev.renderPlaceholder &&\n next.text === prev.text &&\n isTextDecorationsEqual(next.decorations, prev.decorations)\n )\n})\n\nexport default MemoizedText\n","import getDirection from 'direction'\nimport React, { useCallback } from 'react'\nimport { JSX } from 'react'\nimport { Editor, Element as SlateElement, Node, Range } from 'slate'\nimport { ReactEditor, useReadOnly, useSlateStatic } from '..'\nimport useChildren from '../hooks/use-children'\nimport { isElementDecorationsEqual } from '../utils/range-list'\nimport {\n EDITOR_TO_KEY_TO_ELEMENT,\n ELEMENT_TO_NODE,\n NODE_TO_ELEMENT,\n NODE_TO_INDEX,\n NODE_TO_PARENT,\n} from '../utils/weak-maps'\nimport {\n RenderElementProps,\n RenderLeafProps,\n RenderPlaceholderProps,\n} from './editable'\n\nimport Text from './text'\n\n/**\n * Element.\n */\n\nconst Element = (props: {\n decorations: Range[]\n element: SlateElement\n renderElement?: (props: RenderElementProps) => JSX.Element\n renderPlaceholder: (props: RenderPlaceholderProps) => JSX.Element\n renderLeaf?: (props: RenderLeafProps) => JSX.Element\n selection: Range | null\n}) => {\n const {\n decorations,\n element,\n renderElement = (p: RenderElementProps) => <DefaultElement {...p} />,\n renderPlaceholder,\n renderLeaf,\n selection,\n } = props\n const editor = useSlateStatic()\n const readOnly = useReadOnly()\n const isInline = editor.isInline(element)\n const key = ReactEditor.findKey(editor, element)\n const ref = useCallback(\n (ref: HTMLElement | null) => {\n // Update element-related weak maps with the DOM element ref.\n const KEY_TO_ELEMENT = EDITOR_TO_KEY_TO_ELEMENT.get(editor)\n if (ref) {\n KEY_TO_ELEMENT?.set(key, ref)\n NODE_TO_ELEMENT.set(element, ref)\n ELEMENT_TO_NODE.set(ref, element)\n } else {\n KEY_TO_ELEMENT?.delete(key)\n NODE_TO_ELEMENT.delete(element)\n }\n },\n [editor, key, element]\n )\n let children: React.ReactNode = useChildren({\n decorations,\n node: element,\n renderElement,\n renderPlaceholder,\n renderLeaf,\n selection,\n })\n\n // Attributes that the developer must mix into the element in their\n // custom node renderer component.\n const attributes: {\n 'data-slate-node': 'element'\n 'data-slate-void'?: true\n 'data-slate-inline'?: true\n contentEditable?: false\n dir?: 'rtl'\n ref: any\n } = {\n 'data-slate-node': 'element',\n ref,\n }\n\n if (isInline) {\n attributes['data-slate-inline'] = true\n }\n\n // If it's a block node with inline children, add the proper `dir` attribute\n // for text direction.\n if (!isInline && Editor.hasInlines(editor, element)) {\n const text = Node.string(element)\n const dir = getDirection(text)\n\n if (dir === 'rtl') {\n attributes.dir = dir\n }\n }\n\n // If it's a void node, wrap the children in extra void-specific elements.\n if (Editor.isVoid(editor, element)) {\n attributes['data-slate-void'] = true\n\n if (!readOnly && isInline) {\n attributes.contentEditable = false\n }\n\n const Tag = isInline ? 'span' : 'div'\n const [[text]] = Node.texts(element)\n\n children = (\n <Tag\n data-slate-spacer\n style={{\n height: '0',\n color: 'transparent',\n outline: 'none',\n position: 'absolute',\n }}\n >\n <Text\n renderPlaceholder={renderPlaceholder}\n decorations={[]}\n isLast={false}\n parent={element}\n text={text}\n />\n </Tag>\n )\n\n NODE_TO_INDEX.set(text, 0)\n NODE_TO_PARENT.set(text, element)\n }\n\n return renderElement({ attributes, children, element })\n}\n\nconst MemoizedElement = React.memo(Element, (prev, next) => {\n return (\n prev.element === next.element &&\n prev.renderElement === next.renderElement &&\n prev.renderLeaf === next.renderLeaf &&\n prev.renderPlaceholder === next.renderPlaceholder &&\n isElementDecorationsEqual(prev.decorations, next.decorations) &&\n (prev.selection === next.selection ||\n (!!prev.selection &&\n !!next.selection &&\n Range.equals(prev.selection, next.selection)))\n )\n})\n\n/**\n * The default element renderer.\n */\n\nexport const DefaultElement = (props: RenderElementProps) => {\n const { attributes, children, element } = props\n const editor = useSlateStatic()\n const Tag = editor.isInline(element) ? 'span' : 'div'\n return (\n <Tag {...attributes} style={{ position: 'relative' }}>\n {children}\n </Tag>\n )\n}\n\nexport default MemoizedElement\n","import { createContext, useContext } from 'react'\nimport { Range, NodeEntry } from 'slate'\n\n/**\n * A React context for sharing the `decorate` prop of the editable.\n */\n\nexport const DecorateContext = createContext<(entry: NodeEntry) => Range[]>(\n () => []\n)\n\n/**\n * Get the current `decorate` prop of the editable.\n */\n\nexport const useDecorate = (): ((entry: NodeEntry) => Range[]) => {\n return useContext(DecorateContext)\n}\n","import { createContext, useContext } from 'react'\n\n/**\n * A React context for sharing the `selected` state of an element.\n */\n\nexport const SelectedContext = createContext(false)\n\n/**\n * Get the current `selected` state of an element.\n */\n\nexport const useSelected = (): boolean => {\n return useContext(SelectedContext)\n}\n","import React from 'react'\nimport { Ancestor, Descendant, Editor, Element, Range } from 'slate'\nimport {\n RenderElementProps,\n RenderLeafProps,\n RenderPlaceholderProps,\n} from '../components/editable'\n\nimport ElementComponent from '../components/element'\nimport TextComponent from '../components/text'\nimport { ReactEditor } from '../plugin/react-editor'\nimport { NODE_TO_INDEX, NODE_TO_PARENT } from '../utils/weak-maps'\nimport { useDecorate } from './use-decorate'\nimport { SelectedContext } from './use-selected'\nimport { useSlateStatic } from './use-slate-static'\n\n/**\n * Children.\n */\n\nconst useChildren = (props: {\n decorations: Range[]\n node: Ancestor\n renderElement?: (props: RenderElementProps) => JSX.Element\n renderPlaceholder: (props: RenderPlaceholderProps) => JSX.Element\n renderLeaf?: (props: RenderLeafProps) => JSX.Element\n selection: Range | null\n}) => {\n const {\n decorations,\n node,\n renderElement,\n renderPlaceholder,\n renderLeaf,\n selection,\n } = props\n const decorate = useDecorate()\n const editor = useSlateStatic()\n const path = ReactEditor.findPath(editor, node)\n const children = []\n const isLeafBlock =\n Element.isElement(node) &&\n !editor.isInline(node) &&\n Editor.hasInlines(editor, node)\n\n for (let i = 0; i < node.children.length; i++) {\n const p = path.concat(i)\n const n = node.children[i] as Descendant\n const key = ReactEditor.findKey(editor, n)\n const range = Editor.range(editor, p)\n const sel = selection && Range.intersection(range, selection)\n const ds = decorate([n, p])\n\n for (const dec of decorations) {\n const d = Range.intersection(dec, range)\n\n if (d) {\n ds.push(d)\n }\n }\n\n if (Element.isElement(n)) {\n children.push(\n <SelectedContext.Provider key={`provider-${key.id}`} value={!!sel}>\n <ElementComponent\n decorations={ds}\n element={n}\n key={key.id}\n renderElement={renderElement}\n renderPlaceholder={renderPlaceholder}\n renderLeaf={renderLeaf}\n selection={sel}\n />\n </SelectedContext.Provider>\n )\n } else {\n children.push(\n <TextComponent\n decorations={ds}\n key={key.id}\n isLast={isLeafBlock && i === node.children.length - 1}\n parent={node}\n renderPlaceholder={renderPlaceholder}\n renderLeaf={renderLeaf}\n text={n}\n />\n )\n }\n\n NODE_TO_INDEX.set(n, i)\n NODE_TO_PARENT.set(n, node)\n }\n\n return children\n}\n\nexport default useChildren\n","import { createContext, useContext } from 'react'\n\n/**\n * A React context for sharing the `readOnly` state of the editor.\n */\n\nexport const ReadOnlyContext = createContext(false)\n\n/**\n * Get the current `readOnly` state of the editor.\n */\n\nexport const useReadOnly = (): boolean => {\n return useContext(ReadOnlyContext)\n}\n","import { createContext, useContext } from 'react'\nimport { Editor } from 'slate'\nimport { ReactEditor } from '../plugin/react-editor'\n\n/**\n * A React context for sharing the editor object, in a way that re-renders the\n * context whenever changes occur.\n */\n\nexport interface SlateContextValue {\n v: number\n editor: ReactEditor\n}\n\nexport const SlateContext = createContext<{\n v: number\n editor: ReactEditor\n} | null>(null)\n\n/**\n * Get the current editor object from the React context.\n */\n\nexport const useSlate = (): Editor => {\n const context = useContext(SlateContext)\n\n if (!context) {\n throw new Error(\n `The \\`useSlate\\` hook must be used inside the <Slate> component's context.`\n )\n }\n\n const { editor } = context\n return editor\n}\n\nexport const useSlateWithV = () => {\n const context = useContext(SlateContext)\n\n if (!context) {\n throw new Error(\n `The \\`useSlate\\` hook must be used inside the <Slate> component's context.`\n )\n }\n\n return context\n}\n","import { useCallback, useEffect, useRef } from 'react'\nimport { ReactEditor } from '../plugin/react-editor'\nimport { useSlateStatic } from './use-slate-static'\n\nexport function useTrackUserInput() {\n const editor = useSlateStatic()\n\n const receivedUserInput = useRef<boolean>(false)\n const animationFrameIdRef = useRef<number>(0)\n\n const onUserInput = useCallback(() => {\n if (receivedUserInput.current) {\n return\n }\n\n receivedUserInput.current = true\n\n const window = ReactEditor.getWindow(editor)\n window.cancelAnimationFrame(animationFrameIdRef.current)\n\n animationFrameIdRef.current = window.requestAnimationFrame(() => {\n receivedUserInput.current = false\n })\n }, [editor])\n\n useEffect(() => () => cancelAnimationFrame(animationFrameIdRef.current), [])\n\n return {\n receivedUserInput,\n onUserInput,\n }\n}\n","export const TRIPLE_CLICK = 3\n","import { isHotkey } from 'is-hotkey'\nimport { IS_APPLE } from './environment'\n\n/**\n * Hotkey mappings for each platform.\n */\n\nconst HOTKEYS = {\n bold: 'mod+b',\n compose: ['down', 'left', 'right', 'up', 'backspace', 'enter'],\n moveBackward: 'left',\n moveForward: 'right',\n moveWordBackward: 'ctrl+left',\n moveWordForward: 'ctrl+right',\n deleteBackward: 'shift?+backspace',\n deleteForward: 'shift?+delete',\n extendBackward: 'shift+left',\n extendForward: 'shift+right',\n italic: 'mod+i',\n insertSoftBreak: 'shift+enter',\n splitBlock: 'enter',\n undo: 'mod+z',\n}\n\nconst APPLE_HOTKEYS = {\n moveLineBackward: 'opt+up',\n moveLineForward: 'opt+down',\n moveWordBackward: 'opt+left',\n moveWordForward: 'opt+right',\n deleteBackward: ['ctrl+backspace', 'ctrl+h'],\n deleteForward: ['ctrl+delete', 'ctrl+d'],\n deleteLineBackward: 'cmd+shift?+backspace',\n deleteLineForward: ['cmd+shift?+delete', 'ctrl+k'],\n deleteWordBackward: 'opt+shift?+backspace',\n deleteWordForward: 'opt+shift?+delete',\n extendLineBackward: 'opt+shift+up',\n extendLineForward: 'opt+shift+down',\n redo: 'cmd+shift+z',\n transposeCharacter: 'ctrl+t',\n}\n\nconst WINDOWS_HOTKEYS = {\n deleteWordBackward: 'ctrl+shift?+backspace',\n deleteWordForward: 'ctrl+shift?+delete',\n redo: ['ctrl+y', 'ctrl+shift+z'],\n}\n\n/**\n * Create a platform-aware hotkey checker.\n */\n\nconst create = (key: string) => {\n const generic = HOTKEYS[<keyof typeof HOTKEYS>key]\n const apple = APPLE_HOTKEYS[<keyof typeof APPLE_HOTKEYS>key]\n const windows = WINDOWS_HOTKEYS[<keyof typeof WINDOWS_HOTKEYS>key]\n const isGeneric = generic && isHotkey(generic)\n const isApple = apple && isHotkey(apple)\n const isWindows = windows && isHotkey(windows)\n\n return (event: KeyboardEvent) => {\n if (isGeneric && isGeneric(event)) return true\n if (IS_APPLE && isApple && isApple(event)) return true\n if (!IS_APPLE && isWindows && isWindows(event)) return true\n return false\n }\n}\n\n/**\n * Hotkeys.\n */\n\nexport default {\n isBold: create('bold'),\n isCompose: create('compose'),\n isMoveBackward: create('moveBackward'),\n isMoveForward: create('moveForward'),\n isDeleteBackward: create('deleteBackward'),\n isDeleteForward: create('deleteForward'),\n isDeleteLineBackward: create('deleteLineBackward'),\n isDeleteLineForward: create('deleteLineForward'),\n isDeleteWordBackward: create('deleteWordBackward'),\n isDeleteWordForward: create('deleteWordForward'),\n isExtendBackward: create('extendBackward'),\n isExtendForward: create('extendForward'),\n isExtendLineBackward: create('extendLineBackward'),\n isExtendLineForward: create('extendLineForward'),\n isItalic: create('italic'),\n isMoveLineBackward: create('moveLineBackward'),\n isMoveLineForward: create('moveLineForward'),\n isMoveWordBackward: create('moveWordBackward'),\n isMoveWordForward: create('moveWordForward'),\n isRedo: create('redo'),\n isSoftBreak: create('insertSoftBreak'),\n isSplitBlock: create('splitBlock'),\n isTransposeCharacter: create('transposeCharacter'),\n isUndo: create('undo'),\n}\n","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}\nmodule.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _setPrototypeOf(o, p);\n}\nmodule.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var setPrototypeOf = require(\"./setPrototypeOf.js\");\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\nmodule.exports = _inherits, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar assertThisInitialized = require(\"./assertThisInitialized.js\");\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n return assertThisInitialized(self);\n}\nmodule.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _getPrototypeOf(o);\n}\nmodule.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","import { RefObject } from 'react'\nimport { ReactEditor } from '../../plugin/react-editor'\nimport { isTrackedMutation } from '../../utils/dom'\n\nexport type RestoreDOMManager = {\n registerMutations: (mutations: MutationRecord[]) => void\n restoreDOM: () => void\n clear: () => void\n}\n\nexport const createRestoreDomManager = (\n editor: ReactEditor,\n receivedUserInput: RefObject<boolean>\n): RestoreDOMManager => {\n let bufferedMutations: MutationRecord[] = []\n\n const clear = () => {\n bufferedMutations = []\n }\n\n const registerMutations = (mutations: MutationRecord[]) => {\n if (!receivedUserInput.current) {\n return\n }\n\n const trackedMutations = mutations.filter(mutation =>\n isTrackedMutation(editor, mutation, mutations)\n )\n\n bufferedMutations.push(...trackedMutations)\n }\n\n function restoreDOM() {\n if (bufferedMutations.length > 0) {\n bufferedMutations.reverse().forEach(mutation => {\n if (mutation.type === 'characterData') {\n // We don't want to restore the DOM for characterData mutations\n // because this interrupts the composition.\n return\n }\n\n mutation.removedNodes.forEach(node => {\n mutation.target.insertBefore(node, mutation.nextSibling)\n })\n\n mutation.addedNodes.forEach(node => {\n mutation.target.removeChild(node)\n })\n })\n\n // Clear buffered mutations to ensure we don't undo them twice\n clear()\n }\n }\n\n return {\n registerMutations,\n restoreDOM,\n clear,\n }\n}\n","import React, {\n Component,\n ComponentType,\n ContextType,\n ReactNode,\n RefObject,\n} from 'react'\nimport { EditorContext } from '../../hooks/use-slate-static'\nimport { IS_ANDROID } from '../../utils/environment'\nimport {\n createRestoreDomManager,\n RestoreDOMManager,\n} from './restore-dom-manager'\n\nconst MUTATION_OBSERVER_CONFIG: MutationObserverInit = {\n subtree: true,\n childList: true,\n characterData: true,\n characterDataOldValue: true,\n}\n\ntype RestoreDOMProps = {\n children?: ReactNode\n receivedUserInput: RefObject<boolean>\n node: RefObject<HTMLDivElement>\n}\n\n// We have to use a class component here since we rely on `getSnapshotBeforeUpdate` which has no FC equivalent\n// to run code synchronously immediately before react commits the component update to the DOM.\nclass RestoreDOMComponent extends Component<RestoreDOMProps> {\n static contextType = EditorContext\n context: ContextType<typeof EditorContext> = null\n\n private manager: RestoreDOMManager | null = null\n private mutationObserver: MutationObserver | null = null\n\n observe() {\n const { node } = this.props\n if (!node.current) {\n throw new Error('Failed to attach MutationObserver, `node` is undefined')\n }\n\n this.mutationObserver?.observe(node.current, MUTATION_OBSERVER_CONFIG)\n }\n\n componentDidMount() {\n const { receivedUserInput } = this.props\n const editor = this.context!\n\n this.manager = createRestoreDomManager(editor, receivedUserInput)\n this.mutationObserver = new MutationObserver(this.manager.registerMutations)\n\n this.observe()\n }\n\n getSnapshotBeforeUpdate() {\n const pendingMutations = this.mutationObserver?.takeRecords()\n if (pendingMutations?.length) {\n this.manager?.registerMutations(pendingMutations)\n }\n\n this.mutationObserver?.disconnect()\n this.manager?.restoreDOM()\n\n return null\n }\n\n componentDidUpdate() {\n this.manager?.clear()\n this.observe()\n }\n\n componentWillUnmount() {\n this.mutationObserver?.disconnect()\n }\n\n render() {\n return this.props.children\n }\n}\n\nexport const RestoreDOM: ComponentType<RestoreDOMProps> = IS_ANDROID\n ? RestoreDOMComponent\n : ({ children }) => <>{children}</>\n","import { createContext, useContext } from 'react'\n\n/**\n * A React context for sharing the `composing` state of the editor.\n */\n\nexport const ComposingContext = createContext(false)\n\n/**\n * Get the current `composing` state of the editor.\n */\n\nexport const useComposing = (): boolean => {\n return useContext(ComposingContext)\n}\n","import getDirection from 'direction'\nimport debounce from 'lodash/debounce'\nimport throttle from 'lodash/throttle'\nimport React, {\n useCallback,\n useEffect,\n useMemo,\n useReducer,\n useRef,\n useState,\n forwardRef,\n ForwardedRef,\n} from 'react'\nimport { JSX } from 'react'\nimport scrollIntoView from 'scroll-into-view-if-needed'\nimport {\n Editor,\n Element,\n Node,\n NodeEntry,\n Path,\n Range,\n Text,\n Transforms,\n} from 'slate'\nimport { useAndroidInputManager } from '../hooks/android-input-manager/use-android-input-manager'\nimport useChildren from '../hooks/use-children'\nimport { DecorateContext } from '../hooks/use-decorate'\nimport { useIsomorphicLayoutEffect } from '../hooks/use-isomorphic-layout-effect'\nimport { ReadOnlyContext } from '../hooks/use-read-only'\nimport { useSlate } from '../hooks/use-slate'\nimport { useTrackUserInput } from '../hooks/use-track-user-input'\nimport { ReactEditor } from '../plugin/react-editor'\nimport { TRIPLE_CLICK } from '../utils/constants'\nimport {\n DOMElement,\n DOMRange,\n DOMText,\n getActiveElement,\n getDefaultView,\n getSelection,\n isDOMElement,\n isDOMNode,\n isPlainTextOnlyPaste,\n} from '../utils/dom'\nimport {\n CAN_USE_DOM,\n HAS_BEFORE_INPUT_SUPPORT,\n IS_ANDROID,\n IS_CHROME,\n IS_FIREFOX,\n IS_FIREFOX_LEGACY,\n IS_IOS,\n IS_WEBKIT,\n IS_UC_MOBILE,\n IS_WECHATBROWSER,\n} from '../utils/environment'\nimport Hotkeys from '../utils/hotkeys'\nimport {\n EDITOR_TO_ELEMENT,\n EDITOR_TO_FORCE_RENDER,\n EDITOR_TO_PENDING_INSERTION_MARKS,\n EDITOR_TO_USER_MARKS,\n EDITOR_TO_USER_SELECTION,\n EDITOR_TO_WINDOW,\n ELEMENT_TO_NODE,\n IS_COMPOSING,\n IS_FOCUSED,\n IS_READ_ONLY,\n MARK_PLACEHOLDER_SYMBOL,\n NODE_TO_ELEMENT,\n PLACEHOLDER_SYMBOL,\n} from '../utils/weak-maps'\nimport { RestoreDOM } from './restore-dom/restore-dom'\nimport { AndroidInputManager } from '../hooks/android-input-manager/android-input-manager'\nimport { ComposingContext } from '../hooks/use-composing'\n\ntype DeferredOperation = () => void\n\nconst Children = (props: Parameters<typeof useChildren>[0]) => (\n <React.Fragment>{useChildren(props)}</React.Fragment>\n)\n\n/**\n * `RenderElementProps` are passed to the `renderElement` handler.\n */\n\nexport interface RenderElementProps {\n children: any\n element: Element\n attributes: {\n 'data-slate-node': 'element'\n 'data-slate-inline'?: true\n 'data-slate-void'?: true\n dir?: 'rtl'\n ref: any\n }\n}\n\n/**\n * `RenderLeafProps` are passed to the `renderLeaf` handler.\n */\n\nexport interface RenderLeafProps {\n children: any\n leaf: Text\n text: Text\n attributes: {\n 'data-slate-leaf': true\n }\n}\n\n/**\n * `EditableProps` are passed to the `<Editable>` component.\n */\n\nexport type EditableProps = {\n decorate?: (entry: NodeEntry) => Range[]\n onDOMBeforeInput?: (event: InputEvent) => void\n placeholder?: string\n readOnly?: boolean\n role?: string\n style?: React.CSSProperties\n renderElement?: (props: RenderElementProps) => JSX.Element\n renderLeaf?: (props: RenderLeafProps) => JSX.Element\n renderPlaceholder?: (props: RenderPlaceholderProps) => JSX.Element\n scrollSelectionIntoView?: (editor: ReactEditor, domRange: DOMRange) => void\n as?: React.ElementType\n disableDefaultStyles?: boolean\n} & React.TextareaHTMLAttributes<HTMLDivElement>\n\n/**\n * Editable.\n */\n\nexport const Editable = forwardRef(\n (props: EditableProps, forwardedRef: ForwardedRef<HTMLDivElement>) => {\n const defaultRenderPlaceholder = useCallback(\n (props: RenderPlaceholderProps) => <DefaultPlaceholder {...props} />,\n []\n )\n const {\n autoFocus,\n decorate = defaultDecorate,\n onDOMBeforeInput: propsOnDOMBeforeInput,\n placeholder,\n readOnly = false,\n renderElement,\n renderLeaf,\n renderPlaceholder = defaultRenderPlaceholder,\n scrollSelectionIntoView = defaultScrollSelectionIntoView,\n style: userStyle = {},\n as: Component = 'div',\n disableDefaultStyles = false,\n ...attributes\n } = props\n const editor = useSlate()\n // Rerender editor when composition status changed\n const [isComposing, setIsComposing] = useState(false)\n const ref = useRef<HTMLDivElement | null>(null)\n const deferredOperations = useRef<DeferredOperation[]>([])\n const [placeholderHeight, setPlaceholderHeight] = useState<\n number | undefined\n >()\n const processing = useRef(false)\n\n const { onUserInput, receivedUserInput } = useTrackUserInput()\n\n const [, forceRender] = useReducer(s => s + 1, 0)\n EDITOR_TO_FORCE_RENDER.set(editor, forceRender)\n\n // Update internal state on each render.\n IS_READ_ONLY.set(editor, readOnly)\n\n // Keep track of some state for the event handler logic.\n const state = useMemo(\n () => ({\n isDraggingInternally: false,\n isUpdatingSelection: false,\n latestElement: null as DOMElement | null,\n hasMarkPlaceholder: false,\n }),\n []\n )\n\n // The autoFocus TextareaHTMLAttribute doesn't do anything on a div, so it\n // needs to be manually focused.\n useEffect(() => {\n if (ref.current && autoFocus) {\n ref.current.focus()\n }\n }, [autoFocus])\n\n /**\n * The AndroidInputManager object has a cyclical dependency on onDOMSelectionChange\n *\n * It is defined as a reference to simplify hook dependencies and clarify that\n * it needs to be initialized.\n */\n const androidInputManagerRef = useRef<\n AndroidInputManager | null | undefined\n >()\n\n // Listen on the native `selectionchange` event to be able to update any time\n // the selection changes. This is required because React's `onSelect` is leaky\n // and non-standard so it doesn't fire until after a selection has been\n // released. This causes issues in situations where another change happens\n // while a selection is being dragged.\n const onDOMSelectionChange = useMemo(\n () =>\n throttle(() => {\n const el = ReactEditor.toDOMNode(editor, editor)\n const root = el.getRootNode()\n\n if (!processing.current && IS_WEBKIT && root instanceof ShadowRoot) {\n processing.current = true\n\n const active = getActiveElement()\n\n if (active) {\n document.execCommand('indent')\n } else {\n Transforms.deselect(editor)\n }\n\n processing.current = false\n return\n }\n\n const androidInputManager = androidInputManagerRef.current\n if (\n (IS_ANDROID || !ReactEditor.isComposing(editor)) &&\n (!state.isUpdatingSelection || androidInputManager?.isFlushing()) &&\n !state.isDraggingInternally\n ) {\n const root = ReactEditor.findDocumentOrShadowRoot(editor)\n const { activeElement } = root\n const el = ReactEditor.toDOMNode(editor, editor)\n const domSelection = getSelection(root)\n\n if (activeElement === el) {\n state.latestElement = activeElement\n IS_FOCUSED.set(editor, true)\n } else {\n IS_FOCUSED.delete(editor)\n }\n\n if (!domSelection) {\n return Transforms.deselect(editor)\n }\n\n const { anchorNode, focusNode } = domSelection\n\n const anchorNodeSelectable =\n ReactEditor.hasEditableTarget(editor, anchorNode) ||\n ReactEditor.isTargetInsideNonReadonlyVoid(editor, anchorNode)\n\n const focusNodeInEditor = ReactEditor.hasTarget(editor, focusNode)\n\n if (anchorNodeSelectable && focusNodeInEditor) {\n const range = ReactEditor.toSlateRange(editor, domSelection, {\n exactMatch: false,\n suppressThrow: true,\n })\n\n if (range) {\n if (\n !ReactEditor.isComposing(editor) &&\n !androidInputManager?.hasPendingChanges() &&\n !androidInputManager?.isFlushing()\n ) {\n Transforms.select(editor, range)\n } else {\n androidInputManager?.handleUserSelect(range)\n }\n }\n }\n\n // Deselect the editor if the dom selection is not selectable in readonly mode\n if (readOnly && (!anchorNodeSelectable || !focusNodeInEditor)) {\n Transforms.deselect(editor)\n }\n }\n }, 100),\n [editor, readOnly, state]\n )\n\n const scheduleOnDOMSelectionChange = useMemo(\n () => debounce(onDOMSelectionChange, 0),\n [onDOMSelectionChange]\n )\n\n androidInputManagerRef.current = useAndroidInputManager({\n node: ref,\n onDOMSelectionChange,\n scheduleOnDOMSelectionChange,\n })\n\n useIsomorphicLayoutEffect(() => {\n // Update element-related weak maps with the DOM element ref.\n let window\n if (ref.current && (window = getDefaultView(ref.current))) {\n EDITOR_TO_WINDOW.set(editor, window)\n EDITOR_TO_ELEMENT.set(editor, ref.current)\n NODE_TO_ELEMENT.set(editor, ref.current)\n ELEMENT_TO_NODE.set(ref.current, editor)\n } else {\n NODE_TO_ELEMENT.delete(editor)\n }\n\n // Make sure the DOM selection state is in sync.\n const { selection } = editor\n const root = ReactEditor.findDocumentOrShadowRoot(editor)\n const domSelection = getSelection(root)\n\n if (\n !domSelection ||\n !ReactEditor.isFocused(editor) ||\n androidInputManagerRef.current?.hasPendingAction()\n ) {\n return\n }\n\n const setDomSelection = (forceChange?: boolean) => {\n const hasDomSelection = domSelection.type !== 'None'\n\n // If the DOM selection is properly unset, we're done.\n if (!selection && !hasDomSelection) {\n return\n }\n\n // Get anchorNode and focusNode\n const focusNode = domSelection.focusNode\n let anchorNode\n\n // COMPAT: In firefox the normal seletion way does not work\n // (https://github.com/ianstormtaylor/slate/pull/5486#issue-1820720223)\n if (IS_FIREFOX && domSelection.rangeCount > 1) {\n const firstRange = domSelection.getRangeAt(0)\n const lastRange = domSelection.getRangeAt(domSelection.rangeCount - 1)\n\n // Right to left\n if (firstRange.startContainer === focusNode) {\n anchorNode = lastRange.endContainer\n } else {\n // Left to right\n anchorNode = firstRange.startContainer\n }\n } else {\n anchorNode = domSelection.anchorNode\n }\n\n // verify that the dom selection is in the editor\n const editorElement = EDITOR_TO_ELEMENT.get(editor)!\n let hasDomSelectionInEditor = false\n if (\n editorElement.contains(anchorNode) &&\n editorElement.contains(focusNode)\n ) {\n hasDomSelectionInEditor = true\n }\n\n // If the DOM selection is in the editor and the editor selection is already correct, we're done.\n if (\n hasDomSelection &&\n hasDomSelectionInEditor &&\n selection &&\n !forceChange\n ) {\n const slateRange = ReactEditor.toSlateRange(editor, domSelection, {\n exactMatch: true,\n\n // domSelection is not necessarily a valid Slate range\n // (e.g. when clicking on contentEditable:false element)\n suppressThrow: true,\n })\n\n if (slateRange && Range.equals(slateRange, selection)) {\n if (!state.hasMarkPlaceholder) {\n return\n }\n\n // Ensure selection is inside the mark placeholder\n if (\n anchorNode?.parentElement?.hasAttribute(\n 'data-slate-mark-placeholder'\n )\n ) {\n return\n }\n }\n }\n\n // when <Editable/> is being controlled through external value\n // then its children might just change - DOM responds to it on its own\n // but Slate's value is not being updated through any operation\n // and thus it doesn't transform selection on its own\n if (selection && !ReactEditor.hasRange(editor, selection)) {\n editor.selection = ReactEditor.toSlateRange(editor, domSelection, {\n exactMatch: false,\n suppressThrow: true,\n })\n return\n }\n\n // Otherwise the DOM selection is out of sync, so update it.\n state.isUpdatingSelection = true\n\n const newDomRange: DOMRange | null =\n selection && ReactEditor.toDOMRange(editor, selection)\n\n if (newDomRange) {\n if (ReactEditor.isComposing(editor) && !IS_ANDROID) {\n domSelection.collapseToEnd()\n } else if (Range.isBackward(selection!)) {\n domSelection.setBaseAndExtent(\n newDomRange.endContainer,\n newDomRange.endOffset,\n newDomRange.startContainer,\n newDomRange.startOffset\n )\n } else {\n domSelection.setBaseAndExtent(\n newDomRange.startContainer,\n newDomRange.startOffset,\n newDomRange.endContainer,\n newDomRange.endOffset\n )\n }\n scrollSelectionIntoView(editor, newDomRange)\n } else {\n domSelection.removeAllRanges()\n }\n\n return newDomRange\n }\n\n // In firefox if there is more then 1 range and we call setDomSelection we remove the ability to select more cells in a table\n if (domSelection.rangeCount <= 1) {\n setDomSelection()\n }\n\n const ensureSelection =\n androidInputManagerRef.current?.isFlushing() === 'action'\n\n if (!IS_ANDROID || !ensureSelection) {\n setTimeout(() => {\n state.isUpdatingSelection = false\n })\n return\n }\n\n let timeoutId: ReturnType<typeof setTimeout> | null = null\n const animationFrameId = requestAnimationFrame(() => {\n if (ensureSelection) {\n const ensureDomSelection = (forceChange?: boolean) => {\n try {\n const el = ReactEditor.toDOMNode(editor, editor)\n el.focus()\n\n setDomSelection(forceChange)\n } catch (e) {\n // Ignore, dom and state might be out of sync\n }\n }\n\n // Compat: Android IMEs try to force their selection by manually re-applying it even after we set it.\n // This essentially would make setting the slate selection during an update meaningless, so we force it\n // again here. We can't only do it in the setTimeout after the animation frame since that would cause a\n // visible flicker.\n ensureDomSelection()\n\n timeoutId = setTimeout(() => {\n // COMPAT: While setting the selection in an animation frame visually correctly sets the selection,\n // it doesn't update GBoards spellchecker state. We have to manually trigger a selection change after\n // the animation frame to ensure it displays the correct state.\n ensureDomSelection(true)\n state.isUpdatingSelection = false\n })\n }\n })\n\n return () => {\n cancelAnimationFrame(animationFrameId)\n if (timeoutId) {\n clearTimeout(timeoutId)\n }\n }\n })\n\n // Listen on the native `beforeinput` event to get real \"Level 2\" events. This\n // is required because React's `beforeinput` is fake and never really attaches\n // to the real event sadly. (2019/11/01)\n // https://github.com/facebook/react/issues/11211\n const onDOMBeforeInput = useCallback(\n (event: InputEvent) => {\n const el = ReactEditor.toDOMNode(editor, editor)\n const root = el.getRootNode()\n\n if (processing?.current && IS_WEBKIT && root instanceof ShadowRoot) {\n const ranges = event.getTargetRanges()\n const range = ranges[0]\n\n const newRange = new window.Range()\n\n newRange.setStart(range.startContainer, range.startOffset)\n newRange.setEnd(range.endContainer, range.endOffset)\n\n // Translate the DOM Range into a Slate Range\n const slateRange = ReactEditor.toSlateRange(editor, newRange, {\n exactMatch: false,\n suppressThrow: false,\n })\n\n Transforms.select(editor, slateRange)\n\n event.preventDefault()\n event.stopImmediatePropagation()\n return\n }\n onUserInput()\n\n if (\n !readOnly &&\n ReactEditor.hasEditableTarget(editor, event.target) &&\n !isDOMEventHandled(event, propsOnDOMBeforeInput)\n ) {\n // COMPAT: BeforeInput events aren't cancelable on android, so we have to handle them differently using the android input manager.\n if (androidInputManagerRef.current) {\n return androidInputManagerRef.current.handleDOMBeforeInput(event)\n }\n\n // Some IMEs/Chrome extensions like e.g. Grammarly set the selection immediately before\n // triggering a `beforeinput` expecting the change to be applied to the immediately before\n // set selection.\n scheduleOnDOMSelectionChange.flush()\n onDOMSelectionChange.flush()\n\n const { selection } = editor\n const { inputType: type } = event\n const data = (event as any).dataTransfer || event.data || undefined\n\n const isCompositionChange =\n type === 'insertCompositionText' || type === 'deleteCompositionText'\n\n // COMPAT: use composition change events as a hint to where we should insert\n // composition text if we aren't composing to work around https://github.com/ianstormtaylor/slate/issues/5038\n if (isCompositionChange && ReactEditor.isComposing(editor)) {\n return\n }\n\n let native = false\n if (\n type === 'insertText' &&\n selection &&\n Range.isCollapsed(selection) &&\n // Only use native character insertion for single characters a-z or space for now.\n // Long-press events (hold a + press 4 = ä) to choose a special character otherwise\n // causes duplicate inserts.\n event.data &&\n event.data.length === 1 &&\n /[a-z ]/i.test(event.data) &&\n // Chrome has issues correctly editing the start of nodes: https://bugs.chromium.org/p/chromium/issues/detail?id=1249405\n // When there is an inline element, e.g. a link, and you select\n // right after it (the start of the next node).\n selection.anchor.offset !== 0\n ) {\n native = true\n\n // Skip native if there are marks, as\n // `insertText` will insert a node, not just text.\n if (editor.marks) {\n native = false\n }\n\n // Chrome also has issues correctly editing the end of anchor elements: https://bugs.chromium.org/p/chromium/issues/detail?id=1259100\n // Therefore we don't allow native events to insert text at the end of anchor nodes.\n const { anchor } = selection\n\n const [node, offset] = ReactEditor.toDOMPoint(editor, anchor)\n const anchorNode = node.parentElement?.closest('a')\n\n const window = ReactEditor.getWindow(editor)\n\n if (\n native &&\n anchorNode &&\n ReactEditor.hasDOMNode(editor, anchorNode)\n ) {\n // Find the last text node inside the anchor.\n const lastText = window?.document\n .createTreeWalker(anchorNode, NodeFilter.SHOW_TEXT)\n .lastChild() as DOMText | null\n\n if (\n lastText === node &&\n lastText.textContent?.length === offset\n ) {\n native = false\n }\n }\n\n // Chrome has issues with the presence of tab characters inside elements with whiteSpace = 'pre'\n // causing abnormal insert behavior: https://bugs.chromium.org/p/chromium/issues/detail?id=1219139\n if (\n native &&\n node.parentElement &&\n window?.getComputedStyle(node.parentElement)?.whiteSpace === 'pre'\n ) {\n const block = Editor.above(editor, {\n at: anchor.path,\n match: n => Element.isElement(n) && Editor.isBlock(editor, n),\n })\n\n if (block && Node.string(block[0]).includes('\\t')) {\n native = false\n }\n }\n }\n\n // COMPAT: For the deleting forward/backward input types we don't want\n // to change the selection because it is the range that will be deleted,\n // and those commands determine that for themselves.\n if (!type.startsWith('delete') || type.startsWith('deleteBy')) {\n const [targetRange] = (event as any).getTargetRanges()\n\n if (targetRange) {\n const range = ReactEditor.toSlateRange(editor, targetRange, {\n exactMatch: false,\n suppressThrow: false,\n })\n\n if (!selection || !Range.equals(selection, range)) {\n native = false\n\n const selectionRef =\n !isCompositionChange &&\n editor.selection &&\n Editor.rangeRef(editor, editor.selection)\n\n Transforms.select(editor, range)\n\n if (selectionRef) {\n EDITOR_TO_USER_SELECTION.set(editor, selectionRef)\n }\n }\n }\n }\n\n // Composition change types occur while a user is composing text and can't be\n // cancelled. Let them through and wait for the composition to end.\n if (isCompositionChange) {\n return\n }\n\n if (!native) {\n event.preventDefault()\n }\n\n // COMPAT: If the selection is expanded, even if the command seems like\n // a delete forward/backward command it should delete the selection.\n if (\n selection &&\n Range.isExpanded(selection) &&\n type.startsWith('delete')\n ) {\n const direction = type.endsWith('Backward') ? 'backward' : 'forward'\n Editor.deleteFragment(editor, { direction })\n return\n }\n\n switch (type) {\n case 'deleteByComposition':\n case 'deleteByCut':\n case 'deleteByDrag': {\n Editor.deleteFragment(editor)\n break\n }\n\n case 'deleteContent':\n case 'deleteContentForward': {\n Editor.deleteForward(editor)\n break\n }\n\n case 'deleteContentBackward': {\n Editor.deleteBackward(editor)\n break\n }\n\n case 'deleteEntireSoftLine': {\n Editor.deleteBackward(editor, { unit: 'line' })\n Editor.deleteForward(editor, { unit: 'line' })\n break\n }\n\n case 'deleteHardLineBackward': {\n Editor.deleteBackward(editor, { unit: 'block' })\n break\n }\n\n case 'deleteSoftLineBackward': {\n Editor.deleteBackward(editor, { unit: 'line' })\n break\n }\n\n case 'deleteHardLineForward': {\n Editor.deleteForward(editor, { unit: 'block' })\n break\n }\n\n case 'deleteSoftLineForward': {\n Editor.deleteForward(editor, { unit: 'line' })\n break\n }\n\n case 'deleteWordBackward': {\n Editor.deleteBackward(editor, { unit: 'word' })\n break\n }\n\n case 'deleteWordForward': {\n Editor.deleteForward(editor, { unit: 'word' })\n break\n }\n\n case 'insertLineBreak':\n Editor.insertSoftBreak(editor)\n break\n\n case 'insertParagraph': {\n Editor.insertBreak(editor)\n break\n }\n\n case 'insertFromComposition':\n case 'insertFromDrop':\n case 'insertFromPaste':\n case 'insertFromYank':\n case 'insertReplacementText':\n case 'insertText': {\n if (type === 'insertFromComposition') {\n // COMPAT: in Safari, `compositionend` is dispatched after the\n // `beforeinput` for \"insertFromComposition\". But if we wait for it\n // then we will abort because we're still composing and the selection\n // won't be updated properly.\n // https://www.w3.org/TR/input-events-2/\n if (ReactEditor.isComposing(editor)) {\n setIsComposing(false)\n IS_COMPOSING.set(editor, false)\n }\n }\n\n // use a weak comparison instead of 'instanceof' to allow\n // programmatic access of paste events coming from external windows\n // like cypress where cy.window does not work realibly\n if (data?.constructor.name === 'DataTransfer') {\n ReactEditor.insertData(editor, data)\n } else if (typeof data === 'string') {\n // Only insertText operations use the native functionality, for now.\n // Potentially expand to single character deletes, as well.\n if (native) {\n deferredOperations.current.push(() =>\n Editor.insertText(editor, data)\n )\n } else {\n Editor.insertText(editor, data)\n }\n }\n\n break\n }\n }\n\n // Restore the actual user section if nothing manually set it.\n const toRestore = EDITOR_TO_USER_SELECTION.get(editor)?.unref()\n EDITOR_TO_USER_SELECTION.delete(editor)\n\n if (\n toRestore &&\n (!editor.selection || !Range.equals(editor.selection, toRestore))\n ) {\n Transforms.select(editor, toRestore)\n }\n }\n },\n [\n editor,\n onDOMSelectionChange,\n onUserInput,\n propsOnDOMBeforeInput,\n readOnly,\n scheduleOnDOMSelectionChange,\n ]\n )\n\n const callbackRef = useCallback(\n (node: HTMLDivElement | null) => {\n if (node == null) {\n onDOMSelectionChange.cancel()\n scheduleOnDOMSelectionChange.cancel()\n\n EDITOR_TO_ELEMENT.delete(editor)\n NODE_TO_ELEMENT.delete(editor)\n\n if (ref.current && HAS_BEFORE_INPUT_SUPPORT) {\n // @ts-ignore The `beforeinput` event isn't recognized.\n ref.current.removeEventListener('beforeinput', onDOMBeforeInput)\n }\n } else {\n // Attach a native DOM event handler for `beforeinput` events, because React's\n // built-in `onBeforeInput` is actually a leaky polyfill that doesn't expose\n // real `beforeinput` events sadly... (2019/11/04)\n // https://github.com/facebook/react/issues/11211\n if (HAS_BEFORE_INPUT_SUPPORT) {\n // @ts-ignore The `beforeinput` event isn't recognized.\n node.addEventListener('beforeinput', onDOMBeforeInput)\n }\n }\n\n ref.current = node\n if (typeof forwardedRef === 'function') {\n forwardedRef(node)\n } else if (forwardedRef) {\n forwardedRef.current = node\n }\n },\n [\n onDOMSelectionChange,\n scheduleOnDOMSelectionChange,\n editor,\n onDOMBeforeInput,\n forwardedRef,\n ]\n )\n\n useIsomorphicLayoutEffect(() => {\n const window = ReactEditor.getWindow(editor)\n\n // Attach a native DOM event handler for `selectionchange`, because React's\n // built-in `onSelect` handler doesn't fire for all selection changes. It's\n // a leaky polyfill that only fires on keypresses or clicks. Instead, we\n // want to fire for any change to the selection inside the editor.\n // (2019/11/04) https://github.com/facebook/react/issues/5785\n window.document.addEventListener(\n 'selectionchange',\n scheduleOnDOMSelectionChange\n )\n\n // Listen for dragend and drop globally. In Firefox, if a drop handler\n // initiates an operation that causes the originally dragged element to\n // unmount, that element will not emit a dragend event. (2024/06/21)\n const stoppedDragging = () => {\n state.isDraggingInternally = false\n }\n window.document.addEventListener('dragend', stoppedDragging)\n window.document.addEventListener('drop', stoppedDragging)\n\n return () => {\n window.document.removeEventListener(\n 'selectionchange',\n scheduleOnDOMSelectionChange\n )\n window.document.removeEventListener('dragend', stoppedDragging)\n window.document.removeEventListener('drop', stoppedDragging)\n }\n }, [scheduleOnDOMSelectionChange, state])\n\n const decorations = decorate([editor, []])\n\n const showPlaceholder =\n placeholder &&\n editor.children.length === 1 &&\n Array.from(Node.texts(editor)).length === 1 &&\n Node.string(editor) === '' &&\n !isComposing\n\n const placeHolderResizeHandler = useCallback(\n (placeholderEl: HTMLElement | null) => {\n if (placeholderEl && showPlaceholder) {\n setPlaceholderHeight(placeholderEl.getBoundingClientRect()?.height)\n } else {\n setPlaceholderHeight(undefined)\n }\n },\n [showPlaceholder]\n )\n\n if (showPlaceholder) {\n const start = Editor.start(editor, [])\n decorations.push({\n [PLACEHOLDER_SYMBOL]: true,\n placeholder,\n onPlaceholderResize: placeHolderResizeHandler,\n anchor: start,\n focus: start,\n })\n }\n\n const { marks } = editor\n state.hasMarkPlaceholder = false\n\n if (editor.selection && Range.isCollapsed(editor.selection) && marks) {\n const { anchor } = editor.selection\n const leaf = Node.leaf(editor, anchor.path)\n const { text, ...rest } = leaf\n\n // While marks isn't a 'complete' text, we can still use loose Text.equals\n // here which only compares marks anyway.\n if (!Text.equals(leaf, marks as Text, { loose: true })) {\n state.hasMarkPlaceholder = true\n\n const unset = Object.fromEntries(\n Object.keys(rest).map(mark => [mark, null])\n )\n\n decorations.push({\n [MARK_PLACEHOLDER_SYMBOL]: true,\n ...unset,\n ...marks,\n\n anchor,\n focus: anchor,\n })\n }\n }\n\n // Update EDITOR_TO_MARK_PLACEHOLDER_MARKS in setTimeout useEffect to ensure we don't set it\n // before we receive the composition end event.\n useEffect(() => {\n setTimeout(() => {\n const { selection } = editor\n if (selection) {\n const { anchor } = selection\n const text = Node.leaf(editor, anchor.path)\n\n // While marks isn't a 'complete' text, we can still use loose Text.equals\n // here which only compares marks anyway.\n if (marks && !Text.equals(text, marks as Text, { loose: true })) {\n EDITOR_TO_PENDING_INSERTION_MARKS.set(editor, marks)\n return\n }\n }\n\n EDITOR_TO_PENDING_INSERTION_MARKS.delete(editor)\n })\n })\n\n return (\n <ReadOnlyContext.Provider value={readOnly}>\n <ComposingContext.Provider value={isComposing}>\n <DecorateContext.Provider value={decorate}>\n <RestoreDOM node={ref} receivedUserInput={receivedUserInput}>\n <Component\n role={readOnly ? undefined : 'textbox'}\n aria-multiline={readOnly ? undefined : true}\n {...attributes}\n // COMPAT: Certain browsers don't support the `beforeinput` event, so we'd\n // have to use hacks to make these replacement-based features work.\n // For SSR situations HAS_BEFORE_INPUT_SUPPORT is false and results in prop\n // mismatch warning app moves to browser. Pass-through consumer props when\n // not CAN_USE_DOM (SSR) and default to falsy value\n spellCheck={\n HAS_BEFORE_INPUT_SUPPORT || !CAN_USE_DOM\n ? attributes.spellCheck\n : false\n }\n autoCorrect={\n HAS_BEFORE_INPUT_SUPPORT || !CAN_USE_DOM\n ? attributes.autoCorrect\n : 'false'\n }\n autoCapitalize={\n HAS_BEFORE_INPUT_SUPPORT || !CAN_USE_DOM\n ? attributes.autoCapitalize\n : 'false'\n }\n data-slate-editor\n data-slate-node=\"value\"\n // explicitly set this\n contentEditable={!readOnly}\n // in some cases, a decoration needs access to the range / selection to decorate a text node,\n // then you will select the whole text node when you select part the of text\n // this magic zIndex=\"-1\" will fix it\n zindex={-1}\n suppressContentEditableWarning\n ref={callbackRef}\n style={{\n ...(disableDefaultStyles\n ? {}\n : {\n // Allow positioning relative to the editable element.\n position: 'relative',\n // Preserve adjacent whitespace and new lines.\n whiteSpace: 'pre-wrap',\n // Allow words to break if they are too long.\n wordWrap: 'break-word',\n // Make the minimum height that of the placeholder.\n ...(placeholderHeight\n ? { minHeight: placeholderHeight }\n : {}),\n }),\n // Allow for passed-in styles to override anything.\n ...userStyle,\n }}\n onBeforeInput={useCallback(\n (event: React.FormEvent<HTMLDivElement>) => {\n // COMPAT: Certain browsers don't support the `beforeinput` event, so we\n // fall back to React's leaky polyfill instead just for it. It\n // only works for the `insertText` input type.\n if (\n !HAS_BEFORE_INPUT_SUPPORT &&\n !readOnly &&\n !isEventHandled(event, attributes.onBeforeInput) &&\n ReactEditor.hasSelectableTarget(editor, event.target)\n ) {\n event.preventDefault()\n if (!ReactEditor.isComposing(editor)) {\n const text = (event as any).data as string\n Editor.insertText(editor, text)\n }\n }\n },\n [attributes.onBeforeInput, editor, readOnly]\n )}\n onInput={useCallback(\n (event: React.FormEvent<HTMLDivElement>) => {\n if (isEventHandled(event, attributes.onInput)) {\n return\n }\n\n if (androidInputManagerRef.current) {\n androidInputManagerRef.current.handleInput()\n return\n }\n\n // Flush native operations, as native events will have propogated\n // and we can correctly compare DOM text values in components\n // to stop rendering, so that browser functions like autocorrect\n // and spellcheck work as expected.\n for (const op of deferredOperations.current) {\n op()\n }\n deferredOperations.current = []\n\n // COMPAT: Since `beforeinput` doesn't fully `preventDefault`,\n // there's a chance that content might be placed in the browser's undo stack.\n // This means undo can be triggered even when the div is not focused,\n // and it only triggers the input event for the node. (2024/10/09)\n if (!ReactEditor.isFocused(editor)) {\n const native = event.nativeEvent as InputEvent\n const maybeHistoryEditor: any = editor\n if (\n native.inputType === 'historyUndo' &&\n typeof maybeHistoryEditor.undo === 'function'\n ) {\n maybeHistoryEditor.undo()\n return\n }\n if (\n native.inputType === 'historyRedo' &&\n typeof maybeHistoryEditor.redo === 'function'\n ) {\n maybeHistoryEditor.redo()\n return\n }\n }\n },\n [attributes.onInput, editor]\n )}\n onBlur={useCallback(\n (event: React.FocusEvent<HTMLDivElement>) => {\n if (\n readOnly ||\n state.isUpdatingSelection ||\n !ReactEditor.hasSelectableTarget(editor, event.target) ||\n isEventHandled(event, attributes.onBlur)\n ) {\n return\n }\n\n // COMPAT: If the current `activeElement` is still the previous\n // one, this is due to the window being blurred when the tab\n // itself becomes unfocused, so we want to abort early to allow to\n // editor to stay focused when the tab becomes focused again.\n const root = ReactEditor.findDocumentOrShadowRoot(editor)\n if (state.latestElement === root.activeElement) {\n return\n }\n\n const { relatedTarget } = event\n const el = ReactEditor.toDOMNode(editor, editor)\n\n // COMPAT: The event should be ignored if the focus is returning\n // to the editor from an embedded editable element (eg. an <input>\n // element inside a void node).\n if (relatedTarget === el) {\n return\n }\n\n // COMPAT: The event should be ignored if the focus is moving from\n // the editor to inside a void node's spacer element.\n if (\n isDOMElement(relatedTarget) &&\n relatedTarget.hasAttribute('data-slate-spacer')\n ) {\n return\n }\n\n // COMPAT: The event should be ignored if the focus is moving to a\n // non- editable section of an element that isn't a void node (eg.\n // a list item of the check list example).\n if (\n relatedTarget != null &&\n isDOMNode(relatedTarget) &&\n ReactEditor.hasDOMNode(editor, relatedTarget)\n ) {\n const node = ReactEditor.toSlateNode(\n editor,\n relatedTarget\n )\n\n if (Element.isElement(node) && !editor.isVoid(node)) {\n return\n }\n }\n\n // COMPAT: Safari doesn't always remove the selection even if the content-\n // editable element no longer has focus. Refer to:\n // https://stackoverflow.com/questions/12353247/force-contenteditable-div-to-stop-accepting-input-after-it-loses-focus-under-web\n if (IS_WEBKIT) {\n const domSelection = getSelection(root)\n domSelection?.removeAllRanges()\n }\n\n IS_FOCUSED.delete(editor)\n },\n [\n readOnly,\n state.isUpdatingSelection,\n state.latestElement,\n editor,\n attributes.onBlur,\n ]\n )}\n onClick={useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n if (\n ReactEditor.hasTarget(editor, event.target) &&\n !isEventHandled(event, attributes.onClick) &&\n isDOMNode(event.target)\n ) {\n const node = ReactEditor.toSlateNode(editor, event.target)\n const path = ReactEditor.findPath(editor, node)\n\n // At this time, the Slate document may be arbitrarily different,\n // because onClick handlers can change the document before we get here.\n // Therefore we must check that this path actually exists,\n // and that it still refers to the same node.\n if (\n !Editor.hasPath(editor, path) ||\n Node.get(editor, path) !== node\n ) {\n return\n }\n\n if (event.detail === TRIPLE_CLICK && path.length >= 1) {\n let blockPath = path\n if (\n !(\n Element.isElement(node) &&\n Editor.isBlock(editor, node)\n )\n ) {\n const block = Editor.above(editor, {\n match: n =>\n Element.isElement(n) && Editor.isBlock(editor, n),\n at: path,\n })\n\n blockPath = block?.[1] ?? path.slice(0, 1)\n }\n\n const range = Editor.range(editor, blockPath)\n Transforms.select(editor, range)\n return\n }\n\n if (readOnly) {\n return\n }\n\n const start = Editor.start(editor, path)\n const end = Editor.end(editor, path)\n const startVoid = Editor.void(editor, { at: start })\n const endVoid = Editor.void(editor, { at: end })\n\n if (\n startVoid &&\n endVoid &&\n Path.equals(startVoid[1], endVoid[1])\n ) {\n const range = Editor.range(editor, start)\n Transforms.select(editor, range)\n }\n }\n },\n [editor, attributes.onClick, readOnly]\n )}\n onCompositionEnd={useCallback(\n (event: React.CompositionEvent<HTMLDivElement>) => {\n if (ReactEditor.hasSelectableTarget(editor, event.target)) {\n if (ReactEditor.isComposing(editor)) {\n Promise.resolve().then(() => {\n setIsComposing(false)\n IS_COMPOSING.set(editor, false)\n })\n }\n\n androidInputManagerRef.current?.handleCompositionEnd(\n event\n )\n\n if (\n isEventHandled(event, attributes.onCompositionEnd) ||\n IS_ANDROID\n ) {\n return\n }\n\n // COMPAT: In Chrome, `beforeinput` events for compositions\n // aren't correct and never fire the \"insertFromComposition\"\n // type that we need. So instead, insert whenever a composition\n // ends since it will already have been committed to the DOM.\n if (\n !IS_WEBKIT &&\n !IS_FIREFOX_LEGACY &&\n !IS_IOS &&\n !IS_WECHATBROWSER &&\n !IS_UC_MOBILE &&\n event.data\n ) {\n const placeholderMarks =\n EDITOR_TO_PENDING_INSERTION_MARKS.get(editor)\n EDITOR_TO_PENDING_INSERTION_MARKS.delete(editor)\n\n // Ensure we insert text with the marks the user was actually seeing\n if (placeholderMarks !== undefined) {\n EDITOR_TO_USER_MARKS.set(editor, editor.marks)\n editor.marks = placeholderMarks\n }\n\n Editor.insertText(editor, event.data)\n\n const userMarks = EDITOR_TO_USER_MARKS.get(editor)\n EDITOR_TO_USER_MARKS.delete(editor)\n if (userMarks !== undefined) {\n editor.marks = userMarks\n }\n }\n }\n },\n [attributes.onCompositionEnd, editor]\n )}\n onCompositionUpdate={useCallback(\n (event: React.CompositionEvent<HTMLDivElement>) => {\n if (\n ReactEditor.hasSelectableTarget(editor, event.target) &&\n !isEventHandled(event, attributes.onCompositionUpdate)\n ) {\n if (!ReactEditor.isComposing(editor)) {\n setIsComposing(true)\n IS_COMPOSING.set(editor, true)\n }\n }\n },\n [attributes.onCompositionUpdate, editor]\n )}\n onCompositionStart={useCallback(\n (event: React.CompositionEvent<HTMLDivElement>) => {\n if (ReactEditor.hasSelectableTarget(editor, event.target)) {\n androidInputManagerRef.current?.handleCompositionStart(\n event\n )\n\n if (\n isEventHandled(event, attributes.onCompositionStart) ||\n IS_ANDROID\n ) {\n return\n }\n\n setIsComposing(true)\n\n const { selection } = editor\n if (selection && Range.isExpanded(selection)) {\n Editor.deleteFragment(editor)\n return\n }\n }\n },\n [attributes.onCompositionStart, editor]\n )}\n onCopy={useCallback(\n (event: React.ClipboardEvent<HTMLDivElement>) => {\n if (\n ReactEditor.hasSelectableTarget(editor, event.target) &&\n !isEventHandled(event, attributes.onCopy) &&\n !isDOMEventTargetInput(event)\n ) {\n event.preventDefault()\n ReactEditor.setFragmentData(\n editor,\n event.clipboardData,\n 'copy'\n )\n }\n },\n [attributes.onCopy, editor]\n )}\n onCut={useCallback(\n (event: React.ClipboardEvent<HTMLDivElement>) => {\n if (\n !readOnly &&\n ReactEditor.hasSelectableTarget(editor, event.target) &&\n !isEventHandled(event, attributes.onCut) &&\n !isDOMEventTargetInput(event)\n ) {\n event.preventDefault()\n ReactEditor.setFragmentData(\n editor,\n event.clipboardData,\n 'cut'\n )\n const { selection } = editor\n\n if (selection) {\n if (Range.isExpanded(selection)) {\n Editor.deleteFragment(editor)\n } else {\n const node = Node.parent(\n editor,\n selection.anchor.path\n )\n if (Editor.isVoid(editor, node)) {\n Transforms.delete(editor)\n }\n }\n }\n }\n },\n [readOnly, editor, attributes.onCut]\n )}\n onDragOver={useCallback(\n (event: React.DragEvent<HTMLDivElement>) => {\n if (\n ReactEditor.hasTarget(editor, event.target) &&\n !isEventHandled(event, attributes.onDragOver)\n ) {\n // Only when the target is void, call `preventDefault` to signal\n // that drops are allowed. Editable content is droppable by\n // default, and calling `preventDefault` hides the cursor.\n const node = ReactEditor.toSlateNode(editor, event.target)\n\n if (\n Element.isElement(node) &&\n Editor.isVoid(editor, node)\n ) {\n event.preventDefault()\n }\n }\n },\n [attributes.onDragOver, editor]\n )}\n onDragStart={useCallback(\n (event: React.DragEvent<HTMLDivElement>) => {\n if (\n !readOnly &&\n ReactEditor.hasTarget(editor, event.target) &&\n !isEventHandled(event, attributes.onDragStart)\n ) {\n const node = ReactEditor.toSlateNode(editor, event.target)\n const path = ReactEditor.findPath(editor, node)\n const voidMatch =\n (Element.isElement(node) &&\n Editor.isVoid(editor, node)) ||\n Editor.void(editor, { at: path, voids: true })\n\n // If starting a drag on a void node, make sure it is selected\n // so that it shows up in the selection's fragment.\n if (voidMatch) {\n const range = Editor.range(editor, path)\n Transforms.select(editor, range)\n }\n\n state.isDraggingInternally = true\n\n ReactEditor.setFragmentData(\n editor,\n event.dataTransfer,\n 'drag'\n )\n }\n },\n [readOnly, editor, attributes.onDragStart, state]\n )}\n onDrop={useCallback(\n (event: React.DragEvent<HTMLDivElement>) => {\n if (\n !readOnly &&\n ReactEditor.hasTarget(editor, event.target) &&\n !isEventHandled(event, attributes.onDrop)\n ) {\n event.preventDefault()\n\n // Keep a reference to the dragged range before updating selection\n const draggedRange = editor.selection\n\n // Find the range where the drop happened\n const range = ReactEditor.findEventRange(editor, event)\n const data = event.dataTransfer\n\n Transforms.select(editor, range)\n\n if (state.isDraggingInternally) {\n if (\n draggedRange &&\n !Range.equals(draggedRange, range) &&\n !Editor.void(editor, { at: range, voids: true })\n ) {\n Transforms.delete(editor, {\n at: draggedRange,\n })\n }\n }\n\n ReactEditor.insertData(editor, data)\n\n // When dragging from another source into the editor, it's possible\n // that the current editor does not have focus.\n if (!ReactEditor.isFocused(editor)) {\n ReactEditor.focus(editor)\n }\n }\n },\n [readOnly, editor, attributes.onDrop, state]\n )}\n onDragEnd={useCallback(\n (event: React.DragEvent<HTMLDivElement>) => {\n if (\n !readOnly &&\n state.isDraggingInternally &&\n attributes.onDragEnd &&\n ReactEditor.hasTarget(editor, event.target)\n ) {\n attributes.onDragEnd(event)\n }\n },\n [readOnly, state, attributes, editor]\n )}\n onFocus={useCallback(\n (event: React.FocusEvent<HTMLDivElement>) => {\n if (\n !readOnly &&\n !state.isUpdatingSelection &&\n ReactEditor.hasEditableTarget(editor, event.target) &&\n !isEventHandled(event, attributes.onFocus)\n ) {\n const el = ReactEditor.toDOMNode(editor, editor)\n const root = ReactEditor.findDocumentOrShadowRoot(editor)\n state.latestElement = root.activeElement\n\n // COMPAT: If the editor has nested editable elements, the focus\n // can go to them. In Firefox, this must be prevented because it\n // results in issues with keyboard navigation. (2017/03/30)\n if (IS_FIREFOX && event.target !== el) {\n el.focus()\n return\n }\n\n IS_FOCUSED.set(editor, true)\n }\n },\n [readOnly, state, editor, attributes.onFocus]\n )}\n onKeyDown={useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (\n !readOnly &&\n ReactEditor.hasEditableTarget(editor, event.target)\n ) {\n androidInputManagerRef.current?.handleKeyDown(event)\n\n const { nativeEvent } = event\n\n // COMPAT: The composition end event isn't fired reliably in all browsers,\n // so we sometimes might end up stuck in a composition state even though we\n // aren't composing any more.\n if (\n ReactEditor.isComposing(editor) &&\n nativeEvent.isComposing === false\n ) {\n IS_COMPOSING.set(editor, false)\n setIsComposing(false)\n }\n\n if (\n isEventHandled(event, attributes.onKeyDown) ||\n ReactEditor.isComposing(editor)\n ) {\n return\n }\n\n const { selection } = editor\n const element =\n editor.children[\n selection !== null ? selection.focus.path[0] : 0\n ]\n const isRTL = getDirection(Node.string(element)) === 'rtl'\n\n // COMPAT: Since we prevent the default behavior on\n // `beforeinput` events, the browser doesn't think there's ever\n // any history stack to undo or redo, so we have to manage these\n // hotkeys ourselves. (2019/11/06)\n if (Hotkeys.isRedo(nativeEvent)) {\n event.preventDefault()\n const maybeHistoryEditor: any = editor\n\n if (typeof maybeHistoryEditor.redo === 'function') {\n maybeHistoryEditor.redo()\n }\n\n return\n }\n\n if (Hotkeys.isUndo(nativeEvent)) {\n event.preventDefault()\n const maybeHistoryEditor: any = editor\n\n if (typeof maybeHistoryEditor.undo === 'function') {\n maybeHistoryEditor.undo()\n }\n\n return\n }\n\n // COMPAT: Certain browsers don't handle the selection updates\n // properly. In Chrome, the selection isn't properly extended.\n // And in Firefox, the selection isn't properly collapsed.\n // (2017/10/17)\n if (Hotkeys.isMoveLineBackward(nativeEvent)) {\n event.preventDefault()\n Transforms.move(editor, { unit: 'line', reverse: true })\n return\n }\n\n if (Hotkeys.isMoveLineForward(nativeEvent)) {\n event.preventDefault()\n Transforms.move(editor, { unit: 'line' })\n return\n }\n\n if (Hotkeys.isExtendLineBackward(nativeEvent)) {\n event.preventDefault()\n Transforms.move(editor, {\n unit: 'line',\n edge: 'focus',\n reverse: true,\n })\n return\n }\n\n if (Hotkeys.isExtendLineForward(nativeEvent)) {\n event.preventDefault()\n Transforms.move(editor, { unit: 'line', edge: 'focus' })\n return\n }\n\n // COMPAT: If a void node is selected, or a zero-width text node\n // adjacent to an inline is selected, we need to handle these\n // hotkeys manually because browsers won't be able to skip over\n // the void node with the zero-width space not being an empty\n // string.\n if (Hotkeys.isMoveBackward(nativeEvent)) {\n event.preventDefault()\n\n if (selection && Range.isCollapsed(selection)) {\n Transforms.move(editor, { reverse: !isRTL })\n } else {\n Transforms.collapse(editor, {\n edge: isRTL ? 'end' : 'start',\n })\n }\n\n return\n }\n\n if (Hotkeys.isMoveForward(nativeEvent)) {\n event.preventDefault()\n\n if (selection && Range.isCollapsed(selection)) {\n Transforms.move(editor, { reverse: isRTL })\n } else {\n Transforms.collapse(editor, {\n edge: isRTL ? 'start' : 'end',\n })\n }\n\n return\n }\n\n if (Hotkeys.isMoveWordBackward(nativeEvent)) {\n event.preventDefault()\n\n if (selection && Range.isExpanded(selection)) {\n Transforms.collapse(editor, { edge: 'focus' })\n }\n\n Transforms.move(editor, {\n unit: 'word',\n reverse: !isRTL,\n })\n return\n }\n\n if (Hotkeys.isMoveWordForward(nativeEvent)) {\n event.preventDefault()\n\n if (selection && Range.isExpanded(selection)) {\n Transforms.collapse(editor, { edge: 'focus' })\n }\n\n Transforms.move(editor, {\n unit: 'word',\n reverse: isRTL,\n })\n return\n }\n\n // COMPAT: Certain browsers don't support the `beforeinput` event, so we\n // fall back to guessing at the input intention for hotkeys.\n // COMPAT: In iOS, some of these hotkeys are handled in the\n if (!HAS_BEFORE_INPUT_SUPPORT) {\n // We don't have a core behavior for these, but they change the\n // DOM if we don't prevent them, so we have to.\n if (\n Hotkeys.isBold(nativeEvent) ||\n Hotkeys.isItalic(nativeEvent) ||\n Hotkeys.isTransposeCharacter(nativeEvent)\n ) {\n event.preventDefault()\n return\n }\n\n if (Hotkeys.isSoftBreak(nativeEvent)) {\n event.preventDefault()\n Editor.insertSoftBreak(editor)\n return\n }\n\n if (Hotkeys.isSplitBlock(nativeEvent)) {\n event.preventDefault()\n Editor.insertBreak(editor)\n return\n }\n\n if (Hotkeys.isDeleteBackward(nativeEvent)) {\n event.preventDefault()\n\n if (selection && Range.isExpanded(selection)) {\n Editor.deleteFragment(editor, {\n direction: 'backward',\n })\n } else {\n Editor.deleteBackward(editor)\n }\n\n return\n }\n\n if (Hotkeys.isDeleteForward(nativeEvent)) {\n event.preventDefault()\n\n if (selection && Range.isExpanded(selection)) {\n Editor.deleteFragment(editor, {\n direction: 'forward',\n })\n } else {\n Editor.deleteForward(editor)\n }\n\n return\n }\n\n if (Hotkeys.isDeleteLineBackward(nativeEvent)) {\n event.preventDefault()\n\n if (selection && Range.isExpanded(selection)) {\n Editor.deleteFragment(editor, {\n direction: 'backward',\n })\n } else {\n Editor.deleteBackward(editor, { unit: 'line' })\n }\n\n return\n }\n\n if (Hotkeys.isDeleteLineForward(nativeEvent)) {\n event.preventDefault()\n\n if (selection && Range.isExpanded(selection)) {\n Editor.deleteFragment(editor, {\n direction: 'forward',\n })\n } else {\n Editor.deleteForward(editor, { unit: 'line' })\n }\n\n return\n }\n\n if (Hotkeys.isDeleteWordBackward(nativeEvent)) {\n event.preventDefault()\n\n if (selection && Range.isExpanded(selection)) {\n Editor.deleteFragment(editor, {\n direction: 'backward',\n })\n } else {\n Editor.deleteBackward(editor, { unit: 'word' })\n }\n\n return\n }\n\n if (Hotkeys.isDeleteWordForward(nativeEvent)) {\n event.preventDefault()\n\n if (selection && Range.isExpanded(selection)) {\n Editor.deleteFragment(editor, {\n direction: 'forward',\n })\n } else {\n Editor.deleteForward(editor, { unit: 'word' })\n }\n\n return\n }\n } else {\n if (IS_CHROME || IS_WEBKIT) {\n // COMPAT: Chrome and Safari support `beforeinput` event but do not fire\n // an event when deleting backwards in a selected void inline node\n if (\n selection &&\n (Hotkeys.isDeleteBackward(nativeEvent) ||\n Hotkeys.isDeleteForward(nativeEvent)) &&\n Range.isCollapsed(selection)\n ) {\n const currentNode = Node.parent(\n editor,\n selection.anchor.path\n )\n\n if (\n Element.isElement(currentNode) &&\n Editor.isVoid(editor, currentNode) &&\n (Editor.isInline(editor, currentNode) ||\n Editor.isBlock(editor, currentNode))\n ) {\n event.preventDefault()\n Editor.deleteBackward(editor, { unit: 'block' })\n\n return\n }\n }\n }\n }\n }\n },\n [readOnly, editor, attributes.onKeyDown]\n )}\n onPaste={useCallback(\n (event: React.ClipboardEvent<HTMLDivElement>) => {\n if (\n !readOnly &&\n ReactEditor.hasEditableTarget(editor, event.target) &&\n !isEventHandled(event, attributes.onPaste)\n ) {\n // COMPAT: Certain browsers don't support the `beforeinput` event, so we\n // fall back to React's `onPaste` here instead.\n // COMPAT: Firefox, Chrome and Safari don't emit `beforeinput` events\n // when \"paste without formatting\" is used, so fallback. (2020/02/20)\n // COMPAT: Safari InputEvents generated by pasting won't include\n // application/x-slate-fragment items, so use the\n // ClipboardEvent here. (2023/03/15)\n if (\n !HAS_BEFORE_INPUT_SUPPORT ||\n isPlainTextOnlyPaste(event.nativeEvent) ||\n IS_WEBKIT\n ) {\n event.preventDefault()\n ReactEditor.insertData(editor, event.clipboardData)\n }\n }\n },\n [readOnly, editor, attributes.onPaste]\n )}\n >\n <Children\n decorations={decorations}\n node={editor}\n renderElement={renderElement}\n renderPlaceholder={renderPlaceholder}\n renderLeaf={renderLeaf}\n selection={editor.selection}\n />\n </Component>\n </RestoreDOM>\n </DecorateContext.Provider>\n </ComposingContext.Provider>\n </ReadOnlyContext.Provider>\n )\n }\n)\n\n/**\n * The props that get passed to renderPlaceholder\n */\nexport type RenderPlaceholderProps = {\n children: any\n attributes: {\n 'data-slate-placeholder': boolean\n dir?: 'rtl'\n contentEditable: boolean\n ref: React.RefCallback<any>\n style: React.CSSProperties\n }\n}\n\n/**\n * The default placeholder element\n */\n\nexport const DefaultPlaceholder = ({\n attributes,\n children,\n}: RenderPlaceholderProps) => (\n // COMPAT: Artificially add a line-break to the end on the placeholder element\n // to prevent Android IMEs to pick up its content in autocorrect and to auto-capitalize the first letter\n <span {...attributes}>\n {children}\n {IS_ANDROID && <br />}\n </span>\n)\n\n/**\n * A default memoized decorate function.\n */\n\nexport const defaultDecorate: (entry: NodeEntry) => Range[] = () => []\n\n/**\n * A default implement to scroll dom range into view.\n */\n\nconst defaultScrollSelectionIntoView = (\n editor: ReactEditor,\n domRange: DOMRange\n) => {\n // This was affecting the selection of multiple blocks and dragging behavior,\n // so enabled only if the selection has been collapsed.\n if (\n domRange.getBoundingClientRect &&\n (!editor.selection ||\n (editor.selection && Range.isCollapsed(editor.selection)))\n ) {\n const leafEl = domRange.startContainer.parentElement!\n leafEl.getBoundingClientRect = domRange.getBoundingClientRect.bind(domRange)\n scrollIntoView(leafEl, {\n scrollMode: 'if-needed',\n })\n\n // @ts-expect-error an unorthodox delete D:\n delete leafEl.getBoundingClientRect\n }\n}\n\n/**\n * Check if an event is overrided by a handler.\n */\n\nexport const isEventHandled = <\n EventType extends React.SyntheticEvent<unknown, unknown>,\n>(\n event: EventType,\n handler?: (event: EventType) => void | boolean\n) => {\n if (!handler) {\n return false\n }\n // The custom event handler may return a boolean to specify whether the event\n // shall be treated as being handled or not.\n const shouldTreatEventAsHandled = handler(event)\n\n if (shouldTreatEventAsHandled != null) {\n return shouldTreatEventAsHandled\n }\n\n return event.isDefaultPrevented() || event.isPropagationStopped()\n}\n\n/**\n * Check if the event's target is an input element\n */\nexport const isDOMEventTargetInput = <\n EventType extends React.SyntheticEvent<unknown, unknown>,\n>(\n event: EventType\n) => {\n return (\n isDOMNode(event.target) &&\n (event.target instanceof HTMLInputElement ||\n event.target instanceof HTMLTextAreaElement)\n )\n}\n\n/**\n * Check if a DOM event is overrided by a handler.\n */\n\nexport const isDOMEventHandled = <E extends Event>(\n event: E,\n handler?: (event: E) => void | boolean\n) => {\n if (!handler) {\n return false\n }\n\n // The custom event handler may return a boolean to specify whether the event\n // shall be treated as being handled or not.\n const shouldTreatEventAsHandled = handler(event)\n\n if (shouldTreatEventAsHandled != null) {\n return shouldTreatEventAsHandled\n }\n\n return event.defaultPrevented\n}\n","import { createContext, useContext } from 'react'\n\n/**\n * A React context for sharing the `focused` state of the editor.\n */\n\nexport const FocusedContext = createContext(false)\n\n/**\n * Get the current `focused` state of the editor.\n */\n\nexport const useFocused = (): boolean => {\n return useContext(FocusedContext)\n}\n","import {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useReducer,\n useRef,\n} from 'react'\nimport { Editor } from 'slate'\nimport { useIsomorphicLayoutEffect } from './use-isomorphic-layout-effect'\n\nfunction isError(error: any): error is Error {\n return error instanceof Error\n}\n\ntype EditorChangeHandler = (editor: Editor) => void\n/**\n * A React context for sharing the editor selector context in a way to control rerenders\n */\n\nexport const SlateSelectorContext = createContext<{\n getSlate: () => Editor\n addEventListener: (callback: EditorChangeHandler) => () => void\n}>({} as any)\n\nconst refEquality = (a: any, b: any) => a === b\n\n/**\n * use redux style selectors to prevent rerendering on every keystroke.\n * Bear in mind rerendering can only prevented if the returned value is a value type or for reference types (e.g. objects and arrays) add a custom equality function.\n *\n * Example:\n * ```\n * const isSelectionActive = useSlateSelector(editor => Boolean(editor.selection));\n * ```\n */\nexport function useSlateSelector<T>(\n selector: (editor: Editor) => T,\n equalityFn: (a: T, b: T) => boolean = refEquality\n) {\n const [, forceRender] = useReducer(s => s + 1, 0)\n const context = useContext(SlateSelectorContext)\n if (!context) {\n throw new Error(\n `The \\`useSlateSelector\\` hook must be used inside the <Slate> component's context.`\n )\n }\n const { getSlate, addEventListener } = context\n\n const latestSubscriptionCallbackError = useRef<Error | undefined>()\n const latestSelector = useRef<(editor: Editor) => T>(() => null as any)\n const latestSelectedState = useRef<T>(null as any as T)\n let selectedState: T\n\n try {\n if (\n selector !== latestSelector.current ||\n latestSubscriptionCallbackError.current\n ) {\n selectedState = selector(getSlate())\n } else {\n selectedState = latestSelectedState.current\n }\n } catch (err) {\n if (latestSubscriptionCallbackError.current && isError(err)) {\n err.message += `\\nThe error may be correlated with this previous error:\\n${latestSubscriptionCallbackError.current.stack}\\n\\n`\n }\n\n throw err\n }\n useIsomorphicLayoutEffect(() => {\n latestSelector.current = selector\n latestSelectedState.current = selectedState\n latestSubscriptionCallbackError.current = undefined\n })\n\n useIsomorphicLayoutEffect(\n () => {\n function checkForUpdates() {\n try {\n const newSelectedState = latestSelector.current(getSlate())\n\n if (equalityFn(newSelectedState, latestSelectedState.current)) {\n return\n }\n\n latestSelectedState.current = newSelectedState\n } catch (err) {\n // we ignore all errors here, since when the component\n // is re-rendered, the selectors are called again, and\n // will throw again, if neither props nor store state\n // changed\n if (err instanceof Error) {\n latestSubscriptionCallbackError.current = err\n } else {\n latestSubscriptionCallbackError.current = new Error(String(err))\n }\n }\n\n forceRender()\n }\n\n const unsubscribe = addEventListener(checkForUpdates)\n\n checkForUpdates()\n\n return () => unsubscribe()\n },\n // don't rerender on equalityFn change since we want to be able to define it inline\n [addEventListener, getSlate]\n )\n\n return selectedState\n}\n\n/**\n * Create selector context with editor updating on every editor change\n */\nexport function useSelectorContext(editor: Editor) {\n const eventListeners = useRef<EditorChangeHandler[]>([]).current\n const slateRef = useRef<{\n editor: Editor\n }>({\n editor,\n }).current\n const onChange = useCallback(\n (editor: Editor) => {\n slateRef.editor = editor\n eventListeners.forEach((listener: EditorChangeHandler) =>\n listener(editor)\n )\n },\n [eventListeners, slateRef]\n )\n\n const selectorContext = useMemo(() => {\n return {\n getSlate: () => slateRef.editor,\n addEventListener: (callback: EditorChangeHandler) => {\n eventListeners.push(callback)\n return () => {\n eventListeners.splice(eventListeners.indexOf(callback), 1)\n }\n },\n }\n }, [eventListeners, slateRef])\n return { selectorContext, onChange }\n}\n","import React, { useCallback, useEffect, useState } from 'react'\nimport { Descendant, Editor, Node, Operation, Scrubber, Selection } from 'slate'\nimport { FocusedContext } from '../hooks/use-focused'\nimport { useIsomorphicLayoutEffect } from '../hooks/use-isomorphic-layout-effect'\nimport { SlateContext, SlateContextValue } from '../hooks/use-slate'\nimport {\n useSelectorContext,\n SlateSelectorContext,\n} from '../hooks/use-slate-selector'\nimport { EditorContext } from '../hooks/use-slate-static'\nimport { ReactEditor } from '../plugin/react-editor'\nimport { REACT_MAJOR_VERSION } from '../utils/environment'\nimport { EDITOR_TO_ON_CHANGE } from '../utils/weak-maps'\n\n/**\n * A wrapper around the provider to handle `onChange` events, because the editor\n * is a mutable singleton so it won't ever register as \"changed\" otherwise.\n */\n\nexport const Slate = (props: {\n editor: ReactEditor\n initialValue: Descendant[]\n children: React.ReactNode\n onChange?: (value: Descendant[]) => void\n onSelectionChange?: (selection: Selection) => void\n onValueChange?: (value: Descendant[]) => void\n}) => {\n const {\n editor,\n children,\n onChange,\n onSelectionChange,\n onValueChange,\n initialValue,\n ...rest\n } = props\n\n const [context, setContext] = React.useState<SlateContextValue>(() => {\n if (!Node.isNodeList(initialValue)) {\n throw new Error(\n `[Slate] initialValue is invalid! Expected a list of elements but got: ${Scrubber.stringify(\n initialValue\n )}`\n )\n }\n if (!Editor.isEditor(editor)) {\n throw new Error(\n `[Slate] editor is invalid! You passed: ${Scrubber.stringify(editor)}`\n )\n }\n editor.children = initialValue\n Object.assign(editor, rest)\n return { v: 0, editor }\n })\n\n const { selectorContext, onChange: handleSelectorChange } =\n useSelectorContext(editor)\n\n const onContextChange = useCallback(\n (options?: { operation?: Operation }) => {\n if (onChange) {\n onChange(editor.children)\n }\n\n switch (options?.operation?.type) {\n case 'set_selection':\n onSelectionChange?.(editor.selection)\n break\n default:\n onValueChange?.(editor.children)\n }\n\n setContext(prevContext => ({\n v: prevContext.v + 1,\n editor,\n }))\n handleSelectorChange(editor)\n },\n [editor, handleSelectorChange, onChange, onSelectionChange, onValueChange]\n )\n\n useEffect(() => {\n EDITOR_TO_ON_CHANGE.set(editor, onContextChange)\n\n return () => {\n EDITOR_TO_ON_CHANGE.set(editor, () => {})\n }\n }, [editor, onContextChange])\n\n const [isFocused, setIsFocused] = useState(ReactEditor.isFocused(editor))\n\n useEffect(() => {\n setIsFocused(ReactEditor.isFocused(editor))\n }, [editor])\n\n useIsomorphicLayoutEffect(() => {\n const fn = () => setIsFocused(ReactEditor.isFocused(editor))\n if (REACT_MAJOR_VERSION >= 17) {\n // In React >= 17 onFocus and onBlur listen to the focusin and focusout events during the bubbling phase.\n // Therefore in order for <Editable />'s handlers to run first, which is necessary for ReactEditor.isFocused(editor)\n // to return the correct value, we have to listen to the focusin and focusout events without useCapture here.\n document.addEventListener('focusin', fn)\n document.addEventListener('focusout', fn)\n return () => {\n document.removeEventListener('focusin', fn)\n document.removeEventListener('focusout', fn)\n }\n } else {\n document.addEventListener('focus', fn, true)\n document.addEventListener('blur', fn, true)\n return () => {\n document.removeEventListener('focus', fn, true)\n document.removeEventListener('blur', fn, true)\n }\n }\n }, [])\n\n return (\n <SlateSelectorContext.Provider value={selectorContext}>\n <SlateContext.Provider value={context}>\n <EditorContext.Provider value={context.editor}>\n <FocusedContext.Provider value={isFocused}>\n {children}\n </FocusedContext.Provider>\n </EditorContext.Provider>\n </SlateContext.Provider>\n </SlateSelectorContext.Provider>\n )\n}\n","import { useContext } from 'react'\n\nimport { EditorContext } from './use-slate-static'\n\n/**\n * Get the current editor object from the React context.\n * @deprecated Use useSlateStatic instead.\n */\n\nexport const useEditor = () => {\n const editor = useContext(EditorContext)\n\n if (!editor) {\n throw new Error(\n `The \\`useEditor\\` hook must be used inside the <Slate> component's context.`\n )\n }\n\n return editor\n}\n","import { BaseSelection, Range } from 'slate'\n\nimport { useSlateSelector } from './use-slate-selector'\n\n/**\n * Get the current slate selection.\n * Only triggers a rerender when the selection actually changes\n */\nexport const useSlateSelection = () => {\n return useSlateSelector(editor => editor.selection, isSelectionEqual)\n}\n\nconst isSelectionEqual = (a: BaseSelection, b: BaseSelection) => {\n if (!a && !b) return true\n if (!a || !b) return false\n return Range.equals(a, b)\n}\n","/**\n * Utilities for single-line deletion\n */\n\nimport { Editor, Range } from 'slate'\nimport { ReactEditor } from '../plugin/react-editor'\n\nconst doRectsIntersect = (rect: DOMRect, compareRect: DOMRect) => {\n const middle = (compareRect.top + compareRect.bottom) / 2\n\n return rect.top <= middle && rect.bottom >= middle\n}\n\nconst areRangesSameLine = (\n editor: ReactEditor,\n range1: Range,\n range2: Range\n) => {\n const rect1 = ReactEditor.toDOMRange(editor, range1).getBoundingClientRect()\n const rect2 = ReactEditor.toDOMRange(editor, range2).getBoundingClientRect()\n\n return doRectsIntersect(rect1, rect2) && doRectsIntersect(rect2, rect1)\n}\n\n/**\n * A helper utility that returns the end portion of a `Range`\n * which is located on a single line.\n *\n * @param {Editor} editor The editor object to compare against\n * @param {Range} parentRange The parent range to compare against\n * @returns {Range} A valid portion of the parentRange which is one a single line\n */\nexport const findCurrentLineRange = (\n editor: ReactEditor,\n parentRange: Range\n): Range => {\n const parentRangeBoundary = Editor.range(editor, Range.end(parentRange))\n const positions = Array.from(Editor.positions(editor, { at: parentRange }))\n\n let left = 0\n let right = positions.length\n let middle = Math.floor(right / 2)\n\n if (\n areRangesSameLine(\n editor,\n Editor.range(editor, positions[left]),\n parentRangeBoundary\n )\n ) {\n return Editor.range(editor, positions[left], parentRangeBoundary)\n }\n\n if (positions.length < 2) {\n return Editor.range(\n editor,\n positions[positions.length - 1],\n parentRangeBoundary\n )\n }\n\n while (middle !== positions.length && middle !== left) {\n if (\n areRangesSameLine(\n editor,\n Editor.range(editor, positions[middle]),\n parentRangeBoundary\n )\n ) {\n right = middle\n } else {\n left = middle\n }\n\n middle = Math.floor((left + right) / 2)\n }\n\n return Editor.range(editor, positions[right], parentRangeBoundary)\n}\n","import ReactDOM from 'react-dom'\nimport {\n BaseEditor,\n Editor,\n Element,\n Node,\n Operation,\n Path,\n PathRef,\n Point,\n Range,\n Transforms,\n} from 'slate'\nimport {\n TextDiff,\n transformPendingPoint,\n transformPendingRange,\n transformTextDiff,\n} from '../utils/diff-text'\nimport {\n getPlainText,\n getSlateFragmentAttribute,\n isDOMText,\n} from '../utils/dom'\nimport { Key } from '../utils/key'\nimport { findCurrentLineRange } from '../utils/lines'\nimport {\n EDITOR_TO_KEY_TO_ELEMENT,\n EDITOR_TO_ON_CHANGE,\n EDITOR_TO_PENDING_ACTION,\n EDITOR_TO_PENDING_DIFFS,\n EDITOR_TO_PENDING_INSERTION_MARKS,\n EDITOR_TO_PENDING_SELECTION,\n EDITOR_TO_SCHEDULE_FLUSH,\n EDITOR_TO_USER_MARKS,\n EDITOR_TO_USER_SELECTION,\n NODE_TO_KEY,\n} from '../utils/weak-maps'\nimport { ReactEditor } from './react-editor'\nimport { REACT_MAJOR_VERSION } from '../utils/environment'\n\n/**\n * `withReact` adds React and DOM specific behaviors to the editor.\n *\n * If you are using TypeScript, you must extend Slate's CustomTypes to use\n * this plugin.\n *\n * See https://docs.slatejs.org/concepts/11-typescript to learn how.\n */\n\nexport const withReact = <T extends BaseEditor>(\n editor: T,\n clipboardFormatKey = 'x-slate-fragment'\n): T & ReactEditor => {\n const e = editor as T & ReactEditor\n const { apply, onChange, deleteBackward, addMark, removeMark } = e\n\n // The WeakMap which maps a key to a specific HTMLElement must be scoped to the editor instance to\n // avoid collisions between editors in the DOM that share the same value.\n EDITOR_TO_KEY_TO_ELEMENT.set(e, new WeakMap())\n\n e.addMark = (key, value) => {\n EDITOR_TO_SCHEDULE_FLUSH.get(e)?.()\n\n if (\n !EDITOR_TO_PENDING_INSERTION_MARKS.get(e) &&\n EDITOR_TO_PENDING_DIFFS.get(e)?.length\n ) {\n // Ensure the current pending diffs originating from changes before the addMark\n // are applied with the current formatting\n EDITOR_TO_PENDING_INSERTION_MARKS.set(e, null)\n }\n\n EDITOR_TO_USER_MARKS.delete(e)\n\n addMark(key, value)\n }\n\n e.removeMark = key => {\n if (\n !EDITOR_TO_PENDING_INSERTION_MARKS.get(e) &&\n EDITOR_TO_PENDING_DIFFS.get(e)?.length\n ) {\n // Ensure the current pending diffs originating from changes before the addMark\n // are applied with the current formatting\n EDITOR_TO_PENDING_INSERTION_MARKS.set(e, null)\n }\n\n EDITOR_TO_USER_MARKS.delete(e)\n\n removeMark(key)\n }\n\n e.deleteBackward = unit => {\n if (unit !== 'line') {\n return deleteBackward(unit)\n }\n\n if (e.selection && Range.isCollapsed(e.selection)) {\n const parentBlockEntry = Editor.above(e, {\n match: n => Element.isElement(n) && Editor.isBlock(e, n),\n at: e.selection,\n })\n\n if (parentBlockEntry) {\n const [, parentBlockPath] = parentBlockEntry\n const parentElementRange = Editor.range(\n e,\n parentBlockPath,\n e.selection.anchor\n )\n\n const currentLineRange = findCurrentLineRange(e, parentElementRange)\n\n if (!Range.isCollapsed(currentLineRange)) {\n Transforms.delete(e, { at: currentLineRange })\n }\n }\n }\n }\n\n // This attempts to reset the NODE_TO_KEY entry to the correct value\n // as apply() changes the object reference and hence invalidates the NODE_TO_KEY entry\n e.apply = (op: Operation) => {\n const matches: [Path, Key][] = []\n const pathRefMatches: [PathRef, Key][] = []\n\n const pendingDiffs = EDITOR_TO_PENDING_DIFFS.get(e)\n if (pendingDiffs?.length) {\n const transformed = pendingDiffs\n .map(textDiff => transformTextDiff(textDiff, op))\n .filter(Boolean) as TextDiff[]\n\n EDITOR_TO_PENDING_DIFFS.set(e, transformed)\n }\n\n const pendingSelection = EDITOR_TO_PENDING_SELECTION.get(e)\n if (pendingSelection) {\n EDITOR_TO_PENDING_SELECTION.set(\n e,\n transformPendingRange(e, pendingSelection, op)\n )\n }\n\n const pendingAction = EDITOR_TO_PENDING_ACTION.get(e)\n if (pendingAction?.at) {\n const at = Point.isPoint(pendingAction?.at)\n ? transformPendingPoint(e, pendingAction.at, op)\n : transformPendingRange(e, pendingAction.at, op)\n\n EDITOR_TO_PENDING_ACTION.set(e, at ? { ...pendingAction, at } : null)\n }\n\n switch (op.type) {\n case 'insert_text':\n case 'remove_text':\n case 'set_node':\n case 'split_node': {\n matches.push(...getMatches(e, op.path))\n break\n }\n\n case 'set_selection': {\n // Selection was manually set, don't restore the user selection after the change.\n EDITOR_TO_USER_SELECTION.get(e)?.unref()\n EDITOR_TO_USER_SELECTION.delete(e)\n break\n }\n\n case 'insert_node':\n case 'remove_node': {\n matches.push(...getMatches(e, Path.parent(op.path)))\n break\n }\n\n case 'merge_node': {\n const prevPath = Path.previous(op.path)\n matches.push(...getMatches(e, prevPath))\n break\n }\n\n case 'move_node': {\n const commonPath = Path.common(\n Path.parent(op.path),\n Path.parent(op.newPath)\n )\n matches.push(...getMatches(e, commonPath))\n\n let changedPath: Path\n if (Path.isBefore(op.path, op.newPath)) {\n matches.push(...getMatches(e, Path.parent(op.path)))\n changedPath = op.newPath\n } else {\n matches.push(...getMatches(e, Path.parent(op.newPath)))\n changedPath = op.path\n }\n\n const changedNode = Node.get(editor, Path.parent(changedPath))\n const changedNodeKey = ReactEditor.findKey(e, changedNode)\n const changedPathRef = Editor.pathRef(e, Path.parent(changedPath))\n pathRefMatches.push([changedPathRef, changedNodeKey])\n\n break\n }\n }\n\n apply(op)\n\n for (const [path, key] of matches) {\n const [node] = Editor.node(e, path)\n NODE_TO_KEY.set(node, key)\n }\n\n for (const [pathRef, key] of pathRefMatches) {\n if (pathRef.current) {\n const [node] = Editor.node(e, pathRef.current)\n NODE_TO_KEY.set(node, key)\n }\n\n pathRef.unref()\n }\n }\n\n e.setFragmentData = (data: Pick<DataTransfer, 'getData' | 'setData'>) => {\n const { selection } = e\n\n if (!selection) {\n return\n }\n\n const [start, end] = Range.edges(selection)\n const startVoid = Editor.void(e, { at: start.path })\n const endVoid = Editor.void(e, { at: end.path })\n\n if (Range.isCollapsed(selection) && !startVoid) {\n return\n }\n\n // Create a fake selection so that we can add a Base64-encoded copy of the\n // fragment to the HTML, to decode on future pastes.\n const domRange = ReactEditor.toDOMRange(e, selection)\n let contents = domRange.cloneContents()\n let attach = contents.childNodes[0] as HTMLElement\n\n // Make sure attach is non-empty, since empty nodes will not get copied.\n contents.childNodes.forEach(node => {\n if (node.textContent && node.textContent.trim() !== '') {\n attach = node as HTMLElement\n }\n })\n\n // COMPAT: If the end node is a void node, we need to move the end of the\n // range from the void node's spacer span, to the end of the void node's\n // content, since the spacer is before void's content in the DOM.\n if (endVoid) {\n const [voidNode] = endVoid\n const r = domRange.cloneRange()\n const domNode = ReactEditor.toDOMNode(e, voidNode)\n r.setEndAfter(domNode)\n contents = r.cloneContents()\n }\n\n // COMPAT: If the start node is a void node, we need to attach the encoded\n // fragment to the void node's content node instead of the spacer, because\n // attaching it to empty `<div>/<span>` nodes will end up having it erased by\n // most browsers. (2018/04/27)\n if (startVoid) {\n attach = contents.querySelector('[data-slate-spacer]')! as HTMLElement\n }\n\n // Remove any zero-width space spans from the cloned DOM so that they don't\n // show up elsewhere when pasted.\n Array.from(contents.querySelectorAll('[data-slate-zero-width]')).forEach(\n zw => {\n const isNewline = zw.getAttribute('data-slate-zero-width') === 'n'\n zw.textContent = isNewline ? '\\n' : ''\n }\n )\n\n // Set a `data-slate-fragment` attribute on a non-empty node, so it shows up\n // in the HTML, and can be used for intra-Slate pasting. If it's a text\n // node, wrap it in a `<span>` so we have something to set an attribute on.\n if (isDOMText(attach)) {\n const span = attach.ownerDocument.createElement('span')\n // COMPAT: In Chrome and Safari, if we don't add the `white-space` style\n // then leading and trailing spaces will be ignored. (2017/09/21)\n span.style.whiteSpace = 'pre'\n span.appendChild(attach)\n contents.appendChild(span)\n attach = span\n }\n\n const fragment = e.getFragment()\n const string = JSON.stringify(fragment)\n const encoded = window.btoa(encodeURIComponent(string))\n attach.setAttribute('data-slate-fragment', encoded)\n data.setData(`application/${clipboardFormatKey}`, encoded)\n\n // Add the content to a <div> so that we can get its inner HTML.\n const div = contents.ownerDocument.createElement('div')\n div.appendChild(contents)\n div.setAttribute('hidden', 'true')\n contents.ownerDocument.body.appendChild(div)\n data.setData('text/html', div.innerHTML)\n data.setData('text/plain', getPlainText(div))\n contents.ownerDocument.body.removeChild(div)\n return data\n }\n\n e.insertData = (data: DataTransfer) => {\n if (!e.insertFragmentData(data)) {\n e.insertTextData(data)\n }\n }\n\n e.insertFragmentData = (data: DataTransfer): boolean => {\n /**\n * Checking copied fragment from application/x-slate-fragment or data-slate-fragment\n */\n const fragment =\n data.getData(`application/${clipboardFormatKey}`) ||\n getSlateFragmentAttribute(data)\n\n if (fragment) {\n const decoded = decodeURIComponent(window.atob(fragment))\n const parsed = JSON.parse(decoded) as Node[]\n e.insertFragment(parsed)\n return true\n }\n return false\n }\n\n e.insertTextData = (data: DataTransfer): boolean => {\n const text = data.getData('text/plain')\n\n if (text) {\n const lines = text.split(/\\r\\n|\\r|\\n/)\n let split = false\n\n for (const line of lines) {\n if (split) {\n Transforms.splitNodes(e, { always: true })\n }\n\n e.insertText(line)\n split = true\n }\n return true\n }\n return false\n }\n\n e.onChange = options => {\n // COMPAT: React < 18 doesn't batch `setState` hook calls, which means\n // that the children and selection can get out of sync for one render\n // pass. So we have to use this unstable API to ensure it batches them.\n // (2019/12/03)\n // https://github.com/facebook/react/issues/14259#issuecomment-439702367\n const maybeBatchUpdates =\n REACT_MAJOR_VERSION < 18\n ? ReactDOM.unstable_batchedUpdates\n : (callback: () => void) => callback()\n\n maybeBatchUpdates(() => {\n const onContextChange = EDITOR_TO_ON_CHANGE.get(e)\n\n if (onContextChange) {\n onContextChange(options)\n }\n\n onChange(options)\n })\n }\n\n return e\n}\n\nconst getMatches = (e: Editor, path: Path) => {\n const matches: [Path, Key][] = []\n for (const [n, p] of Editor.levels(e, { at: path })) {\n const key = ReactEditor.findKey(e, n)\n matches.push([p, key])\n }\n return matches\n}\n"],"names":["require$$0","EditorContext","createContext","useSlateStatic","editor","useContext","Error","REACT_MAJOR_VERSION","parseInt","React","version","split","IS_IOS","navigator","window","test","userAgent","MSStream","IS_APPLE","IS_ANDROID","IS_FIREFOX","IS_WEBKIT","IS_EDGE_LEGACY","IS_CHROME","IS_CHROME_LEGACY","IS_ANDROID_CHROME_LEGACY","IS_FIREFOX_LEGACY","IS_UC_MOBILE","IS_WECHATBROWSER","CAN_USE_DOM","document","createElement","_navigator$userAgent$","match","_navigator$userAgent$2","HAS_BEFORE_INPUT_SUPPORT","globalThis","InputEvent","prototype","getTargetRanges","NODE_TO_INDEX","WeakMap","NODE_TO_PARENT","EDITOR_TO_WINDOW","EDITOR_TO_ELEMENT","EDITOR_TO_PLACEHOLDER_ELEMENT","ELEMENT_TO_NODE","NODE_TO_ELEMENT","NODE_TO_KEY","EDITOR_TO_KEY_TO_ELEMENT","IS_READ_ONLY","IS_FOCUSED","IS_COMPOSING","EDITOR_TO_USER_SELECTION","EDITOR_TO_ON_CHANGE","EDITOR_TO_SCHEDULE_FLUSH","EDITOR_TO_PENDING_INSERTION_MARKS","EDITOR_TO_USER_MARKS","EDITOR_TO_PENDING_DIFFS","EDITOR_TO_PENDING_ACTION","EDITOR_TO_PENDING_SELECTION","EDITOR_TO_FORCE_RENDER","PLACEHOLDER_SYMBOL","Symbol","MARK_PLACEHOLDER_SYMBOL","DOMNode","Node","DOMText","Text","getDefaultView","value","ownerDocument","defaultView","isDOMComment","isDOMNode","nodeType","isDOMElement","isDOMSelection","anchorNode","Selection","isDOMText","isPlainTextOnlyPaste","event","clipboardData","getData","types","length","normalizeDOMPoint","domPoint","_domPoint","_slicedToArray","node","offset","childNodes","isLast","index","_getEditableChildAndI","getEditableChildAndIndex","_getEditableChildAndI2","i","getEditableChild","textContent","hasShadowRoot","parent","parentNode","toString","direction","child","triedForward","triedBackward","getAttribute","_getEditableChildAndI3","_getEditableChildAndI4","getPlainText","domNode","text","nodeValue","_i","_Array$from","Array","from","childNode","display","getComputedStyle","getPropertyValue","tagName","catchSlateFragment","getSlateFragmentAttribute","dataTransfer","htmlData","_ref","_ref2","fragment","getSelection","root","isTrackedMutation","mutation","batch","target","matches","_ReactEditor$getWindo","ReactEditor","getWindow","contains","hasDOMNode","editable","parentMutation","find","_ref3","addedNodes","removedNodes","_iterator","_createForOfIteratorHelper","_step","s","n","done","err","e","f","_iterator2","_step2","getActiveElement","activeElement","_activeElement","shadowRoot","_activeElement$shadow","_activeElement2","isBefore","otherNode","Boolean","compareDocumentPosition","DOCUMENT_POSITION_PRECEDING","isAfter","DOCUMENT_POSITION_FOLLOWING","Key","_createClass","_classCallCheck","_defineProperty","id","concat","androidPendingDiffs","get","androidScheduleFlush","_EDITOR_TO_SCHEDULE_F","blur","el","toDOMNode","findDocumentOrShadowRoot","set","deselect","selection","domSelection","rangeCount","removeAllRanges","Transforms","getRootNode","Document","ShadowRoot","findEventRange","nativeEvent","_event","x","clientX","y","clientY","toSlateNode","path","findPath","Element","isElement","Editor","isVoid","rect","getBoundingClientRect","isPrev","isInline","left","width","top","height","edge","point","before","after","range","domRange","caretRangeFromPoint","position","caretPositionFromPoint","createRange","setStart","offsetNode","setEnd","toSlateRange","exactMatch","suppressThrow","findKey","key","isEditor","unshift","Scrubber","stringify","focus","options","arguments","undefined","retries","operations","setTimeout","toDOMRange","addRange","select","start","preventScroll","_options$editable","editorEl","targetEl","parentElement","message","includes","closest","isContentEditable","hasEditableTarget","hasRange","anchor","hasPath","hasSelectableTarget","isTargetInsideNonReadonlyVoid","hasTarget","insertData","data","insertFragmentData","insertTextData","isComposing","isFocused","isReadOnly","slateNode","setFragmentData","originEvent","KEY_TO_ELEMENT","toDOMPoint","_Editor$node","_Editor$node2","at","selector","texts","querySelectorAll","attr","trueLength","end","nextText","hasAttribute","_nextText$textContent","domText","startsWith","Math","min","max","isBackward","Range","domAnchor","domFocus","isCollapsed","startNode","startOffset","_ref4","endNode","endOffset","startEl","isStartAtZeroWidth","endEl","isEndAtZeroWidth","domEl","toSlatePoint","_options$searchDirect","searchDirection","_ref5","_ref6","nearestNode","nearestOffset","textNode","_domNode$textContent","_domNode$textContent2","potentialVoidNode","voidNode","potentialNonEditableNode","nonEditableNode","leafNode","contents","cloneContents","removals","_toConsumableArray","slice","call","forEach","textContext","removeChild","leafNodes","current","getLeafNodes","elementNode","_leafNodes$find","nextElementSibling","leaf","_leafNodes2$findLast","previousElementSibling","findLast","endsWith","_Editor$start","querySelector","_focusNode$textConten","startContainer","anchorOffset","focusNode","focusOffset","firstRange","getRangeAt","lastRange","HTMLTableRowElement","getLastChildren","element","childElementCount","children","firstNodeRow","lastNodeRow","firstNode","lastNode","HTMLElement","innerHTML","endContainer","collapsed","focusBeforeAnchor","isExpanded","isForward","mode","unhangRange","voids","verifyDiffState","textDiff","diff","isText","nextPath","Path","next","nextNode","applyStringDiff","_len","diffs","_key","reduce","longestCommonPrefixLength","str","another","charAt","longestCommonSuffixLength","normalizeStringDiff","targetText","removedText","prefixLength","suffixLength","normalized","mergeStringDiffs","a","b","overlap","applied","sliceEnd","targetRange","normalizePoint","parentBlock","above","isBlock","entry","isDescendant","normalizeRange","transformPendingPoint","op","pendingDiffs","equals","Point","transform","affinity","transformed","type","transformPendingRange","transformTextDiff","newPath","RESOLVE_DELAY","FLUSH_DELAY","debug","isDataTransfer","constructor","name","createAndroidInputManager","scheduleOnDOMSelectionChange","onDOMSelectionChange","flushing","compositionEndTimeoutId","flushTimeoutId","actionTimeoutId","idCounter","insertPositionHint","applyPendingSelection","pendingSelection","performAction","action","isPoint","run","flush","clearTimeout","hasPendingDiffs","hasPendingAction","selectionRef","rangeRef","marks","scheduleSelectionChange","_EDITOR_TO_PENDING_DI","_EDITOR_TO_PENDING_DI2","pendingMarks","insertText","deleteFragment","filter","cancel","unref","userMarks","onChange","handleCompositionEnd","handleCompositionStart","updatePlaceholderVisibility","forceHide","placeholderElement","style","removeProperty","storeDiff","_EDITOR_TO_PENDING_DI3","idx","findIndex","change","push","merged","splice","_objectSpread","scheduleAction","handleDOMBeforeInput","_targetRange2","inputType","_event$getTargetRange","_event$getTargetRange2","nativeTargetRange","canStoreDiff","_Range$edges","edges","_Range$edges2","_Range$edges3","_Range$edges4","_Editor$leaf","_Editor$leaf2","relevantPendingDiffs","apply","handleUserSelect","_targetRange3","targetNode","deleteForward","_nativeTargetRange","_targetRange4","nativeCollapsed","deleteBackward","unit","insertSoftBreak","insertBreak","replace","parts","line","_Range$edges5","_Range$edges6","hintPosition","search","diffPosition","scheduleFlush","_EDITOR_TO_PENDING_DI4","hasPendingChanges","isFlushing","pathChanged","parentPathChanged","handleInput","handleKeyDown","_","handleDomMutations","mutations","some","_EDITOR_TO_FORCE_REND","useIsMounted","isMountedRef","useRef","useEffect","useIsomorphicLayoutEffect","useLayoutEffect","useMutationObserver","callback","_useState","useState","MutationObserver","_useState2","mutationObserver","takeRecords","observe","disconnect","MUTATION_OBSERVER_CONFIG","subtree","childList","characterData","useAndroidInputManager","_objectWithoutProperties","_excluded","isMounted","inputManager","shallowCompare","obj1","obj2","Object","keys","every","hasOwnProperty","isDecorationFlagsEqual","other","rangeOwnProps","otherOwnProps","_excluded2","isElementDecorationsEqual","list","isTextDecorationsEqual","String","props","parentPath","isMarkPlaceholder","ZeroWidthString","string","isLineBreak","TextString","isTrailing","_props$isTrailing","ref","getTextContent","initialText","textWithTrailing","MemoizedText","memo","forwardRef","_props$length","_props$isLineBreak","_props$isMarkPlacehol","attributes","PLACEHOLDER_DELAY","disconnectPlaceholderResizeObserver","placeholderResizeObserver","releaseObserver","clearTimeoutRef","timeoutRef","Leaf","renderPlaceholder","_props$renderLeaf","renderLeaf","DefaultLeaf","placeholderRef","showPlaceholder","setShowPlaceholder","showPlaceholderTimeoutRef","callbackPlaceholderRef","useCallback","placeholderEl","_leaf$onPlaceholderRe","onPlaceholderResize","ResizeObserver","ResizeObserverPolyfill","_leaf$onPlaceholderRe2","leafIsPlaceholder","placeholderProps","placeholder","pointerEvents","maxWidth","opacity","userSelect","textDecoration","WebkitUserModify","contentEditable","Fragment","MemoizedLeaf","prev","decorations","leaves","SlateText","callbackRef","span","_props$renderElement","renderElement","p","DefaultElement","readOnly","useReadOnly","useChildren","hasInlines","dir","getDirection","Tag","_Node$texts","_Node$texts2","_Node$texts2$","color","outline","MemoizedElement","DecorateContext","useDecorate","SelectedContext","useSelected","decorate","isLeafBlock","sel","intersection","ds","dec","d","Provider","ElementComponent","TextComponent","ReadOnlyContext","SlateContext","useSlate","context","useSlateWithV","useTrackUserInput","receivedUserInput","animationFrameIdRef","onUserInput","cancelAnimationFrame","requestAnimationFrame","TRIPLE_CLICK","HOTKEYS","bold","compose","moveBackward","moveForward","moveWordBackward","moveWordForward","extendBackward","extendForward","italic","splitBlock","undo","APPLE_HOTKEYS","moveLineBackward","moveLineForward","deleteLineBackward","deleteLineForward","deleteWordBackward","deleteWordForward","extendLineBackward","extendLineForward","redo","transposeCharacter","WINDOWS_HOTKEYS","create","generic","apple","windows","isGeneric","isHotkey","isApple","isWindows","isBold","isCompose","isMoveBackward","isMoveForward","isDeleteBackward","isDeleteForward","isDeleteLineBackward","isDeleteLineForward","isDeleteWordBackward","isDeleteWordForward","isExtendBackward","isExtendForward","isExtendLineBackward","isExtendLineForward","isItalic","isMoveLineBackward","isMoveLineForward","isMoveWordBackward","isMoveWordForward","isRedo","isSoftBreak","isSplitBlock","isTransposeCharacter","isUndo","createRestoreDomManager","bufferedMutations","clear","registerMutations","_bufferedMutations","trackedMutations","restoreDOM","reverse","insertBefore","nextSibling","characterDataOldValue","RestoreDOMComponent","_Component","_inherits","_super","_createSuper","_this","args","_assertThisInitialized","_this$mutationObserve","componentDidMount","manager","getSnapshotBeforeUpdate","_this$mutationObserve2","_this$mutationObserve3","_this$manager2","pendingMutations","_this$manager","componentDidUpdate","_this$manager3","componentWillUnmount","_this$mutationObserve4","render","Component","RestoreDOM","ComposingContext","useComposing","Children","Editable","forwardedRef","defaultRenderPlaceholder","DefaultPlaceholder","autoFocus","_props$decorate","defaultDecorate","propsOnDOMBeforeInput","onDOMBeforeInput","_props$readOnly","_props$renderPlacehol","_props$scrollSelectio","scrollSelectionIntoView","defaultScrollSelectionIntoView","_props$style","userStyle","_props$as","as","_props$disableDefault","disableDefaultStyles","setIsComposing","deferredOperations","_useState3","_useState4","placeholderHeight","setPlaceholderHeight","processing","_useTrackUserInput","_useReducer","useReducer","_useReducer2","forceRender","state","useMemo","isDraggingInternally","isUpdatingSelection","latestElement","hasMarkPlaceholder","androidInputManagerRef","throttle","active","execCommand","androidInputManager","anchorNodeSelectable","focusNodeInEditor","debounce","_androidInputManagerR","_androidInputManagerR2","setDomSelection","forceChange","hasDomSelection","editorElement","hasDomSelectionInEditor","slateRange","_anchorNode","newDomRange","collapseToEnd","setBaseAndExtent","ensureSelection","timeoutId","animationFrameId","ensureDomSelection","ranges","newRange","preventDefault","stopImmediatePropagation","isDOMEventHandled","_EDITOR_TO_USER_SELEC","isCompositionChange","native","_node$parentElement","_window$getComputedSt","_ReactEditor$toDOMPoi","_ReactEditor$toDOMPoi2","_lastText$textContent","lastText","createTreeWalker","NodeFilter","SHOW_TEXT","lastChild","whiteSpace","block","toRestore","removeEventListener","addEventListener","stoppedDragging","placeHolderResizeHandler","_placeholderEl$getBou","_decorations$push","rest","loose","unset","fromEntries","map","mark","role","spellCheck","autoCorrect","autoCapitalize","zindex","suppressContentEditableWarning","wordWrap","minHeight","onBeforeInput","isEventHandled","onInput","maybeHistoryEditor","onBlur","relatedTarget","onClick","detail","blockPath","_block$","startVoid","endVoid","onCompositionEnd","_androidInputManagerR3","Promise","resolve","then","placeholderMarks","onCompositionUpdate","onCompositionStart","_androidInputManagerR4","onCopy","isDOMEventTargetInput","onCut","onDragOver","onDragStart","voidMatch","onDrop","draggedRange","onDragEnd","onFocus","onKeyDown","_androidInputManagerR5","isRTL","Hotkeys","move","collapse","currentNode","onPaste","leafEl","bind","scrollIntoView","scrollMode","handler","shouldTreatEventAsHandled","isDefaultPrevented","isPropagationStopped","HTMLInputElement","HTMLTextAreaElement","defaultPrevented","FocusedContext","useFocused","isError","error","SlateSelectorContext","refEquality","useSlateSelector","equalityFn","getSlate","latestSubscriptionCallbackError","latestSelector","latestSelectedState","selectedState","stack","checkForUpdates","newSelectedState","unsubscribe","useSelectorContext","eventListeners","slateRef","listener","selectorContext","indexOf","Slate","onSelectionChange","onValueChange","initialValue","_React$useState","isNodeList","assign","v","_React$useState2","setContext","_useSelectorContext","handleSelectorChange","onContextChange","_options$operation","operation","prevContext","setIsFocused","fn","useEditor","useSlateSelection","isSelectionEqual","doRectsIntersect","compareRect","middle","bottom","areRangesSameLine","range1","range2","rect1","rect2","findCurrentLineRange","parentRange","parentRangeBoundary","positions","right","floor","withReact","clipboardFormatKey","addMark","removeMark","parentBlockEntry","_parentBlockEntry","parentBlockPath","parentElementRange","currentLineRange","pathRefMatches","pendingAction","getMatches","prevPath","previous","commonPath","common","changedPath","changedNode","changedNodeKey","changedPathRef","pathRef","_matches","_matches$_i","_i2","_pathRefMatches","_pathRefMatches$_i","_Editor$node3","_Editor$node4","attach","trim","_endVoid","r","cloneRange","setEndAfter","zw","isNewline","appendChild","getFragment","JSON","encoded","btoa","encodeURIComponent","setAttribute","setData","div","body","decoded","decodeURIComponent","atob","parsed","parse","insertFragment","lines","splitNodes","always","maybeBatchUpdates","ReactDOM","unstable_batchedUpdates","levels","_step2$value"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,eAAe,CAAC,GAAG,EAAE;AAC9B,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC;AACrC,CAAC;AACD,MAAA,CAAA,OAAc,GAAG,eAAe,EAAE,MAAyB,CAAA,OAAA,CAAA,UAAA,GAAG,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,CAAA;;;;;;ACH9G,SAAS,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAAE;AACrC,EAAE,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,IAAI,GAAG,WAAW,IAAI,OAAO,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC;AACnG,EAAE,IAAI,IAAI,IAAI,CAAC,EAAE;AACjB,IAAI,IAAI,CAAC;AACT,MAAM,CAAC;AACP,MAAM,CAAC;AACP,MAAM,CAAC;AACP,MAAM,CAAC,GAAG,EAAE;AACZ,MAAM,CAAC,GAAG,CAAC,CAAC;AACZ,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACb,IAAI,IAAI;AACR,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,CAA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AAS,EAAEiD,IAAU,EAAI;EAC3C,IAAMpE,OAAO,GAAkB,EAAE,CAAA;EAAA,IAAAqB,UAAA,GAAAR,0BAAA,CACZ2D,YAAM,CAAC8zB,MAAM,CAACn3B,CAAC,EAAE;AAAE8H,MAAAA,EAAE,EAAE7E,IAAAA;AAAI,KAAE,CAAC,CAAA;IAAA9C,MAAA,CAAA;AAAA,EAAA,IAAA;IAAnD,KAAAD,UAAA,CAAAN,CAAA,EAAAO,EAAAA,CAAAA,CAAAA,MAAA,GAAAD,UAAA,CAAAL,CAAA,EAAAC,EAAAA,IAAA,GAAqD;AAAA,MAAA,IAAAs3B,YAAA,GAAAx7B,cAAA,CAAAuE,MAAA,CAAA3F,KAAA,EAAA,CAAA,CAAA;AAAzCqF,QAAAA,CAAC,GAAAu3B,YAAA,CAAA,CAAA,CAAA;AAAEtZ,QAAAA,CAAC,GAAAsZ,YAAA,CAAA,CAAA,CAAA,CAAA;MACd,IAAMpyB,GAAG,GAAGjG,WAAW,CAACgG,OAAO,CAAC/E,CAAC,EAAEH,CAAC,CAAC,CAAA;MACrChB,OAAO,CAACoV,IAAI,CAAC,CAAC6J,CAAC,EAAE9Y,GAAG,CAAC,CAAC,CAAA;AACvB,KAAA;AAAA,GAAA,CAAA,OAAAjF,GAAA,EAAA;IAAAG,UAAA,CAAAF,CAAA,CAAAD,GAAA,CAAA,CAAA;AAAA,GAAA,SAAA;AAAAG,IAAAA,UAAA,CAAAD,CAAA,EAAA,CAAA;AAAA,GAAA;AACD,EAAA,OAAOpB,OAAO,CAAA;AAChB,CAAC;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,15,16,17,18,20,21,43,44,45,46,47]}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/arrayWithHoles.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/arrayLikeToArray.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/nonIterableRest.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/slicedToArray.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/objectWithoutProperties.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/typeof.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/toPrimitive.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/toPropertyKey.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/defineProperty.js","../src/hooks/use-slate-static.tsx","../src/utils/environment.ts","../src/utils/weak-maps.ts","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/iterableToArray.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/nonIterableSpread.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/toConsumableArray.js","../src/utils/dom.ts","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/createClass.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/classCallCheck.js","../src/utils/key.ts","../src/plugin/react-editor.ts","../src/utils/diff-text.ts","../src/hooks/android-input-manager/android-input-manager.ts","../src/hooks/use-is-mounted.tsx","../src/hooks/use-isomorphic-layout-effect.ts","../src/hooks/use-mutation-observer.ts","../src/hooks/android-input-manager/use-android-input-manager.ts","../src/utils/range-list.ts","../src/components/string.tsx","../src/components/leaf.tsx","../src/components/text.tsx","../src/components/element.tsx","../src/hooks/use-decorate.ts","../src/hooks/use-selected.ts","../src/hooks/use-children.tsx","../src/hooks/use-read-only.ts","../src/hooks/use-slate.tsx","../src/hooks/use-track-user-input.ts","../src/utils/constants.ts","../src/utils/hotkeys.ts","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/assertThisInitialized.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/setPrototypeOf.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/inherits.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/getPrototypeOf.js","../src/components/restore-dom/restore-dom-manager.ts","../src/components/restore-dom/restore-dom.tsx","../src/hooks/use-composing.ts","../src/components/editable.tsx","../src/hooks/use-focused.ts","../src/hooks/use-slate-selector.tsx","../src/components/slate.tsx","../src/hooks/use-editor.tsx","../src/hooks/use-slate-selection.tsx","../src/utils/lines.ts","../src/plugin/with-react.ts"],"sourcesContent":["function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\nmodule.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\nmodule.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nmodule.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\nmodule.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nmodule.exports = _nonIterableRest, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayWithHoles = require(\"./arrayWithHoles.js\");\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit.js\");\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\nvar nonIterableRest = require(\"./nonIterableRest.js\");\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\nmodule.exports = _slicedToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nmodule.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var objectWithoutPropertiesLoose = require(\"./objectWithoutPropertiesLoose.js\");\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nmodule.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nmodule.exports = _toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}\nmodule.exports = _toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","import { createContext, useContext } from 'react'\nimport { Editor } from 'slate'\nimport { ReactEditor } from '../plugin/react-editor'\n\n/**\n * A React context for sharing the editor object.\n */\n\nexport const EditorContext = createContext<ReactEditor | null>(null)\n\n/**\n * Get the current editor object from the React context.\n */\n\nexport const useSlateStatic = (): Editor => {\n const editor = useContext(EditorContext)\n\n if (!editor) {\n throw new Error(\n `The \\`useSlateStatic\\` hook must be used inside the <Slate> component's context.`\n )\n }\n\n return editor\n}\n","import React from 'react'\n\nexport const REACT_MAJOR_VERSION = parseInt(React.version.split('.')[0], 10)\n\nexport const IS_IOS =\n typeof navigator !== 'undefined' &&\n typeof window !== 'undefined' &&\n /iPad|iPhone|iPod/.test(navigator.userAgent) &&\n !window.MSStream\n\nexport const IS_APPLE =\n typeof navigator !== 'undefined' && /Mac OS X/.test(navigator.userAgent)\n\nexport const IS_ANDROID =\n typeof navigator !== 'undefined' && /Android/.test(navigator.userAgent)\n\nexport const IS_FIREFOX =\n typeof navigator !== 'undefined' &&\n /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent)\n\nexport const IS_WEBKIT =\n typeof navigator !== 'undefined' &&\n /AppleWebKit(?!.*Chrome)/i.test(navigator.userAgent)\n\n// \"modern\" Edge was released at 79.x\nexport const IS_EDGE_LEGACY =\n typeof navigator !== 'undefined' &&\n /Edge?\\/(?:[0-6][0-9]|[0-7][0-8])(?:\\.)/i.test(navigator.userAgent)\n\nexport const IS_CHROME =\n typeof navigator !== 'undefined' && /Chrome/i.test(navigator.userAgent)\n\n// Native `beforeInput` events don't work well with react on Chrome 75\n// and older, Chrome 76+ can use `beforeInput` though.\nexport const IS_CHROME_LEGACY =\n typeof navigator !== 'undefined' &&\n /Chrome?\\/(?:[0-7][0-5]|[0-6][0-9])(?:\\.)/i.test(navigator.userAgent)\n\nexport const IS_ANDROID_CHROME_LEGACY =\n IS_ANDROID &&\n typeof navigator !== 'undefined' &&\n /Chrome?\\/(?:[0-5]?\\d)(?:\\.)/i.test(navigator.userAgent)\n\n// Firefox did not support `beforeInput` until `v87`.\nexport const IS_FIREFOX_LEGACY =\n typeof navigator !== 'undefined' &&\n /^(?!.*Seamonkey)(?=.*Firefox\\/(?:[0-7][0-9]|[0-8][0-6])(?:\\.)).*/i.test(\n navigator.userAgent\n )\n\n// UC mobile browser\nexport const IS_UC_MOBILE =\n typeof navigator !== 'undefined' && /.*UCBrowser/.test(navigator.userAgent)\n\n// Wechat browser (not including mac wechat)\nexport const IS_WECHATBROWSER =\n typeof navigator !== 'undefined' &&\n /.*Wechat/.test(navigator.userAgent) &&\n !/.*MacWechat/.test(navigator.userAgent) // avoid lookbehind (buggy in safari < 16.4)\n\n// Check if DOM is available as React does internally.\n// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js\nexport const CAN_USE_DOM = !!(\n typeof window !== 'undefined' &&\n typeof window.document !== 'undefined' &&\n typeof window.document.createElement !== 'undefined'\n)\n\n// Check if the browser is Safari and older than 17\nexport const IS_SAFARI_LEGACY =\n typeof navigator !== 'undefined' &&\n /Safari/.test(navigator.userAgent) &&\n /Version\\/(\\d+)/.test(navigator.userAgent) &&\n (navigator.userAgent.match(/Version\\/(\\d+)/)?.[1]\n ? parseInt(navigator.userAgent.match(/Version\\/(\\d+)/)?.[1]!, 10) < 17\n : false)\n\n// COMPAT: Firefox/Edge Legacy don't support the `beforeinput` event\n// Chrome Legacy doesn't support `beforeinput` correctly\nexport const HAS_BEFORE_INPUT_SUPPORT =\n (!IS_CHROME_LEGACY || !IS_ANDROID_CHROME_LEGACY) &&\n !IS_EDGE_LEGACY &&\n // globalThis is undefined in older browsers\n typeof globalThis !== 'undefined' &&\n globalThis.InputEvent &&\n // @ts-ignore The `getTargetRanges` property isn't recognized.\n typeof globalThis.InputEvent.prototype.getTargetRanges === 'function'\n","import { Ancestor, Editor, Node, Operation, Range, RangeRef, Text } from 'slate'\nimport { Action } from '../hooks/android-input-manager/android-input-manager'\nimport { TextDiff } from './diff-text'\nimport { Key } from './key'\n\n/**\n * Two weak maps that allow us rebuild a path given a node. They are populated\n * at render time such that after a render occurs we can always backtrack.\n */\nexport const IS_NODE_MAP_DIRTY: WeakMap<Editor, boolean> = new WeakMap()\nexport const NODE_TO_INDEX: WeakMap<Node, number> = new WeakMap()\nexport const NODE_TO_PARENT: WeakMap<Node, Ancestor> = new WeakMap()\n\n/**\n * Weak maps that allow us to go between Slate nodes and DOM nodes. These\n * are used to resolve DOM event-related logic into Slate actions.\n */\nexport const EDITOR_TO_WINDOW: WeakMap<Editor, Window> = new WeakMap()\nexport const EDITOR_TO_ELEMENT: WeakMap<Editor, HTMLElement> = new WeakMap()\nexport const EDITOR_TO_PLACEHOLDER: WeakMap<Editor, string> = new WeakMap()\nexport const EDITOR_TO_PLACEHOLDER_ELEMENT: WeakMap<Editor, HTMLElement> =\n new WeakMap()\nexport const ELEMENT_TO_NODE: WeakMap<HTMLElement, Node> = new WeakMap()\nexport const NODE_TO_ELEMENT: WeakMap<Node, HTMLElement> = new WeakMap()\nexport const NODE_TO_KEY: WeakMap<Node, Key> = new WeakMap()\nexport const EDITOR_TO_KEY_TO_ELEMENT: WeakMap<\n Editor,\n WeakMap<Key, HTMLElement>\n> = new WeakMap()\n\n/**\n * Weak maps for storing editor-related state.\n */\n\nexport const IS_READ_ONLY: WeakMap<Editor, boolean> = new WeakMap()\nexport const IS_FOCUSED: WeakMap<Editor, boolean> = new WeakMap()\nexport const IS_COMPOSING: WeakMap<Editor, boolean> = new WeakMap()\n\nexport const EDITOR_TO_USER_SELECTION: WeakMap<Editor, RangeRef | null> =\n new WeakMap()\n\n/**\n * Weak map for associating the context `onChange` context with the plugin.\n */\n\nexport const EDITOR_TO_ON_CHANGE = new WeakMap<\n Editor,\n (options?: { operation?: Operation }) => void\n>()\n\n/**\n * Weak maps for saving pending state on composition stage.\n */\n\nexport const EDITOR_TO_SCHEDULE_FLUSH: WeakMap<Editor, () => void> =\n new WeakMap()\n\nexport const EDITOR_TO_PENDING_INSERTION_MARKS: WeakMap<\n Editor,\n Partial<Text> | null\n> = new WeakMap()\n\nexport const EDITOR_TO_USER_MARKS: WeakMap<Editor, Partial<Text> | null> =\n new WeakMap()\n\n/**\n * Android input handling specific weak-maps\n */\n\nexport const EDITOR_TO_PENDING_DIFFS: WeakMap<Editor, TextDiff[]> =\n new WeakMap()\n\nexport const EDITOR_TO_PENDING_ACTION: WeakMap<Editor, Action | null> =\n new WeakMap()\n\nexport const EDITOR_TO_PENDING_SELECTION: WeakMap<Editor, Range | null> =\n new WeakMap()\n\nexport const EDITOR_TO_FORCE_RENDER: WeakMap<Editor, () => void> = new WeakMap()\n\n/**\n * Symbols.\n */\n\nexport const PLACEHOLDER_SYMBOL = Symbol('placeholder') as unknown as string\nexport const MARK_PLACEHOLDER_SYMBOL = Symbol(\n 'mark-placeholder'\n) as unknown as string\n","var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}\nmodule.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nmodule.exports = _iterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nmodule.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayWithoutHoles = require(\"./arrayWithoutHoles.js\");\nvar iterableToArray = require(\"./iterableToArray.js\");\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\nvar nonIterableSpread = require(\"./nonIterableSpread.js\");\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\nmodule.exports = _toConsumableArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","/**\n * Types.\n */\n\n// COMPAT: This is required to prevent TypeScript aliases from doing some very\n// weird things for Slate's types with the same name as globals. (2019/11/27)\n// https://github.com/microsoft/TypeScript/issues/35002\nimport DOMNode = globalThis.Node\nimport DOMComment = globalThis.Comment\nimport DOMElement = globalThis.Element\nimport DOMText = globalThis.Text\nimport DOMRange = globalThis.Range\nimport DOMSelection = globalThis.Selection\nimport DOMStaticRange = globalThis.StaticRange\nimport { ReactEditor } from '../plugin/react-editor'\n\nexport {\n DOMNode,\n DOMComment,\n DOMElement,\n DOMText,\n DOMRange,\n DOMSelection,\n DOMStaticRange,\n}\n\ndeclare global {\n interface Window {\n Selection: (typeof Selection)['constructor']\n DataTransfer: (typeof DataTransfer)['constructor']\n Node: (typeof Node)['constructor']\n }\n}\n\nexport type DOMPoint = [Node, number]\n\n/**\n * Returns the host window of a DOM node\n */\n\nexport const getDefaultView = (value: any): Window | null => {\n return (\n (value && value.ownerDocument && value.ownerDocument.defaultView) || null\n )\n}\n\n/**\n * Check if a DOM node is a comment node.\n */\n\nexport const isDOMComment = (value: any): value is DOMComment => {\n return isDOMNode(value) && value.nodeType === 8\n}\n\n/**\n * Check if a DOM node is an element node.\n */\n\nexport const isDOMElement = (value: any): value is DOMElement => {\n return isDOMNode(value) && value.nodeType === 1\n}\n\n/**\n * Check if a value is a DOM node.\n */\n\nexport const isDOMNode = (value: any): value is DOMNode => {\n const window = getDefaultView(value)\n return !!window && value instanceof window.Node\n}\n\n/**\n * Check if a value is a DOM selection.\n */\n\nexport const isDOMSelection = (value: any): value is DOMSelection => {\n const window = value && value.anchorNode && getDefaultView(value.anchorNode)\n return !!window && value instanceof window.Selection\n}\n\n/**\n * Check if a DOM node is an element node.\n */\n\nexport const isDOMText = (value: any): value is DOMText => {\n return isDOMNode(value) && value.nodeType === 3\n}\n\n/**\n * Checks whether a paste event is a plaintext-only event.\n */\n\nexport const isPlainTextOnlyPaste = (event: ClipboardEvent) => {\n return (\n event.clipboardData &&\n event.clipboardData.getData('text/plain') !== '' &&\n event.clipboardData.types.length === 1\n )\n}\n\n/**\n * Normalize a DOM point so that it always refers to a text node.\n */\n\nexport const normalizeDOMPoint = (domPoint: DOMPoint): DOMPoint => {\n let [node, offset] = domPoint\n\n // If it's an element node, its offset refers to the index of its children\n // including comment nodes, so try to find the right text child node.\n if (isDOMElement(node) && node.childNodes.length) {\n let isLast = offset === node.childNodes.length\n let index = isLast ? offset - 1 : offset\n ;[node, index] = getEditableChildAndIndex(\n node,\n index,\n isLast ? 'backward' : 'forward'\n )\n // If the editable child found is in front of input offset, we instead seek to its end\n isLast = index < offset\n\n // If the node has children, traverse until we have a leaf node. Leaf nodes\n // can be either text nodes, or other void DOM nodes.\n while (isDOMElement(node) && node.childNodes.length) {\n const i = isLast ? node.childNodes.length - 1 : 0\n node = getEditableChild(node, i, isLast ? 'backward' : 'forward')\n }\n\n // Determine the new offset inside the text node.\n offset = isLast && node.textContent != null ? node.textContent.length : 0\n }\n\n // Return the node and offset.\n return [node, offset]\n}\n\n/**\n * Determines whether the active element is nested within a shadowRoot\n */\n\nexport const hasShadowRoot = (node: Node | null) => {\n let parent = node && node.parentNode\n while (parent) {\n if (parent.toString() === '[object ShadowRoot]') {\n return true\n }\n parent = parent.parentNode\n }\n return false\n}\n\n/**\n * Get the nearest editable child and index at `index` in a `parent`, preferring\n * `direction`.\n */\n\nexport const getEditableChildAndIndex = (\n parent: DOMElement,\n index: number,\n direction: 'forward' | 'backward'\n): [DOMNode, number] => {\n const { childNodes } = parent\n let child = childNodes[index]\n let i = index\n let triedForward = false\n let triedBackward = false\n\n // While the child is a comment node, or an element node with no children,\n // keep iterating to find a sibling non-void, non-comment node.\n while (\n isDOMComment(child) ||\n (isDOMElement(child) && child.childNodes.length === 0) ||\n (isDOMElement(child) && child.getAttribute('contenteditable') === 'false')\n ) {\n if (triedForward && triedBackward) {\n break\n }\n\n if (i >= childNodes.length) {\n triedForward = true\n i = index - 1\n direction = 'backward'\n continue\n }\n\n if (i < 0) {\n triedBackward = true\n i = index + 1\n direction = 'forward'\n continue\n }\n\n child = childNodes[i]\n index = i\n i += direction === 'forward' ? 1 : -1\n }\n\n return [child, index]\n}\n\n/**\n * Get the nearest editable child at `index` in a `parent`, preferring\n * `direction`.\n */\n\nexport const getEditableChild = (\n parent: DOMElement,\n index: number,\n direction: 'forward' | 'backward'\n): DOMNode => {\n const [child] = getEditableChildAndIndex(parent, index, direction)\n return child\n}\n\n/**\n * Get a plaintext representation of the content of a node, accounting for block\n * elements which get a newline appended.\n *\n * The domNode must be attached to the DOM.\n */\n\nexport const getPlainText = (domNode: DOMNode) => {\n let text = ''\n\n if (isDOMText(domNode) && domNode.nodeValue) {\n return domNode.nodeValue\n }\n\n if (isDOMElement(domNode)) {\n for (const childNode of Array.from(domNode.childNodes)) {\n text += getPlainText(childNode)\n }\n\n const display = getComputedStyle(domNode).getPropertyValue('display')\n\n if (display === 'block' || display === 'list' || domNode.tagName === 'BR') {\n text += '\\n'\n }\n }\n\n return text\n}\n\n/**\n * Get x-slate-fragment attribute from data-slate-fragment\n */\nconst catchSlateFragment = /data-slate-fragment=\"(.+?)\"/m\nexport const getSlateFragmentAttribute = (\n dataTransfer: DataTransfer\n): string | void => {\n const htmlData = dataTransfer.getData('text/html')\n const [, fragment] = htmlData.match(catchSlateFragment) || []\n return fragment\n}\n\n/**\n * Get the x-slate-fragment attribute that exist in text/html data\n * and append it to the DataTransfer object\n */\nexport const getClipboardData = (\n dataTransfer: DataTransfer,\n clipboardFormatKey = 'x-slate-fragment'\n): DataTransfer => {\n if (!dataTransfer.getData(`application/${clipboardFormatKey}`)) {\n const fragment = getSlateFragmentAttribute(dataTransfer)\n if (fragment) {\n const clipboardData = new DataTransfer()\n dataTransfer.types.forEach(type => {\n clipboardData.setData(type, dataTransfer.getData(type))\n })\n clipboardData.setData(`application/${clipboardFormatKey}`, fragment)\n return clipboardData\n }\n }\n return dataTransfer\n}\n\n/**\n * Get the dom selection from Shadow Root if possible, otherwise from the document\n */\nexport const getSelection = (root: Document | ShadowRoot): Selection | null => {\n if (root.getSelection != null) {\n return root.getSelection()\n }\n return document.getSelection()\n}\n\n/**\n * Check whether a mutation originates from a editable element inside the editor.\n */\n\nexport const isTrackedMutation = (\n editor: ReactEditor,\n mutation: MutationRecord,\n batch: MutationRecord[]\n): boolean => {\n const { target } = mutation\n if (isDOMElement(target) && target.matches('[contentEditable=\"false\"]')) {\n return false\n }\n\n const { document } = ReactEditor.getWindow(editor)\n if (document.contains(target)) {\n return ReactEditor.hasDOMNode(editor, target, { editable: true })\n }\n\n const parentMutation = batch.find(({ addedNodes, removedNodes }) => {\n for (const node of addedNodes) {\n if (node === target || node.contains(target)) {\n return true\n }\n }\n\n for (const node of removedNodes) {\n if (node === target || node.contains(target)) {\n return true\n }\n }\n })\n\n if (!parentMutation || parentMutation === mutation) {\n return false\n }\n\n // Target add/remove is tracked. Track the mutation if we track the parent mutation.\n return isTrackedMutation(editor, parentMutation, batch)\n}\n\n/**\n * Retrieves the deepest active element in the DOM, considering nested shadow DOMs.\n */\nexport const getActiveElement = () => {\n let activeElement = document.activeElement\n\n while (activeElement?.shadowRoot && activeElement.shadowRoot?.activeElement) {\n activeElement = activeElement?.shadowRoot?.activeElement\n }\n\n return activeElement\n}\n\n/**\n * @returns `true` if `otherNode` is before `node` in the document; otherwise, `false`.\n */\nexport const isBefore = (node: DOMNode, otherNode: DOMNode): boolean =>\n Boolean(\n node.compareDocumentPosition(otherNode) &\n DOMNode.DOCUMENT_POSITION_PRECEDING\n )\n\n/**\n * @returns `true` if `otherNode` is after `node` in the document; otherwise, `false`.\n */\nexport const isAfter = (node: DOMNode, otherNode: DOMNode): boolean =>\n Boolean(\n node.compareDocumentPosition(otherNode) &\n DOMNode.DOCUMENT_POSITION_FOLLOWING\n )\n","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nmodule.exports = _createClass, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nmodule.exports = _classCallCheck, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","/**\n * An auto-incrementing identifier for keys.\n */\n\nlet n = 0\n\n/**\n * A class that keeps track of a key string. We use a full class here because we\n * want to be able to use them as keys in `WeakMap` objects.\n */\n\nexport class Key {\n id: string\n\n constructor() {\n this.id = `${n++}`\n }\n}\n","import {\n BaseEditor,\n Editor,\n Element,\n Node,\n Path,\n Point,\n Range,\n Scrubber,\n Transforms,\n} from 'slate'\nimport { TextDiff } from '../utils/diff-text'\nimport {\n DOMElement,\n DOMNode,\n DOMPoint,\n DOMRange,\n DOMSelection,\n DOMStaticRange,\n DOMText,\n getSelection,\n hasShadowRoot,\n isAfter,\n isBefore,\n isDOMElement,\n isDOMNode,\n isDOMSelection,\n normalizeDOMPoint,\n} from '../utils/dom'\nimport { IS_ANDROID, IS_CHROME, IS_FIREFOX } from '../utils/environment'\n\nimport { Key } from '../utils/key'\nimport {\n EDITOR_TO_ELEMENT,\n EDITOR_TO_KEY_TO_ELEMENT,\n EDITOR_TO_PENDING_DIFFS,\n EDITOR_TO_SCHEDULE_FLUSH,\n EDITOR_TO_WINDOW,\n ELEMENT_TO_NODE,\n IS_COMPOSING,\n IS_FOCUSED,\n IS_READ_ONLY,\n NODE_TO_INDEX,\n NODE_TO_KEY,\n NODE_TO_PARENT,\n} from '../utils/weak-maps'\n\n/**\n * A React and DOM-specific version of the `Editor` interface.\n */\n\nexport interface ReactEditor extends BaseEditor {\n hasEditableTarget: (\n editor: ReactEditor,\n target: EventTarget | null\n ) => target is DOMNode\n hasRange: (editor: ReactEditor, range: Range) => boolean\n hasSelectableTarget: (\n editor: ReactEditor,\n target: EventTarget | null\n ) => boolean\n hasTarget: (\n editor: ReactEditor,\n target: EventTarget | null\n ) => target is DOMNode\n insertData: (data: DataTransfer) => void\n insertFragmentData: (data: DataTransfer) => boolean\n insertTextData: (data: DataTransfer) => boolean\n isTargetInsideNonReadonlyVoid: (\n editor: ReactEditor,\n target: EventTarget | null\n ) => boolean\n setFragmentData: (\n data: DataTransfer,\n originEvent?: 'drag' | 'copy' | 'cut'\n ) => void\n}\n\nexport interface ReactEditorInterface {\n /**\n * Experimental and android specific: Get pending diffs\n */\n androidPendingDiffs: (editor: Editor) => TextDiff[] | undefined\n\n /**\n * Experimental and android specific: Flush all pending diffs and cancel composition at the next possible time.\n */\n androidScheduleFlush: (editor: Editor) => void\n\n /**\n * Blur the editor.\n */\n blur: (editor: ReactEditor) => void\n\n /**\n * Deselect the editor.\n */\n deselect: (editor: ReactEditor) => void\n\n /**\n * Find the DOM node that implements DocumentOrShadowRoot for the editor.\n */\n findDocumentOrShadowRoot: (editor: ReactEditor) => Document | ShadowRoot\n\n /**\n * Get the target range from a DOM `event`.\n */\n findEventRange: (editor: ReactEditor, event: any) => Range\n\n /**\n * Find a key for a Slate node.\n */\n findKey: (editor: ReactEditor, node: Node) => Key\n\n /**\n * Find the path of Slate node.\n */\n findPath: (editor: ReactEditor, node: Node) => Path\n\n /**\n * Focus the editor.\n */\n focus: (editor: ReactEditor, options?: { retries: number }) => void\n\n /**\n * Return the host window of the current editor.\n */\n getWindow: (editor: ReactEditor) => Window\n\n /**\n * Check if a DOM node is within the editor.\n */\n hasDOMNode: (\n editor: ReactEditor,\n target: DOMNode,\n options?: { editable?: boolean }\n ) => boolean\n\n /**\n * Check if the target is editable and in the editor.\n */\n hasEditableTarget: (\n editor: ReactEditor,\n target: EventTarget | null\n ) => target is DOMNode\n\n /**\n *\n */\n hasRange: (editor: ReactEditor, range: Range) => boolean\n\n /**\n * Check if the target can be selectable\n */\n hasSelectableTarget: (\n editor: ReactEditor,\n target: EventTarget | null\n ) => boolean\n\n /**\n * Check if the target is in the editor.\n */\n hasTarget: (\n editor: ReactEditor,\n target: EventTarget | null\n ) => target is DOMNode\n\n /**\n * Insert data from a `DataTransfer` into the editor.\n */\n insertData: (editor: ReactEditor, data: DataTransfer) => void\n\n /**\n * Insert fragment data from a `DataTransfer` into the editor.\n */\n insertFragmentData: (editor: ReactEditor, data: DataTransfer) => boolean\n\n /**\n * Insert text data from a `DataTransfer` into the editor.\n */\n insertTextData: (editor: ReactEditor, data: DataTransfer) => boolean\n\n /**\n * Check if the user is currently composing inside the editor.\n */\n isComposing: (editor: ReactEditor) => boolean\n\n /**\n * Check if the editor is focused.\n */\n isFocused: (editor: ReactEditor) => boolean\n\n /**\n * Check if the editor is in read-only mode.\n */\n isReadOnly: (editor: ReactEditor) => boolean\n\n /**\n * Check if the target is inside void and in an non-readonly editor.\n */\n isTargetInsideNonReadonlyVoid: (\n editor: ReactEditor,\n target: EventTarget | null\n ) => boolean\n\n /**\n * Sets data from the currently selected fragment on a `DataTransfer`.\n */\n setFragmentData: (\n editor: ReactEditor,\n data: DataTransfer,\n originEvent?: 'drag' | 'copy' | 'cut'\n ) => void\n\n /**\n * Find the native DOM element from a Slate node.\n */\n toDOMNode: (editor: ReactEditor, node: Node) => HTMLElement\n\n /**\n * Find a native DOM selection point from a Slate point.\n */\n toDOMPoint: (editor: ReactEditor, point: Point) => DOMPoint\n\n /**\n * Find a native DOM range from a Slate `range`.\n *\n * Notice: the returned range will always be ordinal regardless of the direction of Slate `range` due to DOM API limit.\n *\n * there is no way to create a reverse DOM Range using Range.setStart/setEnd\n * according to https://dom.spec.whatwg.org/#concept-range-bp-set.\n */\n toDOMRange: (editor: ReactEditor, range: Range) => DOMRange\n\n /**\n * Find a Slate node from a native DOM `element`.\n */\n toSlateNode: (editor: ReactEditor, domNode: DOMNode) => Node\n\n /**\n * Find a Slate point from a DOM selection's `domNode` and `domOffset`.\n */\n toSlatePoint: <T extends boolean>(\n editor: ReactEditor,\n domPoint: DOMPoint,\n options: {\n exactMatch: boolean\n suppressThrow: T\n /**\n * The direction to search for Slate leaf nodes if `domPoint` is\n * non-editable and non-void.\n */\n searchDirection?: 'forward' | 'backward'\n }\n ) => T extends true ? Point | null : Point\n\n /**\n * Find a Slate range from a DOM range or selection.\n */\n toSlateRange: <T extends boolean>(\n editor: ReactEditor,\n domRange: DOMRange | DOMStaticRange | DOMSelection,\n options: {\n exactMatch: boolean\n suppressThrow: T\n }\n ) => T extends true ? Range | null : Range\n}\n\n// eslint-disable-next-line no-redeclare\nexport const ReactEditor: ReactEditorInterface = {\n androidPendingDiffs: editor => EDITOR_TO_PENDING_DIFFS.get(editor),\n\n androidScheduleFlush: editor => {\n EDITOR_TO_SCHEDULE_FLUSH.get(editor)?.()\n },\n\n blur: editor => {\n const el = ReactEditor.toDOMNode(editor, editor)\n const root = ReactEditor.findDocumentOrShadowRoot(editor)\n IS_FOCUSED.set(editor, false)\n\n if (root.activeElement === el) {\n el.blur()\n }\n },\n\n deselect: editor => {\n const { selection } = editor\n const root = ReactEditor.findDocumentOrShadowRoot(editor)\n const domSelection = getSelection(root)\n\n if (domSelection && domSelection.rangeCount > 0) {\n domSelection.removeAllRanges()\n }\n\n if (selection) {\n Transforms.deselect(editor)\n }\n },\n\n findDocumentOrShadowRoot: editor => {\n const el = ReactEditor.toDOMNode(editor, editor)\n const root = el.getRootNode()\n\n if (root instanceof Document || root instanceof ShadowRoot) {\n return root\n }\n\n return el.ownerDocument\n },\n\n findEventRange: (editor, event) => {\n if ('nativeEvent' in event) {\n event = event.nativeEvent\n }\n\n const { clientX: x, clientY: y, target } = event\n\n if (x == null || y == null) {\n throw new Error(`Cannot resolve a Slate range from a DOM event: ${event}`)\n }\n\n const node = ReactEditor.toSlateNode(editor, event.target)\n const path = ReactEditor.findPath(editor, node)\n\n // If the drop target is inside a void node, move it into either the\n // next or previous node, depending on which side the `x` and `y`\n // coordinates are closest to.\n if (Element.isElement(node) && Editor.isVoid(editor, node)) {\n const rect = target.getBoundingClientRect()\n const isPrev = editor.isInline(node)\n ? x - rect.left < rect.left + rect.width - x\n : y - rect.top < rect.top + rect.height - y\n\n const edge = Editor.point(editor, path, {\n edge: isPrev ? 'start' : 'end',\n })\n const point = isPrev\n ? Editor.before(editor, edge)\n : Editor.after(editor, edge)\n\n if (point) {\n const range = Editor.range(editor, point)\n return range\n }\n }\n\n // Else resolve a range from the caret position where the drop occured.\n let domRange\n const { document } = ReactEditor.getWindow(editor)\n\n // COMPAT: In Firefox, `caretRangeFromPoint` doesn't exist. (2016/07/25)\n if (document.caretRangeFromPoint) {\n domRange = document.caretRangeFromPoint(x, y)\n } else {\n const position = document.caretPositionFromPoint(x, y)\n\n if (position) {\n domRange = document.createRange()\n domRange.setStart(position.offsetNode, position.offset)\n domRange.setEnd(position.offsetNode, position.offset)\n }\n }\n\n if (!domRange) {\n throw new Error(`Cannot resolve a Slate range from a DOM event: ${event}`)\n }\n\n // Resolve a Slate range from the DOM range.\n const range = ReactEditor.toSlateRange(editor, domRange, {\n exactMatch: false,\n suppressThrow: false,\n })\n return range\n },\n\n findKey: (editor, node) => {\n let key = NODE_TO_KEY.get(node)\n\n if (!key) {\n key = new Key()\n NODE_TO_KEY.set(node, key)\n }\n\n return key\n },\n\n findPath: (editor, node) => {\n const path: Path = []\n let child = node\n\n while (true) {\n const parent = NODE_TO_PARENT.get(child)\n\n if (parent == null) {\n if (Editor.isEditor(child)) {\n return path\n } else {\n break\n }\n }\n\n const i = NODE_TO_INDEX.get(child)\n\n if (i == null) {\n break\n }\n\n path.unshift(i)\n child = parent\n }\n\n throw new Error(\n `Unable to find the path for Slate node: ${Scrubber.stringify(node)}`\n )\n },\n\n focus: (editor, options = { retries: 5 }) => {\n // Return if already focused\n if (IS_FOCUSED.get(editor)) {\n return\n }\n\n // Retry setting focus if the editor has pending operations.\n // The DOM (selection) is unstable while changes are applied.\n // Retry until retries are exhausted or editor is focused.\n if (options.retries <= 0) {\n throw new Error(\n 'Could not set focus, editor seems stuck with pending operations'\n )\n }\n if (editor.operations.length > 0) {\n setTimeout(() => {\n ReactEditor.focus(editor, { retries: options.retries - 1 })\n }, 10)\n return\n }\n\n const el = ReactEditor.toDOMNode(editor, editor)\n const root = ReactEditor.findDocumentOrShadowRoot(editor)\n if (root.activeElement !== el) {\n // Ensure that the DOM selection state is set to the editor's selection\n if (editor.selection && root instanceof Document) {\n const domSelection = getSelection(root)\n const domRange = ReactEditor.toDOMRange(editor, editor.selection)\n domSelection?.removeAllRanges()\n domSelection?.addRange(domRange)\n }\n // Create a new selection in the top of the document if missing\n if (!editor.selection) {\n Transforms.select(editor, Editor.start(editor, []))\n }\n // IS_FOCUSED should be set before calling el.focus() to ensure that\n // FocusedContext is updated to the correct value\n IS_FOCUSED.set(editor, true)\n el.focus({ preventScroll: true })\n }\n },\n\n getWindow: editor => {\n const window = EDITOR_TO_WINDOW.get(editor)\n if (!window) {\n throw new Error('Unable to find a host window element for this editor')\n }\n return window\n },\n\n hasDOMNode: (editor, target, options = {}) => {\n const { editable = false } = options\n const editorEl = ReactEditor.toDOMNode(editor, editor)\n let targetEl\n\n // COMPAT: In Firefox, reading `target.nodeType` will throw an error if\n // target is originating from an internal \"restricted\" element (e.g. a\n // stepper arrow on a number input). (2018/05/04)\n // https://github.com/ianstormtaylor/slate/issues/1819\n try {\n targetEl = (\n isDOMElement(target) ? target : target.parentElement\n ) as HTMLElement\n } catch (err) {\n if (\n err instanceof Error &&\n !err.message.includes('Permission denied to access property \"nodeType\"')\n ) {\n throw err\n }\n }\n\n if (!targetEl) {\n return false\n }\n\n return (\n targetEl.closest(`[data-slate-editor]`) === editorEl &&\n (!editable || targetEl.isContentEditable\n ? true\n : (typeof targetEl.isContentEditable === 'boolean' && // isContentEditable exists only on HTMLElement, and on other nodes it will be undefined\n // this is the core logic that lets you know you got the right editor.selection instead of null when editor is contenteditable=\"false\"(readOnly)\n targetEl.closest('[contenteditable=\"false\"]') === editorEl) ||\n !!targetEl.getAttribute('data-slate-zero-width'))\n )\n },\n\n hasEditableTarget: (editor, target): target is DOMNode =>\n isDOMNode(target) &&\n ReactEditor.hasDOMNode(editor, target, { editable: true }),\n\n hasRange: (editor, range) => {\n const { anchor, focus } = range\n return (\n Editor.hasPath(editor, anchor.path) && Editor.hasPath(editor, focus.path)\n )\n },\n\n hasSelectableTarget: (editor, target) =>\n ReactEditor.hasEditableTarget(editor, target) ||\n ReactEditor.isTargetInsideNonReadonlyVoid(editor, target),\n\n hasTarget: (editor, target): target is DOMNode =>\n isDOMNode(target) && ReactEditor.hasDOMNode(editor, target),\n\n insertData: (editor, data) => {\n editor.insertData(data)\n },\n\n insertFragmentData: (editor, data) => editor.insertFragmentData(data),\n\n insertTextData: (editor, data) => editor.insertTextData(data),\n\n isComposing: editor => {\n return !!IS_COMPOSING.get(editor)\n },\n\n isFocused: editor => !!IS_FOCUSED.get(editor),\n\n isReadOnly: editor => !!IS_READ_ONLY.get(editor),\n\n isTargetInsideNonReadonlyVoid: (editor, target) => {\n if (IS_READ_ONLY.get(editor)) return false\n\n const slateNode =\n ReactEditor.hasTarget(editor, target) &&\n ReactEditor.toSlateNode(editor, target)\n return Element.isElement(slateNode) && Editor.isVoid(editor, slateNode)\n },\n\n setFragmentData: (editor, data, originEvent) =>\n editor.setFragmentData(data, originEvent),\n\n toDOMNode: (editor, node) => {\n const KEY_TO_ELEMENT = EDITOR_TO_KEY_TO_ELEMENT.get(editor)\n const domNode = Editor.isEditor(node)\n ? EDITOR_TO_ELEMENT.get(editor)\n : KEY_TO_ELEMENT?.get(ReactEditor.findKey(editor, node))\n\n if (!domNode) {\n throw new Error(\n `Cannot resolve a DOM node from Slate node: ${Scrubber.stringify(node)}`\n )\n }\n\n return domNode\n },\n\n toDOMPoint: (editor, point) => {\n const [node] = Editor.node(editor, point.path)\n const el = ReactEditor.toDOMNode(editor, node)\n let domPoint: DOMPoint | undefined\n\n // If we're inside a void node, force the offset to 0, otherwise the zero\n // width spacing character will result in an incorrect offset of 1\n if (Editor.void(editor, { at: point })) {\n point = { path: point.path, offset: 0 }\n }\n\n // For each leaf, we need to isolate its content, which means filtering\n // to its direct text and zero-width spans. (We have to filter out any\n // other siblings that may have been rendered alongside them.)\n const selector = `[data-slate-string], [data-slate-zero-width]`\n const texts = Array.from(el.querySelectorAll(selector))\n let start = 0\n\n for (let i = 0; i < texts.length; i++) {\n const text = texts[i]\n const domNode = text.childNodes[0] as HTMLElement\n\n if (domNode == null || domNode.textContent == null) {\n continue\n }\n\n const { length } = domNode.textContent\n const attr = text.getAttribute('data-slate-length')\n const trueLength = attr == null ? length : parseInt(attr, 10)\n const end = start + trueLength\n\n // Prefer putting the selection inside the mark placeholder to ensure\n // composed text is displayed with the correct marks.\n const nextText = texts[i + 1]\n if (\n point.offset === end &&\n nextText?.hasAttribute('data-slate-mark-placeholder')\n ) {\n const domText = nextText.childNodes[0]\n\n domPoint = [\n // COMPAT: If we don't explicity set the dom point to be on the actual\n // dom text element, chrome will put the selection behind the actual dom\n // text element, causing domRange.getBoundingClientRect() calls on a collapsed\n // selection to return incorrect zero values (https://bugs.chromium.org/p/chromium/issues/detail?id=435438)\n // which will cause issues when scrolling to it.\n domText instanceof DOMText ? domText : nextText,\n nextText.textContent?.startsWith('\\uFEFF') ? 1 : 0,\n ]\n break\n }\n\n if (point.offset <= end) {\n const offset = Math.min(length, Math.max(0, point.offset - start))\n domPoint = [domNode, offset]\n break\n }\n\n start = end\n }\n\n if (!domPoint) {\n throw new Error(\n `Cannot resolve a DOM point from Slate point: ${Scrubber.stringify(\n point\n )}`\n )\n }\n\n return domPoint\n },\n\n toDOMRange: (editor, range) => {\n const { anchor, focus } = range\n const isBackward = Range.isBackward(range)\n const domAnchor = ReactEditor.toDOMPoint(editor, anchor)\n const domFocus = Range.isCollapsed(range)\n ? domAnchor\n : ReactEditor.toDOMPoint(editor, focus)\n\n const window = ReactEditor.getWindow(editor)\n const domRange = window.document.createRange()\n const [startNode, startOffset] = isBackward ? domFocus : domAnchor\n const [endNode, endOffset] = isBackward ? domAnchor : domFocus\n\n // A slate Point at zero-width Leaf always has an offset of 0 but a native DOM selection at\n // zero-width node has an offset of 1 so we have to check if we are in a zero-width node and\n // adjust the offset accordingly.\n const startEl = (\n isDOMElement(startNode) ? startNode : startNode.parentElement\n ) as HTMLElement\n const isStartAtZeroWidth = !!startEl.getAttribute('data-slate-zero-width')\n const endEl = (\n isDOMElement(endNode) ? endNode : endNode.parentElement\n ) as HTMLElement\n const isEndAtZeroWidth = !!endEl.getAttribute('data-slate-zero-width')\n\n domRange.setStart(startNode, isStartAtZeroWidth ? 1 : startOffset)\n domRange.setEnd(endNode, isEndAtZeroWidth ? 1 : endOffset)\n return domRange\n },\n\n toSlateNode: (editor, domNode) => {\n let domEl = isDOMElement(domNode) ? domNode : domNode.parentElement\n\n if (domEl && !domEl.hasAttribute('data-slate-node')) {\n domEl = domEl.closest(`[data-slate-node]`)\n }\n\n const node = domEl ? ELEMENT_TO_NODE.get(domEl as HTMLElement) : null\n\n if (!node) {\n throw new Error(`Cannot resolve a Slate node from DOM node: ${domEl}`)\n }\n\n return node\n },\n\n toSlatePoint: <T extends boolean>(\n editor: ReactEditor,\n domPoint: DOMPoint,\n options: {\n exactMatch: boolean\n suppressThrow: T\n searchDirection?: 'forward' | 'backward'\n }\n ): T extends true ? Point | null : Point => {\n const { exactMatch, suppressThrow, searchDirection = 'backward' } = options\n const [nearestNode, nearestOffset] = exactMatch\n ? domPoint\n : normalizeDOMPoint(domPoint)\n const parentNode = nearestNode.parentNode as DOMElement\n let textNode: DOMElement | null = null\n let offset = 0\n\n if (parentNode) {\n const editorEl = ReactEditor.toDOMNode(editor, editor)\n const potentialVoidNode = parentNode.closest('[data-slate-void=\"true\"]')\n // Need to ensure that the closest void node is actually a void node\n // within this editor, and not a void node within some parent editor. This can happen\n // if this editor is within a void node of another editor (\"nested editors\", like in\n // the \"Editable Voids\" example on the docs site).\n const voidNode =\n potentialVoidNode && editorEl.contains(potentialVoidNode)\n ? potentialVoidNode\n : null\n const potentialNonEditableNode = parentNode.closest(\n '[contenteditable=\"false\"]'\n )\n const nonEditableNode =\n potentialNonEditableNode && editorEl.contains(potentialNonEditableNode)\n ? potentialNonEditableNode\n : null\n let leafNode = parentNode.closest('[data-slate-leaf]')\n let domNode: DOMElement | null = null\n\n // Calculate how far into the text node the `nearestNode` is, so that we\n // can determine what the offset relative to the text node is.\n if (leafNode) {\n textNode = leafNode.closest('[data-slate-node=\"text\"]')\n\n if (textNode) {\n const window = ReactEditor.getWindow(editor)\n const range = window.document.createRange()\n range.setStart(textNode, 0)\n range.setEnd(nearestNode, nearestOffset)\n\n const contents = range.cloneContents()\n const removals = [\n ...Array.prototype.slice.call(\n contents.querySelectorAll('[data-slate-zero-width]')\n ),\n ...Array.prototype.slice.call(\n contents.querySelectorAll('[contenteditable=false]')\n ),\n ]\n\n removals.forEach(el => {\n // COMPAT: While composing at the start of a text node, some keyboards put\n // the text content inside the zero width space.\n if (\n IS_ANDROID &&\n !exactMatch &&\n el.hasAttribute('data-slate-zero-width') &&\n el.textContent.length > 0 &&\n el.textContext !== '\\uFEFF'\n ) {\n if (el.textContent.startsWith('\\uFEFF')) {\n el.textContent = el.textContent.slice(1)\n }\n\n return\n }\n\n el!.parentNode!.removeChild(el)\n })\n\n // COMPAT: Edge has a bug where Range.prototype.toString() will\n // convert \\n into \\r\\n. The bug causes a loop when slate-react\n // attempts to reposition its cursor to match the native position. Use\n // textContent.length instead.\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10291116/\n offset = contents.textContent!.length\n domNode = textNode\n }\n } else if (voidNode) {\n // For void nodes, the element with the offset key will be a cousin, not an\n // ancestor, so find it by going down from the nearest void parent and taking the\n // first one that isn't inside a nested editor.\n const leafNodes = voidNode.querySelectorAll('[data-slate-leaf]')\n for (let index = 0; index < leafNodes.length; index++) {\n const current = leafNodes[index]\n if (ReactEditor.hasDOMNode(editor, current)) {\n leafNode = current\n break\n }\n }\n\n // COMPAT: In read-only editors the leaf is not rendered.\n if (!leafNode) {\n offset = 1\n } else {\n textNode = leafNode.closest('[data-slate-node=\"text\"]')!\n domNode = leafNode\n offset = domNode.textContent!.length\n domNode.querySelectorAll('[data-slate-zero-width]').forEach(el => {\n offset -= el.textContent!.length\n })\n }\n } else if (nonEditableNode) {\n // Find the edge of the nearest leaf in `searchDirection`\n const getLeafNodes = (node: DOMElement | null | undefined) =>\n node\n ? node.querySelectorAll(\n // Exclude leaf nodes in nested editors\n '[data-slate-leaf]:not(:scope [data-slate-editor] [data-slate-leaf])'\n )\n : []\n const elementNode = nonEditableNode.closest(\n '[data-slate-node=\"element\"]'\n )\n\n if (searchDirection === 'forward') {\n const leafNodes = [\n ...getLeafNodes(elementNode),\n ...getLeafNodes(elementNode?.nextElementSibling),\n ]\n leafNode =\n leafNodes.find(leaf => isAfter(nonEditableNode, leaf)) ?? null\n } else {\n const leafNodes = [\n ...getLeafNodes(elementNode?.previousElementSibling),\n ...getLeafNodes(elementNode),\n ]\n leafNode =\n leafNodes.findLast(leaf => isBefore(nonEditableNode, leaf)) ?? null\n }\n\n if (leafNode) {\n textNode = leafNode.closest('[data-slate-node=\"text\"]')!\n domNode = leafNode\n if (searchDirection === 'forward') {\n offset = 0\n } else {\n offset = domNode.textContent!.length\n domNode.querySelectorAll('[data-slate-zero-width]').forEach(el => {\n offset -= el.textContent!.length\n })\n }\n }\n }\n\n if (\n domNode &&\n offset === domNode.textContent!.length &&\n // COMPAT: Android IMEs might remove the zero width space while composing,\n // and we don't add it for line-breaks.\n IS_ANDROID &&\n domNode.getAttribute('data-slate-zero-width') === 'z' &&\n domNode.textContent?.startsWith('\\uFEFF') &&\n // COMPAT: If the parent node is a Slate zero-width space, editor is\n // because the text node should have no characters. However, during IME\n // composition the ASCII characters will be prepended to the zero-width\n // space, so subtract 1 from the offset to account for the zero-width\n // space character.\n (parentNode.hasAttribute('data-slate-zero-width') ||\n // COMPAT: In Firefox, `range.cloneContents()` returns an extra trailing '\\n'\n // when the document ends with a new-line character. This results in the offset\n // length being off by one, so we need to subtract one to account for this.\n (IS_FIREFOX && domNode.textContent?.endsWith('\\n\\n')))\n ) {\n offset--\n }\n }\n\n if (IS_ANDROID && !textNode && !exactMatch) {\n const node = parentNode.hasAttribute('data-slate-node')\n ? parentNode\n : parentNode.closest('[data-slate-node]')\n\n if (node && ReactEditor.hasDOMNode(editor, node, { editable: true })) {\n const slateNode = ReactEditor.toSlateNode(editor, node)\n let { path, offset } = Editor.start(\n editor,\n ReactEditor.findPath(editor, slateNode)\n )\n\n if (!node.querySelector('[data-slate-leaf]')) {\n offset = nearestOffset\n }\n\n return { path, offset } as T extends true ? Point | null : Point\n }\n }\n\n if (!textNode) {\n if (suppressThrow) {\n return null as T extends true ? Point | null : Point\n }\n throw new Error(\n `Cannot resolve a Slate point from DOM point: ${domPoint}`\n )\n }\n\n // COMPAT: If someone is clicking from one Slate editor into another,\n // the select event fires twice, once for the old editor's `element`\n // first, and then afterwards for the correct `element`. (2017/03/03)\n const slateNode = ReactEditor.toSlateNode(editor, textNode!)\n const path = ReactEditor.findPath(editor, slateNode)\n return { path, offset } as T extends true ? Point | null : Point\n },\n\n toSlateRange: <T extends boolean>(\n editor: ReactEditor,\n domRange: DOMRange | DOMStaticRange | DOMSelection,\n options: {\n exactMatch: boolean\n suppressThrow: T\n }\n ): T extends true ? Range | null : Range => {\n const { exactMatch, suppressThrow } = options\n const el = isDOMSelection(domRange)\n ? domRange.anchorNode\n : domRange.startContainer\n let anchorNode\n let anchorOffset\n let focusNode\n let focusOffset\n let isCollapsed\n\n if (el) {\n if (isDOMSelection(domRange)) {\n // COMPAT: In firefox the normal seletion way does not work\n // (https://github.com/ianstormtaylor/slate/pull/5486#issue-1820720223)\n if (IS_FIREFOX && domRange.rangeCount > 1) {\n focusNode = domRange.focusNode // Focus node works fine\n const firstRange = domRange.getRangeAt(0)\n const lastRange = domRange.getRangeAt(domRange.rangeCount - 1)\n\n // Here we are in the contenteditable mode of a table in firefox\n if (\n focusNode instanceof HTMLTableRowElement &&\n firstRange.startContainer instanceof HTMLTableRowElement &&\n lastRange.startContainer instanceof HTMLTableRowElement\n ) {\n // HTMLElement, becouse Element is a slate element\n function getLastChildren(element: HTMLElement): HTMLElement {\n if (element.childElementCount > 0) {\n return getLastChildren(<HTMLElement>element.children[0])\n } else {\n return element\n }\n }\n\n const firstNodeRow = <HTMLTableRowElement>firstRange.startContainer\n const lastNodeRow = <HTMLTableRowElement>lastRange.startContainer\n\n // This should never fail as \"The HTMLElement interface represents any HTML element.\"\n const firstNode = getLastChildren(\n <HTMLElement>firstNodeRow.children[firstRange.startOffset]\n )\n const lastNode = getLastChildren(\n <HTMLElement>lastNodeRow.children[lastRange.startOffset]\n )\n\n // Zero, as we allways take the right one as the anchor point\n focusOffset = 0\n\n if (lastNode.childNodes.length > 0) {\n anchorNode = lastNode.childNodes[0]\n } else {\n anchorNode = lastNode\n }\n\n if (firstNode.childNodes.length > 0) {\n focusNode = firstNode.childNodes[0]\n } else {\n focusNode = firstNode\n }\n\n if (lastNode instanceof HTMLElement) {\n anchorOffset = (<HTMLElement>lastNode).innerHTML.length\n } else {\n // Fallback option\n anchorOffset = 0\n }\n } else {\n // This is the read only mode of a firefox table\n // Right to left\n if (firstRange.startContainer === focusNode) {\n anchorNode = lastRange.endContainer\n anchorOffset = lastRange.endOffset\n focusOffset = firstRange.startOffset\n } else {\n // Left to right\n anchorNode = firstRange.startContainer\n anchorOffset = firstRange.endOffset\n focusOffset = lastRange.startOffset\n }\n }\n } else {\n anchorNode = domRange.anchorNode\n anchorOffset = domRange.anchorOffset\n focusNode = domRange.focusNode\n focusOffset = domRange.focusOffset\n }\n\n // COMPAT: There's a bug in chrome that always returns `true` for\n // `isCollapsed` for a Selection that comes from a ShadowRoot.\n // (2020/08/08)\n // https://bugs.chromium.org/p/chromium/issues/detail?id=447523\n // IsCollapsed might not work in firefox, but this will\n if ((IS_CHROME && hasShadowRoot(anchorNode)) || IS_FIREFOX) {\n isCollapsed =\n domRange.anchorNode === domRange.focusNode &&\n domRange.anchorOffset === domRange.focusOffset\n } else {\n isCollapsed = domRange.isCollapsed\n }\n } else {\n anchorNode = domRange.startContainer\n anchorOffset = domRange.startOffset\n focusNode = domRange.endContainer\n focusOffset = domRange.endOffset\n isCollapsed = domRange.collapsed\n }\n }\n\n if (\n anchorNode == null ||\n focusNode == null ||\n anchorOffset == null ||\n focusOffset == null\n ) {\n throw new Error(\n `Cannot resolve a Slate range from DOM range: ${domRange}`\n )\n }\n\n // COMPAT: Firefox sometimes includes an extra \\n (rendered by TextString\n // when isTrailing is true) in the focusOffset, resulting in an invalid\n // Slate point. (2023/11/01)\n if (\n IS_FIREFOX &&\n focusNode.textContent?.endsWith('\\n\\n') &&\n focusOffset === focusNode.textContent.length\n ) {\n focusOffset--\n }\n\n const anchor = ReactEditor.toSlatePoint(\n editor,\n [anchorNode, anchorOffset],\n {\n exactMatch,\n suppressThrow,\n }\n )\n if (!anchor) {\n return null as T extends true ? Range | null : Range\n }\n\n const focusBeforeAnchor =\n isBefore(anchorNode, focusNode) ||\n (anchorNode === focusNode && focusOffset < anchorOffset)\n const focus = isCollapsed\n ? anchor\n : ReactEditor.toSlatePoint(editor, [focusNode, focusOffset], {\n exactMatch,\n suppressThrow,\n searchDirection: focusBeforeAnchor ? 'forward' : 'backward',\n })\n if (!focus) {\n return null as T extends true ? Range | null : Range\n }\n\n let range: Range = { anchor: anchor as Point, focus: focus as Point }\n // if the selection is a hanging range that ends in a void\n // and the DOM focus is an Element\n // (meaning that the selection ends before the element)\n // unhang the range to avoid mistakenly including the void\n if (\n Range.isExpanded(range) &&\n Range.isForward(range) &&\n isDOMElement(focusNode) &&\n Editor.void(editor, { at: range.focus, mode: 'highest' })\n ) {\n range = Editor.unhangRange(editor, range, { voids: true })\n }\n\n return range as unknown as T extends true ? Range | null : Range\n },\n}\n","import {\n Editor,\n Node,\n Operation,\n Path,\n Point,\n Range,\n Text,\n Element,\n} from 'slate'\nimport { EDITOR_TO_PENDING_DIFFS } from './weak-maps'\n\nexport type StringDiff = {\n start: number\n end: number\n text: string\n}\n\nexport type TextDiff = {\n id: number\n path: Path\n diff: StringDiff\n}\n\n/**\n * Check whether a text diff was applied in a way we can perform the pending action on /\n * recover the pending selection.\n */\nexport function verifyDiffState(editor: Editor, textDiff: TextDiff): boolean {\n const { path, diff } = textDiff\n if (!Editor.hasPath(editor, path)) {\n return false\n }\n\n const node = Node.get(editor, path)\n if (!Text.isText(node)) {\n return false\n }\n\n if (diff.start !== node.text.length || diff.text.length === 0) {\n return (\n node.text.slice(diff.start, diff.start + diff.text.length) === diff.text\n )\n }\n\n const nextPath = Path.next(path)\n if (!Editor.hasPath(editor, nextPath)) {\n return false\n }\n\n const nextNode = Node.get(editor, nextPath)\n return Text.isText(nextNode) && nextNode.text.startsWith(diff.text)\n}\n\nexport function applyStringDiff(text: string, ...diffs: StringDiff[]) {\n return diffs.reduce(\n (text, diff) =>\n text.slice(0, diff.start) + diff.text + text.slice(diff.end),\n text\n )\n}\n\nfunction longestCommonPrefixLength(str: string, another: string) {\n const length = Math.min(str.length, another.length)\n\n for (let i = 0; i < length; i++) {\n if (str.charAt(i) !== another.charAt(i)) {\n return i\n }\n }\n\n return length\n}\n\nfunction longestCommonSuffixLength(\n str: string,\n another: string,\n max: number\n): number {\n const length = Math.min(str.length, another.length, max)\n\n for (let i = 0; i < length; i++) {\n if (\n str.charAt(str.length - i - 1) !== another.charAt(another.length - i - 1)\n ) {\n return i\n }\n }\n\n return length\n}\n\n/**\n * Remove redundant changes from the diff so that it spans the minimal possible range\n */\nexport function normalizeStringDiff(targetText: string, diff: StringDiff) {\n const { start, end, text } = diff\n const removedText = targetText.slice(start, end)\n\n const prefixLength = longestCommonPrefixLength(removedText, text)\n const max = Math.min(\n removedText.length - prefixLength,\n text.length - prefixLength\n )\n const suffixLength = longestCommonSuffixLength(removedText, text, max)\n\n const normalized: StringDiff = {\n start: start + prefixLength,\n end: end - suffixLength,\n text: text.slice(prefixLength, text.length - suffixLength),\n }\n\n if (normalized.start === normalized.end && normalized.text.length === 0) {\n return null\n }\n\n return normalized\n}\n\n/**\n * Return a string diff that is equivalent to applying b after a spanning the range of\n * both changes\n */\nexport function mergeStringDiffs(\n targetText: string,\n a: StringDiff,\n b: StringDiff\n): StringDiff | null {\n const start = Math.min(a.start, b.start)\n const overlap = Math.max(\n 0,\n Math.min(a.start + a.text.length, b.end) - b.start\n )\n\n const applied = applyStringDiff(targetText, a, b)\n const sliceEnd = Math.max(\n b.start + b.text.length,\n a.start +\n a.text.length +\n (a.start + a.text.length > b.start ? b.text.length : 0) -\n overlap\n )\n\n const text = applied.slice(start, sliceEnd)\n const end = Math.max(a.end, b.end - a.text.length + (a.end - a.start))\n return normalizeStringDiff(targetText, { start, end, text })\n}\n\n/**\n * Get the slate range the text diff spans.\n */\nexport function targetRange(textDiff: TextDiff): Range {\n const { path, diff } = textDiff\n return {\n anchor: { path, offset: diff.start },\n focus: { path, offset: diff.end },\n }\n}\n\n/**\n * Normalize a 'pending point' a.k.a a point based on the dom state before applying\n * the pending diffs. Since the pending diffs might have been inserted with different\n * marks we have to 'walk' the offset from the starting position to ensure we still\n * have a valid point inside the document\n */\nexport function normalizePoint(editor: Editor, point: Point): Point | null {\n let { path, offset } = point\n if (!Editor.hasPath(editor, path)) {\n return null\n }\n\n let leaf = Node.get(editor, path)\n if (!Text.isText(leaf)) {\n return null\n }\n\n const parentBlock = Editor.above(editor, {\n match: n => Element.isElement(n) && Editor.isBlock(editor, n),\n at: path,\n })\n\n if (!parentBlock) {\n return null\n }\n\n while (offset > leaf.text.length) {\n const entry = Editor.next(editor, { at: path, match: Text.isText })\n if (!entry || !Path.isDescendant(entry[1], parentBlock[1])) {\n return null\n }\n\n offset -= leaf.text.length\n leaf = entry[0]\n path = entry[1]\n }\n\n return { path, offset }\n}\n\n/**\n * Normalize a 'pending selection' to ensure it's valid in the current document state.\n */\nexport function normalizeRange(editor: Editor, range: Range): Range | null {\n const anchor = normalizePoint(editor, range.anchor)\n if (!anchor) {\n return null\n }\n\n if (Range.isCollapsed(range)) {\n return { anchor, focus: anchor }\n }\n\n const focus = normalizePoint(editor, range.focus)\n if (!focus) {\n return null\n }\n\n return { anchor, focus }\n}\n\nexport function transformPendingPoint(\n editor: Editor,\n point: Point,\n op: Operation\n): Point | null {\n const pendingDiffs = EDITOR_TO_PENDING_DIFFS.get(editor)\n const textDiff = pendingDiffs?.find(({ path }) =>\n Path.equals(path, point.path)\n )\n\n if (!textDiff || point.offset <= textDiff.diff.start) {\n return Point.transform(point, op, { affinity: 'backward' })\n }\n\n const { diff } = textDiff\n // Point references location inside the diff => transform the point based on the location\n // the diff will be applied to and add the offset inside the diff.\n if (point.offset <= diff.start + diff.text.length) {\n const anchor = { path: point.path, offset: diff.start }\n const transformed = Point.transform(anchor, op, {\n affinity: 'backward',\n })\n\n if (!transformed) {\n return null\n }\n\n return {\n path: transformed.path,\n offset: transformed.offset + point.offset - diff.start,\n }\n }\n\n // Point references location after the diff\n const anchor = {\n path: point.path,\n offset: point.offset - diff.text.length + diff.end - diff.start,\n }\n const transformed = Point.transform(anchor, op, {\n affinity: 'backward',\n })\n if (!transformed) {\n return null\n }\n\n if (\n op.type === 'split_node' &&\n Path.equals(op.path, point.path) &&\n anchor.offset < op.position &&\n diff.start < op.position\n ) {\n return transformed\n }\n\n return {\n path: transformed.path,\n offset: transformed.offset + diff.text.length - diff.end + diff.start,\n }\n}\n\nexport function transformPendingRange(\n editor: Editor,\n range: Range,\n op: Operation\n): Range | null {\n const anchor = transformPendingPoint(editor, range.anchor, op)\n if (!anchor) {\n return null\n }\n\n if (Range.isCollapsed(range)) {\n return { anchor, focus: anchor }\n }\n\n const focus = transformPendingPoint(editor, range.focus, op)\n if (!focus) {\n return null\n }\n\n return { anchor, focus }\n}\n\nexport function transformTextDiff(\n textDiff: TextDiff,\n op: Operation\n): TextDiff | null {\n const { path, diff, id } = textDiff\n\n switch (op.type) {\n case 'insert_text': {\n if (!Path.equals(op.path, path) || op.offset >= diff.end) {\n return textDiff\n }\n\n if (op.offset <= diff.start) {\n return {\n diff: {\n start: op.text.length + diff.start,\n end: op.text.length + diff.end,\n text: diff.text,\n },\n id,\n path,\n }\n }\n\n return {\n diff: {\n start: diff.start,\n end: diff.end + op.text.length,\n text: diff.text,\n },\n id,\n path,\n }\n }\n case 'remove_text': {\n if (!Path.equals(op.path, path) || op.offset >= diff.end) {\n return textDiff\n }\n\n if (op.offset + op.text.length <= diff.start) {\n return {\n diff: {\n start: diff.start - op.text.length,\n end: diff.end - op.text.length,\n text: diff.text,\n },\n id,\n path,\n }\n }\n\n return {\n diff: {\n start: diff.start,\n end: diff.end - op.text.length,\n text: diff.text,\n },\n id,\n path,\n }\n }\n case 'split_node': {\n if (!Path.equals(op.path, path) || op.position >= diff.end) {\n return {\n diff,\n id,\n path: Path.transform(path, op, { affinity: 'backward' })!,\n }\n }\n\n if (op.position > diff.start) {\n return {\n diff: {\n start: diff.start,\n end: Math.min(op.position, diff.end),\n text: diff.text,\n },\n id,\n path,\n }\n }\n\n return {\n diff: {\n start: diff.start - op.position,\n end: diff.end - op.position,\n text: diff.text,\n },\n id,\n path: Path.transform(path, op, { affinity: 'forward' })!,\n }\n }\n case 'merge_node': {\n if (!Path.equals(op.path, path)) {\n return {\n diff,\n id,\n path: Path.transform(path, op)!,\n }\n }\n\n return {\n diff: {\n start: diff.start + op.position,\n end: diff.end + op.position,\n text: diff.text,\n },\n id,\n path: Path.transform(path, op)!,\n }\n }\n }\n\n const newPath = Path.transform(path, op)\n if (!newPath) {\n return null\n }\n\n return {\n diff,\n path: newPath,\n id,\n }\n}\n","import { DebouncedFunc } from 'lodash'\nimport { Editor, Node, Path, Point, Range, Text, Transforms } from 'slate'\nimport { ReactEditor } from '../../plugin/react-editor'\nimport {\n applyStringDiff,\n mergeStringDiffs,\n normalizePoint,\n normalizeRange,\n normalizeStringDiff,\n StringDiff,\n targetRange,\n TextDiff,\n verifyDiffState,\n} from '../../utils/diff-text'\nimport { isDOMSelection, isTrackedMutation } from '../../utils/dom'\nimport {\n EDITOR_TO_FORCE_RENDER,\n EDITOR_TO_PENDING_ACTION,\n EDITOR_TO_PENDING_DIFFS,\n EDITOR_TO_PENDING_INSERTION_MARKS,\n EDITOR_TO_PENDING_SELECTION,\n EDITOR_TO_PLACEHOLDER_ELEMENT,\n EDITOR_TO_USER_MARKS,\n IS_COMPOSING,\n IS_NODE_MAP_DIRTY,\n} from '../../utils/weak-maps'\n\nexport type Action = { at?: Point | Range; run: () => void }\n\n// https://github.com/facebook/draft-js/blob/main/src/component/handlers/composition/DraftEditorCompositionHandler.js#L41\n// When using keyboard English association function, conpositionEnd triggered too fast, resulting in after `insertText` still maintain association state.\nconst RESOLVE_DELAY = 25\n\n// Time with no user interaction before the current user action is considered as done.\nconst FLUSH_DELAY = 200\n\n// Replace with `const debug = console.log` to debug\nconst debug = (..._: unknown[]) => {}\n\n// Type guard to check if a value is a DataTransfer\nconst isDataTransfer = (value: any): value is DataTransfer =>\n value?.constructor.name === 'DataTransfer'\n\nexport type CreateAndroidInputManagerOptions = {\n editor: ReactEditor\n\n scheduleOnDOMSelectionChange: DebouncedFunc<() => void>\n onDOMSelectionChange: DebouncedFunc<() => void>\n}\n\nexport type AndroidInputManager = {\n flush: () => void\n scheduleFlush: () => void\n\n hasPendingDiffs: () => boolean\n hasPendingAction: () => boolean\n hasPendingChanges: () => boolean\n isFlushing: () => boolean | 'action'\n\n handleUserSelect: (range: Range | null) => void\n handleCompositionEnd: (event: React.CompositionEvent<HTMLDivElement>) => void\n handleCompositionStart: (\n event: React.CompositionEvent<HTMLDivElement>\n ) => void\n handleDOMBeforeInput: (event: InputEvent) => void\n handleKeyDown: (event: React.KeyboardEvent<HTMLDivElement>) => void\n\n handleDomMutations: (mutations: MutationRecord[]) => void\n handleInput: () => void\n}\n\nexport function createAndroidInputManager({\n editor,\n scheduleOnDOMSelectionChange,\n onDOMSelectionChange,\n}: CreateAndroidInputManagerOptions): AndroidInputManager {\n let flushing: 'action' | boolean = false\n let compositionEndTimeoutId: ReturnType<typeof setTimeout> | null = null\n let flushTimeoutId: ReturnType<typeof setTimeout> | null = null\n let actionTimeoutId: ReturnType<typeof setTimeout> | null = null\n\n let idCounter = 0\n let insertPositionHint: StringDiff | null | false = false\n\n const applyPendingSelection = () => {\n const pendingSelection = EDITOR_TO_PENDING_SELECTION.get(editor)\n EDITOR_TO_PENDING_SELECTION.delete(editor)\n\n if (pendingSelection) {\n const { selection } = editor\n const normalized = normalizeRange(editor, pendingSelection)\n\n debug('apply pending selection', pendingSelection, normalized)\n\n if (normalized && (!selection || !Range.equals(normalized, selection))) {\n Transforms.select(editor, normalized)\n }\n }\n }\n\n const performAction = () => {\n const action = EDITOR_TO_PENDING_ACTION.get(editor)\n EDITOR_TO_PENDING_ACTION.delete(editor)\n if (!action) {\n return\n }\n\n if (action.at) {\n const target = Point.isPoint(action.at)\n ? normalizePoint(editor, action.at)\n : normalizeRange(editor, action.at)\n\n if (!target) {\n return\n }\n\n const targetRange = Editor.range(editor, target)\n if (!editor.selection || !Range.equals(editor.selection, targetRange)) {\n Transforms.select(editor, target)\n }\n }\n\n action.run()\n }\n\n const flush = () => {\n if (flushTimeoutId) {\n clearTimeout(flushTimeoutId)\n flushTimeoutId = null\n }\n\n if (actionTimeoutId) {\n clearTimeout(actionTimeoutId)\n actionTimeoutId = null\n }\n\n if (!hasPendingDiffs() && !hasPendingAction()) {\n applyPendingSelection()\n return\n }\n\n if (!flushing) {\n flushing = true\n setTimeout(() => (flushing = false))\n }\n\n if (hasPendingAction()) {\n flushing = 'action'\n }\n\n const selectionRef =\n editor.selection &&\n Editor.rangeRef(editor, editor.selection, { affinity: 'forward' })\n EDITOR_TO_USER_MARKS.set(editor, editor.marks)\n\n debug(\n 'flush',\n EDITOR_TO_PENDING_ACTION.get(editor),\n EDITOR_TO_PENDING_DIFFS.get(editor)\n )\n\n let scheduleSelectionChange = hasPendingDiffs()\n\n let diff: TextDiff | undefined\n while ((diff = EDITOR_TO_PENDING_DIFFS.get(editor)?.[0])) {\n const pendingMarks = EDITOR_TO_PENDING_INSERTION_MARKS.get(editor)\n\n if (pendingMarks !== undefined) {\n EDITOR_TO_PENDING_INSERTION_MARKS.delete(editor)\n editor.marks = pendingMarks\n }\n\n if (pendingMarks && insertPositionHint === false) {\n insertPositionHint = null\n debug('insert after mark placeholder')\n }\n\n const range = targetRange(diff)\n if (!editor.selection || !Range.equals(editor.selection, range)) {\n Transforms.select(editor, range)\n }\n\n if (diff.diff.text) {\n Editor.insertText(editor, diff.diff.text)\n } else {\n Editor.deleteFragment(editor)\n }\n\n // Remove diff only after we have applied it to account for it when transforming\n // pending ranges.\n EDITOR_TO_PENDING_DIFFS.set(\n editor,\n EDITOR_TO_PENDING_DIFFS.get(editor)?.filter(\n ({ id }) => id !== diff!.id\n )!\n )\n\n if (!verifyDiffState(editor, diff)) {\n debug('invalid diff state')\n scheduleSelectionChange = false\n EDITOR_TO_PENDING_ACTION.delete(editor)\n EDITOR_TO_USER_MARKS.delete(editor)\n flushing = 'action'\n\n // Ensure we don't restore the pending user (dom) selection\n // since the document and dom state do not match.\n EDITOR_TO_PENDING_SELECTION.delete(editor)\n scheduleOnDOMSelectionChange.cancel()\n onDOMSelectionChange.cancel()\n selectionRef?.unref()\n }\n }\n\n const selection = selectionRef?.unref()\n if (\n selection &&\n !EDITOR_TO_PENDING_SELECTION.get(editor) &&\n (!editor.selection || !Range.equals(selection, editor.selection))\n ) {\n Transforms.select(editor, selection)\n }\n\n if (hasPendingAction()) {\n performAction()\n return\n }\n\n // COMPAT: The selectionChange event is fired after the action is performed,\n // so we have to manually schedule it to ensure we don't 'throw away' the selection\n // while rendering if we have pending changes.\n if (scheduleSelectionChange) {\n debug('scheduleOnDOMSelectionChange pending changes')\n scheduleOnDOMSelectionChange()\n }\n\n scheduleOnDOMSelectionChange.flush()\n onDOMSelectionChange.flush()\n\n applyPendingSelection()\n\n const userMarks = EDITOR_TO_USER_MARKS.get(editor)\n EDITOR_TO_USER_MARKS.delete(editor)\n if (userMarks !== undefined) {\n editor.marks = userMarks\n editor.onChange()\n }\n }\n\n const handleCompositionEnd = (\n _event: React.CompositionEvent<HTMLDivElement>\n ) => {\n if (compositionEndTimeoutId) {\n clearTimeout(compositionEndTimeoutId)\n }\n\n compositionEndTimeoutId = setTimeout(() => {\n IS_COMPOSING.set(editor, false)\n flush()\n }, RESOLVE_DELAY)\n }\n\n const handleCompositionStart = (\n _event: React.CompositionEvent<HTMLDivElement>\n ) => {\n debug('composition start')\n\n IS_COMPOSING.set(editor, true)\n\n if (compositionEndTimeoutId) {\n clearTimeout(compositionEndTimeoutId)\n compositionEndTimeoutId = null\n }\n }\n\n const updatePlaceholderVisibility = (forceHide = false) => {\n const placeholderElement = EDITOR_TO_PLACEHOLDER_ELEMENT.get(editor)\n if (!placeholderElement) {\n return\n }\n\n if (hasPendingDiffs() || forceHide) {\n placeholderElement.style.display = 'none'\n return\n }\n\n placeholderElement.style.removeProperty('display')\n }\n\n const storeDiff = (path: Path, diff: StringDiff) => {\n debug('storeDiff', path, diff)\n\n const pendingDiffs = EDITOR_TO_PENDING_DIFFS.get(editor) ?? []\n EDITOR_TO_PENDING_DIFFS.set(editor, pendingDiffs)\n\n const target = Node.leaf(editor, path)\n const idx = pendingDiffs.findIndex(change => Path.equals(change.path, path))\n if (idx < 0) {\n const normalized = normalizeStringDiff(target.text, diff)\n if (normalized) {\n pendingDiffs.push({ path, diff, id: idCounter++ })\n }\n\n updatePlaceholderVisibility()\n return\n }\n\n const merged = mergeStringDiffs(target.text, pendingDiffs[idx].diff, diff)\n if (!merged) {\n pendingDiffs.splice(idx, 1)\n updatePlaceholderVisibility()\n return\n }\n\n pendingDiffs[idx] = {\n ...pendingDiffs[idx],\n diff: merged,\n }\n }\n\n const scheduleAction = (\n run: () => void,\n { at }: { at?: Point | Range } = {}\n ): void => {\n insertPositionHint = false\n debug('scheduleAction', { at, run })\n\n EDITOR_TO_PENDING_SELECTION.delete(editor)\n scheduleOnDOMSelectionChange.cancel()\n onDOMSelectionChange.cancel()\n\n if (hasPendingAction()) {\n flush()\n }\n\n EDITOR_TO_PENDING_ACTION.set(editor, { at, run })\n\n // COMPAT: When deleting before a non-contenteditable element chrome only fires a beforeinput,\n // (no input) and doesn't perform any dom mutations. Without a flush timeout we would never flush\n // in this case and thus never actually perform the action.\n actionTimeoutId = setTimeout(flush)\n }\n\n const handleDOMBeforeInput = (event: InputEvent): void => {\n if (flushTimeoutId) {\n clearTimeout(flushTimeoutId)\n flushTimeoutId = null\n }\n\n if (IS_NODE_MAP_DIRTY.get(editor)) {\n return\n }\n\n const { inputType: type } = event\n let targetRange: Range | null = null\n const data: DataTransfer | string | undefined =\n (event as any).dataTransfer || event.data || undefined\n\n if (\n insertPositionHint !== false &&\n type !== 'insertText' &&\n type !== 'insertCompositionText'\n ) {\n insertPositionHint = false\n }\n\n let [nativeTargetRange] = (event as any).getTargetRanges()\n if (nativeTargetRange) {\n targetRange = ReactEditor.toSlateRange(editor, nativeTargetRange, {\n exactMatch: false,\n suppressThrow: true,\n })\n }\n\n // COMPAT: SelectionChange event is fired after the action is performed, so we\n // have to manually get the selection here to ensure it's up-to-date.\n const window = ReactEditor.getWindow(editor)\n const domSelection = window.getSelection()\n if (!targetRange && domSelection) {\n nativeTargetRange = domSelection\n targetRange = ReactEditor.toSlateRange(editor, domSelection, {\n exactMatch: false,\n suppressThrow: true,\n })\n }\n\n targetRange = targetRange ?? editor.selection\n if (!targetRange) {\n return\n }\n\n // By default, the input manager tries to store text diffs so that we can\n // defer flushing them at a later point in time. We don't want to flush\n // for every input event as this can be expensive. However, there are some\n // scenarios where we cannot safely store the text diff and must instead\n // schedule an action to let Slate normalize the editor state.\n let canStoreDiff = true\n\n if (type.startsWith('delete')) {\n if (Range.isExpanded(targetRange)) {\n const [start, end] = Range.edges(targetRange)\n const leaf = Node.leaf(editor, start.path)\n\n if (leaf.text.length === start.offset && end.offset === 0) {\n const next = Editor.next(editor, {\n at: start.path,\n match: Text.isText,\n })\n if (next && Path.equals(next[1], end.path)) {\n targetRange = { anchor: end, focus: end }\n }\n }\n }\n\n const direction = type.endsWith('Backward') ? 'backward' : 'forward'\n const [start, end] = Range.edges(targetRange)\n const [leaf, path] = Editor.leaf(editor, start.path)\n\n const diff = {\n text: '',\n start: start.offset,\n end: end.offset,\n }\n const pendingDiffs = EDITOR_TO_PENDING_DIFFS.get(editor)\n const relevantPendingDiffs = pendingDiffs?.find(change =>\n Path.equals(change.path, path)\n )\n const diffs = relevantPendingDiffs\n ? [relevantPendingDiffs.diff, diff]\n : [diff]\n const text = applyStringDiff(leaf.text, ...diffs)\n\n if (text.length === 0) {\n // Text leaf will be removed, so we need to schedule an\n // action to remove it so that Slate can normalize instead\n // of storing as a diff\n canStoreDiff = false\n }\n\n if (Range.isExpanded(targetRange)) {\n if (\n canStoreDiff &&\n Path.equals(targetRange.anchor.path, targetRange.focus.path)\n ) {\n const point = { path: targetRange.anchor.path, offset: start.offset }\n const range = Editor.range(editor, point, point)\n handleUserSelect(range)\n\n return storeDiff(targetRange.anchor.path, {\n text: '',\n end: end.offset,\n start: start.offset,\n })\n }\n\n return scheduleAction(\n () => Editor.deleteFragment(editor, { direction }),\n { at: targetRange }\n )\n }\n }\n\n switch (type) {\n case 'deleteByComposition':\n case 'deleteByCut':\n case 'deleteByDrag': {\n return scheduleAction(() => Editor.deleteFragment(editor), {\n at: targetRange,\n })\n }\n\n case 'deleteContent':\n case 'deleteContentForward': {\n const { anchor } = targetRange\n if (canStoreDiff && Range.isCollapsed(targetRange)) {\n const targetNode = Node.leaf(editor, anchor.path)\n\n if (anchor.offset < targetNode.text.length) {\n return storeDiff(anchor.path, {\n text: '',\n start: anchor.offset,\n end: anchor.offset + 1,\n })\n }\n }\n\n return scheduleAction(() => Editor.deleteForward(editor), {\n at: targetRange,\n })\n }\n\n case 'deleteContentBackward': {\n const { anchor } = targetRange\n\n // If we have a mismatch between the native and slate selection being collapsed\n // we are most likely deleting a zero-width placeholder and thus should perform it\n // as an action to ensure correct behavior (mostly happens with mark placeholders)\n const nativeCollapsed = isDOMSelection(nativeTargetRange)\n ? nativeTargetRange.isCollapsed\n : !!nativeTargetRange?.collapsed\n\n if (\n canStoreDiff &&\n nativeCollapsed &&\n Range.isCollapsed(targetRange) &&\n anchor.offset > 0\n ) {\n return storeDiff(anchor.path, {\n text: '',\n start: anchor.offset - 1,\n end: anchor.offset,\n })\n }\n\n return scheduleAction(() => Editor.deleteBackward(editor), {\n at: targetRange,\n })\n }\n\n case 'deleteEntireSoftLine': {\n return scheduleAction(\n () => {\n Editor.deleteBackward(editor, { unit: 'line' })\n Editor.deleteForward(editor, { unit: 'line' })\n },\n { at: targetRange }\n )\n }\n\n case 'deleteHardLineBackward': {\n return scheduleAction(\n () => Editor.deleteBackward(editor, { unit: 'block' }),\n { at: targetRange }\n )\n }\n\n case 'deleteSoftLineBackward': {\n return scheduleAction(\n () => Editor.deleteBackward(editor, { unit: 'line' }),\n { at: targetRange }\n )\n }\n\n case 'deleteHardLineForward': {\n return scheduleAction(\n () => Editor.deleteForward(editor, { unit: 'block' }),\n { at: targetRange }\n )\n }\n\n case 'deleteSoftLineForward': {\n return scheduleAction(\n () => Editor.deleteForward(editor, { unit: 'line' }),\n { at: targetRange }\n )\n }\n\n case 'deleteWordBackward': {\n return scheduleAction(\n () => Editor.deleteBackward(editor, { unit: 'word' }),\n { at: targetRange }\n )\n }\n\n case 'deleteWordForward': {\n return scheduleAction(\n () => Editor.deleteForward(editor, { unit: 'word' }),\n { at: targetRange }\n )\n }\n\n case 'insertLineBreak': {\n return scheduleAction(() => Editor.insertSoftBreak(editor), {\n at: targetRange,\n })\n }\n\n case 'insertParagraph': {\n return scheduleAction(() => Editor.insertBreak(editor), {\n at: targetRange,\n })\n }\n case 'insertCompositionText':\n case 'deleteCompositionText':\n case 'insertFromComposition':\n case 'insertFromDrop':\n case 'insertFromPaste':\n case 'insertFromYank':\n case 'insertReplacementText':\n case 'insertText': {\n if (isDataTransfer(data)) {\n return scheduleAction(() => ReactEditor.insertData(editor, data), {\n at: targetRange,\n })\n }\n\n let text = data ?? ''\n\n // COMPAT: If we are writing inside a placeholder, the ime inserts the text inside\n // the placeholder itself and thus includes the zero-width space inside edit events.\n if (EDITOR_TO_PENDING_INSERTION_MARKS.get(editor)) {\n text = text.replace('\\uFEFF', '')\n }\n\n // Pastes from the Android clipboard will generate `insertText` events.\n // If the copied text contains any newlines, Android will append an\n // extra newline to the end of the copied text.\n if (type === 'insertText' && /.*\\n.*\\n$/.test(text)) {\n text = text.slice(0, -1)\n }\n\n // If the text includes a newline, split it at newlines and paste each component\n // string, with soft breaks in between each.\n if (text.includes('\\n')) {\n return scheduleAction(\n () => {\n const parts = text.split('\\n')\n parts.forEach((line, i) => {\n if (line) {\n Editor.insertText(editor, line)\n }\n if (i !== parts.length - 1) {\n Editor.insertSoftBreak(editor)\n }\n })\n },\n {\n at: targetRange,\n }\n )\n }\n\n if (Path.equals(targetRange.anchor.path, targetRange.focus.path)) {\n const [start, end] = Range.edges(targetRange)\n\n const diff = {\n start: start.offset,\n end: end.offset,\n text,\n }\n\n // COMPAT: Swiftkey has a weird bug where the target range of the 2nd word\n // inserted after a mark placeholder is inserted with an anchor offset off by 1.\n // So writing 'some text' will result in 'some ttext'. Luckily all 'normal' insert\n // text events are fired with the correct target ranges, only the final 'insertComposition'\n // isn't, so we can adjust the target range start offset if we are confident this is the\n // swiftkey insert causing the issue.\n if (text && insertPositionHint && type === 'insertCompositionText') {\n const hintPosition =\n insertPositionHint.start + insertPositionHint.text.search(/\\S|$/)\n const diffPosition = diff.start + diff.text.search(/\\S|$/)\n\n if (\n diffPosition === hintPosition + 1 &&\n diff.end ===\n insertPositionHint.start + insertPositionHint.text.length\n ) {\n debug('adjusting swiftKey insert position using hint')\n diff.start -= 1\n insertPositionHint = null\n scheduleFlush()\n } else {\n insertPositionHint = false\n }\n } else if (type === 'insertText') {\n if (insertPositionHint === null) {\n insertPositionHint = diff\n } else if (\n insertPositionHint &&\n Range.isCollapsed(targetRange) &&\n insertPositionHint.end + insertPositionHint.text.length ===\n start.offset\n ) {\n insertPositionHint = {\n ...insertPositionHint,\n text: insertPositionHint.text + text,\n }\n } else {\n insertPositionHint = false\n }\n } else {\n insertPositionHint = false\n }\n\n if (canStoreDiff) {\n storeDiff(start.path, diff)\n return\n }\n }\n\n return scheduleAction(() => Editor.insertText(editor, text), {\n at: targetRange,\n })\n }\n }\n }\n\n const hasPendingAction = () => {\n return !!EDITOR_TO_PENDING_ACTION.get(editor)\n }\n\n const hasPendingDiffs = () => {\n return !!EDITOR_TO_PENDING_DIFFS.get(editor)?.length\n }\n\n const hasPendingChanges = () => {\n return hasPendingAction() || hasPendingDiffs()\n }\n\n const isFlushing = () => {\n return flushing\n }\n\n const handleUserSelect = (range: Range | null) => {\n EDITOR_TO_PENDING_SELECTION.set(editor, range)\n\n if (flushTimeoutId) {\n clearTimeout(flushTimeoutId)\n flushTimeoutId = null\n }\n\n const { selection } = editor\n if (!range) {\n return\n }\n\n const pathChanged =\n !selection || !Path.equals(selection.anchor.path, range.anchor.path)\n const parentPathChanged =\n !selection ||\n !Path.equals(\n selection.anchor.path.slice(0, -1),\n range.anchor.path.slice(0, -1)\n )\n\n if ((pathChanged && insertPositionHint) || parentPathChanged) {\n insertPositionHint = false\n }\n\n if (pathChanged || hasPendingDiffs()) {\n flushTimeoutId = setTimeout(flush, FLUSH_DELAY)\n }\n }\n\n const handleInput = () => {\n if (hasPendingAction() || !hasPendingDiffs()) {\n debug('flush input')\n flush()\n }\n }\n\n const handleKeyDown = (_: React.KeyboardEvent) => {\n // COMPAT: Swiftkey closes the keyboard when typing inside a empty node\n // directly next to a non-contenteditable element (= the placeholder).\n // The only event fired soon enough for us to allow hiding the placeholder\n // without swiftkey picking it up is the keydown event, so we have to hide it\n // here. See https://github.com/ianstormtaylor/slate/pull/4988#issuecomment-1201050535\n if (!hasPendingDiffs()) {\n updatePlaceholderVisibility(true)\n setTimeout(updatePlaceholderVisibility)\n }\n }\n\n const scheduleFlush = () => {\n if (!hasPendingAction()) {\n actionTimeoutId = setTimeout(flush)\n }\n }\n\n const handleDomMutations = (mutations: MutationRecord[]) => {\n if (hasPendingDiffs() || hasPendingAction()) {\n return\n }\n\n if (\n mutations.some(mutation => isTrackedMutation(editor, mutation, mutations))\n ) {\n // Cause a re-render to restore the dom state if we encounter tracked mutations without\n // a corresponding pending action.\n EDITOR_TO_FORCE_RENDER.get(editor)?.()\n }\n }\n\n return {\n flush,\n scheduleFlush,\n\n hasPendingDiffs,\n hasPendingAction,\n hasPendingChanges,\n\n isFlushing,\n\n handleUserSelect,\n handleCompositionEnd,\n handleCompositionStart,\n handleDOMBeforeInput,\n handleKeyDown,\n\n handleDomMutations,\n handleInput,\n }\n}\n","import { useEffect, useRef } from 'react'\n\nexport function useIsMounted() {\n const isMountedRef = useRef(false)\n\n useEffect(() => {\n isMountedRef.current = true\n return () => {\n isMountedRef.current = false\n }\n }, [])\n\n return isMountedRef.current\n}\n","import { useLayoutEffect, useEffect } from 'react'\nimport { CAN_USE_DOM } from '../utils/environment'\n\n/**\n * Prevent warning on SSR by falling back to useEffect when DOM isn't available\n */\n\nexport const useIsomorphicLayoutEffect = CAN_USE_DOM\n ? useLayoutEffect\n : useEffect\n","import { RefObject, useEffect, useState } from 'react'\nimport { useIsomorphicLayoutEffect } from './use-isomorphic-layout-effect'\n\nexport function useMutationObserver(\n node: RefObject<HTMLElement>,\n callback: MutationCallback,\n options: MutationObserverInit\n) {\n const [mutationObserver] = useState(() => new MutationObserver(callback))\n\n useIsomorphicLayoutEffect(() => {\n // Discard mutations caused during render phase. This works due to react calling\n // useLayoutEffect synchronously after the render phase before the next tick.\n mutationObserver.takeRecords()\n })\n\n useEffect(() => {\n if (!node.current) {\n throw new Error('Failed to attach MutationObserver, `node` is undefined')\n }\n\n mutationObserver.observe(node.current, options)\n return () => mutationObserver.disconnect()\n }, [mutationObserver, node, options])\n}\n","import { RefObject, useState } from 'react'\nimport { useSlateStatic } from '../use-slate-static'\nimport { IS_ANDROID } from '../../utils/environment'\nimport { EDITOR_TO_SCHEDULE_FLUSH } from '../../utils/weak-maps'\nimport {\n createAndroidInputManager,\n CreateAndroidInputManagerOptions,\n} from './android-input-manager'\nimport { useIsMounted } from '../use-is-mounted'\nimport { useMutationObserver } from '../use-mutation-observer'\n\ntype UseAndroidInputManagerOptions = {\n node: RefObject<HTMLElement>\n} & Omit<\n CreateAndroidInputManagerOptions,\n 'editor' | 'onUserInput' | 'receivedUserInput'\n>\n\nconst MUTATION_OBSERVER_CONFIG: MutationObserverInit = {\n subtree: true,\n childList: true,\n characterData: true,\n}\n\nexport const useAndroidInputManager = !IS_ANDROID\n ? () => null\n : ({ node, ...options }: UseAndroidInputManagerOptions) => {\n if (!IS_ANDROID) {\n return null\n }\n\n const editor = useSlateStatic()\n const isMounted = useIsMounted()\n\n const [inputManager] = useState(() =>\n createAndroidInputManager({\n editor,\n ...options,\n })\n )\n\n useMutationObserver(\n node,\n inputManager.handleDomMutations,\n MUTATION_OBSERVER_CONFIG\n )\n\n EDITOR_TO_SCHEDULE_FLUSH.set(editor, inputManager.scheduleFlush)\n if (isMounted) {\n inputManager.flush()\n }\n\n return inputManager\n }\n","import { Range } from 'slate'\nimport { PLACEHOLDER_SYMBOL } from './weak-maps'\n\nexport const shallowCompare = (\n obj1: { [key: string]: unknown },\n obj2: { [key: string]: unknown }\n) =>\n Object.keys(obj1).length === Object.keys(obj2).length &&\n Object.keys(obj1).every(\n key => obj2.hasOwnProperty(key) && obj1[key] === obj2[key]\n )\n\nconst isDecorationFlagsEqual = (range: Range, other: Range) => {\n const { anchor: rangeAnchor, focus: rangeFocus, ...rangeOwnProps } = range\n const { anchor: otherAnchor, focus: otherFocus, ...otherOwnProps } = other\n\n return (\n range[PLACEHOLDER_SYMBOL] === other[PLACEHOLDER_SYMBOL] &&\n shallowCompare(rangeOwnProps, otherOwnProps)\n )\n}\n\n/**\n * Check if a list of decorator ranges are equal to another.\n *\n * PERF: this requires the two lists to also have the ranges inside them in the\n * same order, but this is an okay constraint for us since decorations are\n * kept in order, and the odd case where they aren't is okay to re-render for.\n */\n\nexport const isElementDecorationsEqual = (\n list: Range[],\n another: Range[]\n): boolean => {\n if (list.length !== another.length) {\n return false\n }\n\n for (let i = 0; i < list.length; i++) {\n const range = list[i]\n const other = another[i]\n\n if (!Range.equals(range, other) || !isDecorationFlagsEqual(range, other)) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Check if a list of decorator ranges are equal to another.\n *\n * PERF: this requires the two lists to also have the ranges inside them in the\n * same order, but this is an okay constraint for us since decorations are\n * kept in order, and the odd case where they aren't is okay to re-render for.\n */\n\nexport const isTextDecorationsEqual = (\n list: Range[],\n another: Range[]\n): boolean => {\n if (list.length !== another.length) {\n return false\n }\n\n for (let i = 0; i < list.length; i++) {\n const range = list[i]\n const other = another[i]\n\n // compare only offsets because paths doesn't matter for text\n if (\n range.anchor.offset !== other.anchor.offset ||\n range.focus.offset !== other.focus.offset ||\n !isDecorationFlagsEqual(range, other)\n ) {\n return false\n }\n }\n\n return true\n}\n","import React, { forwardRef, memo, useRef, useState } from 'react'\nimport { Editor, Text, Path, Element, Node } from 'slate'\n\nimport { ReactEditor, useSlateStatic } from '..'\nimport { useIsomorphicLayoutEffect } from '../hooks/use-isomorphic-layout-effect'\nimport { IS_ANDROID, IS_IOS } from '../utils/environment'\nimport { MARK_PLACEHOLDER_SYMBOL } from '../utils/weak-maps'\n\n/**\n * Leaf content strings.\n */\n\nconst String = (props: {\n isLast: boolean\n leaf: Text\n parent: Element\n text: Text\n}) => {\n const { isLast, leaf, parent, text } = props\n const editor = useSlateStatic()\n const path = ReactEditor.findPath(editor, text)\n const parentPath = Path.parent(path)\n const isMarkPlaceholder = Boolean(leaf[MARK_PLACEHOLDER_SYMBOL])\n\n // COMPAT: Render text inside void nodes with a zero-width space.\n // So the node can contain selection but the text is not visible.\n if (editor.isVoid(parent)) {\n return <ZeroWidthString length={Node.string(parent).length} />\n }\n\n // COMPAT: If this is the last text node in an empty block, render a zero-\n // width space that will convert into a line break when copying and pasting\n // to support expected plain text.\n if (\n leaf.text === '' &&\n parent.children[parent.children.length - 1] === text &&\n !editor.isInline(parent) &&\n Editor.string(editor, parentPath) === ''\n ) {\n return <ZeroWidthString isLineBreak isMarkPlaceholder={isMarkPlaceholder} />\n }\n\n // COMPAT: If the text is empty, it's because it's on the edge of an inline\n // node, so we render a zero-width space so that the selection can be\n // inserted next to it still.\n if (leaf.text === '') {\n return <ZeroWidthString isMarkPlaceholder={isMarkPlaceholder} />\n }\n\n // COMPAT: Browsers will collapse trailing new lines at the end of blocks,\n // so we need to add an extra trailing new lines to prevent that.\n if (isLast && leaf.text.slice(-1) === '\\n') {\n return <TextString isTrailing text={leaf.text} />\n }\n\n return <TextString text={leaf.text} />\n}\n\n/**\n * Leaf strings with text in them.\n */\nconst TextString = (props: { text: string; isTrailing?: boolean }) => {\n const { text, isTrailing = false } = props\n const ref = useRef<HTMLSpanElement>(null)\n const getTextContent = () => {\n return `${text ?? ''}${isTrailing ? '\\n' : ''}`\n }\n const [initialText] = useState(getTextContent)\n\n // This is the actual text rendering boundary where we interface with the DOM\n // The text is not rendered as part of the virtual DOM, as since we handle basic character insertions natively,\n // updating the DOM is not a one way dataflow anymore. What we need here is not reconciliation and diffing\n // with previous version of the virtual DOM, but rather diffing with the actual DOM element, and replace the DOM <span> content\n // exactly if and only if its current content does not match our current virtual DOM.\n // Otherwise the DOM TextNode would always be replaced by React as the user types, which interferes with native text features,\n // eg makes native spellcheck opt out from checking the text node.\n\n // useLayoutEffect: updating our span before browser paint\n useIsomorphicLayoutEffect(() => {\n // null coalescing text to make sure we're not outputing \"null\" as a string in the extreme case it is nullish at runtime\n const textWithTrailing = getTextContent()\n\n if (ref.current && ref.current.textContent !== textWithTrailing) {\n ref.current.textContent = textWithTrailing\n }\n\n // intentionally not specifying dependencies, so that this effect runs on every render\n // as this effectively replaces \"specifying the text in the virtual DOM under the <span> below\" on each render\n })\n\n // We intentionally render a memoized <span> that only receives the initial text content when the component is mounted.\n // We defer to the layout effect above to update the `textContent` of the span element when needed.\n return <MemoizedText ref={ref}>{initialText}</MemoizedText>\n}\n\nconst MemoizedText = memo(\n forwardRef<HTMLSpanElement, { children: string }>((props, ref) => {\n return (\n <span data-slate-string ref={ref}>\n {props.children}\n </span>\n )\n })\n)\n\n/**\n * Leaf strings without text, render as zero-width strings.\n */\n\nexport const ZeroWidthString = (props: {\n length?: number\n isLineBreak?: boolean\n isMarkPlaceholder?: boolean\n}) => {\n const { length = 0, isLineBreak = false, isMarkPlaceholder = false } = props\n\n const attributes: {\n 'data-slate-zero-width': string\n 'data-slate-length': number\n 'data-slate-mark-placeholder'?: boolean\n } = {\n 'data-slate-zero-width': isLineBreak ? 'n' : 'z',\n 'data-slate-length': length,\n }\n\n if (isMarkPlaceholder) {\n attributes['data-slate-mark-placeholder'] = true\n }\n\n return (\n <span {...attributes}>\n {!(IS_ANDROID || IS_IOS) || !isLineBreak ? '\\uFEFF' : null}\n {isLineBreak ? <br /> : null}\n </span>\n )\n}\n\nexport default String\n","import React, {\n useRef,\n useCallback,\n MutableRefObject,\n useState,\n useEffect,\n} from 'react'\nimport { JSX } from 'react'\nimport { Element, Text } from 'slate'\nimport { ResizeObserver as ResizeObserverPolyfill } from '@juggle/resize-observer'\nimport String from './string'\nimport {\n PLACEHOLDER_SYMBOL,\n EDITOR_TO_PLACEHOLDER_ELEMENT,\n EDITOR_TO_FORCE_RENDER,\n} from '../utils/weak-maps'\nimport { RenderLeafProps, RenderPlaceholderProps } from './editable'\nimport { useSlateStatic } from '../hooks/use-slate-static'\nimport { IS_WEBKIT, IS_ANDROID } from '../utils/environment'\n\n// Delay the placeholder on Android to prevent the keyboard from closing.\n// (https://github.com/ianstormtaylor/slate/pull/5368)\nconst PLACEHOLDER_DELAY = IS_ANDROID ? 300 : 0\n\nfunction disconnectPlaceholderResizeObserver(\n placeholderResizeObserver: MutableRefObject<ResizeObserver | null>,\n releaseObserver: boolean\n) {\n if (placeholderResizeObserver.current) {\n placeholderResizeObserver.current.disconnect()\n if (releaseObserver) {\n placeholderResizeObserver.current = null\n }\n }\n}\n\ntype TimerId = ReturnType<typeof setTimeout> | null\n\nfunction clearTimeoutRef(timeoutRef: MutableRefObject<TimerId>) {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current)\n timeoutRef.current = null\n }\n}\n\n/**\n * Individual leaves in a text node with unique formatting.\n */\nconst Leaf = (props: {\n isLast: boolean\n leaf: Text\n parent: Element\n renderPlaceholder: (props: RenderPlaceholderProps) => JSX.Element\n renderLeaf?: (props: RenderLeafProps) => JSX.Element\n text: Text\n}) => {\n const {\n leaf,\n isLast,\n text,\n parent,\n renderPlaceholder,\n renderLeaf = (props: RenderLeafProps) => <DefaultLeaf {...props} />,\n } = props\n\n const editor = useSlateStatic()\n const placeholderResizeObserver = useRef<ResizeObserver | null>(null)\n const placeholderRef = useRef<HTMLElement | null>(null)\n const [showPlaceholder, setShowPlaceholder] = useState(false)\n const showPlaceholderTimeoutRef = useRef<TimerId>(null)\n\n const callbackPlaceholderRef = useCallback(\n (placeholderEl: HTMLElement | null) => {\n disconnectPlaceholderResizeObserver(\n placeholderResizeObserver,\n placeholderEl == null\n )\n\n if (placeholderEl == null) {\n EDITOR_TO_PLACEHOLDER_ELEMENT.delete(editor)\n leaf.onPlaceholderResize?.(null)\n } else {\n EDITOR_TO_PLACEHOLDER_ELEMENT.set(editor, placeholderEl)\n\n if (!placeholderResizeObserver.current) {\n // Create a new observer and observe the placeholder element.\n const ResizeObserver = window.ResizeObserver || ResizeObserverPolyfill\n placeholderResizeObserver.current = new ResizeObserver(() => {\n leaf.onPlaceholderResize?.(placeholderEl)\n })\n }\n placeholderResizeObserver.current.observe(placeholderEl)\n placeholderRef.current = placeholderEl\n }\n },\n [placeholderRef, leaf, editor]\n )\n\n let children = (\n <String isLast={isLast} leaf={leaf} parent={parent} text={text} />\n )\n\n const leafIsPlaceholder = Boolean(leaf[PLACEHOLDER_SYMBOL])\n useEffect(() => {\n if (leafIsPlaceholder) {\n if (!showPlaceholderTimeoutRef.current) {\n // Delay the placeholder, so it will not render in a selection\n showPlaceholderTimeoutRef.current = setTimeout(() => {\n setShowPlaceholder(true)\n showPlaceholderTimeoutRef.current = null\n }, PLACEHOLDER_DELAY)\n }\n } else {\n clearTimeoutRef(showPlaceholderTimeoutRef)\n setShowPlaceholder(false)\n }\n return () => clearTimeoutRef(showPlaceholderTimeoutRef)\n }, [leafIsPlaceholder, setShowPlaceholder])\n\n if (leafIsPlaceholder && showPlaceholder) {\n const placeholderProps: RenderPlaceholderProps = {\n children: leaf.placeholder,\n attributes: {\n 'data-slate-placeholder': true,\n style: {\n position: 'absolute',\n top: 0,\n pointerEvents: 'none',\n width: '100%',\n maxWidth: '100%',\n display: 'block',\n opacity: '0.333',\n userSelect: 'none',\n textDecoration: 'none',\n // Fixes https://github.com/udecode/plate/issues/2315\n WebkitUserModify: IS_WEBKIT ? 'inherit' : undefined,\n },\n contentEditable: false,\n ref: callbackPlaceholderRef,\n },\n }\n\n children = (\n <React.Fragment>\n {renderPlaceholder(placeholderProps)}\n {children}\n </React.Fragment>\n )\n }\n\n // COMPAT: Having the `data-` attributes on these leaf elements ensures that\n // in certain misbehaving browsers they aren't weirdly cloned/destroyed by\n // contenteditable behaviors. (2019/05/08)\n const attributes: {\n 'data-slate-leaf': true\n } = {\n 'data-slate-leaf': true,\n }\n\n return renderLeaf({ attributes, children, leaf, text })\n}\n\nconst MemoizedLeaf = React.memo(Leaf, (prev, next) => {\n return (\n next.parent === prev.parent &&\n next.isLast === prev.isLast &&\n next.renderLeaf === prev.renderLeaf &&\n next.renderPlaceholder === prev.renderPlaceholder &&\n next.text === prev.text &&\n Text.equals(next.leaf, prev.leaf) &&\n next.leaf[PLACEHOLDER_SYMBOL] === prev.leaf[PLACEHOLDER_SYMBOL]\n )\n})\n\nexport const DefaultLeaf = (props: RenderLeafProps) => {\n const { attributes, children } = props\n return <span {...attributes}>{children}</span>\n}\n\nexport default MemoizedLeaf\n","import React, { useCallback, useRef } from 'react'\nimport { Element, Range, Text as SlateText } from 'slate'\nimport { ReactEditor, useSlateStatic } from '..'\nimport { isTextDecorationsEqual } from '../utils/range-list'\nimport {\n EDITOR_TO_KEY_TO_ELEMENT,\n ELEMENT_TO_NODE,\n NODE_TO_ELEMENT,\n} from '../utils/weak-maps'\nimport { RenderLeafProps, RenderPlaceholderProps } from './editable'\nimport Leaf from './leaf'\n\n/**\n * Text.\n */\n\nconst Text = (props: {\n decorations: Range[]\n isLast: boolean\n parent: Element\n renderPlaceholder: (props: RenderPlaceholderProps) => JSX.Element\n renderLeaf?: (props: RenderLeafProps) => JSX.Element\n text: SlateText\n}) => {\n const { decorations, isLast, parent, renderPlaceholder, renderLeaf, text } =\n props\n const editor = useSlateStatic()\n const ref = useRef<HTMLSpanElement | null>(null)\n const leaves = SlateText.decorations(text, decorations)\n const key = ReactEditor.findKey(editor, text)\n const children = []\n\n for (let i = 0; i < leaves.length; i++) {\n const leaf = leaves[i]\n\n children.push(\n <Leaf\n isLast={isLast && i === leaves.length - 1}\n key={`${key.id}-${i}`}\n renderPlaceholder={renderPlaceholder}\n leaf={leaf}\n text={text}\n parent={parent}\n renderLeaf={renderLeaf}\n />\n )\n }\n\n // Update element-related weak maps with the DOM element ref.\n const callbackRef = useCallback(\n (span: HTMLSpanElement | null) => {\n const KEY_TO_ELEMENT = EDITOR_TO_KEY_TO_ELEMENT.get(editor)\n if (span) {\n KEY_TO_ELEMENT?.set(key, span)\n NODE_TO_ELEMENT.set(text, span)\n ELEMENT_TO_NODE.set(span, text)\n } else {\n KEY_TO_ELEMENT?.delete(key)\n NODE_TO_ELEMENT.delete(text)\n if (ref.current) {\n ELEMENT_TO_NODE.delete(ref.current)\n }\n }\n ref.current = span\n },\n [ref, editor, key, text]\n )\n return (\n <span data-slate-node=\"text\" ref={callbackRef}>\n {children}\n </span>\n )\n}\n\nconst MemoizedText = React.memo(Text, (prev, next) => {\n return (\n next.parent === prev.parent &&\n next.isLast === prev.isLast &&\n next.renderLeaf === prev.renderLeaf &&\n next.renderPlaceholder === prev.renderPlaceholder &&\n next.text === prev.text &&\n isTextDecorationsEqual(next.decorations, prev.decorations)\n )\n})\n\nexport default MemoizedText\n","import getDirection from 'direction'\nimport React, { useCallback } from 'react'\nimport { JSX } from 'react'\nimport { Editor, Element as SlateElement, Node, Range } from 'slate'\nimport { ReactEditor, useReadOnly, useSlateStatic } from '..'\nimport useChildren from '../hooks/use-children'\nimport { isElementDecorationsEqual } from '../utils/range-list'\nimport {\n EDITOR_TO_KEY_TO_ELEMENT,\n ELEMENT_TO_NODE,\n NODE_TO_ELEMENT,\n NODE_TO_INDEX,\n NODE_TO_PARENT,\n} from '../utils/weak-maps'\nimport {\n RenderElementProps,\n RenderLeafProps,\n RenderPlaceholderProps,\n} from './editable'\n\nimport Text from './text'\n\n/**\n * Element.\n */\n\nconst Element = (props: {\n decorations: Range[]\n element: SlateElement\n renderElement?: (props: RenderElementProps) => JSX.Element\n renderPlaceholder: (props: RenderPlaceholderProps) => JSX.Element\n renderLeaf?: (props: RenderLeafProps) => JSX.Element\n selection: Range | null\n}) => {\n const {\n decorations,\n element,\n renderElement = (p: RenderElementProps) => <DefaultElement {...p} />,\n renderPlaceholder,\n renderLeaf,\n selection,\n } = props\n const editor = useSlateStatic()\n const readOnly = useReadOnly()\n const isInline = editor.isInline(element)\n const key = ReactEditor.findKey(editor, element)\n const ref = useCallback(\n (ref: HTMLElement | null) => {\n // Update element-related weak maps with the DOM element ref.\n const KEY_TO_ELEMENT = EDITOR_TO_KEY_TO_ELEMENT.get(editor)\n if (ref) {\n KEY_TO_ELEMENT?.set(key, ref)\n NODE_TO_ELEMENT.set(element, ref)\n ELEMENT_TO_NODE.set(ref, element)\n } else {\n KEY_TO_ELEMENT?.delete(key)\n NODE_TO_ELEMENT.delete(element)\n }\n },\n [editor, key, element]\n )\n let children: React.ReactNode = useChildren({\n decorations,\n node: element,\n renderElement,\n renderPlaceholder,\n renderLeaf,\n selection,\n })\n\n // Attributes that the developer must mix into the element in their\n // custom node renderer component.\n const attributes: {\n 'data-slate-node': 'element'\n 'data-slate-void'?: true\n 'data-slate-inline'?: true\n contentEditable?: false\n dir?: 'rtl'\n ref: any\n } = {\n 'data-slate-node': 'element',\n ref,\n }\n\n if (isInline) {\n attributes['data-slate-inline'] = true\n }\n\n // If it's a block node with inline children, add the proper `dir` attribute\n // for text direction.\n if (!isInline && Editor.hasInlines(editor, element)) {\n const text = Node.string(element)\n const dir = getDirection(text)\n\n if (dir === 'rtl') {\n attributes.dir = dir\n }\n }\n\n // If it's a void node, wrap the children in extra void-specific elements.\n if (Editor.isVoid(editor, element)) {\n attributes['data-slate-void'] = true\n\n if (!readOnly && isInline) {\n attributes.contentEditable = false\n }\n\n const Tag = isInline ? 'span' : 'div'\n const [[text]] = Node.texts(element)\n\n children = (\n <Tag\n data-slate-spacer\n style={{\n height: '0',\n color: 'transparent',\n outline: 'none',\n position: 'absolute',\n }}\n >\n <Text\n renderPlaceholder={renderPlaceholder}\n decorations={[]}\n isLast={false}\n parent={element}\n text={text}\n />\n </Tag>\n )\n\n NODE_TO_INDEX.set(text, 0)\n NODE_TO_PARENT.set(text, element)\n }\n\n return renderElement({ attributes, children, element })\n}\n\nconst MemoizedElement = React.memo(Element, (prev, next) => {\n return (\n prev.element === next.element &&\n prev.renderElement === next.renderElement &&\n prev.renderLeaf === next.renderLeaf &&\n prev.renderPlaceholder === next.renderPlaceholder &&\n isElementDecorationsEqual(prev.decorations, next.decorations) &&\n (prev.selection === next.selection ||\n (!!prev.selection &&\n !!next.selection &&\n Range.equals(prev.selection, next.selection)))\n )\n})\n\n/**\n * The default element renderer.\n */\n\nexport const DefaultElement = (props: RenderElementProps) => {\n const { attributes, children, element } = props\n const editor = useSlateStatic()\n const Tag = editor.isInline(element) ? 'span' : 'div'\n return (\n <Tag {...attributes} style={{ position: 'relative' }}>\n {children}\n </Tag>\n )\n}\n\nexport default MemoizedElement\n","import { createContext, useContext } from 'react'\nimport { Range, NodeEntry } from 'slate'\n\n/**\n * A React context for sharing the `decorate` prop of the editable.\n */\n\nexport const DecorateContext = createContext<(entry: NodeEntry) => Range[]>(\n () => []\n)\n\n/**\n * Get the current `decorate` prop of the editable.\n */\n\nexport const useDecorate = (): ((entry: NodeEntry) => Range[]) => {\n return useContext(DecorateContext)\n}\n","import { createContext, useContext } from 'react'\n\n/**\n * A React context for sharing the `selected` state of an element.\n */\n\nexport const SelectedContext = createContext(false)\n\n/**\n * Get the current `selected` state of an element.\n */\n\nexport const useSelected = (): boolean => {\n return useContext(SelectedContext)\n}\n","import React from 'react'\nimport { Ancestor, Descendant, Editor, Element, Range } from 'slate'\nimport {\n RenderElementProps,\n RenderLeafProps,\n RenderPlaceholderProps,\n} from '../components/editable'\n\nimport ElementComponent from '../components/element'\nimport TextComponent from '../components/text'\nimport { ReactEditor } from '../plugin/react-editor'\nimport {\n IS_NODE_MAP_DIRTY,\n NODE_TO_INDEX,\n NODE_TO_PARENT,\n} from '../utils/weak-maps'\nimport { useDecorate } from './use-decorate'\nimport { SelectedContext } from './use-selected'\nimport { useSlateStatic } from './use-slate-static'\n\n/**\n * Children.\n */\n\nconst useChildren = (props: {\n decorations: Range[]\n node: Ancestor\n renderElement?: (props: RenderElementProps) => JSX.Element\n renderPlaceholder: (props: RenderPlaceholderProps) => JSX.Element\n renderLeaf?: (props: RenderLeafProps) => JSX.Element\n selection: Range | null\n}) => {\n const {\n decorations,\n node,\n renderElement,\n renderPlaceholder,\n renderLeaf,\n selection,\n } = props\n const decorate = useDecorate()\n const editor = useSlateStatic()\n IS_NODE_MAP_DIRTY.set(editor as ReactEditor, false)\n const path = ReactEditor.findPath(editor, node)\n const children = []\n const isLeafBlock =\n Element.isElement(node) &&\n !editor.isInline(node) &&\n Editor.hasInlines(editor, node)\n\n for (let i = 0; i < node.children.length; i++) {\n const p = path.concat(i)\n const n = node.children[i] as Descendant\n const key = ReactEditor.findKey(editor, n)\n const range = Editor.range(editor, p)\n const sel = selection && Range.intersection(range, selection)\n const ds = decorate([n, p])\n\n for (const dec of decorations) {\n const d = Range.intersection(dec, range)\n\n if (d) {\n ds.push(d)\n }\n }\n\n if (Element.isElement(n)) {\n children.push(\n <SelectedContext.Provider key={`provider-${key.id}`} value={!!sel}>\n <ElementComponent\n decorations={ds}\n element={n}\n key={key.id}\n renderElement={renderElement}\n renderPlaceholder={renderPlaceholder}\n renderLeaf={renderLeaf}\n selection={sel}\n />\n </SelectedContext.Provider>\n )\n } else {\n children.push(\n <TextComponent\n decorations={ds}\n key={key.id}\n isLast={isLeafBlock && i === node.children.length - 1}\n parent={node}\n renderPlaceholder={renderPlaceholder}\n renderLeaf={renderLeaf}\n text={n}\n />\n )\n }\n\n NODE_TO_INDEX.set(n, i)\n NODE_TO_PARENT.set(n, node)\n }\n\n return children\n}\n\nexport default useChildren\n","import { createContext, useContext } from 'react'\n\n/**\n * A React context for sharing the `readOnly` state of the editor.\n */\n\nexport const ReadOnlyContext = createContext(false)\n\n/**\n * Get the current `readOnly` state of the editor.\n */\n\nexport const useReadOnly = (): boolean => {\n return useContext(ReadOnlyContext)\n}\n","import { createContext, useContext } from 'react'\nimport { Editor } from 'slate'\nimport { ReactEditor } from '../plugin/react-editor'\n\n/**\n * A React context for sharing the editor object, in a way that re-renders the\n * context whenever changes occur.\n */\n\nexport interface SlateContextValue {\n v: number\n editor: ReactEditor\n}\n\nexport const SlateContext = createContext<{\n v: number\n editor: ReactEditor\n} | null>(null)\n\n/**\n * Get the current editor object from the React context.\n */\n\nexport const useSlate = (): Editor => {\n const context = useContext(SlateContext)\n\n if (!context) {\n throw new Error(\n `The \\`useSlate\\` hook must be used inside the <Slate> component's context.`\n )\n }\n\n const { editor } = context\n return editor\n}\n\nexport const useSlateWithV = () => {\n const context = useContext(SlateContext)\n\n if (!context) {\n throw new Error(\n `The \\`useSlate\\` hook must be used inside the <Slate> component's context.`\n )\n }\n\n return context\n}\n","import { useCallback, useEffect, useRef } from 'react'\nimport { ReactEditor } from '../plugin/react-editor'\nimport { useSlateStatic } from './use-slate-static'\n\nexport function useTrackUserInput() {\n const editor = useSlateStatic()\n\n const receivedUserInput = useRef<boolean>(false)\n const animationFrameIdRef = useRef<number>(0)\n\n const onUserInput = useCallback(() => {\n if (receivedUserInput.current) {\n return\n }\n\n receivedUserInput.current = true\n\n const window = ReactEditor.getWindow(editor)\n window.cancelAnimationFrame(animationFrameIdRef.current)\n\n animationFrameIdRef.current = window.requestAnimationFrame(() => {\n receivedUserInput.current = false\n })\n }, [editor])\n\n useEffect(() => () => cancelAnimationFrame(animationFrameIdRef.current), [])\n\n return {\n receivedUserInput,\n onUserInput,\n }\n}\n","export const TRIPLE_CLICK = 3\n","import { isHotkey } from 'is-hotkey'\nimport { IS_APPLE } from './environment'\n\n/**\n * Hotkey mappings for each platform.\n */\n\nconst HOTKEYS = {\n bold: 'mod+b',\n compose: ['down', 'left', 'right', 'up', 'backspace', 'enter'],\n moveBackward: 'left',\n moveForward: 'right',\n moveWordBackward: 'ctrl+left',\n moveWordForward: 'ctrl+right',\n deleteBackward: 'shift?+backspace',\n deleteForward: 'shift?+delete',\n extendBackward: 'shift+left',\n extendForward: 'shift+right',\n italic: 'mod+i',\n insertSoftBreak: 'shift+enter',\n splitBlock: 'enter',\n undo: 'mod+z',\n}\n\nconst APPLE_HOTKEYS = {\n moveLineBackward: 'opt+up',\n moveLineForward: 'opt+down',\n moveWordBackward: 'opt+left',\n moveWordForward: 'opt+right',\n deleteBackward: ['ctrl+backspace', 'ctrl+h'],\n deleteForward: ['ctrl+delete', 'ctrl+d'],\n deleteLineBackward: 'cmd+shift?+backspace',\n deleteLineForward: ['cmd+shift?+delete', 'ctrl+k'],\n deleteWordBackward: 'opt+shift?+backspace',\n deleteWordForward: 'opt+shift?+delete',\n extendLineBackward: 'opt+shift+up',\n extendLineForward: 'opt+shift+down',\n redo: 'cmd+shift+z',\n transposeCharacter: 'ctrl+t',\n}\n\nconst WINDOWS_HOTKEYS = {\n deleteWordBackward: 'ctrl+shift?+backspace',\n deleteWordForward: 'ctrl+shift?+delete',\n redo: ['ctrl+y', 'ctrl+shift+z'],\n}\n\n/**\n * Create a platform-aware hotkey checker.\n */\n\nconst create = (key: string) => {\n const generic = HOTKEYS[<keyof typeof HOTKEYS>key]\n const apple = APPLE_HOTKEYS[<keyof typeof APPLE_HOTKEYS>key]\n const windows = WINDOWS_HOTKEYS[<keyof typeof WINDOWS_HOTKEYS>key]\n const isGeneric = generic && isHotkey(generic)\n const isApple = apple && isHotkey(apple)\n const isWindows = windows && isHotkey(windows)\n\n return (event: KeyboardEvent) => {\n if (isGeneric && isGeneric(event)) return true\n if (IS_APPLE && isApple && isApple(event)) return true\n if (!IS_APPLE && isWindows && isWindows(event)) return true\n return false\n }\n}\n\n/**\n * Hotkeys.\n */\n\nexport default {\n isBold: create('bold'),\n isCompose: create('compose'),\n isMoveBackward: create('moveBackward'),\n isMoveForward: create('moveForward'),\n isDeleteBackward: create('deleteBackward'),\n isDeleteForward: create('deleteForward'),\n isDeleteLineBackward: create('deleteLineBackward'),\n isDeleteLineForward: create('deleteLineForward'),\n isDeleteWordBackward: create('deleteWordBackward'),\n isDeleteWordForward: create('deleteWordForward'),\n isExtendBackward: create('extendBackward'),\n isExtendForward: create('extendForward'),\n isExtendLineBackward: create('extendLineBackward'),\n isExtendLineForward: create('extendLineForward'),\n isItalic: create('italic'),\n isMoveLineBackward: create('moveLineBackward'),\n isMoveLineForward: create('moveLineForward'),\n isMoveWordBackward: create('moveWordBackward'),\n isMoveWordForward: create('moveWordForward'),\n isRedo: create('redo'),\n isSoftBreak: create('insertSoftBreak'),\n isSplitBlock: create('splitBlock'),\n isTransposeCharacter: create('transposeCharacter'),\n isUndo: create('undo'),\n}\n","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}\nmodule.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _setPrototypeOf(o, p);\n}\nmodule.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var setPrototypeOf = require(\"./setPrototypeOf.js\");\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\nmodule.exports = _inherits, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar assertThisInitialized = require(\"./assertThisInitialized.js\");\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n return assertThisInitialized(self);\n}\nmodule.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _getPrototypeOf(o);\n}\nmodule.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","import { RefObject } from 'react'\nimport { ReactEditor } from '../../plugin/react-editor'\nimport { isTrackedMutation } from '../../utils/dom'\n\nexport type RestoreDOMManager = {\n registerMutations: (mutations: MutationRecord[]) => void\n restoreDOM: () => void\n clear: () => void\n}\n\nexport const createRestoreDomManager = (\n editor: ReactEditor,\n receivedUserInput: RefObject<boolean>\n): RestoreDOMManager => {\n let bufferedMutations: MutationRecord[] = []\n\n const clear = () => {\n bufferedMutations = []\n }\n\n const registerMutations = (mutations: MutationRecord[]) => {\n if (!receivedUserInput.current) {\n return\n }\n\n const trackedMutations = mutations.filter(mutation =>\n isTrackedMutation(editor, mutation, mutations)\n )\n\n bufferedMutations.push(...trackedMutations)\n }\n\n function restoreDOM() {\n if (bufferedMutations.length > 0) {\n bufferedMutations.reverse().forEach(mutation => {\n if (mutation.type === 'characterData') {\n // We don't want to restore the DOM for characterData mutations\n // because this interrupts the composition.\n return\n }\n\n mutation.removedNodes.forEach(node => {\n mutation.target.insertBefore(node, mutation.nextSibling)\n })\n\n mutation.addedNodes.forEach(node => {\n mutation.target.removeChild(node)\n })\n })\n\n // Clear buffered mutations to ensure we don't undo them twice\n clear()\n }\n }\n\n return {\n registerMutations,\n restoreDOM,\n clear,\n }\n}\n","import React, {\n Component,\n ComponentType,\n ContextType,\n ReactNode,\n RefObject,\n} from 'react'\nimport { EditorContext } from '../../hooks/use-slate-static'\nimport { IS_ANDROID } from '../../utils/environment'\nimport {\n createRestoreDomManager,\n RestoreDOMManager,\n} from './restore-dom-manager'\n\nconst MUTATION_OBSERVER_CONFIG: MutationObserverInit = {\n subtree: true,\n childList: true,\n characterData: true,\n characterDataOldValue: true,\n}\n\ntype RestoreDOMProps = {\n children?: ReactNode\n receivedUserInput: RefObject<boolean>\n node: RefObject<HTMLDivElement>\n}\n\n// We have to use a class component here since we rely on `getSnapshotBeforeUpdate` which has no FC equivalent\n// to run code synchronously immediately before react commits the component update to the DOM.\nclass RestoreDOMComponent extends Component<RestoreDOMProps> {\n static contextType = EditorContext\n context: ContextType<typeof EditorContext> = null\n\n private manager: RestoreDOMManager | null = null\n private mutationObserver: MutationObserver | null = null\n\n observe() {\n const { node } = this.props\n if (!node.current) {\n throw new Error('Failed to attach MutationObserver, `node` is undefined')\n }\n\n this.mutationObserver?.observe(node.current, MUTATION_OBSERVER_CONFIG)\n }\n\n componentDidMount() {\n const { receivedUserInput } = this.props\n const editor = this.context!\n\n this.manager = createRestoreDomManager(editor, receivedUserInput)\n this.mutationObserver = new MutationObserver(this.manager.registerMutations)\n\n this.observe()\n }\n\n getSnapshotBeforeUpdate() {\n const pendingMutations = this.mutationObserver?.takeRecords()\n if (pendingMutations?.length) {\n this.manager?.registerMutations(pendingMutations)\n }\n\n this.mutationObserver?.disconnect()\n this.manager?.restoreDOM()\n\n return null\n }\n\n componentDidUpdate() {\n this.manager?.clear()\n this.observe()\n }\n\n componentWillUnmount() {\n this.mutationObserver?.disconnect()\n }\n\n render() {\n return this.props.children\n }\n}\n\nexport const RestoreDOM: ComponentType<RestoreDOMProps> = IS_ANDROID\n ? RestoreDOMComponent\n : ({ children }) => <>{children}</>\n","import { createContext, useContext } from 'react'\n\n/**\n * A React context for sharing the `composing` state of the editor.\n */\n\nexport const ComposingContext = createContext(false)\n\n/**\n * Get the current `composing` state of the editor.\n */\n\nexport const useComposing = (): boolean => {\n return useContext(ComposingContext)\n}\n","import getDirection from 'direction'\nimport debounce from 'lodash/debounce'\nimport throttle from 'lodash/throttle'\nimport React, {\n useCallback,\n useEffect,\n useMemo,\n useReducer,\n useRef,\n useState,\n forwardRef,\n ForwardedRef,\n} from 'react'\nimport { JSX } from 'react'\nimport scrollIntoView from 'scroll-into-view-if-needed'\nimport {\n Editor,\n Element,\n Node,\n NodeEntry,\n Path,\n Range,\n Text,\n Transforms,\n} from 'slate'\nimport { useAndroidInputManager } from '../hooks/android-input-manager/use-android-input-manager'\nimport useChildren from '../hooks/use-children'\nimport { DecorateContext } from '../hooks/use-decorate'\nimport { useIsomorphicLayoutEffect } from '../hooks/use-isomorphic-layout-effect'\nimport { ReadOnlyContext } from '../hooks/use-read-only'\nimport { useSlate } from '../hooks/use-slate'\nimport { useTrackUserInput } from '../hooks/use-track-user-input'\nimport { ReactEditor } from '../plugin/react-editor'\nimport { TRIPLE_CLICK } from '../utils/constants'\nimport {\n DOMElement,\n DOMRange,\n DOMText,\n getActiveElement,\n getDefaultView,\n getSelection,\n isDOMElement,\n isDOMNode,\n isPlainTextOnlyPaste,\n} from '../utils/dom'\nimport {\n CAN_USE_DOM,\n HAS_BEFORE_INPUT_SUPPORT,\n IS_ANDROID,\n IS_CHROME,\n IS_FIREFOX,\n IS_FIREFOX_LEGACY,\n IS_IOS,\n IS_WEBKIT,\n IS_UC_MOBILE,\n IS_WECHATBROWSER,\n} from '../utils/environment'\nimport Hotkeys from '../utils/hotkeys'\nimport {\n IS_NODE_MAP_DIRTY,\n EDITOR_TO_ELEMENT,\n EDITOR_TO_FORCE_RENDER,\n EDITOR_TO_PENDING_INSERTION_MARKS,\n EDITOR_TO_USER_MARKS,\n EDITOR_TO_USER_SELECTION,\n EDITOR_TO_WINDOW,\n ELEMENT_TO_NODE,\n IS_COMPOSING,\n IS_FOCUSED,\n IS_READ_ONLY,\n MARK_PLACEHOLDER_SYMBOL,\n NODE_TO_ELEMENT,\n PLACEHOLDER_SYMBOL,\n} from '../utils/weak-maps'\nimport { RestoreDOM } from './restore-dom/restore-dom'\nimport { AndroidInputManager } from '../hooks/android-input-manager/android-input-manager'\nimport { ComposingContext } from '../hooks/use-composing'\n\ntype DeferredOperation = () => void\n\nconst Children = (props: Parameters<typeof useChildren>[0]) => (\n <React.Fragment>{useChildren(props)}</React.Fragment>\n)\n\n/**\n * `RenderElementProps` are passed to the `renderElement` handler.\n */\n\nexport interface RenderElementProps {\n children: any\n element: Element\n attributes: {\n 'data-slate-node': 'element'\n 'data-slate-inline'?: true\n 'data-slate-void'?: true\n dir?: 'rtl'\n ref: any\n }\n}\n\n/**\n * `RenderLeafProps` are passed to the `renderLeaf` handler.\n */\n\nexport interface RenderLeafProps {\n children: any\n leaf: Text\n text: Text\n attributes: {\n 'data-slate-leaf': true\n }\n}\n\n/**\n * `EditableProps` are passed to the `<Editable>` component.\n */\n\nexport type EditableProps = {\n decorate?: (entry: NodeEntry) => Range[]\n onDOMBeforeInput?: (event: InputEvent) => void\n placeholder?: string\n readOnly?: boolean\n role?: string\n style?: React.CSSProperties\n renderElement?: (props: RenderElementProps) => JSX.Element\n renderLeaf?: (props: RenderLeafProps) => JSX.Element\n renderPlaceholder?: (props: RenderPlaceholderProps) => JSX.Element\n scrollSelectionIntoView?: (editor: ReactEditor, domRange: DOMRange) => void\n as?: React.ElementType\n disableDefaultStyles?: boolean\n} & React.TextareaHTMLAttributes<HTMLDivElement>\n\n/**\n * Editable.\n */\n\nexport const Editable = forwardRef(\n (props: EditableProps, forwardedRef: ForwardedRef<HTMLDivElement>) => {\n const defaultRenderPlaceholder = useCallback(\n (props: RenderPlaceholderProps) => <DefaultPlaceholder {...props} />,\n []\n )\n const {\n autoFocus,\n decorate = defaultDecorate,\n onDOMBeforeInput: propsOnDOMBeforeInput,\n placeholder,\n readOnly = false,\n renderElement,\n renderLeaf,\n renderPlaceholder = defaultRenderPlaceholder,\n scrollSelectionIntoView = defaultScrollSelectionIntoView,\n style: userStyle = {},\n as: Component = 'div',\n disableDefaultStyles = false,\n ...attributes\n } = props\n const editor = useSlate()\n // Rerender editor when composition status changed\n const [isComposing, setIsComposing] = useState(false)\n const ref = useRef<HTMLDivElement | null>(null)\n const deferredOperations = useRef<DeferredOperation[]>([])\n const [placeholderHeight, setPlaceholderHeight] = useState<\n number | undefined\n >()\n const processing = useRef(false)\n\n const { onUserInput, receivedUserInput } = useTrackUserInput()\n\n const [, forceRender] = useReducer(s => s + 1, 0)\n EDITOR_TO_FORCE_RENDER.set(editor, forceRender)\n\n // Update internal state on each render.\n IS_READ_ONLY.set(editor, readOnly)\n\n // Keep track of some state for the event handler logic.\n const state = useMemo(\n () => ({\n isDraggingInternally: false,\n isUpdatingSelection: false,\n latestElement: null as DOMElement | null,\n hasMarkPlaceholder: false,\n }),\n []\n )\n\n // The autoFocus TextareaHTMLAttribute doesn't do anything on a div, so it\n // needs to be manually focused.\n useEffect(() => {\n if (ref.current && autoFocus) {\n ref.current.focus()\n }\n }, [autoFocus])\n\n /**\n * The AndroidInputManager object has a cyclical dependency on onDOMSelectionChange\n *\n * It is defined as a reference to simplify hook dependencies and clarify that\n * it needs to be initialized.\n */\n const androidInputManagerRef = useRef<\n AndroidInputManager | null | undefined\n >()\n\n // Listen on the native `selectionchange` event to be able to update any time\n // the selection changes. This is required because React's `onSelect` is leaky\n // and non-standard so it doesn't fire until after a selection has been\n // released. This causes issues in situations where another change happens\n // while a selection is being dragged.\n const onDOMSelectionChange = useMemo(\n () =>\n throttle(() => {\n if (IS_NODE_MAP_DIRTY.get(editor)) {\n onDOMSelectionChange()\n return\n }\n\n const el = ReactEditor.toDOMNode(editor, editor)\n const root = el.getRootNode()\n\n if (!processing.current && IS_WEBKIT && root instanceof ShadowRoot) {\n processing.current = true\n\n const active = getActiveElement()\n\n if (active) {\n document.execCommand('indent')\n } else {\n Transforms.deselect(editor)\n }\n\n processing.current = false\n return\n }\n\n const androidInputManager = androidInputManagerRef.current\n if (\n (IS_ANDROID || !ReactEditor.isComposing(editor)) &&\n (!state.isUpdatingSelection || androidInputManager?.isFlushing()) &&\n !state.isDraggingInternally\n ) {\n const root = ReactEditor.findDocumentOrShadowRoot(editor)\n const { activeElement } = root\n const el = ReactEditor.toDOMNode(editor, editor)\n const domSelection = getSelection(root)\n\n if (activeElement === el) {\n state.latestElement = activeElement\n IS_FOCUSED.set(editor, true)\n } else {\n IS_FOCUSED.delete(editor)\n }\n\n if (!domSelection) {\n return Transforms.deselect(editor)\n }\n\n const { anchorNode, focusNode } = domSelection\n\n const anchorNodeSelectable =\n ReactEditor.hasEditableTarget(editor, anchorNode) ||\n ReactEditor.isTargetInsideNonReadonlyVoid(editor, anchorNode)\n\n const focusNodeInEditor = ReactEditor.hasTarget(editor, focusNode)\n\n if (anchorNodeSelectable && focusNodeInEditor) {\n const range = ReactEditor.toSlateRange(editor, domSelection, {\n exactMatch: false,\n suppressThrow: true,\n })\n\n if (range) {\n if (\n !ReactEditor.isComposing(editor) &&\n !androidInputManager?.hasPendingChanges() &&\n !androidInputManager?.isFlushing()\n ) {\n Transforms.select(editor, range)\n } else {\n androidInputManager?.handleUserSelect(range)\n }\n }\n }\n\n // Deselect the editor if the dom selection is not selectable in readonly mode\n if (readOnly && (!anchorNodeSelectable || !focusNodeInEditor)) {\n Transforms.deselect(editor)\n }\n }\n }, 100),\n [editor, readOnly, state]\n )\n\n const scheduleOnDOMSelectionChange = useMemo(\n () => debounce(onDOMSelectionChange, 0),\n [onDOMSelectionChange]\n )\n\n androidInputManagerRef.current = useAndroidInputManager({\n node: ref,\n onDOMSelectionChange,\n scheduleOnDOMSelectionChange,\n })\n\n useIsomorphicLayoutEffect(() => {\n // Update element-related weak maps with the DOM element ref.\n let window\n if (ref.current && (window = getDefaultView(ref.current))) {\n EDITOR_TO_WINDOW.set(editor, window)\n EDITOR_TO_ELEMENT.set(editor, ref.current)\n NODE_TO_ELEMENT.set(editor, ref.current)\n ELEMENT_TO_NODE.set(ref.current, editor)\n } else {\n NODE_TO_ELEMENT.delete(editor)\n }\n\n // Make sure the DOM selection state is in sync.\n const { selection } = editor\n const root = ReactEditor.findDocumentOrShadowRoot(editor)\n const domSelection = getSelection(root)\n\n if (\n !domSelection ||\n !ReactEditor.isFocused(editor) ||\n androidInputManagerRef.current?.hasPendingAction()\n ) {\n return\n }\n\n const setDomSelection = (forceChange?: boolean) => {\n const hasDomSelection = domSelection.type !== 'None'\n\n // If the DOM selection is properly unset, we're done.\n if (!selection && !hasDomSelection) {\n return\n }\n\n // Get anchorNode and focusNode\n const focusNode = domSelection.focusNode\n let anchorNode\n\n // COMPAT: In firefox the normal seletion way does not work\n // (https://github.com/ianstormtaylor/slate/pull/5486#issue-1820720223)\n if (IS_FIREFOX && domSelection.rangeCount > 1) {\n const firstRange = domSelection.getRangeAt(0)\n const lastRange = domSelection.getRangeAt(domSelection.rangeCount - 1)\n\n // Right to left\n if (firstRange.startContainer === focusNode) {\n anchorNode = lastRange.endContainer\n } else {\n // Left to right\n anchorNode = firstRange.startContainer\n }\n } else {\n anchorNode = domSelection.anchorNode\n }\n\n // verify that the dom selection is in the editor\n const editorElement = EDITOR_TO_ELEMENT.get(editor)!\n let hasDomSelectionInEditor = false\n if (\n editorElement.contains(anchorNode) &&\n editorElement.contains(focusNode)\n ) {\n hasDomSelectionInEditor = true\n }\n\n // If the DOM selection is in the editor and the editor selection is already correct, we're done.\n if (\n hasDomSelection &&\n hasDomSelectionInEditor &&\n selection &&\n !forceChange\n ) {\n const slateRange = ReactEditor.toSlateRange(editor, domSelection, {\n exactMatch: true,\n\n // domSelection is not necessarily a valid Slate range\n // (e.g. when clicking on contentEditable:false element)\n suppressThrow: true,\n })\n\n if (slateRange && Range.equals(slateRange, selection)) {\n if (!state.hasMarkPlaceholder) {\n return\n }\n\n // Ensure selection is inside the mark placeholder\n if (\n anchorNode?.parentElement?.hasAttribute(\n 'data-slate-mark-placeholder'\n )\n ) {\n return\n }\n }\n }\n\n // when <Editable/> is being controlled through external value\n // then its children might just change - DOM responds to it on its own\n // but Slate's value is not being updated through any operation\n // and thus it doesn't transform selection on its own\n if (selection && !ReactEditor.hasRange(editor, selection)) {\n editor.selection = ReactEditor.toSlateRange(editor, domSelection, {\n exactMatch: false,\n suppressThrow: true,\n })\n return\n }\n\n // Otherwise the DOM selection is out of sync, so update it.\n state.isUpdatingSelection = true\n\n const newDomRange: DOMRange | null =\n selection && ReactEditor.toDOMRange(editor, selection)\n\n if (newDomRange) {\n if (ReactEditor.isComposing(editor) && !IS_ANDROID) {\n domSelection.collapseToEnd()\n } else if (Range.isBackward(selection!)) {\n domSelection.setBaseAndExtent(\n newDomRange.endContainer,\n newDomRange.endOffset,\n newDomRange.startContainer,\n newDomRange.startOffset\n )\n } else {\n domSelection.setBaseAndExtent(\n newDomRange.startContainer,\n newDomRange.startOffset,\n newDomRange.endContainer,\n newDomRange.endOffset\n )\n }\n scrollSelectionIntoView(editor, newDomRange)\n } else {\n domSelection.removeAllRanges()\n }\n\n return newDomRange\n }\n\n // In firefox if there is more then 1 range and we call setDomSelection we remove the ability to select more cells in a table\n if (domSelection.rangeCount <= 1) {\n setDomSelection()\n }\n\n const ensureSelection =\n androidInputManagerRef.current?.isFlushing() === 'action'\n\n if (!IS_ANDROID || !ensureSelection) {\n setTimeout(() => {\n state.isUpdatingSelection = false\n })\n return\n }\n\n let timeoutId: ReturnType<typeof setTimeout> | null = null\n const animationFrameId = requestAnimationFrame(() => {\n if (ensureSelection) {\n const ensureDomSelection = (forceChange?: boolean) => {\n try {\n const el = ReactEditor.toDOMNode(editor, editor)\n el.focus()\n\n setDomSelection(forceChange)\n } catch (e) {\n // Ignore, dom and state might be out of sync\n }\n }\n\n // Compat: Android IMEs try to force their selection by manually re-applying it even after we set it.\n // This essentially would make setting the slate selection during an update meaningless, so we force it\n // again here. We can't only do it in the setTimeout after the animation frame since that would cause a\n // visible flicker.\n ensureDomSelection()\n\n timeoutId = setTimeout(() => {\n // COMPAT: While setting the selection in an animation frame visually correctly sets the selection,\n // it doesn't update GBoards spellchecker state. We have to manually trigger a selection change after\n // the animation frame to ensure it displays the correct state.\n ensureDomSelection(true)\n state.isUpdatingSelection = false\n })\n }\n })\n\n return () => {\n cancelAnimationFrame(animationFrameId)\n if (timeoutId) {\n clearTimeout(timeoutId)\n }\n }\n })\n\n // Listen on the native `beforeinput` event to get real \"Level 2\" events. This\n // is required because React's `beforeinput` is fake and never really attaches\n // to the real event sadly. (2019/11/01)\n // https://github.com/facebook/react/issues/11211\n const onDOMBeforeInput = useCallback(\n (event: InputEvent) => {\n const el = ReactEditor.toDOMNode(editor, editor)\n const root = el.getRootNode()\n\n if (processing?.current && IS_WEBKIT && root instanceof ShadowRoot) {\n const ranges = event.getTargetRanges()\n const range = ranges[0]\n\n const newRange = new window.Range()\n\n newRange.setStart(range.startContainer, range.startOffset)\n newRange.setEnd(range.endContainer, range.endOffset)\n\n // Translate the DOM Range into a Slate Range\n const slateRange = ReactEditor.toSlateRange(editor, newRange, {\n exactMatch: false,\n suppressThrow: false,\n })\n\n Transforms.select(editor, slateRange)\n\n event.preventDefault()\n event.stopImmediatePropagation()\n return\n }\n onUserInput()\n\n if (\n !readOnly &&\n ReactEditor.hasEditableTarget(editor, event.target) &&\n !isDOMEventHandled(event, propsOnDOMBeforeInput)\n ) {\n // COMPAT: BeforeInput events aren't cancelable on android, so we have to handle them differently using the android input manager.\n if (androidInputManagerRef.current) {\n return androidInputManagerRef.current.handleDOMBeforeInput(event)\n }\n\n // Some IMEs/Chrome extensions like e.g. Grammarly set the selection immediately before\n // triggering a `beforeinput` expecting the change to be applied to the immediately before\n // set selection.\n scheduleOnDOMSelectionChange.flush()\n onDOMSelectionChange.flush()\n\n const { selection } = editor\n const { inputType: type } = event\n const data = (event as any).dataTransfer || event.data || undefined\n\n const isCompositionChange =\n type === 'insertCompositionText' || type === 'deleteCompositionText'\n\n // COMPAT: use composition change events as a hint to where we should insert\n // composition text if we aren't composing to work around https://github.com/ianstormtaylor/slate/issues/5038\n if (isCompositionChange && ReactEditor.isComposing(editor)) {\n return\n }\n\n let native = false\n if (\n type === 'insertText' &&\n selection &&\n Range.isCollapsed(selection) &&\n // Only use native character insertion for single characters a-z or space for now.\n // Long-press events (hold a + press 4 = ä) to choose a special character otherwise\n // causes duplicate inserts.\n event.data &&\n event.data.length === 1 &&\n /[a-z ]/i.test(event.data) &&\n // Chrome has issues correctly editing the start of nodes: https://bugs.chromium.org/p/chromium/issues/detail?id=1249405\n // When there is an inline element, e.g. a link, and you select\n // right after it (the start of the next node).\n selection.anchor.offset !== 0\n ) {\n native = true\n\n // Skip native if there are marks, as\n // `insertText` will insert a node, not just text.\n if (editor.marks) {\n native = false\n }\n\n // If the NODE_MAP is dirty, we can't trust the selection anchor (eg ReactEditor.toDOMPoint)\n if (!IS_NODE_MAP_DIRTY.get(editor)) {\n // Chrome also has issues correctly editing the end of anchor elements: https://bugs.chromium.org/p/chromium/issues/detail?id=1259100\n // Therefore we don't allow native events to insert text at the end of anchor nodes.\n const { anchor } = selection\n\n const [node, offset] = ReactEditor.toDOMPoint(editor, anchor)\n const anchorNode = node.parentElement?.closest('a')\n\n const window = ReactEditor.getWindow(editor)\n\n if (\n native &&\n anchorNode &&\n ReactEditor.hasDOMNode(editor, anchorNode)\n ) {\n // Find the last text node inside the anchor.\n const lastText = window?.document\n .createTreeWalker(anchorNode, NodeFilter.SHOW_TEXT)\n .lastChild() as DOMText | null\n\n if (\n lastText === node &&\n lastText.textContent?.length === offset\n ) {\n native = false\n }\n }\n\n // Chrome has issues with the presence of tab characters inside elements with whiteSpace = 'pre'\n // causing abnormal insert behavior: https://bugs.chromium.org/p/chromium/issues/detail?id=1219139\n if (\n native &&\n node.parentElement &&\n window?.getComputedStyle(node.parentElement)?.whiteSpace ===\n 'pre'\n ) {\n const block = Editor.above(editor, {\n at: anchor.path,\n match: n => Element.isElement(n) && Editor.isBlock(editor, n),\n })\n\n if (block && Node.string(block[0]).includes('\\t')) {\n native = false\n }\n }\n }\n }\n // COMPAT: For the deleting forward/backward input types we don't want\n // to change the selection because it is the range that will be deleted,\n // and those commands determine that for themselves.\n // If the NODE_MAP is dirty, we can't trust the selection anchor (eg ReactEditor.toDOMPoint via ReactEditor.toSlateRange)\n if (\n (!type.startsWith('delete') || type.startsWith('deleteBy')) &&\n !IS_NODE_MAP_DIRTY.get(editor)\n ) {\n const [targetRange] = (event as any).getTargetRanges()\n\n if (targetRange) {\n const range = ReactEditor.toSlateRange(editor, targetRange, {\n exactMatch: false,\n suppressThrow: false,\n })\n\n if (!selection || !Range.equals(selection, range)) {\n native = false\n\n const selectionRef =\n !isCompositionChange &&\n editor.selection &&\n Editor.rangeRef(editor, editor.selection)\n\n Transforms.select(editor, range)\n\n if (selectionRef) {\n EDITOR_TO_USER_SELECTION.set(editor, selectionRef)\n }\n }\n }\n }\n\n // Composition change types occur while a user is composing text and can't be\n // cancelled. Let them through and wait for the composition to end.\n if (isCompositionChange) {\n return\n }\n\n if (!native) {\n event.preventDefault()\n }\n\n // COMPAT: If the selection is expanded, even if the command seems like\n // a delete forward/backward command it should delete the selection.\n if (\n selection &&\n Range.isExpanded(selection) &&\n type.startsWith('delete')\n ) {\n const direction = type.endsWith('Backward') ? 'backward' : 'forward'\n Editor.deleteFragment(editor, { direction })\n return\n }\n\n switch (type) {\n case 'deleteByComposition':\n case 'deleteByCut':\n case 'deleteByDrag': {\n Editor.deleteFragment(editor)\n break\n }\n\n case 'deleteContent':\n case 'deleteContentForward': {\n Editor.deleteForward(editor)\n break\n }\n\n case 'deleteContentBackward': {\n Editor.deleteBackward(editor)\n break\n }\n\n case 'deleteEntireSoftLine': {\n Editor.deleteBackward(editor, { unit: 'line' })\n Editor.deleteForward(editor, { unit: 'line' })\n break\n }\n\n case 'deleteHardLineBackward': {\n Editor.deleteBackward(editor, { unit: 'block' })\n break\n }\n\n case 'deleteSoftLineBackward': {\n Editor.deleteBackward(editor, { unit: 'line' })\n break\n }\n\n case 'deleteHardLineForward': {\n Editor.deleteForward(editor, { unit: 'block' })\n break\n }\n\n case 'deleteSoftLineForward': {\n Editor.deleteForward(editor, { unit: 'line' })\n break\n }\n\n case 'deleteWordBackward': {\n Editor.deleteBackward(editor, { unit: 'word' })\n break\n }\n\n case 'deleteWordForward': {\n Editor.deleteForward(editor, { unit: 'word' })\n break\n }\n\n case 'insertLineBreak':\n Editor.insertSoftBreak(editor)\n break\n\n case 'insertParagraph': {\n Editor.insertBreak(editor)\n break\n }\n\n case 'insertFromComposition':\n case 'insertFromDrop':\n case 'insertFromPaste':\n case 'insertFromYank':\n case 'insertReplacementText':\n case 'insertText': {\n if (type === 'insertFromComposition') {\n // COMPAT: in Safari, `compositionend` is dispatched after the\n // `beforeinput` for \"insertFromComposition\". But if we wait for it\n // then we will abort because we're still composing and the selection\n // won't be updated properly.\n // https://www.w3.org/TR/input-events-2/\n if (ReactEditor.isComposing(editor)) {\n setIsComposing(false)\n IS_COMPOSING.set(editor, false)\n }\n }\n\n // use a weak comparison instead of 'instanceof' to allow\n // programmatic access of paste events coming from external windows\n // like cypress where cy.window does not work realibly\n if (data?.constructor.name === 'DataTransfer') {\n ReactEditor.insertData(editor, data)\n } else if (typeof data === 'string') {\n // Only insertText operations use the native functionality, for now.\n // Potentially expand to single character deletes, as well.\n if (native) {\n deferredOperations.current.push(() =>\n Editor.insertText(editor, data)\n )\n } else {\n Editor.insertText(editor, data)\n }\n }\n\n break\n }\n }\n\n // Restore the actual user section if nothing manually set it.\n const toRestore = EDITOR_TO_USER_SELECTION.get(editor)?.unref()\n EDITOR_TO_USER_SELECTION.delete(editor)\n\n if (\n toRestore &&\n (!editor.selection || !Range.equals(editor.selection, toRestore))\n ) {\n Transforms.select(editor, toRestore)\n }\n }\n },\n [\n editor,\n onDOMSelectionChange,\n onUserInput,\n propsOnDOMBeforeInput,\n readOnly,\n scheduleOnDOMSelectionChange,\n ]\n )\n\n const callbackRef = useCallback(\n (node: HTMLDivElement | null) => {\n if (node == null) {\n onDOMSelectionChange.cancel()\n scheduleOnDOMSelectionChange.cancel()\n\n EDITOR_TO_ELEMENT.delete(editor)\n NODE_TO_ELEMENT.delete(editor)\n\n if (ref.current && HAS_BEFORE_INPUT_SUPPORT) {\n // @ts-ignore The `beforeinput` event isn't recognized.\n ref.current.removeEventListener('beforeinput', onDOMBeforeInput)\n }\n } else {\n // Attach a native DOM event handler for `beforeinput` events, because React's\n // built-in `onBeforeInput` is actually a leaky polyfill that doesn't expose\n // real `beforeinput` events sadly... (2019/11/04)\n // https://github.com/facebook/react/issues/11211\n if (HAS_BEFORE_INPUT_SUPPORT) {\n // @ts-ignore The `beforeinput` event isn't recognized.\n node.addEventListener('beforeinput', onDOMBeforeInput)\n }\n }\n\n ref.current = node\n if (typeof forwardedRef === 'function') {\n forwardedRef(node)\n } else if (forwardedRef) {\n forwardedRef.current = node\n }\n },\n [\n onDOMSelectionChange,\n scheduleOnDOMSelectionChange,\n editor,\n onDOMBeforeInput,\n forwardedRef,\n ]\n )\n\n useIsomorphicLayoutEffect(() => {\n const window = ReactEditor.getWindow(editor)\n\n // Attach a native DOM event handler for `selectionchange`, because React's\n // built-in `onSelect` handler doesn't fire for all selection changes. It's\n // a leaky polyfill that only fires on keypresses or clicks. Instead, we\n // want to fire for any change to the selection inside the editor.\n // (2019/11/04) https://github.com/facebook/react/issues/5785\n window.document.addEventListener(\n 'selectionchange',\n scheduleOnDOMSelectionChange\n )\n\n // Listen for dragend and drop globally. In Firefox, if a drop handler\n // initiates an operation that causes the originally dragged element to\n // unmount, that element will not emit a dragend event. (2024/06/21)\n const stoppedDragging = () => {\n state.isDraggingInternally = false\n }\n window.document.addEventListener('dragend', stoppedDragging)\n window.document.addEventListener('drop', stoppedDragging)\n\n return () => {\n window.document.removeEventListener(\n 'selectionchange',\n scheduleOnDOMSelectionChange\n )\n window.document.removeEventListener('dragend', stoppedDragging)\n window.document.removeEventListener('drop', stoppedDragging)\n }\n }, [scheduleOnDOMSelectionChange, state])\n\n const decorations = decorate([editor, []])\n\n const showPlaceholder =\n placeholder &&\n editor.children.length === 1 &&\n Array.from(Node.texts(editor)).length === 1 &&\n Node.string(editor) === '' &&\n !isComposing\n\n const placeHolderResizeHandler = useCallback(\n (placeholderEl: HTMLElement | null) => {\n if (placeholderEl && showPlaceholder) {\n setPlaceholderHeight(placeholderEl.getBoundingClientRect()?.height)\n } else {\n setPlaceholderHeight(undefined)\n }\n },\n [showPlaceholder]\n )\n\n if (showPlaceholder) {\n const start = Editor.start(editor, [])\n decorations.push({\n [PLACEHOLDER_SYMBOL]: true,\n placeholder,\n onPlaceholderResize: placeHolderResizeHandler,\n anchor: start,\n focus: start,\n })\n }\n\n const { marks } = editor\n state.hasMarkPlaceholder = false\n\n if (editor.selection && Range.isCollapsed(editor.selection) && marks) {\n const { anchor } = editor.selection\n const leaf = Node.leaf(editor, anchor.path)\n const { text, ...rest } = leaf\n\n // While marks isn't a 'complete' text, we can still use loose Text.equals\n // here which only compares marks anyway.\n if (!Text.equals(leaf, marks as Text, { loose: true })) {\n state.hasMarkPlaceholder = true\n\n const unset = Object.fromEntries(\n Object.keys(rest).map(mark => [mark, null])\n )\n\n decorations.push({\n [MARK_PLACEHOLDER_SYMBOL]: true,\n ...unset,\n ...marks,\n\n anchor,\n focus: anchor,\n })\n }\n }\n\n // Update EDITOR_TO_MARK_PLACEHOLDER_MARKS in setTimeout useEffect to ensure we don't set it\n // before we receive the composition end event.\n useEffect(() => {\n setTimeout(() => {\n const { selection } = editor\n if (selection) {\n const { anchor } = selection\n const text = Node.leaf(editor, anchor.path)\n\n // While marks isn't a 'complete' text, we can still use loose Text.equals\n // here which only compares marks anyway.\n if (marks && !Text.equals(text, marks as Text, { loose: true })) {\n EDITOR_TO_PENDING_INSERTION_MARKS.set(editor, marks)\n return\n }\n }\n\n EDITOR_TO_PENDING_INSERTION_MARKS.delete(editor)\n })\n })\n\n return (\n <ReadOnlyContext.Provider value={readOnly}>\n <ComposingContext.Provider value={isComposing}>\n <DecorateContext.Provider value={decorate}>\n <RestoreDOM node={ref} receivedUserInput={receivedUserInput}>\n <Component\n role={readOnly ? undefined : 'textbox'}\n aria-multiline={readOnly ? undefined : true}\n {...attributes}\n // COMPAT: Certain browsers don't support the `beforeinput` event, so we'd\n // have to use hacks to make these replacement-based features work.\n // For SSR situations HAS_BEFORE_INPUT_SUPPORT is false and results in prop\n // mismatch warning app moves to browser. Pass-through consumer props when\n // not CAN_USE_DOM (SSR) and default to falsy value\n spellCheck={\n HAS_BEFORE_INPUT_SUPPORT || !CAN_USE_DOM\n ? attributes.spellCheck\n : false\n }\n autoCorrect={\n HAS_BEFORE_INPUT_SUPPORT || !CAN_USE_DOM\n ? attributes.autoCorrect\n : 'false'\n }\n autoCapitalize={\n HAS_BEFORE_INPUT_SUPPORT || !CAN_USE_DOM\n ? attributes.autoCapitalize\n : 'false'\n }\n data-slate-editor\n data-slate-node=\"value\"\n // explicitly set this\n contentEditable={!readOnly}\n // in some cases, a decoration needs access to the range / selection to decorate a text node,\n // then you will select the whole text node when you select part the of text\n // this magic zIndex=\"-1\" will fix it\n zindex={-1}\n suppressContentEditableWarning\n ref={callbackRef}\n style={{\n ...(disableDefaultStyles\n ? {}\n : {\n // Allow positioning relative to the editable element.\n position: 'relative',\n // Preserve adjacent whitespace and new lines.\n whiteSpace: 'pre-wrap',\n // Allow words to break if they are too long.\n wordWrap: 'break-word',\n // Make the minimum height that of the placeholder.\n ...(placeholderHeight\n ? { minHeight: placeholderHeight }\n : {}),\n }),\n // Allow for passed-in styles to override anything.\n ...userStyle,\n }}\n onBeforeInput={useCallback(\n (event: React.FormEvent<HTMLDivElement>) => {\n // COMPAT: Certain browsers don't support the `beforeinput` event, so we\n // fall back to React's leaky polyfill instead just for it. It\n // only works for the `insertText` input type.\n if (\n !HAS_BEFORE_INPUT_SUPPORT &&\n !readOnly &&\n !isEventHandled(event, attributes.onBeforeInput) &&\n ReactEditor.hasSelectableTarget(editor, event.target)\n ) {\n event.preventDefault()\n if (!ReactEditor.isComposing(editor)) {\n const text = (event as any).data as string\n Editor.insertText(editor, text)\n }\n }\n },\n [attributes.onBeforeInput, editor, readOnly]\n )}\n onInput={useCallback(\n (event: React.FormEvent<HTMLDivElement>) => {\n if (isEventHandled(event, attributes.onInput)) {\n return\n }\n\n if (androidInputManagerRef.current) {\n androidInputManagerRef.current.handleInput()\n return\n }\n\n // Flush native operations, as native events will have propogated\n // and we can correctly compare DOM text values in components\n // to stop rendering, so that browser functions like autocorrect\n // and spellcheck work as expected.\n for (const op of deferredOperations.current) {\n op()\n }\n deferredOperations.current = []\n\n // COMPAT: Since `beforeinput` doesn't fully `preventDefault`,\n // there's a chance that content might be placed in the browser's undo stack.\n // This means undo can be triggered even when the div is not focused,\n // and it only triggers the input event for the node. (2024/10/09)\n if (!ReactEditor.isFocused(editor)) {\n const native = event.nativeEvent as InputEvent\n const maybeHistoryEditor: any = editor\n if (\n native.inputType === 'historyUndo' &&\n typeof maybeHistoryEditor.undo === 'function'\n ) {\n maybeHistoryEditor.undo()\n return\n }\n if (\n native.inputType === 'historyRedo' &&\n typeof maybeHistoryEditor.redo === 'function'\n ) {\n maybeHistoryEditor.redo()\n return\n }\n }\n },\n [attributes.onInput, editor]\n )}\n onBlur={useCallback(\n (event: React.FocusEvent<HTMLDivElement>) => {\n if (\n readOnly ||\n state.isUpdatingSelection ||\n !ReactEditor.hasSelectableTarget(editor, event.target) ||\n isEventHandled(event, attributes.onBlur)\n ) {\n return\n }\n\n // COMPAT: If the current `activeElement` is still the previous\n // one, this is due to the window being blurred when the tab\n // itself becomes unfocused, so we want to abort early to allow to\n // editor to stay focused when the tab becomes focused again.\n const root = ReactEditor.findDocumentOrShadowRoot(editor)\n if (state.latestElement === root.activeElement) {\n return\n }\n\n const { relatedTarget } = event\n const el = ReactEditor.toDOMNode(editor, editor)\n\n // COMPAT: The event should be ignored if the focus is returning\n // to the editor from an embedded editable element (eg. an <input>\n // element inside a void node).\n if (relatedTarget === el) {\n return\n }\n\n // COMPAT: The event should be ignored if the focus is moving from\n // the editor to inside a void node's spacer element.\n if (\n isDOMElement(relatedTarget) &&\n relatedTarget.hasAttribute('data-slate-spacer')\n ) {\n return\n }\n\n // COMPAT: The event should be ignored if the focus is moving to a\n // non- editable section of an element that isn't a void node (eg.\n // a list item of the check list example).\n if (\n relatedTarget != null &&\n isDOMNode(relatedTarget) &&\n ReactEditor.hasDOMNode(editor, relatedTarget)\n ) {\n const node = ReactEditor.toSlateNode(\n editor,\n relatedTarget\n )\n\n if (Element.isElement(node) && !editor.isVoid(node)) {\n return\n }\n }\n\n // COMPAT: Safari doesn't always remove the selection even if the content-\n // editable element no longer has focus. Refer to:\n // https://stackoverflow.com/questions/12353247/force-contenteditable-div-to-stop-accepting-input-after-it-loses-focus-under-web\n if (IS_WEBKIT) {\n const domSelection = getSelection(root)\n domSelection?.removeAllRanges()\n }\n\n IS_FOCUSED.delete(editor)\n },\n [\n readOnly,\n state.isUpdatingSelection,\n state.latestElement,\n editor,\n attributes.onBlur,\n ]\n )}\n onClick={useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n if (\n ReactEditor.hasTarget(editor, event.target) &&\n !isEventHandled(event, attributes.onClick) &&\n isDOMNode(event.target)\n ) {\n const node = ReactEditor.toSlateNode(editor, event.target)\n const path = ReactEditor.findPath(editor, node)\n\n // At this time, the Slate document may be arbitrarily different,\n // because onClick handlers can change the document before we get here.\n // Therefore we must check that this path actually exists,\n // and that it still refers to the same node.\n if (\n !Editor.hasPath(editor, path) ||\n Node.get(editor, path) !== node\n ) {\n return\n }\n\n if (event.detail === TRIPLE_CLICK && path.length >= 1) {\n let blockPath = path\n if (\n !(\n Element.isElement(node) &&\n Editor.isBlock(editor, node)\n )\n ) {\n const block = Editor.above(editor, {\n match: n =>\n Element.isElement(n) && Editor.isBlock(editor, n),\n at: path,\n })\n\n blockPath = block?.[1] ?? path.slice(0, 1)\n }\n\n const range = Editor.range(editor, blockPath)\n Transforms.select(editor, range)\n return\n }\n\n if (readOnly) {\n return\n }\n\n const start = Editor.start(editor, path)\n const end = Editor.end(editor, path)\n const startVoid = Editor.void(editor, { at: start })\n const endVoid = Editor.void(editor, { at: end })\n\n if (\n startVoid &&\n endVoid &&\n Path.equals(startVoid[1], endVoid[1])\n ) {\n const range = Editor.range(editor, start)\n Transforms.select(editor, range)\n }\n }\n },\n [editor, attributes.onClick, readOnly]\n )}\n onCompositionEnd={useCallback(\n (event: React.CompositionEvent<HTMLDivElement>) => {\n if (ReactEditor.hasSelectableTarget(editor, event.target)) {\n if (ReactEditor.isComposing(editor)) {\n Promise.resolve().then(() => {\n setIsComposing(false)\n IS_COMPOSING.set(editor, false)\n })\n }\n\n androidInputManagerRef.current?.handleCompositionEnd(\n event\n )\n\n if (\n isEventHandled(event, attributes.onCompositionEnd) ||\n IS_ANDROID\n ) {\n return\n }\n\n // COMPAT: In Chrome, `beforeinput` events for compositions\n // aren't correct and never fire the \"insertFromComposition\"\n // type that we need. So instead, insert whenever a composition\n // ends since it will already have been committed to the DOM.\n if (\n !IS_WEBKIT &&\n !IS_FIREFOX_LEGACY &&\n !IS_IOS &&\n !IS_WECHATBROWSER &&\n !IS_UC_MOBILE &&\n event.data\n ) {\n const placeholderMarks =\n EDITOR_TO_PENDING_INSERTION_MARKS.get(editor)\n EDITOR_TO_PENDING_INSERTION_MARKS.delete(editor)\n\n // Ensure we insert text with the marks the user was actually seeing\n if (placeholderMarks !== undefined) {\n EDITOR_TO_USER_MARKS.set(editor, editor.marks)\n editor.marks = placeholderMarks\n }\n\n Editor.insertText(editor, event.data)\n\n const userMarks = EDITOR_TO_USER_MARKS.get(editor)\n EDITOR_TO_USER_MARKS.delete(editor)\n if (userMarks !== undefined) {\n editor.marks = userMarks\n }\n }\n }\n },\n [attributes.onCompositionEnd, editor]\n )}\n onCompositionUpdate={useCallback(\n (event: React.CompositionEvent<HTMLDivElement>) => {\n if (\n ReactEditor.hasSelectableTarget(editor, event.target) &&\n !isEventHandled(event, attributes.onCompositionUpdate)\n ) {\n if (!ReactEditor.isComposing(editor)) {\n setIsComposing(true)\n IS_COMPOSING.set(editor, true)\n }\n }\n },\n [attributes.onCompositionUpdate, editor]\n )}\n onCompositionStart={useCallback(\n (event: React.CompositionEvent<HTMLDivElement>) => {\n if (ReactEditor.hasSelectableTarget(editor, event.target)) {\n androidInputManagerRef.current?.handleCompositionStart(\n event\n )\n\n if (\n isEventHandled(event, attributes.onCompositionStart) ||\n IS_ANDROID\n ) {\n return\n }\n\n setIsComposing(true)\n\n const { selection } = editor\n if (selection && Range.isExpanded(selection)) {\n Editor.deleteFragment(editor)\n return\n }\n }\n },\n [attributes.onCompositionStart, editor]\n )}\n onCopy={useCallback(\n (event: React.ClipboardEvent<HTMLDivElement>) => {\n if (\n ReactEditor.hasSelectableTarget(editor, event.target) &&\n !isEventHandled(event, attributes.onCopy) &&\n !isDOMEventTargetInput(event)\n ) {\n event.preventDefault()\n ReactEditor.setFragmentData(\n editor,\n event.clipboardData,\n 'copy'\n )\n }\n },\n [attributes.onCopy, editor]\n )}\n onCut={useCallback(\n (event: React.ClipboardEvent<HTMLDivElement>) => {\n if (\n !readOnly &&\n ReactEditor.hasSelectableTarget(editor, event.target) &&\n !isEventHandled(event, attributes.onCut) &&\n !isDOMEventTargetInput(event)\n ) {\n event.preventDefault()\n ReactEditor.setFragmentData(\n editor,\n event.clipboardData,\n 'cut'\n )\n const { selection } = editor\n\n if (selection) {\n if (Range.isExpanded(selection)) {\n Editor.deleteFragment(editor)\n } else {\n const node = Node.parent(\n editor,\n selection.anchor.path\n )\n if (Editor.isVoid(editor, node)) {\n Transforms.delete(editor)\n }\n }\n }\n }\n },\n [readOnly, editor, attributes.onCut]\n )}\n onDragOver={useCallback(\n (event: React.DragEvent<HTMLDivElement>) => {\n if (\n ReactEditor.hasTarget(editor, event.target) &&\n !isEventHandled(event, attributes.onDragOver)\n ) {\n // Only when the target is void, call `preventDefault` to signal\n // that drops are allowed. Editable content is droppable by\n // default, and calling `preventDefault` hides the cursor.\n const node = ReactEditor.toSlateNode(editor, event.target)\n\n if (\n Element.isElement(node) &&\n Editor.isVoid(editor, node)\n ) {\n event.preventDefault()\n }\n }\n },\n [attributes.onDragOver, editor]\n )}\n onDragStart={useCallback(\n (event: React.DragEvent<HTMLDivElement>) => {\n if (\n !readOnly &&\n ReactEditor.hasTarget(editor, event.target) &&\n !isEventHandled(event, attributes.onDragStart)\n ) {\n const node = ReactEditor.toSlateNode(editor, event.target)\n const path = ReactEditor.findPath(editor, node)\n const voidMatch =\n (Element.isElement(node) &&\n Editor.isVoid(editor, node)) ||\n Editor.void(editor, { at: path, voids: true })\n\n // If starting a drag on a void node, make sure it is selected\n // so that it shows up in the selection's fragment.\n if (voidMatch) {\n const range = Editor.range(editor, path)\n Transforms.select(editor, range)\n }\n\n state.isDraggingInternally = true\n\n ReactEditor.setFragmentData(\n editor,\n event.dataTransfer,\n 'drag'\n )\n }\n },\n [readOnly, editor, attributes.onDragStart, state]\n )}\n onDrop={useCallback(\n (event: React.DragEvent<HTMLDivElement>) => {\n if (\n !readOnly &&\n ReactEditor.hasTarget(editor, event.target) &&\n !isEventHandled(event, attributes.onDrop)\n ) {\n event.preventDefault()\n\n // Keep a reference to the dragged range before updating selection\n const draggedRange = editor.selection\n\n // Find the range where the drop happened\n const range = ReactEditor.findEventRange(editor, event)\n const data = event.dataTransfer\n\n Transforms.select(editor, range)\n\n if (state.isDraggingInternally) {\n if (\n draggedRange &&\n !Range.equals(draggedRange, range) &&\n !Editor.void(editor, { at: range, voids: true })\n ) {\n Transforms.delete(editor, {\n at: draggedRange,\n })\n }\n }\n\n ReactEditor.insertData(editor, data)\n\n // When dragging from another source into the editor, it's possible\n // that the current editor does not have focus.\n if (!ReactEditor.isFocused(editor)) {\n ReactEditor.focus(editor)\n }\n }\n },\n [readOnly, editor, attributes.onDrop, state]\n )}\n onDragEnd={useCallback(\n (event: React.DragEvent<HTMLDivElement>) => {\n if (\n !readOnly &&\n state.isDraggingInternally &&\n attributes.onDragEnd &&\n ReactEditor.hasTarget(editor, event.target)\n ) {\n attributes.onDragEnd(event)\n }\n },\n [readOnly, state, attributes, editor]\n )}\n onFocus={useCallback(\n (event: React.FocusEvent<HTMLDivElement>) => {\n if (\n !readOnly &&\n !state.isUpdatingSelection &&\n ReactEditor.hasEditableTarget(editor, event.target) &&\n !isEventHandled(event, attributes.onFocus)\n ) {\n const el = ReactEditor.toDOMNode(editor, editor)\n const root = ReactEditor.findDocumentOrShadowRoot(editor)\n state.latestElement = root.activeElement\n\n // COMPAT: If the editor has nested editable elements, the focus\n // can go to them. In Firefox, this must be prevented because it\n // results in issues with keyboard navigation. (2017/03/30)\n if (IS_FIREFOX && event.target !== el) {\n el.focus()\n return\n }\n\n IS_FOCUSED.set(editor, true)\n }\n },\n [readOnly, state, editor, attributes.onFocus]\n )}\n onKeyDown={useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (\n !readOnly &&\n ReactEditor.hasEditableTarget(editor, event.target)\n ) {\n androidInputManagerRef.current?.handleKeyDown(event)\n\n const { nativeEvent } = event\n\n // COMPAT: The composition end event isn't fired reliably in all browsers,\n // so we sometimes might end up stuck in a composition state even though we\n // aren't composing any more.\n if (\n ReactEditor.isComposing(editor) &&\n nativeEvent.isComposing === false\n ) {\n IS_COMPOSING.set(editor, false)\n setIsComposing(false)\n }\n\n if (\n isEventHandled(event, attributes.onKeyDown) ||\n ReactEditor.isComposing(editor)\n ) {\n return\n }\n\n const { selection } = editor\n const element =\n editor.children[\n selection !== null ? selection.focus.path[0] : 0\n ]\n const isRTL = getDirection(Node.string(element)) === 'rtl'\n\n // COMPAT: Since we prevent the default behavior on\n // `beforeinput` events, the browser doesn't think there's ever\n // any history stack to undo or redo, so we have to manage these\n // hotkeys ourselves. (2019/11/06)\n if (Hotkeys.isRedo(nativeEvent)) {\n event.preventDefault()\n const maybeHistoryEditor: any = editor\n\n if (typeof maybeHistoryEditor.redo === 'function') {\n maybeHistoryEditor.redo()\n }\n\n return\n }\n\n if (Hotkeys.isUndo(nativeEvent)) {\n event.preventDefault()\n const maybeHistoryEditor: any = editor\n\n if (typeof maybeHistoryEditor.undo === 'function') {\n maybeHistoryEditor.undo()\n }\n\n return\n }\n\n // COMPAT: Certain browsers don't handle the selection updates\n // properly. In Chrome, the selection isn't properly extended.\n // And in Firefox, the selection isn't properly collapsed.\n // (2017/10/17)\n if (Hotkeys.isMoveLineBackward(nativeEvent)) {\n event.preventDefault()\n Transforms.move(editor, { unit: 'line', reverse: true })\n return\n }\n\n if (Hotkeys.isMoveLineForward(nativeEvent)) {\n event.preventDefault()\n Transforms.move(editor, { unit: 'line' })\n return\n }\n\n if (Hotkeys.isExtendLineBackward(nativeEvent)) {\n event.preventDefault()\n Transforms.move(editor, {\n unit: 'line',\n edge: 'focus',\n reverse: true,\n })\n return\n }\n\n if (Hotkeys.isExtendLineForward(nativeEvent)) {\n event.preventDefault()\n Transforms.move(editor, { unit: 'line', edge: 'focus' })\n return\n }\n\n // COMPAT: If a void node is selected, or a zero-width text node\n // adjacent to an inline is selected, we need to handle these\n // hotkeys manually because browsers won't be able to skip over\n // the void node with the zero-width space not being an empty\n // string.\n if (Hotkeys.isMoveBackward(nativeEvent)) {\n event.preventDefault()\n\n if (selection && Range.isCollapsed(selection)) {\n Transforms.move(editor, { reverse: !isRTL })\n } else {\n Transforms.collapse(editor, {\n edge: isRTL ? 'end' : 'start',\n })\n }\n\n return\n }\n\n if (Hotkeys.isMoveForward(nativeEvent)) {\n event.preventDefault()\n\n if (selection && Range.isCollapsed(selection)) {\n Transforms.move(editor, { reverse: isRTL })\n } else {\n Transforms.collapse(editor, {\n edge: isRTL ? 'start' : 'end',\n })\n }\n\n return\n }\n\n if (Hotkeys.isMoveWordBackward(nativeEvent)) {\n event.preventDefault()\n\n if (selection && Range.isExpanded(selection)) {\n Transforms.collapse(editor, { edge: 'focus' })\n }\n\n Transforms.move(editor, {\n unit: 'word',\n reverse: !isRTL,\n })\n return\n }\n\n if (Hotkeys.isMoveWordForward(nativeEvent)) {\n event.preventDefault()\n\n if (selection && Range.isExpanded(selection)) {\n Transforms.collapse(editor, { edge: 'focus' })\n }\n\n Transforms.move(editor, {\n unit: 'word',\n reverse: isRTL,\n })\n return\n }\n\n // COMPAT: Certain browsers don't support the `beforeinput` event, so we\n // fall back to guessing at the input intention for hotkeys.\n // COMPAT: In iOS, some of these hotkeys are handled in the\n if (!HAS_BEFORE_INPUT_SUPPORT) {\n // We don't have a core behavior for these, but they change the\n // DOM if we don't prevent them, so we have to.\n if (\n Hotkeys.isBold(nativeEvent) ||\n Hotkeys.isItalic(nativeEvent) ||\n Hotkeys.isTransposeCharacter(nativeEvent)\n ) {\n event.preventDefault()\n return\n }\n\n if (Hotkeys.isSoftBreak(nativeEvent)) {\n event.preventDefault()\n Editor.insertSoftBreak(editor)\n return\n }\n\n if (Hotkeys.isSplitBlock(nativeEvent)) {\n event.preventDefault()\n Editor.insertBreak(editor)\n return\n }\n\n if (Hotkeys.isDeleteBackward(nativeEvent)) {\n event.preventDefault()\n\n if (selection && Range.isExpanded(selection)) {\n Editor.deleteFragment(editor, {\n direction: 'backward',\n })\n } else {\n Editor.deleteBackward(editor)\n }\n\n return\n }\n\n if (Hotkeys.isDeleteForward(nativeEvent)) {\n event.preventDefault()\n\n if (selection && Range.isExpanded(selection)) {\n Editor.deleteFragment(editor, {\n direction: 'forward',\n })\n } else {\n Editor.deleteForward(editor)\n }\n\n return\n }\n\n if (Hotkeys.isDeleteLineBackward(nativeEvent)) {\n event.preventDefault()\n\n if (selection && Range.isExpanded(selection)) {\n Editor.deleteFragment(editor, {\n direction: 'backward',\n })\n } else {\n Editor.deleteBackward(editor, { unit: 'line' })\n }\n\n return\n }\n\n if (Hotkeys.isDeleteLineForward(nativeEvent)) {\n event.preventDefault()\n\n if (selection && Range.isExpanded(selection)) {\n Editor.deleteFragment(editor, {\n direction: 'forward',\n })\n } else {\n Editor.deleteForward(editor, { unit: 'line' })\n }\n\n return\n }\n\n if (Hotkeys.isDeleteWordBackward(nativeEvent)) {\n event.preventDefault()\n\n if (selection && Range.isExpanded(selection)) {\n Editor.deleteFragment(editor, {\n direction: 'backward',\n })\n } else {\n Editor.deleteBackward(editor, { unit: 'word' })\n }\n\n return\n }\n\n if (Hotkeys.isDeleteWordForward(nativeEvent)) {\n event.preventDefault()\n\n if (selection && Range.isExpanded(selection)) {\n Editor.deleteFragment(editor, {\n direction: 'forward',\n })\n } else {\n Editor.deleteForward(editor, { unit: 'word' })\n }\n\n return\n }\n } else {\n if (IS_CHROME || IS_WEBKIT) {\n // COMPAT: Chrome and Safari support `beforeinput` event but do not fire\n // an event when deleting backwards in a selected void inline node\n if (\n selection &&\n (Hotkeys.isDeleteBackward(nativeEvent) ||\n Hotkeys.isDeleteForward(nativeEvent)) &&\n Range.isCollapsed(selection)\n ) {\n const currentNode = Node.parent(\n editor,\n selection.anchor.path\n )\n\n if (\n Element.isElement(currentNode) &&\n Editor.isVoid(editor, currentNode) &&\n (Editor.isInline(editor, currentNode) ||\n Editor.isBlock(editor, currentNode))\n ) {\n event.preventDefault()\n Editor.deleteBackward(editor, { unit: 'block' })\n\n return\n }\n }\n }\n }\n }\n },\n [readOnly, editor, attributes.onKeyDown]\n )}\n onPaste={useCallback(\n (event: React.ClipboardEvent<HTMLDivElement>) => {\n if (\n !readOnly &&\n ReactEditor.hasEditableTarget(editor, event.target) &&\n !isEventHandled(event, attributes.onPaste)\n ) {\n // COMPAT: Certain browsers don't support the `beforeinput` event, so we\n // fall back to React's `onPaste` here instead.\n // COMPAT: Firefox, Chrome and Safari don't emit `beforeinput` events\n // when \"paste without formatting\" is used, so fallback. (2020/02/20)\n // COMPAT: Safari InputEvents generated by pasting won't include\n // application/x-slate-fragment items, so use the\n // ClipboardEvent here. (2023/03/15)\n if (\n !HAS_BEFORE_INPUT_SUPPORT ||\n isPlainTextOnlyPaste(event.nativeEvent) ||\n IS_WEBKIT\n ) {\n event.preventDefault()\n ReactEditor.insertData(editor, event.clipboardData)\n }\n }\n },\n [readOnly, editor, attributes.onPaste]\n )}\n >\n <Children\n decorations={decorations}\n node={editor}\n renderElement={renderElement}\n renderPlaceholder={renderPlaceholder}\n renderLeaf={renderLeaf}\n selection={editor.selection}\n />\n </Component>\n </RestoreDOM>\n </DecorateContext.Provider>\n </ComposingContext.Provider>\n </ReadOnlyContext.Provider>\n )\n }\n)\n\n/**\n * The props that get passed to renderPlaceholder\n */\nexport type RenderPlaceholderProps = {\n children: any\n attributes: {\n 'data-slate-placeholder': boolean\n dir?: 'rtl'\n contentEditable: boolean\n ref: React.RefCallback<any>\n style: React.CSSProperties\n }\n}\n\n/**\n * The default placeholder element\n */\n\nexport const DefaultPlaceholder = ({\n attributes,\n children,\n}: RenderPlaceholderProps) => (\n // COMPAT: Artificially add a line-break to the end on the placeholder element\n // to prevent Android IMEs to pick up its content in autocorrect and to auto-capitalize the first letter\n <span {...attributes}>\n {children}\n {IS_ANDROID && <br />}\n </span>\n)\n\n/**\n * A default memoized decorate function.\n */\n\nexport const defaultDecorate: (entry: NodeEntry) => Range[] = () => []\n\n/**\n * A default implement to scroll dom range into view.\n */\n\nconst defaultScrollSelectionIntoView = (\n editor: ReactEditor,\n domRange: DOMRange\n) => {\n // This was affecting the selection of multiple blocks and dragging behavior,\n // so enabled only if the selection has been collapsed.\n if (\n domRange.getBoundingClientRect &&\n (!editor.selection ||\n (editor.selection && Range.isCollapsed(editor.selection)))\n ) {\n const leafEl = domRange.startContainer.parentElement!\n leafEl.getBoundingClientRect = domRange.getBoundingClientRect.bind(domRange)\n scrollIntoView(leafEl, {\n scrollMode: 'if-needed',\n })\n\n // @ts-expect-error an unorthodox delete D:\n delete leafEl.getBoundingClientRect\n }\n}\n\n/**\n * Check if an event is overrided by a handler.\n */\n\nexport const isEventHandled = <\n EventType extends React.SyntheticEvent<unknown, unknown>,\n>(\n event: EventType,\n handler?: (event: EventType) => void | boolean\n) => {\n if (!handler) {\n return false\n }\n // The custom event handler may return a boolean to specify whether the event\n // shall be treated as being handled or not.\n const shouldTreatEventAsHandled = handler(event)\n\n if (shouldTreatEventAsHandled != null) {\n return shouldTreatEventAsHandled\n }\n\n return event.isDefaultPrevented() || event.isPropagationStopped()\n}\n\n/**\n * Check if the event's target is an input element\n */\nexport const isDOMEventTargetInput = <\n EventType extends React.SyntheticEvent<unknown, unknown>,\n>(\n event: EventType\n) => {\n return (\n isDOMNode(event.target) &&\n (event.target instanceof HTMLInputElement ||\n event.target instanceof HTMLTextAreaElement)\n )\n}\n\n/**\n * Check if a DOM event is overrided by a handler.\n */\n\nexport const isDOMEventHandled = <E extends Event>(\n event: E,\n handler?: (event: E) => void | boolean\n) => {\n if (!handler) {\n return false\n }\n\n // The custom event handler may return a boolean to specify whether the event\n // shall be treated as being handled or not.\n const shouldTreatEventAsHandled = handler(event)\n\n if (shouldTreatEventAsHandled != null) {\n return shouldTreatEventAsHandled\n }\n\n return event.defaultPrevented\n}\n","import { createContext, useContext } from 'react'\n\n/**\n * A React context for sharing the `focused` state of the editor.\n */\n\nexport const FocusedContext = createContext(false)\n\n/**\n * Get the current `focused` state of the editor.\n */\n\nexport const useFocused = (): boolean => {\n return useContext(FocusedContext)\n}\n","import {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useReducer,\n useRef,\n} from 'react'\nimport { Editor } from 'slate'\nimport { useIsomorphicLayoutEffect } from './use-isomorphic-layout-effect'\n\nfunction isError(error: any): error is Error {\n return error instanceof Error\n}\n\ntype EditorChangeHandler = (editor: Editor) => void\n/**\n * A React context for sharing the editor selector context in a way to control rerenders\n */\n\nexport const SlateSelectorContext = createContext<{\n getSlate: () => Editor\n addEventListener: (callback: EditorChangeHandler) => () => void\n}>({} as any)\n\nconst refEquality = (a: any, b: any) => a === b\n\n/**\n * use redux style selectors to prevent rerendering on every keystroke.\n * Bear in mind rerendering can only prevented if the returned value is a value type or for reference types (e.g. objects and arrays) add a custom equality function.\n *\n * Example:\n * ```\n * const isSelectionActive = useSlateSelector(editor => Boolean(editor.selection));\n * ```\n */\nexport function useSlateSelector<T>(\n selector: (editor: Editor) => T,\n equalityFn: (a: T, b: T) => boolean = refEquality\n) {\n const [, forceRender] = useReducer(s => s + 1, 0)\n const context = useContext(SlateSelectorContext)\n if (!context) {\n throw new Error(\n `The \\`useSlateSelector\\` hook must be used inside the <Slate> component's context.`\n )\n }\n const { getSlate, addEventListener } = context\n\n const latestSubscriptionCallbackError = useRef<Error | undefined>()\n const latestSelector = useRef<(editor: Editor) => T>(() => null as any)\n const latestSelectedState = useRef<T>(null as any as T)\n let selectedState: T\n\n try {\n if (\n selector !== latestSelector.current ||\n latestSubscriptionCallbackError.current\n ) {\n selectedState = selector(getSlate())\n } else {\n selectedState = latestSelectedState.current\n }\n } catch (err) {\n if (latestSubscriptionCallbackError.current && isError(err)) {\n err.message += `\\nThe error may be correlated with this previous error:\\n${latestSubscriptionCallbackError.current.stack}\\n\\n`\n }\n\n throw err\n }\n useIsomorphicLayoutEffect(() => {\n latestSelector.current = selector\n latestSelectedState.current = selectedState\n latestSubscriptionCallbackError.current = undefined\n })\n\n useIsomorphicLayoutEffect(\n () => {\n function checkForUpdates() {\n try {\n const newSelectedState = latestSelector.current(getSlate())\n\n if (equalityFn(newSelectedState, latestSelectedState.current)) {\n return\n }\n\n latestSelectedState.current = newSelectedState\n } catch (err) {\n // we ignore all errors here, since when the component\n // is re-rendered, the selectors are called again, and\n // will throw again, if neither props nor store state\n // changed\n if (err instanceof Error) {\n latestSubscriptionCallbackError.current = err\n } else {\n latestSubscriptionCallbackError.current = new Error(String(err))\n }\n }\n\n forceRender()\n }\n\n const unsubscribe = addEventListener(checkForUpdates)\n\n checkForUpdates()\n\n return () => unsubscribe()\n },\n // don't rerender on equalityFn change since we want to be able to define it inline\n [addEventListener, getSlate]\n )\n\n return selectedState\n}\n\n/**\n * Create selector context with editor updating on every editor change\n */\nexport function useSelectorContext(editor: Editor) {\n const eventListeners = useRef<EditorChangeHandler[]>([]).current\n const slateRef = useRef<{\n editor: Editor\n }>({\n editor,\n }).current\n const onChange = useCallback(\n (editor: Editor) => {\n slateRef.editor = editor\n eventListeners.forEach((listener: EditorChangeHandler) =>\n listener(editor)\n )\n },\n [eventListeners, slateRef]\n )\n\n const selectorContext = useMemo(() => {\n return {\n getSlate: () => slateRef.editor,\n addEventListener: (callback: EditorChangeHandler) => {\n eventListeners.push(callback)\n return () => {\n eventListeners.splice(eventListeners.indexOf(callback), 1)\n }\n },\n }\n }, [eventListeners, slateRef])\n return { selectorContext, onChange }\n}\n","import React, { useCallback, useEffect, useState } from 'react'\nimport { Descendant, Editor, Node, Operation, Scrubber, Selection } from 'slate'\nimport { FocusedContext } from '../hooks/use-focused'\nimport { useIsomorphicLayoutEffect } from '../hooks/use-isomorphic-layout-effect'\nimport { SlateContext, SlateContextValue } from '../hooks/use-slate'\nimport {\n useSelectorContext,\n SlateSelectorContext,\n} from '../hooks/use-slate-selector'\nimport { EditorContext } from '../hooks/use-slate-static'\nimport { ReactEditor } from '../plugin/react-editor'\nimport { REACT_MAJOR_VERSION } from '../utils/environment'\nimport { EDITOR_TO_ON_CHANGE } from '../utils/weak-maps'\n\n/**\n * A wrapper around the provider to handle `onChange` events, because the editor\n * is a mutable singleton so it won't ever register as \"changed\" otherwise.\n */\n\nexport const Slate = (props: {\n editor: ReactEditor\n initialValue: Descendant[]\n children: React.ReactNode\n onChange?: (value: Descendant[]) => void\n onSelectionChange?: (selection: Selection) => void\n onValueChange?: (value: Descendant[]) => void\n}) => {\n const {\n editor,\n children,\n onChange,\n onSelectionChange,\n onValueChange,\n initialValue,\n ...rest\n } = props\n\n const [context, setContext] = React.useState<SlateContextValue>(() => {\n if (!Node.isNodeList(initialValue)) {\n throw new Error(\n `[Slate] initialValue is invalid! Expected a list of elements but got: ${Scrubber.stringify(\n initialValue\n )}`\n )\n }\n if (!Editor.isEditor(editor)) {\n throw new Error(\n `[Slate] editor is invalid! You passed: ${Scrubber.stringify(editor)}`\n )\n }\n editor.children = initialValue\n Object.assign(editor, rest)\n return { v: 0, editor }\n })\n\n const { selectorContext, onChange: handleSelectorChange } =\n useSelectorContext(editor)\n\n const onContextChange = useCallback(\n (options?: { operation?: Operation }) => {\n if (onChange) {\n onChange(editor.children)\n }\n\n switch (options?.operation?.type) {\n case 'set_selection':\n onSelectionChange?.(editor.selection)\n break\n default:\n onValueChange?.(editor.children)\n }\n\n setContext(prevContext => ({\n v: prevContext.v + 1,\n editor,\n }))\n handleSelectorChange(editor)\n },\n [editor, handleSelectorChange, onChange, onSelectionChange, onValueChange]\n )\n\n useEffect(() => {\n EDITOR_TO_ON_CHANGE.set(editor, onContextChange)\n\n return () => {\n EDITOR_TO_ON_CHANGE.set(editor, () => {})\n }\n }, [editor, onContextChange])\n\n const [isFocused, setIsFocused] = useState(ReactEditor.isFocused(editor))\n\n useEffect(() => {\n setIsFocused(ReactEditor.isFocused(editor))\n }, [editor])\n\n useIsomorphicLayoutEffect(() => {\n const fn = () => setIsFocused(ReactEditor.isFocused(editor))\n if (REACT_MAJOR_VERSION >= 17) {\n // In React >= 17 onFocus and onBlur listen to the focusin and focusout events during the bubbling phase.\n // Therefore in order for <Editable />'s handlers to run first, which is necessary for ReactEditor.isFocused(editor)\n // to return the correct value, we have to listen to the focusin and focusout events without useCapture here.\n document.addEventListener('focusin', fn)\n document.addEventListener('focusout', fn)\n return () => {\n document.removeEventListener('focusin', fn)\n document.removeEventListener('focusout', fn)\n }\n } else {\n document.addEventListener('focus', fn, true)\n document.addEventListener('blur', fn, true)\n return () => {\n document.removeEventListener('focus', fn, true)\n document.removeEventListener('blur', fn, true)\n }\n }\n }, [])\n\n return (\n <SlateSelectorContext.Provider value={selectorContext}>\n <SlateContext.Provider value={context}>\n <EditorContext.Provider value={context.editor}>\n <FocusedContext.Provider value={isFocused}>\n {children}\n </FocusedContext.Provider>\n </EditorContext.Provider>\n </SlateContext.Provider>\n </SlateSelectorContext.Provider>\n )\n}\n","import { useContext } from 'react'\n\nimport { EditorContext } from './use-slate-static'\n\n/**\n * Get the current editor object from the React context.\n * @deprecated Use useSlateStatic instead.\n */\n\nexport const useEditor = () => {\n const editor = useContext(EditorContext)\n\n if (!editor) {\n throw new Error(\n `The \\`useEditor\\` hook must be used inside the <Slate> component's context.`\n )\n }\n\n return editor\n}\n","import { BaseSelection, Range } from 'slate'\n\nimport { useSlateSelector } from './use-slate-selector'\n\n/**\n * Get the current slate selection.\n * Only triggers a rerender when the selection actually changes\n */\nexport const useSlateSelection = () => {\n return useSlateSelector(editor => editor.selection, isSelectionEqual)\n}\n\nconst isSelectionEqual = (a: BaseSelection, b: BaseSelection) => {\n if (!a && !b) return true\n if (!a || !b) return false\n return Range.equals(a, b)\n}\n","/**\n * Utilities for single-line deletion\n */\n\nimport { Editor, Range } from 'slate'\nimport { ReactEditor } from '../plugin/react-editor'\n\nconst doRectsIntersect = (rect: DOMRect, compareRect: DOMRect) => {\n const middle = (compareRect.top + compareRect.bottom) / 2\n\n return rect.top <= middle && rect.bottom >= middle\n}\n\nconst areRangesSameLine = (\n editor: ReactEditor,\n range1: Range,\n range2: Range\n) => {\n const rect1 = ReactEditor.toDOMRange(editor, range1).getBoundingClientRect()\n const rect2 = ReactEditor.toDOMRange(editor, range2).getBoundingClientRect()\n\n return doRectsIntersect(rect1, rect2) && doRectsIntersect(rect2, rect1)\n}\n\n/**\n * A helper utility that returns the end portion of a `Range`\n * which is located on a single line.\n *\n * @param {Editor} editor The editor object to compare against\n * @param {Range} parentRange The parent range to compare against\n * @returns {Range} A valid portion of the parentRange which is one a single line\n */\nexport const findCurrentLineRange = (\n editor: ReactEditor,\n parentRange: Range\n): Range => {\n const parentRangeBoundary = Editor.range(editor, Range.end(parentRange))\n const positions = Array.from(Editor.positions(editor, { at: parentRange }))\n\n let left = 0\n let right = positions.length\n let middle = Math.floor(right / 2)\n\n if (\n areRangesSameLine(\n editor,\n Editor.range(editor, positions[left]),\n parentRangeBoundary\n )\n ) {\n return Editor.range(editor, positions[left], parentRangeBoundary)\n }\n\n if (positions.length < 2) {\n return Editor.range(\n editor,\n positions[positions.length - 1],\n parentRangeBoundary\n )\n }\n\n while (middle !== positions.length && middle !== left) {\n if (\n areRangesSameLine(\n editor,\n Editor.range(editor, positions[middle]),\n parentRangeBoundary\n )\n ) {\n right = middle\n } else {\n left = middle\n }\n\n middle = Math.floor((left + right) / 2)\n }\n\n return Editor.range(editor, positions[right], parentRangeBoundary)\n}\n","import ReactDOM from 'react-dom'\nimport {\n BaseEditor,\n Editor,\n Element,\n Node,\n Operation,\n Path,\n PathRef,\n Point,\n Range,\n Transforms,\n} from 'slate'\nimport {\n TextDiff,\n transformPendingPoint,\n transformPendingRange,\n transformTextDiff,\n} from '../utils/diff-text'\nimport {\n getPlainText,\n getSlateFragmentAttribute,\n isDOMText,\n} from '../utils/dom'\nimport { Key } from '../utils/key'\nimport { findCurrentLineRange } from '../utils/lines'\nimport {\n IS_NODE_MAP_DIRTY,\n EDITOR_TO_KEY_TO_ELEMENT,\n EDITOR_TO_ON_CHANGE,\n EDITOR_TO_PENDING_ACTION,\n EDITOR_TO_PENDING_DIFFS,\n EDITOR_TO_PENDING_INSERTION_MARKS,\n EDITOR_TO_PENDING_SELECTION,\n EDITOR_TO_SCHEDULE_FLUSH,\n EDITOR_TO_USER_MARKS,\n EDITOR_TO_USER_SELECTION,\n NODE_TO_KEY,\n} from '../utils/weak-maps'\nimport { ReactEditor } from './react-editor'\nimport { REACT_MAJOR_VERSION } from '../utils/environment'\n\n/**\n * `withReact` adds React and DOM specific behaviors to the editor.\n *\n * If you are using TypeScript, you must extend Slate's CustomTypes to use\n * this plugin.\n *\n * See https://docs.slatejs.org/concepts/11-typescript to learn how.\n */\n\nexport const withReact = <T extends BaseEditor>(\n editor: T,\n clipboardFormatKey = 'x-slate-fragment'\n): T & ReactEditor => {\n const e = editor as T & ReactEditor\n const { apply, onChange, deleteBackward, addMark, removeMark } = e\n\n // The WeakMap which maps a key to a specific HTMLElement must be scoped to the editor instance to\n // avoid collisions between editors in the DOM that share the same value.\n EDITOR_TO_KEY_TO_ELEMENT.set(e, new WeakMap())\n\n e.addMark = (key, value) => {\n EDITOR_TO_SCHEDULE_FLUSH.get(e)?.()\n\n if (\n !EDITOR_TO_PENDING_INSERTION_MARKS.get(e) &&\n EDITOR_TO_PENDING_DIFFS.get(e)?.length\n ) {\n // Ensure the current pending diffs originating from changes before the addMark\n // are applied with the current formatting\n EDITOR_TO_PENDING_INSERTION_MARKS.set(e, null)\n }\n\n EDITOR_TO_USER_MARKS.delete(e)\n\n addMark(key, value)\n }\n\n e.removeMark = key => {\n if (\n !EDITOR_TO_PENDING_INSERTION_MARKS.get(e) &&\n EDITOR_TO_PENDING_DIFFS.get(e)?.length\n ) {\n // Ensure the current pending diffs originating from changes before the addMark\n // are applied with the current formatting\n EDITOR_TO_PENDING_INSERTION_MARKS.set(e, null)\n }\n\n EDITOR_TO_USER_MARKS.delete(e)\n\n removeMark(key)\n }\n\n e.deleteBackward = unit => {\n if (unit !== 'line') {\n return deleteBackward(unit)\n }\n\n if (e.selection && Range.isCollapsed(e.selection)) {\n const parentBlockEntry = Editor.above(e, {\n match: n => Element.isElement(n) && Editor.isBlock(e, n),\n at: e.selection,\n })\n\n if (parentBlockEntry) {\n const [, parentBlockPath] = parentBlockEntry\n const parentElementRange = Editor.range(\n e,\n parentBlockPath,\n e.selection.anchor\n )\n\n const currentLineRange = findCurrentLineRange(e, parentElementRange)\n\n if (!Range.isCollapsed(currentLineRange)) {\n Transforms.delete(e, { at: currentLineRange })\n }\n }\n }\n }\n\n // This attempts to reset the NODE_TO_KEY entry to the correct value\n // as apply() changes the object reference and hence invalidates the NODE_TO_KEY entry\n e.apply = (op: Operation) => {\n const matches: [Path, Key][] = []\n const pathRefMatches: [PathRef, Key][] = []\n\n const pendingDiffs = EDITOR_TO_PENDING_DIFFS.get(e)\n if (pendingDiffs?.length) {\n const transformed = pendingDiffs\n .map(textDiff => transformTextDiff(textDiff, op))\n .filter(Boolean) as TextDiff[]\n\n EDITOR_TO_PENDING_DIFFS.set(e, transformed)\n }\n\n const pendingSelection = EDITOR_TO_PENDING_SELECTION.get(e)\n if (pendingSelection) {\n EDITOR_TO_PENDING_SELECTION.set(\n e,\n transformPendingRange(e, pendingSelection, op)\n )\n }\n\n const pendingAction = EDITOR_TO_PENDING_ACTION.get(e)\n if (pendingAction?.at) {\n const at = Point.isPoint(pendingAction?.at)\n ? transformPendingPoint(e, pendingAction.at, op)\n : transformPendingRange(e, pendingAction.at, op)\n\n EDITOR_TO_PENDING_ACTION.set(e, at ? { ...pendingAction, at } : null)\n }\n\n switch (op.type) {\n case 'insert_text':\n case 'remove_text':\n case 'set_node':\n case 'split_node': {\n matches.push(...getMatches(e, op.path))\n break\n }\n\n case 'set_selection': {\n // Selection was manually set, don't restore the user selection after the change.\n EDITOR_TO_USER_SELECTION.get(e)?.unref()\n EDITOR_TO_USER_SELECTION.delete(e)\n break\n }\n\n case 'insert_node':\n case 'remove_node': {\n matches.push(...getMatches(e, Path.parent(op.path)))\n break\n }\n\n case 'merge_node': {\n const prevPath = Path.previous(op.path)\n matches.push(...getMatches(e, prevPath))\n break\n }\n\n case 'move_node': {\n const commonPath = Path.common(\n Path.parent(op.path),\n Path.parent(op.newPath)\n )\n matches.push(...getMatches(e, commonPath))\n\n let changedPath: Path\n if (Path.isBefore(op.path, op.newPath)) {\n matches.push(...getMatches(e, Path.parent(op.path)))\n changedPath = op.newPath\n } else {\n matches.push(...getMatches(e, Path.parent(op.newPath)))\n changedPath = op.path\n }\n\n const changedNode = Node.get(editor, Path.parent(changedPath))\n const changedNodeKey = ReactEditor.findKey(e, changedNode)\n const changedPathRef = Editor.pathRef(e, Path.parent(changedPath))\n pathRefMatches.push([changedPathRef, changedNodeKey])\n\n break\n }\n }\n\n apply(op)\n\n switch (op.type) {\n case 'insert_node':\n case 'remove_node':\n case 'merge_node':\n case 'move_node':\n case 'split_node': {\n IS_NODE_MAP_DIRTY.set(e, true)\n }\n }\n\n for (const [path, key] of matches) {\n const [node] = Editor.node(e, path)\n NODE_TO_KEY.set(node, key)\n }\n\n for (const [pathRef, key] of pathRefMatches) {\n if (pathRef.current) {\n const [node] = Editor.node(e, pathRef.current)\n NODE_TO_KEY.set(node, key)\n }\n\n pathRef.unref()\n }\n }\n\n e.setFragmentData = (data: Pick<DataTransfer, 'getData' | 'setData'>) => {\n const { selection } = e\n\n if (!selection) {\n return\n }\n\n const [start, end] = Range.edges(selection)\n const startVoid = Editor.void(e, { at: start.path })\n const endVoid = Editor.void(e, { at: end.path })\n\n if (Range.isCollapsed(selection) && !startVoid) {\n return\n }\n\n // Create a fake selection so that we can add a Base64-encoded copy of the\n // fragment to the HTML, to decode on future pastes.\n const domRange = ReactEditor.toDOMRange(e, selection)\n let contents = domRange.cloneContents()\n let attach = contents.childNodes[0] as HTMLElement\n\n // Make sure attach is non-empty, since empty nodes will not get copied.\n contents.childNodes.forEach(node => {\n if (node.textContent && node.textContent.trim() !== '') {\n attach = node as HTMLElement\n }\n })\n\n // COMPAT: If the end node is a void node, we need to move the end of the\n // range from the void node's spacer span, to the end of the void node's\n // content, since the spacer is before void's content in the DOM.\n if (endVoid) {\n const [voidNode] = endVoid\n const r = domRange.cloneRange()\n const domNode = ReactEditor.toDOMNode(e, voidNode)\n r.setEndAfter(domNode)\n contents = r.cloneContents()\n }\n\n // COMPAT: If the start node is a void node, we need to attach the encoded\n // fragment to the void node's content node instead of the spacer, because\n // attaching it to empty `<div>/<span>` nodes will end up having it erased by\n // most browsers. (2018/04/27)\n if (startVoid) {\n attach = contents.querySelector('[data-slate-spacer]')! as HTMLElement\n }\n\n // Remove any zero-width space spans from the cloned DOM so that they don't\n // show up elsewhere when pasted.\n Array.from(contents.querySelectorAll('[data-slate-zero-width]')).forEach(\n zw => {\n const isNewline = zw.getAttribute('data-slate-zero-width') === 'n'\n zw.textContent = isNewline ? '\\n' : ''\n }\n )\n\n // Set a `data-slate-fragment` attribute on a non-empty node, so it shows up\n // in the HTML, and can be used for intra-Slate pasting. If it's a text\n // node, wrap it in a `<span>` so we have something to set an attribute on.\n if (isDOMText(attach)) {\n const span = attach.ownerDocument.createElement('span')\n // COMPAT: In Chrome and Safari, if we don't add the `white-space` style\n // then leading and trailing spaces will be ignored. (2017/09/21)\n span.style.whiteSpace = 'pre'\n span.appendChild(attach)\n contents.appendChild(span)\n attach = span\n }\n\n const fragment = e.getFragment()\n const string = JSON.stringify(fragment)\n const encoded = window.btoa(encodeURIComponent(string))\n attach.setAttribute('data-slate-fragment', encoded)\n data.setData(`application/${clipboardFormatKey}`, encoded)\n\n // Add the content to a <div> so that we can get its inner HTML.\n const div = contents.ownerDocument.createElement('div')\n div.appendChild(contents)\n div.setAttribute('hidden', 'true')\n contents.ownerDocument.body.appendChild(div)\n data.setData('text/html', div.innerHTML)\n data.setData('text/plain', getPlainText(div))\n contents.ownerDocument.body.removeChild(div)\n return data\n }\n\n e.insertData = (data: DataTransfer) => {\n if (!e.insertFragmentData(data)) {\n e.insertTextData(data)\n }\n }\n\n e.insertFragmentData = (data: DataTransfer): boolean => {\n /**\n * Checking copied fragment from application/x-slate-fragment or data-slate-fragment\n */\n const fragment =\n data.getData(`application/${clipboardFormatKey}`) ||\n getSlateFragmentAttribute(data)\n\n if (fragment) {\n const decoded = decodeURIComponent(window.atob(fragment))\n const parsed = JSON.parse(decoded) as Node[]\n e.insertFragment(parsed)\n return true\n }\n return false\n }\n\n e.insertTextData = (data: DataTransfer): boolean => {\n const text = data.getData('text/plain')\n\n if (text) {\n const lines = text.split(/\\r\\n|\\r|\\n/)\n let split = false\n\n for (const line of lines) {\n if (split) {\n Transforms.splitNodes(e, { always: true })\n }\n\n e.insertText(line)\n split = true\n }\n return true\n }\n return false\n }\n\n e.onChange = options => {\n // COMPAT: React < 18 doesn't batch `setState` hook calls, which means\n // that the children and selection can get out of sync for one render\n // pass. So we have to use this unstable API to ensure it batches them.\n // (2019/12/03)\n // https://github.com/facebook/react/issues/14259#issuecomment-439702367\n const maybeBatchUpdates =\n REACT_MAJOR_VERSION < 18\n ? ReactDOM.unstable_batchedUpdates\n : (callback: () => void) => callback()\n\n maybeBatchUpdates(() => {\n const onContextChange = EDITOR_TO_ON_CHANGE.get(e)\n\n if (onContextChange) {\n onContextChange(options)\n }\n\n onChange(options)\n })\n }\n\n return e\n}\n\nconst getMatches = (e: Editor, path: Path) => {\n const matches: [Path, Key][] = []\n for (const [n, p] of Editor.levels(e, { at: path })) {\n const key = ReactEditor.findKey(e, n)\n matches.push([p, key])\n }\n return matches\n}\n"],"names":["require$$0","EditorContext","createContext","useSlateStatic","editor","useContext","Error","REACT_MAJOR_VERSION","parseInt","React","version","split","IS_IOS","navigator","window","test","userAgent","MSStream","IS_APPLE","IS_ANDROID","IS_FIREFOX","IS_WEBKIT","IS_EDGE_LEGACY","IS_CHROME","IS_CHROME_LEGACY","IS_ANDROID_CHROME_LEGACY","IS_FIREFOX_LEGACY","IS_UC_MOBILE","IS_WECHATBROWSER","CAN_USE_DOM","document","createElement","_navigator$userAgent$","match","_navigator$userAgent$2","HAS_BEFORE_INPUT_SUPPORT","globalThis","InputEvent","prototype","getTargetRanges","IS_NODE_MAP_DIRTY","WeakMap","NODE_TO_INDEX","NODE_TO_PARENT","EDITOR_TO_WINDOW","EDITOR_TO_ELEMENT","EDITOR_TO_PLACEHOLDER_ELEMENT","ELEMENT_TO_NODE","NODE_TO_ELEMENT","NODE_TO_KEY","EDITOR_TO_KEY_TO_ELEMENT","IS_READ_ONLY","IS_FOCUSED","IS_COMPOSING","EDITOR_TO_USER_SELECTION","EDITOR_TO_ON_CHANGE","EDITOR_TO_SCHEDULE_FLUSH","EDITOR_TO_PENDING_INSERTION_MARKS","EDITOR_TO_USER_MARKS","EDITOR_TO_PENDING_DIFFS","EDITOR_TO_PENDING_ACTION","EDITOR_TO_PENDING_SELECTION","EDITOR_TO_FORCE_RENDER","PLACEHOLDER_SYMBOL","Symbol","MARK_PLACEHOLDER_SYMBOL","DOMNode","Node","DOMText","Text","getDefaultView","value","ownerDocument","defaultView","isDOMComment","isDOMNode","nodeType","isDOMElement","isDOMSelection","anchorNode","Selection","isDOMText","isPlainTextOnlyPaste","event","clipboardData","getData","types","length","normalizeDOMPoint","domPoint","_domPoint","_slicedToArray","node","offset","childNodes","isLast","index","_getEditableChildAndI","getEditableChildAndIndex","_getEditableChildAndI2","i","getEditableChild","textContent","hasShadowRoot","parent","parentNode","toString","direction","child","triedForward","triedBackward","getAttribute","_getEditableChildAndI3","_getEditableChildAndI4","getPlainText","domNode","text","nodeValue","_i","_Array$from","Array","from","childNode","display","getComputedStyle","getPropertyValue","tagName","catchSlateFragment","getSlateFragmentAttribute","dataTransfer","htmlData","_ref","_ref2","fragment","getSelection","root","isTrackedMutation","mutation","batch","target","matches","_ReactEditor$getWindo","ReactEditor","getWindow","contains","hasDOMNode","editable","parentMutation","find","_ref3","addedNodes","removedNodes","_iterator","_createForOfIteratorHelper","_step","s","n","done","err","e","f","_iterator2","_step2","getActiveElement","activeElement","_activeElement","shadowRoot","_activeElement$shadow","_activeElement2","isBefore","otherNode","Boolean","compareDocumentPosition","DOCUMENT_POSITION_PRECEDING","isAfter","DOCUMENT_POSITION_FOLLOWING","Key","_createClass","_classCallCheck","_defineProperty","id","concat","androidPendingDiffs","get","androidScheduleFlush","_EDITOR_TO_SCHEDULE_F","blur","el","toDOMNode","findDocumentOrShadowRoot","set","deselect","selection","domSelection","rangeCount","removeAllRanges","Transforms","getRootNode","Document","ShadowRoot","findEventRange","nativeEvent","_event","x","clientX","y","clientY","toSlateNode","path","findPath","Element","isElement","Editor","isVoid","rect","getBoundingClientRect","isPrev","isInline","left","width","top","height","edge","point","before","after","range","domRange","caretRangeFromPoint","position","caretPositionFromPoint","createRange","setStart","offsetNode","setEnd","toSlateRange","exactMatch","suppressThrow","findKey","key","isEditor","unshift","Scrubber","stringify","focus","options","arguments","undefined","retries","operations","setTimeout","toDOMRange","addRange","select","start","preventScroll","_options$editable","editorEl","targetEl","parentElement","message","includes","closest","isContentEditable","hasEditableTarget","hasRange","anchor","hasPath","hasSelectableTarget","isTargetInsideNonReadonlyVoid","hasTarget","insertData","data","insertFragmentData","insertTextData","isComposing","isFocused","isReadOnly","slateNode","setFragmentData","originEvent","KEY_TO_ELEMENT","toDOMPoint","_Editor$node","_Editor$node2","at","selector","texts","querySelectorAll","attr","trueLength","end","nextText","hasAttribute","_nextText$textContent","domText","startsWith","Math","min","max","isBackward","Range","domAnchor","domFocus","isCollapsed","startNode","startOffset","_ref4","endNode","endOffset","startEl","isStartAtZeroWidth","endEl","isEndAtZeroWidth","domEl","toSlatePoint","_options$searchDirect","searchDirection","_ref5","_ref6","nearestNode","nearestOffset","textNode","_domNode$textContent","_domNode$textContent2","potentialVoidNode","voidNode","potentialNonEditableNode","nonEditableNode","leafNode","contents","cloneContents","removals","_toConsumableArray","slice","call","forEach","textContext","removeChild","leafNodes","current","getLeafNodes","elementNode","_leafNodes$find","nextElementSibling","leaf","_leafNodes2$findLast","previousElementSibling","findLast","endsWith","_Editor$start","querySelector","_focusNode$textConten","startContainer","anchorOffset","focusNode","focusOffset","firstRange","getRangeAt","lastRange","HTMLTableRowElement","getLastChildren","element","childElementCount","children","firstNodeRow","lastNodeRow","firstNode","lastNode","HTMLElement","innerHTML","endContainer","collapsed","focusBeforeAnchor","isExpanded","isForward","mode","unhangRange","voids","verifyDiffState","textDiff","diff","isText","nextPath","Path","next","nextNode","applyStringDiff","_len","diffs","_key","reduce","longestCommonPrefixLength","str","another","charAt","longestCommonSuffixLength","normalizeStringDiff","targetText","removedText","prefixLength","suffixLength","normalized","mergeStringDiffs","a","b","overlap","applied","sliceEnd","targetRange","normalizePoint","parentBlock","above","isBlock","entry","isDescendant","normalizeRange","transformPendingPoint","op","pendingDiffs","equals","Point","transform","affinity","transformed","type","transformPendingRange","transformTextDiff","newPath","RESOLVE_DELAY","FLUSH_DELAY","debug","isDataTransfer","constructor","name","createAndroidInputManager","scheduleOnDOMSelectionChange","onDOMSelectionChange","flushing","compositionEndTimeoutId","flushTimeoutId","actionTimeoutId","idCounter","insertPositionHint","applyPendingSelection","pendingSelection","performAction","action","isPoint","run","flush","clearTimeout","hasPendingDiffs","hasPendingAction","selectionRef","rangeRef","marks","scheduleSelectionChange","_EDITOR_TO_PENDING_DI","_EDITOR_TO_PENDING_DI2","pendingMarks","insertText","deleteFragment","filter","cancel","unref","userMarks","onChange","handleCompositionEnd","handleCompositionStart","updatePlaceholderVisibility","forceHide","placeholderElement","style","removeProperty","storeDiff","_EDITOR_TO_PENDING_DI3","idx","findIndex","change","push","merged","splice","_objectSpread","scheduleAction","handleDOMBeforeInput","_targetRange2","inputType","_event$getTargetRange","_event$getTargetRange2","nativeTargetRange","canStoreDiff","_Range$edges","edges","_Range$edges2","_Range$edges3","_Range$edges4","_Editor$leaf","_Editor$leaf2","relevantPendingDiffs","apply","handleUserSelect","_targetRange3","targetNode","deleteForward","_nativeTargetRange","_targetRange4","nativeCollapsed","deleteBackward","unit","insertSoftBreak","insertBreak","replace","parts","line","_Range$edges5","_Range$edges6","hintPosition","search","diffPosition","scheduleFlush","_EDITOR_TO_PENDING_DI4","hasPendingChanges","isFlushing","pathChanged","parentPathChanged","handleInput","handleKeyDown","_","handleDomMutations","mutations","some","_EDITOR_TO_FORCE_REND","useIsMounted","isMountedRef","useRef","useEffect","useIsomorphicLayoutEffect","useLayoutEffect","useMutationObserver","callback","_useState","useState","MutationObserver","_useState2","mutationObserver","takeRecords","observe","disconnect","MUTATION_OBSERVER_CONFIG","subtree","childList","characterData","useAndroidInputManager","_objectWithoutProperties","_excluded","isMounted","inputManager","shallowCompare","obj1","obj2","Object","keys","every","hasOwnProperty","isDecorationFlagsEqual","other","rangeOwnProps","otherOwnProps","_excluded2","isElementDecorationsEqual","list","isTextDecorationsEqual","String","props","parentPath","isMarkPlaceholder","ZeroWidthString","string","isLineBreak","TextString","isTrailing","_props$isTrailing","ref","getTextContent","initialText","textWithTrailing","MemoizedText","memo","forwardRef","_props$length","_props$isLineBreak","_props$isMarkPlacehol","attributes","PLACEHOLDER_DELAY","disconnectPlaceholderResizeObserver","placeholderResizeObserver","releaseObserver","clearTimeoutRef","timeoutRef","Leaf","renderPlaceholder","_props$renderLeaf","renderLeaf","DefaultLeaf","placeholderRef","showPlaceholder","setShowPlaceholder","showPlaceholderTimeoutRef","callbackPlaceholderRef","useCallback","placeholderEl","_leaf$onPlaceholderRe","onPlaceholderResize","ResizeObserver","ResizeObserverPolyfill","_leaf$onPlaceholderRe2","leafIsPlaceholder","placeholderProps","placeholder","pointerEvents","maxWidth","opacity","userSelect","textDecoration","WebkitUserModify","contentEditable","Fragment","MemoizedLeaf","prev","decorations","leaves","SlateText","callbackRef","span","_props$renderElement","renderElement","p","DefaultElement","readOnly","useReadOnly","useChildren","hasInlines","dir","getDirection","Tag","_Node$texts","_Node$texts2","_Node$texts2$","color","outline","MemoizedElement","DecorateContext","useDecorate","SelectedContext","useSelected","decorate","isLeafBlock","sel","intersection","ds","dec","d","Provider","ElementComponent","TextComponent","ReadOnlyContext","SlateContext","useSlate","context","useSlateWithV","useTrackUserInput","receivedUserInput","animationFrameIdRef","onUserInput","cancelAnimationFrame","requestAnimationFrame","TRIPLE_CLICK","HOTKEYS","bold","compose","moveBackward","moveForward","moveWordBackward","moveWordForward","extendBackward","extendForward","italic","splitBlock","undo","APPLE_HOTKEYS","moveLineBackward","moveLineForward","deleteLineBackward","deleteLineForward","deleteWordBackward","deleteWordForward","extendLineBackward","extendLineForward","redo","transposeCharacter","WINDOWS_HOTKEYS","create","generic","apple","windows","isGeneric","isHotkey","isApple","isWindows","isBold","isCompose","isMoveBackward","isMoveForward","isDeleteBackward","isDeleteForward","isDeleteLineBackward","isDeleteLineForward","isDeleteWordBackward","isDeleteWordForward","isExtendBackward","isExtendForward","isExtendLineBackward","isExtendLineForward","isItalic","isMoveLineBackward","isMoveLineForward","isMoveWordBackward","isMoveWordForward","isRedo","isSoftBreak","isSplitBlock","isTransposeCharacter","isUndo","createRestoreDomManager","bufferedMutations","clear","registerMutations","_bufferedMutations","trackedMutations","restoreDOM","reverse","insertBefore","nextSibling","characterDataOldValue","RestoreDOMComponent","_Component","_inherits","_super","_createSuper","_this","args","_assertThisInitialized","_this$mutationObserve","componentDidMount","manager","getSnapshotBeforeUpdate","_this$mutationObserve2","_this$mutationObserve3","_this$manager2","pendingMutations","_this$manager","componentDidUpdate","_this$manager3","componentWillUnmount","_this$mutationObserve4","render","Component","RestoreDOM","ComposingContext","useComposing","Children","Editable","forwardedRef","defaultRenderPlaceholder","DefaultPlaceholder","autoFocus","_props$decorate","defaultDecorate","propsOnDOMBeforeInput","onDOMBeforeInput","_props$readOnly","_props$renderPlacehol","_props$scrollSelectio","scrollSelectionIntoView","defaultScrollSelectionIntoView","_props$style","userStyle","_props$as","as","_props$disableDefault","disableDefaultStyles","setIsComposing","deferredOperations","_useState3","_useState4","placeholderHeight","setPlaceholderHeight","processing","_useTrackUserInput","_useReducer","useReducer","_useReducer2","forceRender","state","useMemo","isDraggingInternally","isUpdatingSelection","latestElement","hasMarkPlaceholder","androidInputManagerRef","throttle","active","execCommand","androidInputManager","anchorNodeSelectable","focusNodeInEditor","debounce","_androidInputManagerR","_androidInputManagerR2","setDomSelection","forceChange","hasDomSelection","editorElement","hasDomSelectionInEditor","slateRange","_anchorNode","newDomRange","collapseToEnd","setBaseAndExtent","ensureSelection","timeoutId","animationFrameId","ensureDomSelection","ranges","newRange","preventDefault","stopImmediatePropagation","isDOMEventHandled","_EDITOR_TO_USER_SELEC","isCompositionChange","native","_node$parentElement","_window$getComputedSt","_ReactEditor$toDOMPoi","_ReactEditor$toDOMPoi2","_lastText$textContent","lastText","createTreeWalker","NodeFilter","SHOW_TEXT","lastChild","whiteSpace","block","toRestore","removeEventListener","addEventListener","stoppedDragging","placeHolderResizeHandler","_placeholderEl$getBou","_decorations$push","rest","loose","unset","fromEntries","map","mark","role","spellCheck","autoCorrect","autoCapitalize","zindex","suppressContentEditableWarning","wordWrap","minHeight","onBeforeInput","isEventHandled","onInput","maybeHistoryEditor","onBlur","relatedTarget","onClick","detail","blockPath","_block$","startVoid","endVoid","onCompositionEnd","_androidInputManagerR3","Promise","resolve","then","placeholderMarks","onCompositionUpdate","onCompositionStart","_androidInputManagerR4","onCopy","isDOMEventTargetInput","onCut","onDragOver","onDragStart","voidMatch","onDrop","draggedRange","onDragEnd","onFocus","onKeyDown","_androidInputManagerR5","isRTL","Hotkeys","move","collapse","currentNode","onPaste","leafEl","bind","scrollIntoView","scrollMode","handler","shouldTreatEventAsHandled","isDefaultPrevented","isPropagationStopped","HTMLInputElement","HTMLTextAreaElement","defaultPrevented","FocusedContext","useFocused","isError","error","SlateSelectorContext","refEquality","useSlateSelector","equalityFn","getSlate","latestSubscriptionCallbackError","latestSelector","latestSelectedState","selectedState","stack","checkForUpdates","newSelectedState","unsubscribe","useSelectorContext","eventListeners","slateRef","listener","selectorContext","indexOf","Slate","onSelectionChange","onValueChange","initialValue","_React$useState","isNodeList","assign","v","_React$useState2","setContext","_useSelectorContext","handleSelectorChange","onContextChange","_options$operation","operation","prevContext","setIsFocused","fn","useEditor","useSlateSelection","isSelectionEqual","doRectsIntersect","compareRect","middle","bottom","areRangesSameLine","range1","range2","rect1","rect2","findCurrentLineRange","parentRange","parentRangeBoundary","positions","right","floor","withReact","clipboardFormatKey","addMark","removeMark","parentBlockEntry","_parentBlockEntry","parentBlockPath","parentElementRange","currentLineRange","pathRefMatches","pendingAction","getMatches","prevPath","previous","commonPath","common","changedPath","changedNode","changedNodeKey","changedPathRef","pathRef","_matches","_matches$_i","_i2","_pathRefMatches","_pathRefMatches$_i","_Editor$node3","_Editor$node4","attach","trim","_endVoid","r","cloneRange","setEndAfter","zw","isNewline","appendChild","getFragment","JSON","encoded","btoa","encodeURIComponent","setAttribute","setData","div","body","decoded","decodeURIComponent","atob","parsed","parse","insertFragment","lines","splitNodes","always","maybeBatchUpdates","ReactDOM","unstable_batchedUpdates","levels","_step2$value"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,eAAe,CAAC,GAAG,EAAE;AAC9B,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC;AACrC,CAAC;AACD,MAAA,CAAA,OAAc,GAAG,eAAe,EAAE,MAAyB,CAAA,OAAA,CAAA,UAAA,GAAG,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,CAAA;;;;;;ACH9G,SAAS,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAAE;AACrC,EAAE,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,IAAI,GAAG,WAAW,IAAI,OAAO,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC;AACnG,EAAE,IAAI,IAAI,IAAI,CAAC,EAAE;AACjB,IAAI,IAAI,CAAC;AACT,MAAM,CAAC;AACP,MAAM,CAAC;AACP,MAAM,CAAC;AACP,MAAM,CAAC,GAAG,EAAE;AACZ,MAAM,CAAC,GAAG,CAAC,CAAC;AACZ,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACb,IAAI,IAAI;AACR,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE;AAC7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