@tiptap/vue-3 2.0.0-beta.20 → 2.0.0-beta.201

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md 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,18 +1,72 @@
1
1
  import { PropType } from 'vue';
2
2
  export declare const BubbleMenu: import("vue").DefineComponent<{
3
+ pluginKey: {
4
+ type: null;
5
+ default: string;
6
+ };
3
7
  editor: {
4
8
  type: PropType<import("@tiptap/core").Editor>;
5
9
  required: true;
6
10
  };
7
- keepInBounds: {
8
- type: PropType<boolean>;
9
- default: boolean;
11
+ delay: {
12
+ type: PropType<number | undefined>;
13
+ default: undefined;
14
+ };
15
+ tippyOptions: {
16
+ type: PropType<Partial<import("tippy.js").Props> | undefined>;
17
+ default: () => {};
18
+ };
19
+ shouldShow: {
20
+ type: PropType<(props: {
21
+ editor: import("@tiptap/core").Editor;
22
+ view: import("prosemirror-view").EditorView;
23
+ state: import("prosemirror-state").EditorState;
24
+ oldState?: import("prosemirror-state").EditorState | undefined;
25
+ from: number;
26
+ to: number;
27
+ }) => boolean>;
28
+ default: null;
10
29
  };
11
30
  }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
12
31
  [key: string]: any;
13
- }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
14
- editor: import("@tiptap/core").Editor;
15
- keepInBounds: boolean;
16
- } & {}>, {
17
- keepInBounds: boolean;
32
+ }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
33
+ pluginKey: {
34
+ type: null;
35
+ default: string;
36
+ };
37
+ editor: {
38
+ type: PropType<import("@tiptap/core").Editor>;
39
+ required: true;
40
+ };
41
+ delay: {
42
+ type: PropType<number | undefined>;
43
+ default: undefined;
44
+ };
45
+ tippyOptions: {
46
+ type: PropType<Partial<import("tippy.js").Props> | undefined>;
47
+ default: () => {};
48
+ };
49
+ shouldShow: {
50
+ type: PropType<(props: {
51
+ editor: import("@tiptap/core").Editor;
52
+ view: import("prosemirror-view").EditorView;
53
+ state: import("prosemirror-state").EditorState;
54
+ oldState?: import("prosemirror-state").EditorState | undefined;
55
+ from: number;
56
+ to: number;
57
+ }) => boolean>;
58
+ default: null;
59
+ };
60
+ }>>, {
61
+ delay: number | undefined;
62
+ tippyOptions: Partial<import("tippy.js").Props> | undefined;
63
+ shouldShow: (props: {
64
+ editor: import("@tiptap/core").Editor;
65
+ view: import("prosemirror-view").EditorView;
66
+ state: import("prosemirror-state").EditorState;
67
+ oldState?: import("prosemirror-state").EditorState | undefined;
68
+ from: number;
69
+ to: number;
70
+ }) => boolean;
71
+ pluginKey: any;
18
72
  }>;
@@ -1,5 +1,5 @@
1
- import { EditorState, Plugin, PluginKey } from 'prosemirror-state';
2
1
  import { Editor as CoreEditor, EditorOptions } from '@tiptap/core';
2
+ import { EditorState, Plugin, PluginKey } from 'prosemirror-state';
3
3
  import { ComponentInternalInstance, ComponentPublicInstance } from 'vue';
4
4
  import { VueRenderer } from './VueRenderer';
5
5
  export declare type ContentComponent = ComponentInternalInstance & {
@@ -7,10 +7,12 @@ export declare type ContentComponent = ComponentInternalInstance & {
7
7
  };
8
8
  export declare class Editor extends CoreEditor {
9
9
  private reactiveState;
10
+ private reactiveExtensionStorage;
10
11
  vueRenderers: Map<string, VueRenderer>;
11
12
  contentComponent: ContentComponent | null;
12
13
  constructor(options?: Partial<EditorOptions>);
13
- get state(): EditorState<any>;
14
+ get state(): EditorState;
15
+ get storage(): Record<string, any>;
14
16
  /**
15
17
  * Register a ProseMirror plugin.
16
18
  */
@@ -1,4 +1,4 @@
1
- import { Ref, PropType, DefineComponent } from 'vue';
1
+ import { DefineComponent, PropType, Ref } from 'vue';
2
2
  import { Editor } from './Editor';
3
3
  export declare const EditorContent: DefineComponent<{
4
4
  editor: {
@@ -7,8 +7,11 @@ export declare const EditorContent: DefineComponent<{
7
7
  };
8
8
  }, {
9
9
  rootEl: Ref<Element | undefined>;
10
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
11
- editor: Editor;
12
- } & {}>, {
10
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
11
+ editor: {
12
+ default: null;
13
+ type: PropType<Editor>;
14
+ };
15
+ }>>, {
13
16
  editor: Editor;
14
17
  }>;
@@ -1,11 +1,57 @@
1
1
  import { PropType } from 'vue';
2
2
  export declare const FloatingMenu: import("vue").DefineComponent<{
3
+ pluginKey: {
4
+ type: null;
5
+ default: string;
6
+ };
3
7
  editor: {
4
8
  type: PropType<import("@tiptap/core").Editor>;
5
9
  required: true;
6
10
  };
11
+ tippyOptions: {
12
+ type: PropType<Partial<import("tippy.js").Props> | undefined>;
13
+ default: () => {};
14
+ };
15
+ shouldShow: {
16
+ type: PropType<(props: {
17
+ editor: import("@tiptap/core").Editor;
18
+ view: import("prosemirror-view").EditorView;
19
+ state: import("prosemirror-state").EditorState;
20
+ oldState?: import("prosemirror-state").EditorState | undefined;
21
+ }) => boolean>;
22
+ default: null;
23
+ };
7
24
  }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
8
25
  [key: string]: any;
9
- }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
10
- editor: import("@tiptap/core").Editor;
11
- } & {}>, {}>;
26
+ }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
27
+ pluginKey: {
28
+ type: null;
29
+ default: string;
30
+ };
31
+ editor: {
32
+ type: PropType<import("@tiptap/core").Editor>;
33
+ required: true;
34
+ };
35
+ tippyOptions: {
36
+ type: PropType<Partial<import("tippy.js").Props> | undefined>;
37
+ default: () => {};
38
+ };
39
+ shouldShow: {
40
+ type: PropType<(props: {
41
+ editor: import("@tiptap/core").Editor;
42
+ view: import("prosemirror-view").EditorView;
43
+ state: import("prosemirror-state").EditorState;
44
+ oldState?: import("prosemirror-state").EditorState | undefined;
45
+ }) => boolean>;
46
+ default: null;
47
+ };
48
+ }>>, {
49
+ tippyOptions: Partial<import("tippy.js").Props> | undefined;
50
+ shouldShow: (props: {
51
+ editor: import("@tiptap/core").Editor;
52
+ view: import("prosemirror-view").EditorView;
53
+ state: import("prosemirror-state").EditorState;
54
+ oldState?: import("prosemirror-state").EditorState | undefined;
55
+ }) => boolean;
56
+ pluginKey: any;
57
+ }>;
@@ -3,8 +3,11 @@ export declare const NodeViewContent: import("vue").DefineComponent<{
3
3
  type: StringConstructor;
4
4
  default: string;
5
5
  };
6
- }, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
7
- as: string;
8
- } & {}>, {
6
+ }, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
7
+ as: {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
11
+ }>>, {
9
12
  as: string;
10
13
  }>;
@@ -3,8 +3,11 @@ export declare const NodeViewWrapper: import("vue").DefineComponent<{
3
3
  type: StringConstructor;
4
4
  default: string;
5
5
  };
6
- }, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
7
- as: string;
8
- } & {}>, {
6
+ }, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
7
+ as: {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
11
+ }>>, {
9
12
  as: string;
10
13
  }>;
@@ -1,42 +1,48 @@
1
- import { NodeViewRenderer } from '@tiptap/core';
2
- import { PropType, Component } from 'vue';
3
- import { Decoration } from 'prosemirror-view';
1
+ import { NodeViewRenderer, NodeViewRendererOptions } from '@tiptap/core';
4
2
  import { Node as ProseMirrorNode } from 'prosemirror-model';
3
+ import { Decoration } from 'prosemirror-view';
4
+ import { Component, PropType } from 'vue';
5
5
  export declare const nodeViewProps: {
6
6
  editor: {
7
7
  type: PropType<import("@tiptap/core").Editor>;
8
- required: boolean;
8
+ required: true;
9
9
  };
10
10
  node: {
11
- type: PropType<ProseMirrorNode<any>>;
12
- required: boolean;
11
+ type: PropType<ProseMirrorNode>;
12
+ required: true;
13
13
  };
14
14
  decorations: {
15
- type: PropType<Decoration<{
16
- [key: string]: any;
17
- }>[]>;
18
- required: boolean;
15
+ type: PropType<Decoration[]>;
16
+ required: true;
19
17
  };
20
18
  selected: {
21
19
  type: PropType<boolean>;
22
- required: boolean;
20
+ required: true;
23
21
  };
24
22
  extension: {
25
- type: PropType<import("@tiptap/core").Node<any>>;
26
- required: boolean;
23
+ type: PropType<import("@tiptap/core").Node<any, any>>;
24
+ required: true;
27
25
  };
28
26
  getPos: {
29
27
  type: PropType<() => number>;
30
- required: boolean;
28
+ required: true;
31
29
  };
32
30
  updateAttributes: {
33
- type: PropType<(attributes: import("@tiptap/core").AnyObject) => void>;
34
- required: boolean;
31
+ type: PropType<(attributes: Record<string, any>) => void>;
32
+ required: true;
33
+ };
34
+ deleteNode: {
35
+ type: PropType<() => void>;
36
+ required: true;
35
37
  };
36
38
  };
37
- interface VueNodeViewRendererOptions {
38
- stopEvent: ((event: Event) => boolean) | null;
39
- update: ((node: ProseMirrorNode, decorations: Decoration[]) => boolean) | null;
39
+ export interface VueNodeViewRendererOptions extends NodeViewRendererOptions {
40
+ update: ((props: {
41
+ oldNode: ProseMirrorNode;
42
+ oldDecorations: Decoration[];
43
+ newNode: ProseMirrorNode;
44
+ newDecorations: Decoration[];
45
+ updateProps: () => void;
46
+ }) => boolean) | null;
40
47
  }
41
48
  export declare function VueNodeViewRenderer(component: Component, options?: Partial<VueNodeViewRendererOptions>): NodeViewRenderer;
42
- export {};
@@ -1,19 +1,19 @@
1
+ import { Editor } from '@tiptap/core';
1
2
  import { Component } from 'vue';
2
- import { AnyObject } from '@tiptap/core';
3
- import { Editor } from './Editor';
3
+ import { Editor as ExtendedEditor } from './Editor';
4
4
  export interface VueRendererOptions {
5
5
  editor: Editor;
6
- props?: AnyObject;
6
+ props?: Record<string, any>;
7
7
  }
8
8
  export declare class VueRenderer {
9
9
  id: string;
10
- editor: Editor;
10
+ editor: ExtendedEditor;
11
11
  component: Component;
12
12
  teleportElement: Element;
13
13
  element: Element;
14
- props: AnyObject;
14
+ props: Record<string, any>;
15
15
  constructor(component: Component, { props, editor }: VueRendererOptions);
16
16
  get ref(): any;
17
- updateProps(props?: AnyObject): void;
17
+ updateProps(props?: Record<string, any>): void;
18
18
  destroy(): void;
19
19
  }
@@ -1,10 +1,10 @@
1
- export * from '@tiptap/core';
2
1
  export * from './BubbleMenu';
3
2
  export { Editor } from './Editor';
4
3
  export * from './EditorContent';
5
4
  export * from './FloatingMenu';
5
+ export * from './NodeViewContent';
6
+ export * from './NodeViewWrapper';
6
7
  export * from './useEditor';
7
- export * from './VueRenderer';
8
8
  export * from './VueNodeViewRenderer';
9
- export * from './NodeViewWrapper';
10
- export * from './NodeViewContent';
9
+ export * from './VueRenderer';
10
+ export * from '@tiptap/core';
@@ -1,3 +1,3 @@
1
1
  import { EditorOptions } from '@tiptap/core';
2
2
  import { Editor } from './Editor';
3
- export declare const useEditor: (options?: Partial<EditorOptions>) => import("vue").Ref<Editor | undefined>;
3
+ export declare const useEditor: (options?: Partial<EditorOptions>) => import("vue").ShallowRef<Editor | undefined>;