add doc page for bubble menu

This commit is contained in:
Philipp Kühn
2021-03-30 14:07:18 +02:00
parent 35ca89311f
commit daa8e72477
10 changed files with 122 additions and 47 deletions

View File

@@ -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 }),