@ckeditor/ckeditor5-undo 27.1.0 → 29.2.0

Sign up to get free protection for your applications and to get access to all the features.
package/LICENSE.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Software License Agreement
2
2
  ==========================
3
3
 
4
- **CKEditor 5 Undo Manager** – https://github.com/ckeditor/ckeditor5-undo <br>
4
+ **CKEditor 5 undo feature** – https://github.com/ckeditor/ckeditor5-undo <br>
5
5
  Copyright (c) 2003-2021, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved.
6
6
 
7
7
  Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
package/README.md CHANGED
@@ -2,8 +2,8 @@ CKEditor 5 undo feature
2
2
  ========================================
3
3
 
4
4
  [![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-undo.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-undo)
5
- [![Dependency Status](https://david-dm.org/ckeditor/ckeditor5-undo/status.svg)](https://david-dm.org/ckeditor/ckeditor5-undo)
6
- [![devDependency Status](https://david-dm.org/ckeditor/ckeditor5-undo/dev-status.svg)](https://david-dm.org/ckeditor/ckeditor5-undo?type=dev)
5
+ [![Coverage Status](https://coveralls.io/repos/github/ckeditor/ckeditor5/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5?branch=master)
6
+ [![Build Status](https://travis-ci.com/ckeditor/ckeditor5.svg?branch=master)](https://travis-ci.com/ckeditor/ckeditor5)
7
7
 
8
8
  This package implements undo support for CKEditor 5.
9
9
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-undo",
3
- "version": "27.1.0",
4
- "description": "Undo manager for CKEditor 5.",
3
+ "version": "29.2.0",
4
+ "description": "Undo feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
7
7
  "ckeditor5",
@@ -12,20 +12,20 @@
12
12
  ],
13
13
  "main": "src/index.js",
14
14
  "dependencies": {
15
- "@ckeditor/ckeditor5-core": "^27.1.0",
16
- "@ckeditor/ckeditor5-engine": "^27.1.0",
17
- "@ckeditor/ckeditor5-ui": "^27.1.0"
15
+ "@ckeditor/ckeditor5-core": "^29.2.0",
16
+ "@ckeditor/ckeditor5-engine": "^29.2.0",
17
+ "@ckeditor/ckeditor5-ui": "^29.2.0"
18
18
  },
19
19
  "devDependencies": {
20
- "@ckeditor/ckeditor5-basic-styles": "^27.1.0",
21
- "@ckeditor/ckeditor5-clipboard": "^27.1.0",
22
- "@ckeditor/ckeditor5-editor-classic": "^27.1.0",
23
- "@ckeditor/ckeditor5-enter": "^27.1.0",
24
- "@ckeditor/ckeditor5-heading": "^27.1.0",
25
- "@ckeditor/ckeditor5-paragraph": "^27.1.0",
26
- "@ckeditor/ckeditor5-typing": "^27.1.0",
27
- "@ckeditor/ckeditor5-table": "^27.1.0",
28
- "@ckeditor/ckeditor5-utils": "^27.1.0"
20
+ "@ckeditor/ckeditor5-basic-styles": "^29.2.0",
21
+ "@ckeditor/ckeditor5-clipboard": "^29.2.0",
22
+ "@ckeditor/ckeditor5-editor-classic": "^29.2.0",
23
+ "@ckeditor/ckeditor5-enter": "^29.2.0",
24
+ "@ckeditor/ckeditor5-heading": "^29.2.0",
25
+ "@ckeditor/ckeditor5-paragraph": "^29.2.0",
26
+ "@ckeditor/ckeditor5-typing": "^29.2.0",
27
+ "@ckeditor/ckeditor5-table": "^29.2.0",
28
+ "@ckeditor/ckeditor5-utils": "^29.2.0"
29
29
  },
30
30
  "engines": {
31
31
  "node": ">=12.0.0",
@@ -43,6 +43,7 @@
43
43
  "files": [
44
44
  "lang",
45
45
  "src",
46
- "theme"
46
+ "theme",
47
+ "ckeditor5-metadata.json"
47
48
  ]
48
49
  }
@@ -42,7 +42,32 @@ export default class BaseCommand extends Command {
42
42
  // Refresh state, so the command is inactive right after initialization.
43
43
  this.refresh();
44
44
 
45
- this.listenTo( editor.data, 'set', () => this.clearStack() );
45
+ // Set the transparent batch for the `editor.data.set()` call if the
46
+ // batch type is not set already.
47
+ this.listenTo( editor.data, 'set', ( evt, data ) => {
48
+ // Create a shallow copy of the options to not change the original args.
49
+ // And make sure that an object is assigned to data[ 1 ].
50
+ data[ 1 ] = { ...data[ 1 ] };
51
+
52
+ const options = data[ 1 ];
53
+
54
+ if ( options.batchType ) {
55
+ return;
56
+ }
57
+
58
+ options.batchType = 'transparent';
59
+ }, { priority: 'high' } );
60
+
61
+ // Clear the stack for the `transparent` batches.
62
+ this.listenTo( editor.data, 'set', ( evt, data ) => {
63
+ // We can assume that the object exists - it was ensured
64
+ // with the high priority listener before.
65
+ const options = data[ 1 ];
66
+
67
+ if ( options.batchType === 'transparent' ) {
68
+ this.clearStack();
69
+ }
70
+ } );
46
71
  }
47
72
 
48
73
  /**