@tiptap/vue-2 2.0.0-beta.17 → 2.0.0-beta.194
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-2/src/BubbleMenu.d.ts +9 -5
- package/dist/packages/vue-2/src/EditorContent.d.ts +4 -3
- package/dist/packages/vue-2/src/FloatingMenu.d.ts +9 -4
- package/dist/packages/vue-2/src/NodeViewContent.d.ts +4 -3
- package/dist/packages/vue-2/src/NodeViewWrapper.d.ts +8 -3
- package/dist/packages/vue-2/src/VueNodeViewRenderer.d.ts +26 -20
- package/dist/packages/vue-2/src/VueRenderer.d.ts +1 -2
- package/dist/packages/vue-2/src/index.d.ts +4 -4
- package/dist/tiptap-vue-2.cjs.js +122 -74
- package/dist/tiptap-vue-2.cjs.js.map +1 -1
- package/dist/tiptap-vue-2.esm.js +120 -70
- package/dist/tiptap-vue-2.esm.js.map +1 -1
- package/dist/tiptap-vue-2.umd.js +125 -77
- package/dist/tiptap-vue-2.umd.js.map +1 -1
- package/package.json +15 -8
- package/src/BubbleMenu.ts +31 -12
- package/src/EditorContent.ts +16 -8
- package/src/FloatingMenu.ts +33 -8
- package/src/NodeViewContent.ts +15 -13
- package/src/NodeViewWrapper.ts +14 -7
- package/src/VueNodeViewRenderer.ts +52 -20
- package/src/VueRenderer.ts +8 -6
- package/src/index.ts +4 -4
- package/CHANGELOG.md +0 -144
- package/LICENSE.md +0 -21
- package/dist/tiptap-vue-2.bundle.umd.min.js +0 -2
- package/dist/tiptap-vue-2.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 sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap
|
|
14
|
+
tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md).
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu';
|
|
2
|
+
import Vue, { Component } from 'vue';
|
|
3
|
+
export interface BubbleMenuInterface extends Vue {
|
|
4
|
+
pluginKey: BubbleMenuPluginProps['pluginKey'];
|
|
5
|
+
editor: BubbleMenuPluginProps['editor'];
|
|
6
|
+
tippyOptions: BubbleMenuPluginProps['tippyOptions'];
|
|
7
|
+
shouldShow: BubbleMenuPluginProps['shouldShow'];
|
|
8
|
+
}
|
|
9
|
+
export declare const BubbleMenu: Component;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import Vue from 'vue';
|
|
1
|
+
import Vue, { Component } from 'vue';
|
|
2
2
|
import { Editor } from './Editor';
|
|
3
|
-
export
|
|
3
|
+
export interface EditorContentInterface extends Vue {
|
|
4
4
|
editor: Editor;
|
|
5
|
-
}
|
|
5
|
+
}
|
|
6
|
+
export declare const EditorContent: Component;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { FloatingMenuPluginProps } from '@tiptap/extension-floating-menu';
|
|
2
|
+
import Vue, { Component } from 'vue';
|
|
3
|
+
export interface FloatingMenuInterface extends Vue {
|
|
4
|
+
pluginKey: FloatingMenuPluginProps['pluginKey'];
|
|
5
|
+
tippyOptions: FloatingMenuPluginProps['tippyOptions'];
|
|
6
|
+
editor: FloatingMenuPluginProps['editor'];
|
|
7
|
+
shouldShow: FloatingMenuPluginProps['shouldShow'];
|
|
8
|
+
}
|
|
9
|
+
export declare const FloatingMenu: Component;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import Vue from 'vue';
|
|
2
|
-
export
|
|
1
|
+
import Vue, { Component } from 'vue';
|
|
2
|
+
export interface NodeViewContentInterface extends Vue {
|
|
3
3
|
as: string;
|
|
4
|
-
}
|
|
4
|
+
}
|
|
5
|
+
export declare const NodeViewContent: Component;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import Vue from 'vue';
|
|
2
|
-
export
|
|
1
|
+
import Vue, { Component } from 'vue';
|
|
2
|
+
export interface NodeViewWrapperInterface extends Vue {
|
|
3
3
|
as: string;
|
|
4
|
-
|
|
4
|
+
decorationClasses: {
|
|
5
|
+
value: string;
|
|
6
|
+
};
|
|
7
|
+
onDragStart: Function;
|
|
8
|
+
}
|
|
9
|
+
export declare const NodeViewWrapper: Component;
|
|
@@ -1,43 +1,49 @@
|
|
|
1
|
-
import { NodeViewRenderer } from '@tiptap/core';
|
|
2
|
-
import { Decoration } from 'prosemirror-view';
|
|
1
|
+
import { NodeViewRenderer, NodeViewRendererOptions } from '@tiptap/core';
|
|
3
2
|
import { Node as ProseMirrorNode } from 'prosemirror-model';
|
|
3
|
+
import { Decoration } from 'prosemirror-view';
|
|
4
4
|
import Vue from 'vue';
|
|
5
|
-
import {
|
|
5
|
+
import { PropType, VueConstructor } from 'vue/types/umd';
|
|
6
6
|
export declare const nodeViewProps: {
|
|
7
7
|
editor: {
|
|
8
8
|
type: PropType<import("@tiptap/core").Editor>;
|
|
9
|
-
required:
|
|
9
|
+
required: true;
|
|
10
10
|
};
|
|
11
11
|
node: {
|
|
12
|
-
type: PropType<ProseMirrorNode
|
|
13
|
-
required:
|
|
12
|
+
type: PropType<ProseMirrorNode>;
|
|
13
|
+
required: true;
|
|
14
14
|
};
|
|
15
15
|
decorations: {
|
|
16
|
-
type: PropType<Decoration
|
|
17
|
-
|
|
18
|
-
}>[]>;
|
|
19
|
-
required: boolean;
|
|
16
|
+
type: PropType<Decoration[]>;
|
|
17
|
+
required: true;
|
|
20
18
|
};
|
|
21
19
|
selected: {
|
|
22
20
|
type: PropType<boolean>;
|
|
23
|
-
required:
|
|
21
|
+
required: true;
|
|
24
22
|
};
|
|
25
23
|
extension: {
|
|
26
|
-
type: PropType<import("@tiptap/core").Node<any>>;
|
|
27
|
-
required:
|
|
24
|
+
type: PropType<import("@tiptap/core").Node<any, any>>;
|
|
25
|
+
required: true;
|
|
28
26
|
};
|
|
29
27
|
getPos: {
|
|
30
28
|
type: PropType<() => number>;
|
|
31
|
-
required:
|
|
29
|
+
required: true;
|
|
32
30
|
};
|
|
33
31
|
updateAttributes: {
|
|
34
|
-
type: PropType<(attributes:
|
|
35
|
-
required:
|
|
32
|
+
type: PropType<(attributes: Record<string, any>) => void>;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
deleteNode: {
|
|
36
|
+
type: PropType<() => void>;
|
|
37
|
+
required: true;
|
|
36
38
|
};
|
|
37
39
|
};
|
|
38
|
-
interface VueNodeViewRendererOptions {
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
export interface VueNodeViewRendererOptions extends NodeViewRendererOptions {
|
|
41
|
+
update: ((props: {
|
|
42
|
+
oldNode: ProseMirrorNode;
|
|
43
|
+
oldDecorations: Decoration[];
|
|
44
|
+
newNode: ProseMirrorNode;
|
|
45
|
+
newDecorations: Decoration[];
|
|
46
|
+
updateProps: () => void;
|
|
47
|
+
}) => boolean) | null;
|
|
41
48
|
}
|
|
42
49
|
export declare function VueNodeViewRenderer(component: Vue | VueConstructor, options?: Partial<VueNodeViewRendererOptions>): NodeViewRenderer;
|
|
43
|
-
export {};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import Vue from 'vue';
|
|
2
|
-
import { AnyObject } from '@tiptap/core';
|
|
3
2
|
import { VueConstructor } from 'vue/types/umd';
|
|
4
3
|
export declare class VueRenderer {
|
|
5
4
|
ref: Vue;
|
|
6
5
|
constructor(component: Vue | VueConstructor, props: any);
|
|
7
6
|
get element(): Element;
|
|
8
|
-
updateProps(props?:
|
|
7
|
+
updateProps(props?: Record<string, any>): void;
|
|
9
8
|
destroy(): void;
|
|
10
9
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
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';
|
|
6
|
-
export * from './VueRenderer';
|
|
7
|
-
export * from './VueNodeViewRenderer';
|
|
8
|
-
export * from './NodeViewWrapper';
|
|
9
5
|
export * from './NodeViewContent';
|
|
6
|
+
export * from './NodeViewWrapper';
|
|
7
|
+
export * from './VueNodeViewRenderer';
|
|
8
|
+
export * from './VueRenderer';
|
|
9
|
+
export * from '@tiptap/core';
|
package/dist/tiptap-vue-2.cjs.js
CHANGED
|
@@ -2,25 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var core = require('@tiptap/core');
|
|
6
|
-
var Vue = require('vue');
|
|
7
5
|
var extensionBubbleMenu = require('@tiptap/extension-bubble-menu');
|
|
6
|
+
var core = require('@tiptap/core');
|
|
8
7
|
var extensionFloatingMenu = require('@tiptap/extension-floating-menu');
|
|
8
|
+
var Vue = require('vue');
|
|
9
9
|
|
|
10
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
11
|
|
|
12
12
|
var Vue__default = /*#__PURE__*/_interopDefaultLegacy(Vue);
|
|
13
13
|
|
|
14
|
-
const BubbleMenu =
|
|
14
|
+
const BubbleMenu = {
|
|
15
15
|
name: 'BubbleMenu',
|
|
16
16
|
props: {
|
|
17
|
+
pluginKey: {
|
|
18
|
+
type: [String, Object],
|
|
19
|
+
default: 'bubbleMenu',
|
|
20
|
+
},
|
|
17
21
|
editor: {
|
|
18
22
|
type: Object,
|
|
19
23
|
required: true,
|
|
20
24
|
},
|
|
21
|
-
|
|
22
|
-
type:
|
|
23
|
-
default:
|
|
25
|
+
tippyOptions: {
|
|
26
|
+
type: Object,
|
|
27
|
+
default: () => ({}),
|
|
28
|
+
},
|
|
29
|
+
shouldShow: {
|
|
30
|
+
type: Function,
|
|
31
|
+
default: null,
|
|
24
32
|
},
|
|
25
33
|
},
|
|
26
34
|
watch: {
|
|
@@ -32,9 +40,11 @@ const BubbleMenu = Vue__default['default'].extend({
|
|
|
32
40
|
}
|
|
33
41
|
this.$nextTick(() => {
|
|
34
42
|
editor.registerPlugin(extensionBubbleMenu.BubbleMenuPlugin({
|
|
43
|
+
pluginKey: this.pluginKey,
|
|
35
44
|
editor,
|
|
36
45
|
element: this.$el,
|
|
37
|
-
|
|
46
|
+
tippyOptions: this.tippyOptions,
|
|
47
|
+
shouldShow: this.shouldShow,
|
|
38
48
|
}));
|
|
39
49
|
});
|
|
40
50
|
},
|
|
@@ -44,9 +54,9 @@ const BubbleMenu = Vue__default['default'].extend({
|
|
|
44
54
|
return createElement('div', { style: { visibility: 'hidden' } }, this.$slots.default);
|
|
45
55
|
},
|
|
46
56
|
beforeDestroy() {
|
|
47
|
-
this.editor.unregisterPlugin(
|
|
57
|
+
this.editor.unregisterPlugin(this.pluginKey);
|
|
48
58
|
},
|
|
49
|
-
}
|
|
59
|
+
};
|
|
50
60
|
|
|
51
61
|
class Editor extends core.Editor {
|
|
52
62
|
constructor() {
|
|
@@ -55,7 +65,7 @@ class Editor extends core.Editor {
|
|
|
55
65
|
}
|
|
56
66
|
}
|
|
57
67
|
|
|
58
|
-
const EditorContent =
|
|
68
|
+
const EditorContent = {
|
|
59
69
|
name: 'EditorContent',
|
|
60
70
|
props: {
|
|
61
71
|
editor: {
|
|
@@ -73,7 +83,7 @@ const EditorContent = Vue__default['default'].extend({
|
|
|
73
83
|
if (!element || !editor.options.element.firstChild) {
|
|
74
84
|
return;
|
|
75
85
|
}
|
|
76
|
-
element.
|
|
86
|
+
element.append(...editor.options.element.childNodes);
|
|
77
87
|
editor.contentComponent = this;
|
|
78
88
|
editor.setOptions({
|
|
79
89
|
element,
|
|
@@ -89,6 +99,9 @@ const EditorContent = Vue__default['default'].extend({
|
|
|
89
99
|
},
|
|
90
100
|
beforeDestroy() {
|
|
91
101
|
const { editor } = this;
|
|
102
|
+
if (!editor) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
92
105
|
if (!editor.isDestroyed) {
|
|
93
106
|
editor.view.setProps({
|
|
94
107
|
nodeViews: {},
|
|
@@ -99,20 +112,32 @@ const EditorContent = Vue__default['default'].extend({
|
|
|
99
112
|
return;
|
|
100
113
|
}
|
|
101
114
|
const newElement = document.createElement('div');
|
|
102
|
-
newElement.
|
|
115
|
+
newElement.append(...editor.options.element.childNodes);
|
|
103
116
|
editor.setOptions({
|
|
104
117
|
element: newElement,
|
|
105
118
|
});
|
|
106
119
|
},
|
|
107
|
-
}
|
|
120
|
+
};
|
|
108
121
|
|
|
109
|
-
const FloatingMenu =
|
|
122
|
+
const FloatingMenu = {
|
|
110
123
|
name: 'FloatingMenu',
|
|
111
124
|
props: {
|
|
125
|
+
pluginKey: {
|
|
126
|
+
type: [String, Object],
|
|
127
|
+
default: 'floatingMenu',
|
|
128
|
+
},
|
|
112
129
|
editor: {
|
|
113
130
|
type: Object,
|
|
114
131
|
required: true,
|
|
115
132
|
},
|
|
133
|
+
tippyOptions: {
|
|
134
|
+
type: Object,
|
|
135
|
+
default: () => ({}),
|
|
136
|
+
},
|
|
137
|
+
shouldShow: {
|
|
138
|
+
type: Function,
|
|
139
|
+
default: null,
|
|
140
|
+
},
|
|
116
141
|
},
|
|
117
142
|
watch: {
|
|
118
143
|
editor: {
|
|
@@ -123,8 +148,11 @@ const FloatingMenu = Vue__default['default'].extend({
|
|
|
123
148
|
}
|
|
124
149
|
this.$nextTick(() => {
|
|
125
150
|
editor.registerPlugin(extensionFloatingMenu.FloatingMenuPlugin({
|
|
151
|
+
pluginKey: this.pluginKey,
|
|
126
152
|
editor,
|
|
127
153
|
element: this.$el,
|
|
154
|
+
tippyOptions: this.tippyOptions,
|
|
155
|
+
shouldShow: this.shouldShow,
|
|
128
156
|
}));
|
|
129
157
|
});
|
|
130
158
|
},
|
|
@@ -134,31 +162,77 @@ const FloatingMenu = Vue__default['default'].extend({
|
|
|
134
162
|
return createElement('div', { style: { visibility: 'hidden' } }, this.$slots.default);
|
|
135
163
|
},
|
|
136
164
|
beforeDestroy() {
|
|
137
|
-
this.editor.unregisterPlugin(
|
|
165
|
+
this.editor.unregisterPlugin(this.pluginKey);
|
|
138
166
|
},
|
|
139
|
-
}
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
const NodeViewContent = {
|
|
170
|
+
props: {
|
|
171
|
+
as: {
|
|
172
|
+
type: String,
|
|
173
|
+
default: 'div',
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
render(createElement) {
|
|
177
|
+
return createElement(this.as, {
|
|
178
|
+
style: {
|
|
179
|
+
whiteSpace: 'pre-wrap',
|
|
180
|
+
},
|
|
181
|
+
attrs: {
|
|
182
|
+
'data-node-view-content': '',
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
const NodeViewWrapper = {
|
|
189
|
+
props: {
|
|
190
|
+
as: {
|
|
191
|
+
type: String,
|
|
192
|
+
default: 'div',
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
inject: ['onDragStart', 'decorationClasses'],
|
|
196
|
+
render(createElement) {
|
|
197
|
+
return createElement(this.as, {
|
|
198
|
+
class: this.decorationClasses.value,
|
|
199
|
+
style: {
|
|
200
|
+
whiteSpace: 'normal',
|
|
201
|
+
},
|
|
202
|
+
attrs: {
|
|
203
|
+
'data-node-view-wrapper': '',
|
|
204
|
+
},
|
|
205
|
+
on: {
|
|
206
|
+
dragstart: this.onDragStart,
|
|
207
|
+
},
|
|
208
|
+
}, this.$slots.default);
|
|
209
|
+
},
|
|
210
|
+
};
|
|
140
211
|
|
|
141
212
|
class VueRenderer {
|
|
142
213
|
constructor(component, props) {
|
|
143
|
-
const Component = Vue__default[
|
|
214
|
+
const Component = (typeof component === 'function') ? component : Vue__default["default"].extend(component);
|
|
144
215
|
this.ref = new Component(props).$mount();
|
|
145
216
|
}
|
|
146
217
|
get element() {
|
|
147
218
|
return this.ref.$el;
|
|
148
219
|
}
|
|
149
220
|
updateProps(props = {}) {
|
|
221
|
+
var _a, _b, _c;
|
|
150
222
|
if (!this.ref.$props) {
|
|
151
223
|
return;
|
|
152
224
|
}
|
|
153
225
|
// prevents `Avoid mutating a prop directly` error message
|
|
154
|
-
|
|
155
|
-
Vue__default[
|
|
226
|
+
// Fix: `VueNodeViewRenderer` change vue Constructor `config.silent` not working
|
|
227
|
+
const currentVueConstructor = (_c = (_b = (_a = this.ref.$props.editor) === null || _a === void 0 ? void 0 : _a.contentComponent) === null || _b === void 0 ? void 0 : _b.$options._base) !== null && _c !== void 0 ? _c : Vue__default["default"]; // eslint-disable-line
|
|
228
|
+
const originalSilent = currentVueConstructor.config.silent;
|
|
229
|
+
currentVueConstructor.config.silent = true;
|
|
156
230
|
Object
|
|
157
231
|
.entries(props)
|
|
158
232
|
.forEach(([key, value]) => {
|
|
159
233
|
this.ref.$props[key] = value;
|
|
160
234
|
});
|
|
161
|
-
|
|
235
|
+
currentVueConstructor.config.silent = originalSilent;
|
|
162
236
|
}
|
|
163
237
|
destroy() {
|
|
164
238
|
this.ref.$destroy();
|
|
@@ -194,9 +268,14 @@ const nodeViewProps = {
|
|
|
194
268
|
type: Function,
|
|
195
269
|
required: true,
|
|
196
270
|
},
|
|
271
|
+
deleteNode: {
|
|
272
|
+
type: Function,
|
|
273
|
+
required: true,
|
|
274
|
+
},
|
|
197
275
|
};
|
|
198
276
|
class VueNodeView extends core.NodeView {
|
|
199
277
|
mount() {
|
|
278
|
+
var _a, _b;
|
|
200
279
|
const props = {
|
|
201
280
|
editor: this.editor,
|
|
202
281
|
node: this.node,
|
|
@@ -205,12 +284,15 @@ class VueNodeView extends core.NodeView {
|
|
|
205
284
|
extension: this.extension,
|
|
206
285
|
getPos: () => this.getPos(),
|
|
207
286
|
updateAttributes: (attributes = {}) => this.updateAttributes(attributes),
|
|
287
|
+
deleteNode: () => this.deleteNode(),
|
|
208
288
|
};
|
|
209
289
|
const onDragStart = this.onDragStart.bind(this);
|
|
210
|
-
this.decorationClasses = Vue__default[
|
|
290
|
+
this.decorationClasses = Vue__default["default"].observable({
|
|
211
291
|
value: this.getDecorationClasses(),
|
|
212
292
|
});
|
|
213
|
-
|
|
293
|
+
// @ts-ignore
|
|
294
|
+
const vue = (_b = (_a = this.editor.contentComponent) === null || _a === void 0 ? void 0 : _a.$options._base) !== null && _b !== void 0 ? _b : Vue__default["default"]; // eslint-disable-line
|
|
295
|
+
const Component = vue
|
|
214
296
|
.extend(this.component)
|
|
215
297
|
.extend({
|
|
216
298
|
props: Object.keys(props),
|
|
@@ -237,11 +319,25 @@ class VueNodeView extends core.NodeView {
|
|
|
237
319
|
return null;
|
|
238
320
|
}
|
|
239
321
|
const contentElement = this.dom.querySelector('[data-node-view-content]');
|
|
240
|
-
return contentElement || this.dom;
|
|
322
|
+
return (contentElement || this.dom);
|
|
241
323
|
}
|
|
242
324
|
update(node, decorations) {
|
|
325
|
+
const updateProps = (props) => {
|
|
326
|
+
this.decorationClasses.value = this.getDecorationClasses();
|
|
327
|
+
this.renderer.updateProps(props);
|
|
328
|
+
};
|
|
243
329
|
if (typeof this.options.update === 'function') {
|
|
244
|
-
|
|
330
|
+
const oldNode = this.node;
|
|
331
|
+
const oldDecorations = this.decorations;
|
|
332
|
+
this.node = node;
|
|
333
|
+
this.decorations = decorations;
|
|
334
|
+
return this.options.update({
|
|
335
|
+
oldNode,
|
|
336
|
+
oldDecorations,
|
|
337
|
+
newNode: node,
|
|
338
|
+
newDecorations: decorations,
|
|
339
|
+
updateProps: () => updateProps({ node, decorations }),
|
|
340
|
+
});
|
|
245
341
|
}
|
|
246
342
|
if (node.type !== this.node.type) {
|
|
247
343
|
return false;
|
|
@@ -251,8 +347,7 @@ class VueNodeView extends core.NodeView {
|
|
|
251
347
|
}
|
|
252
348
|
this.node = node;
|
|
253
349
|
this.decorations = decorations;
|
|
254
|
-
|
|
255
|
-
this.renderer.updateProps({ node, decorations });
|
|
350
|
+
updateProps({ node, decorations });
|
|
256
351
|
return true;
|
|
257
352
|
}
|
|
258
353
|
selectNode() {
|
|
@@ -288,51 +383,6 @@ function VueNodeViewRenderer(component, options) {
|
|
|
288
383
|
};
|
|
289
384
|
}
|
|
290
385
|
|
|
291
|
-
const NodeViewWrapper = Vue__default['default'].extend({
|
|
292
|
-
props: {
|
|
293
|
-
as: {
|
|
294
|
-
type: String,
|
|
295
|
-
default: 'div',
|
|
296
|
-
},
|
|
297
|
-
},
|
|
298
|
-
inject: ['onDragStart', 'decorationClasses'],
|
|
299
|
-
render(createElement) {
|
|
300
|
-
return createElement(this.as, {
|
|
301
|
-
// @ts-ignore
|
|
302
|
-
class: this.decorationClasses.value,
|
|
303
|
-
style: {
|
|
304
|
-
whiteSpace: 'normal',
|
|
305
|
-
},
|
|
306
|
-
attrs: {
|
|
307
|
-
'data-node-view-wrapper': '',
|
|
308
|
-
},
|
|
309
|
-
on: {
|
|
310
|
-
// @ts-ignore
|
|
311
|
-
dragstart: this.onDragStart,
|
|
312
|
-
},
|
|
313
|
-
}, this.$slots.default);
|
|
314
|
-
},
|
|
315
|
-
});
|
|
316
|
-
|
|
317
|
-
const NodeViewContent = Vue__default['default'].extend({
|
|
318
|
-
props: {
|
|
319
|
-
as: {
|
|
320
|
-
type: String,
|
|
321
|
-
default: 'div',
|
|
322
|
-
},
|
|
323
|
-
},
|
|
324
|
-
render(createElement) {
|
|
325
|
-
return createElement(this.as, {
|
|
326
|
-
style: {
|
|
327
|
-
whiteSpace: 'pre-wrap',
|
|
328
|
-
},
|
|
329
|
-
attrs: {
|
|
330
|
-
'data-node-view-content': '',
|
|
331
|
-
},
|
|
332
|
-
});
|
|
333
|
-
},
|
|
334
|
-
});
|
|
335
|
-
|
|
336
386
|
exports.BubbleMenu = BubbleMenu;
|
|
337
387
|
exports.Editor = Editor;
|
|
338
388
|
exports.EditorContent = EditorContent;
|
|
@@ -345,9 +395,7 @@ exports.nodeViewProps = nodeViewProps;
|
|
|
345
395
|
Object.keys(core).forEach(function (k) {
|
|
346
396
|
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
347
397
|
enumerable: true,
|
|
348
|
-
get: function () {
|
|
349
|
-
return core[k];
|
|
350
|
-
}
|
|
398
|
+
get: function () { return core[k]; }
|
|
351
399
|
});
|
|
352
400
|
});
|
|
353
401
|
//# sourceMappingURL=tiptap-vue-2.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiptap-vue-2.cjs.js","sources":["../src/BubbleMenu.ts","../src/Editor.ts","../src/EditorContent.ts","../src/FloatingMenu.ts","../src/VueRenderer.ts","../src/VueNodeViewRenderer.ts","../src/NodeViewWrapper.ts","../src/NodeViewContent.ts"],"sourcesContent":["import Vue, { PropType } from 'vue'\nimport { BubbleMenuPlugin, BubbleMenuPluginKey, BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu'\n\nexport const BubbleMenu = Vue.extend({\n name: 'BubbleMenu',\n\n props: {\n editor: {\n type: Object as PropType<BubbleMenuPluginProps['editor']>,\n required: true,\n },\n\n keepInBounds: {\n type: Boolean as PropType<BubbleMenuPluginProps['keepInBounds']>,\n default: true,\n },\n },\n\n watch: {\n editor: {\n immediate: true,\n handler(editor: BubbleMenuPluginProps['editor']) {\n if (!editor) {\n return\n }\n\n this.$nextTick(() => {\n editor.registerPlugin(BubbleMenuPlugin({\n editor,\n element: this.$el as HTMLElement,\n keepInBounds: this.keepInBounds,\n }))\n })\n },\n },\n },\n\n render(createElement) {\n return createElement('div', { style: { visibility: 'hidden' } }, this.$slots.default)\n },\n\n beforeDestroy() {\n this.editor.unregisterPlugin(BubbleMenuPluginKey)\n },\n})\n","import { Editor as CoreEditor } from '@tiptap/core'\nimport Vue from 'vue'\n\nexport class Editor extends CoreEditor {\n public contentComponent: Vue | null = null\n}\n","import Vue, { PropType } from 'vue'\nimport { Editor } from './Editor'\n\nexport const EditorContent = Vue.extend({\n name: 'EditorContent',\n\n props: {\n editor: {\n default: null,\n type: Object as PropType<Editor>,\n },\n },\n\n watch: {\n editor: {\n immediate: true,\n handler(editor: Editor) {\n if (editor && editor.options.element) {\n this.$nextTick(() => {\n const element = this.$el\n\n if (!element || !editor.options.element.firstChild) {\n return\n }\n\n element.appendChild(editor.options.element.firstChild)\n\n editor.contentComponent = this\n\n editor.setOptions({\n element,\n })\n\n editor.createNodeViews()\n })\n }\n },\n },\n },\n\n render(createElement) {\n return createElement('div')\n },\n\n beforeDestroy() {\n const { editor } = this\n\n if (!editor.isDestroyed) {\n editor.view.setProps({\n nodeViews: {},\n })\n }\n\n editor.contentComponent = null\n\n if (!editor.options.element.firstChild) {\n return\n }\n\n const newElement = document.createElement('div')\n\n newElement.appendChild(editor.options.element.firstChild)\n\n editor.setOptions({\n element: newElement,\n })\n },\n})\n","import Vue, { PropType } from 'vue'\nimport { FloatingMenuPlugin, FloatingMenuPluginKey, FloatingMenuPluginProps } from '@tiptap/extension-floating-menu'\n\nexport const FloatingMenu = Vue.extend({\n name: 'FloatingMenu',\n\n props: {\n editor: {\n type: Object as PropType<FloatingMenuPluginProps['editor']>,\n required: true,\n },\n },\n\n watch: {\n editor: {\n immediate: true,\n handler(editor: FloatingMenuPluginProps['editor']) {\n if (!editor) {\n return\n }\n\n this.$nextTick(() => {\n editor.registerPlugin(FloatingMenuPlugin({\n editor,\n element: this.$el as HTMLElement,\n }))\n })\n },\n },\n },\n\n render(createElement) {\n return createElement('div', { style: { visibility: 'hidden' } }, this.$slots.default)\n },\n\n beforeDestroy() {\n this.editor.unregisterPlugin(FloatingMenuPluginKey)\n },\n})\n","import Vue from 'vue'\nimport { AnyObject } from '@tiptap/core'\nimport { VueConstructor } from 'vue/types/umd'\n\nexport class VueRenderer {\n ref!: Vue\n\n constructor(component: Vue | VueConstructor, props: any) {\n const Component = Vue.extend(component)\n\n this.ref = new Component(props).$mount()\n }\n\n get element(): Element {\n return this.ref.$el\n }\n\n updateProps(props: AnyObject = {}): void {\n if (!this.ref.$props) {\n return\n }\n\n // prevents `Avoid mutating a prop directly` error message\n const originalSilent = Vue.config.silent\n Vue.config.silent = true\n\n Object\n .entries(props)\n .forEach(([key, value]) => {\n this.ref.$props[key] = value\n })\n\n Vue.config.silent = originalSilent\n }\n\n destroy(): void {\n this.ref.$destroy()\n }\n}\n","import {\n NodeView,\n NodeViewProps,\n NodeViewRenderer,\n NodeViewRendererProps,\n} from '@tiptap/core'\nimport { Decoration, NodeView as ProseMirrorNodeView } from 'prosemirror-view'\nimport { Node as ProseMirrorNode } from 'prosemirror-model'\nimport Vue from 'vue'\nimport { VueConstructor, PropType } from 'vue/types/umd'\nimport { Editor } from './Editor'\nimport { VueRenderer } from './VueRenderer'\n\nexport const nodeViewProps = {\n editor: {\n type: Object as PropType<NodeViewProps['editor']>,\n required: true,\n },\n node: {\n type: Object as PropType<NodeViewProps['node']>,\n required: true,\n },\n decorations: {\n type: Object as PropType<NodeViewProps['decorations']>,\n required: true,\n },\n selected: {\n type: Boolean as PropType<NodeViewProps['selected']>,\n required: true,\n },\n extension: {\n type: Object as PropType<NodeViewProps['extension']>,\n required: true,\n },\n getPos: {\n type: Function as PropType<NodeViewProps['getPos']>,\n required: true,\n },\n updateAttributes: {\n type: Function as PropType<NodeViewProps['updateAttributes']>,\n required: true,\n },\n}\n\ninterface VueNodeViewRendererOptions {\n stopEvent: ((event: Event) => boolean) | null,\n update: ((node: ProseMirrorNode, decorations: Decoration[]) => boolean) | null,\n}\n\nclass VueNodeView extends NodeView<(Vue | VueConstructor), Editor> {\n\n renderer!: VueRenderer\n\n decorationClasses!: {\n value: string\n }\n\n mount() {\n const props: NodeViewProps = {\n editor: this.editor,\n node: this.node,\n decorations: this.decorations,\n selected: false,\n extension: this.extension,\n getPos: () => this.getPos(),\n updateAttributes: (attributes = {}) => this.updateAttributes(attributes),\n }\n\n const onDragStart = this.onDragStart.bind(this)\n\n this.decorationClasses = Vue.observable({\n value: this.getDecorationClasses(),\n })\n\n const Component = Vue\n .extend(this.component)\n .extend({\n props: Object.keys(props),\n provide: () => {\n return {\n onDragStart,\n decorationClasses: this.decorationClasses,\n }\n },\n })\n\n this.renderer = new VueRenderer(Component, {\n parent: this.editor.contentComponent,\n propsData: props,\n })\n }\n\n get dom() {\n if (!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\n }\n\n get contentDOM() {\n if (this.node.isLeaf) {\n return null\n }\n\n const contentElement = this.dom.querySelector('[data-node-view-content]')\n\n return contentElement || this.dom\n }\n\n update(node: ProseMirrorNode, decorations: Decoration[]) {\n if (typeof this.options.update === 'function') {\n return this.options.update(node, decorations)\n }\n\n if (node.type !== this.node.type) {\n return false\n }\n\n if (node === this.node && this.decorations === decorations) {\n return true\n }\n\n this.node = node\n this.decorations = decorations\n this.decorationClasses.value = this.getDecorationClasses()\n this.renderer.updateProps({ node, decorations })\n\n return true\n }\n\n selectNode() {\n this.renderer.updateProps({\n selected: true,\n })\n }\n\n deselectNode() {\n this.renderer.updateProps({\n selected: false,\n })\n }\n\n getDecorationClasses() {\n return this.decorations\n // @ts-ignore\n .map(item => item.type.attrs.class)\n .flat()\n .join(' ')\n }\n\n destroy() {\n this.renderer.destroy()\n }\n\n}\n\nexport function VueNodeViewRenderer(component: Vue | VueConstructor, options?: Partial<VueNodeViewRendererOptions>): NodeViewRenderer {\n return (props: NodeViewRendererProps) => {\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 {}\n }\n\n return new VueNodeView(component, props, options) as ProseMirrorNodeView\n }\n}\n","import Vue from 'vue'\n\nexport const NodeViewWrapper = Vue.extend({\n props: {\n as: {\n type: String,\n default: 'div',\n },\n },\n\n inject: ['onDragStart', 'decorationClasses'],\n\n render(createElement) {\n return createElement(\n this.as, {\n // @ts-ignore\n class: this.decorationClasses.value,\n style: {\n whiteSpace: 'normal',\n },\n attrs: {\n 'data-node-view-wrapper': '',\n },\n on: {\n // @ts-ignore\n dragstart: this.onDragStart,\n },\n },\n this.$slots.default,\n )\n },\n})\n","import Vue from 'vue'\n\nexport const NodeViewContent = Vue.extend({\n props: {\n as: {\n type: String,\n default: 'div',\n },\n },\n\n render(createElement) {\n return createElement(\n this.as, {\n style: {\n whiteSpace: 'pre-wrap',\n },\n attrs: {\n 'data-node-view-content': '',\n },\n },\n )\n },\n})\n"],"names":["Vue","BubbleMenuPlugin","BubbleMenuPluginKey","CoreEditor","FloatingMenuPlugin","FloatingMenuPluginKey","NodeView"],"mappings":";;;;;;;;;;;;;MAGa,UAAU,GAAGA,uBAAG,CAAC,MAAM,CAAC;IACnC,IAAI,EAAE,YAAY;IAElB,KAAK,EAAE;QACL,MAAM,EAAE;YACN,IAAI,EAAE,MAAmD;YACzD,QAAQ,EAAE,IAAI;SACf;QAED,YAAY,EAAE;YACZ,IAAI,EAAE,OAA0D;YAChE,OAAO,EAAE,IAAI;SACd;KACF;IAED,KAAK,EAAE;QACL,MAAM,EAAE;YACN,SAAS,EAAE,IAAI;YACf,OAAO,CAAC,MAAuC;gBAC7C,IAAI,CAAC,MAAM,EAAE;oBACX,OAAM;iBACP;gBAED,IAAI,CAAC,SAAS,CAAC;oBACb,MAAM,CAAC,cAAc,CAACC,oCAAgB,CAAC;wBACrC,MAAM;wBACN,OAAO,EAAE,IAAI,CAAC,GAAkB;wBAChC,YAAY,EAAE,IAAI,CAAC,YAAY;qBAChC,CAAC,CAAC,CAAA;iBACJ,CAAC,CAAA;aACH;SACF;KACF;IAED,MAAM,CAA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U,EAAE,UAAU;aACvB;YACD,KAAK,EAAE;gBACL,wBAAwB,EAAE,EAAE;aAC7B;SACF,CACF,CAAA;KACF;CACF;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"tiptap-vue-2.cjs.js","sources":["../src/BubbleMenu.ts","../src/Editor.ts","../src/EditorContent.ts","../src/FloatingMenu.ts","../src/NodeViewContent.ts","../src/NodeViewWrapper.ts","../src/VueRenderer.ts","../src/VueNodeViewRenderer.ts"],"sourcesContent":["import { BubbleMenuPlugin, BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu'\nimport Vue, { Component, PropType } from 'vue'\n\nexport interface BubbleMenuInterface extends Vue {\n pluginKey: BubbleMenuPluginProps['pluginKey'],\n editor: BubbleMenuPluginProps['editor'],\n tippyOptions: BubbleMenuPluginProps['tippyOptions'],\n shouldShow: BubbleMenuPluginProps['shouldShow'],\n}\n\nexport const BubbleMenu: Component = {\n name: 'BubbleMenu',\n\n props: {\n pluginKey: {\n type: [String, Object as PropType<Exclude<BubbleMenuPluginProps['pluginKey'], string>>],\n default: 'bubbleMenu',\n },\n\n editor: {\n type: Object as PropType<BubbleMenuPluginProps['editor']>,\n required: true,\n },\n\n tippyOptions: {\n type: Object as PropType<BubbleMenuPluginProps['tippyOptions']>,\n default: () => ({}),\n },\n\n shouldShow: {\n type: Function as PropType<Exclude<BubbleMenuPluginProps['shouldShow'], null>>,\n default: null,\n },\n },\n\n watch: {\n editor: {\n immediate: true,\n handler(this: BubbleMenuInterface, editor: BubbleMenuPluginProps['editor']) {\n if (!editor) {\n return\n }\n\n this.$nextTick(() => {\n editor.registerPlugin(BubbleMenuPlugin({\n pluginKey: this.pluginKey,\n editor,\n element: this.$el as HTMLElement,\n tippyOptions: this.tippyOptions,\n shouldShow: this.shouldShow,\n }))\n })\n },\n },\n },\n\n render(this: BubbleMenuInterface, createElement) {\n return createElement('div', { style: { visibility: 'hidden' } }, this.$slots.default)\n },\n\n beforeDestroy(this: BubbleMenuInterface) {\n this.editor.unregisterPlugin(this.pluginKey)\n },\n}\n","import { Editor as CoreEditor } from '@tiptap/core'\nimport Vue from 'vue'\n\nexport class Editor extends CoreEditor {\n public contentComponent: Vue | null = null\n}\n","import Vue, { Component, PropType } from 'vue'\n\nimport { Editor } from './Editor'\n\nexport interface EditorContentInterface extends Vue {\n editor: Editor,\n}\n\nexport const EditorContent: Component = {\n name: 'EditorContent',\n\n props: {\n editor: {\n default: null,\n type: Object as PropType<Editor>,\n },\n },\n\n watch: {\n editor: {\n immediate: true,\n handler(this: EditorContentInterface, editor: Editor) {\n if (editor && editor.options.element) {\n this.$nextTick(() => {\n const element = this.$el\n\n if (!element || !editor.options.element.firstChild) {\n return\n }\n\n element.append(...editor.options.element.childNodes)\n editor.contentComponent = this\n\n editor.setOptions({\n element,\n })\n\n editor.createNodeViews()\n })\n }\n },\n },\n },\n\n render(createElement) {\n return createElement('div')\n },\n\n beforeDestroy(this: EditorContentInterface) {\n const { editor } = this\n\n if (!editor) {\n return\n }\n\n if (!editor.isDestroyed) {\n editor.view.setProps({\n nodeViews: {},\n })\n }\n\n editor.contentComponent = null\n\n if (!editor.options.element.firstChild) {\n return\n }\n\n const newElement = document.createElement('div')\n\n newElement.append(...editor.options.element.childNodes)\n\n editor.setOptions({\n element: newElement,\n })\n },\n}\n","import { FloatingMenuPlugin, FloatingMenuPluginProps } from '@tiptap/extension-floating-menu'\nimport Vue, { Component, PropType } from 'vue'\n\nexport interface FloatingMenuInterface extends Vue {\n pluginKey: FloatingMenuPluginProps['pluginKey'],\n tippyOptions: FloatingMenuPluginProps['tippyOptions'],\n editor: FloatingMenuPluginProps['editor'],\n shouldShow: FloatingMenuPluginProps['shouldShow'],\n}\n\nexport const FloatingMenu: Component = {\n name: 'FloatingMenu',\n\n props: {\n pluginKey: {\n type: [String, Object as PropType<Exclude<FloatingMenuPluginProps['pluginKey'], string>>],\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<FloatingMenuPluginProps['shouldShow'], null>>,\n default: null,\n },\n },\n\n watch: {\n editor: {\n immediate: true,\n handler(this: FloatingMenuInterface, editor: FloatingMenuPluginProps['editor']) {\n if (!editor) {\n return\n }\n\n this.$nextTick(() => {\n editor.registerPlugin(FloatingMenuPlugin({\n pluginKey: this.pluginKey,\n editor,\n element: this.$el as HTMLElement,\n tippyOptions: this.tippyOptions,\n shouldShow: this.shouldShow,\n }))\n })\n },\n },\n },\n\n render(this: FloatingMenuInterface, createElement) {\n return createElement('div', { style: { visibility: 'hidden' } }, this.$slots.default)\n },\n\n beforeDestroy(this: FloatingMenuInterface) {\n this.editor.unregisterPlugin(this.pluginKey)\n },\n}\n","import Vue, { Component } from 'vue'\n\nexport interface NodeViewContentInterface extends Vue {\n as: string,\n}\n\nexport const NodeViewContent: Component = {\n props: {\n as: {\n type: String,\n default: 'div',\n },\n },\n\n render(this: NodeViewContentInterface, createElement) {\n return createElement(this.as, {\n style: {\n whiteSpace: 'pre-wrap',\n },\n attrs: {\n 'data-node-view-content': '',\n },\n })\n },\n}\n","import Vue, { Component } from 'vue'\n\nexport interface NodeViewWrapperInterface extends Vue {\n as: string,\n decorationClasses: {\n value: string,\n },\n onDragStart: Function,\n}\n\nexport const NodeViewWrapper: Component = {\n props: {\n as: {\n type: String,\n default: 'div',\n },\n },\n\n inject: ['onDragStart', 'decorationClasses'],\n\n render(this: NodeViewWrapperInterface, createElement) {\n return createElement(\n this.as,\n {\n class: this.decorationClasses.value,\n style: {\n whiteSpace: 'normal',\n },\n attrs: {\n 'data-node-view-wrapper': '',\n },\n on: {\n dragstart: this.onDragStart,\n },\n },\n this.$slots.default,\n )\n },\n}\n","import Vue from 'vue'\nimport { VueConstructor } from 'vue/types/umd'\n\nexport class VueRenderer {\n ref!: Vue\n\n constructor(component: Vue | VueConstructor, props: any) {\n const Component = (typeof component === 'function') ? component : Vue.extend(component)\n\n this.ref = new Component(props).$mount()\n }\n\n get element(): Element {\n return this.ref.$el\n }\n\n updateProps(props: Record<string, any> = {}): void {\n if (!this.ref.$props) {\n return\n }\n\n // prevents `Avoid mutating a prop directly` error message\n // Fix: `VueNodeViewRenderer` change vue Constructor `config.silent` not working\n const currentVueConstructor = this.ref.$props.editor?.contentComponent?.$options._base ?? Vue // eslint-disable-line\n const originalSilent = currentVueConstructor.config.silent\n\n currentVueConstructor.config.silent = true\n\n Object\n .entries(props)\n .forEach(([key, value]) => {\n this.ref.$props[key] = value\n })\n\n currentVueConstructor.config.silent = originalSilent\n }\n\n destroy(): void {\n this.ref.$destroy()\n }\n}\n","import {\n NodeView,\n NodeViewProps,\n NodeViewRenderer,\n NodeViewRendererOptions,\n NodeViewRendererProps,\n} from '@tiptap/core'\nimport { Node as ProseMirrorNode } from 'prosemirror-model'\nimport { Decoration, NodeView as ProseMirrorNodeView } from 'prosemirror-view'\nimport Vue from 'vue'\nimport { PropType, VueConstructor } from 'vue/types/umd'\n\nimport { Editor } from './Editor'\nimport { VueRenderer } from './VueRenderer'\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}\n\nexport interface VueNodeViewRendererOptions extends NodeViewRendererOptions {\n update: ((props: {\n oldNode: ProseMirrorNode,\n oldDecorations: Decoration[],\n newNode: ProseMirrorNode,\n newDecorations: Decoration[],\n updateProps: () => void,\n }) => boolean) | null,\n}\n\nclass VueNodeView extends NodeView<(Vue | VueConstructor), Editor, VueNodeViewRendererOptions> {\n\n renderer!: VueRenderer\n\n decorationClasses!: {\n value: string\n }\n\n mount() {\n const props: NodeViewProps = {\n editor: this.editor,\n node: this.node,\n decorations: this.decorations,\n selected: false,\n extension: this.extension,\n getPos: () => this.getPos(),\n updateAttributes: (attributes = {}) => this.updateAttributes(attributes),\n deleteNode: () => this.deleteNode(),\n }\n\n const onDragStart = this.onDragStart.bind(this)\n\n this.decorationClasses = Vue.observable({\n value: this.getDecorationClasses(),\n })\n\n // @ts-ignore\n const vue = this.editor.contentComponent?.$options._base ?? Vue // eslint-disable-line\n\n const Component = vue\n .extend(this.component)\n .extend({\n props: Object.keys(props),\n provide: () => {\n return {\n onDragStart,\n decorationClasses: this.decorationClasses,\n }\n },\n })\n\n this.renderer = new VueRenderer(Component, {\n parent: this.editor.contentComponent,\n propsData: props,\n })\n }\n\n get dom() {\n if (!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 get contentDOM() {\n if (this.node.isLeaf) {\n return null\n }\n\n const contentElement = this.dom.querySelector('[data-node-view-content]')\n\n return (contentElement || this.dom) as HTMLElement | null\n }\n\n update(node: ProseMirrorNode, decorations: Decoration[]) {\n const updateProps = (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\n this.node = node\n this.decorations = decorations\n\n return this.options.update({\n oldNode,\n oldDecorations,\n newNode: node,\n newDecorations: decorations,\n updateProps: () => updateProps({ node, decorations }),\n })\n }\n\n if (node.type !== this.node.type) {\n return false\n }\n\n if (node === this.node && this.decorations === decorations) {\n return true\n }\n\n this.node = node\n this.decorations = decorations\n\n updateProps({ node, decorations })\n\n return true\n }\n\n selectNode() {\n this.renderer.updateProps({\n selected: true,\n })\n }\n\n deselectNode() {\n this.renderer.updateProps({\n selected: false,\n })\n }\n\n getDecorationClasses() {\n return this.decorations\n // @ts-ignore\n .map(item => item.type.attrs.class)\n .flat()\n .join(' ')\n }\n\n destroy() {\n this.renderer.destroy()\n }\n\n}\n\nexport function VueNodeViewRenderer(component: Vue | VueConstructor, options?: Partial<VueNodeViewRendererOptions>): NodeViewRenderer {\n return (props: NodeViewRendererProps) => {\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 {}\n }\n\n return new VueNodeView(component, props, options) as unknown as ProseMirrorNodeView\n }\n}\n"],"names":["BubbleMenuPlugin","CoreEditor","FloatingMenuPlugin","Vue","NodeView"],"mappings":";;;;;;;;;;;;;AAUa,MAAA,UAAU,GAAc;AACnC,IAAA,IAAI,EAAE,YAAY;AAElB,IAAA,KAAK,EAAE;AACL,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,CAAC,MAAM,EAAE,MAAuE,CAAC;AACvF,YAAA,OAAO,EAAE,YAAY;AACtB,SAAA;AAED,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAAmD;AACzD,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AAED,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,MAAyD;AAC/D,YAAA,OAAO,EAAE,OAAO,EAAE,CAAC;AACpB,SAAA;AAED,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,QAAwE;AAC9E,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AACF,KAAA;AAED,IAAA,KAAK,EAAE;AACL,QAAA,MAAM,EAAE;AACN,YAAA,SAAS,EAAE,IAAI;AACf,YAAA,OAAO,CAA4B,MAAuC,EAAA;gBACxE,IAA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