mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-23 08:47:50 +08:00
23 lines
511 B
TypeScript
23 lines
511 B
TypeScript
import { Plugin, PluginKey } from 'prosemirror-state'
|
|
import { createExtension } from '../Extension'
|
|
|
|
export const Editable = createExtension({
|
|
addProseMirrorPlugins() {
|
|
return [
|
|
new Plugin({
|
|
key: new PluginKey('editable'),
|
|
props: {
|
|
editable: () => this.editor.options.editable,
|
|
},
|
|
}),
|
|
]
|
|
},
|
|
})
|
|
|
|
// TODO: Editable circularly references itself!?
|
|
// declare module '../Editor' {
|
|
// interface AllExtensions {
|
|
// Editable: typeof Editable,
|
|
// }
|
|
// }
|