@tiptap/vue-2 2.0.0-beta.8 → 2.0.0-beta.84

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020, überdosis GbR
3
+ Copyright (c) 2021, überdosis GbR
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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
- ## Offical Documentation
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-next/blob/main/LICENSE.md).
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 Vue from 'vue';
2
- export declare const BubbleMenu: import("vue/types/vue").ExtendedVue<Vue, unknown, unknown, unknown, {
3
- editor: import("@tiptap/core").Editor;
4
- keepInBounds: boolean;
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 declare const EditorContent: import("vue/types/vue").ExtendedVue<Vue, unknown, unknown, unknown, {
3
+ export interface EditorContentInterface extends Vue {
4
4
  editor: Editor;
5
- }>;
5
+ }
6
+ export declare const EditorContent: 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;
@@ -1,4 +1,5 @@
1
- import Vue from 'vue';
2
- export declare const NodeViewContent: import("vue/types/vue").ExtendedVue<Vue, unknown, unknown, unknown, {
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 declare const NodeViewWrapper: import("vue/types/vue").ExtendedVue<Vue, unknown, unknown, unknown, {
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 { VueConstructor, PropType } from 'vue/types/umd';
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: boolean;
9
+ required: true;
10
10
  };
11
11
  node: {
12
- type: PropType<ProseMirrorNode<any>>;
13
- required: boolean;
12
+ type: PropType<ProseMirrorNode>;
13
+ required: true;
14
14
  };
15
15
  decorations: {
16
- type: PropType<Decoration<{
17
- [key: string]: any;
18
- }>[]>;
19
- required: boolean;
16
+ type: PropType<Decoration[]>;
17
+ required: true;
20
18
  };
21
19
  selected: {
22
20
  type: PropType<boolean>;
23
- required: boolean;
21
+ required: true;
24
22
  };
25
23
  extension: {
26
- type: PropType<import("@tiptap/core").Node<any>>;
27
- required: boolean;
24
+ type: PropType<import("@tiptap/core").Node<any, any>>;
25
+ required: true;
28
26
  };
29
27
  getPos: {
30
28
  type: PropType<() => number>;
31
- required: boolean;
29
+ required: true;
32
30
  };
33
31
  updateAttributes: {
34
- type: PropType<(attributes: import("@tiptap/core").AnyObject) => void>;
35
- required: boolean;
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
- stopEvent: ((event: Event) => boolean) | null;
40
- update: ((node: ProseMirrorNode, decorations: Decoration[]) => boolean) | null;
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?: AnyObject): void;
7
+ updateProps(props?: Record<string, any>): void;
9
8
  destroy(): void;
10
9
  }
@@ -1,8 +1,9 @@
1
- export * from '@tiptap/core';
2
1
  export * from './BubbleMenu';
3
2
  export { Editor } from './Editor';
4
3
  export * from './EditorContent';
5
- export * from './VueRenderer';
6
- export * from './VueNodeViewRenderer';
7
- export * from './NodeViewWrapper';
4
+ export * from './FloatingMenu';
8
5
  export * from './NodeViewContent';
6
+ export * from './NodeViewWrapper';
7
+ export * from './VueNodeViewRenderer';
8
+ export * from './VueRenderer';
9
+ export * from '@tiptap/core';
@@ -2,24 +2,33 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var extensionBubbleMenu = require('@tiptap/extension-bubble-menu');
5
6
  var core = require('@tiptap/core');
7
+ var extensionFloatingMenu = require('@tiptap/extension-floating-menu');
6
8
  var Vue = require('vue');
7
- var extensionBubbleMenu = require('@tiptap/extension-bubble-menu');
8
9
 
9
10
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
11
 
11
12
  var Vue__default = /*#__PURE__*/_interopDefaultLegacy(Vue);
12
13
 
13
- const BubbleMenu = Vue__default['default'].extend({
14
+ const BubbleMenu = {
14
15
  name: 'BubbleMenu',
15
16
  props: {
17
+ pluginKey: {
18
+ type: [String, Object],
19
+ default: 'bubbleMenu',
20
+ },
16
21
  editor: {
17
22
  type: Object,
18
23
  required: true,
19
24
  },
20
- keepInBounds: {
21
- type: Boolean,
22
- default: true,
25
+ tippyOptions: {
26
+ type: Object,
27
+ default: () => ({}),
28
+ },
29
+ shouldShow: {
30
+ type: Function,
31
+ default: null,
23
32
  },
24
33
  },
25
34
  watch: {
@@ -31,21 +40,23 @@ const BubbleMenu = Vue__default['default'].extend({
31
40
  }
32
41
  this.$nextTick(() => {
33
42
  editor.registerPlugin(extensionBubbleMenu.BubbleMenuPlugin({
43
+ pluginKey: this.pluginKey,
34
44
  editor,
35
45
  element: this.$el,
36
- keepInBounds: this.keepInBounds,
46
+ tippyOptions: this.tippyOptions,
47
+ shouldShow: this.shouldShow,
37
48
  }));
38
49
  });
39
50
  },
40
51
  },
41
52
  },
42
53
  render(createElement) {
43
- return createElement('div', {}, this.$slots.default);
54
+ return createElement('div', { style: { visibility: 'hidden' } }, this.$slots.default);
44
55
  },
45
56
  beforeDestroy() {
46
- this.editor.unregisterPlugin(extensionBubbleMenu.BubbleMenuPluginKey);
57
+ this.editor.unregisterPlugin(this.pluginKey);
47
58
  },
48
- });
59
+ };
49
60
 
50
61
  class Editor extends core.Editor {
51
62
  constructor() {
@@ -54,7 +65,7 @@ class Editor extends core.Editor {
54
65
  }
55
66
  }
56
67
 
57
- const EditorContent = Vue__default['default'].extend({
68
+ const EditorContent = {
58
69
  name: 'EditorContent',
59
70
  props: {
60
71
  editor: {
@@ -72,7 +83,7 @@ const EditorContent = Vue__default['default'].extend({
72
83
  if (!element || !editor.options.element.firstChild) {
73
84
  return;
74
85
  }
75
- element.appendChild(editor.options.element.firstChild);
86
+ element.append(...editor.options.element.childNodes);
76
87
  editor.contentComponent = this;
77
88
  editor.setOptions({
78
89
  element,
@@ -88,6 +99,9 @@ const EditorContent = Vue__default['default'].extend({
88
99
  },
89
100
  beforeDestroy() {
90
101
  const { editor } = this;
102
+ if (!editor) {
103
+ return;
104
+ }
91
105
  if (!editor.isDestroyed) {
92
106
  editor.view.setProps({
93
107
  nodeViews: {},
@@ -98,34 +112,127 @@ const EditorContent = Vue__default['default'].extend({
98
112
  return;
99
113
  }
100
114
  const newElement = document.createElement('div');
101
- newElement.appendChild(editor.options.element.firstChild);
115
+ newElement.append(...editor.options.element.childNodes);
102
116
  editor.setOptions({
103
117
  element: newElement,
104
118
  });
105
119
  },
106
- });
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
+ };
107
211
 
108
212
  class VueRenderer {
109
213
  constructor(component, props) {
110
- const Component = Vue__default['default'].extend(component);
214
+ const Component = (typeof component === 'function') ? component : Vue__default["default"].extend(component);
111
215
  this.ref = new Component(props).$mount();
112
216
  }
113
217
  get element() {
114
218
  return this.ref.$el;
115
219
  }
116
220
  updateProps(props = {}) {
221
+ var _a, _b, _c;
117
222
  if (!this.ref.$props) {
118
223
  return;
119
224
  }
120
225
  // prevents `Avoid mutating a prop directly` error message
121
- const originalSilent = Vue__default['default'].config.silent;
122
- Vue__default['default'].config.silent = true;
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;
123
230
  Object
124
231
  .entries(props)
125
232
  .forEach(([key, value]) => {
126
233
  this.ref.$props[key] = value;
127
234
  });
128
- Vue__default['default'].config.silent = originalSilent;
235
+ currentVueConstructor.config.silent = originalSilent;
129
236
  }
130
237
  destroy() {
131
238
  this.ref.$destroy();
@@ -161,9 +268,14 @@ const nodeViewProps = {
161
268
  type: Function,
162
269
  required: true,
163
270
  },
271
+ deleteNode: {
272
+ type: Function,
273
+ required: true,
274
+ },
164
275
  };
165
276
  class VueNodeView extends core.NodeView {
166
277
  mount() {
278
+ var _a, _b;
167
279
  const props = {
168
280
  editor: this.editor,
169
281
  node: this.node,
@@ -172,22 +284,22 @@ class VueNodeView extends core.NodeView {
172
284
  extension: this.extension,
173
285
  getPos: () => this.getPos(),
174
286
  updateAttributes: (attributes = {}) => this.updateAttributes(attributes),
287
+ deleteNode: () => this.deleteNode(),
175
288
  };
176
289
  const onDragStart = this.onDragStart.bind(this);
177
- const isEditable = Vue__default['default'].observable({
178
- value: this.editor.isEditable,
179
- });
180
- this.editor.on('viewUpdate', () => {
181
- isEditable.value = this.editor.isEditable;
290
+ this.decorationClasses = Vue__default["default"].observable({
291
+ value: this.getDecorationClasses(),
182
292
  });
183
- const Component = Vue__default['default']
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
184
296
  .extend(this.component)
185
297
  .extend({
186
298
  props: Object.keys(props),
187
- provide() {
299
+ provide: () => {
188
300
  return {
189
301
  onDragStart,
190
- isEditable,
302
+ decorationClasses: this.decorationClasses,
191
303
  };
192
304
  },
193
305
  });
@@ -207,11 +319,25 @@ class VueNodeView extends core.NodeView {
207
319
  return null;
208
320
  }
209
321
  const contentElement = this.dom.querySelector('[data-node-view-content]');
210
- return contentElement || this.dom;
322
+ return (contentElement || this.dom);
211
323
  }
212
324
  update(node, decorations) {
325
+ const updateProps = (props) => {
326
+ this.decorationClasses.value = this.getDecorationClasses();
327
+ this.renderer.updateProps(props);
328
+ };
213
329
  if (typeof this.options.update === 'function') {
214
- return this.options.update(node, decorations);
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
+ });
215
341
  }
216
342
  if (node.type !== this.node.type) {
217
343
  return false;
@@ -221,7 +347,7 @@ class VueNodeView extends core.NodeView {
221
347
  }
222
348
  this.node = node;
223
349
  this.decorations = decorations;
224
- this.renderer.updateProps({ node, decorations });
350
+ updateProps({ node, decorations });
225
351
  return true;
226
352
  }
227
353
  selectNode() {
@@ -234,6 +360,13 @@ class VueNodeView extends core.NodeView {
234
360
  selected: false,
235
361
  });
236
362
  }
363
+ getDecorationClasses() {
364
+ return this.decorations
365
+ // @ts-ignore
366
+ .map(item => item.type.attrs.class)
367
+ .flat()
368
+ .join(' ');
369
+ }
237
370
  destroy() {
238
371
  this.renderer.destroy();
239
372
  }
@@ -250,55 +383,10 @@ function VueNodeViewRenderer(component, options) {
250
383
  };
251
384
  }
252
385
 
253
- const NodeViewWrapper = Vue__default['default'].extend({
254
- props: {
255
- as: {
256
- type: String,
257
- default: 'div',
258
- },
259
- },
260
- inject: ['onDragStart'],
261
- render(createElement) {
262
- return createElement(this.as, {
263
- style: {
264
- whiteSpace: 'normal',
265
- },
266
- attrs: {
267
- 'data-node-view-wrapper': '',
268
- },
269
- on: {
270
- // @ts-ignore
271
- dragstart: this.onDragStart,
272
- },
273
- }, this.$slots.default);
274
- },
275
- });
276
-
277
- const NodeViewContent = Vue__default['default'].extend({
278
- props: {
279
- as: {
280
- type: String,
281
- default: 'div',
282
- },
283
- },
284
- inject: ['isEditable'],
285
- render(createElement) {
286
- return createElement(this.as, {
287
- style: {
288
- whiteSpace: 'pre-wrap',
289
- },
290
- attrs: {
291
- 'data-node-view-content': '',
292
- // @ts-ignore
293
- contenteditable: this.isEditable.value,
294
- },
295
- });
296
- },
297
- });
298
-
299
386
  exports.BubbleMenu = BubbleMenu;
300
387
  exports.Editor = Editor;
301
388
  exports.EditorContent = EditorContent;
389
+ exports.FloatingMenu = FloatingMenu;
302
390
  exports.NodeViewContent = NodeViewContent;
303
391
  exports.NodeViewWrapper = NodeViewWrapper;
304
392
  exports.VueNodeViewRenderer = VueNodeViewRenderer;
@@ -307,9 +395,7 @@ exports.nodeViewProps = nodeViewProps;
307
395
  Object.keys(core).forEach(function (k) {
308
396
  if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
309
397
  enumerable: true,
310
- get: function () {
311
- return core[k];
312
- }
398
+ get: function () { return core[k]; }
313
399
  });
314
400
  });
315
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/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', {}, 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 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 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 const isEditable = Vue.observable({\n value: this.editor.isEditable,\n })\n\n this.editor.on('viewUpdate', () => {\n isEditable.value = this.editor.isEditable\n })\n\n const Component = Vue\n .extend(this.component)\n .extend({\n props: Object.keys(props),\n provide() {\n return {\n onDragStart,\n isEditable,\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.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 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'],\n\n render(createElement) {\n return createElement(\n this.as, {\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 inject: ['isEditable'],\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 // @ts-ignore\n contenteditable: this.isEditable.value,\n },\n },\n )\n },\n})\n"],"names":["Vue","BubbleMenuPlugin","BubbleMenuPluginKey","CoreEditor","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,CAAC,aAAa;QAClB,OAAO,aAAa,CAAC,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;KACrD;IAED,aAAa;QACX,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAACC,uCAAmB,CAAC,CAAA;K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aAAa;QAClB,OAAO,aAAa,CAClB,IAAI,CAAC,EAAE,EAAE;YACP,KAAK,EAAE;gBACL,UAAU,EAAE,UAAU;aACvB;YACD,KAAK,EAAE;gBACL,wBAAwB,EAAE,EAAE;;gBAE5B,eAAe,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK;aACvC;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;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