@tiptap/vue-3 2.0.0-beta.91 → 2.0.0-beta.94

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tiptap/vue-3",
3
3
  "description": "Vue components for tiptap",
4
- "version": "2.0.0-beta.91",
4
+ "version": "2.0.0-beta.94",
5
5
  "homepage": "https://tiptap.dev",
6
6
  "keywords": [
7
7
  "tiptap",
@@ -28,8 +28,8 @@
28
28
  "vue": "^3.0.0"
29
29
  },
30
30
  "dependencies": {
31
- "@tiptap/extension-bubble-menu": "^2.0.0-beta.56",
32
- "@tiptap/extension-floating-menu": "^2.0.0-beta.51",
31
+ "@tiptap/extension-bubble-menu": "^2.0.0-beta.59",
32
+ "@tiptap/extension-floating-menu": "^2.0.0-beta.54",
33
33
  "prosemirror-state": "^1.3.4",
34
34
  "prosemirror-view": "^1.23.6"
35
35
  },
@@ -39,5 +39,5 @@
39
39
  "directory": "packages/vue-3"
40
40
  },
41
41
  "sideEffects": false,
42
- "gitHead": "90e719c711dbccae6a7333956d543fb93789f3d3"
42
+ "gitHead": "591c0807a2ab5c34b4b7fe12c12511fe4f493ebd"
43
43
  }
package/src/BubbleMenu.ts CHANGED
@@ -1,12 +1,12 @@
1
+ import { BubbleMenuPlugin, BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu'
1
2
  import {
3
+ defineComponent,
2
4
  h,
3
- ref,
4
- PropType,
5
- onMounted,
6
5
  onBeforeUnmount,
7
- defineComponent,
6
+ onMounted,
7
+ PropType,
8
+ ref,
8
9
  } from 'vue'
9
- import { BubbleMenuPlugin, BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu'
10
10
 
11
11
  export const BubbleMenu = defineComponent({
12
12
  name: 'BubbleMenu',
package/src/Editor.ts CHANGED
@@ -1,13 +1,14 @@
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 {
4
- markRaw,
5
- Ref,
6
- customRef,
7
4
  ComponentInternalInstance,
8
5
  ComponentPublicInstance,
6
+ customRef,
7
+ markRaw,
9
8
  reactive,
9
+ Ref,
10
10
  } from 'vue'
11
+
11
12
  import { VueRenderer } from './VueRenderer'
12
13
 
13
14
  function useDebouncedRef<T>(value: T) {
@@ -56,7 +57,7 @@ export class Editor extends CoreEditor {
56
57
  this.reactiveExtensionStorage.value = this.extensionStorage
57
58
  })
58
59
 
59
- return markRaw(this)
60
+ return markRaw(this) // eslint-disable-line
60
61
  }
61
62
 
62
63
  get state() {
@@ -1,17 +1,18 @@
1
1
  import {
2
+ DefineComponent,
3
+ defineComponent,
4
+ getCurrentInstance,
2
5
  h,
3
- ref,
6
+ nextTick,
7
+ onBeforeUnmount,
8
+ PropType,
4
9
  Ref,
5
- unref,
10
+ ref,
6
11
  Teleport,
7
- PropType,
8
- defineComponent,
9
- DefineComponent,
12
+ unref,
10
13
  watchEffect,
11
- nextTick,
12
- onBeforeUnmount,
13
- getCurrentInstance,
14
14
  } from 'vue'
15
+
15
16
  import { Editor } from './Editor'
16
17
 
17
18
  export const EditorContent = defineComponent({
@@ -1,12 +1,12 @@
1
+ import { FloatingMenuPlugin, FloatingMenuPluginProps } from '@tiptap/extension-floating-menu'
1
2
  import {
3
+ defineComponent,
2
4
  h,
3
- ref,
4
- PropType,
5
- onMounted,
6
5
  onBeforeUnmount,
7
- defineComponent,
6
+ onMounted,
7
+ PropType,
8
+ ref,
8
9
  } from 'vue'
9
- import { FloatingMenuPlugin, FloatingMenuPluginProps } from '@tiptap/extension-floating-menu'
10
10
 
11
11
  export const FloatingMenu = defineComponent({
12
12
  name: 'FloatingMenu',
@@ -1,4 +1,4 @@
1
- import { h, defineComponent } from 'vue'
1
+ import { defineComponent, h } from 'vue'
2
2
 
3
3
  export const NodeViewContent = defineComponent({
4
4
  props: {
@@ -9,13 +9,11 @@ export const NodeViewContent = defineComponent({
9
9
  },
10
10
 
11
11
  render() {
12
- return h(
13
- this.as, {
14
- style: {
15
- whiteSpace: 'pre-wrap',
16
- },
17
- 'data-node-view-content': '',
12
+ return h(this.as, {
13
+ style: {
14
+ whiteSpace: 'pre-wrap',
18
15
  },
19
- )
16
+ 'data-node-view-content': '',
17
+ })
20
18
  },
21
19
  })
@@ -1,4 +1,4 @@
1
- import { h, defineComponent } from 'vue'
1
+ import { defineComponent, h } from 'vue'
2
2
 
3
3
  export const NodeViewWrapper = defineComponent({
4
4
  props: {
@@ -12,7 +12,8 @@ export const NodeViewWrapper = defineComponent({
12
12
 
13
13
  render() {
14
14
  return h(
15
- this.as, {
15
+ this.as,
16
+ {
16
17
  // @ts-ignore
17
18
  class: this.decorationClasses.value,
18
19
  style: {
@@ -2,19 +2,20 @@ import {
2
2
  NodeView,
3
3
  NodeViewProps,
4
4
  NodeViewRenderer,
5
- NodeViewRendererProps,
6
5
  NodeViewRendererOptions,
6
+ NodeViewRendererProps,
7
7
  } from '@tiptap/core'
8
+ import { Node as ProseMirrorNode } from 'prosemirror-model'
9
+ import { Decoration, NodeView as ProseMirrorNodeView } from 'prosemirror-view'
8
10
  import {
9
- ref,
10
- Ref,
11
- provide,
12
- PropType,
13
11
  Component,
14
12
  defineComponent,
13
+ PropType,
14
+ provide,
15
+ Ref,
16
+ ref,
15
17
  } from 'vue'
16
- import { Decoration, NodeView as ProseMirrorNodeView } from 'prosemirror-view'
17
- import { Node as ProseMirrorNode } from 'prosemirror-model'
18
+
18
19
  import { Editor } from './Editor'
19
20
  import { VueRenderer } from './VueRenderer'
20
21
 
@@ -1,5 +1,6 @@
1
- import { reactive, markRaw, Component } from 'vue'
2
1
  import { Editor } from '@tiptap/core'
2
+ import { Component, markRaw, reactive } from 'vue'
3
+
3
4
  import { Editor as ExtendedEditor } from './Editor'
4
5
 
5
6
  export interface VueRendererOptions {
package/src/index.ts CHANGED
@@ -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'
package/src/useEditor.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { onMounted, onBeforeUnmount, shallowRef } from 'vue'
2
1
  import { EditorOptions } from '@tiptap/core'
2
+ import { onBeforeUnmount, onMounted, shallowRef } from 'vue'
3
+
3
4
  import { Editor } from './Editor'
4
5
 
5
6
  export const useEditor = (options: Partial<EditorOptions> = {}) => {
package/LICENSE.md DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2021, überdosis GbR
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,63 +0,0 @@
1
- import { PropType } from 'vue';
2
- export declare const BubbleMenu: import("vue").DefineComponent<{
3
- pluginKey: {
4
- type: null;
5
- default: string;
6
- };
7
- editor: {
8
- type: PropType<import("@tiptap/core").Editor>;
9
- required: true;
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<any>;
19
- state: import("prosemirror-state").EditorState<any>;
20
- oldState?: import("prosemirror-state").EditorState<any> | undefined;
21
- from: number;
22
- to: number;
23
- }) => boolean>;
24
- default: null;
25
- };
26
- }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
27
- [key: string]: any;
28
- }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
29
- pluginKey: {
30
- type: null;
31
- default: string;
32
- };
33
- editor: {
34
- type: PropType<import("@tiptap/core").Editor>;
35
- required: true;
36
- };
37
- tippyOptions: {
38
- type: PropType<Partial<import("tippy.js").Props> | undefined>;
39
- default: () => {};
40
- };
41
- shouldShow: {
42
- type: PropType<(props: {
43
- editor: import("@tiptap/core").Editor;
44
- view: import("prosemirror-view").EditorView<any>;
45
- state: import("prosemirror-state").EditorState<any>;
46
- oldState?: import("prosemirror-state").EditorState<any> | undefined;
47
- from: number;
48
- to: number;
49
- }) => boolean>;
50
- default: null;
51
- };
52
- }>>, {
53
- tippyOptions: Partial<import("tippy.js").Props> | undefined;
54
- shouldShow: (props: {
55
- editor: import("@tiptap/core").Editor;
56
- view: import("prosemirror-view").EditorView<any>;
57
- state: import("prosemirror-state").EditorState<any>;
58
- oldState?: import("prosemirror-state").EditorState<any> | undefined;
59
- from: number;
60
- to: number;
61
- }) => boolean;
62
- pluginKey: any;
63
- }>;
@@ -1,24 +0,0 @@
1
- import { EditorState, Plugin, PluginKey } from 'prosemirror-state';
2
- import { Editor as CoreEditor, EditorOptions } from '@tiptap/core';
3
- import { ComponentInternalInstance, ComponentPublicInstance } from 'vue';
4
- import { VueRenderer } from './VueRenderer';
5
- export declare type ContentComponent = ComponentInternalInstance & {
6
- ctx: ComponentPublicInstance;
7
- };
8
- export declare class Editor extends CoreEditor {
9
- private reactiveState;
10
- private reactiveExtensionStorage;
11
- vueRenderers: Map<string, VueRenderer>;
12
- contentComponent: ContentComponent | null;
13
- constructor(options?: Partial<EditorOptions>);
14
- get state(): EditorState<any>;
15
- get storage(): Record<string, any>;
16
- /**
17
- * Register a ProseMirror plugin.
18
- */
19
- registerPlugin(plugin: Plugin, handlePlugins?: (newPlugin: Plugin, plugins: Plugin[]) => Plugin[]): void;
20
- /**
21
- * Unregister a ProseMirror plugin.
22
- */
23
- unregisterPlugin(nameOrPluginKey: string | PluginKey): void;
24
- }
@@ -1,17 +0,0 @@
1
- import { Ref, PropType, DefineComponent } from 'vue';
2
- import { Editor } from './Editor';
3
- export declare const EditorContent: DefineComponent<{
4
- editor: {
5
- default: null;
6
- type: PropType<Editor>;
7
- };
8
- }, {
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<import("vue").ExtractPropTypes<{
11
- editor: {
12
- default: null;
13
- type: PropType<Editor>;
14
- };
15
- }>>, {
16
- editor: Editor;
17
- }>;
@@ -1,57 +0,0 @@
1
- import { PropType } from 'vue';
2
- export declare const FloatingMenu: import("vue").DefineComponent<{
3
- pluginKey: {
4
- type: null;
5
- default: string;
6
- };
7
- editor: {
8
- type: PropType<import("@tiptap/core").Editor>;
9
- required: true;
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<any>;
19
- state: import("prosemirror-state").EditorState<any>;
20
- oldState?: import("prosemirror-state").EditorState<any> | undefined;
21
- }) => boolean>;
22
- default: null;
23
- };
24
- }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
25
- [key: string]: any;
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<any>;
43
- state: import("prosemirror-state").EditorState<any>;
44
- oldState?: import("prosemirror-state").EditorState<any> | 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<any>;
53
- state: import("prosemirror-state").EditorState<any>;
54
- oldState?: import("prosemirror-state").EditorState<any> | undefined;
55
- }) => boolean;
56
- pluginKey: any;
57
- }>;
@@ -1,13 +0,0 @@
1
- export declare const NodeViewContent: import("vue").DefineComponent<{
2
- as: {
3
- type: StringConstructor;
4
- default: string;
5
- };
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
- }>>, {
12
- as: string;
13
- }>;
@@ -1,13 +0,0 @@
1
- export declare const NodeViewWrapper: import("vue").DefineComponent<{
2
- as: {
3
- type: StringConstructor;
4
- default: string;
5
- };
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
- }>>, {
12
- as: string;
13
- }>;
@@ -1,50 +0,0 @@
1
- import { NodeViewRenderer, NodeViewRendererOptions } from '@tiptap/core';
2
- import { PropType, Component } from 'vue';
3
- import { Decoration } from 'prosemirror-view';
4
- import { Node as ProseMirrorNode } from 'prosemirror-model';
5
- export declare const nodeViewProps: {
6
- editor: {
7
- type: PropType<import("@tiptap/core").Editor>;
8
- required: true;
9
- };
10
- node: {
11
- type: PropType<ProseMirrorNode<any>>;
12
- required: true;
13
- };
14
- decorations: {
15
- type: PropType<Decoration<{
16
- [key: string]: any;
17
- }>[]>;
18
- required: true;
19
- };
20
- selected: {
21
- type: PropType<boolean>;
22
- required: true;
23
- };
24
- extension: {
25
- type: PropType<import("@tiptap/core").Node<any, any>>;
26
- required: true;
27
- };
28
- getPos: {
29
- type: PropType<() => number>;
30
- required: true;
31
- };
32
- updateAttributes: {
33
- type: PropType<(attributes: Record<string, any>) => void>;
34
- required: true;
35
- };
36
- deleteNode: {
37
- type: PropType<() => void>;
38
- required: true;
39
- };
40
- };
41
- export interface VueNodeViewRendererOptions extends NodeViewRendererOptions {
42
- update: ((props: {
43
- oldNode: ProseMirrorNode;
44
- oldDecorations: Decoration[];
45
- newNode: ProseMirrorNode;
46
- newDecorations: Decoration[];
47
- updateProps: () => void;
48
- }) => boolean) | null;
49
- }
50
- export declare function VueNodeViewRenderer(component: Component, options?: Partial<VueNodeViewRendererOptions>): NodeViewRenderer;
@@ -1,19 +0,0 @@
1
- import { Component } from 'vue';
2
- import { Editor } from '@tiptap/core';
3
- import { Editor as ExtendedEditor } from './Editor';
4
- export interface VueRendererOptions {
5
- editor: Editor;
6
- props?: Record<string, any>;
7
- }
8
- export declare class VueRenderer {
9
- id: string;
10
- editor: ExtendedEditor;
11
- component: Component;
12
- teleportElement: Element;
13
- element: Element;
14
- props: Record<string, any>;
15
- constructor(component: Component, { props, editor }: VueRendererOptions);
16
- get ref(): any;
17
- updateProps(props?: Record<string, any>): void;
18
- destroy(): void;
19
- }
@@ -1,10 +0,0 @@
1
- export * from '@tiptap/core';
2
- export * from './BubbleMenu';
3
- export { Editor } from './Editor';
4
- export * from './EditorContent';
5
- export * from './FloatingMenu';
6
- export * from './useEditor';
7
- export * from './VueRenderer';
8
- export * from './VueNodeViewRenderer';
9
- export * from './NodeViewWrapper';
10
- export * from './NodeViewContent';
@@ -1,3 +0,0 @@
1
- import { EditorOptions } from '@tiptap/core';
2
- import { Editor } from './Editor';
3
- export declare const useEditor: (options?: Partial<EditorOptions>) => import("vue").ShallowRef<Editor | undefined>;