Skip to content

Commit

Permalink
feat: remove keepInBounds
Browse files Browse the repository at this point in the history
  • Loading branch information
philippkuehn committed Apr 16, 2021
1 parent 9335858 commit d7282f1
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 18 deletions.
1 change: 0 additions & 1 deletion packages/extension-bubble-menu/src/bubble-menu-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import tippy from 'tippy.js'
export interface BubbleMenuPluginProps {
editor: Editor,
element: HTMLElement,
keepInBounds: boolean,
}

export type BubbleMenuViewProps = BubbleMenuPluginProps & {
Expand Down
2 changes: 0 additions & 2 deletions packages/extension-bubble-menu/src/bubble-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export const BubbleMenu = Extension.create<BubbleMenuOptions>({

defaultOptions: {
element: null,
keepInBounds: true,
},

addProseMirrorPlugins() {
Expand All @@ -22,7 +21,6 @@ export const BubbleMenu = Extension.create<BubbleMenuOptions>({
BubbleMenuPlugin({
editor: this.editor,
element: this.options.element,
keepInBounds: this.options.keepInBounds,
}),
]
},
Expand Down
3 changes: 1 addition & 2 deletions packages/react/src/BubbleMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ export const BubbleMenu: React.FC<BubbleMenuProps> = props => {
const element = useRef<HTMLDivElement>(null)

useEffect(() => {
const { editor, keepInBounds = true } = props
const { editor } = props

editor.registerPlugin(BubbleMenuPlugin({
editor,
element: element.current as HTMLElement,
keepInBounds,
}))

return () => {
Expand Down
6 changes: 0 additions & 6 deletions packages/vue-2/src/BubbleMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ export const BubbleMenu = Vue.extend({
type: Object as PropType<BubbleMenuPluginProps['editor']>,
required: true,
},

keepInBounds: {
type: Boolean as PropType<BubbleMenuPluginProps['keepInBounds']>,
default: true,
},
},

watch: {
Expand All @@ -28,7 +23,6 @@ export const BubbleMenu = Vue.extend({
editor.registerPlugin(BubbleMenuPlugin({
editor,
element: this.$el as HTMLElement,
keepInBounds: this.keepInBounds,
}))
})
},
Expand Down
8 changes: 1 addition & 7 deletions packages/vue-3/src/BubbleMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,15 @@ export const BubbleMenu = defineComponent({
type: Object as PropType<BubbleMenuPluginProps['editor']>,
required: true,
},

keepInBounds: {
type: Boolean as PropType<BubbleMenuPluginProps['keepInBounds']>,
default: true,
},
},

setup({ editor, keepInBounds }, { slots }) {
setup({ editor }, { slots }) {
const root = ref<HTMLElement | null>(null)

onMounted(() => {
editor.registerPlugin(BubbleMenuPlugin({
editor,
element: root.value as HTMLElement,
keepInBounds,
}))
})

Expand Down

0 comments on commit d7282f1

Please sign in to comment.