({ children, ...attributes }: T)
| 32 | } |
| 33 | |
| 34 | export function editorElementToYText<T extends Element>({ children, ...attributes }: T): Y.XmlText { |
| 35 | const yElement = new Y.XmlText() |
| 36 | |
| 37 | Object.entries(attributes).forEach(([key, value]) => { |
| 38 | yElement.setAttribute(key, value) |
| 39 | }) |
| 40 | |
| 41 | yElement.applyDelta(editorNodesToInsertDelta(children), { sanitize: false }) |
| 42 | return yElement |
| 43 | } |
| 44 | |
| 45 | export * from './editable' |
| 46 |
no test coverage detected