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

Function editorPathOffsetToYOffset

packages/yjs-transform/src/location.ts:14–18  ·  view source on GitHub ↗
(element: Element, pathOffset: number)

Source from the content-addressed store, hash-verified

12}
13
14export function editorPathOffsetToYOffset(element: Element, pathOffset: number) {
15 return element.children
16 .slice(0, pathOffset)
17 .reduce((yOffset, node) => yOffset + getEditorNodeYLength(node), 0)
18}
19
20export function getYTarget(yRoot: Y.XmlText, editorRoot: Node, path: Path): YTarget {
21 if (path.length === 0) {

Callers 1

getYTargetFunction · 0.85

Calls 1

getEditorNodeYLengthFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…