feat: repair paste cursor

This commit is contained in:
SaikaSakura
2022-08-11 22:06:50 +08:00
parent 0a265f9981
commit 322fb098a4
5 changed files with 109 additions and 26 deletions

View File

@@ -905,6 +905,19 @@ class SlateUtils {
);
}
public insertNodes(
nodes: SlateNode | Array<SlateNode>,
options?: Parameters<typeof Transforms.insertNodes>[2]
) {
Transforms.insertNodes(this.editor, nodes, {
...options,
});
}
public getNodeByPath(path: Path) {
Editor.node(this.editor, path);
}
public getStartSelection() {
return {
anchor: this.getStart(),