@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
package/dist/index.umd.js
DELETED
|
@@ -1,570 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tiptap/extension-bubble-menu'), require('vue'), require('@tiptap/core'), require('@tiptap/extension-floating-menu')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@tiptap/extension-bubble-menu', 'vue', '@tiptap/core', '@tiptap/extension-floating-menu'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@tiptap/vue-3"] = {}, global.extensionBubbleMenu, global.vue, global.core, global.extensionFloatingMenu));
|
|
5
|
-
})(this, (function (exports, extensionBubbleMenu, vue, core, extensionFloatingMenu) { 'use strict';
|
|
6
|
-
|
|
7
|
-
const BubbleMenu = vue.defineComponent({
|
|
8
|
-
name: 'BubbleMenu',
|
|
9
|
-
props: {
|
|
10
|
-
pluginKey: {
|
|
11
|
-
type: [String, Object],
|
|
12
|
-
default: 'bubbleMenu',
|
|
13
|
-
},
|
|
14
|
-
editor: {
|
|
15
|
-
type: Object,
|
|
16
|
-
required: true,
|
|
17
|
-
},
|
|
18
|
-
updateDelay: {
|
|
19
|
-
type: Number,
|
|
20
|
-
default: undefined,
|
|
21
|
-
},
|
|
22
|
-
tippyOptions: {
|
|
23
|
-
type: Object,
|
|
24
|
-
default: () => ({}),
|
|
25
|
-
},
|
|
26
|
-
shouldShow: {
|
|
27
|
-
type: Function,
|
|
28
|
-
default: null,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
setup(props, { slots }) {
|
|
32
|
-
const root = vue.ref(null);
|
|
33
|
-
vue.onMounted(() => {
|
|
34
|
-
const { updateDelay, editor, pluginKey, shouldShow, tippyOptions, } = props;
|
|
35
|
-
editor.registerPlugin(extensionBubbleMenu.BubbleMenuPlugin({
|
|
36
|
-
updateDelay,
|
|
37
|
-
editor,
|
|
38
|
-
element: root.value,
|
|
39
|
-
pluginKey,
|
|
40
|
-
shouldShow,
|
|
41
|
-
tippyOptions,
|
|
42
|
-
}));
|
|
43
|
-
});
|
|
44
|
-
vue.onBeforeUnmount(() => {
|
|
45
|
-
const { pluginKey, editor } = props;
|
|
46
|
-
editor.unregisterPlugin(pluginKey);
|
|
47
|
-
});
|
|
48
|
-
return () => { var _a; return vue.h('div', { ref: root }, (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)); };
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
/* eslint-disable react-hooks/rules-of-hooks */
|
|
53
|
-
function useDebouncedRef(value) {
|
|
54
|
-
return vue.customRef((track, trigger) => {
|
|
55
|
-
return {
|
|
56
|
-
get() {
|
|
57
|
-
track();
|
|
58
|
-
return value;
|
|
59
|
-
},
|
|
60
|
-
set(newValue) {
|
|
61
|
-
// update state
|
|
62
|
-
value = newValue;
|
|
63
|
-
// update view as soon as possible
|
|
64
|
-
requestAnimationFrame(() => {
|
|
65
|
-
requestAnimationFrame(() => {
|
|
66
|
-
trigger();
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
class Editor extends core.Editor {
|
|
74
|
-
constructor(options = {}) {
|
|
75
|
-
super(options);
|
|
76
|
-
this.contentComponent = null;
|
|
77
|
-
this.appContext = null;
|
|
78
|
-
this.reactiveState = useDebouncedRef(this.view.state);
|
|
79
|
-
this.reactiveExtensionStorage = useDebouncedRef(this.extensionStorage);
|
|
80
|
-
this.on('beforeTransaction', ({ nextState }) => {
|
|
81
|
-
this.reactiveState.value = nextState;
|
|
82
|
-
this.reactiveExtensionStorage.value = this.extensionStorage;
|
|
83
|
-
});
|
|
84
|
-
return vue.markRaw(this); // eslint-disable-line
|
|
85
|
-
}
|
|
86
|
-
get state() {
|
|
87
|
-
return this.reactiveState ? this.reactiveState.value : this.view.state;
|
|
88
|
-
}
|
|
89
|
-
get storage() {
|
|
90
|
-
return this.reactiveExtensionStorage ? this.reactiveExtensionStorage.value : super.storage;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Register a ProseMirror plugin.
|
|
94
|
-
*/
|
|
95
|
-
registerPlugin(plugin, handlePlugins) {
|
|
96
|
-
const nextState = super.registerPlugin(plugin, handlePlugins);
|
|
97
|
-
if (this.reactiveState) {
|
|
98
|
-
this.reactiveState.value = nextState;
|
|
99
|
-
}
|
|
100
|
-
return nextState;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Unregister a ProseMirror plugin.
|
|
104
|
-
*/
|
|
105
|
-
unregisterPlugin(nameOrPluginKey) {
|
|
106
|
-
const nextState = super.unregisterPlugin(nameOrPluginKey);
|
|
107
|
-
if (this.reactiveState && nextState) {
|
|
108
|
-
this.reactiveState.value = nextState;
|
|
109
|
-
}
|
|
110
|
-
return nextState;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const EditorContent = vue.defineComponent({
|
|
115
|
-
name: 'EditorContent',
|
|
116
|
-
props: {
|
|
117
|
-
editor: {
|
|
118
|
-
default: null,
|
|
119
|
-
type: Object,
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
setup(props) {
|
|
123
|
-
const rootEl = vue.ref();
|
|
124
|
-
const instance = vue.getCurrentInstance();
|
|
125
|
-
vue.watchEffect(() => {
|
|
126
|
-
const editor = props.editor;
|
|
127
|
-
if (editor && editor.options.element && rootEl.value) {
|
|
128
|
-
vue.nextTick(() => {
|
|
129
|
-
if (!rootEl.value || !editor.options.element.firstChild) {
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
const element = vue.unref(rootEl.value);
|
|
133
|
-
rootEl.value.append(...editor.options.element.childNodes);
|
|
134
|
-
// @ts-ignore
|
|
135
|
-
editor.contentComponent = instance.ctx._;
|
|
136
|
-
if (instance) {
|
|
137
|
-
editor.appContext = {
|
|
138
|
-
...instance.appContext,
|
|
139
|
-
// Vue internally uses prototype chain to forward/shadow injects across the entire component chain
|
|
140
|
-
// so don't use object spread operator or 'Object.assign' and just set `provides` as is on editor's appContext
|
|
141
|
-
// @ts-expect-error forward instance's 'provides' into appContext
|
|
142
|
-
provides: instance.provides,
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
editor.setOptions({
|
|
146
|
-
element,
|
|
147
|
-
});
|
|
148
|
-
editor.createNodeViews();
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
vue.onBeforeUnmount(() => {
|
|
153
|
-
const editor = props.editor;
|
|
154
|
-
if (!editor) {
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
editor.contentComponent = null;
|
|
158
|
-
editor.appContext = null;
|
|
159
|
-
});
|
|
160
|
-
return { rootEl };
|
|
161
|
-
},
|
|
162
|
-
render() {
|
|
163
|
-
return vue.h('div', {
|
|
164
|
-
ref: (el) => { this.rootEl = el; },
|
|
165
|
-
});
|
|
166
|
-
},
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
const FloatingMenu = vue.defineComponent({
|
|
170
|
-
name: 'FloatingMenu',
|
|
171
|
-
props: {
|
|
172
|
-
pluginKey: {
|
|
173
|
-
// TODO: TypeScript breaks :(
|
|
174
|
-
// type: [String, Object as PropType<Exclude<FloatingMenuPluginProps['pluginKey'], string>>],
|
|
175
|
-
type: null,
|
|
176
|
-
default: 'floatingMenu',
|
|
177
|
-
},
|
|
178
|
-
editor: {
|
|
179
|
-
type: Object,
|
|
180
|
-
required: true,
|
|
181
|
-
},
|
|
182
|
-
tippyOptions: {
|
|
183
|
-
type: Object,
|
|
184
|
-
default: () => ({}),
|
|
185
|
-
},
|
|
186
|
-
shouldShow: {
|
|
187
|
-
type: Function,
|
|
188
|
-
default: null,
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
|
-
setup(props, { slots }) {
|
|
192
|
-
const root = vue.ref(null);
|
|
193
|
-
vue.onMounted(() => {
|
|
194
|
-
const { pluginKey, editor, tippyOptions, shouldShow, } = props;
|
|
195
|
-
editor.registerPlugin(extensionFloatingMenu.FloatingMenuPlugin({
|
|
196
|
-
pluginKey,
|
|
197
|
-
editor,
|
|
198
|
-
element: root.value,
|
|
199
|
-
tippyOptions,
|
|
200
|
-
shouldShow,
|
|
201
|
-
}));
|
|
202
|
-
});
|
|
203
|
-
vue.onBeforeUnmount(() => {
|
|
204
|
-
const { pluginKey, editor } = props;
|
|
205
|
-
editor.unregisterPlugin(pluginKey);
|
|
206
|
-
});
|
|
207
|
-
return () => { var _a; return vue.h('div', { ref: root }, (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)); };
|
|
208
|
-
},
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
const NodeViewContent = vue.defineComponent({
|
|
212
|
-
name: 'NodeViewContent',
|
|
213
|
-
props: {
|
|
214
|
-
as: {
|
|
215
|
-
type: String,
|
|
216
|
-
default: 'div',
|
|
217
|
-
},
|
|
218
|
-
},
|
|
219
|
-
render() {
|
|
220
|
-
return vue.h(this.as, {
|
|
221
|
-
style: {
|
|
222
|
-
whiteSpace: 'pre-wrap',
|
|
223
|
-
},
|
|
224
|
-
'data-node-view-content': '',
|
|
225
|
-
});
|
|
226
|
-
},
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
const NodeViewWrapper = vue.defineComponent({
|
|
230
|
-
name: 'NodeViewWrapper',
|
|
231
|
-
props: {
|
|
232
|
-
as: {
|
|
233
|
-
type: String,
|
|
234
|
-
default: 'div',
|
|
235
|
-
},
|
|
236
|
-
},
|
|
237
|
-
inject: ['onDragStart', 'decorationClasses'],
|
|
238
|
-
render() {
|
|
239
|
-
var _a, _b;
|
|
240
|
-
return vue.h(this.as, {
|
|
241
|
-
// @ts-ignore
|
|
242
|
-
class: this.decorationClasses,
|
|
243
|
-
style: {
|
|
244
|
-
whiteSpace: 'normal',
|
|
245
|
-
},
|
|
246
|
-
'data-node-view-wrapper': '',
|
|
247
|
-
// @ts-ignore (https://github.com/vuejs/vue-next/issues/3031)
|
|
248
|
-
onDragstart: this.onDragStart,
|
|
249
|
-
}, (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
250
|
-
},
|
|
251
|
-
});
|
|
252
|
-
|
|
253
|
-
const useEditor = (options = {}) => {
|
|
254
|
-
const editor = vue.shallowRef();
|
|
255
|
-
vue.onMounted(() => {
|
|
256
|
-
editor.value = new Editor(options);
|
|
257
|
-
});
|
|
258
|
-
vue.onBeforeUnmount(() => {
|
|
259
|
-
var _a, _b, _c;
|
|
260
|
-
// Cloning root node (and its children) to avoid content being lost by destroy
|
|
261
|
-
const nodes = (_a = editor.value) === null || _a === void 0 ? void 0 : _a.options.element;
|
|
262
|
-
const newEl = nodes === null || nodes === void 0 ? void 0 : nodes.cloneNode(true);
|
|
263
|
-
(_b = nodes === null || nodes === void 0 ? void 0 : nodes.parentNode) === null || _b === void 0 ? void 0 : _b.replaceChild(newEl, nodes);
|
|
264
|
-
(_c = editor.value) === null || _c === void 0 ? void 0 : _c.destroy();
|
|
265
|
-
});
|
|
266
|
-
return editor;
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
/**
|
|
270
|
-
* This class is used to render Vue components inside the editor.
|
|
271
|
-
*/
|
|
272
|
-
class VueRenderer {
|
|
273
|
-
constructor(component, { props = {}, editor }) {
|
|
274
|
-
this.editor = editor;
|
|
275
|
-
this.component = vue.markRaw(component);
|
|
276
|
-
this.el = document.createElement('div');
|
|
277
|
-
this.props = vue.reactive(props);
|
|
278
|
-
this.renderedComponent = this.renderComponent();
|
|
279
|
-
}
|
|
280
|
-
get element() {
|
|
281
|
-
return this.renderedComponent.el;
|
|
282
|
-
}
|
|
283
|
-
get ref() {
|
|
284
|
-
var _a, _b, _c, _d;
|
|
285
|
-
// Composition API
|
|
286
|
-
if ((_b = (_a = this.renderedComponent.vNode) === null || _a === void 0 ? void 0 : _a.component) === null || _b === void 0 ? void 0 : _b.exposed) {
|
|
287
|
-
return this.renderedComponent.vNode.component.exposed;
|
|
288
|
-
}
|
|
289
|
-
// Option API
|
|
290
|
-
return (_d = (_c = this.renderedComponent.vNode) === null || _c === void 0 ? void 0 : _c.component) === null || _d === void 0 ? void 0 : _d.proxy;
|
|
291
|
-
}
|
|
292
|
-
renderComponent() {
|
|
293
|
-
let vNode = vue.h(this.component, this.props);
|
|
294
|
-
if (this.editor.appContext) {
|
|
295
|
-
vNode.appContext = this.editor.appContext;
|
|
296
|
-
}
|
|
297
|
-
if (typeof document !== 'undefined' && this.el) {
|
|
298
|
-
vue.render(vNode, this.el);
|
|
299
|
-
}
|
|
300
|
-
const destroy = () => {
|
|
301
|
-
if (this.el) {
|
|
302
|
-
vue.render(null, this.el);
|
|
303
|
-
}
|
|
304
|
-
this.el = null;
|
|
305
|
-
vNode = null;
|
|
306
|
-
};
|
|
307
|
-
return { vNode, destroy, el: this.el ? this.el.firstElementChild : null };
|
|
308
|
-
}
|
|
309
|
-
updateProps(props = {}) {
|
|
310
|
-
Object.entries(props).forEach(([key, value]) => {
|
|
311
|
-
this.props[key] = value;
|
|
312
|
-
});
|
|
313
|
-
this.renderComponent();
|
|
314
|
-
}
|
|
315
|
-
destroy() {
|
|
316
|
-
this.renderedComponent.destroy();
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
/* eslint-disable no-underscore-dangle */
|
|
321
|
-
const nodeViewProps = {
|
|
322
|
-
editor: {
|
|
323
|
-
type: Object,
|
|
324
|
-
required: true,
|
|
325
|
-
},
|
|
326
|
-
node: {
|
|
327
|
-
type: Object,
|
|
328
|
-
required: true,
|
|
329
|
-
},
|
|
330
|
-
decorations: {
|
|
331
|
-
type: Object,
|
|
332
|
-
required: true,
|
|
333
|
-
},
|
|
334
|
-
selected: {
|
|
335
|
-
type: Boolean,
|
|
336
|
-
required: true,
|
|
337
|
-
},
|
|
338
|
-
extension: {
|
|
339
|
-
type: Object,
|
|
340
|
-
required: true,
|
|
341
|
-
},
|
|
342
|
-
getPos: {
|
|
343
|
-
type: Function,
|
|
344
|
-
required: true,
|
|
345
|
-
},
|
|
346
|
-
updateAttributes: {
|
|
347
|
-
type: Function,
|
|
348
|
-
required: true,
|
|
349
|
-
},
|
|
350
|
-
deleteNode: {
|
|
351
|
-
type: Function,
|
|
352
|
-
required: true,
|
|
353
|
-
},
|
|
354
|
-
view: {
|
|
355
|
-
type: Object,
|
|
356
|
-
required: true,
|
|
357
|
-
},
|
|
358
|
-
innerDecorations: {
|
|
359
|
-
type: Object,
|
|
360
|
-
required: true,
|
|
361
|
-
},
|
|
362
|
-
HTMLAttributes: {
|
|
363
|
-
type: Object,
|
|
364
|
-
required: true,
|
|
365
|
-
},
|
|
366
|
-
};
|
|
367
|
-
class VueNodeView extends core.NodeView {
|
|
368
|
-
mount() {
|
|
369
|
-
const props = {
|
|
370
|
-
editor: this.editor,
|
|
371
|
-
node: this.node,
|
|
372
|
-
decorations: this.decorations,
|
|
373
|
-
innerDecorations: this.innerDecorations,
|
|
374
|
-
view: this.view,
|
|
375
|
-
selected: false,
|
|
376
|
-
extension: this.extension,
|
|
377
|
-
HTMLAttributes: this.HTMLAttributes,
|
|
378
|
-
getPos: () => this.getPos(),
|
|
379
|
-
updateAttributes: (attributes = {}) => this.updateAttributes(attributes),
|
|
380
|
-
deleteNode: () => this.deleteNode(),
|
|
381
|
-
};
|
|
382
|
-
const onDragStart = this.onDragStart.bind(this);
|
|
383
|
-
this.decorationClasses = vue.ref(this.getDecorationClasses());
|
|
384
|
-
const extendedComponent = vue.defineComponent({
|
|
385
|
-
extends: { ...this.component },
|
|
386
|
-
props: Object.keys(props),
|
|
387
|
-
template: this.component.template,
|
|
388
|
-
setup: reactiveProps => {
|
|
389
|
-
var _a, _b;
|
|
390
|
-
vue.provide('onDragStart', onDragStart);
|
|
391
|
-
vue.provide('decorationClasses', this.decorationClasses);
|
|
392
|
-
return (_b = (_a = this.component).setup) === null || _b === void 0 ? void 0 : _b.call(_a, reactiveProps, {
|
|
393
|
-
expose: () => undefined,
|
|
394
|
-
});
|
|
395
|
-
},
|
|
396
|
-
// add support for scoped styles
|
|
397
|
-
// @ts-ignore
|
|
398
|
-
// eslint-disable-next-line
|
|
399
|
-
__scopeId: this.component.__scopeId,
|
|
400
|
-
// add support for CSS Modules
|
|
401
|
-
// @ts-ignore
|
|
402
|
-
// eslint-disable-next-line
|
|
403
|
-
__cssModules: this.component.__cssModules,
|
|
404
|
-
// add support for vue devtools
|
|
405
|
-
// @ts-ignore
|
|
406
|
-
// eslint-disable-next-line
|
|
407
|
-
__name: this.component.__name,
|
|
408
|
-
// @ts-ignore
|
|
409
|
-
// eslint-disable-next-line
|
|
410
|
-
__file: this.component.__file,
|
|
411
|
-
});
|
|
412
|
-
this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this);
|
|
413
|
-
this.editor.on('selectionUpdate', this.handleSelectionUpdate);
|
|
414
|
-
this.renderer = new VueRenderer(extendedComponent, {
|
|
415
|
-
editor: this.editor,
|
|
416
|
-
props,
|
|
417
|
-
});
|
|
418
|
-
}
|
|
419
|
-
/**
|
|
420
|
-
* Return the DOM element.
|
|
421
|
-
* This is the element that will be used to display the node view.
|
|
422
|
-
*/
|
|
423
|
-
get dom() {
|
|
424
|
-
if (!this.renderer.element || !this.renderer.element.hasAttribute('data-node-view-wrapper')) {
|
|
425
|
-
throw Error('Please use the NodeViewWrapper component for your node view.');
|
|
426
|
-
}
|
|
427
|
-
return this.renderer.element;
|
|
428
|
-
}
|
|
429
|
-
/**
|
|
430
|
-
* Return the content DOM element.
|
|
431
|
-
* This is the element that will be used to display the rich-text content of the node.
|
|
432
|
-
*/
|
|
433
|
-
get contentDOM() {
|
|
434
|
-
if (this.node.isLeaf) {
|
|
435
|
-
return null;
|
|
436
|
-
}
|
|
437
|
-
return this.dom.querySelector('[data-node-view-content]');
|
|
438
|
-
}
|
|
439
|
-
/**
|
|
440
|
-
* On editor selection update, check if the node is selected.
|
|
441
|
-
* If it is, call `selectNode`, otherwise call `deselectNode`.
|
|
442
|
-
*/
|
|
443
|
-
handleSelectionUpdate() {
|
|
444
|
-
const { from, to } = this.editor.state.selection;
|
|
445
|
-
const pos = this.getPos();
|
|
446
|
-
if (typeof pos !== 'number') {
|
|
447
|
-
return;
|
|
448
|
-
}
|
|
449
|
-
if (from <= pos && to >= pos + this.node.nodeSize) {
|
|
450
|
-
if (this.renderer.props.selected) {
|
|
451
|
-
return;
|
|
452
|
-
}
|
|
453
|
-
this.selectNode();
|
|
454
|
-
}
|
|
455
|
-
else {
|
|
456
|
-
if (!this.renderer.props.selected) {
|
|
457
|
-
return;
|
|
458
|
-
}
|
|
459
|
-
this.deselectNode();
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
/**
|
|
463
|
-
* On update, update the React component.
|
|
464
|
-
* To prevent unnecessary updates, the `update` option can be used.
|
|
465
|
-
*/
|
|
466
|
-
update(node, decorations, innerDecorations) {
|
|
467
|
-
const rerenderComponent = (props) => {
|
|
468
|
-
this.decorationClasses.value = this.getDecorationClasses();
|
|
469
|
-
this.renderer.updateProps(props);
|
|
470
|
-
};
|
|
471
|
-
if (typeof this.options.update === 'function') {
|
|
472
|
-
const oldNode = this.node;
|
|
473
|
-
const oldDecorations = this.decorations;
|
|
474
|
-
const oldInnerDecorations = this.innerDecorations;
|
|
475
|
-
this.node = node;
|
|
476
|
-
this.decorations = decorations;
|
|
477
|
-
this.innerDecorations = innerDecorations;
|
|
478
|
-
return this.options.update({
|
|
479
|
-
oldNode,
|
|
480
|
-
oldDecorations,
|
|
481
|
-
newNode: node,
|
|
482
|
-
newDecorations: decorations,
|
|
483
|
-
oldInnerDecorations,
|
|
484
|
-
innerDecorations,
|
|
485
|
-
updateProps: () => rerenderComponent({ node, decorations, innerDecorations }),
|
|
486
|
-
});
|
|
487
|
-
}
|
|
488
|
-
if (node.type !== this.node.type) {
|
|
489
|
-
return false;
|
|
490
|
-
}
|
|
491
|
-
if (node === this.node && this.decorations === decorations && this.innerDecorations === innerDecorations) {
|
|
492
|
-
return true;
|
|
493
|
-
}
|
|
494
|
-
this.node = node;
|
|
495
|
-
this.decorations = decorations;
|
|
496
|
-
this.innerDecorations = innerDecorations;
|
|
497
|
-
rerenderComponent({ node, decorations, innerDecorations });
|
|
498
|
-
return true;
|
|
499
|
-
}
|
|
500
|
-
/**
|
|
501
|
-
* Select the node.
|
|
502
|
-
* Add the `selected` prop and the `ProseMirror-selectednode` class.
|
|
503
|
-
*/
|
|
504
|
-
selectNode() {
|
|
505
|
-
this.renderer.updateProps({
|
|
506
|
-
selected: true,
|
|
507
|
-
});
|
|
508
|
-
if (this.renderer.element) {
|
|
509
|
-
this.renderer.element.classList.add('ProseMirror-selectednode');
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
/**
|
|
513
|
-
* Deselect the node.
|
|
514
|
-
* Remove the `selected` prop and the `ProseMirror-selectednode` class.
|
|
515
|
-
*/
|
|
516
|
-
deselectNode() {
|
|
517
|
-
this.renderer.updateProps({
|
|
518
|
-
selected: false,
|
|
519
|
-
});
|
|
520
|
-
if (this.renderer.element) {
|
|
521
|
-
this.renderer.element.classList.remove('ProseMirror-selectednode');
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
getDecorationClasses() {
|
|
525
|
-
return (this.decorations
|
|
526
|
-
// @ts-ignore
|
|
527
|
-
.map(item => item.type.attrs.class)
|
|
528
|
-
.flat()
|
|
529
|
-
.join(' '));
|
|
530
|
-
}
|
|
531
|
-
destroy() {
|
|
532
|
-
this.renderer.destroy();
|
|
533
|
-
this.editor.off('selectionUpdate', this.handleSelectionUpdate);
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
function VueNodeViewRenderer(component, options) {
|
|
537
|
-
return props => {
|
|
538
|
-
// try to get the parent component
|
|
539
|
-
// this is important for vue devtools to show the component hierarchy correctly
|
|
540
|
-
// maybe it’s `undefined` because <editor-content> isn’t rendered yet
|
|
541
|
-
if (!props.editor.contentComponent) {
|
|
542
|
-
return {};
|
|
543
|
-
}
|
|
544
|
-
// check for class-component and normalize if neccessary
|
|
545
|
-
const normalizedComponent = typeof component === 'function' && '__vccOpts' in component
|
|
546
|
-
? component.__vccOpts
|
|
547
|
-
: component;
|
|
548
|
-
return new VueNodeView(normalizedComponent, props, options);
|
|
549
|
-
};
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
exports.BubbleMenu = BubbleMenu;
|
|
553
|
-
exports.Editor = Editor;
|
|
554
|
-
exports.EditorContent = EditorContent;
|
|
555
|
-
exports.FloatingMenu = FloatingMenu;
|
|
556
|
-
exports.NodeViewContent = NodeViewContent;
|
|
557
|
-
exports.NodeViewWrapper = NodeViewWrapper;
|
|
558
|
-
exports.VueNodeViewRenderer = VueNodeViewRenderer;
|
|
559
|
-
exports.VueRenderer = VueRenderer;
|
|
560
|
-
exports.nodeViewProps = nodeViewProps;
|
|
561
|
-
exports.useEditor = useEditor;
|
|
562
|
-
Object.keys(core).forEach(function (k) {
|
|
563
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
564
|
-
enumerable: true,
|
|
565
|
-
get: function () { return core[k]; }
|
|
566
|
-
});
|
|
567
|
-
});
|
|
568
|
-
|
|
569
|
-
}));
|
|
570
|
-
//# sourceMappingURL=index.umd.js.map
|
package/dist/index.umd.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../src/BubbleMenu.ts","../src/Editor.ts","../src/EditorContent.ts","../src/FloatingMenu.ts","../src/NodeViewContent.ts","../src/NodeViewWrapper.ts","../src/useEditor.ts","../src/VueRenderer.ts","../src/VueNodeViewRenderer.ts"],"sourcesContent":["import { BubbleMenuPlugin, BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu'\nimport {\n defineComponent,\n h,\n onBeforeUnmount,\n onMounted,\n PropType,\n ref,\n} from 'vue'\n\nexport const BubbleMenu = defineComponent({\n name: 'BubbleMenu',\n\n props: {\n pluginKey: {\n type: [String, Object] as PropType<BubbleMenuPluginProps['pluginKey']>,\n default: 'bubbleMenu',\n },\n\n editor: {\n type: Object as PropType<BubbleMenuPluginProps['editor']>,\n required: true,\n },\n\n updateDelay: {\n type: Number as PropType<BubbleMenuPluginProps['updateDelay']>,\n default: undefined,\n },\n\n tippyOptions: {\n type: Object as PropType<BubbleMenuPluginProps['tippyOptions']>,\n default: () => ({}),\n },\n\n shouldShow: {\n type: Function as PropType<Exclude<Required<BubbleMenuPluginProps>['shouldShow'], null>>,\n default: null,\n },\n },\n\n setup(props, { slots }) {\n const root = ref<HTMLElement | null>(null)\n\n onMounted(() => {\n const {\n updateDelay,\n editor,\n pluginKey,\n shouldShow,\n tippyOptions,\n } = props\n\n editor.registerPlugin(BubbleMenuPlugin({\n updateDelay,\n editor,\n element: root.value as HTMLElement,\n pluginKey,\n shouldShow,\n tippyOptions,\n }))\n })\n\n onBeforeUnmount(() => {\n const { pluginKey, editor } = props\n\n editor.unregisterPlugin(pluginKey)\n })\n\n return () => h('div', { ref: root }, slots.default?.())\n },\n})\n","/* eslint-disable react-hooks/rules-of-hooks */\nimport { Editor as CoreEditor, EditorOptions } from '@tiptap/core'\nimport { EditorState, Plugin, PluginKey } from '@tiptap/pm/state'\nimport {\n AppContext,\n ComponentInternalInstance,\n ComponentPublicInstance,\n customRef,\n markRaw,\n Ref,\n} from 'vue'\n\nfunction useDebouncedRef<T>(value: T) {\n return customRef<T>((track, trigger) => {\n return {\n get() {\n track()\n return value\n },\n set(newValue) {\n // update state\n value = newValue\n\n // update view as soon as possible\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n trigger()\n })\n })\n },\n }\n })\n}\n\nexport type ContentComponent = ComponentInternalInstance & {\n ctx: ComponentPublicInstance\n}\n\nexport class Editor extends CoreEditor {\n private reactiveState: Ref<EditorState>\n\n private reactiveExtensionStorage: Ref<Record<string, any>>\n\n public contentComponent: ContentComponent | null = null\n\n public appContext: AppContext | null = null\n\n constructor(options: Partial<EditorOptions> = {}) {\n super(options)\n\n this.reactiveState = useDebouncedRef(this.view.state)\n this.reactiveExtensionStorage = useDebouncedRef(this.extensionStorage)\n\n this.on('beforeTransaction', ({ nextState }) => {\n this.reactiveState.value = nextState\n this.reactiveExtensionStorage.value = this.extensionStorage\n })\n\n return markRaw(this) // eslint-disable-line\n }\n\n get state() {\n return this.reactiveState ? this.reactiveState.value : this.view.state\n }\n\n get storage() {\n return this.reactiveExtensionStorage ? this.reactiveExtensionStorage.value : super.storage\n }\n\n /**\n * Register a ProseMirror plugin.\n */\n public registerPlugin(\n plugin: Plugin,\n handlePlugins?: (newPlugin: Plugin, plugins: Plugin[]) => Plugin[],\n ): EditorState {\n const nextState = super.registerPlugin(plugin, handlePlugins)\n\n if (this.reactiveState) {\n this.reactiveState.value = nextState\n }\n\n return nextState\n }\n\n /**\n * Unregister a ProseMirror plugin.\n */\n public unregisterPlugin(nameOrPluginKey: string | PluginKey): EditorState | undefined {\n const nextState = super.unregisterPlugin(nameOrPluginKey)\n\n if (this.reactiveState && nextState) {\n this.reactiveState.value = nextState\n }\n\n return nextState\n }\n}\n","import {\n defineComponent,\n getCurrentInstance,\n h,\n nextTick,\n onBeforeUnmount,\n PropType,\n Ref,\n ref,\n unref,\n watchEffect,\n} from 'vue'\n\nimport { Editor } from './Editor.js'\n\nexport const EditorContent = defineComponent({\n name: 'EditorContent',\n\n props: {\n editor: {\n default: null,\n type: Object as PropType<Editor>,\n },\n },\n\n setup(props) {\n const rootEl: Ref<Element | undefined> = ref()\n const instance = getCurrentInstance()\n\n watchEffect(() => {\n const editor = props.editor\n\n if (editor && editor.options.element && rootEl.value) {\n nextTick(() => {\n if (!rootEl.value || !editor.options.element.firstChild) {\n return\n }\n\n const element = unref(rootEl.value)\n\n rootEl.value.append(...editor.options.element.childNodes)\n\n // @ts-ignore\n editor.contentComponent = instance.ctx._\n\n if (instance) {\n editor.appContext = {\n ...instance.appContext,\n // Vue internally uses prototype chain to forward/shadow injects across the entire component chain\n // so don't use object spread operator or 'Object.assign' and just set `provides` as is on editor's appContext\n // @ts-expect-error forward instance's 'provides' into appContext\n provides: instance.provides,\n }\n }\n\n editor.setOptions({\n element,\n })\n\n editor.createNodeViews()\n })\n }\n })\n\n onBeforeUnmount(() => {\n const editor = props.editor\n\n if (!editor) {\n return\n }\n\n editor.contentComponent = null\n editor.appContext = null\n })\n\n return { rootEl }\n },\n\n render() {\n return h(\n 'div',\n {\n ref: (el: any) => { this.rootEl = el },\n },\n )\n },\n})\n","import { FloatingMenuPlugin, FloatingMenuPluginProps } from '@tiptap/extension-floating-menu'\nimport {\n defineComponent,\n h,\n onBeforeUnmount,\n onMounted,\n PropType,\n ref,\n} from 'vue'\n\nexport const FloatingMenu = defineComponent({\n name: 'FloatingMenu',\n\n props: {\n pluginKey: {\n // TODO: TypeScript breaks :(\n // type: [String, Object as PropType<Exclude<FloatingMenuPluginProps['pluginKey'], string>>],\n type: null,\n default: 'floatingMenu',\n },\n\n editor: {\n type: Object as PropType<FloatingMenuPluginProps['editor']>,\n required: true,\n },\n\n tippyOptions: {\n type: Object as PropType<FloatingMenuPluginProps['tippyOptions']>,\n default: () => ({}),\n },\n\n shouldShow: {\n type: Function as PropType<Exclude<Required<FloatingMenuPluginProps>['shouldShow'], null>>,\n default: null,\n },\n },\n\n setup(props, { slots }) {\n const root = ref<HTMLElement | null>(null)\n\n onMounted(() => {\n const {\n pluginKey,\n editor,\n tippyOptions,\n shouldShow,\n } = props\n\n editor.registerPlugin(FloatingMenuPlugin({\n pluginKey,\n editor,\n element: root.value as HTMLElement,\n tippyOptions,\n shouldShow,\n }))\n })\n\n onBeforeUnmount(() => {\n const { pluginKey, editor } = props\n\n editor.unregisterPlugin(pluginKey)\n })\n\n return () => h('div', { ref: root }, slots.default?.())\n },\n})\n","import { defineComponent, h } from 'vue'\n\nexport const NodeViewContent = defineComponent({\n name: 'NodeViewContent',\n\n props: {\n as: {\n type: String,\n default: 'div',\n },\n },\n\n render() {\n return h(this.as, {\n style: {\n whiteSpace: 'pre-wrap',\n },\n 'data-node-view-content': '',\n })\n },\n})\n","import { defineComponent, h } from 'vue'\n\nexport const NodeViewWrapper = defineComponent({\n name: 'NodeViewWrapper',\n\n props: {\n as: {\n type: String,\n default: 'div',\n },\n },\n\n inject: ['onDragStart', 'decorationClasses'],\n\n render() {\n return h(\n this.as,\n {\n // @ts-ignore\n class: this.decorationClasses,\n style: {\n whiteSpace: 'normal',\n },\n 'data-node-view-wrapper': '',\n // @ts-ignore (https://github.com/vuejs/vue-next/issues/3031)\n onDragstart: this.onDragStart,\n },\n this.$slots.default?.(),\n )\n },\n})\n","import { EditorOptions } from '@tiptap/core'\nimport { onBeforeUnmount, onMounted, shallowRef } from 'vue'\n\nimport { Editor } from './Editor.js'\n\nexport const useEditor = (options: Partial<EditorOptions> = {}) => {\n const editor = shallowRef<Editor>()\n\n onMounted(() => {\n editor.value = new Editor(options)\n })\n\n onBeforeUnmount(() => {\n // Cloning root node (and its children) to avoid content being lost by destroy\n const nodes = editor.value?.options.element\n const newEl = nodes?.cloneNode(true) as HTMLElement\n\n nodes?.parentNode?.replaceChild(newEl, nodes)\n\n editor.value?.destroy()\n })\n\n return editor\n}\n","import { Editor } from '@tiptap/core'\nimport {\n Component, DefineComponent, h, markRaw, reactive, render,\n} from 'vue'\n\nimport { Editor as ExtendedEditor } from './Editor.js'\n\nexport interface VueRendererOptions {\n editor: Editor;\n props?: Record<string, any>;\n}\n\ntype ExtendedVNode = ReturnType<typeof h> | null;\n\ninterface RenderedComponent {\n vNode: ExtendedVNode;\n destroy: () => void;\n el: Element | null;\n}\n\n/**\n * This class is used to render Vue components inside the editor.\n */\nexport class VueRenderer {\n renderedComponent!: RenderedComponent\n\n editor: ExtendedEditor\n\n component: Component\n\n el: Element | null\n\n props: Record<string, any>\n\n constructor(component: Component, { props = {}, editor }: VueRendererOptions) {\n this.editor = editor as ExtendedEditor\n this.component = markRaw(component)\n this.el = document.createElement('div')\n this.props = reactive(props)\n this.renderedComponent = this.renderComponent()\n }\n\n get element(): Element | null {\n return this.renderedComponent.el\n }\n\n get ref(): any {\n // Composition API\n if (this.renderedComponent.vNode?.component?.exposed) {\n return this.renderedComponent.vNode.component.exposed\n }\n // Option API\n return this.renderedComponent.vNode?.component?.proxy\n }\n\n renderComponent() {\n let vNode: ExtendedVNode = h(this.component as DefineComponent, this.props)\n\n if (this.editor.appContext) {\n vNode.appContext = this.editor.appContext\n }\n if (typeof document !== 'undefined' && this.el) {\n render(vNode, this.el)\n }\n\n const destroy = () => {\n if (this.el) {\n render(null, this.el)\n }\n this.el = null\n vNode = null\n }\n\n return { vNode, destroy, el: this.el ? this.el.firstElementChild : null }\n }\n\n updateProps(props: Record<string, any> = {}): void {\n Object.entries(props).forEach(([key, value]) => {\n this.props[key] = value\n })\n this.renderComponent()\n }\n\n destroy(): void {\n this.renderedComponent.destroy()\n }\n}\n","/* eslint-disable no-underscore-dangle */\nimport {\n DecorationWithType,\n NodeView,\n NodeViewProps,\n NodeViewRenderer,\n NodeViewRendererOptions,\n} from '@tiptap/core'\nimport { Node as ProseMirrorNode } from '@tiptap/pm/model'\nimport { Decoration, DecorationSource, NodeView as ProseMirrorNodeView } from '@tiptap/pm/view'\nimport {\n Component, defineComponent, PropType, provide, Ref, ref,\n} from 'vue'\n\nimport { Editor } from './Editor.js'\nimport { VueRenderer } from './VueRenderer.js'\n\nexport const nodeViewProps = {\n editor: {\n type: Object as PropType<NodeViewProps['editor']>,\n required: true as const,\n },\n node: {\n type: Object as PropType<NodeViewProps['node']>,\n required: true as const,\n },\n decorations: {\n type: Object as PropType<NodeViewProps['decorations']>,\n required: true as const,\n },\n selected: {\n type: Boolean as PropType<NodeViewProps['selected']>,\n required: true as const,\n },\n extension: {\n type: Object as PropType<NodeViewProps['extension']>,\n required: true as const,\n },\n getPos: {\n type: Function as PropType<NodeViewProps['getPos']>,\n required: true as const,\n },\n updateAttributes: {\n type: Function as PropType<NodeViewProps['updateAttributes']>,\n required: true as const,\n },\n deleteNode: {\n type: Function as PropType<NodeViewProps['deleteNode']>,\n required: true as const,\n },\n view: {\n type: Object as PropType<NodeViewProps['view']>,\n required: true as const,\n },\n innerDecorations: {\n type: Object as PropType<NodeViewProps['innerDecorations']>,\n required: true as const,\n },\n HTMLAttributes: {\n type: Object as PropType<NodeViewProps['HTMLAttributes']>,\n required: true as const,\n },\n}\n\nexport interface VueNodeViewRendererOptions extends NodeViewRendererOptions {\n update:\n | ((props: {\n oldNode: ProseMirrorNode;\n oldDecorations: readonly Decoration[];\n oldInnerDecorations: DecorationSource;\n newNode: ProseMirrorNode;\n newDecorations: readonly Decoration[];\n innerDecorations: DecorationSource;\n updateProps: () => void;\n }) => boolean)\n | null;\n}\n\nclass VueNodeView extends NodeView<Component, Editor, VueNodeViewRendererOptions> {\n renderer!: VueRenderer\n\n decorationClasses!: Ref<string>\n\n mount() {\n const props = {\n editor: this.editor,\n node: this.node,\n decorations: this.decorations as DecorationWithType[],\n innerDecorations: this.innerDecorations,\n view: this.view,\n selected: false,\n extension: this.extension,\n HTMLAttributes: this.HTMLAttributes,\n getPos: () => this.getPos(),\n updateAttributes: (attributes = {}) => this.updateAttributes(attributes),\n deleteNode: () => this.deleteNode(),\n } satisfies NodeViewProps\n\n const onDragStart = this.onDragStart.bind(this)\n\n this.decorationClasses = ref(this.getDecorationClasses())\n\n const extendedComponent = defineComponent({\n extends: { ...this.component },\n props: Object.keys(props),\n template: (this.component as any).template,\n setup: reactiveProps => {\n provide('onDragStart', onDragStart)\n provide('decorationClasses', this.decorationClasses)\n\n return (this.component as any).setup?.(reactiveProps, {\n expose: () => undefined,\n })\n },\n // add support for scoped styles\n // @ts-ignore\n // eslint-disable-next-line\n __scopeId: this.component.__scopeId,\n // add support for CSS Modules\n // @ts-ignore\n // eslint-disable-next-line\n __cssModules: this.component.__cssModules,\n // add support for vue devtools\n // @ts-ignore\n // eslint-disable-next-line\n __name: this.component.__name,\n // @ts-ignore\n // eslint-disable-next-line\n __file: this.component.__file,\n })\n\n this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this)\n this.editor.on('selectionUpdate', this.handleSelectionUpdate)\n\n this.renderer = new VueRenderer(extendedComponent, {\n editor: this.editor,\n props,\n })\n }\n\n /**\n * Return the DOM element.\n * This is the element that will be used to display the node view.\n */\n get dom() {\n if (!this.renderer.element || !this.renderer.element.hasAttribute('data-node-view-wrapper')) {\n throw Error('Please use the NodeViewWrapper component for your node view.')\n }\n\n return this.renderer.element as HTMLElement\n }\n\n /**\n * Return the content DOM element.\n * This is the element that will be used to display the rich-text content of the node.\n */\n get contentDOM() {\n if (this.node.isLeaf) {\n return null\n }\n\n return this.dom.querySelector('[data-node-view-content]') as HTMLElement | null\n }\n\n /**\n * On editor selection update, check if the node is selected.\n * If it is, call `selectNode`, otherwise call `deselectNode`.\n */\n handleSelectionUpdate() {\n const { from, to } = this.editor.state.selection\n const pos = this.getPos()\n\n if (typeof pos !== 'number') {\n return\n }\n\n if (from <= pos && to >= pos + this.node.nodeSize) {\n if (this.renderer.props.selected) {\n return\n }\n\n this.selectNode()\n } else {\n if (!this.renderer.props.selected) {\n return\n }\n\n this.deselectNode()\n }\n }\n\n /**\n * On update, update the React component.\n * To prevent unnecessary updates, the `update` option can be used.\n */\n update(\n node: ProseMirrorNode,\n decorations: readonly Decoration[],\n innerDecorations: DecorationSource,\n ): boolean {\n const rerenderComponent = (props?: Record<string, any>) => {\n this.decorationClasses.value = this.getDecorationClasses()\n this.renderer.updateProps(props)\n }\n\n if (typeof this.options.update === 'function') {\n const oldNode = this.node\n const oldDecorations = this.decorations\n const oldInnerDecorations = this.innerDecorations\n\n this.node = node\n this.decorations = decorations\n this.innerDecorations = innerDecorations\n\n return this.options.update({\n oldNode,\n oldDecorations,\n newNode: node,\n newDecorations: decorations,\n oldInnerDecorations,\n innerDecorations,\n updateProps: () => rerenderComponent({ node, decorations, innerDecorations }),\n })\n }\n\n if (node.type !== this.node.type) {\n return false\n }\n\n if (node === this.node && this.decorations === decorations && this.innerDecorations === innerDecorations) {\n return true\n }\n\n this.node = node\n this.decorations = decorations\n this.innerDecorations = innerDecorations\n\n rerenderComponent({ node, decorations, innerDecorations })\n\n return true\n }\n\n /**\n * Select the node.\n * Add the `selected` prop and the `ProseMirror-selectednode` class.\n */\n selectNode() {\n this.renderer.updateProps({\n selected: true,\n })\n if (this.renderer.element) {\n this.renderer.element.classList.add('ProseMirror-selectednode')\n }\n }\n\n /**\n * Deselect the node.\n * Remove the `selected` prop and the `ProseMirror-selectednode` class.\n */\n deselectNode() {\n this.renderer.updateProps({\n selected: false,\n })\n if (this.renderer.element) {\n this.renderer.element.classList.remove('ProseMirror-selectednode')\n }\n }\n\n getDecorationClasses() {\n return (\n this.decorations\n // @ts-ignore\n .map(item => item.type.attrs.class)\n .flat()\n .join(' ')\n )\n }\n\n destroy() {\n this.renderer.destroy()\n this.editor.off('selectionUpdate', this.handleSelectionUpdate)\n }\n}\n\nexport function VueNodeViewRenderer(\n component: Component<NodeViewProps>,\n options?: Partial<VueNodeViewRendererOptions>,\n): NodeViewRenderer {\n return props => {\n // try to get the parent component\n // this is important for vue devtools to show the component hierarchy correctly\n // maybe it’s `undefined` because <editor-content> isn’t rendered yet\n if (!(props.editor as Editor).contentComponent) {\n return {} as unknown as ProseMirrorNodeView\n }\n // check for class-component and normalize if neccessary\n const normalizedComponent = typeof component === 'function' && '__vccOpts' in component\n ? (component.__vccOpts as Component)\n : component\n\n return new VueNodeView(normalizedComponent, props, options)\n }\n}\n"],"names":["defineComponent","ref","onMounted","BubbleMenuPlugin","onBeforeUnmount","h","customRef","CoreEditor","markRaw","getCurrentInstance","watchEffect","nextTick","unref","FloatingMenuPlugin","shallowRef","reactive","render","NodeView","provide"],"mappings":";;;;;;AAUO,QAAM,UAAU,GAAGA,mBAAe,CAAC;EACxC,IAAA,IAAI,EAAE,YAAY;EAElB,IAAA,K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