@ckeditor/ckeditor5-clipboard 27.1.0 → 29.2.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
@@ -1,7 +1,7 @@
1
1
  Software License Agreement
2
2
  ==========================
3
3
 
4
- **CKEditor 5 Clipboard Feature** – https://github.com/ckeditor/ckeditor5-clipboard <br>
4
+ **CKEditor 5 clipboard feature** – https://github.com/ckeditor/ckeditor5-clipboard <br>
5
5
  Copyright (c) 2003-2021, [CKSource](http://cksource.com) Frederico Knabben. 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).
package/README.md CHANGED
@@ -2,8 +2,8 @@ CKEditor 5 clipboard feature
2
2
  ========================================
3
3
 
4
4
  [![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-clipboard.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-clipboard)
5
- [![Dependency Status](https://david-dm.org/ckeditor/ckeditor5-clipboard/status.svg)](https://david-dm.org/ckeditor/ckeditor5-clipboard)
6
- [![devDependency Status](https://david-dm.org/ckeditor/ckeditor5-clipboard/dev-status.svg)](https://david-dm.org/ckeditor/ckeditor5-clipboard?type=dev)
5
+ [![Coverage Status](https://coveralls.io/repos/github/ckeditor/ckeditor5/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5?branch=master)
6
+ [![Build Status](https://travis-ci.com/ckeditor/ckeditor5.svg?branch=master)](https://travis-ci.com/ckeditor/ckeditor5)
7
7
 
8
8
  This package implements the clipboard (copy, cut, paste) support for CKEditor 5.
9
9
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-clipboard",
3
- "version": "27.1.0",
4
- "description": "Clipboard integration for CKEditor 5.",
3
+ "version": "29.2.0",
4
+ "description": "Clipboard integration feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
7
7
  "ckeditor5",
@@ -12,30 +12,30 @@
12
12
  ],
13
13
  "main": "src/index.js",
14
14
  "dependencies": {
15
- "@ckeditor/ckeditor5-core": "^27.1.0",
16
- "@ckeditor/ckeditor5-engine": "^27.1.0",
17
- "@ckeditor/ckeditor5-utils": "^27.1.0",
18
- "@ckeditor/ckeditor5-widget": "^27.1.0",
15
+ "@ckeditor/ckeditor5-core": "^29.2.0",
16
+ "@ckeditor/ckeditor5-engine": "^29.2.0",
17
+ "@ckeditor/ckeditor5-utils": "^29.2.0",
18
+ "@ckeditor/ckeditor5-widget": "^29.2.0",
19
19
  "lodash-es": "^4.17.11"
20
20
  },
21
21
  "devDependencies": {
22
- "@ckeditor/ckeditor5-alignment": "^27.1.0",
23
- "@ckeditor/ckeditor5-basic-styles": "^27.1.0",
24
- "@ckeditor/ckeditor5-block-quote": "^27.1.0",
25
- "@ckeditor/ckeditor5-cloud-services": "^27.1.0",
26
- "@ckeditor/ckeditor5-code-block": "^27.1.0",
27
- "@ckeditor/ckeditor5-easy-image": "^27.1.0",
28
- "@ckeditor/ckeditor5-editor-classic": "^27.1.0",
29
- "@ckeditor/ckeditor5-enter": "^27.1.0",
30
- "@ckeditor/ckeditor5-horizontal-line": "^27.1.0",
31
- "@ckeditor/ckeditor5-image": "^27.1.0",
32
- "@ckeditor/ckeditor5-link": "^27.1.0",
33
- "@ckeditor/ckeditor5-page-break": "^27.1.0",
34
- "@ckeditor/ckeditor5-paragraph": "^27.1.0",
35
- "@ckeditor/ckeditor5-paste-from-office": "^27.1.0",
36
- "@ckeditor/ckeditor5-remove-format": "^27.1.0",
37
- "@ckeditor/ckeditor5-table": "^27.1.0",
38
- "@ckeditor/ckeditor5-typing": "^27.1.0"
22
+ "@ckeditor/ckeditor5-alignment": "^29.2.0",
23
+ "@ckeditor/ckeditor5-basic-styles": "^29.2.0",
24
+ "@ckeditor/ckeditor5-block-quote": "^29.2.0",
25
+ "@ckeditor/ckeditor5-cloud-services": "^29.2.0",
26
+ "@ckeditor/ckeditor5-code-block": "^29.2.0",
27
+ "@ckeditor/ckeditor5-easy-image": "^29.2.0",
28
+ "@ckeditor/ckeditor5-editor-classic": "^29.2.0",
29
+ "@ckeditor/ckeditor5-enter": "^29.2.0",
30
+ "@ckeditor/ckeditor5-horizontal-line": "^29.2.0",
31
+ "@ckeditor/ckeditor5-image": "^29.2.0",
32
+ "@ckeditor/ckeditor5-link": "^29.2.0",
33
+ "@ckeditor/ckeditor5-page-break": "^29.2.0",
34
+ "@ckeditor/ckeditor5-paragraph": "^29.2.0",
35
+ "@ckeditor/ckeditor5-paste-from-office": "^29.2.0",
36
+ "@ckeditor/ckeditor5-remove-format": "^29.2.0",
37
+ "@ckeditor/ckeditor5-table": "^29.2.0",
38
+ "@ckeditor/ckeditor5-typing": "^29.2.0"
39
39
  },
40
40
  "engines": {
41
41
  "node": ">=12.0.0",
@@ -53,6 +53,7 @@
53
53
  "files": [
54
54
  "lang",
55
55
  "src",
56
- "theme"
56
+ "theme",
57
+ "ckeditor5-metadata.json"
57
58
  ]
58
59
  }
@@ -98,12 +98,13 @@ export default class DataTransfer {
98
98
 
99
99
  function getFiles( nativeDataTransfer ) {
100
100
  // DataTransfer.files and items are array-like and might not have an iterable interface.
101
- const files = nativeDataTransfer.files ? Array.from( nativeDataTransfer.files ) : [];
102
- const items = nativeDataTransfer.items ? Array.from( nativeDataTransfer.items ) : [];
101
+ const files = Array.from( nativeDataTransfer.files || [] );
102
+ const items = Array.from( nativeDataTransfer.items || [] );
103
103
 
104
104
  if ( files.length ) {
105
105
  return files;
106
106
  }
107
+
107
108
  // Chrome has empty DataTransfer.files, but allows getting files through the items interface.
108
109
  return items
109
110
  .filter( item => item.kind === 'file' )
package/src/dragdrop.js CHANGED
@@ -259,6 +259,11 @@ export default class DragDrop extends Plugin {
259
259
  const modelElement = editor.editing.mapper.toModelElement( draggableWidget );
260
260
 
261
261
  this._draggedRange = LiveRange.fromRange( model.createRangeOn( modelElement ) );
262
+
263
+ // Disable toolbars so they won't obscure the drop area.
264
+ if ( editor.plugins.has( 'WidgetToolbarRepository' ) ) {
265
+ editor.plugins.get( 'WidgetToolbarRepository' ).forceDisabled( 'dragDrop' );
266
+ }
262
267
  }
263
268
 
264
269
  // If this was not a widget we should check if we need to drag some text content.
@@ -610,6 +615,10 @@ export default class DragDrop extends Plugin {
610
615
  this._removeDropMarker();
611
616
  this._clearDraggableAttributes();
612
617
 
618
+ if ( editor.plugins.has( 'WidgetToolbarRepository' ) ) {
619
+ editor.plugins.get( 'WidgetToolbarRepository' ).clearForceDisabled( 'dragDrop' );
620
+ }
621
+
613
622
  this._draggingUid = '';
614
623
 
615
624
  if ( !this._draggedRange ) {
@@ -9,6 +9,7 @@
9
9
 
10
10
  /**
11
11
  * Removes some popular browser quirks out of the clipboard data (HTML).
12
+ * Removes all HTML comments. Comments are considered as an internal thing and it makes little sense if they leak to editor data.
12
13
  *
13
14
  * @param {String} data The HTML data to normalize.
14
15
  * @returns {String} Normalized HTML.
@@ -23,5 +24,7 @@ export default function normalizeClipboardData( data ) {
23
24
  }
24
25
 
25
26
  return spaces;
26
- } );
27
+ } )
28
+ // Remove all HTML comments.
29
+ .replace( /<!--[\s\S]*?-->/g, '' );
27
30
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
2
+ * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5