rename package folders

This commit is contained in:
Philipp Kühn
2020-03-30 10:42:59 +02:00
parent 18c5164af9
commit 14421a11fa
35 changed files with 2 additions and 2 deletions

View File

@@ -0,0 +1,48 @@
import Editor, { Extension } from '@tiptap/core'
import {
history,
undo,
redo,
undoDepth,
redoDepth,
} from 'prosemirror-history'
declare module '@tiptap/core/src/Editor' {
interface Editor {
undo(): Editor,
undo(): Editor,
}
}
export default class History extends Extension {
name = 'history'
created() {
this.editor.registerCommand('undo', (next, { view }) => {
undo(view.state, view.dispatch)
next()
})
this.editor.registerCommand('redo', (next, { view }) => {
redo(view.state, view.dispatch)
next()
})
}
plugins() {
return [
history()
]
}
// commands() {
// return {
// undo: () => undo,
// redo: () => redo,
// undoDepth: () => undoDepth,
// redoDepth: () => redoDepth,
// }
// }
}

View File

@@ -0,0 +1,20 @@
{
"name": "@tiptap/extension-history",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-history.js",
"umd:main": "dist/tiptap-extension-history.umd.js",
"module": "dist/tiptap-extension-history.mjs",
"unpkg": "dist/tiptap-extension-history.js",
"jsdelivr": "dist/tiptap-extension-history.js",
"files": [
"src",
"dist"
],
"peerDependencies": {
"@tiptap/core": "2.x"
},
"dependencies": {
"prosemirror-history": "^1.1.3"
}
}