@ckeditor/ckeditor5-engine 35.3.0 → 35.3.2
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/observer/inputobserver.js +34 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-engine",
|
|
3
|
-
"version": "35.3.
|
|
3
|
+
"version": "35.3.2",
|
|
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": "^35.3.
|
|
26
|
+
"@ckeditor/ckeditor5-utils": "^35.3.2",
|
|
27
27
|
"lodash-es": "^4.17.15"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@ckeditor/ckeditor5-basic-styles": "^35.3.
|
|
31
|
-
"@ckeditor/ckeditor5-block-quote": "^35.3.
|
|
32
|
-
"@ckeditor/ckeditor5-clipboard": "^35.3.
|
|
33
|
-
"@ckeditor/ckeditor5-cloud-services": "^35.3.
|
|
34
|
-
"@ckeditor/ckeditor5-core": "^35.3.
|
|
35
|
-
"@ckeditor/ckeditor5-editor-classic": "^35.3.
|
|
36
|
-
"@ckeditor/ckeditor5-enter": "^35.3.
|
|
37
|
-
"@ckeditor/ckeditor5-essentials": "^35.3.
|
|
38
|
-
"@ckeditor/ckeditor5-heading": "^35.3.
|
|
39
|
-
"@ckeditor/ckeditor5-image": "^35.3.
|
|
40
|
-
"@ckeditor/ckeditor5-link": "^35.3.
|
|
41
|
-
"@ckeditor/ckeditor5-list": "^35.3.
|
|
42
|
-
"@ckeditor/ckeditor5-mention": "^35.3.
|
|
43
|
-
"@ckeditor/ckeditor5-paragraph": "^35.3.
|
|
44
|
-
"@ckeditor/ckeditor5-table": "^35.3.
|
|
45
|
-
"@ckeditor/ckeditor5-theme-lark": "^35.3.
|
|
46
|
-
"@ckeditor/ckeditor5-typing": "^35.3.
|
|
47
|
-
"@ckeditor/ckeditor5-ui": "^35.3.
|
|
48
|
-
"@ckeditor/ckeditor5-undo": "^35.3.
|
|
49
|
-
"@ckeditor/ckeditor5-widget": "^35.3.
|
|
30
|
+
"@ckeditor/ckeditor5-basic-styles": "^35.3.2",
|
|
31
|
+
"@ckeditor/ckeditor5-block-quote": "^35.3.2",
|
|
32
|
+
"@ckeditor/ckeditor5-clipboard": "^35.3.2",
|
|
33
|
+
"@ckeditor/ckeditor5-cloud-services": "^35.3.2",
|
|
34
|
+
"@ckeditor/ckeditor5-core": "^35.3.2",
|
|
35
|
+
"@ckeditor/ckeditor5-editor-classic": "^35.3.2",
|
|
36
|
+
"@ckeditor/ckeditor5-enter": "^35.3.2",
|
|
37
|
+
"@ckeditor/ckeditor5-essentials": "^35.3.2",
|
|
38
|
+
"@ckeditor/ckeditor5-heading": "^35.3.2",
|
|
39
|
+
"@ckeditor/ckeditor5-image": "^35.3.2",
|
|
40
|
+
"@ckeditor/ckeditor5-link": "^35.3.2",
|
|
41
|
+
"@ckeditor/ckeditor5-list": "^35.3.2",
|
|
42
|
+
"@ckeditor/ckeditor5-mention": "^35.3.2",
|
|
43
|
+
"@ckeditor/ckeditor5-paragraph": "^35.3.2",
|
|
44
|
+
"@ckeditor/ckeditor5-table": "^35.3.2",
|
|
45
|
+
"@ckeditor/ckeditor5-theme-lark": "^35.3.2",
|
|
46
|
+
"@ckeditor/ckeditor5-typing": "^35.3.2",
|
|
47
|
+
"@ckeditor/ckeditor5-ui": "^35.3.2",
|
|
48
|
+
"@ckeditor/ckeditor5-undo": "^35.3.2",
|
|
49
|
+
"@ckeditor/ckeditor5-widget": "^35.3.2",
|
|
50
50
|
"typescript": "^4.8.4",
|
|
51
51
|
"webpack": "^5.58.1",
|
|
52
52
|
"webpack-cli": "^4.9.0"
|
|
@@ -100,6 +100,40 @@ export default class InputObserver extends DomEventObserver {
|
|
|
100
100
|
// @if CK_DEBUG_TYPING // }
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
|
+
// Normalize the insertText data that includes new-line characters.
|
|
104
|
+
// https://github.com/ckeditor/ckeditor5/issues/2045.
|
|
105
|
+
if (domEvent.inputType == 'insertText' && data && data.includes('\n')) {
|
|
106
|
+
// There might be a single new-line or double for new paragraph, but we translate
|
|
107
|
+
// it to paragraphs as it is our default action for enter handling.
|
|
108
|
+
const parts = data.split(/\n{1,2}/g);
|
|
109
|
+
let partTargetRanges = targetRanges;
|
|
110
|
+
for (let i = 0; i < parts.length; i++) {
|
|
111
|
+
const dataPart = parts[i];
|
|
112
|
+
if (dataPart != '') {
|
|
113
|
+
this.fire(domEvent.type, domEvent, {
|
|
114
|
+
data: dataPart,
|
|
115
|
+
dataTransfer,
|
|
116
|
+
targetRanges: partTargetRanges,
|
|
117
|
+
inputType: domEvent.inputType,
|
|
118
|
+
isComposing: domEvent.isComposing
|
|
119
|
+
});
|
|
120
|
+
// Use the result view selection so following events will be added one after another.
|
|
121
|
+
partTargetRanges = [viewDocument.selection.getFirstRange()];
|
|
122
|
+
}
|
|
123
|
+
if (i + 1 < parts.length) {
|
|
124
|
+
this.fire(domEvent.type, domEvent, {
|
|
125
|
+
inputType: 'insertParagraph',
|
|
126
|
+
targetRanges: partTargetRanges
|
|
127
|
+
});
|
|
128
|
+
// Use the result view selection so following events will be added one after another.
|
|
129
|
+
partTargetRanges = [viewDocument.selection.getFirstRange()];
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
// @if CK_DEBUG_TYPING // if ( window.logCKETyping ) {
|
|
133
|
+
// @if CK_DEBUG_TYPING // console.groupEnd();
|
|
134
|
+
// @if CK_DEBUG_TYPING // }
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
103
137
|
// Fire the normalized beforeInput event.
|
|
104
138
|
this.fire(domEvent.type, domEvent, {
|
|
105
139
|
data,
|