@ckeditor/ckeditor5-undo 31.0.0 → 33.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/LICENSE.md +2 -2
- package/lang/translations/ar.po +1 -1
- package/lang/translations/ast.po +1 -1
- package/lang/translations/az.po +1 -1
- package/lang/translations/bg.po +1 -1
- package/lang/translations/cs.po +1 -1
- package/lang/translations/da.po +1 -1
- package/lang/translations/de-ch.po +1 -1
- package/lang/translations/de.po +1 -1
- package/lang/translations/el.po +1 -1
- package/lang/translations/en-au.po +1 -1
- package/lang/translations/en-gb.po +1 -1
- package/lang/translations/en.po +1 -1
- package/lang/translations/eo.po +1 -1
- package/lang/translations/es.po +1 -1
- package/lang/translations/et.po +1 -1
- package/lang/translations/eu.po +1 -1
- package/lang/translations/fa.po +1 -1
- package/lang/translations/fi.po +1 -1
- package/lang/translations/fr.po +1 -1
- package/lang/translations/gl.po +1 -1
- package/lang/translations/he.po +1 -1
- package/lang/translations/hi.po +1 -1
- package/lang/translations/hr.po +1 -1
- package/lang/translations/hu.po +1 -1
- package/lang/translations/id.po +1 -1
- package/lang/translations/it.po +1 -1
- package/lang/translations/ja.po +1 -1
- package/lang/translations/km.po +1 -1
- package/lang/translations/kn.po +1 -1
- package/lang/translations/ko.po +1 -1
- package/lang/translations/ku.po +1 -1
- package/lang/translations/lt.po +1 -1
- package/lang/translations/lv.po +1 -1
- package/lang/translations/nb.po +1 -1
- package/lang/translations/ne.po +1 -1
- package/lang/translations/nl.po +1 -1
- package/lang/translations/no.po +1 -1
- package/lang/translations/pl.po +1 -1
- package/lang/translations/pt-br.po +1 -1
- package/lang/translations/pt.po +1 -1
- package/lang/translations/ro.po +1 -1
- package/lang/translations/ru.po +1 -1
- package/lang/translations/si.po +1 -1
- package/lang/translations/sk.po +1 -1
- package/lang/translations/sq.po +1 -1
- package/lang/translations/sr-latn.po +1 -1
- package/lang/translations/sr.po +1 -1
- package/lang/translations/sv.po +1 -1
- package/lang/translations/th.po +1 -1
- package/lang/translations/tk.po +1 -1
- package/lang/translations/tr.po +1 -1
- package/lang/translations/tt.po +1 -1
- package/lang/translations/ug.po +1 -1
- package/lang/translations/uk.po +1 -1
- package/lang/translations/uz.po +25 -0
- package/lang/translations/vi.po +1 -1
- package/lang/translations/zh-cn.po +1 -1
- package/lang/translations/zh.po +1 -1
- package/package.json +14 -14
- package/src/basecommand.js +7 -8
- package/src/index.js +1 -1
- package/src/redocommand.js +2 -2
- package/src/undo.js +1 -1
- package/src/undocommand.js +2 -2
- package/src/undoediting.js +18 -14
- package/src/undoui.js +1 -1
package/LICENSE.md
CHANGED
|
@@ -2,7 +2,7 @@ Software License Agreement
|
|
|
2
2
|
==========================
|
|
3
3
|
|
|
4
4
|
**CKEditor 5 undo feature** – https://github.com/ckeditor/ckeditor5-undo <br>
|
|
5
|
-
Copyright (c) 2003-
|
|
5
|
+
Copyright (c) 2003-2022, [CKSource](http://cksource.com) Holding sp. z o.o. 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).
|
|
8
8
|
|
|
@@ -14,4 +14,4 @@ Where not otherwise indicated, all CKEditor content is authored by CKSource engi
|
|
|
14
14
|
Trademarks
|
|
15
15
|
----------
|
|
16
16
|
|
|
17
|
-
**CKEditor** is a trademark of [CKSource](http://cksource.com)
|
|
17
|
+
**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.
|
package/lang/translations/ar.po
CHANGED
package/lang/translations/ast.po
CHANGED
package/lang/translations/az.po
CHANGED
package/lang/translations/bg.po
CHANGED
package/lang/translations/cs.po
CHANGED
package/lang/translations/da.po
CHANGED
package/lang/translations/de.po
CHANGED
package/lang/translations/el.po
CHANGED
package/lang/translations/en.po
CHANGED
package/lang/translations/eo.po
CHANGED
package/lang/translations/es.po
CHANGED
package/lang/translations/et.po
CHANGED
package/lang/translations/eu.po
CHANGED
package/lang/translations/fa.po
CHANGED
package/lang/translations/fi.po
CHANGED
package/lang/translations/fr.po
CHANGED
package/lang/translations/gl.po
CHANGED
package/lang/translations/he.po
CHANGED
package/lang/translations/hi.po
CHANGED
package/lang/translations/hr.po
CHANGED
package/lang/translations/hu.po
CHANGED
package/lang/translations/id.po
CHANGED
package/lang/translations/it.po
CHANGED
package/lang/translations/ja.po
CHANGED
package/lang/translations/km.po
CHANGED
package/lang/translations/kn.po
CHANGED
package/lang/translations/ko.po
CHANGED
package/lang/translations/ku.po
CHANGED
package/lang/translations/lt.po
CHANGED
package/lang/translations/lv.po
CHANGED
package/lang/translations/nb.po
CHANGED
package/lang/translations/ne.po
CHANGED
package/lang/translations/nl.po
CHANGED
package/lang/translations/no.po
CHANGED
package/lang/translations/pl.po
CHANGED
package/lang/translations/pt.po
CHANGED
package/lang/translations/ro.po
CHANGED
package/lang/translations/ru.po
CHANGED
package/lang/translations/si.po
CHANGED
package/lang/translations/sk.po
CHANGED
package/lang/translations/sq.po
CHANGED
package/lang/translations/sr.po
CHANGED
package/lang/translations/sv.po
CHANGED
package/lang/translations/th.po
CHANGED
package/lang/translations/tk.po
CHANGED
package/lang/translations/tr.po
CHANGED
package/lang/translations/tt.po
CHANGED
package/lang/translations/ug.po
CHANGED
package/lang/translations/uk.po
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
2
|
+
#
|
|
3
|
+
# !!! IMPORTANT !!!
|
|
4
|
+
#
|
|
5
|
+
# Before you edit this file, please keep in mind that contributing to the project
|
|
6
|
+
# translations is possible ONLY via the Transifex online service.
|
|
7
|
+
#
|
|
8
|
+
# To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
|
|
9
|
+
#
|
|
10
|
+
# To learn more, check out the official contributor's guide:
|
|
11
|
+
# https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
|
|
12
|
+
#
|
|
13
|
+
msgid ""
|
|
14
|
+
msgstr ""
|
|
15
|
+
"Language-Team: Uzbek (https://www.transifex.com/ckeditor/teams/11143/uz/)\n"
|
|
16
|
+
"Language: uz\n"
|
|
17
|
+
"Plural-Forms: nplurals=1; plural=0;\n"
|
|
18
|
+
|
|
19
|
+
msgctxt "Toolbar button tooltip for the Undo feature."
|
|
20
|
+
msgid "Undo"
|
|
21
|
+
msgstr "Bekor qilish"
|
|
22
|
+
|
|
23
|
+
msgctxt "Toolbar button tooltip for the Redo feature."
|
|
24
|
+
msgid "Redo"
|
|
25
|
+
msgstr "Takrorlash"
|
package/lang/translations/vi.po
CHANGED
package/lang/translations/zh.po
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-undo",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "33.0.0",
|
|
4
4
|
"description": "Undo feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -12,23 +12,23 @@
|
|
|
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": "^33.0.0",
|
|
16
|
+
"@ckeditor/ckeditor5-engine": "^33.0.0",
|
|
17
|
+
"@ckeditor/ckeditor5-ui": "^33.0.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": "^33.0.0",
|
|
21
|
+
"@ckeditor/ckeditor5-clipboard": "^33.0.0",
|
|
22
|
+
"@ckeditor/ckeditor5-editor-classic": "^33.0.0",
|
|
23
|
+
"@ckeditor/ckeditor5-enter": "^33.0.0",
|
|
24
|
+
"@ckeditor/ckeditor5-heading": "^33.0.0",
|
|
25
|
+
"@ckeditor/ckeditor5-paragraph": "^33.0.0",
|
|
26
|
+
"@ckeditor/ckeditor5-typing": "^33.0.0",
|
|
27
|
+
"@ckeditor/ckeditor5-table": "^33.0.0",
|
|
28
|
+
"@ckeditor/ckeditor5-utils": "^33.0.0"
|
|
29
29
|
},
|
|
30
30
|
"engines": {
|
|
31
|
-
"node": ">=
|
|
31
|
+
"node": ">=14.0.0",
|
|
32
32
|
"npm": ">=5.7.1"
|
|
33
33
|
},
|
|
34
34
|
"author": "CKSource (http://cksource.com/)",
|
package/src/basecommand.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2022, 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
5
|
|
|
@@ -51,20 +51,19 @@ export default class BaseCommand extends Command {
|
|
|
51
51
|
|
|
52
52
|
const options = data[ 1 ];
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
// If batch type is not set, default to non-undoable batch.
|
|
55
|
+
if ( !options.batchType ) {
|
|
56
|
+
options.batchType = { isUndoable: false };
|
|
56
57
|
}
|
|
57
|
-
|
|
58
|
-
options.batchType = 'transparent';
|
|
59
58
|
}, { priority: 'high' } );
|
|
60
59
|
|
|
61
60
|
// Clear the stack for the `transparent` batches.
|
|
62
61
|
this.listenTo( editor.data, 'set', ( evt, data ) => {
|
|
63
|
-
// We can assume that the object exists
|
|
64
|
-
// with
|
|
62
|
+
// We can assume that the object exists and it has a `batchType` property.
|
|
63
|
+
// It was ensured with a higher priority listener before.
|
|
65
64
|
const options = data[ 1 ];
|
|
66
65
|
|
|
67
|
-
if ( options.batchType
|
|
66
|
+
if ( !options.batchType.isUndoable ) {
|
|
68
67
|
this.clearStack();
|
|
69
68
|
}
|
|
70
69
|
} );
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2022, 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
5
|
|
package/src/redocommand.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2022, 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
5
|
|
|
@@ -30,7 +30,7 @@ export default class RedoCommand extends BaseCommand {
|
|
|
30
30
|
*/
|
|
31
31
|
execute() {
|
|
32
32
|
const item = this._stack.pop();
|
|
33
|
-
const redoingBatch = this.editor.model.createBatch(
|
|
33
|
+
const redoingBatch = this.editor.model.createBatch( { isUndo: true } );
|
|
34
34
|
|
|
35
35
|
// All changes have to be done in one `enqueueChange` callback so other listeners will not step between consecutive
|
|
36
36
|
// operations, or won't do changes to the document before selection is properly restored.
|
package/src/undo.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2022, 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
5
|
|
package/src/undocommand.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2022, 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
5
|
|
|
@@ -33,7 +33,7 @@ export default class UndoCommand extends BaseCommand {
|
|
|
33
33
|
const batchIndex = batch ? this._stack.findIndex( a => a.batch == batch ) : this._stack.length - 1;
|
|
34
34
|
|
|
35
35
|
const item = this._stack.splice( batchIndex, 1 )[ 0 ];
|
|
36
|
-
const undoingBatch = this.editor.model.createBatch(
|
|
36
|
+
const undoingBatch = this.editor.model.createBatch( { isUndo: true } );
|
|
37
37
|
|
|
38
38
|
// All changes has to be done in one `enqueueChange` callback so other listeners will not
|
|
39
39
|
// step between consecutive operations, or won't do changes to the document before selection is properly restored.
|
package/src/undoediting.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2022, 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
5
|
|
|
@@ -87,25 +87,29 @@ export default class UndoEditing extends Plugin {
|
|
|
87
87
|
|
|
88
88
|
const isRedoBatch = this._redoCommand._createdBatches.has( batch );
|
|
89
89
|
const isUndoBatch = this._undoCommand._createdBatches.has( batch );
|
|
90
|
-
const
|
|
90
|
+
const wasProcessed = this._batchRegistry.has( batch );
|
|
91
91
|
|
|
92
|
-
//
|
|
93
|
-
if (
|
|
92
|
+
// Skip the batch if it was already processed.
|
|
93
|
+
if ( wasProcessed ) {
|
|
94
94
|
return;
|
|
95
|
-
} else {
|
|
96
|
-
if ( isRedoBatch ) {
|
|
97
|
-
// If this batch comes from `redoCommand`, add it to `undoCommand` stack.
|
|
98
|
-
this._undoCommand.addBatch( batch );
|
|
99
|
-
} else if ( !isUndoBatch ) {
|
|
100
|
-
// A default batch - these are new changes in the document, not introduced by undo feature.
|
|
101
|
-
// Add them to `undoCommand` stack and clear `redoCommand` stack.
|
|
102
|
-
this._undoCommand.addBatch( batch );
|
|
103
|
-
this._redoCommand.clearStack();
|
|
104
|
-
}
|
|
105
95
|
}
|
|
106
96
|
|
|
107
97
|
// Add the batch to the registry so it will not be processed again.
|
|
108
98
|
this._batchRegistry.add( batch );
|
|
99
|
+
|
|
100
|
+
if ( !batch.isUndoable ) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if ( isRedoBatch ) {
|
|
105
|
+
// If this batch comes from `redoCommand`, add it to the `undoCommand` stack.
|
|
106
|
+
this._undoCommand.addBatch( batch );
|
|
107
|
+
} else if ( !isUndoBatch ) {
|
|
108
|
+
// If the batch comes neither from `redoCommand` nor from `undoCommand` then it is a new, regular batch.
|
|
109
|
+
// Add the batch to the `undoCommand` stack and clear the `redoCommand` stack.
|
|
110
|
+
this._undoCommand.addBatch( batch );
|
|
111
|
+
this._redoCommand.clearStack();
|
|
112
|
+
}
|
|
109
113
|
}, { priority: 'highest' } );
|
|
110
114
|
|
|
111
115
|
this.listenTo( this._undoCommand, 'revert', ( evt, undoneBatch, undoingBatch ) => {
|
package/src/undoui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2022, 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
5
|
|