import { Extension } from '@tiptap/core' import { FloatingMenuPlugin, FloatingMenuPluginProps } from './floating-menu-plugin' export type FloatingMenuOptions = Omit & { element: HTMLElement | null, } export const FloatingMenu = Extension.create({ name: 'bubbleMenu', defaultOptions: { element: null, }, addProseMirrorPlugins() { if (!this.options.element) { return [] } return [ FloatingMenuPlugin({ editor: this.editor, element: this.options.element, }), ] }, })