mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
18 lines
444 B
TypeScript
18 lines
444 B
TypeScript
import { Extension } from '@tiptap/core'
|
|
import { Plugin, PluginKey } from 'prosemirror-state'
|
|
|
|
export const NoTextInput = Extension.create({
|
|
name: 'noTextInput',
|
|
|
|
addProseMirrorPlugins() {
|
|
return [
|
|
new Plugin({
|
|
key: new PluginKey('noTextInput'),
|
|
filterTransaction: (transaction) => {
|
|
// Block all content-changing transactions
|
|
return !transaction.docChanged
|
|
},
|
|
}),
|
|
]
|
|
},
|
|
})
|