@ckeditor/ckeditor5-undo 0.0.0-internal-20241017.0 → 0.0.0-internal-20241206.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 +7 -2
- package/README.md +21 -6
- package/dist/index.js +84 -89
- package/dist/index.js.map +1 -1
- package/dist/translations/af.d.ts +8 -0
- package/dist/translations/af.js +5 -0
- package/dist/translations/af.umd.js +11 -0
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/bs.d.ts +8 -0
- package/dist/translations/bs.js +5 -0
- package/dist/translations/bs.umd.js +11 -0
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/es-co.d.ts +8 -0
- package/dist/translations/es-co.js +5 -0
- package/dist/translations/es-co.umd.js +11 -0
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gu.d.ts +8 -0
- package/dist/translations/gu.js +5 -0
- package/dist/translations/gu.umd.js +11 -0
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hy.d.ts +8 -0
- package/dist/translations/hy.js +5 -0
- package/dist/translations/hy.umd.js +11 -0
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/jv.d.ts +8 -0
- package/dist/translations/jv.js +5 -0
- package/dist/translations/jv.umd.js +11 -0
- package/dist/translations/kk.d.ts +8 -0
- package/dist/translations/kk.js +5 -0
- package/dist/translations/kk.umd.js +11 -0
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/oc.d.ts +8 -0
- package/dist/translations/oc.js +5 -0
- package/dist/translations/oc.umd.js +11 -0
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.d.ts +8 -0
- package/dist/translations/sl.js +5 -0
- package/dist/translations/sl.umd.js +11 -0
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/lang/translations/af.po +20 -0
- package/lang/translations/ar.po +4 -10
- package/lang/translations/ast.po +3 -9
- package/lang/translations/az.po +3 -9
- package/lang/translations/bg.po +3 -9
- package/lang/translations/bn.po +3 -9
- package/lang/translations/bs.po +20 -0
- package/lang/translations/ca.po +3 -9
- package/lang/translations/cs.po +4 -10
- package/lang/translations/da.po +3 -9
- package/lang/translations/de-ch.po +3 -9
- package/lang/translations/de.po +3 -9
- package/lang/translations/el.po +3 -9
- package/lang/translations/en-au.po +3 -9
- package/lang/translations/en-gb.po +3 -9
- package/lang/translations/en.po +5 -11
- package/lang/translations/eo.po +3 -9
- package/lang/translations/es-co.po +20 -0
- package/lang/translations/es.po +4 -10
- package/lang/translations/et.po +3 -9
- package/lang/translations/eu.po +3 -9
- package/lang/translations/fa.po +4 -10
- package/lang/translations/fi.po +3 -9
- package/lang/translations/fr.po +4 -10
- package/lang/translations/gl.po +3 -9
- package/lang/translations/gu.po +20 -0
- package/lang/translations/he.po +4 -10
- package/lang/translations/hi.po +3 -9
- package/lang/translations/hr.po +4 -10
- package/lang/translations/hu.po +3 -9
- package/lang/translations/hy.po +20 -0
- package/lang/translations/id.po +3 -9
- package/lang/translations/it.po +4 -10
- package/lang/translations/ja.po +3 -9
- package/lang/translations/jv.po +20 -0
- package/lang/translations/kk.po +20 -0
- package/lang/translations/km.po +3 -9
- package/lang/translations/kn.po +4 -10
- package/lang/translations/ko.po +3 -9
- package/lang/translations/ku.po +3 -9
- package/lang/translations/lt.po +4 -10
- package/lang/translations/lv.po +4 -10
- package/lang/translations/ms.po +3 -9
- package/lang/translations/nb.po +3 -9
- package/lang/translations/ne.po +3 -9
- package/lang/translations/nl.po +3 -9
- package/lang/translations/no.po +3 -9
- package/lang/translations/oc.po +20 -0
- package/lang/translations/pl.po +4 -10
- package/lang/translations/pt-br.po +4 -10
- package/lang/translations/pt.po +4 -10
- package/lang/translations/ro.po +4 -10
- package/lang/translations/ru.po +4 -10
- package/lang/translations/si.po +3 -9
- package/lang/translations/sk.po +4 -10
- package/lang/translations/sl.po +20 -0
- package/lang/translations/sq.po +3 -9
- package/lang/translations/sr-latn.po +4 -10
- package/lang/translations/sr.po +4 -10
- package/lang/translations/sv.po +3 -9
- package/lang/translations/th.po +3 -9
- package/lang/translations/ti.po +3 -9
- package/lang/translations/tk.po +3 -9
- package/lang/translations/tr.po +3 -9
- package/lang/translations/tt.po +3 -9
- package/lang/translations/ug.po +4 -10
- package/lang/translations/uk.po +4 -10
- package/lang/translations/ur.po +3 -9
- package/lang/translations/uz.po +4 -10
- package/lang/translations/vi.po +3 -9
- package/lang/translations/zh-cn.po +3 -9
- package/lang/translations/zh.po +3 -9
- package/package.json +23 -6
- package/src/augmentation.d.ts +1 -1
- package/src/augmentation.js +1 -1
- package/src/basecommand.d.ts +1 -1
- package/src/basecommand.js +1 -1
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -1
- package/src/redocommand.d.ts +1 -1
- package/src/redocommand.js +1 -1
- package/src/undo.d.ts +1 -1
- package/src/undo.js +1 -1
- package/src/undocommand.d.ts +1 -1
- package/src/undocommand.js +1 -1
- package/src/undoediting.d.ts +1 -1
- package/src/undoediting.js +1 -1
- package/src/undoui.d.ts +1 -1
- package/src/undoui.js +1 -1
- package/dist/augmentation.d.ts +0 -20
- package/dist/basecommand.d.ts +0 -76
- package/dist/index.d.ts +0 -17
- package/dist/redocommand.d.ts +0 -31
- package/dist/undo.d.ts +0 -125
- package/dist/undocommand.d.ts +0 -41
- package/dist/undoediting.d.ts +0 -45
- package/dist/undoui.d.ts +0 -42
package/LICENSE.md
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
Software License Agreement
|
|
2
2
|
==========================
|
|
3
3
|
|
|
4
|
-
**CKEditor 5
|
|
4
|
+
**CKEditor 5 Undo feature** (https://github.com/ckeditor/ckeditor5)<br>
|
|
5
5
|
Copyright (c) 2003–2024, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
|
|
6
6
|
|
|
7
|
-
Licensed under
|
|
7
|
+
Licensed under a dual-license model, this software is available under:
|
|
8
|
+
|
|
9
|
+
* the [GNU General Public License Version 2 or later](https://www.gnu.org/licenses/gpl.html),
|
|
10
|
+
* or commercial license terms from CKSource Holding sp. z o.o.
|
|
11
|
+
|
|
12
|
+
For more information, see: [https://ckeditor.com/legal/ckeditor-licensing-options](https://ckeditor.com/legal/ckeditor-licensing-options).
|
|
8
13
|
|
|
9
14
|
Sources of Intellectual Property Included in CKEditor
|
|
10
15
|
-----------------------------------------------------
|
package/README.md
CHANGED
|
@@ -3,20 +3,35 @@ CKEditor 5 undo feature
|
|
|
3
3
|
|
|
4
4
|
[](https://www.npmjs.com/package/@ckeditor/ckeditor5-undo)
|
|
5
5
|
[](https://coveralls.io/github/ckeditor/ckeditor5?branch=master)
|
|
6
|
-
[](https://app.circleci.com/pipelines/github/ckeditor/ckeditor5?branch=master)
|
|
7
7
|
|
|
8
8
|
This package implements undo support for CKEditor 5.
|
|
9
9
|
|
|
10
|
-
## Documentation
|
|
11
|
-
|
|
12
|
-
See the [`@ckeditor/ckeditor5-undo` package](https://ckeditor.com/docs/ckeditor5/latest/api/undo.html) page in [CKEditor 5 documentation](https://ckeditor.com/docs/ckeditor5/latest/).
|
|
13
|
-
|
|
14
10
|
## Installation
|
|
15
11
|
|
|
12
|
+
This plugin is part of the `ckeditor5` package. Install the whole package to use it.
|
|
13
|
+
|
|
16
14
|
```bash
|
|
17
15
|
npm install ckeditor5
|
|
18
16
|
```
|
|
19
17
|
|
|
18
|
+
## Create free account
|
|
19
|
+
|
|
20
|
+
If you want to check full CKEditor 5 capabilities, sign up for a [free non-commitment 14-day trial](https://portal.ckeditor.com/checkout?plan=free).
|
|
21
|
+
|
|
22
|
+
## Demo
|
|
23
|
+
|
|
24
|
+
Check out the demo in the [undo/redo feature guide](https://ckeditor.com/docs/ckeditor5/latest/features/undo-redo.html#demo).
|
|
25
|
+
|
|
26
|
+
## Documentation
|
|
27
|
+
|
|
28
|
+
See the [`@ckeditor/ckeditor5-undo` package](https://ckeditor.com/docs/ckeditor5/latest/api/undo.html) page in [CKEditor 5 documentation](https://ckeditor.com/docs/ckeditor5/latest/).
|
|
29
|
+
|
|
20
30
|
## License
|
|
21
31
|
|
|
22
|
-
Licensed under
|
|
32
|
+
Licensed under a dual-license model, this software is available under:
|
|
33
|
+
|
|
34
|
+
* the [GNU General Public License Version 2 or later](https://www.gnu.org/licenses/gpl.html),
|
|
35
|
+
* or commercial license terms from CKSource Holding sp. z o.o.
|
|
36
|
+
|
|
37
|
+
For more information, see: [https://ckeditor.com/legal/ckeditor-licensing-options](https://ckeditor.com/legal/ckeditor-licensing-options).
|
package/dist/index.js
CHANGED
|
@@ -10,20 +10,20 @@ import { ButtonView, MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-u
|
|
|
10
10
|
* Base class for the undo feature commands: {@link module:undo/undocommand~UndoCommand} and {@link module:undo/redocommand~RedoCommand}.
|
|
11
11
|
*/ class BaseCommand extends Command {
|
|
12
12
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* * {@link module:engine/model/batch~Batch batch} saved by the command,
|
|
16
|
-
* * {@link module:engine/model/selection~Selection selection} state at the moment of saving the batch.
|
|
17
|
-
*/ _stack = [];
|
|
18
|
-
/**
|
|
19
|
-
* Stores all batches that were created by this command.
|
|
20
|
-
*
|
|
21
|
-
* @internal
|
|
22
|
-
*/ _createdBatches = new WeakSet();
|
|
23
|
-
/**
|
|
24
|
-
* @inheritDoc
|
|
25
|
-
*/ constructor(editor){
|
|
13
|
+
* @inheritDoc
|
|
14
|
+
*/ constructor(editor){
|
|
26
15
|
super(editor);
|
|
16
|
+
/**
|
|
17
|
+
* Stack of items stored by the command. These are pairs of:
|
|
18
|
+
*
|
|
19
|
+
* * {@link module:engine/model/batch~Batch batch} saved by the command,
|
|
20
|
+
* * {@link module:engine/model/selection~Selection selection} state at the moment of saving the batch.
|
|
21
|
+
*/ this._stack = [];
|
|
22
|
+
/**
|
|
23
|
+
* Stores all batches that were created by this command.
|
|
24
|
+
*
|
|
25
|
+
* @internal
|
|
26
|
+
*/ this._createdBatches = new WeakSet();
|
|
27
27
|
// Refresh state, so the command is inactive right after initialization.
|
|
28
28
|
this.refresh();
|
|
29
29
|
// This command should not depend on selection change.
|
|
@@ -57,21 +57,21 @@ import { ButtonView, MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-u
|
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
* @inheritDoc
|
|
61
|
+
*/ refresh() {
|
|
62
62
|
this.isEnabled = this._stack.length > 0;
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
* Returns all batches created by this command.
|
|
66
|
+
*/ get createdBatches() {
|
|
67
67
|
return this._createdBatches;
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
* Stores a batch in the command, together with the selection state of the {@link module:engine/model/document~Document document}
|
|
71
|
+
* created by the editor which this command is registered to.
|
|
72
|
+
*
|
|
73
|
+
* @param batch The batch to add.
|
|
74
|
+
*/ addBatch(batch) {
|
|
75
75
|
const docSelection = this.editor.model.document.selection;
|
|
76
76
|
const selection = {
|
|
77
77
|
ranges: docSelection.hasOwnRange ? Array.from(docSelection.getRanges()) : [],
|
|
@@ -84,18 +84,18 @@ import { ButtonView, MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-u
|
|
|
84
84
|
this.refresh();
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
* Removes all items from the stack.
|
|
88
|
+
*/ clearStack() {
|
|
89
89
|
this._stack = [];
|
|
90
90
|
this.refresh();
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
93
|
+
* Restores the {@link module:engine/model/document~Document#selection document selection} state after a batch was undone.
|
|
94
|
+
*
|
|
95
|
+
* @param ranges Ranges to be restored.
|
|
96
|
+
* @param isBackward A flag describing whether the restored range was selected forward or backward.
|
|
97
|
+
* @param operations Operations which has been applied since selection has been stored.
|
|
98
|
+
*/ _restoreSelection(ranges, isBackward, operations) {
|
|
99
99
|
const model = this.editor.model;
|
|
100
100
|
const document = model.document;
|
|
101
101
|
// This will keep the transformed selection ranges.
|
|
@@ -129,12 +129,12 @@ import { ButtonView, MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-u
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
/**
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
132
|
+
* Undoes a batch by reversing that batch, transforming reversed batch and finally applying it.
|
|
133
|
+
* This is a helper method for {@link #execute}.
|
|
134
|
+
*
|
|
135
|
+
* @param batchToUndo The batch to be undone.
|
|
136
|
+
* @param undoingBatch The batch that will contain undoing changes.
|
|
137
|
+
*/ _undo(batchToUndo, undoingBatch) {
|
|
138
138
|
const model = this.editor.model;
|
|
139
139
|
const document = model.document;
|
|
140
140
|
// All changes done by the command execution will be saved as one batch.
|
|
@@ -198,14 +198,14 @@ function isRangeContainedByAnyOtherRange(range, ranges) {
|
|
|
198
198
|
* The undo command also takes care of restoring the {@link module:engine/model/document~Document#selection document selection}.
|
|
199
199
|
*/ class UndoCommand extends BaseCommand {
|
|
200
200
|
/**
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
201
|
+
* Executes the command. This method reverts a {@link module:engine/model/batch~Batch batch} added to the command's stack, transforms
|
|
202
|
+
* and applies the reverted version on the {@link module:engine/model/document~Document document} and removes the batch from the stack.
|
|
203
|
+
* Then, it restores the {@link module:engine/model/document~Document#selection document selection}.
|
|
204
|
+
*
|
|
205
|
+
* @fires execute
|
|
206
|
+
* @fires revert
|
|
207
|
+
* @param batch A batch that should be undone. If not set, the last added batch will be undone.
|
|
208
|
+
*/ execute(batch = null) {
|
|
209
209
|
// If batch is not given, set `batchIndex` to the last index in command stack.
|
|
210
210
|
const batchIndex = batch ? this._stack.findIndex((a)=>a.batch == batch) : this._stack.length - 1;
|
|
211
211
|
const item = this._stack.splice(batchIndex, 1)[0];
|
|
@@ -236,13 +236,13 @@ function isRangeContainedByAnyOtherRange(range, ranges) {
|
|
|
236
236
|
* The redo command also takes care of restoring the {@link module:engine/model/document~Document#selection document selection}.
|
|
237
237
|
*/ class RedoCommand extends BaseCommand {
|
|
238
238
|
/**
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
239
|
+
* Executes the command. This method reverts the last {@link module:engine/model/batch~Batch batch} added to
|
|
240
|
+
* the command's stack, applies the reverted and transformed version on the
|
|
241
|
+
* {@link module:engine/model/document~Document document} and removes the batch from the stack.
|
|
242
|
+
* Then, it restores the {@link module:engine/model/document~Document#selection document selection}.
|
|
243
|
+
*
|
|
244
|
+
* @fires execute
|
|
245
|
+
*/ execute() {
|
|
246
246
|
const item = this._stack.pop();
|
|
247
247
|
const redoingBatch = this.editor.model.createBatch({
|
|
248
248
|
isUndo: true
|
|
@@ -265,30 +265,25 @@ function isRangeContainedByAnyOtherRange(range, ranges) {
|
|
|
265
265
|
*
|
|
266
266
|
* It introduces the `'undo'` and `'redo'` commands to the editor.
|
|
267
267
|
*/ class UndoEditing extends Plugin {
|
|
268
|
+
constructor(){
|
|
269
|
+
super(...arguments);
|
|
270
|
+
/**
|
|
271
|
+
* Keeps track of which batches were registered in undo.
|
|
272
|
+
*/ this._batchRegistry = new WeakSet();
|
|
273
|
+
}
|
|
268
274
|
/**
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
*/ _undoCommand;
|
|
272
|
-
/**
|
|
273
|
-
* The command that manages the redo {@link module:engine/model/batch~Batch batches} stack (history).
|
|
274
|
-
* Created and registered during the {@link #init feature initialization}.
|
|
275
|
-
*/ _redoCommand;
|
|
276
|
-
/**
|
|
277
|
-
* Keeps track of which batches were registered in undo.
|
|
278
|
-
*/ _batchRegistry = new WeakSet();
|
|
279
|
-
/**
|
|
280
|
-
* @inheritDoc
|
|
281
|
-
*/ static get pluginName() {
|
|
275
|
+
* @inheritDoc
|
|
276
|
+
*/ static get pluginName() {
|
|
282
277
|
return 'UndoEditing';
|
|
283
278
|
}
|
|
284
279
|
/**
|
|
285
|
-
|
|
286
|
-
|
|
280
|
+
* @inheritDoc
|
|
281
|
+
*/ static get isOfficialPlugin() {
|
|
287
282
|
return true;
|
|
288
283
|
}
|
|
289
284
|
/**
|
|
290
|
-
|
|
291
|
-
|
|
285
|
+
* @inheritDoc
|
|
286
|
+
*/ init() {
|
|
292
287
|
const editor = this.editor;
|
|
293
288
|
const t = editor.t;
|
|
294
289
|
// Create commands.
|
|
@@ -365,18 +360,18 @@ function isRangeContainedByAnyOtherRange(range, ranges) {
|
|
|
365
360
|
* The undo UI feature. It introduces the `'undo'` and `'redo'` buttons to the editor.
|
|
366
361
|
*/ class UndoUI extends Plugin {
|
|
367
362
|
/**
|
|
368
|
-
|
|
369
|
-
|
|
363
|
+
* @inheritDoc
|
|
364
|
+
*/ static get pluginName() {
|
|
370
365
|
return 'UndoUI';
|
|
371
366
|
}
|
|
372
367
|
/**
|
|
373
|
-
|
|
374
|
-
|
|
368
|
+
* @inheritDoc
|
|
369
|
+
*/ static get isOfficialPlugin() {
|
|
375
370
|
return true;
|
|
376
371
|
}
|
|
377
372
|
/**
|
|
378
|
-
|
|
379
|
-
|
|
373
|
+
* @inheritDoc
|
|
374
|
+
*/ init() {
|
|
380
375
|
const editor = this.editor;
|
|
381
376
|
const locale = editor.locale;
|
|
382
377
|
const t = editor.t;
|
|
@@ -386,13 +381,13 @@ function isRangeContainedByAnyOtherRange(range, ranges) {
|
|
|
386
381
|
this._addButtonsToFactory('redo', t('Redo'), 'CTRL+Y', localizedRedoIcon);
|
|
387
382
|
}
|
|
388
383
|
/**
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
384
|
+
* Creates a button for the specified command.
|
|
385
|
+
*
|
|
386
|
+
* @param name Command name.
|
|
387
|
+
* @param label Button label.
|
|
388
|
+
* @param keystroke Command keystroke.
|
|
389
|
+
* @param Icon Source of the icon.
|
|
390
|
+
*/ _addButtonsToFactory(name, label, keystroke, Icon) {
|
|
396
391
|
const editor = this.editor;
|
|
397
392
|
editor.ui.componentFactory.add(name, ()=>{
|
|
398
393
|
const buttonView = this._createButton(ButtonView, name, label, keystroke, Icon);
|
|
@@ -406,8 +401,8 @@ function isRangeContainedByAnyOtherRange(range, ranges) {
|
|
|
406
401
|
});
|
|
407
402
|
}
|
|
408
403
|
/**
|
|
409
|
-
|
|
410
|
-
|
|
404
|
+
* TODO
|
|
405
|
+
*/ _createButton(ButtonClass, name, label, keystroke, Icon) {
|
|
411
406
|
const editor = this.editor;
|
|
412
407
|
const locale = editor.locale;
|
|
413
408
|
const command = editor.commands.get(name);
|
|
@@ -524,21 +519,21 @@ function isRangeContainedByAnyOtherRange(range, ranges) {
|
|
|
524
519
|
* ```
|
|
525
520
|
*/ class Undo extends Plugin {
|
|
526
521
|
/**
|
|
527
|
-
|
|
528
|
-
|
|
522
|
+
* @inheritDoc
|
|
523
|
+
*/ static get requires() {
|
|
529
524
|
return [
|
|
530
525
|
UndoEditing,
|
|
531
526
|
UndoUI
|
|
532
527
|
];
|
|
533
528
|
}
|
|
534
529
|
/**
|
|
535
|
-
|
|
536
|
-
|
|
530
|
+
* @inheritDoc
|
|
531
|
+
*/ static get pluginName() {
|
|
537
532
|
return 'Undo';
|
|
538
533
|
}
|
|
539
534
|
/**
|
|
540
|
-
|
|
541
|
-
|
|
535
|
+
* @inheritDoc
|
|
536
|
+
*/ static get isOfficialPlugin() {
|
|
542
537
|
return true;
|
|
543
538
|
}
|
|
544
539
|
}
|