@tiptap/vue-3 2.0.0-beta.21 → 2.0.0-beta.211
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/index.cjs +523 -0
- package/dist/index.d.ts +271 -0
- package/dist/index.js +523 -0
- package/package.json +42 -13
- package/src/BubbleMenu.ts +41 -15
- package/src/Editor.ts +20 -10
- 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 +78 -33
- package/src/VueRenderer.ts +10 -9
- package/src/index.ts +4 -4
- package/src/useEditor.ts +3 -2
- package/CHANGELOG.md +0 -179
- package/LICENSE.md +0 -21
- package/dist/packages/vue-3/src/BubbleMenu.d.ts +0 -18
- package/dist/packages/vue-3/src/Editor.d.ts +0 -22
- package/dist/packages/vue-3/src/EditorContent.d.ts +0 -14
- package/dist/packages/vue-3/src/FloatingMenu.d.ts +0 -11
- package/dist/packages/vue-3/src/NodeViewContent.d.ts +0 -10
- package/dist/packages/vue-3/src/NodeViewWrapper.d.ts +0 -10
- package/dist/packages/vue-3/src/VueNodeViewRenderer.d.ts +0 -42
- package/dist/packages/vue-3/src/VueRenderer.d.ts +0 -19
- package/dist/packages/vue-3/src/index.d.ts +0 -10
- package/dist/packages/vue-3/src/useEditor.d.ts +0 -3
- package/dist/tiptap-vue-3.bundle.umd.min.js +0 -2
- package/dist/tiptap-vue-3.bundle.umd.min.js.map +0 -1
- package/dist/tiptap-vue-3.cjs.js +0 -405
- package/dist/tiptap-vue-3.cjs.js.map +0 -1
- package/dist/tiptap-vue-3.esm.js +0 -385
- package/dist/tiptap-vue-3.esm.js.map +0 -1
- package/dist/tiptap-vue-3.umd.js +0 -406
- package/dist/tiptap-vue-3.umd.js.map +0 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { PropType, Component, ComponentInternalInstance, ComponentPublicInstance, DefineComponent, Ref } from 'vue';
|
|
3
|
+
import * as prosemirror_state from 'prosemirror-state';
|
|
4
|
+
import * as prosemirror_view from 'prosemirror-view';
|
|
5
|
+
import { Decoration } from 'prosemirror-view';
|
|
6
|
+
import * as tippy_js from 'tippy.js';
|
|
7
|
+
import * as _tiptap_core from '@tiptap/core';
|
|
8
|
+
import { Editor as Editor$1, EditorOptions, NodeViewRendererOptions, NodeViewRenderer } from '@tiptap/core';
|
|
9
|
+
export * from '@tiptap/core';
|
|
10
|
+
import { EditorState, Plugin, PluginKey } from '@tiptap/pm/state';
|
|
11
|
+
import { Node } from '@tiptap/pm/model';
|
|
12
|
+
|
|
13
|
+
declare const BubbleMenu: vue.DefineComponent<{
|
|
14
|
+
pluginKey: {
|
|
15
|
+
type: null;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
editor: {
|
|
19
|
+
type: PropType<_tiptap_core.Editor>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
updateDelay: {
|
|
23
|
+
type: PropType<number | undefined>;
|
|
24
|
+
default: undefined;
|
|
25
|
+
};
|
|
26
|
+
tippyOptions: {
|
|
27
|
+
type: PropType<Partial<tippy_js.Props> | undefined>;
|
|
28
|
+
default: () => {};
|
|
29
|
+
};
|
|
30
|
+
shouldShow: {
|
|
31
|
+
type: PropType<(props: {
|
|
32
|
+
editor: _tiptap_core.Editor;
|
|
33
|
+
view: prosemirror_view.EditorView;
|
|
34
|
+
state: prosemirror_state.EditorState;
|
|
35
|
+
oldState?: prosemirror_state.EditorState | undefined;
|
|
36
|
+
from: number;
|
|
37
|
+
to: number;
|
|
38
|
+
}) => boolean>;
|
|
39
|
+
default: null;
|
|
40
|
+
};
|
|
41
|
+
}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
44
|
+
pluginKey: {
|
|
45
|
+
type: null;
|
|
46
|
+
default: string;
|
|
47
|
+
};
|
|
48
|
+
editor: {
|
|
49
|
+
type: PropType<_tiptap_core.Editor>;
|
|
50
|
+
required: true;
|
|
51
|
+
};
|
|
52
|
+
updateDelay: {
|
|
53
|
+
type: PropType<number | undefined>;
|
|
54
|
+
default: undefined;
|
|
55
|
+
};
|
|
56
|
+
tippyOptions: {
|
|
57
|
+
type: PropType<Partial<tippy_js.Props> | undefined>;
|
|
58
|
+
default: () => {};
|
|
59
|
+
};
|
|
60
|
+
shouldShow: {
|
|
61
|
+
type: PropType<(props: {
|
|
62
|
+
editor: _tiptap_core.Editor;
|
|
63
|
+
view: prosemirror_view.EditorView;
|
|
64
|
+
state: prosemirror_state.EditorState;
|
|
65
|
+
oldState?: prosemirror_state.EditorState | undefined;
|
|
66
|
+
from: number;
|
|
67
|
+
to: number;
|
|
68
|
+
}) => boolean>;
|
|
69
|
+
default: null;
|
|
70
|
+
};
|
|
71
|
+
}>>, {
|
|
72
|
+
updateDelay: number | undefined;
|
|
73
|
+
tippyOptions: Partial<tippy_js.Props> | undefined;
|
|
74
|
+
shouldShow: (props: {
|
|
75
|
+
editor: _tiptap_core.Editor;
|
|
76
|
+
view: prosemirror_view.EditorView;
|
|
77
|
+
state: prosemirror_state.EditorState;
|
|
78
|
+
oldState?: prosemirror_state.EditorState | undefined;
|
|
79
|
+
from: number;
|
|
80
|
+
to: number;
|
|
81
|
+
}) => boolean;
|
|
82
|
+
pluginKey: any;
|
|
83
|
+
}>;
|
|
84
|
+
|
|
85
|
+
interface VueRendererOptions {
|
|
86
|
+
editor: Editor$1;
|
|
87
|
+
props?: Record<string, any>;
|
|
88
|
+
}
|
|
89
|
+
declare class VueRenderer {
|
|
90
|
+
id: string;
|
|
91
|
+
editor: Editor;
|
|
92
|
+
component: Component;
|
|
93
|
+
teleportElement: Element;
|
|
94
|
+
element: Element;
|
|
95
|
+
props: Record<string, any>;
|
|
96
|
+
constructor(component: Component, { props, editor }: VueRendererOptions);
|
|
97
|
+
get ref(): any;
|
|
98
|
+
updateProps(props?: Record<string, any>): void;
|
|
99
|
+
destroy(): void;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
declare type ContentComponent = ComponentInternalInstance & {
|
|
103
|
+
ctx: ComponentPublicInstance;
|
|
104
|
+
};
|
|
105
|
+
declare class Editor extends Editor$1 {
|
|
106
|
+
private reactiveState;
|
|
107
|
+
private reactiveExtensionStorage;
|
|
108
|
+
vueRenderers: Map<string, VueRenderer>;
|
|
109
|
+
contentComponent: ContentComponent | null;
|
|
110
|
+
constructor(options?: Partial<EditorOptions>);
|
|
111
|
+
get state(): EditorState;
|
|
112
|
+
get storage(): Record<string, any>;
|
|
113
|
+
/**
|
|
114
|
+
* Register a ProseMirror plugin.
|
|
115
|
+
*/
|
|
116
|
+
registerPlugin(plugin: Plugin, handlePlugins?: (newPlugin: Plugin, plugins: Plugin[]) => Plugin[]): void;
|
|
117
|
+
/**
|
|
118
|
+
* Unregister a ProseMirror plugin.
|
|
119
|
+
*/
|
|
120
|
+
unregisterPlugin(nameOrPluginKey: string | PluginKey): void;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
declare const EditorContent: DefineComponent<{
|
|
124
|
+
editor: {
|
|
125
|
+
default: null;
|
|
126
|
+
type: PropType<Editor>;
|
|
127
|
+
};
|
|
128
|
+
}, {
|
|
129
|
+
rootEl: Ref<Element | undefined>;
|
|
130
|
+
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
131
|
+
editor: {
|
|
132
|
+
default: null;
|
|
133
|
+
type: PropType<Editor>;
|
|
134
|
+
};
|
|
135
|
+
}>>, {
|
|
136
|
+
editor: Editor;
|
|
137
|
+
}>;
|
|
138
|
+
|
|
139
|
+
declare const FloatingMenu: vue.DefineComponent<{
|
|
140
|
+
pluginKey: {
|
|
141
|
+
type: null;
|
|
142
|
+
default: string;
|
|
143
|
+
};
|
|
144
|
+
editor: {
|
|
145
|
+
type: PropType<_tiptap_core.Editor>;
|
|
146
|
+
required: true;
|
|
147
|
+
};
|
|
148
|
+
tippyOptions: {
|
|
149
|
+
type: PropType<Partial<tippy_js.Props> | undefined>;
|
|
150
|
+
default: () => {};
|
|
151
|
+
};
|
|
152
|
+
shouldShow: {
|
|
153
|
+
type: PropType<(props: {
|
|
154
|
+
editor: _tiptap_core.Editor;
|
|
155
|
+
view: prosemirror_view.EditorView;
|
|
156
|
+
state: prosemirror_state.EditorState;
|
|
157
|
+
oldState?: prosemirror_state.EditorState | undefined;
|
|
158
|
+
}) => boolean>;
|
|
159
|
+
default: null;
|
|
160
|
+
};
|
|
161
|
+
}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
162
|
+
[key: string]: any;
|
|
163
|
+
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
164
|
+
pluginKey: {
|
|
165
|
+
type: null;
|
|
166
|
+
default: string;
|
|
167
|
+
};
|
|
168
|
+
editor: {
|
|
169
|
+
type: PropType<_tiptap_core.Editor>;
|
|
170
|
+
required: true;
|
|
171
|
+
};
|
|
172
|
+
tippyOptions: {
|
|
173
|
+
type: PropType<Partial<tippy_js.Props> | undefined>;
|
|
174
|
+
default: () => {};
|
|
175
|
+
};
|
|
176
|
+
shouldShow: {
|
|
177
|
+
type: PropType<(props: {
|
|
178
|
+
editor: _tiptap_core.Editor;
|
|
179
|
+
view: prosemirror_view.EditorView;
|
|
180
|
+
state: prosemirror_state.EditorState;
|
|
181
|
+
oldState?: prosemirror_state.EditorState | undefined;
|
|
182
|
+
}) => boolean>;
|
|
183
|
+
default: null;
|
|
184
|
+
};
|
|
185
|
+
}>>, {
|
|
186
|
+
tippyOptions: Partial<tippy_js.Props> | undefined;
|
|
187
|
+
shouldShow: (props: {
|
|
188
|
+
editor: _tiptap_core.Editor;
|
|
189
|
+
view: prosemirror_view.EditorView;
|
|
190
|
+
state: prosemirror_state.EditorState;
|
|
191
|
+
oldState?: prosemirror_state.EditorState | undefined;
|
|
192
|
+
}) => boolean;
|
|
193
|
+
pluginKey: any;
|
|
194
|
+
}>;
|
|
195
|
+
|
|
196
|
+
declare const NodeViewContent: vue.DefineComponent<{
|
|
197
|
+
as: {
|
|
198
|
+
type: StringConstructor;
|
|
199
|
+
default: string;
|
|
200
|
+
};
|
|
201
|
+
}, unknown, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
202
|
+
as: {
|
|
203
|
+
type: StringConstructor;
|
|
204
|
+
default: string;
|
|
205
|
+
};
|
|
206
|
+
}>>, {
|
|
207
|
+
as: string;
|
|
208
|
+
}>;
|
|
209
|
+
|
|
210
|
+
declare const NodeViewWrapper: vue.DefineComponent<{
|
|
211
|
+
as: {
|
|
212
|
+
type: StringConstructor;
|
|
213
|
+
default: string;
|
|
214
|
+
};
|
|
215
|
+
}, unknown, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
216
|
+
as: {
|
|
217
|
+
type: StringConstructor;
|
|
218
|
+
default: string;
|
|
219
|
+
};
|
|
220
|
+
}>>, {
|
|
221
|
+
as: string;
|
|
222
|
+
}>;
|
|
223
|
+
|
|
224
|
+
declare const useEditor: (options?: Partial<EditorOptions>) => vue.ShallowRef<Editor | undefined>;
|
|
225
|
+
|
|
226
|
+
declare const nodeViewProps: {
|
|
227
|
+
editor: {
|
|
228
|
+
type: PropType<_tiptap_core.Editor>;
|
|
229
|
+
required: true;
|
|
230
|
+
};
|
|
231
|
+
node: {
|
|
232
|
+
type: PropType<Node>;
|
|
233
|
+
required: true;
|
|
234
|
+
};
|
|
235
|
+
decorations: {
|
|
236
|
+
type: PropType<Decoration[]>;
|
|
237
|
+
required: true;
|
|
238
|
+
};
|
|
239
|
+
selected: {
|
|
240
|
+
type: PropType<boolean>;
|
|
241
|
+
required: true;
|
|
242
|
+
};
|
|
243
|
+
extension: {
|
|
244
|
+
type: PropType<_tiptap_core.Node<any, any>>;
|
|
245
|
+
required: true;
|
|
246
|
+
};
|
|
247
|
+
getPos: {
|
|
248
|
+
type: PropType<() => number>;
|
|
249
|
+
required: true;
|
|
250
|
+
};
|
|
251
|
+
updateAttributes: {
|
|
252
|
+
type: PropType<(attributes: Record<string, any>) => void>;
|
|
253
|
+
required: true;
|
|
254
|
+
};
|
|
255
|
+
deleteNode: {
|
|
256
|
+
type: PropType<() => void>;
|
|
257
|
+
required: true;
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
interface VueNodeViewRendererOptions extends NodeViewRendererOptions {
|
|
261
|
+
update: ((props: {
|
|
262
|
+
oldNode: Node;
|
|
263
|
+
oldDecorations: Decoration[];
|
|
264
|
+
newNode: Node;
|
|
265
|
+
newDecorations: Decoration[];
|
|
266
|
+
updateProps: () => void;
|
|
267
|
+
}) => boolean) | null;
|
|
268
|
+
}
|
|
269
|
+
declare function VueNodeViewRenderer(component: Component, options?: Partial<VueNodeViewRendererOptions>): NodeViewRenderer;
|
|
270
|
+
|
|
271
|
+
export { BubbleMenu, Editor, EditorContent, FloatingMenu, NodeViewContent, NodeViewWrapper, VueNodeViewRenderer, VueNodeViewRendererOptions, VueRenderer, VueRendererOptions, nodeViewProps, useEditor };
|