@ckeditor/ckeditor5-clipboard 29.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-clipboard",
|
|
3
|
-
"version": "29.
|
|
3
|
+
"version": "29.2.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": "^29.
|
|
16
|
-
"@ckeditor/ckeditor5-engine": "^29.
|
|
17
|
-
"@ckeditor/ckeditor5-utils": "^29.
|
|
18
|
-
"@ckeditor/ckeditor5-widget": "^29.
|
|
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": "^29.
|
|
23
|
-
"@ckeditor/ckeditor5-basic-styles": "^29.
|
|
24
|
-
"@ckeditor/ckeditor5-block-quote": "^29.
|
|
25
|
-
"@ckeditor/ckeditor5-cloud-services": "^29.
|
|
26
|
-
"@ckeditor/ckeditor5-code-block": "^29.
|
|
27
|
-
"@ckeditor/ckeditor5-easy-image": "^29.
|
|
28
|
-
"@ckeditor/ckeditor5-editor-classic": "^29.
|
|
29
|
-
"@ckeditor/ckeditor5-enter": "^29.
|
|
30
|
-
"@ckeditor/ckeditor5-horizontal-line": "^29.
|
|
31
|
-
"@ckeditor/ckeditor5-image": "^29.
|
|
32
|
-
"@ckeditor/ckeditor5-link": "^29.
|
|
33
|
-
"@ckeditor/ckeditor5-page-break": "^29.
|
|
34
|
-
"@ckeditor/ckeditor5-paragraph": "^29.
|
|
35
|
-
"@ckeditor/ckeditor5-paste-from-office": "^29.
|
|
36
|
-
"@ckeditor/ckeditor5-remove-format": "^29.
|
|
37
|
-
"@ckeditor/ckeditor5-table": "^29.
|
|
38
|
-
"@ckeditor/ckeditor5-typing": "^29.
|
|
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",
|
package/src/datatransfer.js
CHANGED
|
@@ -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 =
|
|
102
|
-
const 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' )
|
|
@@ -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
|
}
|