Files
tiptap/packages/core/src/extensions/editable.ts
2020-11-15 23:25:25 +01:00

23 lines
509 B
TypeScript

import { Plugin, PluginKey } from 'prosemirror-state'
import { Extension } from '../Extension'
export const Editable = Extension.create({
addProseMirrorPlugins() {
return [
new Plugin({
key: new PluginKey('editable'),
props: {
editable: () => this.editor.options.editable,
},
}),
]
},
})
// TODO: Editable circularly references itself!?
// declare module '@tiptap/core' {
// interface AllExtensions {
// Editable: typeof Editable,
// }
// }