add tippy

This commit is contained in:
Philipp Kühn
2021-01-18 12:40:13 +01:00
parent 06b88977fc
commit f96dff1f0f
5 changed files with 87 additions and 22 deletions

View File

@@ -1,15 +1,14 @@
import { Node } from '@tiptap/core'
import Suggestion from '@tiptap/suggestion'
import Suggestion, { SuggestionOptions } from '@tiptap/suggestion'
export interface MentionOptions {
renderer: any,
}
export type MentionOptions = Omit<SuggestionOptions, 'editor'>
export const Mention = Node.create({
name: 'mention',
defaultOptions: <MentionOptions>{
renderer: null,
char: '@',
renderer: () => ({}),
},
group: 'inline',
@@ -47,8 +46,7 @@ export const Mention = Node.create({
return [
Suggestion({
editor: this.editor,
char: '@',
renderer: this.options.renderer,
...this.options,
}),
]
},