Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
children: any[]
): Editor {
const otherChildren: any[] = []
let selectionChild: Range | undefined
for (const child of children) {
if (Range.isRange(child)) {
selectionChild = child
} else {
otherChildren.push(child)
}
}
const descendants = resolveDescendants(otherChildren)
const selection: Partial = {}
const editor = makeEditor()
Object.assign(editor, attributes)
editor.children = descendants
// Search the document's texts to see if any of them have tokens associated
// that need incorporated into the selection.
for (const [node, path] of Node.texts(editor)) {
const anchor = getAnchorOffset(node)
const focus = getFocusOffset(node)
if (anchor != null) {
const [offset] = anchor
selection.anchor = { path, offset }
}
if (focus != null) {
const [offset] = focus
() => withLayout(withHistory(withReact(createEditor()))),
[]
() => withTables(withHistory(withReact(createEditor()))),
[]
const editor = useMemo(() => withHistory(withReact(createEditor())), [])
const editor = useMemo(() => withHistory(withReact(createEditor())), [])
const decorate = useCallback(([node, path]) => {
const editor = useMemo(() => withHistory(withReact(createEditor())), [])
() => withHtml(withReact(withHistory(createEditor()))),
[]
() => withImages(withHistory(withReact(createEditor()))),
[]
() => withShortcuts(withReact(withHistory(createEditor()))),
[]
const editor = useMemo(() => withReact(createEditor()), [])
return (