mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-03 13:53:42 +00:00
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:
parent
f168016549
commit
67a563d6c7
@ -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) {
|
export function takeSnapshot (snapshotId: string) {
|
||||||
copyDocumentContent(documentId, snapshotId, { provider }, initialContentId)
|
copyDocumentContent(documentId, snapshotId, { provider }, initialContentId)
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ export { default } from './plugin'
|
|||||||
export * from './types'
|
export * from './types'
|
||||||
export * from './utils'
|
export * from './utils'
|
||||||
|
|
||||||
|
export { FocusExtension, type FocusOptions, type FocusStorage } from './components/extension/focus'
|
||||||
export { HeadingsExtension, type HeadingsOptions, type HeadingsStorage } from './components/extension/headings'
|
export { HeadingsExtension, type HeadingsOptions, type HeadingsStorage } from './components/extension/headings'
|
||||||
export {
|
export {
|
||||||
IsEmptyContentExtension,
|
IsEmptyContentExtension,
|
||||||
|
Loading…
Reference in New Issue
Block a user