add doc page for bubble menu
This commit is contained in:
@@ -3,13 +3,13 @@ import { EditorState, Plugin, PluginKey } from 'prosemirror-state'
|
||||
import { EditorView } from 'prosemirror-view'
|
||||
import { coordsAtPos } from './helpers'
|
||||
|
||||
export interface BubbleMenuPluginOptions {
|
||||
export interface BubbleMenuPluginProps {
|
||||
editor: Editor,
|
||||
element: HTMLElement,
|
||||
keepInBounds: boolean,
|
||||
}
|
||||
|
||||
export type BubbleMenuViewOptions = BubbleMenuPluginOptions & {
|
||||
export type BubbleMenuViewOptions = BubbleMenuPluginProps & {
|
||||
view: EditorView,
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ export class BubbleMenuView {
|
||||
|
||||
export const BubbleMenuPluginKey = new PluginKey('menuBubble')
|
||||
|
||||
export const BubbleMenuPlugin = (options: BubbleMenuPluginOptions) => {
|
||||
export const BubbleMenuPlugin = (options: BubbleMenuPluginProps) => {
|
||||
return new Plugin({
|
||||
key: BubbleMenuPluginKey,
|
||||
view: view => new BubbleMenuView({ view, ...options }),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Extension } from '@tiptap/core'
|
||||
import { BubbleMenuPlugin, BubbleMenuPluginOptions } from './bubble-menu-plugin'
|
||||
import { BubbleMenuPlugin, BubbleMenuPluginProps } from './bubble-menu-plugin'
|
||||
|
||||
export type BubbleMenuOptions = Omit<BubbleMenuPluginOptions, 'editor'>
|
||||
export type BubbleMenuOptions = Omit<BubbleMenuPluginProps, 'editor'>
|
||||
|
||||
export const BubbleMenu = Extension.create<BubbleMenuOptions>({
|
||||
name: 'bubbleMenu',
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { BubbleMenu } from './bubble-menu'
|
||||
|
||||
export * from './bubble-menu'
|
||||
export * from './bubble-menu-plugin'
|
||||
|
||||
export default BubbleMenu
|
||||
|
||||
Reference in New Issue
Block a user