@tiptap/vue-3 3.0.0-next.4 → 3.0.0-next.5

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/dist/index.d.cts CHANGED
@@ -1,96 +1,11 @@
1
- import * as _floating_ui_dom from '@floating-ui/dom';
2
- import { EditorState, PluginKey } from 'prosemirror-state';
3
- import { EditorView } from 'prosemirror-view';
4
- import * as _tiptap_core from '@tiptap/core';
5
- import { Editor as Editor$1, EditorOptions, NodeViewProps, NodeViewRendererOptions, NodeViewRenderer } from '@tiptap/core';
1
+ import { Editor as Editor$1, EditorOptions, Storage, MarkViewRendererOptions, MarkViewProps, MarkView, MarkViewRenderer, NodeViewProps, NodeViewRendererOptions, NodeViewRenderer } from '@tiptap/core';
6
2
  export * from '@tiptap/core';
3
+ import { EditorState, Plugin, PluginKey } from '@tiptap/pm/state';
7
4
  import * as vue from 'vue';
8
- import { PropType, AppContext, ComponentInternalInstance, ComponentPublicInstance, Ref, Component, h } from 'vue';
9
- import { BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu';
10
- import { EditorState as EditorState$1, Plugin, PluginKey as PluginKey$1 } from '@tiptap/pm/state';
11
- import { FloatingMenuPluginProps } from '@tiptap/extension-floating-menu';
5
+ import { AppContext, ComponentInternalInstance, ComponentPublicInstance, PropType, Ref, Component, h } from 'vue';
12
6
  import { Node } from '@tiptap/pm/model';
13
7
  import { Decoration, DecorationSource } from '@tiptap/pm/view';
14
8
 
15
- declare const BubbleMenu: vue.DefineComponent<vue.ExtractPropTypes<{
16
- pluginKey: {
17
- type: PropType<BubbleMenuPluginProps["pluginKey"]>;
18
- default: string;
19
- };
20
- editor: {
21
- type: PropType<BubbleMenuPluginProps["editor"]>;
22
- required: true;
23
- };
24
- updateDelay: {
25
- type: PropType<BubbleMenuPluginProps["updateDelay"]>;
26
- default: undefined;
27
- };
28
- resizeDelay: {
29
- type: PropType<BubbleMenuPluginProps["resizeDelay"]>;
30
- default: undefined;
31
- };
32
- options: {
33
- type: PropType<BubbleMenuPluginProps["options"]>;
34
- default: () => {};
35
- };
36
- shouldShow: {
37
- type: PropType<Exclude<Required<BubbleMenuPluginProps>["shouldShow"], null>>;
38
- default: null;
39
- };
40
- }>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
41
- [key: string]: any;
42
- }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
43
- pluginKey: {
44
- type: PropType<BubbleMenuPluginProps["pluginKey"]>;
45
- default: string;
46
- };
47
- editor: {
48
- type: PropType<BubbleMenuPluginProps["editor"]>;
49
- required: true;
50
- };
51
- updateDelay: {
52
- type: PropType<BubbleMenuPluginProps["updateDelay"]>;
53
- default: undefined;
54
- };
55
- resizeDelay: {
56
- type: PropType<BubbleMenuPluginProps["resizeDelay"]>;
57
- default: undefined;
58
- };
59
- options: {
60
- type: PropType<BubbleMenuPluginProps["options"]>;
61
- default: () => {};
62
- };
63
- shouldShow: {
64
- type: PropType<Exclude<Required<BubbleMenuPluginProps>["shouldShow"], null>>;
65
- default: null;
66
- };
67
- }>> & Readonly<{}>, {
68
- updateDelay: number | undefined;
69
- resizeDelay: number | undefined;
70
- shouldShow: (props: {
71
- editor: _tiptap_core.Editor;
72
- element: HTMLElement;
73
- view: EditorView;
74
- state: EditorState;
75
- oldState?: EditorState;
76
- from: number;
77
- to: number;
78
- }) => boolean;
79
- options: {
80
- strategy?: "absolute" | "fixed";
81
- placement?: "top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end";
82
- offset?: Parameters<typeof _floating_ui_dom.offset>[0] | boolean;
83
- flip?: Parameters<typeof _floating_ui_dom.flip>[0] | boolean;
84
- shift?: Parameters<typeof _floating_ui_dom.shift>[0] | boolean;
85
- arrow?: Parameters<typeof _floating_ui_dom.arrow>[0] | false;
86
- size?: Parameters<typeof _floating_ui_dom.size>[0] | boolean;
87
- autoPlacement?: Parameters<typeof _floating_ui_dom.autoPlacement>[0] | boolean;
88
- hide?: Parameters<typeof _floating_ui_dom.hide>[0] | boolean;
89
- inline?: Parameters<typeof _floating_ui_dom.inline>[0] | boolean;
90
- } | undefined;
91
- pluginKey: string | PluginKey<any>;
92
- }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
93
-
94
9
  type ContentComponent = ComponentInternalInstance & {
95
10
  ctx: ComponentPublicInstance;
96
11
  };
@@ -100,16 +15,16 @@ declare class Editor extends Editor$1 {
100
15
  contentComponent: ContentComponent | null;
101
16
  appContext: AppContext | null;
102
17
  constructor(options?: Partial<EditorOptions>);
103
- get state(): EditorState$1;
104
- get storage(): Record<string, any>;
18
+ get state(): EditorState;
19
+ get storage(): Storage;
105
20
  /**
106
21
  * Register a ProseMirror plugin.
107
22
  */
108
- registerPlugin(plugin: Plugin, handlePlugins?: (newPlugin: Plugin, plugins: Plugin[]) => Plugin[]): EditorState$1;
23
+ registerPlugin(plugin: Plugin, handlePlugins?: (newPlugin: Plugin, plugins: Plugin[]) => Plugin[]): EditorState;
109
24
  /**
110
25
  * Unregister a ProseMirror plugin.
111
26
  */
112
- unregisterPlugin(nameOrPluginKey: string | PluginKey$1): EditorState$1 | undefined;
27
+ unregisterPlugin(nameOrPluginKey: string | PluginKey): EditorState | undefined;
113
28
  }
114
29
 
115
30
  declare const EditorContent: vue.DefineComponent<vue.ExtractPropTypes<{
@@ -128,67 +43,21 @@ declare const EditorContent: vue.DefineComponent<vue.ExtractPropTypes<{
128
43
  editor: Editor;
129
44
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
130
45
 
131
- declare const FloatingMenu: vue.DefineComponent<vue.ExtractPropTypes<{
132
- pluginKey: {
133
- type: null;
46
+ declare const NodeViewContent: vue.DefineComponent<vue.ExtractPropTypes<{
47
+ as: {
48
+ type: StringConstructor;
134
49
  default: string;
135
50
  };
136
- editor: {
137
- type: PropType<FloatingMenuPluginProps["editor"]>;
138
- required: true;
139
- };
140
- options: {
141
- type: PropType<FloatingMenuPluginProps["options"]>;
142
- default: () => {};
143
- };
144
- shouldShow: {
145
- type: PropType<Exclude<Required<FloatingMenuPluginProps>["shouldShow"], null>>;
146
- default: null;
147
- };
148
- }>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
149
- [key: string]: any;
150
- }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
151
- pluginKey: {
152
- type: null;
51
+ }>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
52
+ as: {
53
+ type: StringConstructor;
153
54
  default: string;
154
55
  };
155
- editor: {
156
- type: PropType<FloatingMenuPluginProps["editor"]>;
157
- required: true;
158
- };
159
- options: {
160
- type: PropType<FloatingMenuPluginProps["options"]>;
161
- default: () => {};
162
- };
163
- shouldShow: {
164
- type: PropType<Exclude<Required<FloatingMenuPluginProps>["shouldShow"], null>>;
165
- default: null;
166
- };
167
56
  }>> & Readonly<{}>, {
168
- shouldShow: (props: {
169
- editor: _tiptap_core.Editor;
170
- view: EditorView;
171
- state: EditorState;
172
- oldState?: EditorState;
173
- from: number;
174
- to: number;
175
- }) => boolean;
176
- options: {
177
- strategy?: "absolute" | "fixed";
178
- placement?: "top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end";
179
- offset?: Parameters<typeof _floating_ui_dom.offset>[0] | boolean;
180
- flip?: Parameters<typeof _floating_ui_dom.flip>[0] | boolean;
181
- shift?: Parameters<typeof _floating_ui_dom.shift>[0] | boolean;
182
- arrow?: Parameters<typeof _floating_ui_dom.arrow>[0] | false;
183
- size?: Parameters<typeof _floating_ui_dom.size>[0] | boolean;
184
- autoPlacement?: Parameters<typeof _floating_ui_dom.autoPlacement>[0] | boolean;
185
- hide?: Parameters<typeof _floating_ui_dom.hide>[0] | boolean;
186
- inline?: Parameters<typeof _floating_ui_dom.inline>[0] | boolean;
187
- } | undefined;
188
- pluginKey: any;
57
+ as: string;
189
58
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
190
59
 
191
- declare const NodeViewContent: vue.DefineComponent<vue.ExtractPropTypes<{
60
+ declare const NodeViewWrapper: vue.DefineComponent<vue.ExtractPropTypes<{
192
61
  as: {
193
62
  type: StringConstructor;
194
63
  default: string;
@@ -202,7 +71,71 @@ declare const NodeViewContent: vue.DefineComponent<vue.ExtractPropTypes<{
202
71
  as: string;
203
72
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
204
73
 
205
- declare const NodeViewWrapper: vue.DefineComponent<vue.ExtractPropTypes<{
74
+ declare const useEditor: (options?: Partial<EditorOptions>) => vue.ShallowRef<Editor | undefined, Editor | undefined>;
75
+
76
+ interface VueRendererOptions {
77
+ editor: Editor$1;
78
+ props?: Record<string, any>;
79
+ }
80
+ type ExtendedVNode = ReturnType<typeof h> | null;
81
+ interface RenderedComponent {
82
+ vNode: ExtendedVNode;
83
+ destroy: () => void;
84
+ el: Element | null;
85
+ }
86
+ /**
87
+ * This class is used to render Vue components inside the editor.
88
+ */
89
+ declare class VueRenderer {
90
+ renderedComponent: RenderedComponent;
91
+ editor: Editor;
92
+ component: Component;
93
+ el: Element | null;
94
+ props: Record<string, any>;
95
+ constructor(component: Component, { props, editor }: VueRendererOptions);
96
+ get element(): Element | null;
97
+ get ref(): any;
98
+ renderComponent(): {
99
+ vNode: vue.VNode<vue.RendererNode, vue.RendererElement, {
100
+ [key: string]: any;
101
+ }>;
102
+ destroy: () => void;
103
+ el: Element | null;
104
+ };
105
+ updateProps(props?: Record<string, any>): void;
106
+ destroy(): void;
107
+ }
108
+
109
+ interface VueMarkViewRendererOptions extends MarkViewRendererOptions {
110
+ as?: string;
111
+ className?: string;
112
+ attrs?: {
113
+ [key: string]: string;
114
+ };
115
+ }
116
+ declare const markViewProps: {
117
+ editor: {
118
+ type: PropType<MarkViewProps["editor"]>;
119
+ required: true;
120
+ };
121
+ mark: {
122
+ type: PropType<MarkViewProps["mark"]>;
123
+ required: true;
124
+ };
125
+ extension: {
126
+ type: PropType<MarkViewProps["extension"]>;
127
+ required: true;
128
+ };
129
+ inline: {
130
+ type: PropType<MarkViewProps["inline"]>;
131
+ required: true;
132
+ };
133
+ view: {
134
+ type: PropType<MarkViewProps["view"]>;
135
+ required: true;
136
+ };
137
+ };
138
+ declare const MarkViewContent: vue.DefineComponent<vue.ExtractPropTypes<{
206
139
  as: {
207
140
  type: StringConstructor;
208
141
  default: string;
@@ -215,8 +148,14 @@ declare const NodeViewWrapper: vue.DefineComponent<vue.ExtractPropTypes<{
215
148
  }>> & Readonly<{}>, {
216
149
  as: string;
217
150
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
218
-
219
- declare const useEditor: (options?: Partial<EditorOptions>) => vue.ShallowRef<Editor | undefined, Editor | undefined>;
151
+ declare class VueMarkView extends MarkView<Component, VueMarkViewRendererOptions> {
152
+ renderer: VueRenderer;
153
+ constructor(component: Component, props: MarkViewProps, options?: Partial<VueMarkViewRendererOptions>);
154
+ get dom(): HTMLElement;
155
+ get contentDOM(): HTMLElement | null;
156
+ destroy(): void;
157
+ }
158
+ declare function VueMarkViewRenderer(component: Component, options?: Partial<VueMarkViewRendererOptions>): MarkViewRenderer;
220
159
 
221
160
  declare const nodeViewProps: {
222
161
  editor: {
@@ -251,6 +190,18 @@ declare const nodeViewProps: {
251
190
  type: PropType<NodeViewProps["deleteNode"]>;
252
191
  required: true;
253
192
  };
193
+ view: {
194
+ type: PropType<NodeViewProps["view"]>;
195
+ required: true;
196
+ };
197
+ innerDecorations: {
198
+ type: PropType<NodeViewProps["innerDecorations"]>;
199
+ required: true;
200
+ };
201
+ HTMLAttributes: {
202
+ type: PropType<NodeViewProps["HTMLAttributes"]>;
203
+ required: true;
204
+ };
254
205
  };
255
206
  interface VueNodeViewRendererOptions extends NodeViewRendererOptions {
256
207
  update: ((props: {
@@ -265,37 +216,4 @@ interface VueNodeViewRendererOptions extends NodeViewRendererOptions {
265
216
  }
266
217
  declare function VueNodeViewRenderer(component: Component<NodeViewProps>, options?: Partial<VueNodeViewRendererOptions>): NodeViewRenderer;
267
218
 
268
- interface VueRendererOptions {
269
- editor: Editor$1;
270
- props?: Record<string, any>;
271
- }
272
- type ExtendedVNode = ReturnType<typeof h> | null;
273
- interface RenderedComponent {
274
- vNode: ExtendedVNode;
275
- destroy: () => void;
276
- el: Element | null;
277
- }
278
- /**
279
- * This class is used to render Vue components inside the editor.
280
- */
281
- declare class VueRenderer {
282
- renderedComponent: RenderedComponent;
283
- editor: Editor;
284
- component: Component;
285
- el: Element | null;
286
- props: Record<string, any>;
287
- constructor(component: Component, { props, editor }: VueRendererOptions);
288
- get element(): Element | null;
289
- get ref(): any;
290
- renderComponent(): {
291
- vNode: vue.VNode<vue.RendererNode, vue.RendererElement, {
292
- [key: string]: any;
293
- }>;
294
- destroy: () => void;
295
- el: Element | null;
296
- };
297
- updateProps(props?: Record<string, any>): void;
298
- destroy(): void;
299
- }
300
-
301
- export { BubbleMenu, Editor, EditorContent, FloatingMenu, NodeViewContent, NodeViewWrapper, VueNodeViewRenderer, type VueNodeViewRendererOptions, VueRenderer, type VueRendererOptions, nodeViewProps, useEditor };
219
+ export { Editor, EditorContent, MarkViewContent, NodeViewContent, NodeViewWrapper, VueMarkView, VueMarkViewRenderer, type VueMarkViewRendererOptions, VueNodeViewRenderer, type VueNodeViewRendererOptions, VueRenderer, type VueRendererOptions, markViewProps, nodeViewProps, useEditor };
package/dist/index.d.ts CHANGED
@@ -1,96 +1,11 @@
1
- import * as _floating_ui_dom from '@floating-ui/dom';
2
- import { EditorState, PluginKey } from 'prosemirror-state';
3
- import { EditorView } from 'prosemirror-view';
4
- import * as _tiptap_core from '@tiptap/core';
5
- import { Editor as Editor$1, EditorOptions, NodeViewProps, NodeViewRendererOptions, NodeViewRenderer } from '@tiptap/core';
1
+ import { Editor as Editor$1, EditorOptions, Storage, MarkViewRendererOptions, MarkViewProps, MarkView, MarkViewRenderer, NodeViewProps, NodeViewRendererOptions, NodeViewRenderer } from '@tiptap/core';
6
2
  export * from '@tiptap/core';
3
+ import { EditorState, Plugin, PluginKey } from '@tiptap/pm/state';
7
4
  import * as vue from 'vue';
8
- import { PropType, AppContext, ComponentInternalInstance, ComponentPublicInstance, Ref, Component, h } from 'vue';
9
- import { BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu';
10
- import { EditorState as EditorState$1, Plugin, PluginKey as PluginKey$1 } from '@tiptap/pm/state';
11
- import { FloatingMenuPluginProps } from '@tiptap/extension-floating-menu';
5
+ import { AppContext, ComponentInternalInstance, ComponentPublicInstance, PropType, Ref, Component, h } from 'vue';
12
6
  import { Node } from '@tiptap/pm/model';
13
7
  import { Decoration, DecorationSource } from '@tiptap/pm/view';
14
8
 
15
- declare const BubbleMenu: vue.DefineComponent<vue.ExtractPropTypes<{
16
- pluginKey: {
17
- type: PropType<BubbleMenuPluginProps["pluginKey"]>;
18
- default: string;
19
- };
20
- editor: {
21
- type: PropType<BubbleMenuPluginProps["editor"]>;
22
- required: true;
23
- };
24
- updateDelay: {
25
- type: PropType<BubbleMenuPluginProps["updateDelay"]>;
26
- default: undefined;
27
- };
28
- resizeDelay: {
29
- type: PropType<BubbleMenuPluginProps["resizeDelay"]>;
30
- default: undefined;
31
- };
32
- options: {
33
- type: PropType<BubbleMenuPluginProps["options"]>;
34
- default: () => {};
35
- };
36
- shouldShow: {
37
- type: PropType<Exclude<Required<BubbleMenuPluginProps>["shouldShow"], null>>;
38
- default: null;
39
- };
40
- }>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
41
- [key: string]: any;
42
- }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
43
- pluginKey: {
44
- type: PropType<BubbleMenuPluginProps["pluginKey"]>;
45
- default: string;
46
- };
47
- editor: {
48
- type: PropType<BubbleMenuPluginProps["editor"]>;
49
- required: true;
50
- };
51
- updateDelay: {
52
- type: PropType<BubbleMenuPluginProps["updateDelay"]>;
53
- default: undefined;
54
- };
55
- resizeDelay: {
56
- type: PropType<BubbleMenuPluginProps["resizeDelay"]>;
57
- default: undefined;
58
- };
59
- options: {
60
- type: PropType<BubbleMenuPluginProps["options"]>;
61
- default: () => {};
62
- };
63
- shouldShow: {
64
- type: PropType<Exclude<Required<BubbleMenuPluginProps>["shouldShow"], null>>;
65
- default: null;
66
- };
67
- }>> & Readonly<{}>, {
68
- updateDelay: number | undefined;
69
- resizeDelay: number | undefined;
70
- shouldShow: (props: {
71
- editor: _tiptap_core.Editor;
72
- element: HTMLElement;
73
- view: EditorView;
74
- state: EditorState;
75
- oldState?: EditorState;
76
- from: number;
77
- to: number;
78
- }) => boolean;
79
- options: {
80
- strategy?: "absolute" | "fixed";
81
- placement?: "top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end";
82
- offset?: Parameters<typeof _floating_ui_dom.offset>[0] | boolean;
83
- flip?: Parameters<typeof _floating_ui_dom.flip>[0] | boolean;
84
- shift?: Parameters<typeof _floating_ui_dom.shift>[0] | boolean;
85
- arrow?: Parameters<typeof _floating_ui_dom.arrow>[0] | false;
86
- size?: Parameters<typeof _floating_ui_dom.size>[0] | boolean;
87
- autoPlacement?: Parameters<typeof _floating_ui_dom.autoPlacement>[0] | boolean;
88
- hide?: Parameters<typeof _floating_ui_dom.hide>[0] | boolean;
89
- inline?: Parameters<typeof _floating_ui_dom.inline>[0] | boolean;
90
- } | undefined;
91
- pluginKey: string | PluginKey<any>;
92
- }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
93
-
94
9
  type ContentComponent = ComponentInternalInstance & {
95
10
  ctx: ComponentPublicInstance;
96
11
  };
@@ -100,16 +15,16 @@ declare class Editor extends Editor$1 {
100
15
  contentComponent: ContentComponent | null;
101
16
  appContext: AppContext | null;
102
17
  constructor(options?: Partial<EditorOptions>);
103
- get state(): EditorState$1;
104
- get storage(): Record<string, any>;
18
+ get state(): EditorState;
19
+ get storage(): Storage;
105
20
  /**
106
21
  * Register a ProseMirror plugin.
107
22
  */
108
- registerPlugin(plugin: Plugin, handlePlugins?: (newPlugin: Plugin, plugins: Plugin[]) => Plugin[]): EditorState$1;
23
+ registerPlugin(plugin: Plugin, handlePlugins?: (newPlugin: Plugin, plugins: Plugin[]) => Plugin[]): EditorState;
109
24
  /**
110
25
  * Unregister a ProseMirror plugin.
111
26
  */
112
- unregisterPlugin(nameOrPluginKey: string | PluginKey$1): EditorState$1 | undefined;
27
+ unregisterPlugin(nameOrPluginKey: string | PluginKey): EditorState | undefined;
113
28
  }
114
29
 
115
30
  declare const EditorContent: vue.DefineComponent<vue.ExtractPropTypes<{
@@ -128,67 +43,21 @@ declare const EditorContent: vue.DefineComponent<vue.ExtractPropTypes<{
128
43
  editor: Editor;
129
44
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
130
45
 
131
- declare const FloatingMenu: vue.DefineComponent<vue.ExtractPropTypes<{
132
- pluginKey: {
133
- type: null;
46
+ declare const NodeViewContent: vue.DefineComponent<vue.ExtractPropTypes<{
47
+ as: {
48
+ type: StringConstructor;
134
49
  default: string;
135
50
  };
136
- editor: {
137
- type: PropType<FloatingMenuPluginProps["editor"]>;
138
- required: true;
139
- };
140
- options: {
141
- type: PropType<FloatingMenuPluginProps["options"]>;
142
- default: () => {};
143
- };
144
- shouldShow: {
145
- type: PropType<Exclude<Required<FloatingMenuPluginProps>["shouldShow"], null>>;
146
- default: null;
147
- };
148
- }>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
149
- [key: string]: any;
150
- }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
151
- pluginKey: {
152
- type: null;
51
+ }>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
52
+ as: {
53
+ type: StringConstructor;
153
54
  default: string;
154
55
  };
155
- editor: {
156
- type: PropType<FloatingMenuPluginProps["editor"]>;
157
- required: true;
158
- };
159
- options: {
160
- type: PropType<FloatingMenuPluginProps["options"]>;
161
- default: () => {};
162
- };
163
- shouldShow: {
164
- type: PropType<Exclude<Required<FloatingMenuPluginProps>["shouldShow"], null>>;
165
- default: null;
166
- };
167
56
  }>> & Readonly<{}>, {
168
- shouldShow: (props: {
169
- editor: _tiptap_core.Editor;
170
- view: EditorView;
171
- state: EditorState;
172
- oldState?: EditorState;
173
- from: number;
174
- to: number;
175
- }) => boolean;
176
- options: {
177
- strategy?: "absolute" | "fixed";
178
- placement?: "top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end";
179
- offset?: Parameters<typeof _floating_ui_dom.offset>[0] | boolean;
180
- flip?: Parameters<typeof _floating_ui_dom.flip>[0] | boolean;
181
- shift?: Parameters<typeof _floating_ui_dom.shift>[0] | boolean;
182
- arrow?: Parameters<typeof _floating_ui_dom.arrow>[0] | false;
183
- size?: Parameters<typeof _floating_ui_dom.size>[0] | boolean;
184
- autoPlacement?: Parameters<typeof _floating_ui_dom.autoPlacement>[0] | boolean;
185
- hide?: Parameters<typeof _floating_ui_dom.hide>[0] | boolean;
186
- inline?: Parameters<typeof _floating_ui_dom.inline>[0] | boolean;
187
- } | undefined;
188
- pluginKey: any;
57
+ as: string;
189
58
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
190
59
 
191
- declare const NodeViewContent: vue.DefineComponent<vue.ExtractPropTypes<{
60
+ declare const NodeViewWrapper: vue.DefineComponent<vue.ExtractPropTypes<{
192
61
  as: {
193
62
  type: StringConstructor;
194
63
  default: string;
@@ -202,7 +71,71 @@ declare const NodeViewContent: vue.DefineComponent<vue.ExtractPropTypes<{
202
71
  as: string;
203
72
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
204
73
 
205
- declare const NodeViewWrapper: vue.DefineComponent<vue.ExtractPropTypes<{
74
+ declare const useEditor: (options?: Partial<EditorOptions>) => vue.ShallowRef<Editor | undefined, Editor | undefined>;
75
+
76
+ interface VueRendererOptions {
77
+ editor: Editor$1;
78
+ props?: Record<string, any>;
79
+ }
80
+ type ExtendedVNode = ReturnType<typeof h> | null;
81
+ interface RenderedComponent {
82
+ vNode: ExtendedVNode;
83
+ destroy: () => void;
84
+ el: Element | null;
85
+ }
86
+ /**
87
+ * This class is used to render Vue components inside the editor.
88
+ */
89
+ declare class VueRenderer {
90
+ renderedComponent: RenderedComponent;
91
+ editor: Editor;
92
+ component: Component;
93
+ el: Element | null;
94
+ props: Record<string, any>;
95
+ constructor(component: Component, { props, editor }: VueRendererOptions);
96
+ get element(): Element | null;
97
+ get ref(): any;
98
+ renderComponent(): {
99
+ vNode: vue.VNode<vue.RendererNode, vue.RendererElement, {
100
+ [key: string]: any;
101
+ }>;
102
+ destroy: () => void;
103
+ el: Element | null;
104
+ };
105
+ updateProps(props?: Record<string, any>): void;
106
+ destroy(): void;
107
+ }
108
+
109
+ interface VueMarkViewRendererOptions extends MarkViewRendererOptions {
110
+ as?: string;
111
+ className?: string;
112
+ attrs?: {
113
+ [key: string]: string;
114
+ };
115
+ }
116
+ declare const markViewProps: {
117
+ editor: {
118
+ type: PropType<MarkViewProps["editor"]>;
119
+ required: true;
120
+ };
121
+ mark: {
122
+ type: PropType<MarkViewProps["mark"]>;
123
+ required: true;
124
+ };
125
+ extension: {
126
+ type: PropType<MarkViewProps["extension"]>;
127
+ required: true;
128
+ };
129
+ inline: {
130
+ type: PropType<MarkViewProps["inline"]>;
131
+ required: true;
132
+ };
133
+ view: {
134
+ type: PropType<MarkViewProps["view"]>;
135
+ required: true;
136
+ };
137
+ };
138
+ declare const MarkViewContent: vue.DefineComponent<vue.ExtractPropTypes<{
206
139
  as: {
207
140
  type: StringConstructor;
208
141
  default: string;
@@ -215,8 +148,14 @@ declare const NodeViewWrapper: vue.DefineComponent<vue.ExtractPropTypes<{
215
148
  }>> & Readonly<{}>, {
216
149
  as: string;
217
150
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
218
-
219
- declare const useEditor: (options?: Partial<EditorOptions>) => vue.ShallowRef<Editor | undefined, Editor | undefined>;
151
+ declare class VueMarkView extends MarkView<Component, VueMarkViewRendererOptions> {
152
+ renderer: VueRenderer;
153
+ constructor(component: Component, props: MarkViewProps, options?: Partial<VueMarkViewRendererOptions>);
154
+ get dom(): HTMLElement;
155
+ get contentDOM(): HTMLElement | null;
156
+ destroy(): void;
157
+ }
158
+ declare function VueMarkViewRenderer(component: Component, options?: Partial<VueMarkViewRendererOptions>): MarkViewRenderer;
220
159
 
221
160
  declare const nodeViewProps: {
222
161
  editor: {
@@ -251,6 +190,18 @@ declare const nodeViewProps: {
251
190
  type: PropType<NodeViewProps["deleteNode"]>;
252
191
  required: true;
253
192
  };
193
+ view: {
194
+ type: PropType<NodeViewProps["view"]>;
195
+ required: true;
196
+ };
197
+ innerDecorations: {
198
+ type: PropType<NodeViewProps["innerDecorations"]>;
199
+ required: true;
200
+ };
201
+ HTMLAttributes: {
202
+ type: PropType<NodeViewProps["HTMLAttributes"]>;
203
+ required: true;
204
+ };
254
205
  };
255
206
  interface VueNodeViewRendererOptions extends NodeViewRendererOptions {
256
207
  update: ((props: {
@@ -265,37 +216,4 @@ interface VueNodeViewRendererOptions extends NodeViewRendererOptions {
265
216
  }
266
217
  declare function VueNodeViewRenderer(component: Component<NodeViewProps>, options?: Partial<VueNodeViewRendererOptions>): NodeViewRenderer;
267
218
 
268
- interface VueRendererOptions {
269
- editor: Editor$1;
270
- props?: Record<string, any>;
271
- }
272
- type ExtendedVNode = ReturnType<typeof h> | null;
273
- interface RenderedComponent {
274
- vNode: ExtendedVNode;
275
- destroy: () => void;
276
- el: Element | null;
277
- }
278
- /**
279
- * This class is used to render Vue components inside the editor.
280
- */
281
- declare class VueRenderer {
282
- renderedComponent: RenderedComponent;
283
- editor: Editor;
284
- component: Component;
285
- el: Element | null;
286
- props: Record<string, any>;
287
- constructor(component: Component, { props, editor }: VueRendererOptions);
288
- get element(): Element | null;
289
- get ref(): any;
290
- renderComponent(): {
291
- vNode: vue.VNode<vue.RendererNode, vue.RendererElement, {
292
- [key: string]: any;
293
- }>;
294
- destroy: () => void;
295
- el: Element | null;
296
- };
297
- updateProps(props?: Record<string, any>): void;
298
- destroy(): void;
299
- }
300
-
301
- export { BubbleMenu, Editor, EditorContent, FloatingMenu, NodeViewContent, NodeViewWrapper, VueNodeViewRenderer, type VueNodeViewRendererOptions, VueRenderer, type VueRendererOptions, nodeViewProps, useEditor };
219
+ export { Editor, EditorContent, MarkViewContent, NodeViewContent, NodeViewWrapper, VueMarkView, VueMarkViewRenderer, type VueMarkViewRendererOptions, VueNodeViewRenderer, type VueNodeViewRendererOptions, VueRenderer, type VueRendererOptions, markViewProps, nodeViewProps, useEditor };