wip: add getExtensionField

This commit is contained in:
Philipp Kühn
2021-04-15 21:14:33 +02:00
parent d194b90a61
commit 07bc40ce75
11 changed files with 213 additions and 274 deletions

View File

@@ -1,7 +1,7 @@
import {
Extension,
callOrReturn,
createExtensionContext,
getExtensionField,
ParentConfig,
} from '@tiptap/core'
import { gapCursor } from 'prosemirror-gapcursor'
@@ -31,12 +31,12 @@ export const Gapcursor = Extension.create({
},
extendNodeSchema(extension) {
const context = createExtensionContext(extension, {
const context = {
options: extension.options,
})
}
return {
allowGapCursor: callOrReturn(extension.config.allowGapCursor, context) ?? null,
allowGapCursor: callOrReturn(getExtensionField(extension, 'allowGapCursor', context)) ?? null,
}
},
})