@tiptap/extension-history 2.0.0-beta.20 → 2.0.0-beta.21

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.
@@ -0,0 +1,20 @@
1
+ import { Extension } from '@tiptap/core';
2
+ export interface HistoryOptions {
3
+ depth: number;
4
+ newGroupDelay: number;
5
+ }
6
+ declare module '@tiptap/core' {
7
+ interface Commands<ReturnType> {
8
+ history: {
9
+ /**
10
+ * Undo recent changes
11
+ */
12
+ undo: () => ReturnType;
13
+ /**
14
+ * Reapply reverted changes
15
+ */
16
+ redo: () => ReturnType;
17
+ };
18
+ }
19
+ }
20
+ export declare const History: Extension<HistoryOptions, any>;
@@ -0,0 +1,3 @@
1
+ import { History } from './history';
2
+ export * from './history';
3
+ export default History;
@@ -0,0 +1,45 @@
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
@@ -0,0 +1 @@
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;;;;;"}
@@ -0,0 +1,40 @@
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
@@ -0,0 +1 @@
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;;;;"}
@@ -0,0 +1,48 @@
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
@@ -0,0 +1 @@
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;;;;;;;;;;;"}
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.20",
4
+ "version": "2.0.0-beta.21",
5
5
  "homepage": "https://tiptap.dev",
6
6
  "keywords": [
7
7
  "tiptap",
@@ -32,5 +32,5 @@
32
32
  "url": "https://github.com/ueberdosis/tiptap",
33
33
  "directory": "packages/extension-history"
34
34
  },
35
- "gitHead": "fce16e805824972834d5a8ce8d60e3ff41d63c7e"
35
+ "gitHead": "621cfa2f7e98a48525fa22f9d97a92fc08368966"
36
36
  }