@ckeditor/ckeditor5-undo 38.2.0-alpha.1 → 39.0.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/README.md CHANGED
@@ -4,7 +4,6 @@ CKEditor 5 undo feature
4
4
  [![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-undo.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-undo)
5
5
  [![Coverage Status](https://coveralls.io/repos/github/ckeditor/ckeditor5/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5?branch=master)
6
6
  [![Build Status](https://travis-ci.com/ckeditor/ckeditor5.svg?branch=master)](https://app.travis-ci.com/github/ckeditor/ckeditor5)
7
- ![Dependency Status](https://img.shields.io/librariesio/release/npm/@ckeditor/ckeditor5-undo)
8
7
 
9
8
  This package implements undo support for CKEditor 5.
10
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-undo",
3
- "version": "38.2.0-alpha.1",
3
+ "version": "39.0.0",
4
4
  "description": "Undo feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -11,11 +11,10 @@
11
11
  "ckeditor5-dll"
12
12
  ],
13
13
  "main": "src/index.js",
14
- "type": "module",
15
14
  "dependencies": {
16
- "@ckeditor/ckeditor5-core": "38.2.0-alpha.1",
17
- "@ckeditor/ckeditor5-engine": "38.2.0-alpha.1",
18
- "@ckeditor/ckeditor5-ui": "38.2.0-alpha.1"
15
+ "@ckeditor/ckeditor5-core": "39.0.0",
16
+ "@ckeditor/ckeditor5-engine": "39.0.0",
17
+ "@ckeditor/ckeditor5-ui": "39.0.0"
19
18
  },
20
19
  "engines": {
21
20
  "node": ">=16.0.0",
@@ -2,7 +2,7 @@
2
2
  * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- import type { Undo, UndoEditing, UndoUI, UndoCommand, RedoCommand } from './index.js';
5
+ import type { Undo, UndoEditing, UndoUI, UndoCommand, RedoCommand } from './index';
6
6
  declare module '@ckeditor/ckeditor5-core' {
7
7
  interface CommandsMap {
8
8
  undo: UndoCommand;
package/src/index.d.ts CHANGED
@@ -5,9 +5,9 @@
5
5
  /**
6
6
  * @module undo
7
7
  */
8
- export { default as Undo } from './undo.js';
9
- export { default as UndoEditing } from './undoediting.js';
10
- export { default as UndoUI } from './undoui.js';
11
- export type { default as UndoCommand } from './undocommand.js';
12
- export type { default as RedoCommand } from './redocommand.js';
13
- import './augmentation.js';
8
+ export { default as Undo } from './undo';
9
+ export { default as UndoEditing } from './undoediting';
10
+ export { default as UndoUI } from './undoui';
11
+ export type { default as UndoCommand } from './undocommand';
12
+ export type { default as RedoCommand } from './redocommand';
13
+ import './augmentation';
package/src/index.js CHANGED
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * @module undo
7
7
  */
8
- export { default as Undo } from './undo.js';
9
- export { default as UndoEditing } from './undoediting.js';
10
- export { default as UndoUI } from './undoui.js';
11
- import './augmentation.js';
8
+ export { default as Undo } from './undo';
9
+ export { default as UndoEditing } from './undoediting';
10
+ export { default as UndoUI } from './undoui';
11
+ import './augmentation';
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * @module undo/redocommand
7
7
  */
8
- import BaseCommand from './basecommand.js';
8
+ import BaseCommand from './basecommand';
9
9
  /**
10
10
  * The redo command stores {@link module:engine/model/batch~Batch batches} that were used to undo a batch by
11
11
  * {@link module:undo/undocommand~UndoCommand}. It is able to redo a previously undone batch by reversing the undoing
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * @module undo/redocommand
7
7
  */
8
- import BaseCommand from './basecommand.js';
8
+ import BaseCommand from './basecommand';
9
9
  /**
10
10
  * The redo command stores {@link module:engine/model/batch~Batch batches} that were used to undo a batch by
11
11
  * {@link module:undo/undocommand~UndoCommand}. It is able to redo a previously undone batch by reversing the undoing
package/src/undo.d.ts CHANGED
@@ -6,8 +6,8 @@
6
6
  * @module undo/undo
7
7
  */
8
8
  import { Plugin } from '@ckeditor/ckeditor5-core';
9
- import UndoEditing from './undoediting.js';
10
- import UndoUI from './undoui.js';
9
+ import UndoEditing from './undoediting';
10
+ import UndoUI from './undoui';
11
11
  /**
12
12
  * The undo feature.
13
13
  *
package/src/undo.js CHANGED
@@ -6,8 +6,8 @@
6
6
  * @module undo/undo
7
7
  */
8
8
  import { Plugin } from '@ckeditor/ckeditor5-core';
9
- import UndoEditing from './undoediting.js';
10
- import UndoUI from './undoui.js';
9
+ import UndoEditing from './undoediting';
10
+ import UndoUI from './undoui';
11
11
  /**
12
12
  * The undo feature.
13
13
  *
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * @module undo/undocommand
7
7
  */
8
- import BaseCommand from './basecommand.js';
8
+ import BaseCommand from './basecommand';
9
9
  import type { Batch } from '@ckeditor/ckeditor5-engine';
10
10
  /**
11
11
  * The undo command stores {@link module:engine/model/batch~Batch batches} applied to the
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * @module undo/undocommand
7
7
  */
8
- import BaseCommand from './basecommand.js';
8
+ import BaseCommand from './basecommand';
9
9
  /**
10
10
  * The undo command stores {@link module:engine/model/batch~Batch batches} applied to the
11
11
  * {@link module:engine/model/document~Document document} and is able to undo a batch by reversing it and transforming by
@@ -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
  }
@@ -6,8 +6,8 @@
6
6
  * @module undo/undoediting
7
7
  */
8
8
  import { Plugin } from '@ckeditor/ckeditor5-core';
9
- import UndoCommand from './undocommand.js';
10
- import RedoCommand from './redocommand.js';
9
+ import UndoCommand from './undocommand';
10
+ import RedoCommand from './redocommand';
11
11
  /**
12
12
  * The undo engine feature.
13
13
  *