fix: rename key to pluginKey for menus
This commit is contained in:
@@ -9,7 +9,7 @@ import { EditorView } from 'prosemirror-view'
|
||||
import tippy, { Instance, Props } from 'tippy.js'
|
||||
|
||||
export interface BubbleMenuPluginProps {
|
||||
key: PluginKey | string,
|
||||
pluginKey: PluginKey | string,
|
||||
editor: Editor,
|
||||
element: HTMLElement,
|
||||
tippyOptions?: Partial<Props>,
|
||||
@@ -191,9 +191,9 @@ export class BubbleMenuView {
|
||||
|
||||
export const BubbleMenuPlugin = (options: BubbleMenuPluginProps) => {
|
||||
return new Plugin({
|
||||
key: typeof options.key === 'string'
|
||||
? new PluginKey(options.key)
|
||||
: options.key,
|
||||
key: typeof options.pluginKey === 'string'
|
||||
? new PluginKey(options.pluginKey)
|
||||
: options.pluginKey,
|
||||
view: view => new BubbleMenuView({ view, ...options }),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ export const BubbleMenu = Extension.create<BubbleMenuOptions>({
|
||||
defaultOptions: {
|
||||
element: null,
|
||||
tippyOptions: {},
|
||||
key: 'bubbleMenu',
|
||||
pluginKey: 'bubbleMenu',
|
||||
shouldShow: null,
|
||||
},
|
||||
|
||||
@@ -22,7 +22,7 @@ export const BubbleMenu = Extension.create<BubbleMenuOptions>({
|
||||
|
||||
return [
|
||||
BubbleMenuPlugin({
|
||||
key: this.options.key,
|
||||
pluginKey: this.options.pluginKey,
|
||||
editor: this.editor,
|
||||
element: this.options.element,
|
||||
tippyOptions: this.options.tippyOptions,
|
||||
|
||||
Reference in New Issue
Block a user