From d7282f168bc6cfae4e1630d14bb8462bc135b254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Fri, 16 Apr 2021 10:46:50 +0200 Subject: [PATCH] feat: remove keepInBounds --- packages/extension-bubble-menu/src/bubble-menu-plugin.ts | 1 - packages/extension-bubble-menu/src/bubble-menu.ts | 2 -- packages/react/src/BubbleMenu.tsx | 3 +-- packages/vue-2/src/BubbleMenu.ts | 6 ------ packages/vue-3/src/BubbleMenu.ts | 8 +------- 5 files changed, 2 insertions(+), 18 deletions(-) diff --git a/packages/extension-bubble-menu/src/bubble-menu-plugin.ts b/packages/extension-bubble-menu/src/bubble-menu-plugin.ts index 9322af5f5..b948970fd 100644 --- a/packages/extension-bubble-menu/src/bubble-menu-plugin.ts +++ b/packages/extension-bubble-menu/src/bubble-menu-plugin.ts @@ -6,7 +6,6 @@ import tippy from 'tippy.js' export interface BubbleMenuPluginProps { editor: Editor, element: HTMLElement, - keepInBounds: boolean, } export type BubbleMenuViewProps = BubbleMenuPluginProps & { diff --git a/packages/extension-bubble-menu/src/bubble-menu.ts b/packages/extension-bubble-menu/src/bubble-menu.ts index 3c96bbe02..af473a27b 100644 --- a/packages/extension-bubble-menu/src/bubble-menu.ts +++ b/packages/extension-bubble-menu/src/bubble-menu.ts @@ -10,7 +10,6 @@ export const BubbleMenu = Extension.create({ defaultOptions: { element: null, - keepInBounds: true, }, addProseMirrorPlugins() { @@ -22,7 +21,6 @@ export const BubbleMenu = Extension.create({ BubbleMenuPlugin({ editor: this.editor, element: this.options.element, - keepInBounds: this.options.keepInBounds, }), ] }, diff --git a/packages/react/src/BubbleMenu.tsx b/packages/react/src/BubbleMenu.tsx index 45af5182a..518d23c54 100644 --- a/packages/react/src/BubbleMenu.tsx +++ b/packages/react/src/BubbleMenu.tsx @@ -9,12 +9,11 @@ export const BubbleMenu: React.FC = props => { const element = useRef(null) useEffect(() => { - const { editor, keepInBounds = true } = props + const { editor } = props editor.registerPlugin(BubbleMenuPlugin({ editor, element: element.current as HTMLElement, - keepInBounds, })) return () => { diff --git a/packages/vue-2/src/BubbleMenu.ts b/packages/vue-2/src/BubbleMenu.ts index 2cd3a7d38..f4e412321 100644 --- a/packages/vue-2/src/BubbleMenu.ts +++ b/packages/vue-2/src/BubbleMenu.ts @@ -9,11 +9,6 @@ export const BubbleMenu = Vue.extend({ type: Object as PropType, required: true, }, - - keepInBounds: { - type: Boolean as PropType, - default: true, - }, }, watch: { @@ -28,7 +23,6 @@ export const BubbleMenu = Vue.extend({ editor.registerPlugin(BubbleMenuPlugin({ editor, element: this.$el as HTMLElement, - keepInBounds: this.keepInBounds, })) }) }, diff --git a/packages/vue-3/src/BubbleMenu.ts b/packages/vue-3/src/BubbleMenu.ts index bfea8dc36..43d5877e3 100644 --- a/packages/vue-3/src/BubbleMenu.ts +++ b/packages/vue-3/src/BubbleMenu.ts @@ -20,21 +20,15 @@ export const BubbleMenu = defineComponent({ type: Object as PropType, required: true, }, - - keepInBounds: { - type: Boolean as PropType, - default: true, - }, }, - setup({ editor, keepInBounds }, { slots }) { + setup({ editor }, { slots }) { const root = ref(null) onMounted(() => { editor.registerPlugin(BubbleMenuPlugin({ editor, element: root.value as HTMLElement, - keepInBounds, })) })