rename VueRenderer to VueNodeViewRenderer

This commit is contained in:
Philipp Kühn 2021-01-18 12:40:05 +01:00 committed by Hans Pagel
parent 58b7aa7baa
commit 34f6a0d9ce
2 changed files with 5 additions and 5 deletions

View File

@ -16,7 +16,7 @@ function getComponentFromElement(element: HTMLElement): Vue {
return element.__vue__ return element.__vue__
} }
interface VueRendererOptions { interface VueNodeViewRendererOptions {
stopEvent: ((event: Event) => boolean) | null, stopEvent: ((event: Event) => boolean) | null,
update: ((node: ProseMirrorNode, decorations: Decoration[]) => boolean) | null, update: ((node: ProseMirrorNode, decorations: Decoration[]) => boolean) | null,
} }
@ -39,12 +39,12 @@ class VueNodeView implements NodeView {
isDragging = false isDragging = false
options: VueRendererOptions = { options: VueNodeViewRendererOptions = {
stopEvent: null, stopEvent: null,
update: null, update: null,
} }
constructor(component: Vue | VueConstructor, props: NodeViewRendererProps, options?: Partial<VueRendererOptions>) { constructor(component: Vue | VueConstructor, props: NodeViewRendererProps, options?: Partial<VueNodeViewRendererOptions>) {
this.options = { ...this.options, ...options } this.options = { ...this.options, ...options }
this.editor = props.editor this.editor = props.editor
this.extension = props.extension this.extension = props.extension
@ -314,7 +314,7 @@ class VueNodeView implements NodeView {
} }
export default function VueRenderer(component: Vue | VueConstructor, options?: Partial<VueRendererOptions>): NodeViewRenderer { export default function VueNodeViewRenderer(component: Vue | VueConstructor, options?: Partial<VueNodeViewRendererOptions>): NodeViewRenderer {
return (props: NodeViewRendererProps) => { return (props: NodeViewRendererProps) => {
// try to get the parent component // try to get the parent component
// this is important for vue devtools to show the component hierarchy correctly // this is important for vue devtools to show the component hierarchy correctly

View File

@ -1,3 +1,3 @@
export * from '@tiptap/core' export * from '@tiptap/core'
export { default as VueRenderer } from './VueRenderer' export { default as VueNodeViewRenderer } from './VueNodeViewRenderer'
export { default as EditorContent } from './components/EditorContent' export { default as EditorContent } from './components/EditorContent'