@ckeditor/ckeditor5-undo 0.0.0-nightly-20230726.0 → 0.0.0-nightly-20230728.0
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +4 -4
- package/src/undocommand.js +4 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-undo",
|
3
|
-
"version": "0.0.0-nightly-
|
3
|
+
"version": "0.0.0-nightly-20230728.0",
|
4
4
|
"description": "Undo feature for CKEditor 5.",
|
5
5
|
"keywords": [
|
6
6
|
"ckeditor",
|
@@ -12,9 +12,9 @@
|
|
12
12
|
],
|
13
13
|
"main": "src/index.js",
|
14
14
|
"dependencies": {
|
15
|
-
"@ckeditor/ckeditor5-core": "0.0.0-nightly-
|
16
|
-
"@ckeditor/ckeditor5-engine": "0.0.0-nightly-
|
17
|
-
"@ckeditor/ckeditor5-ui": "0.0.0-nightly-
|
15
|
+
"@ckeditor/ckeditor5-core": "0.0.0-nightly-20230728.0",
|
16
|
+
"@ckeditor/ckeditor5-engine": "0.0.0-nightly-20230728.0",
|
17
|
+
"@ckeditor/ckeditor5-ui": "0.0.0-nightly-20230728.0"
|
18
18
|
},
|
19
19
|
"engines": {
|
20
20
|
"node": ">=16.0.0",
|
package/src/undocommand.js
CHANGED
@@ -34,8 +34,11 @@ export default class UndoCommand extends BaseCommand {
|
|
34
34
|
this._undo(item.batch, undoingBatch);
|
35
35
|
const operations = this.editor.model.document.history.getOperations(item.batch.baseVersion);
|
36
36
|
this._restoreSelection(item.selection.ranges, item.selection.isBackward, operations);
|
37
|
-
this.fire('revert', item.batch, undoingBatch);
|
38
37
|
});
|
38
|
+
// Firing `revert` event after the change block to make sure that it includes all changes from post-fixers
|
39
|
+
// and make sure that the selection is "stabilized" (the selection range is saved after undo is executed and then
|
40
|
+
// restored on redo, so it is important that the selection range is saved after post-fixers are done).
|
41
|
+
this.fire('revert', item.batch, undoingBatch);
|
39
42
|
this.refresh();
|
40
43
|
}
|
41
44
|
}
|