@tiptap/extension-history 2.0.0-beta.213 → 2.0.0-beta.215

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 CHANGED
@@ -1,43 +1,45 @@
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
- });
1
+ 'use strict';
37
2
 
38
- // src/index.ts
39
- var src_default = History;
3
+ Object.defineProperty(exports, '__esModule', { value: true });
40
4
 
5
+ var core = require('@tiptap/core');
6
+ var history = require('@tiptap/pm/history');
41
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 history.undo(state, dispatch);
20
+ },
21
+ redo: () => ({ state, dispatch }) => {
22
+ return history.redo(state, dispatch);
23
+ },
24
+ };
25
+ },
26
+ addProseMirrorPlugins() {
27
+ return [
28
+ history.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
42
 
43
- exports.History = History; exports.default = src_default;
43
+ exports.History = History;
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;;;;;"}
package/dist/index.js CHANGED
@@ -1,43 +1,40 @@
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
- }
1
+ import { Extension } from '@tiptap/core';
2
+ import { undo, redo, history } from '@tiptap/pm/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
+ },
36
37
  });
37
38
 
38
- // src/index.ts
39
- var src_default = History;
40
- export {
41
- History,
42
- src_default as default
43
- };
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;;;;"}
@@ -0,0 +1,48 @@
1
+ (function (global, factory) {
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
+
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 history.undo(state, dispatch);
19
+ },
20
+ redo: () => ({ state, dispatch }) => {
21
+ return history.redo(state, dispatch);
22
+ },
23
+ };
24
+ },
25
+ addProseMirrorPlugins() {
26
+ return [
27
+ history.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=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,23 +1,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 };
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;
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.213",
4
+ "version": "2.0.0-beta.215",
5
5
  "homepage": "https://tiptap.dev",
6
6
  "keywords": [
7
7
  "tiptap",
@@ -15,14 +15,15 @@
15
15
  "type": "module",
16
16
  "exports": {
17
17
  ".": {
18
- "types": "./dist/index.d.ts",
18
+ "types": "./dist/packages/extension-history/src/index.d.ts",
19
19
  "import": "./dist/index.js",
20
20
  "require": "./dist/index.cjs"
21
21
  }
22
22
  },
23
23
  "main": "dist/index.cjs",
24
24
  "module": "dist/index.js",
25
- "types": "dist/index.d.ts",
25
+ "umd": "dist/index.umd.js",
26
+ "types": "dist/packages/extension-history/src/index.d.ts",
26
27
  "files": [
27
28
  "src",
28
29
  "dist"
@@ -32,8 +33,8 @@
32
33
  "@tiptap/pm": "^2.0.0-beta.209"
33
34
  },
34
35
  "devDependencies": {
35
- "@tiptap/core": "^2.0.0-beta.213",
36
- "@tiptap/pm": "^2.0.0-beta.213"
36
+ "@tiptap/core": "^2.0.0-beta.215",
37
+ "@tiptap/pm": "^2.0.0-beta.215"
37
38
  },
38
39
  "repository": {
39
40
  "type": "git",
@@ -41,17 +42,7 @@
41
42
  "directory": "packages/extension-history"
42
43
  },
43
44
  "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
- ]
45
+ "clean": "rm -rf dist",
46
+ "build": "npm run clean && rollup -c"
56
47
  }
57
48
  }