chore: migrate to new versions of prosemirror packages (#2854)

* refactor: upgrade prosemirror packages to new typescript versions

* refactor: migrate to new typings from prosemirror

* style: fix linting issues

* style: fix linting issues

* style: fix linting issues

* fix(ci): fix build process by reimplement filterTransaction

* fix(extension-test): fix broken build because of wrong output file names

* fix: fix prosemirror-tables not being bundled correctly for ES6

* fix: move to prosemirror-tables-contently until es6 build is working

* fix: fix tests for youtube

* fix: fix youtube test

* fix(demos): fix demos build
This commit is contained in:
Dominik 2022-06-20 11:45:37 +02:00 committed by GitHub
parent 2fa2c22e6f
commit 1ebc8f8e14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
56 changed files with 2440 additions and 6727 deletions

View File

@ -10,15 +10,15 @@ prosemirror-keymap
prosemirror-model
prosemirror-schema-list
prosemirror-state
prosemirror-tables
prosemirror-tables-contently
prosemirror-transform
prosemirror-view
react
react-dom
react-dom/client
shiki
simplify-js
tippy.js
uuid
y-webrtc
yjs
react
react-dom
react-dom/client

View File

@ -16,6 +16,7 @@
"simplify-js": "^1.2.4",
"y-webrtc": "^10.2.2",
"yjs": "^13.5.26",
"y-prosemirror": "1.0.20",
"lowlight": "^1.20.0"
},
"devDependencies": {

View File

@ -4,7 +4,7 @@ context('/src/Examples/CollaborativeEditing/React/', () => {
})
it('should show the current room with participants', () => {
cy.wait(3000)
cy.wait(6000)
cy.get('.editor__status')
.should('contain', 'rooms.')
.should('contain', 'users online')
@ -14,7 +14,7 @@ context('/src/Examples/CollaborativeEditing/React/', () => {
cy.window().then(win => {
cy.stub(win, 'prompt').returns('John Doe')
cy.get('.editor__name > button').click()
cy.wait(3000)
cy.wait(6000)
cy.get('.editor__name').should('contain', 'John Doe')
})

View File

@ -4,7 +4,7 @@ context('/src/Examples/CollaborativeEditing/Vue/', () => {
})
it('should show the current room with participants', () => {
cy.wait(3000)
cy.wait(6000)
cy.get('.editor__status')
.should('contain', 'rooms.')
.should('contain', 'users online')
@ -14,7 +14,7 @@ context('/src/Examples/CollaborativeEditing/Vue/', () => {
cy.window().then(win => {
cy.stub(win, 'prompt').returns('John Doe')
cy.get('.editor__name > button').click()
cy.wait(3000)
cy.wait(6000)
cy.get('.editor__name').should('contain', 'John Doe')
})
})

View File

@ -1,6 +1,6 @@
import { Extension } from '@tiptap/core'
import { NodeSelection, Plugin } from 'prosemirror-state'
import { serializeForClipboard } from 'prosemirror-view/src/clipboard'
import { __serializeForClipboard as serializeForClipboard } from 'prosemirror-view'
function removeNode(node) {
node.parentNode.removeChild(node)

View File

@ -43,7 +43,9 @@ export default () => {
const editor = useEditor({
extensions: [
StarterKit,
Youtube,
Youtube.configure({
controls: false,
}),
],
content: `
<p>Tiptap now supports youtube embeds! Awesome!</p>

View File

@ -43,7 +43,9 @@ export default {
this.editor = new Editor({
extensions: [
StarterKit,
Youtube,
Youtube.configure({
controls: false,
}),
],
content: `
<p>Tiptap now supports youtube embeds! Awesome!</p>

8434
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -24,20 +24,13 @@
"dist"
],
"dependencies": {
"@types/prosemirror-commands": "^1.0.4",
"@types/prosemirror-keymap": "^1.0.4",
"@types/prosemirror-model": "^1.16.0",
"@types/prosemirror-schema-list": "^1.0.3",
"@types/prosemirror-state": "^1.2.8",
"@types/prosemirror-transform": "^1.1.5",
"@types/prosemirror-view": "^1.23.1",
"prosemirror-commands": "^1.2.1",
"prosemirror-keymap": "^1.1.5",
"prosemirror-model": "^1.16.1",
"prosemirror-schema-list": "^1.1.6",
"prosemirror-state": "^1.3.4",
"prosemirror-transform": "^1.3.3",
"prosemirror-view": "^1.23.6"
"prosemirror-commands": "^1.3.0",
"prosemirror-keymap": "^1.2.0",
"prosemirror-model": "^1.17.0",
"prosemirror-schema-list": "^1.2.0",
"prosemirror-state": "^1.4.0",
"prosemirror-transform": "^1.6.0",
"prosemirror-view": "^1.25.0"
},
"repository": {
"type": "git",
@ -45,4 +38,4 @@
"directory": "packages/core"
},
"sideEffects": false
}
}

View File

@ -198,7 +198,7 @@ export class Editor extends EventEmitter<EditorEvents> {
*/
public registerPlugin(plugin: Plugin, handlePlugins?: (newPlugin: Plugin, plugins: Plugin[]) => Plugin[]): void {
const plugins = isFunction(handlePlugins)
? handlePlugins(plugin, this.state.plugins)
? handlePlugins(plugin, [...this.state.plugins])
: [...this.state.plugins, plugin]
const state = this.state.reconfigure({ plugins })
@ -271,7 +271,7 @@ export class Editor extends EventEmitter<EditorEvents> {
dispatchTransaction: this.dispatchTransaction.bind(this),
state: EditorState.create({
doc,
selection,
selection: selection || undefined,
}),
})

View File

@ -188,7 +188,7 @@ export function inputRulesPlugin(props: { editor: Editor, rules: InputRule[] }):
return null
},
apply(tr, prev) {
const stored = tr.getMeta(this)
const stored = tr.getMeta(plugin)
if (stored) {
return stored

View File

@ -49,11 +49,11 @@ export class NodeView<
return
}
get dom(): Element | null {
return null
get dom(): HTMLElement {
return this.editor.view.dom as HTMLElement
}
get contentDOM(): Element | null {
get contentDOM(): HTMLElement | null {
return null
}

View File

@ -191,7 +191,7 @@ export function pasteRulesPlugin(props: { editor: Editor, rules: PasteRule[] }):
},
paste: (view, event) => {
const html = event.clipboardData?.getData('text/html')
const html = (event as ClipboardEvent).clipboardData?.getData('text/html')
isPastedFromProseMirror = !!html?.includes('data-pm-slice')

View File

@ -10,13 +10,7 @@ export const Tabindex = Extension.create({
new Plugin({
key: new PluginKey('tabindex'),
props: {
attributes: () => {
if (this.editor.isEditable) {
return {
tabindex: '0',
}
}
},
attributes: this.editor.isEditable ? { tabindex: '0' } : {},
},
}),
]

View File

@ -11,10 +11,11 @@ export function createChainableState(config: {
return {
...state,
schema: state.schema,
plugins: state.plugins,
apply: state.apply.bind(state),
applyTransaction: state.applyTransaction.bind(state),
filterTransaction: state.filterTransaction,
plugins: state.plugins,
schema: state.schema,
reconfigure: state.reconfigure.bind(state),
toJSON: state.toJSON.bind(state),
get storedMarks() {

View File

@ -40,7 +40,7 @@ export function getMarkRange(
return
}
const mark = findMarkInSet(start.node.marks, type, attributes)
const mark = findMarkInSet([...start.node.marks], type, attributes)
if (!mark) {
return
@ -51,7 +51,7 @@ export function getMarkRange(
let endIndex = startIndex + 1
let endPos = startPos + start.node.nodeSize
findMarkInSet(start.node.marks, type, attributes)
findMarkInSet([...start.node.marks], type, attributes)
while (startIndex > 0 && mark.isInSet($pos.parent.child(startIndex - 1).marks)) {
startIndex -= 1
@ -60,7 +60,7 @@ export function getMarkRange(
while (
endIndex < $pos.parent.childCount
&& isMarkInSet($pos.parent.child(endIndex).marks, type, attributes)
&& isMarkInSet([...$pos.parent.child(endIndex).marks], type, attributes)
) {
endPos += $pos.parent.child(endIndex).nodeSize
endIndex += 1

View File

@ -27,13 +27,15 @@ export function getTextBetween(
separated = true
}
text += textSerializer({
node,
pos,
parent,
index,
range,
})
if (parent) {
text += textSerializer({
node,
pos,
parent,
index,
range,
})
}
} else if (node.isText) {
text += node?.text?.slice(Math.max(from, pos) - pos, to - pos) // eslint-disable-line
separated = false

View File

@ -1,6 +1,6 @@
import { ResolvedPos } from 'prosemirror-model'
export const getTextContentFromNodes = ($from: ResolvedPos<any>, maxMatch = 500) => {
export const getTextContentFromNodes = ($from: ResolvedPos, maxMatch = 500) => {
let textBefore = ''
$from.parent.nodesBetween(

View File

@ -24,8 +24,8 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"prosemirror-state": "^1.3.4",
"prosemirror-view": "^1.23.6",
"prosemirror-state": "^1.4.0",
"prosemirror-view": "^1.25.0",
"tippy.js": "^6.3.7"
},
"repository": {
@ -34,4 +34,4 @@
"directory": "packages/extension-bubble-menu"
},
"sideEffects": false
}
}

View File

@ -24,12 +24,12 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"prosemirror-model": "^1.16.1",
"prosemirror-state": "^1.3.4"
"prosemirror-model": "^1.17.0",
"prosemirror-state": "^1.4.0"
},
"repository": {
"type": "git",
"url": "https://github.com/ueberdosis/tiptap",
"directory": "packages/extension-character-count"
}
}
}

View File

@ -27,13 +27,14 @@
"dependencies": {
"@tiptap/extension-code-block": "^2.0.0-beta.40",
"@types/lowlight": "^0.0.3",
"prosemirror-model": "^1.16.1",
"prosemirror-state": "^1.3.4",
"prosemirror-view": "^1.23.6"
"lowlight": "^1.20.0",
"prosemirror-model": "^1.17.0",
"prosemirror-state": "^1.4.0",
"prosemirror-view": "^1.25.0"
},
"repository": {
"type": "git",
"url": "https://github.com/ueberdosis/tiptap",
"directory": "packages/extension-code-block-lowlight"
}
}
}

View File

@ -74,7 +74,7 @@ export function LowlightPlugin({ name, lowlight, defaultLanguage }: { name: stri
throw Error('You should provide an instance of lowlight to use the code-block-lowlight extension')
}
return new Plugin({
const lowlightPlugin: Plugin<any> = new Plugin({
key: new PluginKey('lowlight'),
state: {
@ -129,8 +129,10 @@ export function LowlightPlugin({ name, lowlight, defaultLanguage }: { name: stri
props: {
decorations(state) {
return this.getState(state)
return lowlightPlugin.getState(state)
},
},
})
return lowlightPlugin
}

View File

@ -24,11 +24,11 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"prosemirror-state": "^1.3.4"
"prosemirror-state": "^1.4.0"
},
"repository": {
"type": "git",
"url": "https://github.com/ueberdosis/tiptap",
"directory": "packages/extension-code-block"
}
}
}

View File

@ -24,7 +24,7 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"prosemirror-state": "^1.3.4",
"prosemirror-state": "^1.4.0",
"y-prosemirror": "1.0.20"
},
"repository": {

View File

@ -24,12 +24,11 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"@types/prosemirror-dropcursor": "^1.0.3",
"prosemirror-dropcursor": "^1.4.0"
"prosemirror-dropcursor": "^1.5.0"
},
"repository": {
"type": "git",
"url": "https://github.com/ueberdosis/tiptap",
"directory": "packages/extension-dropcursor"
}
}
}

View File

@ -2,9 +2,9 @@ import { Extension } from '@tiptap/core'
import { dropCursor } from 'prosemirror-dropcursor'
export interface DropcursorOptions {
color: string | null,
width: number | null,
class: string | null,
color: string | undefined,
width: number | undefined,
class: string | undefined,
}
export const Dropcursor = Extension.create<DropcursorOptions>({
@ -14,7 +14,7 @@ export const Dropcursor = Extension.create<DropcursorOptions>({
return {
color: 'currentColor',
width: 1,
class: null,
class: undefined,
}
},

View File

@ -24,8 +24,8 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"prosemirror-state": "^1.3.4",
"prosemirror-view": "^1.23.6",
"prosemirror-state": "^1.4.0",
"prosemirror-view": "^1.25.0",
"tippy.js": "^6.3.7"
},
"repository": {
@ -34,4 +34,4 @@
"directory": "packages/extension-floating-menu"
},
"sideEffects": false
}
}

View File

@ -24,12 +24,12 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"prosemirror-state": "^1.3.4",
"prosemirror-view": "^1.23.6"
"prosemirror-state": "^1.4.0",
"prosemirror-view": "^1.25.0"
},
"repository": {
"type": "git",
"url": "https://github.com/ueberdosis/tiptap",
"directory": "packages/extension-focus"
}
}
}

View File

@ -24,12 +24,11 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"@types/prosemirror-gapcursor": "^1.0.4",
"prosemirror-gapcursor": "^1.2.1"
"prosemirror-gapcursor": "^1.3.0"
},
"repository": {
"type": "git",
"url": "https://github.com/ueberdosis/tiptap",
"directory": "packages/extension-gapcursor"
}
}
}

View File

@ -24,12 +24,11 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"@types/prosemirror-history": "^1.0.3",
"prosemirror-history": "^1.2.0"
"prosemirror-history": "^1.3.0"
},
"repository": {
"type": "git",
"url": "https://github.com/ueberdosis/tiptap",
"directory": "packages/extension-history"
}
}
}

View File

@ -24,11 +24,11 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"prosemirror-state": "^1.3.4"
"prosemirror-state": "^1.4.0"
},
"repository": {
"type": "git",
"url": "https://github.com/ueberdosis/tiptap",
"directory": "packages/extension-horizontal-rule"
}
}
}

View File

@ -25,12 +25,12 @@
},
"dependencies": {
"linkifyjs": "^3.0.5",
"prosemirror-model": "^1.16.1",
"prosemirror-state": "^1.3.4"
"prosemirror-model": "^1.17.0",
"prosemirror-state": "^1.4.0"
},
"repository": {
"type": "git",
"url": "https://github.com/ueberdosis/tiptap",
"directory": "packages/extension-link"
}
}
}

View File

@ -26,7 +26,7 @@ export function autolink(options: AutolinkOptions): Plugin {
}
const { tr } = newState
const transform = combineTransactionSteps(oldState.doc, transactions)
const transform = combineTransactionSteps(oldState.doc, [...transactions])
const { mapping } = transform
const changes = getChangedRanges(transform)

View File

@ -25,8 +25,8 @@
},
"dependencies": {
"@tiptap/suggestion": "^2.0.0-beta.95",
"prosemirror-model": "^1.16.1",
"prosemirror-state": "^1.3.4"
"prosemirror-model": "^1.17.0",
"prosemirror-state": "^1.4.0"
},
"repository": {
"type": "git",

View File

@ -24,13 +24,13 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"prosemirror-model": "^1.16.1",
"prosemirror-state": "^1.3.4",
"prosemirror-view": "^1.23.6"
"prosemirror-model": "^1.17.0",
"prosemirror-state": "^1.4.0",
"prosemirror-view": "^1.25.0"
},
"repository": {
"type": "git",
"url": "https://github.com/ueberdosis/tiptap",
"directory": "packages/extension-placeholder"
}
}
}

View File

@ -41,7 +41,7 @@ export const Placeholder = Extension.create<PlaceholderOptions>({
const decorations: Decoration[] = []
if (!active) {
return
return null
}
doc.descendants((node, pos) => {

View File

@ -46,6 +46,7 @@ export const Subscript = Mark.create<SubscriptExtensionOptions>({
}
// If it falls through well match, and this mark will be applied.
return null
},
},
]

View File

@ -46,6 +46,7 @@ export const Superscript = Mark.create<SuperscriptExtensionOptions>({
}
// If it falls through well match, and this mark will be applied.
return null
},
},
]

412
packages/extension-table/package-lock.json generated Normal file
View File

@ -0,0 +1,412 @@
{
"name": "@tiptap/extension-table",
"version": "2.0.0-beta.52",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@tiptap/extension-table",
"version": "2.0.0-beta.52",
"license": "MIT",
"dependencies": {
"prosemirror-model": "^1.17.0",
"prosemirror-state": "^1.4.0",
"prosemirror-tables-contently": "^1.1.2",
"prosemirror-view": "^1.25.0"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/ueberdosis"
},
"peerDependencies": {
"@tiptap/core": "^2.0.0-beta.1"
}
},
"node_modules/@tiptap/core": {
"version": "2.0.0-beta.179",
"resolved": "https://registry.npmjs.org/@tiptap/core/-/core-2.0.0-beta.179.tgz",
"integrity": "sha512-weJKZ761+PCimMCSLILsN4IodEGPmnsu+stD+MkUTJSKAp/nCDH0FcIgq80FOF7+TMqRHXWuGoeHf9GSvSMZHQ==",
"peer": true,
"dependencies": {
"@types/prosemirror-commands": "^1.0.4",
"@types/prosemirror-keymap": "^1.0.4",
"@types/prosemirror-model": "^1.16.0",
"@types/prosemirror-schema-list": "^1.0.3",
"@types/prosemirror-state": "^1.2.8",
"@types/prosemirror-transform": "^1.1.5",
"@types/prosemirror-view": "^1.23.1",
"prosemirror-commands": "^1.2.1",
"prosemirror-keymap": "^1.1.5",
"prosemirror-model": "^1.16.1",
"prosemirror-schema-list": "^1.1.6",
"prosemirror-state": "^1.3.4",
"prosemirror-transform": "^1.3.3",
"prosemirror-view": "^1.23.6"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/ueberdosis"
}
},
"node_modules/@types/orderedmap": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@types/orderedmap/-/orderedmap-1.0.0.tgz",
"integrity": "sha512-dxKo80TqYx3YtBipHwA/SdFmMMyLCnP+5mkEqN0eMjcTBzHkiiX0ES118DsjDBjvD+zeSsSU9jULTZ+frog+Gw==",
"peer": true
},
"node_modules/@types/prosemirror-commands": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@types/prosemirror-commands/-/prosemirror-commands-1.0.4.tgz",
"integrity": "sha512-utDNYB3EXLjAfYIcRWJe6pn3kcQ5kG4RijbT/0Y/TFOm6yhvYS/D9eJVnijdg9LDjykapcezchxGRqFD5LcyaQ==",
"peer": true,
"dependencies": {
"@types/prosemirror-model": "*",
"@types/prosemirror-state": "*",
"@types/prosemirror-view": "*"
}
},
"node_modules/@types/prosemirror-keymap": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@types/prosemirror-keymap/-/prosemirror-keymap-1.0.4.tgz",
"integrity": "sha512-ycevwkqUh+jEQtPwqO7sWGcm+Sybmhu8MpBsM8DlO3+YTKnXbKA6SDz/+q14q1wK3UA8lHJyfR+v+GPxfUSemg==",
"peer": true,
"dependencies": {
"@types/prosemirror-commands": "*",
"@types/prosemirror-model": "*",
"@types/prosemirror-state": "*",
"@types/prosemirror-view": "*"
}
},
"node_modules/@types/prosemirror-model": {
"version": "1.16.2",
"resolved": "https://registry.npmjs.org/@types/prosemirror-model/-/prosemirror-model-1.16.2.tgz",
"integrity": "sha512-1XPJopkKP3oHSBP61uuSuW13DIDZPWvAzP6Pv2/6mixk8EBPUeRGIW548DjJTicMo23gEg1zvCZy9asblQdWag==",
"peer": true,
"dependencies": {
"@types/orderedmap": "*"
}
},
"node_modules/@types/prosemirror-schema-list": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@types/prosemirror-schema-list/-/prosemirror-schema-list-1.0.3.tgz",
"integrity": "sha512-uWybOf+M2Ea7rlbs0yLsS4YJYNGXYtn4N+w8HCw3Vvfl6wBAROzlMt0gV/D/VW/7J/LlAjwMezuGe8xi24HzXA==",
"peer": true,
"dependencies": {
"@types/orderedmap": "*",
"@types/prosemirror-model": "*",
"@types/prosemirror-state": "*"
}
},
"node_modules/@types/prosemirror-state": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/@types/prosemirror-state/-/prosemirror-state-1.3.0.tgz",
"integrity": "sha512-nMdUF6w8B++NH4V54X+4GvDty7M02UfuHQW0s1AS25Z4ZrOW4RSY2+s57doXBbeMSjzYV/QoMxCY2sT3KQ2VdQ==",
"peer": true,
"dependencies": {
"@types/prosemirror-model": "*",
"@types/prosemirror-transform": "*",
"@types/prosemirror-view": "*"
}
},
"node_modules/@types/prosemirror-transform": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/@types/prosemirror-transform/-/prosemirror-transform-1.4.2.tgz",
"integrity": "sha512-FZNzjYm6YUkb1XXOrw2193TiFzwM92ui1nycNaRSd5JDbugf9yBLkXm4Rq3HGJJxBBkRcUE8niqUW5aWlXQQiQ==",
"peer": true,
"dependencies": {
"@types/prosemirror-model": "*"
}
},
"node_modules/@types/prosemirror-view": {
"version": "1.23.3",
"resolved": "https://registry.npmjs.org/@types/prosemirror-view/-/prosemirror-view-1.23.3.tgz",
"integrity": "sha512-T5dPDmZiXAazJVSvnx55D6h4mcpiH2q2wTyO9zIeOdox5zx964+zcDl9dFNaXG3qCGlERwMPckhBZL1HCxyygw==",
"peer": true,
"dependencies": {
"@types/prosemirror-model": "*",
"@types/prosemirror-state": "*",
"@types/prosemirror-transform": "*"
}
},
"node_modules/orderedmap": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/orderedmap/-/orderedmap-2.0.0.tgz",
"integrity": "sha512-buf4PoAMlh45b8a8gsGy/X6w279TSqkyAS0C0wdTSJwFSU+ljQFJON5I8NfjLHoCXwpSROIo2wr0g33T+kQshQ=="
},
"node_modules/prosemirror-commands": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.3.0.tgz",
"integrity": "sha512-BwBbZ5OAScPcm0x7H8SPbqjuEJnCU2RJT9LDyOiiIl/3NbL1nJZI4SFNHwU2e/tRr2Xe7JsptpzseqvZvToLBQ==",
"peer": true,
"dependencies": {
"prosemirror-model": "^1.0.0",
"prosemirror-state": "^1.0.0",
"prosemirror-transform": "^1.0.0"
}
},
"node_modules/prosemirror-keymap": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/prosemirror-keymap/-/prosemirror-keymap-1.2.0.tgz",
"integrity": "sha512-TdSfu+YyLDd54ufN/ZeD1VtBRYpgZnTPnnbY+4R08DDgs84KrIPEPbJL8t1Lm2dkljFx6xeBE26YWH3aIzkPKg==",
"dependencies": {
"prosemirror-state": "^1.0.0",
"w3c-keyname": "^2.2.0"
}
},
"node_modules/prosemirror-model": {
"version": "1.18.1",
"resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.18.1.tgz",
"integrity": "sha512-IxSVBKAEMjD7s3n8cgtwMlxAXZrC7Mlag7zYsAKDndAqnDScvSmp/UdnRTV/B33lTCVU3CCm7dyAn/rVVD0mcw==",
"dependencies": {
"orderedmap": "^2.0.0"
}
},
"node_modules/prosemirror-schema-list": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/prosemirror-schema-list/-/prosemirror-schema-list-1.2.0.tgz",
"integrity": "sha512-8PT/9xOx1HHdC7fDNNfhQ50Z8Mzu7nKyA1KCDltSpcZVZIbB0k7KtsHrnXyuIhbLlScoymBiLZ00c5MH6wdFsA==",
"peer": true,
"dependencies": {
"prosemirror-model": "^1.0.0",
"prosemirror-state": "^1.0.0",
"prosemirror-transform": "^1.0.0"
}
},
"node_modules/prosemirror-state": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/prosemirror-state/-/prosemirror-state-1.4.0.tgz",
"integrity": "sha512-mVDZdjNX/YT5FvypiwbphJe9psA5h+j9apsSszVRFc6oKFoIInvzdujh8QW9f9lwHtSYajLxNiM1hPhd0Sl1XA==",
"dependencies": {
"prosemirror-model": "^1.0.0",
"prosemirror-transform": "^1.0.0"
}
},
"node_modules/prosemirror-tables-contently": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/prosemirror-tables-contently/-/prosemirror-tables-contently-1.1.2.tgz",
"integrity": "sha512-REa13GZyVcmwUef6eFfGIZ4IIT3n+95+FEQC0mIg3F7MlwBp5q2lL5y/Pl8EcSIDDagoXp/8oW6uaYy0tWhb6A==",
"dependencies": {
"prosemirror-keymap": "^1.1.2",
"prosemirror-model": "^1.8.1",
"prosemirror-state": "^1.3.1",
"prosemirror-transform": "^1.2.1",
"prosemirror-view": "^1.13.3"
}
},
"node_modules/prosemirror-transform": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/prosemirror-transform/-/prosemirror-transform-1.6.0.tgz",
"integrity": "sha512-MAp7AjsjEGEqQY0sSMufNIUuEyB1ZR9Fqlm8dTwwWwpEJRv/plsKjWXBbx52q3Ml8MtaMcd7ic14zAHVB3WaMw==",
"dependencies": {
"prosemirror-model": "^1.0.0"
}
},
"node_modules/prosemirror-view": {
"version": "1.26.1",
"resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.26.1.tgz",
"integrity": "sha512-8MEuEFQ64zoIRSz24A97WhtSqtZynTwTsECt0kOh0TotNx/YRPKWozEmUJUmJGUYsFowZNdsI0gm1bvX1x3/9Q==",
"dependencies": {
"prosemirror-model": "^1.16.0",
"prosemirror-state": "^1.0.0",
"prosemirror-transform": "^1.1.0"
}
},
"node_modules/w3c-keyname": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.4.tgz",
"integrity": "sha512-tOhfEwEzFLJzf6d1ZPkYfGj+FWhIpBux9ppoP3rlclw3Z0BZv3N7b7030Z1kYth+6rDuAsXUFr+d0VE6Ed1ikw=="
}
},
"dependencies": {
"@tiptap/core": {
"version": "2.0.0-beta.179",
"resolved": "https://registry.npmjs.org/@tiptap/core/-/core-2.0.0-beta.179.tgz",
"integrity": "sha512-weJKZ761+PCimMCSLILsN4IodEGPmnsu+stD+MkUTJSKAp/nCDH0FcIgq80FOF7+TMqRHXWuGoeHf9GSvSMZHQ==",
"peer": true,
"requires": {
"@types/prosemirror-commands": "^1.0.4",
"@types/prosemirror-keymap": "^1.0.4",
"@types/prosemirror-model": "^1.16.0",
"@types/prosemirror-schema-list": "^1.0.3",
"@types/prosemirror-state": "^1.2.8",
"@types/prosemirror-transform": "^1.1.5",
"@types/prosemirror-view": "^1.23.1",
"prosemirror-commands": "^1.2.1",
"prosemirror-keymap": "^1.1.5",
"prosemirror-model": "^1.16.1",
"prosemirror-schema-list": "^1.1.6",
"prosemirror-state": "^1.3.4",
"prosemirror-transform": "^1.3.3",
"prosemirror-view": "^1.23.6"
}
},
"@types/orderedmap": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@types/orderedmap/-/orderedmap-1.0.0.tgz",
"integrity": "sha512-dxKo80TqYx3YtBipHwA/SdFmMMyLCnP+5mkEqN0eMjcTBzHkiiX0ES118DsjDBjvD+zeSsSU9jULTZ+frog+Gw==",
"peer": true
},
"@types/prosemirror-commands": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@types/prosemirror-commands/-/prosemirror-commands-1.0.4.tgz",
"integrity": "sha512-utDNYB3EXLjAfYIcRWJe6pn3kcQ5kG4RijbT/0Y/TFOm6yhvYS/D9eJVnijdg9LDjykapcezchxGRqFD5LcyaQ==",
"peer": true,
"requires": {
"@types/prosemirror-model": "*",
"@types/prosemirror-state": "*",
"@types/prosemirror-view": "*"
}
},
"@types/prosemirror-keymap": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@types/prosemirror-keymap/-/prosemirror-keymap-1.0.4.tgz",
"integrity": "sha512-ycevwkqUh+jEQtPwqO7sWGcm+Sybmhu8MpBsM8DlO3+YTKnXbKA6SDz/+q14q1wK3UA8lHJyfR+v+GPxfUSemg==",
"peer": true,
"requires": {
"@types/prosemirror-commands": "*",
"@types/prosemirror-model": "*",
"@types/prosemirror-state": "*",
"@types/prosemirror-view": "*"
}
},
"@types/prosemirror-model": {
"version": "1.16.2",
"resolved": "https://registry.npmjs.org/@types/prosemirror-model/-/prosemirror-model-1.16.2.tgz",
"integrity": "sha512-1XPJopkKP3oHSBP61uuSuW13DIDZPWvAzP6Pv2/6mixk8EBPUeRGIW548DjJTicMo23gEg1zvCZy9asblQdWag==",
"peer": true,
"requires": {
"@types/orderedmap": "*"
}
},
"@types/prosemirror-schema-list": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@types/prosemirror-schema-list/-/prosemirror-schema-list-1.0.3.tgz",
"integrity": "sha512-uWybOf+M2Ea7rlbs0yLsS4YJYNGXYtn4N+w8HCw3Vvfl6wBAROzlMt0gV/D/VW/7J/LlAjwMezuGe8xi24HzXA==",
"peer": true,
"requires": {
"@types/orderedmap": "*",
"@types/prosemirror-model": "*",
"@types/prosemirror-state": "*"
}
},
"@types/prosemirror-state": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/@types/prosemirror-state/-/prosemirror-state-1.3.0.tgz",
"integrity": "sha512-nMdUF6w8B++NH4V54X+4GvDty7M02UfuHQW0s1AS25Z4ZrOW4RSY2+s57doXBbeMSjzYV/QoMxCY2sT3KQ2VdQ==",
"peer": true,
"requires": {
"@types/prosemirror-model": "*",
"@types/prosemirror-transform": "*",
"@types/prosemirror-view": "*"
}
},
"@types/prosemirror-transform": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/@types/prosemirror-transform/-/prosemirror-transform-1.4.2.tgz",
"integrity": "sha512-FZNzjYm6YUkb1XXOrw2193TiFzwM92ui1nycNaRSd5JDbugf9yBLkXm4Rq3HGJJxBBkRcUE8niqUW5aWlXQQiQ==",
"peer": true,
"requires": {
"@types/prosemirror-model": "*"
}
},
"@types/prosemirror-view": {
"version": "1.23.3",
"resolved": "https://registry.npmjs.org/@types/prosemirror-view/-/prosemirror-view-1.23.3.tgz",
"integrity": "sha512-T5dPDmZiXAazJVSvnx55D6h4mcpiH2q2wTyO9zIeOdox5zx964+zcDl9dFNaXG3qCGlERwMPckhBZL1HCxyygw==",
"peer": true,
"requires": {
"@types/prosemirror-model": "*",
"@types/prosemirror-state": "*",
"@types/prosemirror-transform": "*"
}
},
"orderedmap": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/orderedmap/-/orderedmap-2.0.0.tgz",
"integrity": "sha512-buf4PoAMlh45b8a8gsGy/X6w279TSqkyAS0C0wdTSJwFSU+ljQFJON5I8NfjLHoCXwpSROIo2wr0g33T+kQshQ=="
},
"prosemirror-commands": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.3.0.tgz",
"integrity": "sha512-BwBbZ5OAScPcm0x7H8SPbqjuEJnCU2RJT9LDyOiiIl/3NbL1nJZI4SFNHwU2e/tRr2Xe7JsptpzseqvZvToLBQ==",
"peer": true,
"requires": {
"prosemirror-model": "^1.0.0",
"prosemirror-state": "^1.0.0",
"prosemirror-transform": "^1.0.0"
}
},
"prosemirror-keymap": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/prosemirror-keymap/-/prosemirror-keymap-1.2.0.tgz",
"integrity": "sha512-TdSfu+YyLDd54ufN/ZeD1VtBRYpgZnTPnnbY+4R08DDgs84KrIPEPbJL8t1Lm2dkljFx6xeBE26YWH3aIzkPKg==",
"requires": {
"prosemirror-state": "^1.0.0",
"w3c-keyname": "^2.2.0"
}
},
"prosemirror-model": {
"version": "1.18.1",
"resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.18.1.tgz",
"integrity": "sha512-IxSVBKAEMjD7s3n8cgtwMlxAXZrC7Mlag7zYsAKDndAqnDScvSmp/UdnRTV/B33lTCVU3CCm7dyAn/rVVD0mcw==",
"requires": {
"orderedmap": "^2.0.0"
}
},
"prosemirror-schema-list": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/prosemirror-schema-list/-/prosemirror-schema-list-1.2.0.tgz",
"integrity": "sha512-8PT/9xOx1HHdC7fDNNfhQ50Z8Mzu7nKyA1KCDltSpcZVZIbB0k7KtsHrnXyuIhbLlScoymBiLZ00c5MH6wdFsA==",
"peer": true,
"requires": {
"prosemirror-model": "^1.0.0",
"prosemirror-state": "^1.0.0",
"prosemirror-transform": "^1.0.0"
}
},
"prosemirror-state": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/prosemirror-state/-/prosemirror-state-1.4.0.tgz",
"integrity": "sha512-mVDZdjNX/YT5FvypiwbphJe9psA5h+j9apsSszVRFc6oKFoIInvzdujh8QW9f9lwHtSYajLxNiM1hPhd0Sl1XA==",
"requires": {
"prosemirror-model": "^1.0.0",
"prosemirror-transform": "^1.0.0"
}
},
"prosemirror-tables-contently": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/prosemirror-tables-contently/-/prosemirror-tables-contently-1.1.2.tgz",
"integrity": "sha512-REa13GZyVcmwUef6eFfGIZ4IIT3n+95+FEQC0mIg3F7MlwBp5q2lL5y/Pl8EcSIDDagoXp/8oW6uaYy0tWhb6A==",
"requires": {
"prosemirror-keymap": "^1.1.2",
"prosemirror-model": "^1.8.1",
"prosemirror-state": "^1.3.1",
"prosemirror-transform": "^1.2.1",
"prosemirror-view": "^1.13.3"
}
},
"prosemirror-transform": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/prosemirror-transform/-/prosemirror-transform-1.6.0.tgz",
"integrity": "sha512-MAp7AjsjEGEqQY0sSMufNIUuEyB1ZR9Fqlm8dTwwWwpEJRv/plsKjWXBbx52q3Ml8MtaMcd7ic14zAHVB3WaMw==",
"requires": {
"prosemirror-model": "^1.0.0"
}
},
"prosemirror-view": {
"version": "1.26.1",
"resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.26.1.tgz",
"integrity": "sha512-8MEuEFQ64zoIRSz24A97WhtSqtZynTwTsECt0kOh0TotNx/YRPKWozEmUJUmJGUYsFowZNdsI0gm1bvX1x3/9Q==",
"requires": {
"prosemirror-model": "^1.16.0",
"prosemirror-state": "^1.0.0",
"prosemirror-transform": "^1.1.0"
}
},
"w3c-keyname": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.4.tgz",
"integrity": "sha512-tOhfEwEzFLJzf6d1ZPkYfGj+FWhIpBux9ppoP3rlclw3Z0BZv3N7b7030Z1kYth+6rDuAsXUFr+d0VE6Ed1ikw=="
}
}
}

View File

@ -24,12 +24,10 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"@types/prosemirror-model": "^1.16.0",
"@types/prosemirror-state": "^1.2.8",
"prosemirror-model": "^1.16.1",
"prosemirror-state": "^1.3.4",
"prosemirror-tables": "^1.1.1",
"prosemirror-view": "^1.23.6"
"prosemirror-model": "^1.17.0",
"prosemirror-state": "^1.4.0",
"prosemirror-tables-contently": "^1.1.2",
"prosemirror-view": "^1.25.0"
},
"repository": {
"type": "git",

View File

@ -24,7 +24,7 @@ import {
tableEditing,
toggleHeader,
toggleHeaderCell,
} from 'prosemirror-tables'
} from 'prosemirror-tables-contently'
import { NodeView } from 'prosemirror-view'
import { TableView } from './TableView'

View File

@ -1,10 +1,6 @@
import {
Fragment,
Node as ProsemirrorNode,
NodeType, Schema,
} from 'prosemirror-model'
import { Fragment, Node as ProsemirrorNode, NodeType } from 'prosemirror-model'
export function createCell(cellType: NodeType, cellContent?: Fragment<Schema> | ProsemirrorNode<Schema> | Array<ProsemirrorNode<Schema>>): ProsemirrorNode | null | undefined {
export function createCell(cellType: NodeType, cellContent?: Fragment | ProsemirrorNode | Array<ProsemirrorNode>): ProsemirrorNode | null | undefined {
if (cellContent) {
return cellType.createChecked(null, cellContent)
}

View File

@ -3,7 +3,7 @@ import { Fragment, Node as ProsemirrorNode, Schema } from 'prosemirror-model'
import { createCell } from './createCell'
import { getTableNodeTypes } from './getTableNodeTypes'
export function createTable(schema: Schema, rowsCount: number, colsCount: number, withHeaderRow: boolean, cellContent?: Fragment<Schema> | ProsemirrorNode<Schema> | Array<ProsemirrorNode<Schema>>): ProsemirrorNode {
export function createTable(schema: Schema, rowsCount: number, colsCount: number, withHeaderRow: boolean, cellContent?: Fragment | ProsemirrorNode | Array<ProsemirrorNode>): ProsemirrorNode {
const types = getTableNodeTypes(schema)
const headerCells = []
const cells = []

View File

@ -1,4 +1,4 @@
import { CellSelection } from 'prosemirror-tables'
import { CellSelection } from 'prosemirror-tables-contently'
export function isCellSelection(value: unknown): value is CellSelection {
return value instanceof CellSelection

View File

@ -22,7 +22,7 @@
],
"peerDependencies": {
"@tiptap/core": "^2.0.0-beta.1",
"prosemirror-model": "^1.16.1"
"prosemirror-model": "^1.17.0"
},
"repository": {
"type": "git",

View File

@ -12,10 +12,10 @@
"type": "github",
"url": "https://github.com/sponsors/ueberdosis"
},
"main": "dist/tiptap-extension-video.cjs.js",
"umd": "dist/tiptap-extension-video.umd.js",
"module": "dist/tiptap-extension-video.esm.js",
"types": "dist/packages/extension-video/src/index.d.ts",
"main": "dist/tiptap-extension-youtube.cjs.js",
"umd": "dist/tiptap-extension-youtube.umd.js",
"module": "dist/tiptap-extension-youtube.esm.js",
"types": "dist/packages/extension-youtube/src/index.d.ts",
"files": [
"src",
"dist"
@ -26,6 +26,6 @@
"repository": {
"type": "git",
"url": "https://github.com/ueberdosis/tiptap",
"directory": "packages/extension-video"
"directory": "packages/extension-youtube"
}
}

View File

@ -22,7 +22,7 @@
],
"dependencies": {
"@tiptap/core": "^2.0.0-beta.179",
"prosemirror-model": "^1.16.1",
"prosemirror-model": "^1.17.0",
"zeed-dom": "^0.9.19"
},
"repository": {

View File

@ -5,7 +5,7 @@ export function getHTMLFromFragment(doc: Node, schema: Schema): string {
const document = DOMSerializer
.fromSchema(schema)
.serializeFragment(doc.content, {
document: createHTMLDocument(),
document: (createHTMLDocument() as unknown as Document),
}) as unknown as VHTMLDocument
return document.render()

View File

@ -34,7 +34,7 @@
"dependencies": {
"@tiptap/extension-bubble-menu": "^2.0.0-beta.59",
"@tiptap/extension-floating-menu": "^2.0.0-beta.54",
"prosemirror-view": "^1.23.6"
"prosemirror-view": "^1.25.0"
},
"repository": {
"type": "git",

View File

@ -14,19 +14,24 @@ import { ReactRenderer } from './ReactRenderer'
import { ReactNodeViewContext, ReactNodeViewContextProps } from './useReactNodeView'
export interface ReactNodeViewRendererOptions extends NodeViewRendererOptions {
update: ((props: {
oldNode: ProseMirrorNode,
oldDecorations: Decoration[],
newNode: ProseMirrorNode,
newDecorations: Decoration[],
updateProps: () => void,
}) => boolean) | null,
as?: string,
className?: string,
update:
| ((props: {
oldNode: ProseMirrorNode;
oldDecorations: Decoration[];
newNode: ProseMirrorNode;
newDecorations: Decoration[];
updateProps: () => void;
}) => boolean)
| null;
as?: string;
className?: string;
}
class ReactNodeView extends NodeView<React.FunctionComponent, Editor, ReactNodeViewRendererOptions> {
class ReactNodeView extends NodeView<
React.FunctionComponent,
Editor,
ReactNodeViewRendererOptions
> {
renderer!: ReactRenderer
contentDOMElement!: HTMLElement | null
@ -55,11 +60,7 @@ class ReactNodeView extends NodeView<React.FunctionComponent, Editor, ReactNodeV
const Component = this.component
const onDragStart = this.onDragStart.bind(this)
const nodeViewContentRef: ReactNodeViewContextProps['nodeViewContentRef'] = element => {
if (
element
&& this.contentDOMElement
&& element.firstChild !== this.contentDOMElement
) {
if (element && this.contentDOMElement && element.firstChild !== this.contentDOMElement) {
element.appendChild(this.contentDOMElement)
}
}
@ -108,7 +109,7 @@ class ReactNodeView extends NodeView<React.FunctionComponent, Editor, ReactNodeV
throw Error('Please use the NodeViewWrapper component for your node view.')
}
return this.renderer.element
return this.renderer.element as HTMLElement
}
get contentDOM() {
@ -174,7 +175,10 @@ class ReactNodeView extends NodeView<React.FunctionComponent, Editor, ReactNodeV
}
}
export function ReactNodeViewRenderer(component: any, options?: Partial<ReactNodeViewRendererOptions>): NodeViewRenderer {
export function ReactNodeViewRenderer(
component: any,
options?: Partial<ReactNodeViewRendererOptions>,
): NodeViewRenderer {
return (props: NodeViewRendererProps) => {
// try to get the parent component
// this is important for vue devtools to show the component hierarchy correctly
@ -183,6 +187,6 @@ export function ReactNodeViewRenderer(component: any, options?: Partial<ReactNod
return {}
}
return new ReactNodeView(component, props, options) as ProseMirrorNodeView
return new ReactNodeView(component, props, options) as unknown as ProseMirrorNodeView
}
}

View File

@ -20,22 +20,18 @@
"src",
"dist"
],
"devDependencies": {
"@types/prosemirror-model": "^1.16.1",
"@types/prosemirror-state": "^1.2.8",
"@types/prosemirror-view": "^1.23.1"
},
"devDependencies": {},
"peerDependencies": {
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"prosemirror-model": "^1.16.1",
"prosemirror-state": "^1.3.4",
"prosemirror-view": "^1.23.6"
"prosemirror-model": "^1.17.0",
"prosemirror-state": "^1.4.0",
"prosemirror-view": "^1.25.0"
},
"repository": {
"type": "git",
"url": "https://github.com/ueberdosis/tiptap",
"directory": "packages/suggestion"
}
}
}

View File

@ -74,7 +74,7 @@ export function Suggestion<I = any>({
let props: SuggestionProps<I> | undefined
const renderer = render?.()
return new Plugin({
const plugin: Plugin<any> = new Plugin({
key: pluginKey,
view() {
@ -241,7 +241,7 @@ export function Suggestion<I = any>({
props: {
// Call the keydown hook if suggestion is active.
handleKeyDown(view, event) {
const { active, range } = this.getState(view.state)
const { active, range } = plugin.getState(view.state)
if (!active) {
return false
@ -252,7 +252,7 @@ export function Suggestion<I = any>({
// Setup decorator on the currently active suggestion.
decorations(state) {
const { active, range, decorationId } = this.getState(state)
const { active, range, decorationId } = plugin.getState(state)
if (!active) {
return null
@ -268,4 +268,6 @@ export function Suggestion<I = any>({
},
},
})
return plugin
}

View File

@ -30,7 +30,7 @@
"dependencies": {
"@tiptap/extension-bubble-menu": "^2.0.0-beta.59",
"@tiptap/extension-floating-menu": "^2.0.0-beta.54",
"prosemirror-view": "^1.23.6"
"prosemirror-view": "^1.25.0"
},
"repository": {
"type": "git",

View File

@ -110,7 +110,7 @@ class VueNodeView extends NodeView<(Vue | VueConstructor), Editor, VueNodeViewRe
throw Error('Please use the NodeViewWrapper component for your node view.')
}
return this.renderer.element
return this.renderer.element as HTMLElement
}
get contentDOM() {
@ -120,7 +120,7 @@ class VueNodeView extends NodeView<(Vue | VueConstructor), Editor, VueNodeViewRe
const contentElement = this.dom.querySelector('[data-node-view-content]')
return contentElement || this.dom
return (contentElement || this.dom) as HTMLElement | null
}
update(node: ProseMirrorNode, decorations: Decoration[]) {
@ -196,6 +196,6 @@ export function VueNodeViewRenderer(component: Vue | VueConstructor, options?: P
return {}
}
return new VueNodeView(component, props, options) as ProseMirrorNodeView
return new VueNodeView(component, props, options) as unknown as ProseMirrorNodeView
}
}

View File

@ -30,8 +30,8 @@
"dependencies": {
"@tiptap/extension-bubble-menu": "^2.0.0-beta.59",
"@tiptap/extension-floating-menu": "^2.0.0-beta.54",
"prosemirror-state": "^1.3.4",
"prosemirror-view": "^1.23.6"
"prosemirror-state": "^1.4.0",
"prosemirror-view": "^1.25.0"
},
"repository": {
"type": "git",

View File

@ -119,7 +119,7 @@ class VueNodeView extends NodeView<Component, Editor, VueNodeViewRendererOptions
throw Error('Please use the NodeViewWrapper component for your node view.')
}
return this.renderer.element
return this.renderer.element as HTMLElement
}
get contentDOM() {
@ -129,7 +129,7 @@ class VueNodeView extends NodeView<Component, Editor, VueNodeViewRendererOptions
const contentElement = this.dom.querySelector('[data-node-view-content]')
return contentElement || this.dom
return (contentElement || this.dom) as HTMLElement | null
}
update(node: ProseMirrorNode, decorations: Decoration[]) {
@ -205,6 +205,6 @@ export function VueNodeViewRenderer(component: Component, options?: Partial<VueN
return {}
}
return new VueNodeView(component, props, options) as ProseMirrorNodeView
return new VueNodeView(component, props, options) as unknown as ProseMirrorNodeView
}
}