(sharedRoot: Y.XmlText, editorRoot: Node, op: InsertNodeOperation)
| 3 | import * as Y from 'yjs' |
| 4 | |
| 5 | export function insertNode(sharedRoot: Y.XmlText, editorRoot: Node, op: InsertNodeOperation): void { |
| 6 | const { yParent, textRange } = getYTarget(sharedRoot, editorRoot, op.path) |
| 7 | |
| 8 | if (Text.isText(op.node)) { |
| 9 | return yParent.insert(textRange.start, op.node.text, getProperties(op.node)) |
| 10 | } |
| 11 | |
| 12 | yParent.insertEmbed(textRange.start, editorElementToYText(op.node)) |
| 13 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…