Merge branch 'main' of github.com:ueberdosis/tiptap-next into main

This commit is contained in:
Hans Pagel 2021-01-13 11:08:42 +01:00
commit d8a93151ff
2 changed files with 9 additions and 4 deletions

View File

@ -97,7 +97,7 @@ export type NodeViewRendererProps = {
extension: Node,
}
export type NodeViewRenderer = (props: NodeViewRendererProps) => NodeView
export type NodeViewRenderer = (props: NodeViewRendererProps) => (NodeView | {})
export type UnfilteredCommands = {
[Item in keyof AllExtensions]: AllExtensions[Item] extends Extension<any, infer ExtensionCommands>

View File

@ -1,4 +1,9 @@
import { Editor, Node, NodeViewRendererProps } from '@tiptap/core'
import {
Editor,
Node,
NodeViewRenderer,
NodeViewRendererProps,
} from '@tiptap/core'
import { Decoration, NodeView } from 'prosemirror-view'
import { NodeSelection } from 'prosemirror-state'
import { Node as ProseMirrorNode } from 'prosemirror-model'
@ -309,7 +314,7 @@ class VueNodeView implements NodeView {
}
export default function VueRenderer(component: Vue | VueConstructor, options?: Partial<VueRendererOptions>) {
export default function VueRenderer(component: Vue | VueConstructor, options?: Partial<VueRendererOptions>): NodeViewRenderer {
return (props: NodeViewRendererProps) => {
// try to get the parent component
// this is important for vue devtools to show the component hierarchy correctly
@ -319,7 +324,7 @@ export default function VueRenderer(component: Vue | VueConstructor, options?: P
: undefined
if (!parent) {
return undefined
return {}
}
return new VueNodeView(component, props, options) as NodeView