@ckeditor/ckeditor5-engine 36.0.0 → 36.0.1
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 +22 -22
- package/src/view/datatransfer.js +24 -27
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-engine",
|
|
3
|
-
"version": "36.0.
|
|
3
|
+
"version": "36.0.1",
|
|
4
4
|
"description": "The editing engine of CKEditor 5 – the best browser-based rich text editor.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wysiwyg",
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
],
|
|
24
24
|
"main": "src/index.js",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@ckeditor/ckeditor5-utils": "^36.0.
|
|
26
|
+
"@ckeditor/ckeditor5-utils": "^36.0.1",
|
|
27
27
|
"lodash-es": "^4.17.15"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@ckeditor/ckeditor5-basic-styles": "^36.0.
|
|
31
|
-
"@ckeditor/ckeditor5-block-quote": "^36.0.
|
|
32
|
-
"@ckeditor/ckeditor5-clipboard": "^36.0.
|
|
33
|
-
"@ckeditor/ckeditor5-cloud-services": "^36.0.
|
|
34
|
-
"@ckeditor/ckeditor5-core": "^36.0.
|
|
35
|
-
"@ckeditor/ckeditor5-editor-classic": "^36.0.
|
|
36
|
-
"@ckeditor/ckeditor5-enter": "^36.0.
|
|
37
|
-
"@ckeditor/ckeditor5-essentials": "^36.0.
|
|
38
|
-
"@ckeditor/ckeditor5-heading": "^36.0.
|
|
39
|
-
"@ckeditor/ckeditor5-image": "^36.0.
|
|
40
|
-
"@ckeditor/ckeditor5-link": "^36.0.
|
|
41
|
-
"@ckeditor/ckeditor5-list": "^36.0.
|
|
42
|
-
"@ckeditor/ckeditor5-mention": "^36.0.
|
|
43
|
-
"@ckeditor/ckeditor5-paragraph": "^36.0.
|
|
44
|
-
"@ckeditor/ckeditor5-table": "^36.0.
|
|
45
|
-
"@ckeditor/ckeditor5-theme-lark": "^36.0.
|
|
46
|
-
"@ckeditor/ckeditor5-typing": "^36.0.
|
|
47
|
-
"@ckeditor/ckeditor5-ui": "^36.0.
|
|
48
|
-
"@ckeditor/ckeditor5-undo": "^36.0.
|
|
49
|
-
"@ckeditor/ckeditor5-widget": "^36.0.
|
|
30
|
+
"@ckeditor/ckeditor5-basic-styles": "^36.0.1",
|
|
31
|
+
"@ckeditor/ckeditor5-block-quote": "^36.0.1",
|
|
32
|
+
"@ckeditor/ckeditor5-clipboard": "^36.0.1",
|
|
33
|
+
"@ckeditor/ckeditor5-cloud-services": "^36.0.1",
|
|
34
|
+
"@ckeditor/ckeditor5-core": "^36.0.1",
|
|
35
|
+
"@ckeditor/ckeditor5-editor-classic": "^36.0.1",
|
|
36
|
+
"@ckeditor/ckeditor5-enter": "^36.0.1",
|
|
37
|
+
"@ckeditor/ckeditor5-essentials": "^36.0.1",
|
|
38
|
+
"@ckeditor/ckeditor5-heading": "^36.0.1",
|
|
39
|
+
"@ckeditor/ckeditor5-image": "^36.0.1",
|
|
40
|
+
"@ckeditor/ckeditor5-link": "^36.0.1",
|
|
41
|
+
"@ckeditor/ckeditor5-list": "^36.0.1",
|
|
42
|
+
"@ckeditor/ckeditor5-mention": "^36.0.1",
|
|
43
|
+
"@ckeditor/ckeditor5-paragraph": "^36.0.1",
|
|
44
|
+
"@ckeditor/ckeditor5-table": "^36.0.1",
|
|
45
|
+
"@ckeditor/ckeditor5-theme-lark": "^36.0.1",
|
|
46
|
+
"@ckeditor/ckeditor5-typing": "^36.0.1",
|
|
47
|
+
"@ckeditor/ckeditor5-ui": "^36.0.1",
|
|
48
|
+
"@ckeditor/ckeditor5-undo": "^36.0.1",
|
|
49
|
+
"@ckeditor/ckeditor5-widget": "^36.0.1",
|
|
50
50
|
"typescript": "^4.8.4",
|
|
51
51
|
"webpack": "^5.58.1",
|
|
52
52
|
"webpack-cli": "^4.9.0"
|
package/src/view/datatransfer.js
CHANGED
|
@@ -6,26 +6,29 @@
|
|
|
6
6
|
* A facade over the native [`DataTransfer`](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer) object.
|
|
7
7
|
*/
|
|
8
8
|
export default class DataTransfer {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
*
|
|
20
|
-
* @private
|
|
21
|
-
* @member {DataTransfer} #_native
|
|
22
|
-
*/
|
|
9
|
+
/**
|
|
10
|
+
* @param nativeDataTransfer The native [`DataTransfer`](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer) object.
|
|
11
|
+
* @param options.cacheFiles Whether `files` list should be initialized in the constructor.
|
|
12
|
+
*/
|
|
13
|
+
constructor(nativeDataTransfer, options = {}) {
|
|
14
|
+
// We should store references to the File instances in case someone would like to process this files
|
|
15
|
+
// outside the event handler. Files are stored only for `drop` and `paste` events because they are not usable
|
|
16
|
+
// in other events and are generating a huge delay on Firefox while dragging.
|
|
17
|
+
// See https://github.com/ckeditor/ckeditor5/issues/13366.
|
|
18
|
+
this._files = options.cacheFiles ? getFiles(nativeDataTransfer) : null;
|
|
23
19
|
this._native = nativeDataTransfer;
|
|
24
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* The array of files created from the native `DataTransfer#files` or `DataTransfer#items`.
|
|
23
|
+
*/
|
|
24
|
+
get files() {
|
|
25
|
+
if (!this._files) {
|
|
26
|
+
this._files = getFiles(this._native);
|
|
27
|
+
}
|
|
28
|
+
return this._files;
|
|
29
|
+
}
|
|
25
30
|
/**
|
|
26
31
|
* Returns an array of available native content types.
|
|
27
|
-
*
|
|
28
|
-
* @returns {Array.<String>}
|
|
29
32
|
*/
|
|
30
33
|
get types() {
|
|
31
34
|
return this._native.types;
|
|
@@ -33,10 +36,11 @@ export default class DataTransfer {
|
|
|
33
36
|
/**
|
|
34
37
|
* Gets the data from the data transfer by its MIME type.
|
|
35
38
|
*
|
|
36
|
-
*
|
|
39
|
+
* ```ts
|
|
40
|
+
* dataTransfer.getData( 'text/plain' );
|
|
41
|
+
* ```
|
|
37
42
|
*
|
|
38
|
-
* @param
|
|
39
|
-
* @returns {String}
|
|
43
|
+
* @param type The MIME type. E.g. `text/html` or `text/plain`.
|
|
40
44
|
*/
|
|
41
45
|
getData(type) {
|
|
42
46
|
return this._native.getData(type);
|
|
@@ -44,16 +48,13 @@ export default class DataTransfer {
|
|
|
44
48
|
/**
|
|
45
49
|
* Sets the data in the data transfer.
|
|
46
50
|
*
|
|
47
|
-
* @param
|
|
48
|
-
* @param {String} data
|
|
51
|
+
* @param type The MIME type. E.g. `text/html` or `text/plain`.
|
|
49
52
|
*/
|
|
50
53
|
setData(type, data) {
|
|
51
54
|
this._native.setData(type, data);
|
|
52
55
|
}
|
|
53
56
|
/**
|
|
54
57
|
* The effect that is allowed for a drag operation.
|
|
55
|
-
*
|
|
56
|
-
* @param {String} value
|
|
57
58
|
*/
|
|
58
59
|
set effectAllowed(value) {
|
|
59
60
|
this._native.effectAllowed = value;
|
|
@@ -63,8 +64,6 @@ export default class DataTransfer {
|
|
|
63
64
|
}
|
|
64
65
|
/**
|
|
65
66
|
* The actual drop effect.
|
|
66
|
-
*
|
|
67
|
-
* @param {String} value
|
|
68
67
|
*/
|
|
69
68
|
set dropEffect(value) {
|
|
70
69
|
this._native.dropEffect = value;
|
|
@@ -74,8 +73,6 @@ export default class DataTransfer {
|
|
|
74
73
|
}
|
|
75
74
|
/**
|
|
76
75
|
* Whether the dragging operation was canceled.
|
|
77
|
-
*
|
|
78
|
-
* @returns {Boolean}
|
|
79
76
|
*/
|
|
80
77
|
get isCanceled() {
|
|
81
78
|
return this._native.dropEffect == 'none' || !!this._native.mozUserCancelled;
|