Skip to content

Commit

Permalink
fix(core): update types to match prosemirror-view #5867
Browse files Browse the repository at this point in the history
  • Loading branch information
nperez0111 committed Nov 26, 2024
1 parent ea2fa82 commit d464dca
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
13 changes: 12 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/core/src/NodeView.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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
}
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
EditorView,
NodeView,
NodeViewConstructor,
ViewMutationRecord,
} from '@tiptap/pm/view'

import { Editor } from './Editor.js'
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/pm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit d464dca

Please sign in to comment.