@tiptap/vue-2
Advanced tools
Comparing version 3.0.0-next.3 to 3.0.0-next.4
@@ -49,3 +49,3 @@ import { BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu'; | ||
}; | ||
onDragStart: Function; | ||
onDragStart: () => void; | ||
} | ||
@@ -52,0 +52,0 @@ declare const NodeViewWrapper: Component; |
@@ -36,2 +36,3 @@ // src/BubbleMenu.ts | ||
} | ||
; | ||
this.$el.style.visibility = "hidden"; | ||
@@ -41,11 +42,13 @@ this.$el.style.position = "absolute"; | ||
this.$nextTick(() => { | ||
editor.registerPlugin(BubbleMenuPlugin({ | ||
updateDelay: this.updateDelay, | ||
resizeDelay: this.resizeDelay, | ||
options: this.options, | ||
editor, | ||
element: this.$el, | ||
pluginKey: this.pluginKey, | ||
shouldShow: this.shouldShow | ||
})); | ||
editor.registerPlugin( | ||
BubbleMenuPlugin({ | ||
updateDelay: this.updateDelay, | ||
resizeDelay: this.resizeDelay, | ||
options: this.options, | ||
editor, | ||
element: this.$el, | ||
pluginKey: this.pluginKey, | ||
shouldShow: this.shouldShow | ||
}) | ||
); | ||
}); | ||
@@ -156,2 +159,3 @@ } | ||
} | ||
; | ||
this.$el.style.visibility = "hidden"; | ||
@@ -161,9 +165,11 @@ this.$el.style.position = "absolute"; | ||
this.$nextTick(() => { | ||
editor.registerPlugin(FloatingMenuPlugin({ | ||
pluginKey: this.pluginKey, | ||
editor, | ||
element: this.$el, | ||
options: this.options, | ||
shouldShow: this.shouldShow | ||
})); | ||
editor.registerPlugin( | ||
FloatingMenuPlugin({ | ||
pluginKey: this.pluginKey, | ||
editor, | ||
element: this.$el, | ||
options: this.options, | ||
shouldShow: this.shouldShow | ||
}) | ||
); | ||
}); | ||
@@ -231,5 +237,3 @@ } | ||
// src/VueNodeViewRenderer.ts | ||
import { | ||
NodeView | ||
} from "@tiptap/core"; | ||
import { NodeView } from "@tiptap/core"; | ||
import Vue2 from "vue"; | ||
@@ -236,0 +240,0 @@ import { booleanProp, functionProp, objectProp } from "vue-ts-types"; |
{ | ||
"name": "@tiptap/vue-2", | ||
"description": "Vue components for tiptap", | ||
"version": "3.0.0-next.3", | ||
"version": "3.0.0-next.4", | ||
"homepage": "https://tiptap.dev", | ||
@@ -17,3 +17,6 @@ "keywords": [ | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"types": { | ||
"import": "./dist/index.d.ts", | ||
"require": "./dist/index.d.cts" | ||
}, | ||
"import": "./dist/index.js", | ||
@@ -32,10 +35,10 @@ "require": "./dist/index.cjs" | ||
"dependencies": { | ||
"@tiptap/extension-bubble-menu": "^3.0.0-next.3", | ||
"@tiptap/extension-floating-menu": "^3.0.0-next.3", | ||
"@tiptap/extension-bubble-menu": "^3.0.0-next.4", | ||
"@tiptap/extension-floating-menu": "^3.0.0-next.4", | ||
"vue-ts-types": "1.6.2" | ||
}, | ||
"devDependencies": { | ||
"@tiptap/core": "^3.0.0-next.3", | ||
"@tiptap/pm": "^3.0.0-next.3", | ||
"vue": "^2.6.0" | ||
"@tiptap/core": "^3.0.0-next.4", | ||
"@tiptap/pm": "^3.0.0-next.4", | ||
"vue": "^2.7.16" | ||
}, | ||
@@ -54,4 +57,5 @@ "peerDependencies": { | ||
"scripts": { | ||
"build": "tsup" | ||
"build": "tsup", | ||
"lint": "prettier ./src/ --check && eslint --cache --quiet --no-error-on-unmatched-pattern ./src/" | ||
} | ||
} | ||
} |
# @tiptap/vue-2 | ||
[![Version](https://img.shields.io/npm/v/@tiptap/vue-2.svg?label=version)](https://www.npmjs.com/package/@tiptap/vue-2) | ||
@@ -8,8 +9,11 @@ [![Downloads](https://img.shields.io/npm/dm/@tiptap/vue-2.svg)](https://npmcharts.com/compare/tiptap?minimal=true) | ||
## Introduction | ||
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*. | ||
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_. | ||
## Official Documentation | ||
Documentation can be found on the [Tiptap website](https://tiptap.dev). | ||
## License | ||
Tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md). |
@@ -5,8 +5,8 @@ import { BubbleMenuPlugin, BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu' | ||
export interface BubbleMenuInterface extends Vue { | ||
pluginKey: BubbleMenuPluginProps['pluginKey'], | ||
editor: BubbleMenuPluginProps['editor'], | ||
updateDelay: BubbleMenuPluginProps['updateDelay'], | ||
resizeDelay: BubbleMenuPluginProps['resizeDelay'], | ||
shouldShow: BubbleMenuPluginProps['shouldShow'], | ||
options: BubbleMenuPluginProps['options'], | ||
pluginKey: BubbleMenuPluginProps['pluginKey'] | ||
editor: BubbleMenuPluginProps['editor'] | ||
updateDelay: BubbleMenuPluginProps['updateDelay'] | ||
resizeDelay: BubbleMenuPluginProps['resizeDelay'] | ||
shouldShow: BubbleMenuPluginProps['shouldShow'] | ||
options: BubbleMenuPluginProps['options'] | ||
} | ||
@@ -55,4 +55,4 @@ | ||
(this.$el as HTMLElement).style.visibility = 'hidden'; | ||
(this.$el as HTMLElement).style.position = 'absolute' | ||
;(this.$el as HTMLElement).style.visibility = 'hidden' | ||
;(this.$el as HTMLElement).style.position = 'absolute' | ||
@@ -62,11 +62,13 @@ this.$el.remove() | ||
this.$nextTick(() => { | ||
editor.registerPlugin(BubbleMenuPlugin({ | ||
updateDelay: this.updateDelay, | ||
resizeDelay: this.resizeDelay, | ||
options: this.options, | ||
editor, | ||
element: this.$el as HTMLElement, | ||
pluginKey: this.pluginKey, | ||
shouldShow: this.shouldShow, | ||
})) | ||
editor.registerPlugin( | ||
BubbleMenuPlugin({ | ||
updateDelay: this.updateDelay, | ||
resizeDelay: this.resizeDelay, | ||
options: this.options, | ||
editor, | ||
element: this.$el as HTMLElement, | ||
pluginKey: this.pluginKey, | ||
shouldShow: this.shouldShow, | ||
}), | ||
) | ||
}) | ||
@@ -73,0 +75,0 @@ }, |
@@ -6,3 +6,3 @@ import Vue, { Component, CreateElement, PropType } from 'vue' | ||
export interface EditorContentInterface extends Vue { | ||
editor: Editor, | ||
editor: Editor | ||
} | ||
@@ -9,0 +9,0 @@ |
@@ -5,6 +5,6 @@ import { FloatingMenuPlugin, FloatingMenuPluginProps } from '@tiptap/extension-floating-menu' | ||
export interface FloatingMenuInterface extends Vue { | ||
pluginKey: FloatingMenuPluginProps['pluginKey'], | ||
options: FloatingMenuPluginProps['options'], | ||
editor: FloatingMenuPluginProps['editor'], | ||
shouldShow: FloatingMenuPluginProps['shouldShow'], | ||
pluginKey: FloatingMenuPluginProps['pluginKey'] | ||
options: FloatingMenuPluginProps['options'] | ||
editor: FloatingMenuPluginProps['editor'] | ||
shouldShow: FloatingMenuPluginProps['shouldShow'] | ||
} | ||
@@ -45,4 +45,4 @@ | ||
(this.$el as HTMLElement).style.visibility = 'hidden'; | ||
(this.$el as HTMLElement).style.position = 'absolute' | ||
;(this.$el as HTMLElement).style.visibility = 'hidden' | ||
;(this.$el as HTMLElement).style.position = 'absolute' | ||
@@ -52,9 +52,11 @@ this.$el.remove() | ||
this.$nextTick(() => { | ||
editor.registerPlugin(FloatingMenuPlugin({ | ||
pluginKey: this.pluginKey, | ||
editor, | ||
element: this.$el as HTMLElement, | ||
options: this.options, | ||
shouldShow: this.shouldShow, | ||
})) | ||
editor.registerPlugin( | ||
FloatingMenuPlugin({ | ||
pluginKey: this.pluginKey, | ||
editor, | ||
element: this.$el as HTMLElement, | ||
options: this.options, | ||
shouldShow: this.shouldShow, | ||
}), | ||
) | ||
}) | ||
@@ -61,0 +63,0 @@ }, |
import Vue, { Component, CreateElement } from 'vue' | ||
export interface NodeViewContentInterface extends Vue { | ||
as: string, | ||
as: string | ||
} | ||
@@ -6,0 +6,0 @@ |
import Vue, { Component, CreateElement } from 'vue' | ||
export interface NodeViewWrapperInterface extends Vue { | ||
as: string, | ||
as: string | ||
decorationClasses: { | ||
value: string, | ||
}, | ||
onDragStart: Function, | ||
value: string | ||
} | ||
onDragStart: () => void | ||
} | ||
@@ -10,0 +10,0 @@ |
@@ -1,8 +0,2 @@ | ||
import { | ||
DecorationWithType, | ||
NodeView, | ||
NodeViewProps, | ||
NodeViewRenderer, | ||
NodeViewRendererOptions, | ||
} from '@tiptap/core' | ||
import { DecorationWithType, NodeView, NodeViewProps, NodeViewRenderer, NodeViewRendererOptions } from '@tiptap/core' | ||
import { Node as ProseMirrorNode } from '@tiptap/pm/model' | ||
@@ -31,11 +25,11 @@ import { Decoration, DecorationSource, NodeView as ProseMirrorNodeView } from '@tiptap/pm/view' | ||
| ((props: { | ||
oldNode: ProseMirrorNode; | ||
oldDecorations: readonly Decoration[]; | ||
oldInnerDecorations: DecorationSource; | ||
newNode: ProseMirrorNode; | ||
newDecorations: readonly Decoration[]; | ||
innerDecorations: DecorationSource; | ||
updateProps: () => void; | ||
oldNode: ProseMirrorNode | ||
oldDecorations: readonly Decoration[] | ||
oldInnerDecorations: DecorationSource | ||
newNode: ProseMirrorNode | ||
newDecorations: readonly Decoration[] | ||
innerDecorations: DecorationSource | ||
updateProps: () => void | ||
}) => boolean) | ||
| null; | ||
| null | ||
} | ||
@@ -47,3 +41,3 @@ | ||
decorationClasses!: { | ||
value: string; | ||
value: string | ||
} | ||
@@ -73,3 +67,3 @@ | ||
// @ts-ignore | ||
const vue = this.editor.contentComponent?.$options._base ?? Vue; // eslint-disable-line | ||
const vue = this.editor.contentComponent?.$options._base ?? Vue // eslint-disable-line | ||
@@ -152,7 +146,3 @@ const Component = vue.extend(this.component).extend({ | ||
*/ | ||
update( | ||
node: ProseMirrorNode, | ||
decorations: readonly Decoration[], | ||
innerDecorations: DecorationSource, | ||
): boolean { | ||
update(node: ProseMirrorNode, decorations: readonly Decoration[], innerDecorations: DecorationSource): boolean { | ||
const rerenderComponent = (props?: Record<string, any>) => { | ||
@@ -159,0 +149,0 @@ this.decorationClasses.value = this.getDecorationClasses() |
@@ -11,3 +11,3 @@ import Vue from 'vue' | ||
constructor(component: Vue | VueConstructor, props: any) { | ||
const Component = (typeof component === 'function') ? component : Vue.extend(component) | ||
const Component = typeof component === 'function' ? component : Vue.extend(component) | ||
@@ -33,7 +33,5 @@ this.ref = new Component(props).$mount() | ||
Object | ||
.entries(props) | ||
.forEach(([key, value]) => { | ||
this.ref.$props[key] = value | ||
}) | ||
Object.entries(props).forEach(([key, value]) => { | ||
this.ref.$props[key] = value | ||
}) | ||
@@ -40,0 +38,0 @@ currentVueConstructor.config.silent = originalSilent |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
100052
18
1494
19