@tiptap/vue-3 2.11.7 → 3.0.0-beta.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.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 +587 -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 +579 -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
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import * as _floating_ui_dom from '@floating-ui/dom';
|
|
2
|
+
import { offset, flip, shift, arrow, size, autoPlacement, hide, inline } from '@floating-ui/dom';
|
|
3
|
+
import { EditorState as EditorState$1, PluginKey as PluginKey$1 } from 'prosemirror-state';
|
|
4
|
+
import { EditorView as EditorView$1 } from 'prosemirror-view';
|
|
5
|
+
import * as _tiptap_core from '@tiptap/core';
|
|
6
|
+
import { Editor } from '@tiptap/core';
|
|
7
|
+
import * as vue from 'vue';
|
|
8
|
+
import { PropType } from 'vue';
|
|
9
|
+
import { PluginKey, EditorState } from '@tiptap/pm/state';
|
|
10
|
+
import { EditorView } from '@tiptap/pm/view';
|
|
11
|
+
|
|
12
|
+
interface BubbleMenuPluginProps {
|
|
13
|
+
/**
|
|
14
|
+
* The plugin key.
|
|
15
|
+
* @type {PluginKey | string}
|
|
16
|
+
* @default 'bubbleMenu'
|
|
17
|
+
*/
|
|
18
|
+
pluginKey: PluginKey | string;
|
|
19
|
+
/**
|
|
20
|
+
* The editor instance.
|
|
21
|
+
*/
|
|
22
|
+
editor: Editor;
|
|
23
|
+
/**
|
|
24
|
+
* The DOM element that contains your menu.
|
|
25
|
+
* @type {HTMLElement}
|
|
26
|
+
* @default null
|
|
27
|
+
*/
|
|
28
|
+
element: HTMLElement;
|
|
29
|
+
/**
|
|
30
|
+
* The delay in milliseconds before the menu should be updated.
|
|
31
|
+
* This can be useful to prevent performance issues.
|
|
32
|
+
* @type {number}
|
|
33
|
+
* @default 250
|
|
34
|
+
*/
|
|
35
|
+
updateDelay?: number;
|
|
36
|
+
/**
|
|
37
|
+
* The delay in milliseconds before the menu position should be updated on window resize.
|
|
38
|
+
* This can be useful to prevent performance issues.
|
|
39
|
+
* @type {number}
|
|
40
|
+
* @default 60
|
|
41
|
+
*/
|
|
42
|
+
resizeDelay?: number;
|
|
43
|
+
/**
|
|
44
|
+
* A function that determines whether the menu should be shown or not.
|
|
45
|
+
* If this function returns `false`, the menu will be hidden, otherwise it will be shown.
|
|
46
|
+
*/
|
|
47
|
+
shouldShow: ((props: {
|
|
48
|
+
editor: Editor;
|
|
49
|
+
element: HTMLElement;
|
|
50
|
+
view: EditorView;
|
|
51
|
+
state: EditorState;
|
|
52
|
+
oldState?: EditorState;
|
|
53
|
+
from: number;
|
|
54
|
+
to: number;
|
|
55
|
+
}) => boolean) | null;
|
|
56
|
+
/**
|
|
57
|
+
* FloatingUI options.
|
|
58
|
+
*/
|
|
59
|
+
options?: {
|
|
60
|
+
strategy?: 'absolute' | 'fixed';
|
|
61
|
+
placement?: 'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end';
|
|
62
|
+
offset?: Parameters<typeof offset>[0] | boolean;
|
|
63
|
+
flip?: Parameters<typeof flip>[0] | boolean;
|
|
64
|
+
shift?: Parameters<typeof shift>[0] | boolean;
|
|
65
|
+
arrow?: Parameters<typeof arrow>[0] | false;
|
|
66
|
+
size?: Parameters<typeof size>[0] | boolean;
|
|
67
|
+
autoPlacement?: Parameters<typeof autoPlacement>[0] | boolean;
|
|
68
|
+
hide?: Parameters<typeof hide>[0] | boolean;
|
|
69
|
+
inline?: Parameters<typeof inline>[0] | boolean;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
declare const BubbleMenu: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
74
|
+
pluginKey: {
|
|
75
|
+
type: PropType<BubbleMenuPluginProps["pluginKey"]>;
|
|
76
|
+
default: string;
|
|
77
|
+
};
|
|
78
|
+
editor: {
|
|
79
|
+
type: PropType<BubbleMenuPluginProps["editor"]>;
|
|
80
|
+
required: true;
|
|
81
|
+
};
|
|
82
|
+
updateDelay: {
|
|
83
|
+
type: PropType<BubbleMenuPluginProps["updateDelay"]>;
|
|
84
|
+
default: undefined;
|
|
85
|
+
};
|
|
86
|
+
resizeDelay: {
|
|
87
|
+
type: PropType<BubbleMenuPluginProps["resizeDelay"]>;
|
|
88
|
+
default: undefined;
|
|
89
|
+
};
|
|
90
|
+
options: {
|
|
91
|
+
type: PropType<BubbleMenuPluginProps["options"]>;
|
|
92
|
+
default: () => {};
|
|
93
|
+
};
|
|
94
|
+
shouldShow: {
|
|
95
|
+
type: PropType<Exclude<Required<BubbleMenuPluginProps>["shouldShow"], null>>;
|
|
96
|
+
default: null;
|
|
97
|
+
};
|
|
98
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
99
|
+
[key: string]: any;
|
|
100
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
101
|
+
pluginKey: {
|
|
102
|
+
type: PropType<BubbleMenuPluginProps["pluginKey"]>;
|
|
103
|
+
default: string;
|
|
104
|
+
};
|
|
105
|
+
editor: {
|
|
106
|
+
type: PropType<BubbleMenuPluginProps["editor"]>;
|
|
107
|
+
required: true;
|
|
108
|
+
};
|
|
109
|
+
updateDelay: {
|
|
110
|
+
type: PropType<BubbleMenuPluginProps["updateDelay"]>;
|
|
111
|
+
default: undefined;
|
|
112
|
+
};
|
|
113
|
+
resizeDelay: {
|
|
114
|
+
type: PropType<BubbleMenuPluginProps["resizeDelay"]>;
|
|
115
|
+
default: undefined;
|
|
116
|
+
};
|
|
117
|
+
options: {
|
|
118
|
+
type: PropType<BubbleMenuPluginProps["options"]>;
|
|
119
|
+
default: () => {};
|
|
120
|
+
};
|
|
121
|
+
shouldShow: {
|
|
122
|
+
type: PropType<Exclude<Required<BubbleMenuPluginProps>["shouldShow"], null>>;
|
|
123
|
+
default: null;
|
|
124
|
+
};
|
|
125
|
+
}>> & Readonly<{}>, {
|
|
126
|
+
updateDelay: number | undefined;
|
|
127
|
+
resizeDelay: number | undefined;
|
|
128
|
+
shouldShow: (props: {
|
|
129
|
+
editor: _tiptap_core.Editor;
|
|
130
|
+
element: HTMLElement;
|
|
131
|
+
view: EditorView$1;
|
|
132
|
+
state: EditorState$1;
|
|
133
|
+
oldState?: EditorState$1;
|
|
134
|
+
from: number;
|
|
135
|
+
to: number;
|
|
136
|
+
}) => boolean;
|
|
137
|
+
options: {
|
|
138
|
+
strategy?: "absolute" | "fixed";
|
|
139
|
+
placement?: "top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end";
|
|
140
|
+
offset?: Parameters<typeof _floating_ui_dom.offset>[0] | boolean;
|
|
141
|
+
flip?: Parameters<typeof _floating_ui_dom.flip>[0] | boolean;
|
|
142
|
+
shift?: Parameters<typeof _floating_ui_dom.shift>[0] | boolean;
|
|
143
|
+
arrow?: Parameters<typeof _floating_ui_dom.arrow>[0] | false;
|
|
144
|
+
size?: Parameters<typeof _floating_ui_dom.size>[0] | boolean;
|
|
145
|
+
autoPlacement?: Parameters<typeof _floating_ui_dom.autoPlacement>[0] | boolean;
|
|
146
|
+
hide?: Parameters<typeof _floating_ui_dom.hide>[0] | boolean;
|
|
147
|
+
inline?: Parameters<typeof _floating_ui_dom.inline>[0] | boolean;
|
|
148
|
+
} | undefined;
|
|
149
|
+
pluginKey: string | PluginKey$1<any>;
|
|
150
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
151
|
+
|
|
152
|
+
interface FloatingMenuPluginProps {
|
|
153
|
+
/**
|
|
154
|
+
* The plugin key for the floating menu.
|
|
155
|
+
* @default 'floatingMenu'
|
|
156
|
+
*/
|
|
157
|
+
pluginKey: PluginKey | string;
|
|
158
|
+
/**
|
|
159
|
+
* The editor instance.
|
|
160
|
+
* @default null
|
|
161
|
+
*/
|
|
162
|
+
editor: Editor;
|
|
163
|
+
/**
|
|
164
|
+
* The DOM element that contains your menu.
|
|
165
|
+
* @default null
|
|
166
|
+
*/
|
|
167
|
+
element: HTMLElement;
|
|
168
|
+
/**
|
|
169
|
+
* A function that determines whether the menu should be shown or not.
|
|
170
|
+
* If this function returns `false`, the menu will be hidden, otherwise it will be shown.
|
|
171
|
+
*/
|
|
172
|
+
shouldShow: ((props: {
|
|
173
|
+
editor: Editor;
|
|
174
|
+
view: EditorView;
|
|
175
|
+
state: EditorState;
|
|
176
|
+
oldState?: EditorState;
|
|
177
|
+
from: number;
|
|
178
|
+
to: number;
|
|
179
|
+
}) => boolean) | null;
|
|
180
|
+
/**
|
|
181
|
+
* FloatingUI options.
|
|
182
|
+
*/
|
|
183
|
+
options?: {
|
|
184
|
+
strategy?: 'absolute' | 'fixed';
|
|
185
|
+
placement?: 'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end';
|
|
186
|
+
offset?: Parameters<typeof offset>[0] | boolean;
|
|
187
|
+
flip?: Parameters<typeof flip>[0] | boolean;
|
|
188
|
+
shift?: Parameters<typeof shift>[0] | boolean;
|
|
189
|
+
arrow?: Parameters<typeof arrow>[0] | false;
|
|
190
|
+
size?: Parameters<typeof size>[0] | boolean;
|
|
191
|
+
autoPlacement?: Parameters<typeof autoPlacement>[0] | boolean;
|
|
192
|
+
hide?: Parameters<typeof hide>[0] | boolean;
|
|
193
|
+
inline?: Parameters<typeof inline>[0] | boolean;
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
declare const FloatingMenu: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
198
|
+
pluginKey: {
|
|
199
|
+
type: null;
|
|
200
|
+
default: string;
|
|
201
|
+
};
|
|
202
|
+
editor: {
|
|
203
|
+
type: PropType<FloatingMenuPluginProps["editor"]>;
|
|
204
|
+
required: true;
|
|
205
|
+
};
|
|
206
|
+
options: {
|
|
207
|
+
type: PropType<FloatingMenuPluginProps["options"]>;
|
|
208
|
+
default: () => {};
|
|
209
|
+
};
|
|
210
|
+
shouldShow: {
|
|
211
|
+
type: PropType<Exclude<Required<FloatingMenuPluginProps>["shouldShow"], null>>;
|
|
212
|
+
default: null;
|
|
213
|
+
};
|
|
214
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
215
|
+
[key: string]: any;
|
|
216
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
217
|
+
pluginKey: {
|
|
218
|
+
type: null;
|
|
219
|
+
default: string;
|
|
220
|
+
};
|
|
221
|
+
editor: {
|
|
222
|
+
type: PropType<FloatingMenuPluginProps["editor"]>;
|
|
223
|
+
required: true;
|
|
224
|
+
};
|
|
225
|
+
options: {
|
|
226
|
+
type: PropType<FloatingMenuPluginProps["options"]>;
|
|
227
|
+
default: () => {};
|
|
228
|
+
};
|
|
229
|
+
shouldShow: {
|
|
230
|
+
type: PropType<Exclude<Required<FloatingMenuPluginProps>["shouldShow"], null>>;
|
|
231
|
+
default: null;
|
|
232
|
+
};
|
|
233
|
+
}>> & Readonly<{}>, {
|
|
234
|
+
shouldShow: (props: {
|
|
235
|
+
editor: _tiptap_core.Editor;
|
|
236
|
+
view: EditorView$1;
|
|
237
|
+
state: EditorState$1;
|
|
238
|
+
oldState?: EditorState$1;
|
|
239
|
+
from: number;
|
|
240
|
+
to: number;
|
|
241
|
+
}) => boolean;
|
|
242
|
+
options: {
|
|
243
|
+
strategy?: "absolute" | "fixed";
|
|
244
|
+
placement?: "top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end";
|
|
245
|
+
offset?: Parameters<typeof _floating_ui_dom.offset>[0] | boolean;
|
|
246
|
+
flip?: Parameters<typeof _floating_ui_dom.flip>[0] | boolean;
|
|
247
|
+
shift?: Parameters<typeof _floating_ui_dom.shift>[0] | boolean;
|
|
248
|
+
arrow?: Parameters<typeof _floating_ui_dom.arrow>[0] | false;
|
|
249
|
+
size?: Parameters<typeof _floating_ui_dom.size>[0] | boolean;
|
|
250
|
+
autoPlacement?: Parameters<typeof _floating_ui_dom.autoPlacement>[0] | boolean;
|
|
251
|
+
hide?: Parameters<typeof _floating_ui_dom.hide>[0] | boolean;
|
|
252
|
+
inline?: Parameters<typeof _floating_ui_dom.inline>[0] | boolean;
|
|
253
|
+
} | undefined;
|
|
254
|
+
pluginKey: any;
|
|
255
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
256
|
+
|
|
257
|
+
export { BubbleMenu, FloatingMenu };
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import * as _floating_ui_dom from '@floating-ui/dom';
|
|
2
|
+
import { offset, flip, shift, arrow, size, autoPlacement, hide, inline } from '@floating-ui/dom';
|
|
3
|
+
import { EditorState as EditorState$1, PluginKey as PluginKey$1 } from 'prosemirror-state';
|
|
4
|
+
import { EditorView as EditorView$1 } from 'prosemirror-view';
|
|
5
|
+
import * as _tiptap_core from '@tiptap/core';
|
|
6
|
+
import { Editor } from '@tiptap/core';
|
|
7
|
+
import * as vue from 'vue';
|
|
8
|
+
import { PropType } from 'vue';
|
|
9
|
+
import { PluginKey, EditorState } from '@tiptap/pm/state';
|
|
10
|
+
import { EditorView } from '@tiptap/pm/view';
|
|
11
|
+
|
|
12
|
+
interface BubbleMenuPluginProps {
|
|
13
|
+
/**
|
|
14
|
+
* The plugin key.
|
|
15
|
+
* @type {PluginKey | string}
|
|
16
|
+
* @default 'bubbleMenu'
|
|
17
|
+
*/
|
|
18
|
+
pluginKey: PluginKey | string;
|
|
19
|
+
/**
|
|
20
|
+
* The editor instance.
|
|
21
|
+
*/
|
|
22
|
+
editor: Editor;
|
|
23
|
+
/**
|
|
24
|
+
* The DOM element that contains your menu.
|
|
25
|
+
* @type {HTMLElement}
|
|
26
|
+
* @default null
|
|
27
|
+
*/
|
|
28
|
+
element: HTMLElement;
|
|
29
|
+
/**
|
|
30
|
+
* The delay in milliseconds before the menu should be updated.
|
|
31
|
+
* This can be useful to prevent performance issues.
|
|
32
|
+
* @type {number}
|
|
33
|
+
* @default 250
|
|
34
|
+
*/
|
|
35
|
+
updateDelay?: number;
|
|
36
|
+
/**
|
|
37
|
+
* The delay in milliseconds before the menu position should be updated on window resize.
|
|
38
|
+
* This can be useful to prevent performance issues.
|
|
39
|
+
* @type {number}
|
|
40
|
+
* @default 60
|
|
41
|
+
*/
|
|
42
|
+
resizeDelay?: number;
|
|
43
|
+
/**
|
|
44
|
+
* A function that determines whether the menu should be shown or not.
|
|
45
|
+
* If this function returns `false`, the menu will be hidden, otherwise it will be shown.
|
|
46
|
+
*/
|
|
47
|
+
shouldShow: ((props: {
|
|
48
|
+
editor: Editor;
|
|
49
|
+
element: HTMLElement;
|
|
50
|
+
view: EditorView;
|
|
51
|
+
state: EditorState;
|
|
52
|
+
oldState?: EditorState;
|
|
53
|
+
from: number;
|
|
54
|
+
to: number;
|
|
55
|
+
}) => boolean) | null;
|
|
56
|
+
/**
|
|
57
|
+
* FloatingUI options.
|
|
58
|
+
*/
|
|
59
|
+
options?: {
|
|
60
|
+
strategy?: 'absolute' | 'fixed';
|
|
61
|
+
placement?: 'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end';
|
|
62
|
+
offset?: Parameters<typeof offset>[0] | boolean;
|
|
63
|
+
flip?: Parameters<typeof flip>[0] | boolean;
|
|
64
|
+
shift?: Parameters<typeof shift>[0] | boolean;
|
|
65
|
+
arrow?: Parameters<typeof arrow>[0] | false;
|
|
66
|
+
size?: Parameters<typeof size>[0] | boolean;
|
|
67
|
+
autoPlacement?: Parameters<typeof autoPlacement>[0] | boolean;
|
|
68
|
+
hide?: Parameters<typeof hide>[0] | boolean;
|
|
69
|
+
inline?: Parameters<typeof inline>[0] | boolean;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
declare const BubbleMenu: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
74
|
+
pluginKey: {
|
|
75
|
+
type: PropType<BubbleMenuPluginProps["pluginKey"]>;
|
|
76
|
+
default: string;
|
|
77
|
+
};
|
|
78
|
+
editor: {
|
|
79
|
+
type: PropType<BubbleMenuPluginProps["editor"]>;
|
|
80
|
+
required: true;
|
|
81
|
+
};
|
|
82
|
+
updateDelay: {
|
|
83
|
+
type: PropType<BubbleMenuPluginProps["updateDelay"]>;
|
|
84
|
+
default: undefined;
|
|
85
|
+
};
|
|
86
|
+
resizeDelay: {
|
|
87
|
+
type: PropType<BubbleMenuPluginProps["resizeDelay"]>;
|
|
88
|
+
default: undefined;
|
|
89
|
+
};
|
|
90
|
+
options: {
|
|
91
|
+
type: PropType<BubbleMenuPluginProps["options"]>;
|
|
92
|
+
default: () => {};
|
|
93
|
+
};
|
|
94
|
+
shouldShow: {
|
|
95
|
+
type: PropType<Exclude<Required<BubbleMenuPluginProps>["shouldShow"], null>>;
|
|
96
|
+
default: null;
|
|
97
|
+
};
|
|
98
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
99
|
+
[key: string]: any;
|
|
100
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
101
|
+
pluginKey: {
|
|
102
|
+
type: PropType<BubbleMenuPluginProps["pluginKey"]>;
|
|
103
|
+
default: string;
|
|
104
|
+
};
|
|
105
|
+
editor: {
|
|
106
|
+
type: PropType<BubbleMenuPluginProps["editor"]>;
|
|
107
|
+
required: true;
|
|
108
|
+
};
|
|
109
|
+
updateDelay: {
|
|
110
|
+
type: PropType<BubbleMenuPluginProps["updateDelay"]>;
|
|
111
|
+
default: undefined;
|
|
112
|
+
};
|
|
113
|
+
resizeDelay: {
|
|
114
|
+
type: PropType<BubbleMenuPluginProps["resizeDelay"]>;
|
|
115
|
+
default: undefined;
|
|
116
|
+
};
|
|
117
|
+
options: {
|
|
118
|
+
type: PropType<BubbleMenuPluginProps["options"]>;
|
|
119
|
+
default: () => {};
|
|
120
|
+
};
|
|
121
|
+
shouldShow: {
|
|
122
|
+
type: PropType<Exclude<Required<BubbleMenuPluginProps>["shouldShow"], null>>;
|
|
123
|
+
default: null;
|
|
124
|
+
};
|
|
125
|
+
}>> & Readonly<{}>, {
|
|
126
|
+
updateDelay: number | undefined;
|
|
127
|
+
resizeDelay: number | undefined;
|
|
128
|
+
shouldShow: (props: {
|
|
129
|
+
editor: _tiptap_core.Editor;
|
|
130
|
+
element: HTMLElement;
|
|
131
|
+
view: EditorView$1;
|
|
132
|
+
state: EditorState$1;
|
|
133
|
+
oldState?: EditorState$1;
|
|
134
|
+
from: number;
|
|
135
|
+
to: number;
|
|
136
|
+
}) => boolean;
|
|
137
|
+
options: {
|
|
138
|
+
strategy?: "absolute" | "fixed";
|
|
139
|
+
placement?: "top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end";
|
|
140
|
+
offset?: Parameters<typeof _floating_ui_dom.offset>[0] | boolean;
|
|
141
|
+
flip?: Parameters<typeof _floating_ui_dom.flip>[0] | boolean;
|
|
142
|
+
shift?: Parameters<typeof _floating_ui_dom.shift>[0] | boolean;
|
|
143
|
+
arrow?: Parameters<typeof _floating_ui_dom.arrow>[0] | false;
|
|
144
|
+
size?: Parameters<typeof _floating_ui_dom.size>[0] | boolean;
|
|
145
|
+
autoPlacement?: Parameters<typeof _floating_ui_dom.autoPlacement>[0] | boolean;
|
|
146
|
+
hide?: Parameters<typeof _floating_ui_dom.hide>[0] | boolean;
|
|
147
|
+
inline?: Parameters<typeof _floating_ui_dom.inline>[0] | boolean;
|
|
148
|
+
} | undefined;
|
|
149
|
+
pluginKey: string | PluginKey$1<any>;
|
|
150
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
151
|
+
|
|
152
|
+
interface FloatingMenuPluginProps {
|
|
153
|
+
/**
|
|
154
|
+
* The plugin key for the floating menu.
|
|
155
|
+
* @default 'floatingMenu'
|
|
156
|
+
*/
|
|
157
|
+
pluginKey: PluginKey | string;
|
|
158
|
+
/**
|
|
159
|
+
* The editor instance.
|
|
160
|
+
* @default null
|
|
161
|
+
*/
|
|
162
|
+
editor: Editor;
|
|
163
|
+
/**
|
|
164
|
+
* The DOM element that contains your menu.
|
|
165
|
+
* @default null
|
|
166
|
+
*/
|
|
167
|
+
element: HTMLElement;
|
|
168
|
+
/**
|
|
169
|
+
* A function that determines whether the menu should be shown or not.
|
|
170
|
+
* If this function returns `false`, the menu will be hidden, otherwise it will be shown.
|
|
171
|
+
*/
|
|
172
|
+
shouldShow: ((props: {
|
|
173
|
+
editor: Editor;
|
|
174
|
+
view: EditorView;
|
|
175
|
+
state: EditorState;
|
|
176
|
+
oldState?: EditorState;
|
|
177
|
+
from: number;
|
|
178
|
+
to: number;
|
|
179
|
+
}) => boolean) | null;
|
|
180
|
+
/**
|
|
181
|
+
* FloatingUI options.
|
|
182
|
+
*/
|
|
183
|
+
options?: {
|
|
184
|
+
strategy?: 'absolute' | 'fixed';
|
|
185
|
+
placement?: 'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end';
|
|
186
|
+
offset?: Parameters<typeof offset>[0] | boolean;
|
|
187
|
+
flip?: Parameters<typeof flip>[0] | boolean;
|
|
188
|
+
shift?: Parameters<typeof shift>[0] | boolean;
|
|
189
|
+
arrow?: Parameters<typeof arrow>[0] | false;
|
|
190
|
+
size?: Parameters<typeof size>[0] | boolean;
|
|
191
|
+
autoPlacement?: Parameters<typeof autoPlacement>[0] | boolean;
|
|
192
|
+
hide?: Parameters<typeof hide>[0] | boolean;
|
|
193
|
+
inline?: Parameters<typeof inline>[0] | boolean;
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
declare const FloatingMenu: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
198
|
+
pluginKey: {
|
|
199
|
+
type: null;
|
|
200
|
+
default: string;
|
|
201
|
+
};
|
|
202
|
+
editor: {
|
|
203
|
+
type: PropType<FloatingMenuPluginProps["editor"]>;
|
|
204
|
+
required: true;
|
|
205
|
+
};
|
|
206
|
+
options: {
|
|
207
|
+
type: PropType<FloatingMenuPluginProps["options"]>;
|
|
208
|
+
default: () => {};
|
|
209
|
+
};
|
|
210
|
+
shouldShow: {
|
|
211
|
+
type: PropType<Exclude<Required<FloatingMenuPluginProps>["shouldShow"], null>>;
|
|
212
|
+
default: null;
|
|
213
|
+
};
|
|
214
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
215
|
+
[key: string]: any;
|
|
216
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
217
|
+
pluginKey: {
|
|
218
|
+
type: null;
|
|
219
|
+
default: string;
|
|
220
|
+
};
|
|
221
|
+
editor: {
|
|
222
|
+
type: PropType<FloatingMenuPluginProps["editor"]>;
|
|
223
|
+
required: true;
|
|
224
|
+
};
|
|
225
|
+
options: {
|
|
226
|
+
type: PropType<FloatingMenuPluginProps["options"]>;
|
|
227
|
+
default: () => {};
|
|
228
|
+
};
|
|
229
|
+
shouldShow: {
|
|
230
|
+
type: PropType<Exclude<Required<FloatingMenuPluginProps>["shouldShow"], null>>;
|
|
231
|
+
default: null;
|
|
232
|
+
};
|
|
233
|
+
}>> & Readonly<{}>, {
|
|
234
|
+
shouldShow: (props: {
|
|
235
|
+
editor: _tiptap_core.Editor;
|
|
236
|
+
view: EditorView$1;
|
|
237
|
+
state: EditorState$1;
|
|
238
|
+
oldState?: EditorState$1;
|
|
239
|
+
from: number;
|
|
240
|
+
to: number;
|
|
241
|
+
}) => boolean;
|
|
242
|
+
options: {
|
|
243
|
+
strategy?: "absolute" | "fixed";
|
|
244
|
+
placement?: "top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end";
|
|
245
|
+
offset?: Parameters<typeof _floating_ui_dom.offset>[0] | boolean;
|
|
246
|
+
flip?: Parameters<typeof _floating_ui_dom.flip>[0] | boolean;
|
|
247
|
+
shift?: Parameters<typeof _floating_ui_dom.shift>[0] | boolean;
|
|
248
|
+
arrow?: Parameters<typeof _floating_ui_dom.arrow>[0] | false;
|
|
249
|
+
size?: Parameters<typeof _floating_ui_dom.size>[0] | boolean;
|
|
250
|
+
autoPlacement?: Parameters<typeof _floating_ui_dom.autoPlacement>[0] | boolean;
|
|
251
|
+
hide?: Parameters<typeof _floating_ui_dom.hide>[0] | boolean;
|
|
252
|
+
inline?: Parameters<typeof _floating_ui_dom.inline>[0] | boolean;
|
|
253
|
+
} | undefined;
|
|
254
|
+
pluginKey: any;
|
|
255
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
256
|
+
|
|
257
|
+
export { BubbleMenu, FloatingMenu };
|