@ckeditor/ckeditor5-clipboard 29.1.0 → 31.1.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.1.0",
3
+ "version": "31.1.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.1.0",
16
- "@ckeditor/ckeditor5-engine": "^29.1.0",
17
- "@ckeditor/ckeditor5-utils": "^29.1.0",
18
- "@ckeditor/ckeditor5-widget": "^29.1.0",
15
+ "@ckeditor/ckeditor5-core": "^31.1.0",
16
+ "@ckeditor/ckeditor5-engine": "^31.1.0",
17
+ "@ckeditor/ckeditor5-utils": "^31.1.0",
18
+ "@ckeditor/ckeditor5-widget": "^31.1.0",
19
19
  "lodash-es": "^4.17.11"
20
20
  },
21
21
  "devDependencies": {
22
- "@ckeditor/ckeditor5-alignment": "^29.1.0",
23
- "@ckeditor/ckeditor5-basic-styles": "^29.1.0",
24
- "@ckeditor/ckeditor5-block-quote": "^29.1.0",
25
- "@ckeditor/ckeditor5-cloud-services": "^29.1.0",
26
- "@ckeditor/ckeditor5-code-block": "^29.1.0",
27
- "@ckeditor/ckeditor5-easy-image": "^29.1.0",
28
- "@ckeditor/ckeditor5-editor-classic": "^29.1.0",
29
- "@ckeditor/ckeditor5-enter": "^29.1.0",
30
- "@ckeditor/ckeditor5-horizontal-line": "^29.1.0",
31
- "@ckeditor/ckeditor5-image": "^29.1.0",
32
- "@ckeditor/ckeditor5-link": "^29.1.0",
33
- "@ckeditor/ckeditor5-page-break": "^29.1.0",
34
- "@ckeditor/ckeditor5-paragraph": "^29.1.0",
35
- "@ckeditor/ckeditor5-paste-from-office": "^29.1.0",
36
- "@ckeditor/ckeditor5-remove-format": "^29.1.0",
37
- "@ckeditor/ckeditor5-table": "^29.1.0",
38
- "@ckeditor/ckeditor5-typing": "^29.1.0"
22
+ "@ckeditor/ckeditor5-alignment": "^31.1.0",
23
+ "@ckeditor/ckeditor5-basic-styles": "^31.1.0",
24
+ "@ckeditor/ckeditor5-block-quote": "^31.1.0",
25
+ "@ckeditor/ckeditor5-cloud-services": "^31.1.0",
26
+ "@ckeditor/ckeditor5-code-block": "^31.1.0",
27
+ "@ckeditor/ckeditor5-easy-image": "^31.1.0",
28
+ "@ckeditor/ckeditor5-editor-classic": "^31.1.0",
29
+ "@ckeditor/ckeditor5-enter": "^31.1.0",
30
+ "@ckeditor/ckeditor5-horizontal-line": "^31.1.0",
31
+ "@ckeditor/ckeditor5-image": "^31.1.0",
32
+ "@ckeditor/ckeditor5-link": "^31.1.0",
33
+ "@ckeditor/ckeditor5-page-break": "^31.1.0",
34
+ "@ckeditor/ckeditor5-paragraph": "^31.1.0",
35
+ "@ckeditor/ckeditor5-paste-from-office": "^31.1.0",
36
+ "@ckeditor/ckeditor5-remove-format": "^31.1.0",
37
+ "@ckeditor/ckeditor5-table": "^31.1.0",
38
+ "@ckeditor/ckeditor5-typing": "^31.1.0"
39
39
  },
40
40
  "engines": {
41
41
  "node": ">=12.0.0",
@@ -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' )
@@ -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. These are considered an internal thing and it makes little sense if they leak into the 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
  }
package/CHANGELOG.md DELETED
@@ -1,180 +0,0 @@
1
- Changelog
2
- =========
3
-
4
- All changes in the package are documented in the main repository. See: https://github.com/ckeditor/ckeditor5/blob/master/CHANGELOG.md.
5
-
6
- Changes for the past releases are available below.
7
-
8
- ## [19.0.0](https://github.com/ckeditor/ckeditor5-clipboard/compare/v18.0.0...v19.0.0) (2020-04-29)
9
-
10
- ### Other changes
11
-
12
- * Handled `paste` and `drop` events no longer propagate up the DOM tree. Closes [ckeditor/ckeditor5#6464](https://github.com/ckeditor/ckeditor5/issues/6464). ([70aa7ba](https://github.com/ckeditor/ckeditor5-clipboard/commit/70aa7ba))
13
-
14
-
15
- ## [18.0.0](https://github.com/ckeditor/ckeditor5-clipboard/compare/v17.0.0...v18.0.0) (2020-03-19)
16
-
17
- Internal changes only (updated dependencies, documentation, etc.).
18
-
19
-
20
- ## [17.0.0](https://github.com/ckeditor/ckeditor5-clipboard/compare/v16.0.0...v17.0.0) (2020-02-19)
21
-
22
- Internal changes only (updated dependencies, documentation, etc.).
23
-
24
-
25
- ## [16.0.0](https://github.com/ckeditor/ckeditor5-clipboard/compare/v15.0.0...v16.0.0) (2019-12-04)
26
-
27
- Internal changes only (updated dependencies, documentation, etc.).
28
-
29
-
30
- ## [15.0.0](https://github.com/ckeditor/ckeditor5-clipboard/compare/v12.0.2...v15.0.0) (2019-10-23)
31
-
32
- Internal changes only (updated dependencies, documentation, etc.).
33
-
34
-
35
- ## [12.0.2](https://github.com/ckeditor/ckeditor5-clipboard/compare/v12.0.1...v12.0.2) (2019-08-26)
36
-
37
- ### Other changes
38
-
39
- * The issue tracker for this package was moved to https://github.com/ckeditor/ckeditor5/issues. See [ckeditor/ckeditor5#1988](https://github.com/ckeditor/ckeditor5/issues/1988). ([b1782bb](https://github.com/ckeditor/ckeditor5-clipboard/commit/b1782bb))
40
-
41
-
42
- ## [12.0.1](https://github.com/ckeditor/ckeditor5-clipboard/compare/v12.0.0...v12.0.1) (2019-07-10)
43
-
44
- Internal changes only (updated dependencies, documentation, etc.).
45
-
46
-
47
- ## [12.0.0](https://github.com/ckeditor/ckeditor5-clipboard/compare/v11.0.2...v12.0.0) (2019-07-04)
48
-
49
- ### Other changes
50
-
51
- * New lines pasted as a plain text will always create a new paragraph. Closes [ckeditor/ckeditor5#1727](https://github.com/ckeditor/ckeditor5/issues/1727). ([f0eb3a0](https://github.com/ckeditor/ckeditor5-clipboard/commit/f0eb3a0))
52
-
53
- ### BREAKING CHANGES
54
-
55
- * From now on, every new line pasted in the editor as a plain text, will create a new paragraph. Read more at [ckeditor/ckeditor5#1727](https://github.com/ckeditor/ckeditor5/issues/1727).
56
-
57
-
58
- ## [11.0.2](https://github.com/ckeditor/ckeditor5-clipboard/compare/v11.0.1...v11.0.2) (2019-06-05)
59
-
60
- Internal changes only (updated dependencies, documentation, etc.).
61
-
62
-
63
- ## [11.0.1](https://github.com/ckeditor/ckeditor5-clipboard/compare/v11.0.0...v11.0.1) (2019-04-10)
64
-
65
- ### Bug fixes
66
-
67
- * The DOM `drop` event will not bubble up if the `clipboardInput` event was handled. Closes [ckeditor/ckeditor5-upload#92](https://github.com/ckeditor/ckeditor5-upload/issues/92). ([5d14697](https://github.com/ckeditor/ckeditor5-clipboard/commit/5d14697))
68
-
69
-
70
- ## [11.0.0](https://github.com/ckeditor/ckeditor5-clipboard/compare/v10.0.4...v11.0.0) (2019-02-28)
71
-
72
- ### BREAKING CHANGES
73
-
74
- * Upgraded minimal versions of Node to `8.0.0` and npm to `5.7.1`. See: [ckeditor/ckeditor5#1507](https://github.com/ckeditor/ckeditor5/issues/1507). ([612ea3c](https://github.com/ckeditor/ckeditor5-cloud-services/commit/612ea3c))
75
-
76
-
77
- ## [10.0.4](https://github.com/ckeditor/ckeditor5-clipboard/compare/v10.0.3...v10.0.4) (2018-12-05)
78
-
79
- Internal changes only (updated dependencies, documentation, etc.).
80
-
81
-
82
- ## [10.0.3](https://github.com/ckeditor/ckeditor5-clipboard/compare/v10.0.2...v10.0.3) (2018-10-08)
83
-
84
- ### Other changes
85
-
86
- * The `Clipboard#inputTransformation` event is now emitted with an additional `dataTransfer` object. Closes [#54](https://github.com/ckeditor/ckeditor5-clipboard/issues/54) . ([f3589b4](https://github.com/ckeditor/ckeditor5-clipboard/commit/f3589b4))
87
-
88
-
89
- ## [10.0.2](https://github.com/ckeditor/ckeditor5-clipboard/compare/v10.0.1...v10.0.2) (2018-07-18)
90
-
91
- Internal changes only (updated dependencies, documentation, etc.).
92
-
93
-
94
- ## [10.0.1](https://github.com/ckeditor/ckeditor5-clipboard/compare/v10.0.0...v10.0.1) (2018-06-21)
95
-
96
- ### Bug fixes
97
-
98
- * Disabled the entire clipboard input pipeline when the editor is read-only. Closes [#48](https://github.com/ckeditor/ckeditor5-clipboard/issues/48). ([b40ec4b](https://github.com/ckeditor/ckeditor5-clipboard/commit/b40ec4b))
99
- * When pasting a plain text, single new line characters should be converted to `<br>`s. Closes [ckeditor/ckeditor5#766](https://github.com/ckeditor/ckeditor5/issues/766). ([be21676](https://github.com/ckeditor/ckeditor5-clipboard/commit/be21676))
100
-
101
-
102
- ## [10.0.0](https://github.com/ckeditor/ckeditor5-clipboard/compare/v1.0.0-beta.4...v10.0.0) (2018-04-25)
103
-
104
- ### Other changes
105
-
106
- * Changed the license to GPL2+ only. See [ckeditor/ckeditor5#991](https://github.com/ckeditor/ckeditor5/issues/991). ([8c092af](https://github.com/ckeditor/ckeditor5-clipboard/commit/8c092af))
107
-
108
- ### BREAKING CHANGES
109
-
110
- * The license under which CKEditor 5 is released has been changed from a triple GPL, LGPL and MPL license to a GPL2+ only. See [ckeditor/ckeditor5#991](https://github.com/ckeditor/ckeditor5/issues/991) for more information.
111
-
112
-
113
- ## [1.0.0-beta.4](https://github.com/ckeditor/ckeditor5-clipboard/compare/v1.0.0-beta.2...v1.0.0-beta.4) (2018-04-19)
114
-
115
- Internal changes only (updated dependencies, documentation, etc.).
116
-
117
-
118
- ## [1.0.0-beta.2](https://github.com/ckeditor/ckeditor5-clipboard/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2018-04-10)
119
-
120
- Internal changes only (updated dependencies, documentation, etc.).
121
-
122
-
123
- ## [1.0.0-beta.1](https://github.com/ckeditor/ckeditor5-clipboard/compare/v1.0.0-alpha.2...v1.0.0-beta.1) (2018-03-15)
124
-
125
- Internal changes only (updated dependencies, documentation, etc.).
126
-
127
-
128
- ## [1.0.0-alpha.2](https://github.com/ckeditor/ckeditor5-clipboard/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2017-11-14)
129
-
130
- Internal changes only (updated dependencies, documentation, etc.).
131
-
132
-
133
- ## [1.0.0-alpha.1](https://github.com/ckeditor/ckeditor5-clipboard/compare/v0.7.0...v1.0.0-alpha.1) (2017-10-03)
134
-
135
- Internal changes only (updated dependencies, documentation, etc.).
136
-
137
-
138
- ## [0.7.0](https://github.com/ckeditor/ckeditor5-clipboard/compare/v0.6.0...v0.7.0) (2017-09-03)
139
-
140
- ### Bug fixes
141
-
142
- * Whitespaces around inline elements will not be lost upon pasting. Closes [#24](https://github.com/ckeditor/ckeditor5-clipboard/issues/24). ([5888743](https://github.com/ckeditor/ckeditor5-clipboard/commit/5888743))
143
-
144
- ### Features
145
-
146
- * Added the `'dragover'` event to ClipboardObserver. ([00c7567](https://github.com/ckeditor/ckeditor5-clipboard/commit/00c7567))
147
- * Added `dropRange` to the `drop` event and `targetRanges` to the `clipboardInput` event. Closes [#29](https://github.com/ckeditor/ckeditor5-clipboard/issues/29). ([86daed9](https://github.com/ckeditor/ckeditor5-clipboard/commit/86daed9))
148
- * Disable pasting and cutting when the editor is read-only. Closes [#26](https://github.com/ckeditor/ckeditor5-clipboard/issues/26). ([0ba74d5](https://github.com/ckeditor/ckeditor5-clipboard/commit/0ba74d5))
149
- * The viewport will be scrolled to the selection on paste. See ckeditor/ckeditor5-engine#660. ([9a0e20f](https://github.com/ckeditor/ckeditor5-clipboard/commit/9a0e20f))
150
-
151
-
152
- ## [0.6.0](https://github.com/ckeditor/ckeditor5-clipboard/compare/v0.5.0...v0.6.0) (2017-05-07)
153
-
154
- ### Bug fixes
155
-
156
- * Plain text data is now available in the clipboard when copying or cutting the editor contents. Closes [#11](https://github.com/ckeditor/ckeditor5-clipboard/issues/11). ([8a01e0f](https://github.com/ckeditor/ckeditor5-clipboard/commit/8a01e0f))
157
-
158
- ### Features
159
-
160
- * Introduced `DataTransfer#files` property. Change the clipboard input pipeline. Closes [#16](https://github.com/ckeditor/ckeditor5-clipboard/issues/16). ([e4e7e10](https://github.com/ckeditor/ckeditor5-clipboard/commit/e4e7e10))
161
-
162
- ### BREAKING CHANGES
163
-
164
- * The `clipboardInput` event now contains only the `dataTransfer` property (`content` was removed). The separate `inputTransformation` event was introduced for the content transformations.
165
-
166
-
167
- ## [0.5.0](https://github.com/ckeditor/ckeditor5-clipboard/compare/v0.4.1...v0.5.0) (2017-04-05)
168
-
169
- ### Other changes
170
-
171
- * Aligned use of the `DataController` to the latest API. Closes [#14](https://github.com/ckeditor/ckeditor5-clipboard/issues/14). ([8f98e2b](https://github.com/ckeditor/ckeditor5-clipboard/commit/8f98e2b))
172
-
173
- ### Features
174
-
175
- * Named existing plugin(s). ([3d37f53](https://github.com/ckeditor/ckeditor5-clipboard/commit/3d37f53))
176
-
177
-
178
- ## [0.4.1](https://github.com/ckeditor/ckeditor5-clipboard/compare/v0.4.0...v0.4.1) (2017-03-06)
179
-
180
- Internal changes only (updated dependencies, documentation, etc.).