@tiptap/extension-history 2.0.0-beta.8 → 2.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/{tiptap-extension-history.cjs.js → index.cjs} +14 -9
- package/dist/index.cjs.map +1 -0
- package/dist/{tiptap-extension-history.esm.js → index.js} +11 -7
- package/dist/index.js.map +1 -0
- package/dist/{tiptap-extension-history.umd.js → index.umd.js} +18 -13
- package/dist/index.umd.js.map +1 -0
- package/dist/packages/extension-history/src/history.d.ts +5 -5
- package/package.json +23 -14
- package/src/history.ts +14 -8
- package/CHANGELOG.md +0 -174
- package/LICENSE.md +0 -21
- package/dist/tiptap-extension-history.cjs.js.map +0 -1
- package/dist/tiptap-extension-history.esm.js.map +0 -1
- package/dist/tiptap-extension-history.umd.js.map +0 -1
package/README.md
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
[](https://github.com/sponsors/ueberdosis)
|
|
6
6
|
|
|
7
7
|
## Introduction
|
|
8
|
-
|
|
8
|
+
Tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as *New York Times*, *The Guardian* or *Atlassian*.
|
|
9
9
|
|
|
10
|
-
##
|
|
11
|
-
Documentation can be found on the [
|
|
10
|
+
## Official Documentation
|
|
11
|
+
Documentation can be found on the [Tiptap website](https://tiptap.dev).
|
|
12
12
|
|
|
13
13
|
## License
|
|
14
|
-
|
|
14
|
+
Tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md).
|
|
@@ -3,27 +3,29 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var core = require('@tiptap/core');
|
|
6
|
-
var
|
|
6
|
+
var history = require('@tiptap/pm/history');
|
|
7
7
|
|
|
8
8
|
const History = core.Extension.create({
|
|
9
9
|
name: 'history',
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
addOptions() {
|
|
11
|
+
return {
|
|
12
|
+
depth: 100,
|
|
13
|
+
newGroupDelay: 500,
|
|
14
|
+
};
|
|
13
15
|
},
|
|
14
16
|
addCommands() {
|
|
15
17
|
return {
|
|
16
18
|
undo: () => ({ state, dispatch }) => {
|
|
17
|
-
return
|
|
19
|
+
return history.undo(state, dispatch);
|
|
18
20
|
},
|
|
19
21
|
redo: () => ({ state, dispatch }) => {
|
|
20
|
-
return
|
|
22
|
+
return history.redo(state, dispatch);
|
|
21
23
|
},
|
|
22
24
|
};
|
|
23
25
|
},
|
|
24
26
|
addProseMirrorPlugins() {
|
|
25
27
|
return [
|
|
26
|
-
|
|
28
|
+
history.history(this.options),
|
|
27
29
|
];
|
|
28
30
|
},
|
|
29
31
|
addKeyboardShortcuts() {
|
|
@@ -31,10 +33,13 @@ const History = core.Extension.create({
|
|
|
31
33
|
'Mod-z': () => this.editor.commands.undo(),
|
|
32
34
|
'Mod-y': () => this.editor.commands.redo(),
|
|
33
35
|
'Shift-Mod-z': () => this.editor.commands.redo(),
|
|
36
|
+
// Russian keyboard layouts
|
|
37
|
+
'Mod-я': () => this.editor.commands.undo(),
|
|
38
|
+
'Shift-Mod-я': () => this.editor.commands.redo(),
|
|
34
39
|
};
|
|
35
40
|
},
|
|
36
41
|
});
|
|
37
42
|
|
|
38
43
|
exports.History = History;
|
|
39
|
-
exports
|
|
40
|
-
//# sourceMappingURL=
|
|
44
|
+
exports["default"] = History;
|
|
45
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/history.ts"],"sourcesContent":["import { Extension } from '@tiptap/core'\nimport { history, redo, undo } from '@tiptap/pm/history'\n\nexport interface HistoryOptions {\n depth: number,\n newGroupDelay: number,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n history: {\n /**\n * Undo recent changes\n */\n undo: () => ReturnType,\n /**\n * Reapply reverted changes\n */\n redo: () => ReturnType,\n }\n }\n}\n\nexport const History = Extension.create<HistoryOptions>({\n name: 'history',\n\n addOptions() {\n return {\n depth: 100,\n newGroupDelay: 500,\n }\n },\n\n addCommands() {\n return {\n undo: () => ({ state, dispatch }) => {\n return undo(state, dispatch)\n },\n redo: () => ({ state, dispatch }) => {\n return redo(state, dispatch)\n },\n }\n },\n\n addProseMirrorPlugins() {\n return [\n history(this.options),\n ]\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-z': () => this.editor.commands.undo(),\n 'Mod-y': () => this.editor.commands.redo(),\n 'Shift-Mod-z': () => this.editor.commands.redo(),\n\n // Russian keyboard layouts\n 'Mod-я': () => this.editor.commands.undo(),\n 'Shift-Mod-я': () => this.editor.commands.redo(),\n }\n },\n})\n"],"names":["Extension","undo","redo","history"],"mappings":";;;;;;;AAuBa,MAAA,OAAO,GAAGA,cAAS,CAAC,MAAM,CAAiB;AACtD,IAAA,IAAI,EAAE,SAAS;IAEf,UAAU,GAAA;QACR,OAAO;AACL,YAAA,KAAK,EAAE,GAAG;AACV,YAAA,aAAa,EAAE,GAAG;SACnB,CAAA;KACF;IAED,WAAW,GAAA;QACT,OAAO;YACL,IAAI,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAI;AAClC,gBAAA,OAAOC,YAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;aAC7B;YACD,IAAI,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAI;AAClC,gBAAA,OAAOC,YAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;aAC7B;SACF,CAAA;KACF;IAED,qBAAqB,GAAA;QACnB,OAAO;AACL,YAAAC,eAAO,CAAC,IAAI,CAAC,OAAO,CAAC;SACtB,CAAA;KACF;IAED,oBAAoB,GAAA;QAClB,OAAO;YACL,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;YAC1C,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;YAC1C,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;;YAGhD,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;YAC1C,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;SACjD,CAAA;KACF;AACF,CAAA;;;;;"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/core';
|
|
2
|
-
import { undo, redo, history } from '
|
|
2
|
+
import { undo, redo, history } from '@tiptap/pm/history';
|
|
3
3
|
|
|
4
4
|
const History = Extension.create({
|
|
5
5
|
name: 'history',
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
addOptions() {
|
|
7
|
+
return {
|
|
8
|
+
depth: 100,
|
|
9
|
+
newGroupDelay: 500,
|
|
10
|
+
};
|
|
9
11
|
},
|
|
10
12
|
addCommands() {
|
|
11
13
|
return {
|
|
@@ -27,10 +29,12 @@ const History = Extension.create({
|
|
|
27
29
|
'Mod-z': () => this.editor.commands.undo(),
|
|
28
30
|
'Mod-y': () => this.editor.commands.redo(),
|
|
29
31
|
'Shift-Mod-z': () => this.editor.commands.redo(),
|
|
32
|
+
// Russian keyboard layouts
|
|
33
|
+
'Mod-я': () => this.editor.commands.undo(),
|
|
34
|
+
'Shift-Mod-я': () => this.editor.commands.redo(),
|
|
30
35
|
};
|
|
31
36
|
},
|
|
32
37
|
});
|
|
33
38
|
|
|
34
|
-
export default
|
|
35
|
-
|
|
36
|
-
//# sourceMappingURL=tiptap-extension-history.esm.js.map
|
|
39
|
+
export { History, History as default };
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/history.ts"],"sourcesContent":["import { Extension } from '@tiptap/core'\nimport { history, redo, undo } from '@tiptap/pm/history'\n\nexport interface HistoryOptions {\n depth: number,\n newGroupDelay: number,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n history: {\n /**\n * Undo recent changes\n */\n undo: () => ReturnType,\n /**\n * Reapply reverted changes\n */\n redo: () => ReturnType,\n }\n }\n}\n\nexport const History = Extension.create<HistoryOptions>({\n name: 'history',\n\n addOptions() {\n return {\n depth: 100,\n newGroupDelay: 500,\n }\n },\n\n addCommands() {\n return {\n undo: () => ({ state, dispatch }) => {\n return undo(state, dispatch)\n },\n redo: () => ({ state, dispatch }) => {\n return redo(state, dispatch)\n },\n }\n },\n\n addProseMirrorPlugins() {\n return [\n history(this.options),\n ]\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-z': () => this.editor.commands.undo(),\n 'Mod-y': () => this.editor.commands.redo(),\n 'Shift-Mod-z': () => this.editor.commands.redo(),\n\n // Russian keyboard layouts\n 'Mod-я': () => this.editor.commands.undo(),\n 'Shift-Mod-я': () => this.editor.commands.redo(),\n }\n },\n})\n"],"names":[],"mappings":";;;AAuBa,MAAA,OAAO,GAAG,SAAS,CAAC,MAAM,CAAiB;AACtD,IAAA,IAAI,EAAE,SAAS;IAEf,UAAU,GAAA;QACR,OAAO;AACL,YAAA,KAAK,EAAE,GAAG;AACV,YAAA,aAAa,EAAE,GAAG;SACnB,CAAA;KACF;IAED,WAAW,GAAA;QACT,OAAO;YACL,IAAI,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAI;AAClC,gBAAA,OAAO,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;aAC7B;YACD,IAAI,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAI;AAClC,gBAAA,OAAO,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;aAC7B;SACF,CAAA;KACF;IAED,qBAAqB,GAAA;QACnB,OAAO;AACL,YAAA,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;SACtB,CAAA;KACF;IAED,oBAAoB,GAAA;QAClB,OAAO;YACL,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;YAC1C,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;YAC1C,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;;YAGhD,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;YAC1C,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;SACjD,CAAA;KACF;AACF,CAAA;;;;"}
|
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tiptap/core'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@tiptap/core', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global[
|
|
5
|
-
}(this, (function (exports, core,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tiptap/core'), require('@tiptap/pm/history')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@tiptap/core', '@tiptap/pm/history'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@tiptap/extension-history"] = {}, global.core, global.history));
|
|
5
|
+
})(this, (function (exports, core, history) { 'use strict';
|
|
6
6
|
|
|
7
7
|
const History = core.Extension.create({
|
|
8
8
|
name: 'history',
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
addOptions() {
|
|
10
|
+
return {
|
|
11
|
+
depth: 100,
|
|
12
|
+
newGroupDelay: 500,
|
|
13
|
+
};
|
|
12
14
|
},
|
|
13
15
|
addCommands() {
|
|
14
16
|
return {
|
|
15
17
|
undo: () => ({ state, dispatch }) => {
|
|
16
|
-
return
|
|
18
|
+
return history.undo(state, dispatch);
|
|
17
19
|
},
|
|
18
20
|
redo: () => ({ state, dispatch }) => {
|
|
19
|
-
return
|
|
21
|
+
return history.redo(state, dispatch);
|
|
20
22
|
},
|
|
21
23
|
};
|
|
22
24
|
},
|
|
23
25
|
addProseMirrorPlugins() {
|
|
24
26
|
return [
|
|
25
|
-
|
|
27
|
+
history.history(this.options),
|
|
26
28
|
];
|
|
27
29
|
},
|
|
28
30
|
addKeyboardShortcuts() {
|
|
@@ -30,14 +32,17 @@
|
|
|
30
32
|
'Mod-z': () => this.editor.commands.undo(),
|
|
31
33
|
'Mod-y': () => this.editor.commands.redo(),
|
|
32
34
|
'Shift-Mod-z': () => this.editor.commands.redo(),
|
|
35
|
+
// Russian keyboard layouts
|
|
36
|
+
'Mod-я': () => this.editor.commands.undo(),
|
|
37
|
+
'Shift-Mod-я': () => this.editor.commands.redo(),
|
|
33
38
|
};
|
|
34
39
|
},
|
|
35
40
|
});
|
|
36
41
|
|
|
37
42
|
exports.History = History;
|
|
38
|
-
exports
|
|
43
|
+
exports["default"] = History;
|
|
39
44
|
|
|
40
45
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
41
46
|
|
|
42
|
-
}))
|
|
43
|
-
//# sourceMappingURL=
|
|
47
|
+
}));
|
|
48
|
+
//# sourceMappingURL=index.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../src/history.ts"],"sourcesContent":["import { Extension } from '@tiptap/core'\nimport { history, redo, undo } from '@tiptap/pm/history'\n\nexport interface HistoryOptions {\n depth: number,\n newGroupDelay: number,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n history: {\n /**\n * Undo recent changes\n */\n undo: () => ReturnType,\n /**\n * Reapply reverted changes\n */\n redo: () => ReturnType,\n }\n }\n}\n\nexport const History = Extension.create<HistoryOptions>({\n name: 'history',\n\n addOptions() {\n return {\n depth: 100,\n newGroupDelay: 500,\n }\n },\n\n addCommands() {\n return {\n undo: () => ({ state, dispatch }) => {\n return undo(state, dispatch)\n },\n redo: () => ({ state, dispatch }) => {\n return redo(state, dispatch)\n },\n }\n },\n\n addProseMirrorPlugins() {\n return [\n history(this.options),\n ]\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-z': () => this.editor.commands.undo(),\n 'Mod-y': () => this.editor.commands.redo(),\n 'Shift-Mod-z': () => this.editor.commands.redo(),\n\n // Russian keyboard layouts\n 'Mod-я': () => this.editor.commands.undo(),\n 'Shift-Mod-я': () => this.editor.commands.redo(),\n }\n },\n})\n"],"names":["Extension","undo","redo","history"],"mappings":";;;;;;AAuBa,QAAA,OAAO,GAAGA,cAAS,CAAC,MAAM,CAAiB;EACtD,IAAA,IAAI,EAAE,SAAS;MAEf,UAAU,GAAA;UACR,OAAO;EACL,YAAA,KAAK,EAAE,GAAG;EACV,YAAA,aAAa,EAAE,GAAG;WACnB,CAAA;OACF;MAED,WAAW,GAAA;UACT,OAAO;cACL,IAAI,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAI;EAClC,gBAAA,OAAOC,YAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;eAC7B;cACD,IAAI,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAI;EAClC,gBAAA,OAAOC,YAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;eAC7B;WACF,CAAA;OACF;MAED,qBAAqB,GAAA;UACnB,OAAO;EACL,YAAAC,eAAO,CAAC,IAAI,CAAC,OAAO,CAAC;WACtB,CAAA;OACF;MAED,oBAAoB,GAAA;UAClB,OAAO;cACL,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;cAC1C,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;cAC1C,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;;cAGhD,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;cAC1C,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;WACjD,CAAA;OACF;EACF,CAAA;;;;;;;;;;;"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
2
|
export interface HistoryOptions {
|
|
3
3
|
depth: number;
|
|
4
4
|
newGroupDelay: number;
|
|
5
5
|
}
|
|
6
6
|
declare module '@tiptap/core' {
|
|
7
|
-
interface Commands {
|
|
7
|
+
interface Commands<ReturnType> {
|
|
8
8
|
history: {
|
|
9
9
|
/**
|
|
10
10
|
* Undo recent changes
|
|
11
11
|
*/
|
|
12
|
-
undo: () =>
|
|
12
|
+
undo: () => ReturnType;
|
|
13
13
|
/**
|
|
14
14
|
* Reapply reverted changes
|
|
15
15
|
*/
|
|
16
|
-
redo: () =>
|
|
16
|
+
redo: () => ReturnType;
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
export declare const History: Extension<HistoryOptions>;
|
|
20
|
+
export declare const History: Extension<HistoryOptions, any>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/extension-history",
|
|
3
3
|
"description": "history extension for tiptap",
|
|
4
|
-
"version": "2.0.0-
|
|
4
|
+
"version": "2.0.0-rc.1",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -12,28 +12,37 @@
|
|
|
12
12
|
"type": "github",
|
|
13
13
|
"url": "https://github.com/sponsors/ueberdosis"
|
|
14
14
|
},
|
|
15
|
-
"main": "dist/tiptap-extension-history.cjs.js",
|
|
16
|
-
"umd": "dist/tiptap-extension-history.umd.js",
|
|
17
|
-
"module": "dist/tiptap-extension-history.esm.js",
|
|
18
|
-
"types": "dist/packages/extension-history/src/index.d.ts",
|
|
19
15
|
"type": "module",
|
|
20
16
|
"exports": {
|
|
21
17
|
".": {
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
18
|
+
"types": "./dist/packages/extension-history/src/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js",
|
|
20
|
+
"require": "./dist/index.cjs"
|
|
25
21
|
}
|
|
26
22
|
},
|
|
23
|
+
"main": "dist/index.cjs",
|
|
24
|
+
"module": "dist/index.js",
|
|
25
|
+
"umd": "dist/index.umd.js",
|
|
26
|
+
"types": "dist/packages/extension-history/src/index.d.ts",
|
|
27
27
|
"files": [
|
|
28
28
|
"src",
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@tiptap/core": "
|
|
32
|
+
"@tiptap/core": "2.0.0-rc.1",
|
|
33
|
+
"@tiptap/pm": "2.0.0-rc.1"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@tiptap/core": "2.0.0-rc.1",
|
|
37
|
+
"@tiptap/pm": "2.0.0-rc.1"
|
|
33
38
|
},
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "https://github.com/ueberdosis/tiptap",
|
|
42
|
+
"directory": "packages/extension-history"
|
|
37
43
|
},
|
|
38
|
-
"
|
|
39
|
-
|
|
44
|
+
"scripts": {
|
|
45
|
+
"clean": "rm -rf dist",
|
|
46
|
+
"build": "npm run clean && rollup -c"
|
|
47
|
+
}
|
|
48
|
+
}
|
package/src/history.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { history,
|
|
1
|
+
import { Extension } from '@tiptap/core'
|
|
2
|
+
import { history, redo, undo } from '@tiptap/pm/history'
|
|
3
3
|
|
|
4
4
|
export interface HistoryOptions {
|
|
5
5
|
depth: number,
|
|
@@ -7,16 +7,16 @@ export interface HistoryOptions {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
declare module '@tiptap/core' {
|
|
10
|
-
interface Commands {
|
|
10
|
+
interface Commands<ReturnType> {
|
|
11
11
|
history: {
|
|
12
12
|
/**
|
|
13
13
|
* Undo recent changes
|
|
14
14
|
*/
|
|
15
|
-
undo: () =>
|
|
15
|
+
undo: () => ReturnType,
|
|
16
16
|
/**
|
|
17
17
|
* Reapply reverted changes
|
|
18
18
|
*/
|
|
19
|
-
redo: () =>
|
|
19
|
+
redo: () => ReturnType,
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -24,9 +24,11 @@ declare module '@tiptap/core' {
|
|
|
24
24
|
export const History = Extension.create<HistoryOptions>({
|
|
25
25
|
name: 'history',
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
addOptions() {
|
|
28
|
+
return {
|
|
29
|
+
depth: 100,
|
|
30
|
+
newGroupDelay: 500,
|
|
31
|
+
}
|
|
30
32
|
},
|
|
31
33
|
|
|
32
34
|
addCommands() {
|
|
@@ -51,6 +53,10 @@ export const History = Extension.create<HistoryOptions>({
|
|
|
51
53
|
'Mod-z': () => this.editor.commands.undo(),
|
|
52
54
|
'Mod-y': () => this.editor.commands.redo(),
|
|
53
55
|
'Shift-Mod-z': () => this.editor.commands.redo(),
|
|
56
|
+
|
|
57
|
+
// Russian keyboard layouts
|
|
58
|
+
'Mod-я': () => this.editor.commands.undo(),
|
|
59
|
+
'Shift-Mod-я': () => this.editor.commands.redo(),
|
|
54
60
|
}
|
|
55
61
|
},
|
|
56
62
|
})
|
package/CHANGELOG.md
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
# [2.0.0-beta.8](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@2.0.0-beta.7...@tiptap/extension-history@2.0.0-beta.8) (2021-05-06)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Bug Fixes
|
|
10
|
-
|
|
11
|
-
* add exports to package.json ([1277fa4](https://github.com/ueberdosis/tiptap/commit/1277fa47151e9c039508cdb219bdd0ffe647f4ee))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
# [2.0.0-beta.7](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@2.0.0-beta.6...@tiptap/extension-history@2.0.0-beta.7) (2021-05-06)
|
|
18
|
-
|
|
19
|
-
**Note:** Version bump only for package @tiptap/extension-history
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
# [2.0.0-beta.6](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@2.0.0-beta.5...@tiptap/extension-history@2.0.0-beta.6) (2021-05-05)
|
|
26
|
-
|
|
27
|
-
**Note:** Version bump only for package @tiptap/extension-history
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
# [2.0.0-beta.5](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@2.0.0-beta.4...@tiptap/extension-history@2.0.0-beta.5) (2021-04-23)
|
|
34
|
-
|
|
35
|
-
**Note:** Version bump only for package @tiptap/extension-history
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
# [2.0.0-beta.4](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@2.0.0-beta.3...@tiptap/extension-history@2.0.0-beta.4) (2021-04-22)
|
|
42
|
-
|
|
43
|
-
**Note:** Version bump only for package @tiptap/extension-history
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
# [2.0.0-beta.3](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@2.0.0-beta.2...@tiptap/extension-history@2.0.0-beta.3) (2021-04-16)
|
|
50
|
-
|
|
51
|
-
**Note:** Version bump only for package @tiptap/extension-history
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
# [2.0.0-beta.2](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@2.0.0-beta.1...@tiptap/extension-history@2.0.0-beta.2) (2021-04-15)
|
|
58
|
-
|
|
59
|
-
**Note:** Version bump only for package @tiptap/extension-history
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
# [2.0.0-beta.1](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@2.0.0-alpha.11...@tiptap/extension-history@2.0.0-beta.1) (2021-03-05)
|
|
66
|
-
|
|
67
|
-
**Note:** Version bump only for package @tiptap/extension-history
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
# [2.0.0-alpha.11](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@2.0.0-alpha.10...@tiptap/extension-history@2.0.0-alpha.11) (2021-02-16)
|
|
74
|
-
|
|
75
|
-
**Note:** Version bump only for package @tiptap/extension-history
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
# [2.0.0-alpha.10](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@2.0.0-alpha.9...@tiptap/extension-history@2.0.0-alpha.10) (2021-02-07)
|
|
82
|
-
|
|
83
|
-
**Note:** Version bump only for package @tiptap/extension-history
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
# [2.0.0-alpha.9](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@2.0.0-alpha.8...@tiptap/extension-history@2.0.0-alpha.9) (2021-02-05)
|
|
90
|
-
|
|
91
|
-
**Note:** Version bump only for package @tiptap/extension-history
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
# [2.0.0-alpha.8](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@2.0.0-alpha.7...@tiptap/extension-history@2.0.0-alpha.8) (2021-01-29)
|
|
98
|
-
|
|
99
|
-
**Note:** Version bump only for package @tiptap/extension-history
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
# [2.0.0-alpha.7](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@2.0.0-alpha.6...@tiptap/extension-history@2.0.0-alpha.7) (2021-01-29)
|
|
106
|
-
|
|
107
|
-
**Note:** Version bump only for package @tiptap/extension-history
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
# [2.0.0-alpha.6](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@2.0.0-alpha.5...@tiptap/extension-history@2.0.0-alpha.6) (2021-01-28)
|
|
114
|
-
|
|
115
|
-
**Note:** Version bump only for package @tiptap/extension-history
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
# [2.0.0-alpha.5](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@2.0.0-alpha.4...@tiptap/extension-history@2.0.0-alpha.5) (2020-12-18)
|
|
122
|
-
|
|
123
|
-
**Note:** Version bump only for package @tiptap/extension-history
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
# [2.0.0-alpha.4](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@2.0.0-alpha.3...@tiptap/extension-history@2.0.0-alpha.4) (2020-12-02)
|
|
130
|
-
|
|
131
|
-
**Note:** Version bump only for package @tiptap/extension-history
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
# [2.0.0-alpha.3](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@2.0.0-alpha.2...@tiptap/extension-history@2.0.0-alpha.3) (2020-11-19)
|
|
138
|
-
|
|
139
|
-
**Note:** Version bump only for package @tiptap/extension-history
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
# [2.0.0-alpha.2](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@2.0.0-alpha.1...@tiptap/extension-history@2.0.0-alpha.2) (2020-11-19)
|
|
146
|
-
|
|
147
|
-
**Note:** Version bump only for package @tiptap/extension-history
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
# [2.0.0-alpha.1](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@1.0.0-alpha.2...@tiptap/extension-history@2.0.0-alpha.1) (2020-11-18)
|
|
154
|
-
|
|
155
|
-
**Note:** Version bump only for package @tiptap/extension-history
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
# [1.0.0-alpha.2](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-history@1.0.0-alpha.1...@tiptap/extension-history@1.0.0-alpha.2) (2020-11-16)
|
|
162
|
-
|
|
163
|
-
**Note:** Version bump only for package @tiptap/extension-history
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
# 1.0.0-alpha.1 (2020-11-16)
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
### Reverts
|
|
173
|
-
|
|
174
|
-
* Revert "use global namespace" ([0c9ce26](https://github.com/ueberdosis/tiptap/commit/0c9ce26c02c07d88a757c01b0a9d7f9e2b0b7502))
|
package/LICENSE.md
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021, überdosis GbR
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tiptap-extension-history.cjs.js","sources":["../src/history.ts"],"sourcesContent":["import { Command, Extension } from '@tiptap/core'\nimport { history, undo, redo } from 'prosemirror-history'\n\nexport interface HistoryOptions {\n depth: number,\n newGroupDelay: number,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n history: {\n /**\n * Undo recent changes\n */\n undo: () => Command,\n /**\n * Reapply reverted changes\n */\n redo: () => Command,\n }\n }\n}\n\nexport const History = Extension.create<HistoryOptions>({\n name: 'history',\n\n defaultOptions: {\n depth: 100,\n newGroupDelay: 500,\n },\n\n addCommands() {\n return {\n undo: () => ({ state, dispatch }) => {\n return undo(state, dispatch)\n },\n redo: () => ({ state, dispatch }) => {\n return redo(state, dispatch)\n },\n }\n },\n\n addProseMirrorPlugins() {\n return [\n history(this.options),\n ]\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-z': () => this.editor.commands.undo(),\n 'Mod-y': () => this.editor.commands.redo(),\n 'Shift-Mod-z': () => this.editor.commands.redo(),\n }\n },\n})\n"],"names":["Extension","undo","redo","history"],"mappings":";;;;;;;MAuBa,OAAO,GAAGA,cAAS,CAAC,MAAM,CAAiB;IACtD,IAAI,EAAE,SAAS;IAEf,cAAc,EAAE;QACd,KAAK,EAAE,GAAG;QACV,aAAa,EAAE,GAAG;KACnB;IAED,WAAW;QACT,OAAO;YACL,IAAI,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE;gBAC9B,OAAOC,uBAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;aAC7B;YACD,IAAI,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE;gBAC9B,OAAOC,uBAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;aAC7B;SACF,CAAA;KACF;IAED,qBAAqB;QACnB,OAAO;YACLC,0BAAO,CAAC,IAAI,CAAC,OAAO,CAAC;SACtB,CAAA;KACF;IAED,oBAAoB;QAClB,OAAO;YACL,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;YAC1C,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;YAC1C,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;SACjD,CAAA;KACF;CACF;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tiptap-extension-history.esm.js","sources":["../src/history.ts"],"sourcesContent":["import { Command, Extension } from '@tiptap/core'\nimport { history, undo, redo } from 'prosemirror-history'\n\nexport interface HistoryOptions {\n depth: number,\n newGroupDelay: number,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n history: {\n /**\n * Undo recent changes\n */\n undo: () => Command,\n /**\n * Reapply reverted changes\n */\n redo: () => Command,\n }\n }\n}\n\nexport const History = Extension.create<HistoryOptions>({\n name: 'history',\n\n defaultOptions: {\n depth: 100,\n newGroupDelay: 500,\n },\n\n addCommands() {\n return {\n undo: () => ({ state, dispatch }) => {\n return undo(state, dispatch)\n },\n redo: () => ({ state, dispatch }) => {\n return redo(state, dispatch)\n },\n }\n },\n\n addProseMirrorPlugins() {\n return [\n history(this.options),\n ]\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-z': () => this.editor.commands.undo(),\n 'Mod-y': () => this.editor.commands.redo(),\n 'Shift-Mod-z': () => this.editor.commands.redo(),\n }\n },\n})\n"],"names":[],"mappings":";;;MAuBa,OAAO,GAAG,SAAS,CAAC,MAAM,CAAiB;IACtD,IAAI,EAAE,SAAS;IAEf,cAAc,EAAE;QACd,KAAK,EAAE,GAAG;QACV,aAAa,EAAE,GAAG;KACnB;IAED,WAAW;QACT,OAAO;YACL,IAAI,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE;gBAC9B,OAAO,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;aAC7B;YACD,IAAI,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE;gBAC9B,OAAO,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;aAC7B;SACF,CAAA;KACF;IAED,qBAAqB;QACnB,OAAO;YACL,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;SACtB,CAAA;KACF;IAED,oBAAoB;QAClB,OAAO;YACL,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;YAC1C,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;YAC1C,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;SACjD,CAAA;KACF;CACF;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tiptap-extension-history.umd.js","sources":["../src/history.ts"],"sourcesContent":["import { Command, Extension } from '@tiptap/core'\nimport { history, undo, redo } from 'prosemirror-history'\n\nexport interface HistoryOptions {\n depth: number,\n newGroupDelay: number,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n history: {\n /**\n * Undo recent changes\n */\n undo: () => Command,\n /**\n * Reapply reverted changes\n */\n redo: () => Command,\n }\n }\n}\n\nexport const History = Extension.create<HistoryOptions>({\n name: 'history',\n\n defaultOptions: {\n depth: 100,\n newGroupDelay: 500,\n },\n\n addCommands() {\n return {\n undo: () => ({ state, dispatch }) => {\n return undo(state, dispatch)\n },\n redo: () => ({ state, dispatch }) => {\n return redo(state, dispatch)\n },\n }\n },\n\n addProseMirrorPlugins() {\n return [\n history(this.options),\n ]\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-z': () => this.editor.commands.undo(),\n 'Mod-y': () => this.editor.commands.redo(),\n 'Shift-Mod-z': () => this.editor.commands.redo(),\n }\n },\n})\n"],"names":["Extension","undo","redo","history"],"mappings":";;;;;;QAuBa,OAAO,GAAGA,cAAS,CAAC,MAAM,CAAiB;MACtD,IAAI,EAAE,SAAS;MAEf,cAAc,EAAE;UACd,KAAK,EAAE,GAAG;UACV,aAAa,EAAE,GAAG;OACnB;MAED,WAAW;UACT,OAAO;cACL,IAAI,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE;kBAC9B,OAAOC,uBAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;eAC7B;cACD,IAAI,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE;kBAC9B,OAAOC,uBAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;eAC7B;WACF,CAAA;OACF;MAED,qBAAqB;UACnB,OAAO;cACLC,0BAAO,CAAC,IAAI,CAAC,OAAO,CAAC;WACtB,CAAA;OACF;MAED,oBAAoB;UAClB,OAAO;cACL,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;cAC1C,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;cAC1C,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;WACjD,CAAA;OACF;GACF;;;;;;;;;;;"}
|