fix nodeview type, fix #92
This commit is contained in:
@@ -97,7 +97,7 @@ export type NodeViewRendererProps = {
|
|||||||
extension: Node,
|
extension: Node,
|
||||||
}
|
}
|
||||||
|
|
||||||
export type NodeViewRenderer = (props: NodeViewRendererProps) => NodeView
|
export type NodeViewRenderer = (props: NodeViewRendererProps) => (NodeView | undefined)
|
||||||
|
|
||||||
export type UnfilteredCommands = {
|
export type UnfilteredCommands = {
|
||||||
[Item in keyof AllExtensions]: AllExtensions[Item] extends Extension<any, infer ExtensionCommands>
|
[Item in keyof AllExtensions]: AllExtensions[Item] extends Extension<any, infer ExtensionCommands>
|
||||||
|
|||||||
@@ -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 { Decoration, NodeView } from 'prosemirror-view'
|
||||||
import { NodeSelection } from 'prosemirror-state'
|
import { NodeSelection } from 'prosemirror-state'
|
||||||
import { Node as ProseMirrorNode } from 'prosemirror-model'
|
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) => {
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user