@tiptap/vue-3 2.6.2 → 3.0.0-next.1

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.
Files changed (188) hide show
  1. package/dist/index.cjs +541 -465
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +300 -0
  4. package/dist/index.d.ts +300 -0
  5. package/dist/index.js +543 -452
  6. package/dist/index.js.map +1 -1
  7. package/package.json +10 -12
  8. package/src/BubbleMenu.ts +25 -7
  9. package/src/FloatingMenu.ts +17 -5
  10. package/dist/index.umd.js +0 -508
  11. package/dist/index.umd.js.map +0 -1
  12. package/dist/packages/core/src/CommandManager.d.ts +0 -20
  13. package/dist/packages/core/src/Editor.d.ts +0 -163
  14. package/dist/packages/core/src/EventEmitter.d.ts +0 -11
  15. package/dist/packages/core/src/Extension.d.ts +0 -344
  16. package/dist/packages/core/src/ExtensionManager.d.ts +0 -55
  17. package/dist/packages/core/src/InputRule.d.ts +0 -42
  18. package/dist/packages/core/src/Mark.d.ts +0 -452
  19. package/dist/packages/core/src/Node.d.ts +0 -612
  20. package/dist/packages/core/src/NodePos.d.ts +0 -44
  21. package/dist/packages/core/src/NodeView.d.ts +0 -31
  22. package/dist/packages/core/src/PasteRule.d.ts +0 -50
  23. package/dist/packages/core/src/Tracker.d.ts +0 -11
  24. package/dist/packages/core/src/commands/blur.d.ts +0 -13
  25. package/dist/packages/core/src/commands/clearContent.d.ts +0 -14
  26. package/dist/packages/core/src/commands/clearNodes.d.ts +0 -13
  27. package/dist/packages/core/src/commands/command.d.ts +0 -18
  28. package/dist/packages/core/src/commands/createParagraphNear.d.ts +0 -13
  29. package/dist/packages/core/src/commands/cut.d.ts +0 -20
  30. package/dist/packages/core/src/commands/deleteCurrentNode.d.ts +0 -13
  31. package/dist/packages/core/src/commands/deleteNode.d.ts +0 -15
  32. package/dist/packages/core/src/commands/deleteRange.d.ts +0 -14
  33. package/dist/packages/core/src/commands/deleteSelection.d.ts +0 -13
  34. package/dist/packages/core/src/commands/enter.d.ts +0 -13
  35. package/dist/packages/core/src/commands/exitCode.d.ts +0 -13
  36. package/dist/packages/core/src/commands/extendMarkRange.d.ts +0 -25
  37. package/dist/packages/core/src/commands/first.d.ts +0 -14
  38. package/dist/packages/core/src/commands/focus.d.ts +0 -27
  39. package/dist/packages/core/src/commands/forEach.d.ts +0 -14
  40. package/dist/packages/core/src/commands/index.d.ts +0 -55
  41. package/dist/packages/core/src/commands/insertContent.d.ts +0 -34
  42. package/dist/packages/core/src/commands/insertContentAt.d.ts +0 -47
  43. package/dist/packages/core/src/commands/join.d.ts +0 -41
  44. package/dist/packages/core/src/commands/joinItemBackward.d.ts +0 -13
  45. package/dist/packages/core/src/commands/joinItemForward.d.ts +0 -13
  46. package/dist/packages/core/src/commands/joinTextblockBackward.d.ts +0 -12
  47. package/dist/packages/core/src/commands/joinTextblockForward.d.ts +0 -12
  48. package/dist/packages/core/src/commands/keyboardShortcut.d.ts +0 -14
  49. package/dist/packages/core/src/commands/lift.d.ts +0 -17
  50. package/dist/packages/core/src/commands/liftEmptyBlock.d.ts +0 -13
  51. package/dist/packages/core/src/commands/liftListItem.d.ts +0 -15
  52. package/dist/packages/core/src/commands/newlineInCode.d.ts +0 -13
  53. package/dist/packages/core/src/commands/resetAttributes.d.ts +0 -16
  54. package/dist/packages/core/src/commands/scrollIntoView.d.ts +0 -13
  55. package/dist/packages/core/src/commands/selectAll.d.ts +0 -13
  56. package/dist/packages/core/src/commands/selectNodeBackward.d.ts +0 -13
  57. package/dist/packages/core/src/commands/selectNodeForward.d.ts +0 -13
  58. package/dist/packages/core/src/commands/selectParentNode.d.ts +0 -13
  59. package/dist/packages/core/src/commands/selectTextblockEnd.d.ts +0 -13
  60. package/dist/packages/core/src/commands/selectTextblockStart.d.ts +0 -13
  61. package/dist/packages/core/src/commands/setContent.d.ts +0 -40
  62. package/dist/packages/core/src/commands/setMark.d.ts +0 -15
  63. package/dist/packages/core/src/commands/setMeta.d.ts +0 -16
  64. package/dist/packages/core/src/commands/setNode.d.ts +0 -16
  65. package/dist/packages/core/src/commands/setNodeSelection.d.ts +0 -14
  66. package/dist/packages/core/src/commands/setTextSelection.d.ts +0 -14
  67. package/dist/packages/core/src/commands/sinkListItem.d.ts +0 -15
  68. package/dist/packages/core/src/commands/splitBlock.d.ts +0 -17
  69. package/dist/packages/core/src/commands/splitListItem.d.ts +0 -16
  70. package/dist/packages/core/src/commands/toggleList.d.ts +0 -18
  71. package/dist/packages/core/src/commands/toggleMark.d.ts +0 -30
  72. package/dist/packages/core/src/commands/toggleNode.d.ts +0 -17
  73. package/dist/packages/core/src/commands/toggleWrap.d.ts +0 -16
  74. package/dist/packages/core/src/commands/undoInputRule.d.ts +0 -13
  75. package/dist/packages/core/src/commands/unsetAllMarks.d.ts +0 -13
  76. package/dist/packages/core/src/commands/unsetMark.d.ts +0 -25
  77. package/dist/packages/core/src/commands/updateAttributes.d.ts +0 -24
  78. package/dist/packages/core/src/commands/wrapIn.d.ts +0 -16
  79. package/dist/packages/core/src/commands/wrapInList.d.ts +0 -16
  80. package/dist/packages/core/src/extensions/clipboardTextSerializer.d.ts +0 -5
  81. package/dist/packages/core/src/extensions/commands.d.ts +0 -3
  82. package/dist/packages/core/src/extensions/editable.d.ts +0 -2
  83. package/dist/packages/core/src/extensions/focusEvents.d.ts +0 -2
  84. package/dist/packages/core/src/extensions/index.d.ts +0 -6
  85. package/dist/packages/core/src/extensions/keymap.d.ts +0 -2
  86. package/dist/packages/core/src/extensions/tabindex.d.ts +0 -2
  87. package/dist/packages/core/src/helpers/combineTransactionSteps.d.ts +0 -10
  88. package/dist/packages/core/src/helpers/createChainableState.d.ts +0 -10
  89. package/dist/packages/core/src/helpers/createDocument.d.ts +0 -12
  90. package/dist/packages/core/src/helpers/createNodeFromContent.d.ts +0 -15
  91. package/dist/packages/core/src/helpers/defaultBlockAt.d.ts +0 -7
  92. package/dist/packages/core/src/helpers/findChildren.d.ts +0 -9
  93. package/dist/packages/core/src/helpers/findChildrenInRange.d.ts +0 -10
  94. package/dist/packages/core/src/helpers/findParentNode.d.ts +0 -16
  95. package/dist/packages/core/src/helpers/findParentNodeClosestToPos.d.ts +0 -17
  96. package/dist/packages/core/src/helpers/generateHTML.d.ts +0 -8
  97. package/dist/packages/core/src/helpers/generateJSON.d.ts +0 -8
  98. package/dist/packages/core/src/helpers/generateText.d.ts +0 -12
  99. package/dist/packages/core/src/helpers/getAttributes.d.ts +0 -9
  100. package/dist/packages/core/src/helpers/getAttributesFromExtensions.d.ts +0 -6
  101. package/dist/packages/core/src/helpers/getChangedRanges.d.ts +0 -11
  102. package/dist/packages/core/src/helpers/getDebugJSON.d.ts +0 -8
  103. package/dist/packages/core/src/helpers/getExtensionField.d.ts +0 -9
  104. package/dist/packages/core/src/helpers/getHTMLFromFragment.d.ts +0 -2
  105. package/dist/packages/core/src/helpers/getMarkAttributes.d.ts +0 -3
  106. package/dist/packages/core/src/helpers/getMarkRange.d.ts +0 -3
  107. package/dist/packages/core/src/helpers/getMarkType.d.ts +0 -2
  108. package/dist/packages/core/src/helpers/getMarksBetween.d.ts +0 -3
  109. package/dist/packages/core/src/helpers/getNodeAtPosition.d.ts +0 -11
  110. package/dist/packages/core/src/helpers/getNodeAttributes.d.ts +0 -3
  111. package/dist/packages/core/src/helpers/getNodeType.d.ts +0 -2
  112. package/dist/packages/core/src/helpers/getRenderedAttributes.d.ts +0 -3
  113. package/dist/packages/core/src/helpers/getSchema.d.ts +0 -4
  114. package/dist/packages/core/src/helpers/getSchemaByResolvedExtensions.d.ts +0 -10
  115. package/dist/packages/core/src/helpers/getSchemaTypeByName.d.ts +0 -8
  116. package/dist/packages/core/src/helpers/getSchemaTypeNameByName.d.ts +0 -8
  117. package/dist/packages/core/src/helpers/getSplittedAttributes.d.ts +0 -9
  118. package/dist/packages/core/src/helpers/getText.d.ts +0 -15
  119. package/dist/packages/core/src/helpers/getTextBetween.d.ts +0 -14
  120. package/dist/packages/core/src/helpers/getTextContentFromNodes.d.ts +0 -8
  121. package/dist/packages/core/src/helpers/getTextSerializersFromSchema.d.ts +0 -8
  122. package/dist/packages/core/src/helpers/index.d.ts +0 -50
  123. package/dist/packages/core/src/helpers/injectExtensionAttributesToParseRule.d.ts +0 -9
  124. package/dist/packages/core/src/helpers/isActive.d.ts +0 -2
  125. package/dist/packages/core/src/helpers/isAtEndOfNode.d.ts +0 -2
  126. package/dist/packages/core/src/helpers/isAtStartOfNode.d.ts +0 -2
  127. package/dist/packages/core/src/helpers/isExtensionRulesEnabled.d.ts +0 -2
  128. package/dist/packages/core/src/helpers/isList.d.ts +0 -2
  129. package/dist/packages/core/src/helpers/isMarkActive.d.ts +0 -3
  130. package/dist/packages/core/src/helpers/isNodeActive.d.ts +0 -3
  131. package/dist/packages/core/src/helpers/isNodeEmpty.d.ts +0 -14
  132. package/dist/packages/core/src/helpers/isNodeSelection.d.ts +0 -2
  133. package/dist/packages/core/src/helpers/isTextSelection.d.ts +0 -2
  134. package/dist/packages/core/src/helpers/posToDOMRect.d.ts +0 -2
  135. package/dist/packages/core/src/helpers/resolveFocusPosition.d.ts +0 -4
  136. package/dist/packages/core/src/helpers/selectionToInsertionEnd.d.ts +0 -2
  137. package/dist/packages/core/src/helpers/splitExtensions.d.ts +0 -9
  138. package/dist/packages/core/src/index.d.ts +0 -24
  139. package/dist/packages/core/src/inputRules/index.d.ts +0 -5
  140. package/dist/packages/core/src/inputRules/markInputRule.d.ts +0 -13
  141. package/dist/packages/core/src/inputRules/nodeInputRule.d.ts +0 -23
  142. package/dist/packages/core/src/inputRules/textInputRule.d.ts +0 -10
  143. package/dist/packages/core/src/inputRules/textblockTypeInputRule.d.ts +0 -15
  144. package/dist/packages/core/src/inputRules/wrappingInputRule.d.ts +0 -28
  145. package/dist/packages/core/src/pasteRules/index.d.ts +0 -3
  146. package/dist/packages/core/src/pasteRules/markPasteRule.d.ts +0 -13
  147. package/dist/packages/core/src/pasteRules/nodePasteRule.d.ts +0 -14
  148. package/dist/packages/core/src/pasteRules/textPasteRule.d.ts +0 -10
  149. package/dist/packages/core/src/style.d.ts +0 -1
  150. package/dist/packages/core/src/types.d.ts +0 -253
  151. package/dist/packages/core/src/utilities/callOrReturn.d.ts +0 -9
  152. package/dist/packages/core/src/utilities/createStyleTag.d.ts +0 -1
  153. package/dist/packages/core/src/utilities/deleteProps.d.ts +0 -6
  154. package/dist/packages/core/src/utilities/elementFromString.d.ts +0 -1
  155. package/dist/packages/core/src/utilities/escapeForRegEx.d.ts +0 -1
  156. package/dist/packages/core/src/utilities/findDuplicates.d.ts +0 -1
  157. package/dist/packages/core/src/utilities/fromString.d.ts +0 -1
  158. package/dist/packages/core/src/utilities/index.d.ts +0 -20
  159. package/dist/packages/core/src/utilities/isAndroid.d.ts +0 -1
  160. package/dist/packages/core/src/utilities/isEmptyObject.d.ts +0 -1
  161. package/dist/packages/core/src/utilities/isFunction.d.ts +0 -1
  162. package/dist/packages/core/src/utilities/isMacOS.d.ts +0 -1
  163. package/dist/packages/core/src/utilities/isNumber.d.ts +0 -1
  164. package/dist/packages/core/src/utilities/isPlainObject.d.ts +0 -1
  165. package/dist/packages/core/src/utilities/isRegExp.d.ts +0 -1
  166. package/dist/packages/core/src/utilities/isString.d.ts +0 -1
  167. package/dist/packages/core/src/utilities/isiOS.d.ts +0 -1
  168. package/dist/packages/core/src/utilities/mergeAttributes.d.ts +0 -1
  169. package/dist/packages/core/src/utilities/mergeDeep.d.ts +0 -1
  170. package/dist/packages/core/src/utilities/minMax.d.ts +0 -1
  171. package/dist/packages/core/src/utilities/objectIncludes.d.ts +0 -8
  172. package/dist/packages/core/src/utilities/removeDuplicates.d.ts +0 -8
  173. package/dist/packages/extension-bubble-menu/src/bubble-menu-plugin.d.ts +0 -76
  174. package/dist/packages/extension-bubble-menu/src/bubble-menu.d.ts +0 -15
  175. package/dist/packages/extension-bubble-menu/src/index.d.ts +0 -4
  176. package/dist/packages/extension-floating-menu/src/floating-menu-plugin.d.ts +0 -66
  177. package/dist/packages/extension-floating-menu/src/floating-menu.d.ts +0 -15
  178. package/dist/packages/extension-floating-menu/src/index.d.ts +0 -4
  179. package/dist/packages/vue-3/src/BubbleMenu.d.ts +0 -59
  180. package/dist/packages/vue-3/src/Editor.d.ts +0 -23
  181. package/dist/packages/vue-3/src/EditorContent.d.ts +0 -17
  182. package/dist/packages/vue-3/src/FloatingMenu.d.ts +0 -48
  183. package/dist/packages/vue-3/src/NodeViewContent.d.ts +0 -13
  184. package/dist/packages/vue-3/src/NodeViewWrapper.d.ts +0 -13
  185. package/dist/packages/vue-3/src/VueNodeViewRenderer.d.ts +0 -48
  186. package/dist/packages/vue-3/src/VueRenderer.d.ts +0 -36
  187. package/dist/packages/vue-3/src/index.d.ts +0 -10
  188. package/dist/packages/vue-3/src/useEditor.d.ts +0 -3
package/dist/index.umd.js DELETED
@@ -1,508 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tiptap/extension-bubble-menu'), require('vue'), require('@tiptap/core'), require('@tiptap/extension-floating-menu')) :
3
- typeof define === 'function' && define.amd ? define(['exports', '@tiptap/extension-bubble-menu', 'vue', '@tiptap/core', '@tiptap/extension-floating-menu'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@tiptap/vue-3"] = {}, global.extensionBubbleMenu, global.vue, global.core, global.extensionFloatingMenu));
5
- })(this, (function (exports, extensionBubbleMenu, vue, core, extensionFloatingMenu) { 'use strict';
6
-
7
- const BubbleMenu = vue.defineComponent({
8
- name: 'BubbleMenu',
9
- props: {
10
- pluginKey: {
11
- type: [String, Object],
12
- default: 'bubbleMenu',
13
- },
14
- editor: {
15
- type: Object,
16
- required: true,
17
- },
18
- updateDelay: {
19
- type: Number,
20
- default: undefined,
21
- },
22
- tippyOptions: {
23
- type: Object,
24
- default: () => ({}),
25
- },
26
- shouldShow: {
27
- type: Function,
28
- default: null,
29
- },
30
- },
31
- setup(props, { slots }) {
32
- const root = vue.ref(null);
33
- vue.onMounted(() => {
34
- const { updateDelay, editor, pluginKey, shouldShow, tippyOptions, } = props;
35
- editor.registerPlugin(extensionBubbleMenu.BubbleMenuPlugin({
36
- updateDelay,
37
- editor,
38
- element: root.value,
39
- pluginKey,
40
- shouldShow,
41
- tippyOptions,
42
- }));
43
- });
44
- vue.onBeforeUnmount(() => {
45
- const { pluginKey, editor } = props;
46
- editor.unregisterPlugin(pluginKey);
47
- });
48
- return () => { var _a; return vue.h('div', { ref: root }, (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)); };
49
- },
50
- });
51
-
52
- /* eslint-disable react-hooks/rules-of-hooks */
53
- function useDebouncedRef(value) {
54
- return vue.customRef((track, trigger) => {
55
- return {
56
- get() {
57
- track();
58
- return value;
59
- },
60
- set(newValue) {
61
- // update state
62
- value = newValue;
63
- // update view as soon as possible
64
- requestAnimationFrame(() => {
65
- requestAnimationFrame(() => {
66
- trigger();
67
- });
68
- });
69
- },
70
- };
71
- });
72
- }
73
- class Editor extends core.Editor {
74
- constructor(options = {}) {
75
- super(options);
76
- this.contentComponent = null;
77
- this.appContext = null;
78
- this.reactiveState = useDebouncedRef(this.view.state);
79
- this.reactiveExtensionStorage = useDebouncedRef(this.extensionStorage);
80
- this.on('beforeTransaction', ({ nextState }) => {
81
- this.reactiveState.value = nextState;
82
- this.reactiveExtensionStorage.value = this.extensionStorage;
83
- });
84
- return vue.markRaw(this); // eslint-disable-line
85
- }
86
- get state() {
87
- return this.reactiveState ? this.reactiveState.value : this.view.state;
88
- }
89
- get storage() {
90
- return this.reactiveExtensionStorage ? this.reactiveExtensionStorage.value : super.storage;
91
- }
92
- /**
93
- * Register a ProseMirror plugin.
94
- */
95
- registerPlugin(plugin, handlePlugins) {
96
- super.registerPlugin(plugin, handlePlugins);
97
- this.reactiveState.value = this.view.state;
98
- }
99
- /**
100
- * Unregister a ProseMirror plugin.
101
- */
102
- unregisterPlugin(nameOrPluginKey) {
103
- super.unregisterPlugin(nameOrPluginKey);
104
- this.reactiveState.value = this.view.state;
105
- }
106
- }
107
-
108
- const EditorContent = vue.defineComponent({
109
- name: 'EditorContent',
110
- props: {
111
- editor: {
112
- default: null,
113
- type: Object,
114
- },
115
- },
116
- setup(props) {
117
- const rootEl = vue.ref();
118
- const instance = vue.getCurrentInstance();
119
- vue.watchEffect(() => {
120
- const editor = props.editor;
121
- if (editor && editor.options.element && rootEl.value) {
122
- vue.nextTick(() => {
123
- if (!rootEl.value || !editor.options.element.firstChild) {
124
- return;
125
- }
126
- const element = vue.unref(rootEl.value);
127
- rootEl.value.append(...editor.options.element.childNodes);
128
- // @ts-ignore
129
- editor.contentComponent = instance.ctx._;
130
- if (instance) {
131
- editor.appContext = {
132
- ...instance.appContext,
133
- // Vue internally uses prototype chain to forward/shadow injects across the entire component chain
134
- // so don't use object spread operator or 'Object.assign' and just set `provides` as is on editor's appContext
135
- // @ts-expect-error forward instance's 'provides' into appContext
136
- provides: instance.provides,
137
- };
138
- }
139
- editor.setOptions({
140
- element,
141
- });
142
- editor.createNodeViews();
143
- });
144
- }
145
- });
146
- vue.onBeforeUnmount(() => {
147
- const editor = props.editor;
148
- if (!editor) {
149
- return;
150
- }
151
- // destroy nodeviews before vue removes dom element
152
- if (!editor.isDestroyed) {
153
- editor.view.setProps({
154
- nodeViews: {},
155
- });
156
- }
157
- editor.contentComponent = null;
158
- editor.appContext = null;
159
- if (!editor.options.element.firstChild) {
160
- return;
161
- }
162
- const newElement = document.createElement('div');
163
- newElement.append(...editor.options.element.childNodes);
164
- editor.setOptions({
165
- element: newElement,
166
- });
167
- });
168
- return { rootEl };
169
- },
170
- render() {
171
- return vue.h('div', {
172
- ref: (el) => { this.rootEl = el; },
173
- });
174
- },
175
- });
176
-
177
- const FloatingMenu = vue.defineComponent({
178
- name: 'FloatingMenu',
179
- props: {
180
- pluginKey: {
181
- // TODO: TypeScript breaks :(
182
- // type: [String, Object as PropType<Exclude<FloatingMenuPluginProps['pluginKey'], string>>],
183
- type: null,
184
- default: 'floatingMenu',
185
- },
186
- editor: {
187
- type: Object,
188
- required: true,
189
- },
190
- tippyOptions: {
191
- type: Object,
192
- default: () => ({}),
193
- },
194
- shouldShow: {
195
- type: Function,
196
- default: null,
197
- },
198
- },
199
- setup(props, { slots }) {
200
- const root = vue.ref(null);
201
- vue.onMounted(() => {
202
- const { pluginKey, editor, tippyOptions, shouldShow, } = props;
203
- editor.registerPlugin(extensionFloatingMenu.FloatingMenuPlugin({
204
- pluginKey,
205
- editor,
206
- element: root.value,
207
- tippyOptions,
208
- shouldShow,
209
- }));
210
- });
211
- vue.onBeforeUnmount(() => {
212
- const { pluginKey, editor } = props;
213
- editor.unregisterPlugin(pluginKey);
214
- });
215
- return () => { var _a; return vue.h('div', { ref: root }, (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)); };
216
- },
217
- });
218
-
219
- const NodeViewContent = vue.defineComponent({
220
- name: 'NodeViewContent',
221
- props: {
222
- as: {
223
- type: String,
224
- default: 'div',
225
- },
226
- },
227
- render() {
228
- return vue.h(this.as, {
229
- style: {
230
- whiteSpace: 'pre-wrap',
231
- },
232
- 'data-node-view-content': '',
233
- });
234
- },
235
- });
236
-
237
- const NodeViewWrapper = vue.defineComponent({
238
- name: 'NodeViewWrapper',
239
- props: {
240
- as: {
241
- type: String,
242
- default: 'div',
243
- },
244
- },
245
- inject: ['onDragStart', 'decorationClasses'],
246
- render() {
247
- var _a, _b;
248
- return vue.h(this.as, {
249
- // @ts-ignore
250
- class: this.decorationClasses,
251
- style: {
252
- whiteSpace: 'normal',
253
- },
254
- 'data-node-view-wrapper': '',
255
- // @ts-ignore (https://github.com/vuejs/vue-next/issues/3031)
256
- onDragstart: this.onDragStart,
257
- }, (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a));
258
- },
259
- });
260
-
261
- const useEditor = (options = {}) => {
262
- const editor = vue.shallowRef();
263
- vue.onMounted(() => {
264
- editor.value = new Editor(options);
265
- });
266
- vue.onBeforeUnmount(() => {
267
- var _a;
268
- (_a = editor.value) === null || _a === void 0 ? void 0 : _a.destroy();
269
- });
270
- return editor;
271
- };
272
-
273
- /**
274
- * This class is used to render Vue components inside the editor.
275
- */
276
- class VueRenderer {
277
- constructor(component, { props = {}, editor }) {
278
- this.editor = editor;
279
- this.component = vue.markRaw(component);
280
- this.el = document.createElement('div');
281
- this.props = vue.reactive(props);
282
- this.renderedComponent = this.renderComponent();
283
- }
284
- get element() {
285
- return this.renderedComponent.el;
286
- }
287
- get ref() {
288
- var _a, _b, _c, _d;
289
- // Composition API
290
- if ((_b = (_a = this.renderedComponent.vNode) === null || _a === void 0 ? void 0 : _a.component) === null || _b === void 0 ? void 0 : _b.exposed) {
291
- return this.renderedComponent.vNode.component.exposed;
292
- }
293
- // Option API
294
- return (_d = (_c = this.renderedComponent.vNode) === null || _c === void 0 ? void 0 : _c.component) === null || _d === void 0 ? void 0 : _d.proxy;
295
- }
296
- renderComponent() {
297
- let vNode = vue.h(this.component, this.props);
298
- if (this.editor.appContext) {
299
- vNode.appContext = this.editor.appContext;
300
- }
301
- if (typeof document !== 'undefined' && this.el) {
302
- vue.render(vNode, this.el);
303
- }
304
- const destroy = () => {
305
- if (this.el) {
306
- vue.render(null, this.el);
307
- }
308
- this.el = null;
309
- vNode = null;
310
- };
311
- return { vNode, destroy, el: this.el ? this.el.firstElementChild : null };
312
- }
313
- updateProps(props = {}) {
314
- Object.entries(props).forEach(([key, value]) => {
315
- this.props[key] = value;
316
- });
317
- this.renderComponent();
318
- }
319
- destroy() {
320
- this.renderedComponent.destroy();
321
- }
322
- }
323
-
324
- const nodeViewProps = {
325
- editor: {
326
- type: Object,
327
- required: true,
328
- },
329
- node: {
330
- type: Object,
331
- required: true,
332
- },
333
- decorations: {
334
- type: Object,
335
- required: true,
336
- },
337
- selected: {
338
- type: Boolean,
339
- required: true,
340
- },
341
- extension: {
342
- type: Object,
343
- required: true,
344
- },
345
- getPos: {
346
- type: Function,
347
- required: true,
348
- },
349
- updateAttributes: {
350
- type: Function,
351
- required: true,
352
- },
353
- deleteNode: {
354
- type: Function,
355
- required: true,
356
- },
357
- };
358
- class VueNodeView extends core.NodeView {
359
- mount() {
360
- const props = {
361
- editor: this.editor,
362
- node: this.node,
363
- decorations: this.decorations,
364
- selected: false,
365
- extension: this.extension,
366
- getPos: () => this.getPos(),
367
- updateAttributes: (attributes = {}) => this.updateAttributes(attributes),
368
- deleteNode: () => this.deleteNode(),
369
- };
370
- const onDragStart = this.onDragStart.bind(this);
371
- this.decorationClasses = vue.ref(this.getDecorationClasses());
372
- const extendedComponent = vue.defineComponent({
373
- extends: { ...this.component },
374
- props: Object.keys(props),
375
- template: this.component.template,
376
- setup: reactiveProps => {
377
- var _a, _b;
378
- vue.provide('onDragStart', onDragStart);
379
- vue.provide('decorationClasses', this.decorationClasses);
380
- return (_b = (_a = this.component).setup) === null || _b === void 0 ? void 0 : _b.call(_a, reactiveProps, {
381
- expose: () => undefined,
382
- });
383
- },
384
- // add support for scoped styles
385
- // @ts-ignore
386
- // eslint-disable-next-line
387
- __scopeId: this.component.__scopeId,
388
- // add support for CSS Modules
389
- // @ts-ignore
390
- // eslint-disable-next-line
391
- __cssModules: this.component.__cssModules,
392
- // add support for vue devtools
393
- // @ts-ignore
394
- // eslint-disable-next-line
395
- __name: this.component.__name,
396
- // @ts-ignore
397
- // eslint-disable-next-line
398
- __file: this.component.__file,
399
- });
400
- this.renderer = new VueRenderer(extendedComponent, {
401
- editor: this.editor,
402
- props,
403
- });
404
- }
405
- get dom() {
406
- if (!this.renderer.element || !this.renderer.element.hasAttribute('data-node-view-wrapper')) {
407
- throw Error('Please use the NodeViewWrapper component for your node view.');
408
- }
409
- return this.renderer.element;
410
- }
411
- get contentDOM() {
412
- if (this.node.isLeaf) {
413
- return null;
414
- }
415
- return this.dom.querySelector('[data-node-view-content]');
416
- }
417
- update(node, decorations) {
418
- const updateProps = (props) => {
419
- this.decorationClasses.value = this.getDecorationClasses();
420
- this.renderer.updateProps(props);
421
- };
422
- if (typeof this.options.update === 'function') {
423
- const oldNode = this.node;
424
- const oldDecorations = this.decorations;
425
- this.node = node;
426
- this.decorations = decorations;
427
- return this.options.update({
428
- oldNode,
429
- oldDecorations,
430
- newNode: node,
431
- newDecorations: decorations,
432
- updateProps: () => updateProps({ node, decorations }),
433
- });
434
- }
435
- if (node.type !== this.node.type) {
436
- return false;
437
- }
438
- if (node === this.node && this.decorations === decorations) {
439
- return true;
440
- }
441
- this.node = node;
442
- this.decorations = decorations;
443
- updateProps({ node, decorations });
444
- return true;
445
- }
446
- selectNode() {
447
- this.renderer.updateProps({
448
- selected: true,
449
- });
450
- if (this.renderer.element) {
451
- this.renderer.element.classList.add('ProseMirror-selectednode');
452
- }
453
- }
454
- deselectNode() {
455
- this.renderer.updateProps({
456
- selected: false,
457
- });
458
- if (this.renderer.element) {
459
- this.renderer.element.classList.remove('ProseMirror-selectednode');
460
- }
461
- }
462
- getDecorationClasses() {
463
- return (this.decorations
464
- // @ts-ignore
465
- .map(item => item.type.attrs.class)
466
- .flat()
467
- .join(' '));
468
- }
469
- destroy() {
470
- this.renderer.destroy();
471
- }
472
- }
473
- function VueNodeViewRenderer(component, options) {
474
- return (props) => {
475
- // try to get the parent component
476
- // this is important for vue devtools to show the component hierarchy correctly
477
- // maybe it’s `undefined` because <editor-content> isn’t rendered yet
478
- if (!props.editor.contentComponent) {
479
- return {};
480
- }
481
- // check for class-component and normalize if neccessary
482
- const normalizedComponent = typeof component === 'function' && '__vccOpts' in component
483
- // eslint-disable-next-line no-underscore-dangle
484
- ? component.__vccOpts
485
- : component;
486
- return new VueNodeView(normalizedComponent, props, options);
487
- };
488
- }
489
-
490
- exports.BubbleMenu = BubbleMenu;
491
- exports.Editor = Editor;
492
- exports.EditorContent = EditorContent;
493
- exports.FloatingMenu = FloatingMenu;
494
- exports.NodeViewContent = NodeViewContent;
495
- exports.NodeViewWrapper = NodeViewWrapper;
496
- exports.VueNodeViewRenderer = VueNodeViewRenderer;
497
- exports.VueRenderer = VueRenderer;
498
- exports.nodeViewProps = nodeViewProps;
499
- exports.useEditor = useEditor;
500
- Object.keys(core).forEach(function (k) {
501
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
502
- enumerable: true,
503
- get: function () { return core[k]; }
504
- });
505
- });
506
-
507
- }));
508
- //# sourceMappingURL=index.umd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.umd.js","sources":["../src/BubbleMenu.ts","../src/Editor.ts","../src/EditorContent.ts","../src/FloatingMenu.ts","../src/NodeViewContent.ts","../src/NodeViewWrapper.ts","../src/useEditor.ts","../src/VueRenderer.ts","../src/VueNodeViewRenderer.ts"],"sourcesContent":["import { BubbleMenuPlugin, BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu'\nimport {\n defineComponent,\n h,\n onBeforeUnmount,\n onMounted,\n PropType,\n ref,\n} from 'vue'\n\nexport const BubbleMenu = defineComponent({\n name: 'BubbleMenu',\n\n props: {\n pluginKey: {\n type: [String, Object] as PropType<BubbleMenuPluginProps['pluginKey']>,\n default: 'bubbleMenu',\n },\n\n editor: {\n type: Object as PropType<BubbleMenuPluginProps['editor']>,\n required: true,\n },\n\n updateDelay: {\n type: Number as PropType<BubbleMenuPluginProps['updateDelay']>,\n default: undefined,\n },\n\n tippyOptions: {\n type: Object as PropType<BubbleMenuPluginProps['tippyOptions']>,\n default: () => ({}),\n },\n\n shouldShow: {\n type: Function as PropType<Exclude<Required<BubbleMenuPluginProps>['shouldShow'], null>>,\n default: null,\n },\n },\n\n setup(props, { slots }) {\n const root = ref<HTMLElement | null>(null)\n\n onMounted(() => {\n const {\n updateDelay,\n editor,\n pluginKey,\n shouldShow,\n tippyOptions,\n } = props\n\n editor.registerPlugin(BubbleMenuPlugin({\n updateDelay,\n editor,\n element: root.value as HTMLElement,\n pluginKey,\n shouldShow,\n tippyOptions,\n }))\n })\n\n onBeforeUnmount(() => {\n const { pluginKey, editor } = props\n\n editor.unregisterPlugin(pluginKey)\n })\n\n return () => h('div', { ref: root }, slots.default?.())\n },\n})\n","/* eslint-disable react-hooks/rules-of-hooks */\nimport { Editor as CoreEditor, EditorOptions } from '@tiptap/core'\nimport { EditorState, Plugin, PluginKey } from '@tiptap/pm/state'\nimport {\n AppContext,\n ComponentInternalInstance,\n ComponentPublicInstance,\n customRef,\n markRaw,\n Ref,\n} from 'vue'\n\nfunction useDebouncedRef<T>(value: T) {\n return customRef<T>((track, trigger) => {\n return {\n get() {\n track()\n return value\n },\n set(newValue) {\n // update state\n value = newValue\n\n // update view as soon as possible\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n trigger()\n })\n })\n },\n }\n })\n}\n\nexport type ContentComponent = ComponentInternalInstance & {\n ctx: ComponentPublicInstance\n}\n\nexport class Editor extends CoreEditor {\n private reactiveState: Ref<EditorState>\n\n private reactiveExtensionStorage: Ref<Record<string, any>>\n\n public contentComponent: ContentComponent | null = null\n\n public appContext: AppContext | null = null\n\n constructor(options: Partial<EditorOptions> = {}) {\n super(options)\n\n this.reactiveState = useDebouncedRef(this.view.state)\n this.reactiveExtensionStorage = useDebouncedRef(this.extensionStorage)\n\n this.on('beforeTransaction', ({ nextState }) => {\n this.reactiveState.value = nextState\n this.reactiveExtensionStorage.value = this.extensionStorage\n })\n\n return markRaw(this) // eslint-disable-line\n }\n\n get state() {\n return this.reactiveState ? this.reactiveState.value : this.view.state\n }\n\n get storage() {\n return this.reactiveExtensionStorage ? this.reactiveExtensionStorage.value : super.storage\n }\n\n /**\n * Register a ProseMirror plugin.\n */\n public registerPlugin(\n plugin: Plugin,\n handlePlugins?: (newPlugin: Plugin, plugins: Plugin[]) => Plugin[],\n ): void {\n super.registerPlugin(plugin, handlePlugins)\n this.reactiveState.value = this.view.state\n }\n\n /**\n * Unregister a ProseMirror plugin.\n */\n public unregisterPlugin(nameOrPluginKey: string | PluginKey): void {\n super.unregisterPlugin(nameOrPluginKey)\n this.reactiveState.value = this.view.state\n }\n}\n","import {\n defineComponent,\n getCurrentInstance,\n h,\n nextTick,\n onBeforeUnmount,\n PropType,\n Ref,\n ref,\n unref,\n watchEffect,\n} from 'vue'\n\nimport { Editor } from './Editor.js'\n\nexport const EditorContent = defineComponent({\n name: 'EditorContent',\n\n props: {\n editor: {\n default: null,\n type: Object as PropType<Editor>,\n },\n },\n\n setup(props) {\n const rootEl: Ref<Element | undefined> = ref()\n const instance = getCurrentInstance()\n\n watchEffect(() => {\n const editor = props.editor\n\n if (editor && editor.options.element && rootEl.value) {\n nextTick(() => {\n if (!rootEl.value || !editor.options.element.firstChild) {\n return\n }\n\n const element = unref(rootEl.value)\n\n rootEl.value.append(...editor.options.element.childNodes)\n\n // @ts-ignore\n editor.contentComponent = instance.ctx._\n\n if (instance) {\n editor.appContext = {\n ...instance.appContext,\n // Vue internally uses prototype chain to forward/shadow injects across the entire component chain\n // so don't use object spread operator or 'Object.assign' and just set `provides` as is on editor's appContext\n // @ts-expect-error forward instance's 'provides' into appContext\n provides: instance.provides,\n }\n }\n\n editor.setOptions({\n element,\n })\n\n editor.createNodeViews()\n })\n }\n })\n\n onBeforeUnmount(() => {\n const editor = props.editor\n\n if (!editor) {\n return\n }\n\n // destroy nodeviews before vue removes dom element\n if (!editor.isDestroyed) {\n editor.view.setProps({\n nodeViews: {},\n })\n }\n\n editor.contentComponent = null\n editor.appContext = 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 return { rootEl }\n },\n\n render() {\n return h(\n 'div',\n {\n ref: (el: any) => { this.rootEl = el },\n },\n )\n },\n})\n","import { FloatingMenuPlugin, FloatingMenuPluginProps } from '@tiptap/extension-floating-menu'\nimport {\n defineComponent,\n h,\n onBeforeUnmount,\n onMounted,\n PropType,\n ref,\n} from 'vue'\n\nexport const FloatingMenu = defineComponent({\n name: 'FloatingMenu',\n\n props: {\n pluginKey: {\n // TODO: TypeScript breaks :(\n // type: [String, Object as PropType<Exclude<FloatingMenuPluginProps['pluginKey'], string>>],\n type: null,\n default: 'floatingMenu',\n },\n\n editor: {\n type: Object as PropType<FloatingMenuPluginProps['editor']>,\n required: true,\n },\n\n tippyOptions: {\n type: Object as PropType<FloatingMenuPluginProps['tippyOptions']>,\n default: () => ({}),\n },\n\n shouldShow: {\n type: Function as PropType<Exclude<Required<FloatingMenuPluginProps>['shouldShow'], null>>,\n default: null,\n },\n },\n\n setup(props, { slots }) {\n const root = ref<HTMLElement | null>(null)\n\n onMounted(() => {\n const {\n pluginKey,\n editor,\n tippyOptions,\n shouldShow,\n } = props\n\n editor.registerPlugin(FloatingMenuPlugin({\n pluginKey,\n editor,\n element: root.value as HTMLElement,\n tippyOptions,\n shouldShow,\n }))\n })\n\n onBeforeUnmount(() => {\n const { pluginKey, editor } = props\n\n editor.unregisterPlugin(pluginKey)\n })\n\n return () => h('div', { ref: root }, slots.default?.())\n },\n})\n","import { defineComponent, h } from 'vue'\n\nexport const NodeViewContent = defineComponent({\n name: 'NodeViewContent',\n\n props: {\n as: {\n type: String,\n default: 'div',\n },\n },\n\n render() {\n return h(this.as, {\n style: {\n whiteSpace: 'pre-wrap',\n },\n 'data-node-view-content': '',\n })\n },\n})\n","import { defineComponent, h } from 'vue'\n\nexport const NodeViewWrapper = defineComponent({\n name: 'NodeViewWrapper',\n\n props: {\n as: {\n type: String,\n default: 'div',\n },\n },\n\n inject: ['onDragStart', 'decorationClasses'],\n\n render() {\n return h(\n this.as,\n {\n // @ts-ignore\n class: this.decorationClasses,\n style: {\n whiteSpace: 'normal',\n },\n 'data-node-view-wrapper': '',\n // @ts-ignore (https://github.com/vuejs/vue-next/issues/3031)\n onDragstart: this.onDragStart,\n },\n this.$slots.default?.(),\n )\n },\n})\n","import { EditorOptions } from '@tiptap/core'\nimport { onBeforeUnmount, onMounted, shallowRef } from 'vue'\n\nimport { Editor } from './Editor.js'\n\nexport const useEditor = (options: Partial<EditorOptions> = {}) => {\n const editor = shallowRef<Editor>()\n\n onMounted(() => {\n editor.value = new Editor(options)\n })\n\n onBeforeUnmount(() => {\n editor.value?.destroy()\n })\n\n return editor\n}\n","import { Editor } from '@tiptap/core'\nimport {\n Component, DefineComponent, h, markRaw, reactive, render,\n} from 'vue'\n\nimport { Editor as ExtendedEditor } from './Editor.js'\n\nexport interface VueRendererOptions {\n editor: Editor;\n props?: Record<string, any>;\n}\n\ntype ExtendedVNode = ReturnType<typeof h> | null;\n\ninterface RenderedComponent {\n vNode: ExtendedVNode;\n destroy: () => void;\n el: Element | null;\n}\n\n/**\n * This class is used to render Vue components inside the editor.\n */\nexport class VueRenderer {\n renderedComponent!: RenderedComponent\n\n editor: ExtendedEditor\n\n component: Component\n\n el: Element | null\n\n props: Record<string, any>\n\n constructor(component: Component, { props = {}, editor }: VueRendererOptions) {\n this.editor = editor as ExtendedEditor\n this.component = markRaw(component)\n this.el = document.createElement('div')\n this.props = reactive(props)\n this.renderedComponent = this.renderComponent()\n }\n\n get element(): Element | null {\n return this.renderedComponent.el\n }\n\n get ref(): any {\n // Composition API\n if (this.renderedComponent.vNode?.component?.exposed) {\n return this.renderedComponent.vNode.component.exposed\n }\n // Option API\n return this.renderedComponent.vNode?.component?.proxy\n }\n\n renderComponent() {\n let vNode: ExtendedVNode = h(this.component as DefineComponent, this.props)\n\n if (this.editor.appContext) {\n vNode.appContext = this.editor.appContext\n }\n if (typeof document !== 'undefined' && this.el) {\n render(vNode, this.el)\n }\n\n const destroy = () => {\n if (this.el) {\n render(null, this.el)\n }\n this.el = null\n vNode = null\n }\n\n return { vNode, destroy, el: this.el ? this.el.firstElementChild : null }\n }\n\n updateProps(props: Record<string, any> = {}): void {\n Object.entries(props).forEach(([key, value]) => {\n this.props[key] = value\n })\n this.renderComponent()\n }\n\n destroy(): void {\n this.renderedComponent.destroy()\n }\n}\n","import {\n DecorationWithType,\n NodeView,\n NodeViewProps,\n NodeViewRenderer,\n NodeViewRendererOptions,\n NodeViewRendererProps,\n} from '@tiptap/core'\nimport { Node as ProseMirrorNode } from '@tiptap/pm/model'\nimport { Decoration, NodeView as ProseMirrorNodeView } from '@tiptap/pm/view'\nimport {\n Component,\n defineComponent,\n PropType,\n provide,\n Ref,\n ref,\n} from 'vue'\n\nimport { Editor } from './Editor.js'\nimport { VueRenderer } from './VueRenderer.js'\n\nexport const nodeViewProps = {\n editor: {\n type: Object as PropType<NodeViewProps['editor']>,\n required: true as const,\n },\n node: {\n type: Object as PropType<NodeViewProps['node']>,\n required: true as const,\n },\n decorations: {\n type: Object as PropType<NodeViewProps['decorations']>,\n required: true as const,\n },\n selected: {\n type: Boolean as PropType<NodeViewProps['selected']>,\n required: true as const,\n },\n extension: {\n type: Object as PropType<NodeViewProps['extension']>,\n required: true as const,\n },\n getPos: {\n type: Function as PropType<NodeViewProps['getPos']>,\n required: true as const,\n },\n updateAttributes: {\n type: Function as PropType<NodeViewProps['updateAttributes']>,\n required: true as const,\n },\n deleteNode: {\n type: Function as PropType<NodeViewProps['deleteNode']>,\n required: true as const,\n },\n}\n\nexport interface VueNodeViewRendererOptions extends NodeViewRendererOptions {\n update:\n | ((props: {\n oldNode: ProseMirrorNode\n oldDecorations: Decoration[]\n newNode: ProseMirrorNode\n newDecorations: Decoration[]\n updateProps: () => void\n }) => boolean)\n | null\n}\n\nclass VueNodeView extends NodeView<Component, Editor, VueNodeViewRendererOptions> {\n renderer!: VueRenderer\n\n decorationClasses!: Ref<string>\n\n mount() {\n const props: 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 = ref(this.getDecorationClasses())\n\n const extendedComponent = defineComponent({\n extends: { ...this.component },\n props: Object.keys(props),\n template: (this.component as any).template,\n setup: reactiveProps => {\n provide('onDragStart', onDragStart)\n provide('decorationClasses', this.decorationClasses)\n\n return (this.component as any).setup?.(reactiveProps, {\n expose: () => undefined,\n })\n },\n // add support for scoped styles\n // @ts-ignore\n // eslint-disable-next-line\n __scopeId: this.component.__scopeId,\n // add support for CSS Modules\n // @ts-ignore\n // eslint-disable-next-line\n __cssModules: this.component.__cssModules,\n // add support for vue devtools\n // @ts-ignore\n // eslint-disable-next-line\n __name: this.component.__name,\n // @ts-ignore\n // eslint-disable-next-line\n __file: this.component.__file,\n })\n\n this.renderer = new VueRenderer(extendedComponent, {\n editor: this.editor,\n props,\n })\n }\n\n get dom() {\n if (!this.renderer.element || !this.renderer.element.hasAttribute('data-node-view-wrapper')) {\n throw Error('Please use the NodeViewWrapper component for your node view.')\n }\n\n return this.renderer.element as HTMLElement\n }\n\n get contentDOM() {\n if (this.node.isLeaf) {\n return null\n }\n\n return this.dom.querySelector('[data-node-view-content]') as HTMLElement | null\n }\n\n update(node: ProseMirrorNode, decorations: DecorationWithType[]) {\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 if (this.renderer.element) {\n this.renderer.element.classList.add('ProseMirror-selectednode')\n }\n }\n\n deselectNode() {\n this.renderer.updateProps({\n selected: false,\n })\n if (this.renderer.element) {\n this.renderer.element.classList.remove('ProseMirror-selectednode')\n }\n }\n\n getDecorationClasses() {\n return (\n this.decorations\n // @ts-ignore\n .map(item => item.type.attrs.class)\n .flat()\n .join(' ')\n )\n }\n\n destroy() {\n this.renderer.destroy()\n }\n}\n\nexport function VueNodeViewRenderer(\n component: Component,\n options?: Partial<VueNodeViewRendererOptions>,\n): 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 // check for class-component and normalize if neccessary\n const normalizedComponent = typeof component === 'function' && '__vccOpts' in component\n // eslint-disable-next-line no-underscore-dangle\n ? component.__vccOpts as Component\n : component\n\n return new VueNodeView(normalizedComponent, props, options) as unknown as ProseMirrorNodeView\n }\n}\n"],"names":["defineComponent","ref","onMounted","BubbleMenuPlugin","onBeforeUnmount","h","customRef","CoreEditor","markRaw","getCurrentInstance","watchEffect","nextTick","unref","FloatingMenuPlugin","shallowRef","reactive","render","NodeView","provide"],"mappings":";;;;;;AAUO,QAAM,UAAU,GAAGA,mBAAe,CAAC;EACxC,IAAA,IAAI,EAAE,YAAY;EAElB,IAAA,KAAK,EAAE;EACL,QAAA,SAAS,EAAE;EACT,YAAA,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAiD;EACtE,YAAA,OAAO,EAAE,YAAY;EACtB,SAAA;EAED,QAAA,MAAM,EAAE;EACN,YAAA,IAAI,EAAE,MAAmD;EACzD,YAAA,QAAQ,EAAE,IAAI;EACf,SAAA;EAED,QAAA,WAAW,EAAE;EACX,YAAA,IAAI,EAAE,MAAwD;EAC9D,YAAA,OAAO,EAAE,SAAS;EACnB,SAAA;EAED,QAAA,YAAY,EAAE;EACZ,YAAA,IAAI,EAAE,MAAyD;EAC/D,YAAA,OAAO,EAAE,OAAO,EAAE,CAAC;EACpB,SAAA;EAED,QAAA,UAAU,EAAE;EACV,YAAA,IAAI,EAAE,QAAkF;EACxF,YAAA,OAAO,EAAE,IAAI;EACd,SAAA;EACF,KAAA;EAED,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAA;EACpB,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AC,CAAA;WACnE;OACF;MAED,oBAAoB,GAAA;UAClB,QACE,IAAI,CAAC,WAAW;;EAEb,aAAA,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;EAClC,aAAA,IAAI,EAAE;EACN,aAAA,IAAI,CAAC,GAAG,CAAC,EACb;OACF;MAED,OAAO,GAAA;EACL,QAAA,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAA;OACxB;EACF,CAAA;EAEe,SAAA,mBAAmB,CACjC,SAAoB,EACpB,OAA6C,EAAA;MAE7C,OAAO,CAAC,KAA4B,KAAI;;;;EAItC,QAAA,IAAI,CAAE,KAAK,CAAC,MAAiB,CAAC,gBAAgB,EAAE;EAC9C,YAAA,OAAO,EAAE,CAAA;WACV;;UAED,MAAM,mBAAmB,GAAG,OAAO,SAAS,KAAK,UAAU,IAAI,WAAW,IAAI,SAAS;;gBAEnF,SAAS,CAAC,SAAsB;gBAChC,SAAS,CAAA;UAEb,OAAO,IAAI,WAAW,CAAC,mBAAmB,EAAE,KAAK,EAAE,OAAO,CAAmC,CAAA;EAC/F,KAAC,CAAA;EACH;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,20 +0,0 @@
1
- import { EditorState, Transaction } from '@tiptap/pm/state';
2
- import { Editor } from './Editor.js';
3
- import { AnyCommands, CanCommands, ChainedCommands, CommandProps, SingleCommands } from './types.js';
4
- export declare class CommandManager {
5
- editor: Editor;
6
- rawCommands: AnyCommands;
7
- customState?: EditorState;
8
- constructor(props: {
9
- editor: Editor;
10
- state?: EditorState;
11
- });
12
- get hasCustomState(): boolean;
13
- get state(): EditorState;
14
- get commands(): SingleCommands;
15
- get chain(): () => ChainedCommands;
16
- get can(): () => CanCommands;
17
- createChain(startTr?: Transaction, shouldDispatch?: boolean): ChainedCommands;
18
- createCan(startTr?: Transaction): CanCommands;
19
- buildProps(tr: Transaction, shouldDispatch?: boolean): CommandProps;
20
- }