@tiptap/extension-history
Advanced tools
Comparing version 2.3.2 to 2.4.0
import { Extension } from '@tiptap/core'; | ||
import { undo, redo, history } from '@tiptap/pm/history'; | ||
/** | ||
* This extension allows you to undo and redo recent changes. | ||
* @see https://www.tiptap.dev/api/extensions/history | ||
* | ||
* **Important**: If the `@tiptap/extension-collaboration` package is used, make sure to remove | ||
* the `history` extension, as it is not compatible with the `collaboration` extension. | ||
* | ||
* `@tiptap/extension-collaboration` uses its own history implementation. | ||
*/ | ||
const History = Extension.create({ | ||
@@ -5,0 +14,0 @@ name: 'history', |
@@ -7,2 +7,11 @@ (function (global, factory) { | ||
/** | ||
* This extension allows you to undo and redo recent changes. | ||
* @see https://www.tiptap.dev/api/extensions/history | ||
* | ||
* **Important**: If the `@tiptap/extension-collaboration` package is used, make sure to remove | ||
* the `history` extension, as it is not compatible with the `collaboration` extension. | ||
* | ||
* `@tiptap/extension-collaboration` uses its own history implementation. | ||
*/ | ||
const History = core.Extension.create({ | ||
@@ -9,0 +18,0 @@ name: 'history', |
import { Extension } from '@tiptap/core'; | ||
export interface HistoryOptions { | ||
/** | ||
* The amount of history events that are collected before the oldest events are discarded. | ||
* @default 100 | ||
* @example 50 | ||
*/ | ||
depth: number; | ||
/** | ||
* The delay (in milliseconds) between changes after which a new group should be started. | ||
* @default 500 | ||
* @example 1000 | ||
*/ | ||
newGroupDelay: number; | ||
@@ -11,2 +21,3 @@ } | ||
* Undo recent changes | ||
* @example editor.commands.undo() | ||
*/ | ||
@@ -16,2 +27,3 @@ undo: () => ReturnType; | ||
* Reapply reverted changes | ||
* @example editor.commands.redo() | ||
*/ | ||
@@ -22,2 +34,11 @@ redo: () => ReturnType; | ||
} | ||
/** | ||
* This extension allows you to undo and redo recent changes. | ||
* @see https://www.tiptap.dev/api/extensions/history | ||
* | ||
* **Important**: If the `@tiptap/extension-collaboration` package is used, make sure to remove | ||
* the `history` extension, as it is not compatible with the `collaboration` extension. | ||
* | ||
* `@tiptap/extension-collaboration` uses its own history implementation. | ||
*/ | ||
export declare const History: Extension<HistoryOptions, any>; |
{ | ||
"name": "@tiptap/extension-history", | ||
"description": "history extension for tiptap", | ||
"version": "2.3.2", | ||
"version": "2.4.0", | ||
"homepage": "https://tiptap.dev", | ||
@@ -32,4 +32,4 @@ "keywords": [ | ||
"devDependencies": { | ||
"@tiptap/core": "^2.3.2", | ||
"@tiptap/pm": "^2.3.2" | ||
"@tiptap/core": "^2.4.0", | ||
"@tiptap/pm": "^2.4.0" | ||
}, | ||
@@ -36,0 +36,0 @@ "peerDependencies": { |
@@ -5,3 +5,14 @@ import { Extension } from '@tiptap/core' | ||
export interface HistoryOptions { | ||
/** | ||
* The amount of history events that are collected before the oldest events are discarded. | ||
* @default 100 | ||
* @example 50 | ||
*/ | ||
depth: number, | ||
/** | ||
* The delay (in milliseconds) between changes after which a new group should be started. | ||
* @default 500 | ||
* @example 1000 | ||
*/ | ||
newGroupDelay: number, | ||
@@ -15,2 +26,3 @@ } | ||
* Undo recent changes | ||
* @example editor.commands.undo() | ||
*/ | ||
@@ -20,2 +32,3 @@ undo: () => ReturnType, | ||
* Reapply reverted changes | ||
* @example editor.commands.redo() | ||
*/ | ||
@@ -27,2 +40,11 @@ redo: () => ReturnType, | ||
/** | ||
* This extension allows you to undo and redo recent changes. | ||
* @see https://www.tiptap.dev/api/extensions/history | ||
* | ||
* **Important**: If the `@tiptap/extension-collaboration` package is used, make sure to remove | ||
* the `history` extension, as it is not compatible with the `collaboration` extension. | ||
* | ||
* `@tiptap/extension-collaboration` uses its own history implementation. | ||
*/ | ||
export const History = Extension.create<HistoryOptions>({ | ||
@@ -29,0 +51,0 @@ name: 'history', |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20457
272