antdv-next-tiptap 1.0.0
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 +21 -0
- package/README.md +282 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.css +2 -0
- package/dist/index.mjs +9132 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/src/commands/colorButton.vue.d.ts +15 -0
- package/dist/types/src/commands/fontFamilySelect.vue.d.ts +7 -0
- package/dist/types/src/commands/fontSizeSelect.vue.d.ts +7 -0
- package/dist/types/src/commands/fullscreenButton.vue.d.ts +7 -0
- package/dist/types/src/commands/headingSelect.vue.d.ts +7 -0
- package/dist/types/src/commands/imageButton.vue.d.ts +7 -0
- package/dist/types/src/commands/imageModal.vue.d.ts +23 -0
- package/dist/types/src/commands/imageView.vue.d.ts +93 -0
- package/dist/types/src/commands/linkButton.vue.d.ts +7 -0
- package/dist/types/src/commands/listSelect.vue.d.ts +7 -0
- package/dist/types/src/commands/tableButton.vue.d.ts +7 -0
- package/dist/types/src/commands/tableToolbar.vue.d.ts +7 -0
- package/dist/types/src/commands/taskItemView.vue.d.ts +4 -0
- package/dist/types/src/commands/textBubbleMenu.vue.d.ts +7 -0
- package/dist/types/src/commands/videoButton.vue.d.ts +7 -0
- package/dist/types/src/commands/videoModal.vue.d.ts +21 -0
- package/dist/types/src/commands/videoView.vue.d.ts +93 -0
- package/dist/types/src/extensions/base.d.ts +2 -0
- package/dist/types/src/extensions/blockquote.d.ts +6 -0
- package/dist/types/src/extensions/bold.d.ts +2 -0
- package/dist/types/src/extensions/bulletList.d.ts +2 -0
- package/dist/types/src/extensions/clearFormat.d.ts +7 -0
- package/dist/types/src/extensions/code.d.ts +6 -0
- package/dist/types/src/extensions/codeBlock.d.ts +6 -0
- package/dist/types/src/extensions/color.d.ts +2 -0
- package/dist/types/src/extensions/fontFamily.d.ts +6 -0
- package/dist/types/src/extensions/fontSize.d.ts +6 -0
- package/dist/types/src/extensions/fullscreen.d.ts +2 -0
- package/dist/types/src/extensions/heading.d.ts +2 -0
- package/dist/types/src/extensions/highlight.d.ts +7 -0
- package/dist/types/src/extensions/horizontalRule.d.ts +6 -0
- package/dist/types/src/extensions/image.d.ts +2 -0
- package/dist/types/src/extensions/index.d.ts +3 -0
- package/dist/types/src/extensions/italic.d.ts +2 -0
- package/dist/types/src/extensions/link.d.ts +6 -0
- package/dist/types/src/extensions/orderedList.d.ts +2 -0
- package/dist/types/src/extensions/print.d.ts +2 -0
- package/dist/types/src/extensions/strike.d.ts +6 -0
- package/dist/types/src/extensions/table.d.ts +2 -0
- package/dist/types/src/extensions/taskList.d.ts +2 -0
- package/dist/types/src/extensions/textAlign.d.ts +2 -0
- package/dist/types/src/extensions/textStyle.d.ts +7 -0
- package/dist/types/src/extensions/types.d.ts +31 -0
- package/dist/types/src/extensions/underline.d.ts +6 -0
- package/dist/types/src/extensions/undoRedo.d.ts +6 -0
- package/dist/types/src/extensions/video.d.ts +2 -0
- package/dist/types/src/extensions/videoNode.d.ts +27 -0
- package/dist/types/src/injectionKeys.d.ts +5 -0
- package/dist/types/src/tiptap.vue.d.ts +30 -0
- package/dist/types/src/tiptapProps.d.ts +39 -0
- package/dist/types/src/toolbarItem.vue.d.ts +9 -0
- package/package.json +112 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor?: Editor;
|
|
4
|
+
/** 图标 */
|
|
5
|
+
icon: string;
|
|
6
|
+
/** 标题 */
|
|
7
|
+
title: string;
|
|
8
|
+
/** 应用颜色的回调 */
|
|
9
|
+
apply: (color: string) => void;
|
|
10
|
+
/** 获取当前颜色 */
|
|
11
|
+
getColor?: () => string;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor?: Editor;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor?: Editor;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor: Editor;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor: Editor;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor?: Editor;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface ImageFormData {
|
|
2
|
+
src: string;
|
|
3
|
+
alt: string;
|
|
4
|
+
width: number | null;
|
|
5
|
+
height: number | null;
|
|
6
|
+
}
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
title: string;
|
|
9
|
+
initialValues?: Partial<ImageFormData>;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_ModelProps = {
|
|
12
|
+
'open': boolean;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
15
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
16
|
+
"update:open": (value: boolean) => any;
|
|
17
|
+
confirm: (data: ImageFormData) => any;
|
|
18
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
19
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
20
|
+
onConfirm?: ((data: ImageFormData) => any) | undefined;
|
|
21
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
declare const __VLS_export: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
|
|
2
|
+
editor: {
|
|
3
|
+
type: PropType<import('@tiptap/core').NodeViewProps["editor"]>;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
node: {
|
|
7
|
+
type: PropType<import('@tiptap/core').NodeViewProps["node"]>;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
decorations: {
|
|
11
|
+
type: PropType<import('@tiptap/core').NodeViewProps["decorations"]>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
selected: {
|
|
15
|
+
type: PropType<import('@tiptap/core').NodeViewProps["selected"]>;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
extension: {
|
|
19
|
+
type: PropType<import('@tiptap/core').NodeViewProps["extension"]>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
getPos: {
|
|
23
|
+
type: PropType<import('@tiptap/core').NodeViewProps["getPos"]>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
updateAttributes: {
|
|
27
|
+
type: PropType<import('@tiptap/core').NodeViewProps["updateAttributes"]>;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
deleteNode: {
|
|
31
|
+
type: PropType<import('@tiptap/core').NodeViewProps["deleteNode"]>;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
view: {
|
|
35
|
+
type: PropType<import('@tiptap/core').NodeViewProps["view"]>;
|
|
36
|
+
required: true;
|
|
37
|
+
};
|
|
38
|
+
innerDecorations: {
|
|
39
|
+
type: PropType<import('@tiptap/core').NodeViewProps["innerDecorations"]>;
|
|
40
|
+
required: true;
|
|
41
|
+
};
|
|
42
|
+
HTMLAttributes: {
|
|
43
|
+
type: PropType<import('@tiptap/core').NodeViewProps["HTMLAttributes"]>;
|
|
44
|
+
required: true;
|
|
45
|
+
};
|
|
46
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
47
|
+
editor: {
|
|
48
|
+
type: PropType<import('@tiptap/core').NodeViewProps["editor"]>;
|
|
49
|
+
required: true;
|
|
50
|
+
};
|
|
51
|
+
node: {
|
|
52
|
+
type: PropType<import('@tiptap/core').NodeViewProps["node"]>;
|
|
53
|
+
required: true;
|
|
54
|
+
};
|
|
55
|
+
decorations: {
|
|
56
|
+
type: PropType<import('@tiptap/core').NodeViewProps["decorations"]>;
|
|
57
|
+
required: true;
|
|
58
|
+
};
|
|
59
|
+
selected: {
|
|
60
|
+
type: PropType<import('@tiptap/core').NodeViewProps["selected"]>;
|
|
61
|
+
required: true;
|
|
62
|
+
};
|
|
63
|
+
extension: {
|
|
64
|
+
type: PropType<import('@tiptap/core').NodeViewProps["extension"]>;
|
|
65
|
+
required: true;
|
|
66
|
+
};
|
|
67
|
+
getPos: {
|
|
68
|
+
type: PropType<import('@tiptap/core').NodeViewProps["getPos"]>;
|
|
69
|
+
required: true;
|
|
70
|
+
};
|
|
71
|
+
updateAttributes: {
|
|
72
|
+
type: PropType<import('@tiptap/core').NodeViewProps["updateAttributes"]>;
|
|
73
|
+
required: true;
|
|
74
|
+
};
|
|
75
|
+
deleteNode: {
|
|
76
|
+
type: PropType<import('@tiptap/core').NodeViewProps["deleteNode"]>;
|
|
77
|
+
required: true;
|
|
78
|
+
};
|
|
79
|
+
view: {
|
|
80
|
+
type: PropType<import('@tiptap/core').NodeViewProps["view"]>;
|
|
81
|
+
required: true;
|
|
82
|
+
};
|
|
83
|
+
innerDecorations: {
|
|
84
|
+
type: PropType<import('@tiptap/core').NodeViewProps["innerDecorations"]>;
|
|
85
|
+
required: true;
|
|
86
|
+
};
|
|
87
|
+
HTMLAttributes: {
|
|
88
|
+
type: PropType<import('@tiptap/core').NodeViewProps["HTMLAttributes"]>;
|
|
89
|
+
required: true;
|
|
90
|
+
};
|
|
91
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
92
|
+
declare const _default: typeof __VLS_export;
|
|
93
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor?: Editor;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor: Editor;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor?: Editor;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor: Editor;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NodeViewProps } from '@tiptap/core';
|
|
2
|
+
declare const __VLS_export: import('vue').DefineComponent<NodeViewProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<NodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor: Editor;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor?: Editor;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { VideoAttrs } from '../extensions/videoNode';
|
|
2
|
+
export type VideoFormData = Omit<VideoAttrs, 'src'> & {
|
|
3
|
+
src: string;
|
|
4
|
+
};
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
title: string;
|
|
7
|
+
initialValues?: Partial<VideoFormData>;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_ModelProps = {
|
|
10
|
+
'open': boolean;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
13
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
14
|
+
"update:open": (value: boolean) => any;
|
|
15
|
+
confirm: (data: VideoFormData) => any;
|
|
16
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
17
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
18
|
+
onConfirm?: ((data: VideoFormData) => any) | undefined;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
declare const __VLS_export: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
|
|
2
|
+
editor: {
|
|
3
|
+
type: PropType<import('@tiptap/core').NodeViewProps["editor"]>;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
node: {
|
|
7
|
+
type: PropType<import('@tiptap/core').NodeViewProps["node"]>;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
decorations: {
|
|
11
|
+
type: PropType<import('@tiptap/core').NodeViewProps["decorations"]>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
selected: {
|
|
15
|
+
type: PropType<import('@tiptap/core').NodeViewProps["selected"]>;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
extension: {
|
|
19
|
+
type: PropType<import('@tiptap/core').NodeViewProps["extension"]>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
getPos: {
|
|
23
|
+
type: PropType<import('@tiptap/core').NodeViewProps["getPos"]>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
updateAttributes: {
|
|
27
|
+
type: PropType<import('@tiptap/core').NodeViewProps["updateAttributes"]>;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
deleteNode: {
|
|
31
|
+
type: PropType<import('@tiptap/core').NodeViewProps["deleteNode"]>;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
view: {
|
|
35
|
+
type: PropType<import('@tiptap/core').NodeViewProps["view"]>;
|
|
36
|
+
required: true;
|
|
37
|
+
};
|
|
38
|
+
innerDecorations: {
|
|
39
|
+
type: PropType<import('@tiptap/core').NodeViewProps["innerDecorations"]>;
|
|
40
|
+
required: true;
|
|
41
|
+
};
|
|
42
|
+
HTMLAttributes: {
|
|
43
|
+
type: PropType<import('@tiptap/core').NodeViewProps["HTMLAttributes"]>;
|
|
44
|
+
required: true;
|
|
45
|
+
};
|
|
46
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
47
|
+
editor: {
|
|
48
|
+
type: PropType<import('@tiptap/core').NodeViewProps["editor"]>;
|
|
49
|
+
required: true;
|
|
50
|
+
};
|
|
51
|
+
node: {
|
|
52
|
+
type: PropType<import('@tiptap/core').NodeViewProps["node"]>;
|
|
53
|
+
required: true;
|
|
54
|
+
};
|
|
55
|
+
decorations: {
|
|
56
|
+
type: PropType<import('@tiptap/core').NodeViewProps["decorations"]>;
|
|
57
|
+
required: true;
|
|
58
|
+
};
|
|
59
|
+
selected: {
|
|
60
|
+
type: PropType<import('@tiptap/core').NodeViewProps["selected"]>;
|
|
61
|
+
required: true;
|
|
62
|
+
};
|
|
63
|
+
extension: {
|
|
64
|
+
type: PropType<import('@tiptap/core').NodeViewProps["extension"]>;
|
|
65
|
+
required: true;
|
|
66
|
+
};
|
|
67
|
+
getPos: {
|
|
68
|
+
type: PropType<import('@tiptap/core').NodeViewProps["getPos"]>;
|
|
69
|
+
required: true;
|
|
70
|
+
};
|
|
71
|
+
updateAttributes: {
|
|
72
|
+
type: PropType<import('@tiptap/core').NodeViewProps["updateAttributes"]>;
|
|
73
|
+
required: true;
|
|
74
|
+
};
|
|
75
|
+
deleteNode: {
|
|
76
|
+
type: PropType<import('@tiptap/core').NodeViewProps["deleteNode"]>;
|
|
77
|
+
required: true;
|
|
78
|
+
};
|
|
79
|
+
view: {
|
|
80
|
+
type: PropType<import('@tiptap/core').NodeViewProps["view"]>;
|
|
81
|
+
required: true;
|
|
82
|
+
};
|
|
83
|
+
innerDecorations: {
|
|
84
|
+
type: PropType<import('@tiptap/core').NodeViewProps["innerDecorations"]>;
|
|
85
|
+
required: true;
|
|
86
|
+
};
|
|
87
|
+
HTMLAttributes: {
|
|
88
|
+
type: PropType<import('@tiptap/core').NodeViewProps["HTMLAttributes"]>;
|
|
89
|
+
required: true;
|
|
90
|
+
};
|
|
91
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
92
|
+
declare const _default: typeof __VLS_export;
|
|
93
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AnyExtension, Editor } from '@tiptap/vue-3';
|
|
2
|
+
import { VNode } from 'vue';
|
|
3
|
+
import { PluginName } from '../tiptapProps';
|
|
4
|
+
export interface ToolbarButton {
|
|
5
|
+
/** 图标 */
|
|
6
|
+
icon: string;
|
|
7
|
+
/** 标题 */
|
|
8
|
+
title: string;
|
|
9
|
+
/** 图标大小(默认16) */
|
|
10
|
+
size?: string | number;
|
|
11
|
+
/** 按钮执行的方法 */
|
|
12
|
+
action: (editor: Editor) => void;
|
|
13
|
+
/** 当前扩展是否被激活 */
|
|
14
|
+
isActive?: (editor: Editor) => boolean;
|
|
15
|
+
/** 是否禁用 */
|
|
16
|
+
isDisabled?: (editor: Editor) => boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface ToolbarComponent {
|
|
19
|
+
type: 'component';
|
|
20
|
+
/** 自定义渲染 */
|
|
21
|
+
render: (editor: Editor) => VNode;
|
|
22
|
+
}
|
|
23
|
+
export type ToolbarItem = {
|
|
24
|
+
divider: true;
|
|
25
|
+
} | ToolbarButton | ToolbarComponent;
|
|
26
|
+
export interface TiptapPlugin {
|
|
27
|
+
/** 插件唯一标识,用于 disabledPlugins 过滤 */
|
|
28
|
+
name?: PluginName;
|
|
29
|
+
extensions: AnyExtension[];
|
|
30
|
+
toolbar?: ToolbarItem[];
|
|
31
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
export interface VideoAttrs {
|
|
3
|
+
src: string;
|
|
4
|
+
/** 宽度 */
|
|
5
|
+
width: string | null;
|
|
6
|
+
/** 高度 */
|
|
7
|
+
height: string | null;
|
|
8
|
+
/** 是否显示播放控件 */
|
|
9
|
+
controls: boolean;
|
|
10
|
+
/** 是否自动播放 */
|
|
11
|
+
autoplay: boolean;
|
|
12
|
+
/** 是否静音播放 */
|
|
13
|
+
muted: boolean;
|
|
14
|
+
/** 是否循环播放 */
|
|
15
|
+
loop: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare module '@tiptap/core' {
|
|
18
|
+
interface Commands<ReturnType> {
|
|
19
|
+
nativeVideo: {
|
|
20
|
+
setNativeVideo: (options: {
|
|
21
|
+
src: string;
|
|
22
|
+
} & Partial<Omit<VideoAttrs, 'src'>>) => ReturnType;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/** 原生 <video> 节点,支持 controls / autoplay / muted / loop / width / height */
|
|
27
|
+
export declare const VideoNode: Node<any, any>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { InjectionKey, Ref } from 'vue';
|
|
2
|
+
import { UploadFn } from './tiptapProps';
|
|
3
|
+
export declare const uploadImageKey: InjectionKey<UploadFn>;
|
|
4
|
+
export declare const uploadVideoKey: InjectionKey<UploadFn>;
|
|
5
|
+
export declare const editableKey: InjectionKey<Ref<boolean>>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { TiptapProps } from './tiptapProps';
|
|
2
|
+
type __VLS_Slots = {
|
|
3
|
+
'word-count'(props: {
|
|
4
|
+
count: number;
|
|
5
|
+
limit: true | number;
|
|
6
|
+
}): unknown;
|
|
7
|
+
};
|
|
8
|
+
declare const modelValue: import('vue').ModelRef<string | undefined, string, string | undefined, string | undefined>;
|
|
9
|
+
type __VLS_Props = TiptapProps;
|
|
10
|
+
type __VLS_ModelProps = {
|
|
11
|
+
'modelValue'?: typeof modelValue['value'];
|
|
12
|
+
};
|
|
13
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
14
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
15
|
+
blur: (value: string) => any;
|
|
16
|
+
change: (value: string) => any;
|
|
17
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
18
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
19
|
+
onBlur?: ((value: string) => any) | undefined;
|
|
20
|
+
onChange?: ((value: string) => any) | undefined;
|
|
21
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
22
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
export default _default;
|
|
26
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|