@tiptap/vue-3 2.11.7 → 3.0.0-beta.1
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/LICENSE.md +21 -0
- package/README.md +5 -1
- package/dist/index.cjs +562 -528
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +219 -0
- package/dist/index.d.ts +218 -10
- package/dist/index.js +526 -516
- package/dist/index.js.map +1 -1
- package/dist/menus/index.cjs +613 -0
- package/dist/menus/index.cjs.map +1 -0
- package/dist/menus/index.d.cts +257 -0
- package/dist/menus/index.d.ts +257 -0
- package/dist/menus/index.js +605 -0
- package/dist/menus/index.js.map +1 -0
- package/package.json +27 -16
- package/src/Editor.ts +6 -11
- package/src/EditorContent.ts +10 -20
- package/src/VueMarkViewRenderer.ts +114 -0
- package/src/VueNodeViewRenderer.ts +19 -30
- package/src/VueRenderer.ts +10 -11
- package/src/index.ts +1 -2
- package/src/menus/BubbleMenu.ts +78 -0
- package/src/menus/FloatingMenu.ts +68 -0
- package/src/menus/index.ts +2 -0
- package/src/useEditor.ts +1 -1
- package/dist/BubbleMenu.d.ts +0 -61
- package/dist/BubbleMenu.d.ts.map +0 -1
- package/dist/Editor.d.ts +0 -24
- package/dist/Editor.d.ts.map +0 -1
- package/dist/EditorContent.d.ts +0 -18
- package/dist/EditorContent.d.ts.map +0 -1
- package/dist/FloatingMenu.d.ts +0 -49
- package/dist/FloatingMenu.d.ts.map +0 -1
- package/dist/NodeViewContent.d.ts +0 -14
- package/dist/NodeViewContent.d.ts.map +0 -1
- package/dist/NodeViewWrapper.d.ts +0 -14
- package/dist/NodeViewWrapper.d.ts.map +0 -1
- package/dist/VueNodeViewRenderer.d.ts +0 -63
- package/dist/VueNodeViewRenderer.d.ts.map +0 -1
- package/dist/VueRenderer.d.ts +0 -37
- package/dist/VueRenderer.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.umd.js +0 -570
- package/dist/index.umd.js.map +0 -1
- package/dist/useEditor.d.ts +0 -4
- package/dist/useEditor.d.ts.map +0 -1
- package/src/BubbleMenu.ts +0 -71
- package/src/FloatingMenu.ts +0 -66
package/src/BubbleMenu.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { BubbleMenuPlugin, BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu'
|
|
2
|
-
import {
|
|
3
|
-
defineComponent,
|
|
4
|
-
h,
|
|
5
|
-
onBeforeUnmount,
|
|
6
|
-
onMounted,
|
|
7
|
-
PropType,
|
|
8
|
-
ref,
|
|
9
|
-
} from 'vue'
|
|
10
|
-
|
|
11
|
-
export const BubbleMenu = defineComponent({
|
|
12
|
-
name: 'BubbleMenu',
|
|
13
|
-
|
|
14
|
-
props: {
|
|
15
|
-
pluginKey: {
|
|
16
|
-
type: [String, Object] as PropType<BubbleMenuPluginProps['pluginKey']>,
|
|
17
|
-
default: 'bubbleMenu',
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
editor: {
|
|
21
|
-
type: Object as PropType<BubbleMenuPluginProps['editor']>,
|
|
22
|
-
required: true,
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
updateDelay: {
|
|
26
|
-
type: Number as PropType<BubbleMenuPluginProps['updateDelay']>,
|
|
27
|
-
default: undefined,
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
tippyOptions: {
|
|
31
|
-
type: Object as PropType<BubbleMenuPluginProps['tippyOptions']>,
|
|
32
|
-
default: () => ({}),
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
shouldShow: {
|
|
36
|
-
type: Function as PropType<Exclude<Required<BubbleMenuPluginProps>['shouldShow'], null>>,
|
|
37
|
-
default: null,
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
setup(props, { slots }) {
|
|
42
|
-
const root = ref<HTMLElement | null>(null)
|
|
43
|
-
|
|
44
|
-
onMounted(() => {
|
|
45
|
-
const {
|
|
46
|
-
updateDelay,
|
|
47
|
-
editor,
|
|
48
|
-
pluginKey,
|
|
49
|
-
shouldShow,
|
|
50
|
-
tippyOptions,
|
|
51
|
-
} = props
|
|
52
|
-
|
|
53
|
-
editor.registerPlugin(BubbleMenuPlugin({
|
|
54
|
-
updateDelay,
|
|
55
|
-
editor,
|
|
56
|
-
element: root.value as HTMLElement,
|
|
57
|
-
pluginKey,
|
|
58
|
-
shouldShow,
|
|
59
|
-
tippyOptions,
|
|
60
|
-
}))
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
onBeforeUnmount(() => {
|
|
64
|
-
const { pluginKey, editor } = props
|
|
65
|
-
|
|
66
|
-
editor.unregisterPlugin(pluginKey)
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
return () => h('div', { ref: root }, slots.default?.())
|
|
70
|
-
},
|
|
71
|
-
})
|
package/src/FloatingMenu.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { FloatingMenuPlugin, FloatingMenuPluginProps } from '@tiptap/extension-floating-menu'
|
|
2
|
-
import {
|
|
3
|
-
defineComponent,
|
|
4
|
-
h,
|
|
5
|
-
onBeforeUnmount,
|
|
6
|
-
onMounted,
|
|
7
|
-
PropType,
|
|
8
|
-
ref,
|
|
9
|
-
} from 'vue'
|
|
10
|
-
|
|
11
|
-
export const FloatingMenu = defineComponent({
|
|
12
|
-
name: 'FloatingMenu',
|
|
13
|
-
|
|
14
|
-
props: {
|
|
15
|
-
pluginKey: {
|
|
16
|
-
// TODO: TypeScript breaks :(
|
|
17
|
-
// type: [String, Object as PropType<Exclude<FloatingMenuPluginProps['pluginKey'], string>>],
|
|
18
|
-
type: null,
|
|
19
|
-
default: 'floatingMenu',
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
editor: {
|
|
23
|
-
type: Object as PropType<FloatingMenuPluginProps['editor']>,
|
|
24
|
-
required: true,
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
tippyOptions: {
|
|
28
|
-
type: Object as PropType<FloatingMenuPluginProps['tippyOptions']>,
|
|
29
|
-
default: () => ({}),
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
shouldShow: {
|
|
33
|
-
type: Function as PropType<Exclude<Required<FloatingMenuPluginProps>['shouldShow'], null>>,
|
|
34
|
-
default: null,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
setup(props, { slots }) {
|
|
39
|
-
const root = ref<HTMLElement | null>(null)
|
|
40
|
-
|
|
41
|
-
onMounted(() => {
|
|
42
|
-
const {
|
|
43
|
-
pluginKey,
|
|
44
|
-
editor,
|
|
45
|
-
tippyOptions,
|
|
46
|
-
shouldShow,
|
|
47
|
-
} = props
|
|
48
|
-
|
|
49
|
-
editor.registerPlugin(FloatingMenuPlugin({
|
|
50
|
-
pluginKey,
|
|
51
|
-
editor,
|
|
52
|
-
element: root.value as HTMLElement,
|
|
53
|
-
tippyOptions,
|
|
54
|
-
shouldShow,
|
|
55
|
-
}))
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
onBeforeUnmount(() => {
|
|
59
|
-
const { pluginKey, editor } = props
|
|
60
|
-
|
|
61
|
-
editor.unregisterPlugin(pluginKey)
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
return () => h('div', { ref: root }, slots.default?.())
|
|
65
|
-
},
|
|
66
|
-
})
|