mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-14 10:39:18 +08:00
Merge pull request #705 from christosnc/master
Add options to enable / disable dropCursor and gapCursor
This commit is contained in:
commit
1fc3a0b504
@ -80,6 +80,8 @@ export default {
|
||||
| `extensions` | `Array` | `[]` | A list of extensions used, by the editor. This can be `Nodes`, `Marks` or `Plugins`. |
|
||||
| `useBuiltInExtensions` | `Boolean` | `true` | By default tiptap adds a `Doc`, `Paragraph` and `Text` node to the Prosemirror schema. |
|
||||
| `dropCursor` | `Object` | `{}` | Config for `prosemirror-dropcursor`. |
|
||||
| `enableDropCursor` | `Boolean` | `true` | Option to enable / disable the dropCursor plugin`. |
|
||||
| `enableGapCursor` | `Boolean` | `true` | Option to enable / disable the gapCursor plugin`. |
|
||||
| `parseOptions` | `Object` | `{}` | A list of [Prosemirror parseOptions](https://prosemirror.net/docs/ref/#model.ParseOptions). |
|
||||
| `onInit` | `Function` | `undefined` | This will return an Object with the current `state` and `view` of Prosemirror on init. |
|
||||
| `onFocus` | `Function` | `undefined` | This will return an Object with the `event` and current `state` and `view` of Prosemirror on focus. |
|
||||
|
@ -50,6 +50,8 @@ export default class Editor extends Emitter {
|
||||
disableInputRules: false,
|
||||
disablePasteRules: false,
|
||||
dropCursor: {},
|
||||
enableDropCursor: true,
|
||||
enableGapCursor: true,
|
||||
parseOptions: {},
|
||||
injectCSS: true,
|
||||
onInit: () => {},
|
||||
@ -211,8 +213,8 @@ export default class Editor extends Emitter {
|
||||
Backspace: undoInputRule,
|
||||
}),
|
||||
keymap(baseKeymap),
|
||||
dropCursor(this.options.dropCursor),
|
||||
gapCursor(),
|
||||
...(enableDropCursor ? [dropCursor(this.options.dropCursor)] : []),
|
||||
...(enableGapCursor ? [gapCursor()] : []),
|
||||
new Plugin({
|
||||
key: new PluginKey('editable'),
|
||||
props: {
|
||||
|
Loading…
Reference in New Issue
Block a user