MCPcopy Create free account
hub / github.com/editablejs/editable / insertNode

Function insertNode

packages/plugins/yjs/src/apply-to-yjs/node/insert-node.ts:5–13  ·  view source on GitHub ↗
(sharedRoot: Y.XmlText, editorRoot: Node, op: InsertNodeOperation)

Source from the content-addressed store, hash-verified

3import * as Y from 'yjs'
4
5export 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}

Callers

nothing calls this directly

Calls 3

getYTargetFunction · 0.90
getPropertiesFunction · 0.90
editorElementToYTextFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…