import { Extension } from '@tiptap/core' import { BubbleMenuPlugin, BubbleMenuPluginProps } from './bubble-menu-plugin' export type BubbleMenuOptions = Omit & { element: HTMLElement | null, } export const BubbleMenu = Extension.create({ name: 'bubbleMenu', defaultOptions: { element: null, tippyOptions: {}, }, addProseMirrorPlugins() { if (!this.options.element) { return [] } return [ BubbleMenuPlugin({ editor: this.editor, element: this.options.element, tippyOptions: this.options.tippyOptions, }), ] }, })