EZQMS-360: Platform changes for document comments highlight sync (#3965)

* EZQMS-360: Platform changes for document comments highlight sync

Signed-off-by: Anna No <anna.no@xored.com>

* EZQMS-360: Platform changes for document comments highlight sync

Signed-off-by: Anna No <anna.no@xored.com>

---------

Signed-off-by: Anna No <anna.no@xored.com>
This commit is contained in:
Anna No 2023-11-09 21:53:19 +07:00 committed by GitHub
parent f168016549
commit 67a563d6c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View File

@ -161,6 +161,25 @@
})
}
export function selectRange (from: number, to: number) {
if (!editor) {
return
}
const { doc, tr } = editor.view.state
const [$start, $end] = [doc.resolve(from), doc.resolve(to)]
editor.view.dispatch(tr.setSelection(new TextSelection($start, $end)))
needFocus = true
}
export function setNodeUuid (nodeId: string): boolean {
if (!editor || editor.view.state.selection.empty || !nodeId) {
return false
}
return editor.chain().setNodeUuid(nodeId).run()
}
export function takeSnapshot (snapshotId: string) {
copyDocumentContent(documentId, snapshotId, { provider }, initialContentId)
}

View File

@ -35,6 +35,7 @@ export { default } from './plugin'
export * from './types'
export * from './utils'
export { FocusExtension, type FocusOptions, type FocusStorage } from './components/extension/focus'
export { HeadingsExtension, type HeadingsOptions, type HeadingsStorage } from './components/extension/headings'
export {
IsEmptyContentExtension,