( sharedRoot: Y.XmlText, editorRoot: Node, pos: Y.RelativePosition, )
| 54 | } |
| 55 | |
| 56 | export function relativePositionToEditorPoint( |
| 57 | sharedRoot: Y.XmlText, |
| 58 | editorRoot: Node, |
| 59 | pos: Y.RelativePosition, |
| 60 | ): BasePoint | null { |
| 61 | if (!sharedRoot.doc) { |
| 62 | throw new Error("sharedRoot isn't attach to a yDoc") |
| 63 | } |
| 64 | |
| 65 | const absPos = Y.createAbsolutePositionFromRelativePosition(pos, sharedRoot.doc) |
| 66 | |
| 67 | return absPos && absolutePositionToEditorPoint(sharedRoot, editorRoot, absPos) |
| 68 | } |
| 69 | |
| 70 | export function getStoredPosition(sharedRoot: Y.XmlText, key: string): Y.RelativePosition | null { |
| 71 | const rawPosition = sharedRoot.getAttribute(STORED_POSITION_PREFIX + key) |
no test coverage detected
searching dependent graphs…