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

Function storePosition

packages/plugins/yjs/src/plugin/with-yjs.ts:104–113  ·  view source on GitHub ↗
(editor: YjsEditor, key: string, point: Point)

Source from the content-addressed store, hash-verified

102 },
103
104 storePosition(editor: YjsEditor, key: string, point: Point): void {
105 const { sharedRoot, positionStorageOrigin: locationStorageOrigin } = editor
106 assertDocumentAttachment(sharedRoot)
107
108 const position = editorPointToRelativePosition(sharedRoot, editor, point)
109
110 sharedRoot.doc.transact(() => {
111 setStoredPosition(sharedRoot, key, position)
112 }, locationStorageOrigin)
113 },
114
115 removeStoredPosition(editor: YjsEditor, key: string): void {
116 const { sharedRoot, positionStorageOrigin: locationStorageOrigin } = editor

Callers

nothing calls this directly

Calls 3

assertDocumentAttachmentFunction · 0.90
setStoredPositionFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…