mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-27 11:06:50 +03:00
EZQMS-327: move inline comments to platform popups (#3909)
Signed-off-by: Anna No <anna.no@xored.com>
This commit is contained in:
parent
2d3a751922
commit
e80af41f37
@ -48,7 +48,7 @@
|
|||||||
import { InlinePopupExtension } from './extension/inlinePopup'
|
import { InlinePopupExtension } from './extension/inlinePopup'
|
||||||
import { InlineStyleToolbarExtension } from './extension/inlineStyleToolbar'
|
import { InlineStyleToolbarExtension } from './extension/inlineStyleToolbar'
|
||||||
import { FileAttachFunction, ImageExtension } from './extension/imageExt'
|
import { FileAttachFunction, ImageExtension } from './extension/imageExt'
|
||||||
import { NodeUuidExtension } from './extension/nodeUuid'
|
import { NodeUuidExtension, nodeElementQuerySelector } from './extension/nodeUuid'
|
||||||
import ImageStyleToolbar from './ImageStyleToolbar.svelte'
|
import ImageStyleToolbar from './ImageStyleToolbar.svelte'
|
||||||
import StyleButton from './StyleButton.svelte'
|
import StyleButton from './StyleButton.svelte'
|
||||||
import TextEditorStyleToolbar from './TextEditorStyleToolbar.svelte'
|
import TextEditorStyleToolbar from './TextEditorStyleToolbar.svelte'
|
||||||
@ -123,6 +123,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getNodeElement (uuid: string): Element | null {
|
||||||
|
if (!editor || !uuid) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
return editor.view.dom.querySelector(nodeElementQuerySelector(uuid))
|
||||||
|
}
|
||||||
|
|
||||||
export function selectNode (uuid: string) {
|
export function selectNode (uuid: string) {
|
||||||
if (!editor) {
|
if (!editor) {
|
||||||
return
|
return
|
||||||
|
@ -4,6 +4,8 @@ import { EditorState, Plugin, PluginKey } from 'prosemirror-state'
|
|||||||
|
|
||||||
const NAME = 'node-uuid'
|
const NAME = 'node-uuid'
|
||||||
|
|
||||||
|
export const nodeElementQuerySelector = (nodeUuid: string): string => `span[${NAME}='${nodeUuid}']`
|
||||||
|
|
||||||
export interface NodeUuidOptions {
|
export interface NodeUuidOptions {
|
||||||
HTMLAttributes: Record<string, any>
|
HTMLAttributes: Record<string, any>
|
||||||
onNodeSelected?: (uuid: string | null) => void
|
onNodeSelected?: (uuid: string | null) => void
|
||||||
|
Loading…
Reference in New Issue
Block a user