@ckeditor/ckeditor5-undo 27.1.0 → 29.2.0
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/LICENSE.md +1 -1
- package/README.md +2 -2
- package/package.json +16 -15
- package/src/basecommand.js +26 -1
package/LICENSE.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Software License Agreement
|
2
2
|
==========================
|
3
3
|
|
4
|
-
**CKEditor 5
|
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
|
[](https://www.npmjs.com/package/@ckeditor/ckeditor5-undo)
|
5
|
-
[](https://coveralls.io/github/ckeditor/ckeditor5?branch=master)
|
6
|
+
[](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": "
|
4
|
-
"description": "Undo
|
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": "^
|
16
|
-
"@ckeditor/ckeditor5-engine": "^
|
17
|
-
"@ckeditor/ckeditor5-ui": "^
|
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": "^
|
21
|
-
"@ckeditor/ckeditor5-clipboard": "^
|
22
|
-
"@ckeditor/ckeditor5-editor-classic": "^
|
23
|
-
"@ckeditor/ckeditor5-enter": "^
|
24
|
-
"@ckeditor/ckeditor5-heading": "^
|
25
|
-
"@ckeditor/ckeditor5-paragraph": "^
|
26
|
-
"@ckeditor/ckeditor5-typing": "^
|
27
|
-
"@ckeditor/ckeditor5-table": "^
|
28
|
-
"@ckeditor/ckeditor5-utils": "^
|
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
|
}
|
package/src/basecommand.js
CHANGED
@@ -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
|
-
|
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
|
/**
|