improve build script

This commit is contained in:
Philipp Kühn
2020-11-10 09:21:47 +01:00
parent 0181b70bc2
commit 7d121eb39a
43 changed files with 314 additions and 240 deletions

View File

@@ -267,6 +267,8 @@ export class Editor extends EventEmitter {
}),
})
console.log({ plugins: this.extensionManager.plugins })
// `editor.view` is not yet available at this time.
// Therefore we will add all plugins and node views directly afterwards.
const newState = this.state.reconfigure({

View File

@@ -1,4 +1,4 @@
import { Plugin } from 'prosemirror-state'
import { Plugin, PluginKey } from 'prosemirror-state'
import { createExtension } from '../Extension'
export const FocusEvents = createExtension({
@@ -7,6 +7,7 @@ export const FocusEvents = createExtension({
return [
new Plugin({
key: new PluginKey('focusEvents'),
props: {
attributes: {
tabindex: '0',

View File

@@ -1,4 +1,4 @@
import { Plugin } from 'prosemirror-state'
import { Plugin, PluginKey } from 'prosemirror-state'
import { Slice, Fragment, MarkType } from 'prosemirror-model'
export default function (regexp: RegExp, type: MarkType, getAttrs?: (match: any) => any): Plugin {
@@ -51,6 +51,7 @@ export default function (regexp: RegExp, type: MarkType, getAttrs?: (match: any)
}
return new Plugin({
key: new PluginKey('markPasteRule'),
props: {
transformPasted: slice => {
return new Slice(handler(slice.content), slice.openStart, slice.openEnd)