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

Function getEditorNodeYLength

packages/yjs-transform/src/location.ts:6–12  ·  view source on GitHub ↗
(node: Node | undefined)

Source from the content-addressed store, hash-verified

4import { YTarget } from './types'
5
6export function getEditorNodeYLength(node: Node | undefined): number {
7 if (!node) {
8 return 0
9 }
10
11 return Text.isText(node) ? node.text.length : 1
12}
13
14export function editorPathOffsetToYOffset(element: Element, pathOffset: number) {
15 return element.children

Callers 4

applyDeltaFunction · 0.90
splitNodeFunction · 0.90
getYTargetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…