@tiptap/extensions 3.30.1 → 3.30.3

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.
Files changed (73) hide show
  1. package/dist/character-count/index.cjs +84 -128
  2. package/dist/character-count/index.cjs.map +1 -1
  3. package/dist/character-count/index.d.cts +59 -58
  4. package/dist/character-count/index.d.cts.map +1 -0
  5. package/dist/character-count/index.d.ts +59 -58
  6. package/dist/character-count/index.d.ts.map +1 -0
  7. package/dist/character-count/index.js +82 -100
  8. package/dist/character-count/index.js.map +1 -1
  9. package/dist/drop-cursor/index.cjs +24 -44
  10. package/dist/drop-cursor/index.cjs.map +1 -1
  11. package/dist/drop-cursor/index.d.cts +23 -22
  12. package/dist/drop-cursor/index.d.cts.map +1 -0
  13. package/dist/drop-cursor/index.d.ts +23 -22
  14. package/dist/drop-cursor/index.d.ts.map +1 -0
  15. package/dist/drop-cursor/index.js +22 -16
  16. package/dist/drop-cursor/index.js.map +1 -1
  17. package/dist/focus/index.cjs +45 -92
  18. package/dist/focus/index.cjs.map +1 -1
  19. package/dist/focus/index.d.cts +22 -21
  20. package/dist/focus/index.d.cts.map +1 -0
  21. package/dist/focus/index.d.ts +22 -21
  22. package/dist/focus/index.d.ts.map +1 -0
  23. package/dist/focus/index.js +42 -63
  24. package/dist/focus/index.js.map +1 -1
  25. package/dist/gap-cursor/index.cjs +25 -48
  26. package/dist/gap-cursor/index.cjs.map +1 -1
  27. package/dist/gap-cursor/index.d.cts +16 -15
  28. package/dist/gap-cursor/index.d.cts.map +1 -0
  29. package/dist/gap-cursor/index.d.ts +16 -15
  30. package/dist/gap-cursor/index.d.ts.map +1 -0
  31. package/dist/gap-cursor/index.js +24 -21
  32. package/dist/gap-cursor/index.js.map +1 -1
  33. package/dist/index.cjs +666 -742
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.d.cts +231 -220
  36. package/dist/index.d.cts.map +1 -0
  37. package/dist/index.d.ts +231 -220
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.js +653 -703
  40. package/dist/index.js.map +1 -1
  41. package/dist/placeholder/index.cjs +344 -376
  42. package/dist/placeholder/index.cjs.map +1 -1
  43. package/dist/placeholder/index.d.cts +73 -69
  44. package/dist/placeholder/index.d.cts.map +1 -0
  45. package/dist/placeholder/index.d.ts +73 -69
  46. package/dist/placeholder/index.d.ts.map +1 -0
  47. package/dist/placeholder/index.js +340 -346
  48. package/dist/placeholder/index.js.map +1 -1
  49. package/dist/selection/index.cjs +62 -86
  50. package/dist/selection/index.cjs.map +1 -1
  51. package/dist/selection/index.d.cts +11 -10
  52. package/dist/selection/index.d.cts.map +1 -0
  53. package/dist/selection/index.d.ts +11 -10
  54. package/dist/selection/index.d.ts.map +1 -0
  55. package/dist/selection/index.js +58 -56
  56. package/dist/selection/index.js.map +1 -1
  57. package/dist/trailing-node/index.cjs +59 -89
  58. package/dist/trailing-node/index.cjs.map +1 -1
  59. package/dist/trailing-node/index.d.cts +17 -16
  60. package/dist/trailing-node/index.d.cts.map +1 -0
  61. package/dist/trailing-node/index.d.ts +17 -16
  62. package/dist/trailing-node/index.d.ts.map +1 -0
  63. package/dist/trailing-node/index.js +55 -59
  64. package/dist/trailing-node/index.js.map +1 -1
  65. package/dist/undo-redo/index.cjs +45 -63
  66. package/dist/undo-redo/index.cjs.map +1 -1
  67. package/dist/undo-redo/index.d.cts +31 -30
  68. package/dist/undo-redo/index.d.cts.map +1 -0
  69. package/dist/undo-redo/index.d.ts +31 -30
  70. package/dist/undo-redo/index.d.ts.map +1 -0
  71. package/dist/undo-redo/index.js +43 -35
  72. package/dist/undo-redo/index.js.map +1 -1
  73. package/package.json +6 -6
@@ -1,34 +1,34 @@
1
- import { Extension } from '@tiptap/core';
2
-
1
+ import { Extension } from "@tiptap/core";
2
+ //#region src/undo-redo/undo-redo.d.ts
3
3
  interface UndoRedoOptions {
4
- /**
5
- * The amount of history events that are collected before the oldest events are discarded.
6
- * @default 100
7
- * @example 50
8
- */
9
- depth: number;
10
- /**
11
- * The delay (in milliseconds) between changes after which a new group should be started.
12
- * @default 500
13
- * @example 1000
14
- */
15
- newGroupDelay: number;
4
+ /**
5
+ * The amount of history events that are collected before the oldest events are discarded.
6
+ * @default 100
7
+ * @example 50
8
+ */
9
+ depth: number;
10
+ /**
11
+ * The delay (in milliseconds) between changes after which a new group should be started.
12
+ * @default 500
13
+ * @example 1000
14
+ */
15
+ newGroupDelay: number;
16
16
  }
17
17
  declare module '@tiptap/core' {
18
- interface Commands<ReturnType> {
19
- undoRedo: {
20
- /**
21
- * Undo recent changes
22
- * @example editor.commands.undo()
23
- */
24
- undo: () => ReturnType;
25
- /**
26
- * Reapply reverted changes
27
- * @example editor.commands.redo()
28
- */
29
- redo: () => ReturnType;
30
- };
31
- }
18
+ interface Commands<ReturnType> {
19
+ undoRedo: {
20
+ /**
21
+ * Undo recent changes
22
+ * @example editor.commands.undo()
23
+ */
24
+ undo: () => ReturnType;
25
+ /**
26
+ * Reapply reverted changes
27
+ * @example editor.commands.redo()
28
+ */
29
+ redo: () => ReturnType;
30
+ };
31
+ }
32
32
  }
33
33
  /**
34
34
  * This extension allows you to undo and redo recent changes.
@@ -40,5 +40,6 @@ declare module '@tiptap/core' {
40
40
  * `@tiptap/extension-collaboration` uses its own history implementation.
41
41
  */
42
42
  declare const UndoRedo: Extension<UndoRedoOptions, any>;
43
-
44
- export { UndoRedo, type UndoRedoOptions };
43
+ //#endregion
44
+ export { UndoRedo, UndoRedoOptions };
45
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/undo-redo/undo-redo.ts"],"mappings":";;UAGiB;;;;;;EAMf;;;;;;EAOA;;;YAIU,SAAS;IACjB;;;;;MAKE,YAAY;;;;;MAKZ,YAAY;;;;;;;;;;;;;cAcL,UAAQ,UAAA"}
@@ -1,34 +1,34 @@
1
- import { Extension } from '@tiptap/core';
2
-
1
+ import { Extension } from "@tiptap/core";
2
+ //#region src/undo-redo/undo-redo.d.ts
3
3
  interface UndoRedoOptions {
4
- /**
5
- * The amount of history events that are collected before the oldest events are discarded.
6
- * @default 100
7
- * @example 50
8
- */
9
- depth: number;
10
- /**
11
- * The delay (in milliseconds) between changes after which a new group should be started.
12
- * @default 500
13
- * @example 1000
14
- */
15
- newGroupDelay: number;
4
+ /**
5
+ * The amount of history events that are collected before the oldest events are discarded.
6
+ * @default 100
7
+ * @example 50
8
+ */
9
+ depth: number;
10
+ /**
11
+ * The delay (in milliseconds) between changes after which a new group should be started.
12
+ * @default 500
13
+ * @example 1000
14
+ */
15
+ newGroupDelay: number;
16
16
  }
17
17
  declare module '@tiptap/core' {
18
- interface Commands<ReturnType> {
19
- undoRedo: {
20
- /**
21
- * Undo recent changes
22
- * @example editor.commands.undo()
23
- */
24
- undo: () => ReturnType;
25
- /**
26
- * Reapply reverted changes
27
- * @example editor.commands.redo()
28
- */
29
- redo: () => ReturnType;
30
- };
31
- }
18
+ interface Commands<ReturnType> {
19
+ undoRedo: {
20
+ /**
21
+ * Undo recent changes
22
+ * @example editor.commands.undo()
23
+ */
24
+ undo: () => ReturnType;
25
+ /**
26
+ * Reapply reverted changes
27
+ * @example editor.commands.redo()
28
+ */
29
+ redo: () => ReturnType;
30
+ };
31
+ }
32
32
  }
33
33
  /**
34
34
  * This extension allows you to undo and redo recent changes.
@@ -40,5 +40,6 @@ declare module '@tiptap/core' {
40
40
  * `@tiptap/extension-collaboration` uses its own history implementation.
41
41
  */
42
42
  declare const UndoRedo: Extension<UndoRedoOptions, any>;
43
-
44
- export { UndoRedo, type UndoRedoOptions };
43
+ //#endregion
44
+ export { UndoRedo, UndoRedoOptions };
45
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/undo-redo/undo-redo.ts"],"mappings":";;UAGiB;;;;;;EAMf;;;;;;EAOA;;;YAIU,SAAS;IACjB;;;;;MAKE,YAAY;;;;;MAKZ,YAAY;;;;;;;;;;;;;cAcL,UAAQ,UAAA"}
@@ -1,39 +1,47 @@
1
- // src/undo-redo/undo-redo.ts
2
1
  import { Extension } from "@tiptap/core";
3
2
  import { history, redo, undo } from "@tiptap/pm/history";
4
- var UndoRedo = Extension.create({
5
- name: "undoRedo",
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 [history(this.options)];
24
- },
25
- addKeyboardShortcuts() {
26
- return {
27
- "Mod-z": () => this.editor.commands.undo(),
28
- "Shift-Mod-z": () => this.editor.commands.redo(),
29
- "Mod-y": () => this.editor.commands.redo(),
30
- // Russian keyboard layouts
31
- "Mod-\u044F": () => this.editor.commands.undo(),
32
- "Shift-Mod-\u044F": () => this.editor.commands.redo()
33
- };
34
- }
3
+ //#region src/undo-redo/undo-redo.ts
4
+ /**
5
+ * This extension allows you to undo and redo recent changes.
6
+ * @see https://www.tiptap.dev/api/extensions/undo-redo
7
+ *
8
+ * **Important**: If the `@tiptap/extension-collaboration` package is used, make sure to remove
9
+ * the `undo-redo` extension, as it is not compatible with the `collaboration` extension.
10
+ *
11
+ * `@tiptap/extension-collaboration` uses its own history implementation.
12
+ */
13
+ const UndoRedo = Extension.create({
14
+ name: "undoRedo",
15
+ addOptions() {
16
+ return {
17
+ depth: 100,
18
+ newGroupDelay: 500
19
+ };
20
+ },
21
+ addCommands() {
22
+ return {
23
+ undo: () => ({ state, dispatch }) => {
24
+ return undo(state, dispatch);
25
+ },
26
+ redo: () => ({ state, dispatch }) => {
27
+ return redo(state, dispatch);
28
+ }
29
+ };
30
+ },
31
+ addProseMirrorPlugins() {
32
+ return [history(this.options)];
33
+ },
34
+ addKeyboardShortcuts() {
35
+ return {
36
+ "Mod-z": () => this.editor.commands.undo(),
37
+ "Shift-Mod-z": () => this.editor.commands.redo(),
38
+ "Mod-y": () => this.editor.commands.redo(),
39
+ "Mod-я": () => this.editor.commands.undo(),
40
+ "Shift-Mod-я": () => this.editor.commands.redo()
41
+ };
42
+ }
35
43
  });
36
- export {
37
- UndoRedo
38
- };
44
+ //#endregion
45
+ export { UndoRedo };
46
+
39
47
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/undo-redo/undo-redo.ts"],"sourcesContent":["import { Extension } from '@tiptap/core'\nimport { history, redo, undo } from '@tiptap/pm/history'\n\nexport interface UndoRedoOptions {\n /**\n * The amount of history events that are collected before the oldest events are discarded.\n * @default 100\n * @example 50\n */\n depth: number\n\n /**\n * The delay (in milliseconds) between changes after which a new group should be started.\n * @default 500\n * @example 1000\n */\n newGroupDelay: number\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n undoRedo: {\n /**\n * Undo recent changes\n * @example editor.commands.undo()\n */\n undo: () => ReturnType\n /**\n * Reapply reverted changes\n * @example editor.commands.redo()\n */\n redo: () => ReturnType\n }\n }\n}\n\n/**\n * This extension allows you to undo and redo recent changes.\n * @see https://www.tiptap.dev/api/extensions/undo-redo\n *\n * **Important**: If the `@tiptap/extension-collaboration` package is used, make sure to remove\n * the `undo-redo` extension, as it is not compatible with the `collaboration` extension.\n *\n * `@tiptap/extension-collaboration` uses its own history implementation.\n */\nexport const UndoRedo = Extension.create<UndoRedoOptions>({\n name: 'undoRedo',\n\n addOptions() {\n return {\n depth: 100,\n newGroupDelay: 500,\n }\n },\n\n addCommands() {\n return {\n undo:\n () =>\n ({ state, dispatch }) => {\n return undo(state, dispatch)\n },\n redo:\n () =>\n ({ state, dispatch }) => {\n return redo(state, dispatch)\n },\n }\n },\n\n addProseMirrorPlugins() {\n return [history(this.options)]\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-z': () => this.editor.commands.undo(),\n 'Shift-Mod-z': () => this.editor.commands.redo(),\n 'Mod-y': () => 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"],"mappings":";AAAA,SAAS,iBAAiB;AAC1B,SAAS,SAAS,MAAM,YAAY;AA4C7B,IAAM,WAAW,UAAU,OAAwB;AAAA,EACxD,MAAM;AAAA,EAEN,aAAa;AACX,WAAO;AAAA,MACL,OAAO;AAAA,MACP,eAAe;AAAA,IACjB;AAAA,EACF;AAAA,EAEA,cAAc;AACZ,WAAO;AAAA,MACL,MACE,MACA,CAAC,EAAE,OAAO,SAAS,MAAM;AACvB,eAAO,KAAK,OAAO,QAAQ;AAAA,MAC7B;AAAA,MACF,MACE,MACA,CAAC,EAAE,OAAO,SAAS,MAAM;AACvB,eAAO,KAAK,OAAO,QAAQ;AAAA,MAC7B;AAAA,IACJ;AAAA,EACF;AAAA,EAEA,wBAAwB;AACtB,WAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;AAAA,EAC/B;AAAA,EAEA,uBAAuB;AACrB,WAAO;AAAA,MACL,SAAS,MAAM,KAAK,OAAO,SAAS,KAAK;AAAA,MACzC,eAAe,MAAM,KAAK,OAAO,SAAS,KAAK;AAAA,MAC/C,SAAS,MAAM,KAAK,OAAO,SAAS,KAAK;AAAA;AAAA,MAGzC,cAAS,MAAM,KAAK,OAAO,SAAS,KAAK;AAAA,MACzC,oBAAe,MAAM,KAAK,OAAO,SAAS,KAAK;AAAA,IACjD;AAAA,EACF;AACF,CAAC;","names":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/undo-redo/undo-redo.ts"],"sourcesContent":["import { Extension } from '@tiptap/core'\nimport { history, redo, undo } from '@tiptap/pm/history'\n\nexport interface UndoRedoOptions {\n /**\n * The amount of history events that are collected before the oldest events are discarded.\n * @default 100\n * @example 50\n */\n depth: number\n\n /**\n * The delay (in milliseconds) between changes after which a new group should be started.\n * @default 500\n * @example 1000\n */\n newGroupDelay: number\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n undoRedo: {\n /**\n * Undo recent changes\n * @example editor.commands.undo()\n */\n undo: () => ReturnType\n /**\n * Reapply reverted changes\n * @example editor.commands.redo()\n */\n redo: () => ReturnType\n }\n }\n}\n\n/**\n * This extension allows you to undo and redo recent changes.\n * @see https://www.tiptap.dev/api/extensions/undo-redo\n *\n * **Important**: If the `@tiptap/extension-collaboration` package is used, make sure to remove\n * the `undo-redo` extension, as it is not compatible with the `collaboration` extension.\n *\n * `@tiptap/extension-collaboration` uses its own history implementation.\n */\nexport const UndoRedo = Extension.create<UndoRedoOptions>({\n name: 'undoRedo',\n\n addOptions() {\n return {\n depth: 100,\n newGroupDelay: 500,\n }\n },\n\n addCommands() {\n return {\n undo:\n () =>\n ({ state, dispatch }) => {\n return undo(state, dispatch)\n },\n redo:\n () =>\n ({ state, dispatch }) => {\n return redo(state, dispatch)\n },\n }\n },\n\n addProseMirrorPlugins() {\n return [history(this.options)]\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-z': () => this.editor.commands.undo(),\n 'Shift-Mod-z': () => this.editor.commands.redo(),\n 'Mod-y': () => 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"],"mappings":";;;;;;;;;;;;AA6CA,MAAa,WAAW,UAAU,OAAwB;CACxD,MAAM;CAEN,aAAa;EACX,OAAO;GACL,OAAO;GACP,eAAe;EACjB;CACF;CAEA,cAAc;EACZ,OAAO;GACL,aAEG,EAAE,OAAO,eAAe;IACvB,OAAO,KAAK,OAAO,QAAQ;GAC7B;GACF,aAEG,EAAE,OAAO,eAAe;IACvB,OAAO,KAAK,OAAO,QAAQ;GAC7B;EACJ;CACF;CAEA,wBAAwB;EACtB,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;CAC/B;CAEA,uBAAuB;EACrB,OAAO;GACL,eAAe,KAAK,OAAO,SAAS,KAAK;GACzC,qBAAqB,KAAK,OAAO,SAAS,KAAK;GAC/C,eAAe,KAAK,OAAO,SAAS,KAAK;GAGzC,eAAe,KAAK,OAAO,SAAS,KAAK;GACzC,qBAAqB,KAAK,OAAO,SAAS,KAAK;EACjD;CACF;AACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiptap/extensions",
3
- "version": "3.30.1",
3
+ "version": "3.30.3",
4
4
  "description": "various extensions for tiptap",
5
5
  "keywords": [
6
6
  "tiptap",
@@ -103,14 +103,14 @@
103
103
  }
104
104
  },
105
105
  "devDependencies": {
106
- "@tiptap/core": "^3.30.1",
107
- "@tiptap/pm": "^3.30.1"
106
+ "@tiptap/core": "^3.30.3",
107
+ "@tiptap/pm": "^3.30.3"
108
108
  },
109
109
  "peerDependencies": {
110
- "@tiptap/core": "3.30.1",
111
- "@tiptap/pm": "3.30.1"
110
+ "@tiptap/core": "3.30.3",
111
+ "@tiptap/pm": "3.30.3"
112
112
  },
113
113
  "scripts": {
114
- "build": "tsup"
114
+ "build": "vp pack"
115
115
  }
116
116
  }