mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-01 01:19:03 +08:00
fix(core): update types to match prosemirror-view #5867
This commit is contained in:
parent
ea2fa82c4f
commit
d464dca5d4
13
package-lock.json
generated
13
package-lock.json
generated
@ -20500,7 +20500,7 @@
|
||||
"prosemirror-tables": "^1.6.1",
|
||||
"prosemirror-trailing-node": "^3.0.0",
|
||||
"prosemirror-transform": "^1.10.2",
|
||||
"prosemirror-view": "^1.36.0"
|
||||
"prosemirror-view": "^1.37.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
@ -20531,6 +20531,17 @@
|
||||
"prosemirror-view": "^1.13.3"
|
||||
}
|
||||
},
|
||||
"packages/pm/node_modules/prosemirror-view": {
|
||||
"version": "1.37.0",
|
||||
"resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.37.0.tgz",
|
||||
"integrity": "sha512-z2nkKI1sJzyi7T47Ji/ewBPuIma1RNvQCCYVdV+MqWBV7o4Sa1n94UJCJJ1aQRF/xRkFfyqLGlGFWitIcCOtbg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"prosemirror-model": "^1.20.0",
|
||||
"prosemirror-state": "^1.0.0",
|
||||
"prosemirror-transform": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"packages/react": {
|
||||
"name": "@tiptap/react",
|
||||
"version": "2.10.0",
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { NodeSelection } from '@tiptap/pm/state'
|
||||
import { NodeView as ProseMirrorNodeView } from '@tiptap/pm/view'
|
||||
import { NodeView as ProseMirrorNodeView, ViewMutationRecord } from '@tiptap/pm/view'
|
||||
|
||||
import { Editor as CoreEditor } from './Editor.js'
|
||||
import { DecorationWithType, NodeViewRendererOptions, NodeViewRendererProps } from './types.js'
|
||||
@ -214,7 +214,7 @@ export class NodeView<
|
||||
* @return `false` if the editor should re-read the selection or re-parse the range around the mutation
|
||||
* @return `true` if it can safely be ignored.
|
||||
*/
|
||||
ignoreMutation(mutation: MutationRecord | { type: 'selection'; target: Element }) {
|
||||
ignoreMutation(mutation: ViewMutationRecord) {
|
||||
if (!this.dom || !this.contentDOM) {
|
||||
return true
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import {
|
||||
EditorView,
|
||||
NodeView,
|
||||
NodeViewConstructor,
|
||||
ViewMutationRecord,
|
||||
} from '@tiptap/pm/view'
|
||||
|
||||
import { Editor } from './Editor.js'
|
||||
@ -259,7 +260,7 @@ export interface NodeViewProps extends NodeViewRendererProps {
|
||||
export interface NodeViewRendererOptions {
|
||||
stopEvent: ((props: { event: Event }) => boolean) | null;
|
||||
ignoreMutation:
|
||||
| ((props: { mutation: MutationRecord | { type: 'selection'; target: Element } }) => boolean)
|
||||
| ((props: { mutation: ViewMutationRecord }) => boolean)
|
||||
| null;
|
||||
contentDOMElementTag: string;
|
||||
}
|
||||
|
@ -143,7 +143,7 @@
|
||||
"prosemirror-tables": "^1.6.1",
|
||||
"prosemirror-trailing-node": "^3.0.0",
|
||||
"prosemirror-transform": "^1.10.2",
|
||||
"prosemirror-view": "^1.36.0"
|
||||
"prosemirror-view": "^1.37.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
Loading…
Reference in New Issue
Block a user