@tiptap/extension-history 2.0.0-beta.21 → 2.0.0-beta.210
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/dist/index.cjs +43 -0
- package/dist/{packages/extension-history/src/history.d.ts → index.d.ts} +23 -20
- package/dist/index.js +43 -0
- package/package.json +31 -10
- package/src/history.ts +1 -1
- package/LICENSE.md +0 -21
- package/dist/packages/extension-history/src/index.d.ts +0 -3
- package/dist/tiptap-extension-history.cjs.js +0 -45
- package/dist/tiptap-extension-history.cjs.js.map +0 -1
- package/dist/tiptap-extension-history.esm.js +0 -40
- package/dist/tiptap-extension-history.esm.js.map +0 -1
- package/dist/tiptap-extension-history.umd.js +0 -48
- package/dist/tiptap-extension-history.umd.js.map +0 -1
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/history.ts
|
|
2
|
+
var _core = require('@tiptap/core');
|
|
3
|
+
var _history = require('@tiptap/pm/history');
|
|
4
|
+
var History = _core.Extension.create({
|
|
5
|
+
name: "history",
|
|
6
|
+
addOptions() {
|
|
7
|
+
return {
|
|
8
|
+
depth: 100,
|
|
9
|
+
newGroupDelay: 500
|
|
10
|
+
};
|
|
11
|
+
},
|
|
12
|
+
addCommands() {
|
|
13
|
+
return {
|
|
14
|
+
undo: () => ({ state, dispatch }) => {
|
|
15
|
+
return _history.undo.call(void 0, state, dispatch);
|
|
16
|
+
},
|
|
17
|
+
redo: () => ({ state, dispatch }) => {
|
|
18
|
+
return _history.redo.call(void 0, state, dispatch);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
addProseMirrorPlugins() {
|
|
23
|
+
return [
|
|
24
|
+
_history.history.call(void 0, this.options)
|
|
25
|
+
];
|
|
26
|
+
},
|
|
27
|
+
addKeyboardShortcuts() {
|
|
28
|
+
return {
|
|
29
|
+
"Mod-z": () => this.editor.commands.undo(),
|
|
30
|
+
"Mod-y": () => this.editor.commands.redo(),
|
|
31
|
+
"Shift-Mod-z": () => this.editor.commands.redo(),
|
|
32
|
+
"Mod-\u044F": () => this.editor.commands.undo(),
|
|
33
|
+
"Shift-Mod-\u044F": () => this.editor.commands.redo()
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// src/index.ts
|
|
39
|
+
var src_default = History;
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
exports.History = History; exports.default = src_default;
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import { Extension } from '@tiptap/core';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
|
|
3
|
+
interface HistoryOptions {
|
|
4
|
+
depth: number;
|
|
5
|
+
newGroupDelay: number;
|
|
6
|
+
}
|
|
7
|
+
declare module '@tiptap/core' {
|
|
8
|
+
interface Commands<ReturnType> {
|
|
9
|
+
history: {
|
|
10
|
+
/**
|
|
11
|
+
* Undo recent changes
|
|
12
|
+
*/
|
|
13
|
+
undo: () => ReturnType;
|
|
14
|
+
/**
|
|
15
|
+
* Reapply reverted changes
|
|
16
|
+
*/
|
|
17
|
+
redo: () => ReturnType;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
declare const History: Extension<HistoryOptions, any>;
|
|
22
|
+
|
|
23
|
+
export { History, HistoryOptions, History as default };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// src/history.ts
|
|
2
|
+
import { Extension } from "@tiptap/core";
|
|
3
|
+
import { history, redo, undo } from "@tiptap/pm/history";
|
|
4
|
+
var History = Extension.create({
|
|
5
|
+
name: "history",
|
|
6
|
+
addOptions() {
|
|
7
|
+
return {
|
|
8
|
+
depth: 100,
|
|
9
|
+
newGroupDelay: 500
|
|
10
|
+
};
|
|
11
|
+
},
|
|
12
|
+
addCommands() {
|
|
13
|
+
return {
|
|
14
|
+
undo: () => ({ state, dispatch }) => {
|
|
15
|
+
return undo(state, dispatch);
|
|
16
|
+
},
|
|
17
|
+
redo: () => ({ state, dispatch }) => {
|
|
18
|
+
return redo(state, dispatch);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
addProseMirrorPlugins() {
|
|
23
|
+
return [
|
|
24
|
+
history(this.options)
|
|
25
|
+
];
|
|
26
|
+
},
|
|
27
|
+
addKeyboardShortcuts() {
|
|
28
|
+
return {
|
|
29
|
+
"Mod-z": () => this.editor.commands.undo(),
|
|
30
|
+
"Mod-y": () => this.editor.commands.redo(),
|
|
31
|
+
"Shift-Mod-z": () => this.editor.commands.redo(),
|
|
32
|
+
"Mod-\u044F": () => this.editor.commands.undo(),
|
|
33
|
+
"Shift-Mod-\u044F": () => this.editor.commands.redo()
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// src/index.ts
|
|
39
|
+
var src_default = History;
|
|
40
|
+
export {
|
|
41
|
+
History,
|
|
42
|
+
src_default as default
|
|
43
|
+
};
|
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-beta.
|
|
4
|
+
"version": "2.0.0-beta.210",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -12,25 +12,46 @@
|
|
|
12
12
|
"type": "github",
|
|
13
13
|
"url": "https://github.com/sponsors/ueberdosis"
|
|
14
14
|
},
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
"type": "module",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js",
|
|
20
|
+
"require": "./dist/index.cjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"main": "dist/index.cjs",
|
|
24
|
+
"module": "dist/index.js",
|
|
25
|
+
"types": "dist/index.d.ts",
|
|
19
26
|
"files": [
|
|
20
27
|
"src",
|
|
21
28
|
"dist"
|
|
22
29
|
],
|
|
23
30
|
"peerDependencies": {
|
|
24
|
-
"@tiptap/core": "^2.0.0-beta.
|
|
31
|
+
"@tiptap/core": "^2.0.0-beta.209",
|
|
32
|
+
"@tiptap/pm": "^2.0.0-beta.209"
|
|
25
33
|
},
|
|
26
|
-
"
|
|
27
|
-
"@
|
|
28
|
-
"
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@tiptap/core": "^2.0.0-beta.210",
|
|
36
|
+
"@tiptap/pm": "^2.0.0-beta.210"
|
|
29
37
|
},
|
|
30
38
|
"repository": {
|
|
31
39
|
"type": "git",
|
|
32
40
|
"url": "https://github.com/ueberdosis/tiptap",
|
|
33
41
|
"directory": "packages/extension-history"
|
|
34
42
|
},
|
|
35
|
-
"
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsup"
|
|
45
|
+
},
|
|
46
|
+
"tsup": {
|
|
47
|
+
"entry": [
|
|
48
|
+
"src/index.ts"
|
|
49
|
+
],
|
|
50
|
+
"dts": true,
|
|
51
|
+
"splitting": true,
|
|
52
|
+
"format": [
|
|
53
|
+
"esm",
|
|
54
|
+
"cjs"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
36
57
|
}
|
package/src/history.ts
CHANGED
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,45 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var core = require('@tiptap/core');
|
|
6
|
-
var prosemirrorHistory = require('prosemirror-history');
|
|
7
|
-
|
|
8
|
-
const History = core.Extension.create({
|
|
9
|
-
name: 'history',
|
|
10
|
-
addOptions() {
|
|
11
|
-
return {
|
|
12
|
-
depth: 100,
|
|
13
|
-
newGroupDelay: 500,
|
|
14
|
-
};
|
|
15
|
-
},
|
|
16
|
-
addCommands() {
|
|
17
|
-
return {
|
|
18
|
-
undo: () => ({ state, dispatch }) => {
|
|
19
|
-
return prosemirrorHistory.undo(state, dispatch);
|
|
20
|
-
},
|
|
21
|
-
redo: () => ({ state, dispatch }) => {
|
|
22
|
-
return prosemirrorHistory.redo(state, dispatch);
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
},
|
|
26
|
-
addProseMirrorPlugins() {
|
|
27
|
-
return [
|
|
28
|
-
prosemirrorHistory.history(this.options),
|
|
29
|
-
];
|
|
30
|
-
},
|
|
31
|
-
addKeyboardShortcuts() {
|
|
32
|
-
return {
|
|
33
|
-
'Mod-z': () => this.editor.commands.undo(),
|
|
34
|
-
'Mod-y': () => this.editor.commands.redo(),
|
|
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(),
|
|
39
|
-
};
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
exports.History = History;
|
|
44
|
-
exports["default"] = History;
|
|
45
|
-
//# sourceMappingURL=tiptap-extension-history.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tiptap-extension-history.cjs.js","sources":["../src/history.ts"],"sourcesContent":["import { 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<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":";;;;;;;MAuBa,OAAO,GAAGA,cAAS,CAAC,MAAM,CAAiB;IACtD,IAAI,EAAE,SAAS;IAEf,UAAU;QACR,OAAO;YACL,KAAK,EAAE,GAAG;YACV,aAAa,EAAE,GAAG;SACnB,CAAA;KACF;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;;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;CACF;;;;;"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Extension } from '@tiptap/core';
|
|
2
|
-
import { undo, redo, history } from 'prosemirror-history';
|
|
3
|
-
|
|
4
|
-
const History = Extension.create({
|
|
5
|
-
name: 'history',
|
|
6
|
-
addOptions() {
|
|
7
|
-
return {
|
|
8
|
-
depth: 100,
|
|
9
|
-
newGroupDelay: 500,
|
|
10
|
-
};
|
|
11
|
-
},
|
|
12
|
-
addCommands() {
|
|
13
|
-
return {
|
|
14
|
-
undo: () => ({ state, dispatch }) => {
|
|
15
|
-
return undo(state, dispatch);
|
|
16
|
-
},
|
|
17
|
-
redo: () => ({ state, dispatch }) => {
|
|
18
|
-
return redo(state, dispatch);
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
},
|
|
22
|
-
addProseMirrorPlugins() {
|
|
23
|
-
return [
|
|
24
|
-
history(this.options),
|
|
25
|
-
];
|
|
26
|
-
},
|
|
27
|
-
addKeyboardShortcuts() {
|
|
28
|
-
return {
|
|
29
|
-
'Mod-z': () => this.editor.commands.undo(),
|
|
30
|
-
'Mod-y': () => this.editor.commands.redo(),
|
|
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(),
|
|
35
|
-
};
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
export { History, History as default };
|
|
40
|
-
//# sourceMappingURL=tiptap-extension-history.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tiptap-extension-history.esm.js","sources":["../src/history.ts"],"sourcesContent":["import { 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<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":";;;MAuBa,OAAO,GAAG,SAAS,CAAC,MAAM,CAAiB;IACtD,IAAI,EAAE,SAAS;IAEf,UAAU;QACR,OAAO;YACL,KAAK,EAAE,GAAG;YACV,aAAa,EAAE,GAAG;SACnB,CAAA;KACF;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;;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;CACF;;;;"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tiptap/core'), require('prosemirror-history')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@tiptap/core', 'prosemirror-history'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@tiptap/extension-history"] = {}, global.core, global.prosemirrorHistory));
|
|
5
|
-
})(this, (function (exports, core, prosemirrorHistory) { 'use strict';
|
|
6
|
-
|
|
7
|
-
const History = core.Extension.create({
|
|
8
|
-
name: 'history',
|
|
9
|
-
addOptions() {
|
|
10
|
-
return {
|
|
11
|
-
depth: 100,
|
|
12
|
-
newGroupDelay: 500,
|
|
13
|
-
};
|
|
14
|
-
},
|
|
15
|
-
addCommands() {
|
|
16
|
-
return {
|
|
17
|
-
undo: () => ({ state, dispatch }) => {
|
|
18
|
-
return prosemirrorHistory.undo(state, dispatch);
|
|
19
|
-
},
|
|
20
|
-
redo: () => ({ state, dispatch }) => {
|
|
21
|
-
return prosemirrorHistory.redo(state, dispatch);
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
},
|
|
25
|
-
addProseMirrorPlugins() {
|
|
26
|
-
return [
|
|
27
|
-
prosemirrorHistory.history(this.options),
|
|
28
|
-
];
|
|
29
|
-
},
|
|
30
|
-
addKeyboardShortcuts() {
|
|
31
|
-
return {
|
|
32
|
-
'Mod-z': () => this.editor.commands.undo(),
|
|
33
|
-
'Mod-y': () => this.editor.commands.redo(),
|
|
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(),
|
|
38
|
-
};
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
exports.History = History;
|
|
43
|
-
exports["default"] = History;
|
|
44
|
-
|
|
45
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
46
|
-
|
|
47
|
-
}));
|
|
48
|
-
//# sourceMappingURL=tiptap-extension-history.umd.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tiptap-extension-history.umd.js","sources":["../src/history.ts"],"sourcesContent":["import { 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<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":";;;;;;QAuBa,OAAO,GAAGA,cAAS,CAAC,MAAM,CAAiB;MACtD,IAAI,EAAE,SAAS;MAEf,UAAU;UACR,OAAO;cACL,KAAK,EAAE,GAAG;cACV,aAAa,EAAE,GAAG;WACnB,CAAA;OACF;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;;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;GACF;;;;;;;;;;;"}
|