@ckeditor/ckeditor5-undo
Advanced tools
Comparing version 31.1.0 to 32.0.0
@@ -5,3 +5,3 @@ Software License Agreement | ||
**CKEditor 5 undo feature** – https://github.com/ckeditor/ckeditor5-undo <br> | ||
Copyright (c) 2003-2021, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved. | ||
Copyright (c) 2003-2022, [CKSource](http://cksource.com) Holding sp. z o.o. All rights reserved. | ||
@@ -18,2 +18,2 @@ Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html). | ||
**CKEditor** is a trademark of [CKSource](http://cksource.com) Frederico Knabben. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders. | ||
**CKEditor** is a trademark of [CKSource](http://cksource.com) Holding sp. z o.o. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders. |
{ | ||
"name": "@ckeditor/ckeditor5-undo", | ||
"version": "31.1.0", | ||
"version": "32.0.0", | ||
"description": "Undo feature for CKEditor 5.", | ||
@@ -15,19 +15,19 @@ "keywords": [ | ||
"dependencies": { | ||
"@ckeditor/ckeditor5-core": "^31.1.0", | ||
"@ckeditor/ckeditor5-engine": "^31.1.0", | ||
"@ckeditor/ckeditor5-ui": "^31.1.0" | ||
"@ckeditor/ckeditor5-core": "^32.0.0", | ||
"@ckeditor/ckeditor5-engine": "^32.0.0", | ||
"@ckeditor/ckeditor5-ui": "^32.0.0" | ||
}, | ||
"devDependencies": { | ||
"@ckeditor/ckeditor5-basic-styles": "^31.1.0", | ||
"@ckeditor/ckeditor5-clipboard": "^31.1.0", | ||
"@ckeditor/ckeditor5-editor-classic": "^31.1.0", | ||
"@ckeditor/ckeditor5-enter": "^31.1.0", | ||
"@ckeditor/ckeditor5-heading": "^31.1.0", | ||
"@ckeditor/ckeditor5-paragraph": "^31.1.0", | ||
"@ckeditor/ckeditor5-typing": "^31.1.0", | ||
"@ckeditor/ckeditor5-table": "^31.1.0", | ||
"@ckeditor/ckeditor5-utils": "^31.1.0" | ||
"@ckeditor/ckeditor5-basic-styles": "^32.0.0", | ||
"@ckeditor/ckeditor5-clipboard": "^32.0.0", | ||
"@ckeditor/ckeditor5-editor-classic": "^32.0.0", | ||
"@ckeditor/ckeditor5-enter": "^32.0.0", | ||
"@ckeditor/ckeditor5-heading": "^32.0.0", | ||
"@ckeditor/ckeditor5-paragraph": "^32.0.0", | ||
"@ckeditor/ckeditor5-typing": "^32.0.0", | ||
"@ckeditor/ckeditor5-table": "^32.0.0", | ||
"@ckeditor/ckeditor5-utils": "^32.0.0" | ||
}, | ||
"engines": { | ||
"node": ">=12.0.0", | ||
"node": ">=14.0.0", | ||
"npm": ">=5.7.1" | ||
@@ -34,0 +34,0 @@ }, |
/** | ||
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. | ||
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
@@ -54,7 +54,6 @@ */ | ||
if ( options.batchType ) { | ||
return; | ||
// If batch type is not set, default to non-undoable batch. | ||
if ( !options.batchType ) { | ||
options.batchType = { isUndoable: false }; | ||
} | ||
options.batchType = 'transparent'; | ||
}, { priority: 'high' } ); | ||
@@ -64,7 +63,7 @@ | ||
this.listenTo( editor.data, 'set', ( evt, data ) => { | ||
// We can assume that the object exists - it was ensured | ||
// with the high priority listener before. | ||
// We can assume that the object exists and it has `batchType` property. | ||
// It was ensured with a higher priority listener before. | ||
const options = data[ 1 ]; | ||
if ( options.batchType === 'transparent' ) { | ||
if ( !options.batchType.isUndoable ) { | ||
this.clearStack(); | ||
@@ -71,0 +70,0 @@ } |
/** | ||
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. | ||
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. | ||
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
@@ -33,3 +33,3 @@ */ | ||
const item = this._stack.pop(); | ||
const redoingBatch = this.editor.model.createBatch( 'transparent' ); | ||
const redoingBatch = this.editor.model.createBatch( { isUndo: true } ); | ||
@@ -36,0 +36,0 @@ // All changes have to be done in one `enqueueChange` callback so other listeners will not step between consecutive |
/** | ||
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. | ||
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. | ||
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
@@ -36,3 +36,3 @@ */ | ||
const item = this._stack.splice( batchIndex, 1 )[ 0 ]; | ||
const undoingBatch = this.editor.model.createBatch( 'transparent' ); | ||
const undoingBatch = this.editor.model.createBatch( { isUndo: true } ); | ||
@@ -39,0 +39,0 @@ // All changes has to be done in one `enqueueChange` callback so other listeners will not |
/** | ||
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. | ||
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
@@ -90,17 +90,7 @@ */ | ||
const isUndoBatch = this._undoCommand._createdBatches.has( batch ); | ||
const isRegisteredBatch = this._batchRegistry.has( batch ); | ||
const wasProcessed = this._batchRegistry.has( batch ); | ||
// If changes are not a part of a batch or this is not a new batch, omit those changes. | ||
if ( isRegisteredBatch || ( batch.type == 'transparent' && !isRedoBatch && !isUndoBatch ) ) { | ||
// Skip the batch if it was already processed. | ||
if ( wasProcessed ) { | ||
return; | ||
} else { | ||
if ( isRedoBatch ) { | ||
// If this batch comes from `redoCommand`, add it to `undoCommand` stack. | ||
this._undoCommand.addBatch( batch ); | ||
} else if ( !isUndoBatch ) { | ||
// A default batch - these are new changes in the document, not introduced by undo feature. | ||
// Add them to `undoCommand` stack and clear `redoCommand` stack. | ||
this._undoCommand.addBatch( batch ); | ||
this._redoCommand.clearStack(); | ||
} | ||
} | ||
@@ -110,2 +100,16 @@ | ||
this._batchRegistry.add( batch ); | ||
if ( !batch.isUndoable ) { | ||
return; | ||
} | ||
if ( isRedoBatch ) { | ||
// If this batch comes from `redoCommand`, add it to `undoCommand` stack. | ||
this._undoCommand.addBatch( batch ); | ||
} else if ( !isUndoBatch ) { | ||
// If the batch neither comes from `redoCommand` or `undoCommand` then this is a new, regular batch. | ||
// Add the batch to the `undoCommand` stack and clear `redoCommand` stack. | ||
this._undoCommand.addBatch( batch ); | ||
this._redoCommand.clearStack(); | ||
} | ||
}, { priority: 'highest' } ); | ||
@@ -112,0 +116,0 @@ |
/** | ||
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. | ||
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
@@ -4,0 +4,0 @@ */ |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
575
82428
+ Added@ckeditor/ckeditor5-core@32.0.0(transitive)
+ Added@ckeditor/ckeditor5-engine@32.0.0(transitive)
+ Added@ckeditor/ckeditor5-ui@32.0.0(transitive)
+ Added@ckeditor/ckeditor5-utils@32.0.0(transitive)
- Removed@ckeditor/ckeditor5-core@31.1.0(transitive)
- Removed@ckeditor/ckeditor5-engine@31.1.0(transitive)
- Removed@ckeditor/ckeditor5-ui@31.1.0(transitive)
- Removed@ckeditor/ckeditor5-utils@31.1.0(transitive)