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, }, addProseMirrorPlugins() { if (!this.options.element) { return [] } return [ BubbleMenuPlugin({ editor: this.editor, element: this.options.element, }), ] }, })