tiptap/packages/core/src/extensions/editable.ts
Philipp Kühn cb5ca0c084 refactoring
2020-11-10 21:18:22 +01:00

23 lines
514 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 '@tiptap/core' {
// interface AllExtensions {
// Editable: typeof Editable,
// }
// }