diff --git a/packages/tiptap/src/Editor.js b/packages/tiptap/src/Editor.js index 6263f5b3d..2dccd5de6 100644 --- a/packages/tiptap/src/Editor.js +++ b/packages/tiptap/src/Editor.js @@ -4,18 +4,18 @@ import { PluginKey, TextSelection, } from 'prosemirror-state' -import {EditorView} from 'prosemirror-view' -import {Schema, DOMParser, DOMSerializer} from 'prosemirror-model' -import {dropCursor} from 'prosemirror-dropcursor' -import {gapCursor} from 'prosemirror-gapcursor' -import {keymap} from 'prosemirror-keymap' -import {baseKeymap} from 'prosemirror-commands' -import {inputRules, undoInputRule} from 'prosemirror-inputrules' +import { EditorView } from 'prosemirror-view' +import { Schema, DOMParser, DOMSerializer } from 'prosemirror-model' +import { dropCursor } from 'prosemirror-dropcursor' +import { gapCursor } from 'prosemirror-gapcursor' +import { keymap } from 'prosemirror-keymap' +import { baseKeymap } from 'prosemirror-commands' +import { inputRules, undoInputRule } from 'prosemirror-inputrules' import { - markIsActive, - nodeIsActive, - getMarkAttrs, - getNodeAttrs, + markIsActive, + nodeIsActive, + getMarkAttrs, + getNodeAttrs, } from 'tiptap-utils' import { injectCSS, @@ -25,7 +25,7 @@ import { ComponentView, minMax, } from './Utils' -import {Doc, Paragraph, Text} from './Nodes' +import { Doc, Paragraph, Text } from './Nodes' import css from './style.css' export default class Editor extends Emitter { @@ -52,20 +52,13 @@ export default class Editor extends Emitter { dropCursor: {}, parseOptions: {}, injectCSS: true, - onInit: () => { - }, - onTransaction: () => { - }, - onUpdate: () => { - }, - onFocus: () => { - }, - onBlur: () => { - }, - onPaste: () => { - }, - onDrop: () => { - }, + onInit: () => {}, + onTransaction: () => {}, + onUpdate: () => {}, + onFocus: () => {}, + onBlur: () => {}, + onPaste: () => {}, + onDrop: () => {}, } this.events = [ @@ -87,7 +80,7 @@ export default class Editor extends Emitter { ...options, }) this.focused = false - this.selection = {from: 0, to: 0} + this.selection = { from: 0, to: 0 } this.element = document.createElement('div') this.extensions = this.createExtensions() this.nodes = this.createNodes() @@ -110,8 +103,7 @@ export default class Editor extends Emitter { } this.events.forEach(name => { - this.on(name, this.options[camelCase(`on ${name}`)] || (() => { - })) + this.on(name, this.options[camelCase(`on ${name}`)] || (() => {})) }) this.emit('init', { @@ -283,7 +275,6 @@ export default class Editor extends Emitter { const htmlString = `