@tiptap/vue-3 2.0.0-beta.20 → 2.0.0-beta.201
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/README.md +2 -2
- package/dist/packages/vue-3/src/BubbleMenu.d.ts +62 -8
- package/dist/packages/vue-3/src/Editor.d.ts +4 -2
- package/dist/packages/vue-3/src/EditorContent.d.ts +7 -4
- package/dist/packages/vue-3/src/FloatingMenu.d.ts +49 -3
- package/dist/packages/vue-3/src/NodeViewContent.d.ts +6 -3
- package/dist/packages/vue-3/src/NodeViewWrapper.d.ts +6 -3
- package/dist/packages/vue-3/src/VueNodeViewRenderer.d.ts +26 -20
- package/dist/packages/vue-3/src/VueRenderer.d.ts +6 -6
- package/dist/packages/vue-3/src/index.d.ts +4 -4
- package/dist/packages/vue-3/src/useEditor.d.ts +1 -1
- package/dist/tiptap-vue-3.cjs.js +139 -64
- package/dist/tiptap-vue-3.cjs.js.map +1 -1
- package/dist/tiptap-vue-3.esm.js +139 -62
- package/dist/tiptap-vue-3.esm.js.map +1 -1
- package/dist/tiptap-vue-3.umd.js +142 -67
- package/dist/tiptap-vue-3.umd.js.map +1 -1
- package/package.json +16 -9
- package/src/BubbleMenu.ts +41 -15
- package/src/Editor.ts +16 -5
- package/src/EditorContent.ts +15 -10
- package/src/FloatingMenu.ts +36 -11
- package/src/NodeViewContent.ts +6 -8
- package/src/NodeViewWrapper.ts +5 -4
- package/src/VueNodeViewRenderer.ts +65 -25
- package/src/VueRenderer.ts +10 -9
- package/src/index.ts +4 -4
- package/src/useEditor.ts +3 -2
- package/CHANGELOG.md +0 -171
- package/LICENSE.md +0 -21
- package/dist/tiptap-vue-3.bundle.umd.min.js +0 -2
- package/dist/tiptap-vue-3.bundle.umd.min.js.map +0 -1
package/README.md
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
## Introduction
|
|
8
8
|
tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as *New York Times*, *The Guardian* or *Atlassian*.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Official Documentation
|
|
11
11
|
Documentation can be found on the [tiptap website](https://tiptap.dev).
|
|
12
12
|
|
|
13
13
|
## License
|
|
14
|
-
tiptap is open
|
|
14
|
+
tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md).
|
|
@@ -1,18 +1,72 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
2
|
export declare const BubbleMenu: import("vue").DefineComponent<{
|
|
3
|
+
pluginKey: {
|
|
4
|
+
type: null;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
3
7
|
editor: {
|
|
4
8
|
type: PropType<import("@tiptap/core").Editor>;
|
|
5
9
|
required: true;
|
|
6
10
|
};
|
|
7
|
-
|
|
8
|
-
type: PropType<
|
|
9
|
-
default:
|
|
11
|
+
delay: {
|
|
12
|
+
type: PropType<number | undefined>;
|
|
13
|
+
default: undefined;
|
|
14
|
+
};
|
|
15
|
+
tippyOptions: {
|
|
16
|
+
type: PropType<Partial<import("tippy.js").Props> | undefined>;
|
|
17
|
+
default: () => {};
|
|
18
|
+
};
|
|
19
|
+
shouldShow: {
|
|
20
|
+
type: PropType<(props: {
|
|
21
|
+
editor: import("@tiptap/core").Editor;
|
|
22
|
+
view: import("prosemirror-view").EditorView;
|
|
23
|
+
state: import("prosemirror-state").EditorState;
|
|
24
|
+
oldState?: import("prosemirror-state").EditorState | undefined;
|
|
25
|
+
from: number;
|
|
26
|
+
to: number;
|
|
27
|
+
}) => boolean>;
|
|
28
|
+
default: null;
|
|
10
29
|
};
|
|
11
30
|
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
12
31
|
[key: string]: any;
|
|
13
|
-
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
32
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
|
+
pluginKey: {
|
|
34
|
+
type: null;
|
|
35
|
+
default: string;
|
|
36
|
+
};
|
|
37
|
+
editor: {
|
|
38
|
+
type: PropType<import("@tiptap/core").Editor>;
|
|
39
|
+
required: true;
|
|
40
|
+
};
|
|
41
|
+
delay: {
|
|
42
|
+
type: PropType<number | undefined>;
|
|
43
|
+
default: undefined;
|
|
44
|
+
};
|
|
45
|
+
tippyOptions: {
|
|
46
|
+
type: PropType<Partial<import("tippy.js").Props> | undefined>;
|
|
47
|
+
default: () => {};
|
|
48
|
+
};
|
|
49
|
+
shouldShow: {
|
|
50
|
+
type: PropType<(props: {
|
|
51
|
+
editor: import("@tiptap/core").Editor;
|
|
52
|
+
view: import("prosemirror-view").EditorView;
|
|
53
|
+
state: import("prosemirror-state").EditorState;
|
|
54
|
+
oldState?: import("prosemirror-state").EditorState | undefined;
|
|
55
|
+
from: number;
|
|
56
|
+
to: number;
|
|
57
|
+
}) => boolean>;
|
|
58
|
+
default: null;
|
|
59
|
+
};
|
|
60
|
+
}>>, {
|
|
61
|
+
delay: number | undefined;
|
|
62
|
+
tippyOptions: Partial<import("tippy.js").Props> | undefined;
|
|
63
|
+
shouldShow: (props: {
|
|
64
|
+
editor: import("@tiptap/core").Editor;
|
|
65
|
+
view: import("prosemirror-view").EditorView;
|
|
66
|
+
state: import("prosemirror-state").EditorState;
|
|
67
|
+
oldState?: import("prosemirror-state").EditorState | undefined;
|
|
68
|
+
from: number;
|
|
69
|
+
to: number;
|
|
70
|
+
}) => boolean;
|
|
71
|
+
pluginKey: any;
|
|
18
72
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EditorState, Plugin, PluginKey } from 'prosemirror-state';
|
|
2
1
|
import { Editor as CoreEditor, EditorOptions } from '@tiptap/core';
|
|
2
|
+
import { EditorState, Plugin, PluginKey } from 'prosemirror-state';
|
|
3
3
|
import { ComponentInternalInstance, ComponentPublicInstance } from 'vue';
|
|
4
4
|
import { VueRenderer } from './VueRenderer';
|
|
5
5
|
export declare type ContentComponent = ComponentInternalInstance & {
|
|
@@ -7,10 +7,12 @@ export declare type ContentComponent = ComponentInternalInstance & {
|
|
|
7
7
|
};
|
|
8
8
|
export declare class Editor extends CoreEditor {
|
|
9
9
|
private reactiveState;
|
|
10
|
+
private reactiveExtensionStorage;
|
|
10
11
|
vueRenderers: Map<string, VueRenderer>;
|
|
11
12
|
contentComponent: ContentComponent | null;
|
|
12
13
|
constructor(options?: Partial<EditorOptions>);
|
|
13
|
-
get state(): EditorState
|
|
14
|
+
get state(): EditorState;
|
|
15
|
+
get storage(): Record<string, any>;
|
|
14
16
|
/**
|
|
15
17
|
* Register a ProseMirror plugin.
|
|
16
18
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DefineComponent, PropType, Ref } from 'vue';
|
|
2
2
|
import { Editor } from './Editor';
|
|
3
3
|
export declare const EditorContent: DefineComponent<{
|
|
4
4
|
editor: {
|
|
@@ -7,8 +7,11 @@ export declare const EditorContent: DefineComponent<{
|
|
|
7
7
|
};
|
|
8
8
|
}, {
|
|
9
9
|
rootEl: Ref<Element | undefined>;
|
|
10
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
11
|
-
editor:
|
|
12
|
-
|
|
10
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
|
+
editor: {
|
|
12
|
+
default: null;
|
|
13
|
+
type: PropType<Editor>;
|
|
14
|
+
};
|
|
15
|
+
}>>, {
|
|
13
16
|
editor: Editor;
|
|
14
17
|
}>;
|
|
@@ -1,11 +1,57 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
2
|
export declare const FloatingMenu: import("vue").DefineComponent<{
|
|
3
|
+
pluginKey: {
|
|
4
|
+
type: null;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
3
7
|
editor: {
|
|
4
8
|
type: PropType<import("@tiptap/core").Editor>;
|
|
5
9
|
required: true;
|
|
6
10
|
};
|
|
11
|
+
tippyOptions: {
|
|
12
|
+
type: PropType<Partial<import("tippy.js").Props> | undefined>;
|
|
13
|
+
default: () => {};
|
|
14
|
+
};
|
|
15
|
+
shouldShow: {
|
|
16
|
+
type: PropType<(props: {
|
|
17
|
+
editor: import("@tiptap/core").Editor;
|
|
18
|
+
view: import("prosemirror-view").EditorView;
|
|
19
|
+
state: import("prosemirror-state").EditorState;
|
|
20
|
+
oldState?: import("prosemirror-state").EditorState | undefined;
|
|
21
|
+
}) => boolean>;
|
|
22
|
+
default: null;
|
|
23
|
+
};
|
|
7
24
|
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
8
25
|
[key: string]: any;
|
|
9
|
-
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
10
|
-
|
|
11
|
-
|
|
26
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
|
+
pluginKey: {
|
|
28
|
+
type: null;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
31
|
+
editor: {
|
|
32
|
+
type: PropType<import("@tiptap/core").Editor>;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
tippyOptions: {
|
|
36
|
+
type: PropType<Partial<import("tippy.js").Props> | undefined>;
|
|
37
|
+
default: () => {};
|
|
38
|
+
};
|
|
39
|
+
shouldShow: {
|
|
40
|
+
type: PropType<(props: {
|
|
41
|
+
editor: import("@tiptap/core").Editor;
|
|
42
|
+
view: import("prosemirror-view").EditorView;
|
|
43
|
+
state: import("prosemirror-state").EditorState;
|
|
44
|
+
oldState?: import("prosemirror-state").EditorState | undefined;
|
|
45
|
+
}) => boolean>;
|
|
46
|
+
default: null;
|
|
47
|
+
};
|
|
48
|
+
}>>, {
|
|
49
|
+
tippyOptions: Partial<import("tippy.js").Props> | undefined;
|
|
50
|
+
shouldShow: (props: {
|
|
51
|
+
editor: import("@tiptap/core").Editor;
|
|
52
|
+
view: import("prosemirror-view").EditorView;
|
|
53
|
+
state: import("prosemirror-state").EditorState;
|
|
54
|
+
oldState?: import("prosemirror-state").EditorState | undefined;
|
|
55
|
+
}) => boolean;
|
|
56
|
+
pluginKey: any;
|
|
57
|
+
}>;
|
|
@@ -3,8 +3,11 @@ export declare const NodeViewContent: import("vue").DefineComponent<{
|
|
|
3
3
|
type: StringConstructor;
|
|
4
4
|
default: string;
|
|
5
5
|
};
|
|
6
|
-
}, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
7
|
-
as:
|
|
8
|
-
|
|
6
|
+
}, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
+
as: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
}>>, {
|
|
9
12
|
as: string;
|
|
10
13
|
}>;
|
|
@@ -3,8 +3,11 @@ export declare const NodeViewWrapper: import("vue").DefineComponent<{
|
|
|
3
3
|
type: StringConstructor;
|
|
4
4
|
default: string;
|
|
5
5
|
};
|
|
6
|
-
}, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
7
|
-
as:
|
|
8
|
-
|
|
6
|
+
}, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
+
as: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
}>>, {
|
|
9
12
|
as: string;
|
|
10
13
|
}>;
|
|
@@ -1,42 +1,48 @@
|
|
|
1
|
-
import { NodeViewRenderer } from '@tiptap/core';
|
|
2
|
-
import { PropType, Component } from 'vue';
|
|
3
|
-
import { Decoration } from 'prosemirror-view';
|
|
1
|
+
import { NodeViewRenderer, NodeViewRendererOptions } from '@tiptap/core';
|
|
4
2
|
import { Node as ProseMirrorNode } from 'prosemirror-model';
|
|
3
|
+
import { Decoration } from 'prosemirror-view';
|
|
4
|
+
import { Component, PropType } from 'vue';
|
|
5
5
|
export declare const nodeViewProps: {
|
|
6
6
|
editor: {
|
|
7
7
|
type: PropType<import("@tiptap/core").Editor>;
|
|
8
|
-
required:
|
|
8
|
+
required: true;
|
|
9
9
|
};
|
|
10
10
|
node: {
|
|
11
|
-
type: PropType<ProseMirrorNode
|
|
12
|
-
required:
|
|
11
|
+
type: PropType<ProseMirrorNode>;
|
|
12
|
+
required: true;
|
|
13
13
|
};
|
|
14
14
|
decorations: {
|
|
15
|
-
type: PropType<Decoration
|
|
16
|
-
|
|
17
|
-
}>[]>;
|
|
18
|
-
required: boolean;
|
|
15
|
+
type: PropType<Decoration[]>;
|
|
16
|
+
required: true;
|
|
19
17
|
};
|
|
20
18
|
selected: {
|
|
21
19
|
type: PropType<boolean>;
|
|
22
|
-
required:
|
|
20
|
+
required: true;
|
|
23
21
|
};
|
|
24
22
|
extension: {
|
|
25
|
-
type: PropType<import("@tiptap/core").Node<any>>;
|
|
26
|
-
required:
|
|
23
|
+
type: PropType<import("@tiptap/core").Node<any, any>>;
|
|
24
|
+
required: true;
|
|
27
25
|
};
|
|
28
26
|
getPos: {
|
|
29
27
|
type: PropType<() => number>;
|
|
30
|
-
required:
|
|
28
|
+
required: true;
|
|
31
29
|
};
|
|
32
30
|
updateAttributes: {
|
|
33
|
-
type: PropType<(attributes:
|
|
34
|
-
required:
|
|
31
|
+
type: PropType<(attributes: Record<string, any>) => void>;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
deleteNode: {
|
|
35
|
+
type: PropType<() => void>;
|
|
36
|
+
required: true;
|
|
35
37
|
};
|
|
36
38
|
};
|
|
37
|
-
interface VueNodeViewRendererOptions {
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
export interface VueNodeViewRendererOptions extends NodeViewRendererOptions {
|
|
40
|
+
update: ((props: {
|
|
41
|
+
oldNode: ProseMirrorNode;
|
|
42
|
+
oldDecorations: Decoration[];
|
|
43
|
+
newNode: ProseMirrorNode;
|
|
44
|
+
newDecorations: Decoration[];
|
|
45
|
+
updateProps: () => void;
|
|
46
|
+
}) => boolean) | null;
|
|
40
47
|
}
|
|
41
48
|
export declare function VueNodeViewRenderer(component: Component, options?: Partial<VueNodeViewRendererOptions>): NodeViewRenderer;
|
|
42
|
-
export {};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core';
|
|
1
2
|
import { Component } from 'vue';
|
|
2
|
-
import {
|
|
3
|
-
import { Editor } from './Editor';
|
|
3
|
+
import { Editor as ExtendedEditor } from './Editor';
|
|
4
4
|
export interface VueRendererOptions {
|
|
5
5
|
editor: Editor;
|
|
6
|
-
props?:
|
|
6
|
+
props?: Record<string, any>;
|
|
7
7
|
}
|
|
8
8
|
export declare class VueRenderer {
|
|
9
9
|
id: string;
|
|
10
|
-
editor:
|
|
10
|
+
editor: ExtendedEditor;
|
|
11
11
|
component: Component;
|
|
12
12
|
teleportElement: Element;
|
|
13
13
|
element: Element;
|
|
14
|
-
props:
|
|
14
|
+
props: Record<string, any>;
|
|
15
15
|
constructor(component: Component, { props, editor }: VueRendererOptions);
|
|
16
16
|
get ref(): any;
|
|
17
|
-
updateProps(props?:
|
|
17
|
+
updateProps(props?: Record<string, any>): void;
|
|
18
18
|
destroy(): void;
|
|
19
19
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * from '@tiptap/core';
|
|
2
1
|
export * from './BubbleMenu';
|
|
3
2
|
export { Editor } from './Editor';
|
|
4
3
|
export * from './EditorContent';
|
|
5
4
|
export * from './FloatingMenu';
|
|
5
|
+
export * from './NodeViewContent';
|
|
6
|
+
export * from './NodeViewWrapper';
|
|
6
7
|
export * from './useEditor';
|
|
7
|
-
export * from './VueRenderer';
|
|
8
8
|
export * from './VueNodeViewRenderer';
|
|
9
|
-
export * from './
|
|
10
|
-
export * from '
|
|
9
|
+
export * from './VueRenderer';
|
|
10
|
+
export * from '@tiptap/core';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { EditorOptions } from '@tiptap/core';
|
|
2
2
|
import { Editor } from './Editor';
|
|
3
|
-
export declare const useEditor: (options?: Partial<EditorOptions>) => import("vue").
|
|
3
|
+
export declare const useEditor: (options?: Partial<EditorOptions>) => import("vue").ShallowRef<Editor | undefined>;
|