tiptap/packages/core/src/extensions/editable.ts
Philipp Kühn fcd264bb16 add comment
2020-11-04 17:25:25 +01:00

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,
// }
// }