@tiptap/vue-2 3.10.6 → 3.10.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/menus/index.cjs +23 -30
- package/dist/menus/index.cjs.map +1 -1
- package/dist/menus/index.d.cts +7 -2
- package/dist/menus/index.d.ts +7 -2
- package/dist/menus/index.js +23 -30
- package/dist/menus/index.js.map +1 -1
- package/package.json +7 -7
- package/src/menus/BubbleMenu.ts +34 -37
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/vue-2",
|
|
3
3
|
"description": "Vue components for tiptap",
|
|
4
|
-
"version": "3.10.
|
|
4
|
+
"version": "3.10.7",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -43,17 +43,17 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"vue": "^2.7.16",
|
|
46
|
-
"@tiptap/core": "^3.10.
|
|
47
|
-
"@tiptap/pm": "^3.10.
|
|
46
|
+
"@tiptap/core": "^3.10.7",
|
|
47
|
+
"@tiptap/pm": "^3.10.7"
|
|
48
48
|
},
|
|
49
49
|
"optionalDependencies": {
|
|
50
|
-
"@tiptap/extension-bubble-menu": "^3.10.
|
|
51
|
-
"@tiptap/extension-floating-menu": "^3.10.
|
|
50
|
+
"@tiptap/extension-bubble-menu": "^3.10.7",
|
|
51
|
+
"@tiptap/extension-floating-menu": "^3.10.7"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"vue": "^2.6.0",
|
|
55
|
-
"@tiptap/core": "^3.10.
|
|
56
|
-
"@tiptap/pm": "^3.10.
|
|
55
|
+
"@tiptap/core": "^3.10.7",
|
|
56
|
+
"@tiptap/pm": "^3.10.7"
|
|
57
57
|
},
|
|
58
58
|
"repository": {
|
|
59
59
|
"type": "git",
|
package/src/menus/BubbleMenu.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu'
|
|
2
2
|
import { BubbleMenuPlugin } from '@tiptap/extension-bubble-menu'
|
|
3
|
-
import type { Component, CreateElement, PropType } from 'vue'
|
|
4
|
-
import type Vue from 'vue'
|
|
3
|
+
import type { Component, CreateElement, PropType, VNode } from 'vue'
|
|
5
4
|
|
|
6
|
-
export interface BubbleMenuInterface
|
|
5
|
+
export interface BubbleMenuInterface {
|
|
6
|
+
$el: HTMLElement
|
|
7
|
+
$nextTick: (callback: () => void) => void
|
|
8
|
+
$slots: { default?: VNode[] }
|
|
7
9
|
pluginKey: BubbleMenuPluginProps['pluginKey']
|
|
8
10
|
editor: BubbleMenuPluginProps['editor']
|
|
9
11
|
updateDelay: BubbleMenuPluginProps['updateDelay']
|
|
@@ -52,40 +54,35 @@ export const BubbleMenu: Component = {
|
|
|
52
54
|
},
|
|
53
55
|
},
|
|
54
56
|
|
|
55
|
-
|
|
56
|
-
editor
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}),
|
|
85
|
-
)
|
|
86
|
-
})
|
|
87
|
-
},
|
|
88
|
-
},
|
|
57
|
+
mounted(this: BubbleMenuInterface) {
|
|
58
|
+
const editor = this.editor
|
|
59
|
+
const el = this.$el as HTMLElement
|
|
60
|
+
|
|
61
|
+
if (!editor || !el) {
|
|
62
|
+
return
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
el.style.visibility = 'hidden'
|
|
66
|
+
el.style.position = 'absolute'
|
|
67
|
+
|
|
68
|
+
// Remove element from DOM; plugin will re-parent it when shown
|
|
69
|
+
el.remove()
|
|
70
|
+
|
|
71
|
+
this.$nextTick(() => {
|
|
72
|
+
editor.registerPlugin(
|
|
73
|
+
BubbleMenuPlugin({
|
|
74
|
+
updateDelay: this.updateDelay,
|
|
75
|
+
resizeDelay: this.resizeDelay,
|
|
76
|
+
options: this.options,
|
|
77
|
+
editor,
|
|
78
|
+
element: el,
|
|
79
|
+
pluginKey: this.pluginKey,
|
|
80
|
+
appendTo: this.appendTo,
|
|
81
|
+
shouldShow: this.shouldShow,
|
|
82
|
+
getReferencedVirtualElement: this.getReferencedVirtualElement,
|
|
83
|
+
}),
|
|
84
|
+
)
|
|
85
|
+
})
|
|
89
86
|
},
|
|
90
87
|
|
|
91
88
|
render(this: BubbleMenuInterface, createElement: CreateElement) {
|