@tiptap/vue-2 2.0.0-beta.82 → 2.0.0-beta.85
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/dist/packages/vue-2/src/BubbleMenu.d.ts +9 -0
- package/dist/packages/vue-2/src/Editor.d.ts +5 -0
- package/dist/packages/vue-2/src/EditorContent.d.ts +6 -0
- package/dist/packages/vue-2/src/FloatingMenu.d.ts +9 -0
- package/dist/packages/vue-2/src/NodeViewContent.d.ts +5 -0
- package/dist/packages/vue-2/src/NodeViewWrapper.d.ts +9 -0
- package/dist/packages/vue-2/src/VueNodeViewRenderer.d.ts +49 -0
- package/dist/packages/vue-2/src/VueRenderer.d.ts +9 -0
- package/dist/packages/vue-2/src/index.d.ts +9 -0
- package/dist/tiptap-vue-2.cjs.js +401 -0
- package/dist/tiptap-vue-2.cjs.js.map +1 -0
- package/dist/tiptap-vue-2.esm.js +380 -0
- package/dist/tiptap-vue-2.esm.js.map +1 -0
- package/dist/tiptap-vue-2.umd.js +402 -0
- package/dist/tiptap-vue-2.umd.js.map +1 -0
- package/package.json +5 -5
- package/src/VueNodeViewRenderer.ts +3 -3
- package/src/VueRenderer.ts +1 -1
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021, überdosis GbR
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,9 @@
|
|
|
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;
|
|
@@ -0,0 +1,9 @@
|
|
|
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;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { NodeViewRenderer, NodeViewRendererOptions } from '@tiptap/core';
|
|
2
|
+
import { Node as ProseMirrorNode } from 'prosemirror-model';
|
|
3
|
+
import { Decoration } from 'prosemirror-view';
|
|
4
|
+
import Vue from 'vue';
|
|
5
|
+
import { PropType, VueConstructor } from 'vue/types/umd';
|
|
6
|
+
export declare const nodeViewProps: {
|
|
7
|
+
editor: {
|
|
8
|
+
type: PropType<import("@tiptap/core").Editor>;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
node: {
|
|
12
|
+
type: PropType<ProseMirrorNode>;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
decorations: {
|
|
16
|
+
type: PropType<Decoration[]>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
selected: {
|
|
20
|
+
type: PropType<boolean>;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
extension: {
|
|
24
|
+
type: PropType<import("@tiptap/core").Node<any, any>>;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
getPos: {
|
|
28
|
+
type: PropType<() => number>;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
updateAttributes: {
|
|
32
|
+
type: PropType<(attributes: Record<string, any>) => void>;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
deleteNode: {
|
|
36
|
+
type: PropType<() => void>;
|
|
37
|
+
required: true;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
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;
|
|
48
|
+
}
|
|
49
|
+
export declare function VueNodeViewRenderer(component: Vue | VueConstructor, options?: Partial<VueNodeViewRendererOptions>): NodeViewRenderer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Vue from 'vue';
|
|
2
|
+
import { VueConstructor } from 'vue/types/umd';
|
|
3
|
+
export declare class VueRenderer {
|
|
4
|
+
ref: Vue;
|
|
5
|
+
constructor(component: Vue | VueConstructor, props: any);
|
|
6
|
+
get element(): Element;
|
|
7
|
+
updateProps(props?: Record<string, any>): void;
|
|
8
|
+
destroy(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './BubbleMenu';
|
|
2
|
+
export { Editor } from './Editor';
|
|
3
|
+
export * from './EditorContent';
|
|
4
|
+
export * from './FloatingMenu';
|
|
5
|
+
export * from './NodeViewContent';
|
|
6
|
+
export * from './NodeViewWrapper';
|
|
7
|
+
export * from './VueNodeViewRenderer';
|
|
8
|
+
export * from './VueRenderer';
|
|
9
|
+
export * from '@tiptap/core';
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var extensionBubbleMenu = require('@tiptap/extension-bubble-menu');
|
|
6
|
+
var core = require('@tiptap/core');
|
|
7
|
+
var extensionFloatingMenu = require('@tiptap/extension-floating-menu');
|
|
8
|
+
var Vue = require('vue');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
+
|
|
12
|
+
var Vue__default = /*#__PURE__*/_interopDefaultLegacy(Vue);
|
|
13
|
+
|
|
14
|
+
const BubbleMenu = {
|
|
15
|
+
name: 'BubbleMenu',
|
|
16
|
+
props: {
|
|
17
|
+
pluginKey: {
|
|
18
|
+
type: [String, Object],
|
|
19
|
+
default: 'bubbleMenu',
|
|
20
|
+
},
|
|
21
|
+
editor: {
|
|
22
|
+
type: Object,
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
tippyOptions: {
|
|
26
|
+
type: Object,
|
|
27
|
+
default: () => ({}),
|
|
28
|
+
},
|
|
29
|
+
shouldShow: {
|
|
30
|
+
type: Function,
|
|
31
|
+
default: null,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
watch: {
|
|
35
|
+
editor: {
|
|
36
|
+
immediate: true,
|
|
37
|
+
handler(editor) {
|
|
38
|
+
if (!editor) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
this.$nextTick(() => {
|
|
42
|
+
editor.registerPlugin(extensionBubbleMenu.BubbleMenuPlugin({
|
|
43
|
+
pluginKey: this.pluginKey,
|
|
44
|
+
editor,
|
|
45
|
+
element: this.$el,
|
|
46
|
+
tippyOptions: this.tippyOptions,
|
|
47
|
+
shouldShow: this.shouldShow,
|
|
48
|
+
}));
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
render(createElement) {
|
|
54
|
+
return createElement('div', { style: { visibility: 'hidden' } }, this.$slots.default);
|
|
55
|
+
},
|
|
56
|
+
beforeDestroy() {
|
|
57
|
+
this.editor.unregisterPlugin(this.pluginKey);
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
class Editor extends core.Editor {
|
|
62
|
+
constructor() {
|
|
63
|
+
super(...arguments);
|
|
64
|
+
this.contentComponent = null;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const EditorContent = {
|
|
69
|
+
name: 'EditorContent',
|
|
70
|
+
props: {
|
|
71
|
+
editor: {
|
|
72
|
+
default: null,
|
|
73
|
+
type: Object,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
watch: {
|
|
77
|
+
editor: {
|
|
78
|
+
immediate: true,
|
|
79
|
+
handler(editor) {
|
|
80
|
+
if (editor && editor.options.element) {
|
|
81
|
+
this.$nextTick(() => {
|
|
82
|
+
const element = this.$el;
|
|
83
|
+
if (!element || !editor.options.element.firstChild) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
element.append(...editor.options.element.childNodes);
|
|
87
|
+
editor.contentComponent = this;
|
|
88
|
+
editor.setOptions({
|
|
89
|
+
element,
|
|
90
|
+
});
|
|
91
|
+
editor.createNodeViews();
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
render(createElement) {
|
|
98
|
+
return createElement('div');
|
|
99
|
+
},
|
|
100
|
+
beforeDestroy() {
|
|
101
|
+
const { editor } = this;
|
|
102
|
+
if (!editor) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (!editor.isDestroyed) {
|
|
106
|
+
editor.view.setProps({
|
|
107
|
+
nodeViews: {},
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
editor.contentComponent = null;
|
|
111
|
+
if (!editor.options.element.firstChild) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const newElement = document.createElement('div');
|
|
115
|
+
newElement.append(...editor.options.element.childNodes);
|
|
116
|
+
editor.setOptions({
|
|
117
|
+
element: newElement,
|
|
118
|
+
});
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const FloatingMenu = {
|
|
123
|
+
name: 'FloatingMenu',
|
|
124
|
+
props: {
|
|
125
|
+
pluginKey: {
|
|
126
|
+
type: [String, Object],
|
|
127
|
+
default: 'floatingMenu',
|
|
128
|
+
},
|
|
129
|
+
editor: {
|
|
130
|
+
type: Object,
|
|
131
|
+
required: true,
|
|
132
|
+
},
|
|
133
|
+
tippyOptions: {
|
|
134
|
+
type: Object,
|
|
135
|
+
default: () => ({}),
|
|
136
|
+
},
|
|
137
|
+
shouldShow: {
|
|
138
|
+
type: Function,
|
|
139
|
+
default: null,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
watch: {
|
|
143
|
+
editor: {
|
|
144
|
+
immediate: true,
|
|
145
|
+
handler(editor) {
|
|
146
|
+
if (!editor) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
this.$nextTick(() => {
|
|
150
|
+
editor.registerPlugin(extensionFloatingMenu.FloatingMenuPlugin({
|
|
151
|
+
pluginKey: this.pluginKey,
|
|
152
|
+
editor,
|
|
153
|
+
element: this.$el,
|
|
154
|
+
tippyOptions: this.tippyOptions,
|
|
155
|
+
shouldShow: this.shouldShow,
|
|
156
|
+
}));
|
|
157
|
+
});
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
render(createElement) {
|
|
162
|
+
return createElement('div', { style: { visibility: 'hidden' } }, this.$slots.default);
|
|
163
|
+
},
|
|
164
|
+
beforeDestroy() {
|
|
165
|
+
this.editor.unregisterPlugin(this.pluginKey);
|
|
166
|
+
},
|
|
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
|
+
};
|
|
211
|
+
|
|
212
|
+
class VueRenderer {
|
|
213
|
+
constructor(component, props) {
|
|
214
|
+
const Component = (typeof component === 'function') ? component : Vue__default["default"].extend(component);
|
|
215
|
+
this.ref = new Component(props).$mount();
|
|
216
|
+
}
|
|
217
|
+
get element() {
|
|
218
|
+
return this.ref.$el;
|
|
219
|
+
}
|
|
220
|
+
updateProps(props = {}) {
|
|
221
|
+
var _a, _b, _c;
|
|
222
|
+
if (!this.ref.$props) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
// prevents `Avoid mutating a prop directly` error message
|
|
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;
|
|
230
|
+
Object
|
|
231
|
+
.entries(props)
|
|
232
|
+
.forEach(([key, value]) => {
|
|
233
|
+
this.ref.$props[key] = value;
|
|
234
|
+
});
|
|
235
|
+
currentVueConstructor.config.silent = originalSilent;
|
|
236
|
+
}
|
|
237
|
+
destroy() {
|
|
238
|
+
this.ref.$destroy();
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
const nodeViewProps = {
|
|
243
|
+
editor: {
|
|
244
|
+
type: Object,
|
|
245
|
+
required: true,
|
|
246
|
+
},
|
|
247
|
+
node: {
|
|
248
|
+
type: Object,
|
|
249
|
+
required: true,
|
|
250
|
+
},
|
|
251
|
+
decorations: {
|
|
252
|
+
type: Object,
|
|
253
|
+
required: true,
|
|
254
|
+
},
|
|
255
|
+
selected: {
|
|
256
|
+
type: Boolean,
|
|
257
|
+
required: true,
|
|
258
|
+
},
|
|
259
|
+
extension: {
|
|
260
|
+
type: Object,
|
|
261
|
+
required: true,
|
|
262
|
+
},
|
|
263
|
+
getPos: {
|
|
264
|
+
type: Function,
|
|
265
|
+
required: true,
|
|
266
|
+
},
|
|
267
|
+
updateAttributes: {
|
|
268
|
+
type: Function,
|
|
269
|
+
required: true,
|
|
270
|
+
},
|
|
271
|
+
deleteNode: {
|
|
272
|
+
type: Function,
|
|
273
|
+
required: true,
|
|
274
|
+
},
|
|
275
|
+
};
|
|
276
|
+
class VueNodeView extends core.NodeView {
|
|
277
|
+
mount() {
|
|
278
|
+
var _a, _b;
|
|
279
|
+
const props = {
|
|
280
|
+
editor: this.editor,
|
|
281
|
+
node: this.node,
|
|
282
|
+
decorations: this.decorations,
|
|
283
|
+
selected: false,
|
|
284
|
+
extension: this.extension,
|
|
285
|
+
getPos: () => this.getPos(),
|
|
286
|
+
updateAttributes: (attributes = {}) => this.updateAttributes(attributes),
|
|
287
|
+
deleteNode: () => this.deleteNode(),
|
|
288
|
+
};
|
|
289
|
+
const onDragStart = this.onDragStart.bind(this);
|
|
290
|
+
this.decorationClasses = Vue__default["default"].observable({
|
|
291
|
+
value: this.getDecorationClasses(),
|
|
292
|
+
});
|
|
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
|
|
296
|
+
.extend(this.component)
|
|
297
|
+
.extend({
|
|
298
|
+
props: Object.keys(props),
|
|
299
|
+
provide: () => {
|
|
300
|
+
return {
|
|
301
|
+
onDragStart,
|
|
302
|
+
decorationClasses: this.decorationClasses,
|
|
303
|
+
};
|
|
304
|
+
},
|
|
305
|
+
});
|
|
306
|
+
this.renderer = new VueRenderer(Component, {
|
|
307
|
+
parent: this.editor.contentComponent,
|
|
308
|
+
propsData: props,
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
get dom() {
|
|
312
|
+
if (!this.renderer.element.hasAttribute('data-node-view-wrapper')) {
|
|
313
|
+
throw Error('Please use the NodeViewWrapper component for your node view.');
|
|
314
|
+
}
|
|
315
|
+
return this.renderer.element;
|
|
316
|
+
}
|
|
317
|
+
get contentDOM() {
|
|
318
|
+
if (this.node.isLeaf) {
|
|
319
|
+
return null;
|
|
320
|
+
}
|
|
321
|
+
const contentElement = this.dom.querySelector('[data-node-view-content]');
|
|
322
|
+
return (contentElement || this.dom);
|
|
323
|
+
}
|
|
324
|
+
update(node, decorations) {
|
|
325
|
+
const updateProps = (props) => {
|
|
326
|
+
this.decorationClasses.value = this.getDecorationClasses();
|
|
327
|
+
this.renderer.updateProps(props);
|
|
328
|
+
};
|
|
329
|
+
if (typeof this.options.update === 'function') {
|
|
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
|
+
});
|
|
341
|
+
}
|
|
342
|
+
if (node.type !== this.node.type) {
|
|
343
|
+
return false;
|
|
344
|
+
}
|
|
345
|
+
if (node === this.node && this.decorations === decorations) {
|
|
346
|
+
return true;
|
|
347
|
+
}
|
|
348
|
+
this.node = node;
|
|
349
|
+
this.decorations = decorations;
|
|
350
|
+
updateProps({ node, decorations });
|
|
351
|
+
return true;
|
|
352
|
+
}
|
|
353
|
+
selectNode() {
|
|
354
|
+
this.renderer.updateProps({
|
|
355
|
+
selected: true,
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
deselectNode() {
|
|
359
|
+
this.renderer.updateProps({
|
|
360
|
+
selected: false,
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
getDecorationClasses() {
|
|
364
|
+
return this.decorations
|
|
365
|
+
// @ts-ignore
|
|
366
|
+
.map(item => item.type.attrs.class)
|
|
367
|
+
.flat()
|
|
368
|
+
.join(' ');
|
|
369
|
+
}
|
|
370
|
+
destroy() {
|
|
371
|
+
this.renderer.destroy();
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
function VueNodeViewRenderer(component, options) {
|
|
375
|
+
return (props) => {
|
|
376
|
+
// try to get the parent component
|
|
377
|
+
// this is important for vue devtools to show the component hierarchy correctly
|
|
378
|
+
// maybe it’s `undefined` because <editor-content> isn’t rendered yet
|
|
379
|
+
if (!props.editor.contentComponent) {
|
|
380
|
+
return {};
|
|
381
|
+
}
|
|
382
|
+
return new VueNodeView(component, props, options);
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
exports.BubbleMenu = BubbleMenu;
|
|
387
|
+
exports.Editor = Editor;
|
|
388
|
+
exports.EditorContent = EditorContent;
|
|
389
|
+
exports.FloatingMenu = FloatingMenu;
|
|
390
|
+
exports.NodeViewContent = NodeViewContent;
|
|
391
|
+
exports.NodeViewWrapper = NodeViewWrapper;
|
|
392
|
+
exports.VueNodeViewRenderer = VueNodeViewRenderer;
|
|
393
|
+
exports.VueRenderer = VueRenderer;
|
|
394
|
+
exports.nodeViewProps = nodeViewProps;
|
|
395
|
+
Object.keys(core).forEach(function (k) {
|
|
396
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
397
|
+
enumerable: true,
|
|
398
|
+
get: function () { return core[k]; }
|
|
399
|
+
});
|
|
400
|
+
});
|
|
401
|
+
//# sourceMappingURL=tiptap-vue-2.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,IAAI,CAAC,MAAM,EAAE;oBACX,OAAM;AACP,iBAAA;AAED,gBAAA,IAAI,CAAC,SAAS,CAAC,MAAK;AAClB,oBAAA,MAAM,CAAC,cAAc,CAACA,oCAAgB,CAAC;wBACrC,SAAS,EAAE,IAAI,CAAC,SAAS;wBACzB,MAAM;wBACN,OAAO,EAAE,IAAI,CAAC,GAAkB;wBAChC,YAA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