@ckeditor/ckeditor5-clipboard 35.4.0 → 36.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 CHANGED
@@ -2,7 +2,7 @@ Software License Agreement
2
2
  ==========================
3
3
 
4
4
  **CKEditor 5 clipboard feature** – https://github.com/ckeditor/ckeditor5-clipboard <br>
5
- Copyright (c) 2003-2022, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
5
+ Copyright (c) 2003-2023, [CKSource Holding sp. z o.o.](https://cksource.com) 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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-clipboard",
3
- "version": "35.4.0",
3
+ "version": "36.0.0",
4
4
  "description": "Clipboard integration feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -12,30 +12,30 @@
12
12
  ],
13
13
  "main": "src/index.js",
14
14
  "dependencies": {
15
- "@ckeditor/ckeditor5-core": "^35.4.0",
16
- "@ckeditor/ckeditor5-engine": "^35.4.0",
17
- "@ckeditor/ckeditor5-utils": "^35.4.0",
18
- "@ckeditor/ckeditor5-widget": "^35.4.0",
15
+ "@ckeditor/ckeditor5-core": "^36.0.0",
16
+ "@ckeditor/ckeditor5-engine": "^36.0.0",
17
+ "@ckeditor/ckeditor5-utils": "^36.0.0",
18
+ "@ckeditor/ckeditor5-widget": "^36.0.0",
19
19
  "lodash-es": "^4.17.11"
20
20
  },
21
21
  "devDependencies": {
22
- "@ckeditor/ckeditor5-alignment": "^35.4.0",
23
- "@ckeditor/ckeditor5-basic-styles": "^35.4.0",
24
- "@ckeditor/ckeditor5-block-quote": "^35.4.0",
25
- "@ckeditor/ckeditor5-cloud-services": "^35.4.0",
26
- "@ckeditor/ckeditor5-code-block": "^35.4.0",
27
- "@ckeditor/ckeditor5-easy-image": "^35.4.0",
28
- "@ckeditor/ckeditor5-editor-classic": "^35.4.0",
29
- "@ckeditor/ckeditor5-enter": "^35.4.0",
30
- "@ckeditor/ckeditor5-horizontal-line": "^35.4.0",
31
- "@ckeditor/ckeditor5-image": "^35.4.0",
32
- "@ckeditor/ckeditor5-link": "^35.4.0",
33
- "@ckeditor/ckeditor5-page-break": "^35.4.0",
34
- "@ckeditor/ckeditor5-paragraph": "^35.4.0",
35
- "@ckeditor/ckeditor5-paste-from-office": "^35.4.0",
36
- "@ckeditor/ckeditor5-remove-format": "^35.4.0",
37
- "@ckeditor/ckeditor5-table": "^35.4.0",
38
- "@ckeditor/ckeditor5-typing": "^35.4.0",
22
+ "@ckeditor/ckeditor5-alignment": "^36.0.0",
23
+ "@ckeditor/ckeditor5-basic-styles": "^36.0.0",
24
+ "@ckeditor/ckeditor5-block-quote": "^36.0.0",
25
+ "@ckeditor/ckeditor5-cloud-services": "^36.0.0",
26
+ "@ckeditor/ckeditor5-code-block": "^36.0.0",
27
+ "@ckeditor/ckeditor5-easy-image": "^36.0.0",
28
+ "@ckeditor/ckeditor5-editor-classic": "^36.0.0",
29
+ "@ckeditor/ckeditor5-enter": "^36.0.0",
30
+ "@ckeditor/ckeditor5-horizontal-line": "^36.0.0",
31
+ "@ckeditor/ckeditor5-image": "^36.0.0",
32
+ "@ckeditor/ckeditor5-link": "^36.0.0",
33
+ "@ckeditor/ckeditor5-page-break": "^36.0.0",
34
+ "@ckeditor/ckeditor5-paragraph": "^36.0.0",
35
+ "@ckeditor/ckeditor5-paste-from-office": "^36.0.0",
36
+ "@ckeditor/ckeditor5-remove-format": "^36.0.0",
37
+ "@ckeditor/ckeditor5-table": "^36.0.0",
38
+ "@ckeditor/ckeditor5-typing": "^36.0.0",
39
39
  "typescript": "^4.8.4",
40
40
  "webpack": "^5.58.1",
41
41
  "webpack-cli": "^4.9.0"
package/src/clipboard.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
@@ -18,8 +18,6 @@ import PastePlainText from './pasteplaintext';
18
18
  * * {@link module:clipboard/clipboardpipeline~ClipboardPipeline}
19
19
  * * {@link module:clipboard/dragdrop~DragDrop}
20
20
  * * {@link module:clipboard/pasteplaintext~PastePlainText}
21
- *
22
- * @extends module:core/plugin~Plugin
23
21
  */
24
22
  export default class Clipboard extends Plugin {
25
23
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
@@ -28,8 +28,6 @@ import { DataTransfer, DomEventObserver } from '@ckeditor/ckeditor5-engine';
28
28
  * To make it available, it needs to be added to {@link module:engine/view/document~Document} by using
29
29
  * the {@link module:engine/view/view~View#addObserver `View#addObserver()`} method. Alternatively, you can load the
30
30
  * {@link module:clipboard/clipboard~Clipboard} plugin which adds this observer automatically (because it uses it).
31
- *
32
- * @extends module:engine/view/observer/domeventobserver~DomEventObserver
33
31
  */
34
32
  export default class ClipboardObserver extends DomEventObserver {
35
33
  constructor(view) {
@@ -89,193 +87,3 @@ function getDropViewRange(view, domEvent) {
89
87
  }
90
88
  return null;
91
89
  }
92
- /**
93
- * Fired as a continuation of the {@link #event:paste} and {@link #event:drop} events.
94
- *
95
- * It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
96
- *
97
- * This event carries a `dataTransfer` object which comes from the clipboard and whose content should be processed
98
- * and inserted into the editor.
99
- *
100
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
101
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
102
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
103
- * the observer must be added manually.
104
- *
105
- * @see module:clipboard/clipboardobserver~ClipboardObserver
106
- * @see module:clipboard/clipboard~Clipboard
107
- * @event module:engine/view/document~Document#event:clipboardInput
108
- * @param {Object} data The event data.
109
- * @param {module:engine/view/datatransfer~DataTransfer} data.dataTransfer Data transfer instance.
110
- * @param {'paste'|'drop'} method Whether the event was triggered by a paste or drop operation.
111
- * @param {module:engine/view/element~Element} target The tree view element representing the target.
112
- * @param {Array.<module:engine/view/range~Range>} data.targetRanges Ranges which are the target of the operation
113
- * (usually – into which the content should be inserted).
114
- * If the clipboard input was triggered by a paste operation, this property is not set. If by a drop operation,
115
- * then it is the drop position (which can be different than the selection at the moment of drop).
116
- */
117
- /**
118
- * Fired when the user drags the content over one of the editing roots of the editor.
119
- *
120
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
121
- *
122
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
123
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
124
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
125
- * the observer must be added manually.
126
- *
127
- * @see module:engine/view/document~Document#event:clipboardInput
128
- * @event module:engine/view/document~Document#event:dragover
129
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
130
- */
131
- /**
132
- * Fired when the user dropped the content into one of the editing roots of the editor.
133
- *
134
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
135
- *
136
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
137
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
138
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
139
- * the observer must be added manually.
140
- *
141
- * @see module:engine/view/document~Document#event:clipboardInput
142
- * @event module:engine/view/document~Document#event:drop
143
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
144
- * @param {module:engine/view/range~Range} dropRange The position into which the content is dropped.
145
- */
146
- /**
147
- * Fired when the user pasted the content into one of the editing roots of the editor.
148
- *
149
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
150
- *
151
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
152
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
153
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
154
- * the observer must be added manually.
155
- *
156
- * @see module:engine/view/document~Document#event:clipboardInput
157
- * @event module:engine/view/document~Document#event:paste
158
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
159
- */
160
- /**
161
- * Fired when the user copied the content from one of the editing roots of the editor.
162
- *
163
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
164
- *
165
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
166
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
167
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
168
- * the observer must be added manually.
169
- *
170
- * @see module:clipboard/clipboardobserver~ClipboardObserver
171
- * @event module:engine/view/document~Document#event:copy
172
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
173
- */
174
- /**
175
- * Fired when the user cut the content from one of the editing roots of the editor.
176
- *
177
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
178
- *
179
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
180
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
181
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
182
- * the observer must be added manually.
183
- *
184
- * @see module:clipboard/clipboardobserver~ClipboardObserver
185
- * @event module:engine/view/document~Document#event:cut
186
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
187
- */
188
- /**
189
- * The value of the {@link module:engine/view/document~Document#event:paste},
190
- * {@link module:engine/view/document~Document#event:copy} and {@link module:engine/view/document~Document#event:cut} events.
191
- *
192
- * In order to access the clipboard data, use the `dataTransfer` property.
193
- *
194
- * @class module:clipboard/clipboardobserver~ClipboardEventData
195
- * @extends module:engine/view/observer/domeventdata~DomEventData
196
- */
197
- /**
198
- * The data transfer instance.
199
- *
200
- * @readonly
201
- * @member {module:engine/view/datatransfer~DataTransfer} module:clipboard/clipboardobserver~ClipboardEventData#dataTransfer
202
- */
203
- /**
204
- * Fired as a continuation of the {@link #event:dragover} event.
205
- *
206
- * It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
207
- *
208
- * This event carries a `dataTransfer` object which comes from the clipboard and whose content should be processed
209
- * and inserted into the editor.
210
- *
211
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
212
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
213
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
214
- * the observer must be added manually.
215
- *
216
- * @see module:clipboard/clipboardobserver~ClipboardObserver
217
- * @see module:clipboard/clipboard~Clipboard
218
- * @event module:engine/view/document~Document#event:dragging
219
- * @param {Object} data The event data.
220
- * @param {module:engine/view/datatransfer~DataTransfer} data.dataTransfer The data transfer instance.
221
- * @param {module:engine/view/element~Element} target The tree view element representing the target.
222
- * @param {Array.<module:engine/view/range~Range>} data.targetRanges Ranges which are the target of the operation
223
- * (usually – into which the content should be inserted).
224
- * It is the drop position (which can be different than the selection at the moment of drop).
225
- */
226
- /**
227
- * Fired when the user starts dragging the content in one of the editing roots of the editor.
228
- *
229
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
230
- *
231
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
232
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
233
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
234
- * the observer must be added manually.
235
- *
236
- * @see module:engine/view/document~Document#event:clipboardInput
237
- * @event module:engine/view/document~Document#event:dragstart
238
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
239
- */
240
- /**
241
- * Fired when the user ended dragging the content.
242
- *
243
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
244
- *
245
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
246
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
247
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
248
- * the observer must be added manually.
249
- *
250
- * @see module:engine/view/document~Document#event:clipboardInput
251
- * @event module:engine/view/document~Document#event:dragend
252
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
253
- */
254
- /**
255
- * Fired when the user drags the content into one of the editing roots of the editor.
256
- *
257
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
258
- *
259
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
260
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
261
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
262
- * the observer must be added manually.
263
- *
264
- * @see module:engine/view/document~Document#event:clipboardInput
265
- * @event module:engine/view/document~Document#event:dragenter
266
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
267
- */
268
- /**
269
- * Fired when the user drags the content out of one of the editing roots of the editor.
270
- *
271
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
272
- *
273
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
274
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
275
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
276
- * the observer must be added manually.
277
- *
278
- * @see module:engine/view/document~Document#event:clipboardInput
279
- * @event module:engine/view/document~Document#event:dragleave
280
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
281
- */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
@@ -110,8 +110,6 @@ import viewToPlainText from './utils/viewtoplaintext';
110
110
  * on the current selection.
111
111
  *
112
112
  * Read more about the clipboard integration in the {@glink framework/guides/deep-dive/clipboard clipboard deep-dive guide}.
113
- *
114
- * @extends module:core/plugin~Plugin
115
113
  */
116
114
  export default class ClipboardPipeline extends Plugin {
117
115
  /**
@@ -132,8 +130,6 @@ export default class ClipboardPipeline extends Plugin {
132
130
  }
133
131
  /**
134
132
  * The clipboard paste pipeline.
135
- *
136
- * @private
137
133
  */
138
134
  _setupPasteDrop() {
139
135
  const editor = this.editor;
@@ -209,8 +205,6 @@ export default class ClipboardPipeline extends Plugin {
209
205
  }
210
206
  /**
211
207
  * The clipboard copy/cut pipeline.
212
- *
213
- * @private
214
208
  */
215
209
  _setupCopyCut() {
216
210
  const editor = this.editor;
package/src/dragdrop.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
@@ -95,8 +95,6 @@ import '../theme/clipboard.css';
95
95
  * The drag and drop feature. It works on top of the {@link module:clipboard/clipboardpipeline~ClipboardPipeline}.
96
96
  *
97
97
  * Read more about the clipboard integration in the {@glink framework/guides/deep-dive/clipboard clipboard deep-dive guide}.
98
- *
99
- * @extends module:core/plugin~Plugin
100
98
  */
101
99
  export default class DragDrop extends Plugin {
102
100
  /**
@@ -117,49 +115,11 @@ export default class DragDrop extends Plugin {
117
115
  init() {
118
116
  const editor = this.editor;
119
117
  const view = editor.editing.view;
120
- /**
121
- * The live range over the original content that is being dragged.
122
- *
123
- * @private
124
- * @type {module:engine/model/liverange~LiveRange}
125
- */
126
118
  this._draggedRange = null;
127
- /**
128
- * The UID of current dragging that is used to verify if the drop started in the same editor as the drag start.
129
- *
130
- * **Note**: This is a workaround for broken 'dragend' events (they are not fired if the source text node got removed).
131
- *
132
- * @private
133
- * @type {String}
134
- */
135
119
  this._draggingUid = '';
136
- /**
137
- * The reference to the model element that currently has a `draggable` attribute set (it is set while dragging).
138
- *
139
- * @private
140
- * @type {module:engine/model/element~Element}
141
- */
142
120
  this._draggableElement = null;
143
- /**
144
- * A throttled callback updating the drop marker.
145
- *
146
- * @private
147
- * @type {Function}
148
- */
149
121
  this._updateDropMarkerThrottled = throttle(targetRange => this._updateDropMarker(targetRange), 40);
150
- /**
151
- * A delayed callback removing the drop marker.
152
- *
153
- * @private
154
- * @type {Function}
155
- */
156
122
  this._removeDropMarkerDelayed = delay(() => this._removeDropMarker(), 40);
157
- /**
158
- * A delayed callback removing draggable attributes.
159
- *
160
- * @private
161
- * @type {Function}
162
- */
163
123
  this._clearDraggableAttributesDelayed = delay(() => this._clearDraggableAttributes(), 40);
164
124
  view.addObserver(ClipboardObserver);
165
125
  view.addObserver(MouseObserver);
@@ -200,8 +160,6 @@ export default class DragDrop extends Plugin {
200
160
  }
201
161
  /**
202
162
  * Drag and drop events handling.
203
- *
204
- * @private
205
163
  */
206
164
  _setupDragging() {
207
165
  const editor = this.editor;
@@ -306,8 +264,6 @@ export default class DragDrop extends Plugin {
306
264
  }
307
265
  /**
308
266
  * Integration with the `clipboardInput` event.
309
- *
310
- * @private
311
267
  */
312
268
  _setupClipboardInputIntegration() {
313
269
  const editor = this.editor;
@@ -348,8 +304,6 @@ export default class DragDrop extends Plugin {
348
304
  }
349
305
  /**
350
306
  * Integration with the `contentInsertion` event of the clipboard pipeline.
351
- *
352
- * @private
353
307
  */
354
308
  _setupContentInsertionIntegration() {
355
309
  const clipboardPipeline = this.editor.plugins.get(ClipboardPipeline);
@@ -377,8 +331,6 @@ export default class DragDrop extends Plugin {
377
331
  }
378
332
  /**
379
333
  * Adds listeners that add the `draggable` attribute to the elements while the mouse button is down so the dragging could start.
380
- *
381
- * @private
382
334
  */
383
335
  _setupDraggableAttributeHandling() {
384
336
  const editor = this.editor;
@@ -425,8 +377,6 @@ export default class DragDrop extends Plugin {
425
377
  }
426
378
  /**
427
379
  * Removes the `draggable` attribute from the element that was used for dragging.
428
- *
429
- * @private
430
380
  */
431
381
  _clearDraggableAttributes() {
432
382
  const editing = this.editor.editing;
@@ -440,8 +390,6 @@ export default class DragDrop extends Plugin {
440
390
  }
441
391
  /**
442
392
  * Creates downcast conversion for the drop target marker.
443
- *
444
- * @private
445
393
  */
446
394
  _setupDropMarker() {
447
395
  const editor = this.editor;
@@ -472,8 +420,7 @@ export default class DragDrop extends Plugin {
472
420
  /**
473
421
  * Updates the drop target marker to the provided range.
474
422
  *
475
- * @private
476
- * @param {module:engine/model/range~Range} targetRange The range to set the marker to.
423
+ * @param targetRange The range to set the marker to.
477
424
  */
478
425
  _updateDropMarker(targetRange) {
479
426
  const editor = this.editor;
@@ -495,8 +442,6 @@ export default class DragDrop extends Plugin {
495
442
  }
496
443
  /**
497
444
  * Removes the drop target marker.
498
- *
499
- * @private
500
445
  */
501
446
  _removeDropMarker() {
502
447
  const model = this.editor.model;
@@ -511,8 +456,7 @@ export default class DragDrop extends Plugin {
511
456
  /**
512
457
  * Deletes the dragged content from its original range and clears the dragging state.
513
458
  *
514
- * @private
515
- * @param {Boolean} moved Whether the move succeeded.
459
+ * @param moved Whether the move succeeded.
516
460
  */
517
461
  _finalizeDragging(moved) {
518
462
  const editor = this.editor;
@@ -534,12 +478,9 @@ export default class DragDrop extends Plugin {
534
478
  this._draggedRange = null;
535
479
  }
536
480
  }
537
- // Returns fixed selection range for given position and target element.
538
- //
539
- // @param {module:core/editor/editor~Editor} editor
540
- // @param {Array.<module:engine/view/range~Range>} targetViewRanges
541
- // @param {module:engine/view/element~Element} targetViewElement
542
- // @returns {module:engine/model/range~Range|null}
481
+ /**
482
+ * Returns fixed selection range for given position and target element.
483
+ */
543
484
  function findDropTargetRange(editor, targetViewRanges, targetViewElement) {
544
485
  const model = editor.model;
545
486
  const mapper = editor.editing.mapper;
@@ -581,11 +522,9 @@ function findDropTargetRange(editor, targetViewRanges, targetViewElement) {
581
522
  // so a nested editable, but view target position was directly in the `<figure>` element).
582
523
  return findDropTargetRangeOnAncestorObject(editor, targetModelPosition.parent);
583
524
  }
584
- // Returns fixed selection range for a given position and a target element if it is over the widget but not over its nested editable.
585
- //
586
- // @param {module:core/editor/editor~Editor} editor
587
- // @param {module:engine/view/element~Element} targetViewElement
588
- // @returns {module:engine/model/range~Range|null}
525
+ /**
526
+ * Returns fixed selection range for a given position and a target element if it is over the widget but not over its nested editable.
527
+ */
589
528
  function findDropTargetRangeOnWidget(editor, targetViewElement) {
590
529
  const model = editor.model;
591
530
  const mapper = editor.editing.mapper;
@@ -604,23 +543,18 @@ function findDropTargetRangeOnWidget(editor, targetViewElement) {
604
543
  }
605
544
  return null;
606
545
  }
607
- // Returns fixed selection range inside a model element.
608
- //
609
- // @param {module:core/editor/editor~Editor} editor
610
- // @param {module:engine/model/element~Element} targetModelElement
611
- // @returns {module:engine/model/range~Range}
546
+ /**
547
+ * Returns fixed selection range inside a model element.
548
+ */
612
549
  function findDropTargetRangeInElement(editor, targetModelElement) {
613
550
  const model = editor.model;
614
551
  const schema = model.schema;
615
552
  const positionAtElementStart = model.createPositionAt(targetModelElement, 0);
616
553
  return schema.getNearestSelectionRange(positionAtElementStart, 'forward');
617
554
  }
618
- // Returns fixed selection range for a given position and a target element if the drop is between blocks.
619
- //
620
- // @param {module:core/editor/editor~Editor} editor
621
- // @param {module:engine/model/position~Position} targetModelPosition
622
- // @param {module:engine/model/element~Element} targetModelElement
623
- // @returns {module:engine/model/range~Range|null}
555
+ /**
556
+ * Returns fixed selection range for a given position and a target element if the drop is between blocks.
557
+ */
624
558
  function findDropTargetRangeBetweenBlocks(editor, targetModelPosition, targetModelElement) {
625
559
  const model = editor.model;
626
560
  // Check if target is between blocks.
@@ -641,11 +575,9 @@ function findDropTargetRangeBetweenBlocks(editor, targetModelPosition, targetMod
641
575
  }
642
576
  return null;
643
577
  }
644
- // Returns a selection range on the ancestor object.
645
- //
646
- // @param {module:core/editor/editor~Editor} editor
647
- // @param {module:engine/model/element~Element} element
648
- // @returns {module:engine/model/range~Range}
578
+ /**
579
+ * Returns a selection range on the ancestor object.
580
+ */
649
581
  function findDropTargetRangeOnAncestorObject(editor, element) {
650
582
  const model = editor.model;
651
583
  let currentElement = element;
@@ -658,11 +590,9 @@ function findDropTargetRangeOnAncestorObject(editor, element) {
658
590
  /* istanbul ignore next */
659
591
  return null;
660
592
  }
661
- // Returns the closest model element for the specified view element.
662
- //
663
- // @param {module:core/editor/editor~Editor} editor
664
- // @param {module:engine/view/element~Element} element
665
- // @returns {module:engine/model/element~Element}
593
+ /**
594
+ * Returns the closest model element for the specified view element.
595
+ */
666
596
  function getClosestMappedModelElement(editor, element) {
667
597
  const mapper = editor.editing.mapper;
668
598
  const view = editor.editing.view;
@@ -675,20 +605,22 @@ function getClosestMappedModelElement(editor, element) {
675
605
  const viewElement = mapper.findMappedViewAncestor(viewPosition);
676
606
  return mapper.toModelElement(viewElement);
677
607
  }
678
- // Returns the drop effect that should be a result of dragging the content.
679
- // This function is handling a quirk when checking the effect in the 'drop' DOM event.
608
+ /**
609
+ * Returns the drop effect that should be a result of dragging the content.
610
+ * This function is handling a quirk when checking the effect in the 'drop' DOM event.
611
+ */
680
612
  function getFinalDropEffect(dataTransfer) {
681
613
  if (env.isGecko) {
682
614
  return dataTransfer.dropEffect;
683
615
  }
684
616
  return ['all', 'copyMove'].includes(dataTransfer.effectAllowed) ? 'move' : 'copy';
685
617
  }
686
- // Returns a function wrapper that will trigger a function after a specified wait time.
687
- // The timeout can be canceled by calling the cancel function on the returned wrapped function.
688
- //
689
- // @param {Function} func The function to wrap.
690
- // @param {Number} wait The timeout in ms.
691
- // @returns {Function}
618
+ /**
619
+ * Returns a function wrapper that will trigger a function after a specified wait time.
620
+ * The timeout can be canceled by calling the cancel function on the returned wrapped function.
621
+ * @param func The function to wrap.
622
+ * @param wait The timeout in ms.
623
+ */
692
624
  function delay(func, wait) {
693
625
  let timer;
694
626
  function delayed(...args) {
@@ -700,10 +632,9 @@ function delay(func, wait) {
700
632
  };
701
633
  return delayed;
702
634
  }
703
- // Returns a widget element that should be dragged.
704
- //
705
- // @param {module:engine/view/element~Element} target
706
- // @returns {module:engine/view/element~Element}
635
+ /**
636
+ * Returns a widget element that should be dragged.
637
+ */
707
638
  function findDraggableWidget(target) {
708
639
  // This is directly an editable so not a widget for sure.
709
640
  if (target.is('editableElement')) {
package/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
@@ -12,8 +12,6 @@ import ClipboardPipeline from './clipboardpipeline';
12
12
  * The plugin detects the user's intention to paste plain text.
13
13
  *
14
14
  * For example, it detects the <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>V</kbd> keystroke.
15
- *
16
- * @extends module:core/plugin~Plugin
17
15
  */
18
16
  export default class PastePlainText extends Plugin {
19
17
  /**
@@ -69,11 +67,9 @@ export default class PastePlainText extends Plugin {
69
67
  });
70
68
  }
71
69
  }
72
- // Returns true if specified `documentFragment` represents a plain text.
73
- //
74
- // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment
75
- // @param {module:engine/model/schema~Schema} schema
76
- // @returns {Boolean}
70
+ /**
71
+ * Returns true if specified `documentFragment` represents a plain text.
72
+ */
77
73
  function isPlainTextFragment(documentFragment, schema) {
78
74
  if (documentFragment.childCount > 1) {
79
75
  return false;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
@@ -9,8 +9,8 @@
9
9
  * Removes some popular browser quirks out of the clipboard data (HTML).
10
10
  * Removes all HTML comments. These are considered an internal thing and it makes little sense if they leak into the editor data.
11
11
  *
12
- * @param {String} data The HTML data to normalize.
13
- * @returns {String} Normalized HTML.
12
+ * @param data The HTML data to normalize.
13
+ * @returns Normalized HTML.
14
14
  */
15
15
  export default function normalizeClipboardData(data) {
16
16
  return data
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
@@ -8,8 +8,8 @@
8
8
  /**
9
9
  * Converts plain text to its HTML-ized version.
10
10
  *
11
- * @param {String} text The plain text to convert.
12
- * @returns {String} HTML generated from the plain text.
11
+ * @param text The plain text to convert.
12
+ * @returns HTML generated from the plain text.
13
13
  */
14
14
  export default function plainTextToHtml(text) {
15
15
  text = text
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
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
5
  // Elements which should not have empty-line padding.
@@ -9,8 +9,8 @@ const smallPaddingElements = ['figcaption', 'li'];
9
9
  /**
10
10
  * Converts {@link module:engine/view/item~Item view item} and all of its children to plain text.
11
11
  *
12
- * @param {module:engine/view/item~Item} viewItem View item to convert.
13
- * @returns {String} Plain text representation of `viewItem`.
12
+ * @param viewItem View item to convert.
13
+ * @returns Plain text representation of `viewItem`.
14
14
  */
15
15
  export default function viewToPlainText(viewItem) {
16
16
  let text = '';
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
+ * 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
5