suneditor 3.0.0-alpha.2 → 3.0.0-alpha.4
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/README.md +1 -1
- package/dist/suneditor.min.css +1 -0
- package/dist/suneditor.min.js +1 -0
- package/package.json +4 -1
- package/src/assets/suneditor.css +10 -9
- package/src/core/base/eventHandlers/handler_ww_dragDrop.js +10 -5
- package/src/core/base/eventHandlers/handler_ww_key_input.js +28 -4
- package/src/core/base/eventManager.js +8 -2
- package/src/core/class/component.js +2 -2
- package/src/core/class/offset.js +32 -13
- package/src/core/class/selection.js +7 -5
- package/src/core/class/viewer.js +2 -2
- package/src/core/section/constructor.js +2 -5
- package/src/langs/en.js +11 -0
- package/src/langs/ko.js +48 -0
- package/src/modules/Controller.js +1 -1
- package/src/plugins/command/fileUpload.js +3 -3
- package/src/plugins/dropdown/table.js +4 -4
- package/src/plugins/modal/audio.js +5 -5
- package/src/plugins/modal/image.js +5 -5
- package/src/plugins/modal/video.js +5 -5
- /package/src/assets/{suneditor-content.css → suneditor-contents.css} +0 -0
|
@@ -1532,16 +1532,16 @@ Table.prototype = {
|
|
|
1532
1532
|
},
|
|
1533
1533
|
|
|
1534
1534
|
_setResizeLinePosition(figure, target, resizeLine, isLeftEdge) {
|
|
1535
|
-
const tdOffset = this.offset.
|
|
1536
|
-
const tableOffset = this.offset.
|
|
1535
|
+
const tdOffset = this.offset.getLocal(target);
|
|
1536
|
+
const tableOffset = this.offset.getLocal(figure);
|
|
1537
1537
|
resizeLine.style.left = `${tdOffset.left + (isLeftEdge ? 0 : target.offsetWidth)}px`;
|
|
1538
1538
|
resizeLine.style.top = `${tableOffset.top}px`;
|
|
1539
1539
|
resizeLine.style.height = `${figure.offsetHeight}px`;
|
|
1540
1540
|
},
|
|
1541
1541
|
|
|
1542
1542
|
_setResizeRowPosition(figure, target, resizeLine) {
|
|
1543
|
-
const rowOffset = this.offset.
|
|
1544
|
-
const tableOffset = this.offset.
|
|
1543
|
+
const rowOffset = this.offset.getLocal(target);
|
|
1544
|
+
const tableOffset = this.offset.getLocal(figure);
|
|
1545
1545
|
resizeLine.style.top = `${rowOffset.top + target.offsetHeight}px`;
|
|
1546
1546
|
resizeLine.style.left = `${tableOffset.left}px`;
|
|
1547
1547
|
resizeLine.style.width = `${figure.offsetWidth}px`;
|
|
@@ -96,7 +96,7 @@ Audio_.prototype = {
|
|
|
96
96
|
onPastAndDrop({ file }) {
|
|
97
97
|
if (!/^audio/.test(file.type)) return;
|
|
98
98
|
|
|
99
|
-
this.
|
|
99
|
+
this.submitFile([file]);
|
|
100
100
|
this.editor.focus();
|
|
101
101
|
|
|
102
102
|
return false;
|
|
@@ -108,9 +108,9 @@ Audio_.prototype = {
|
|
|
108
108
|
*/
|
|
109
109
|
modalAction() {
|
|
110
110
|
if (this.audioInputFile && this.audioInputFile?.files.length > 0) {
|
|
111
|
-
return this.
|
|
111
|
+
return this.submitFile(this.audioInputFile.files);
|
|
112
112
|
} else if (this.audioUrlFile && this.urlValue.length > 0) {
|
|
113
|
-
return this.
|
|
113
|
+
return this.submitURL(this.urlValue);
|
|
114
114
|
}
|
|
115
115
|
return false;
|
|
116
116
|
},
|
|
@@ -222,7 +222,7 @@ Audio_.prototype = {
|
|
|
222
222
|
}
|
|
223
223
|
},
|
|
224
224
|
|
|
225
|
-
async
|
|
225
|
+
async submitFile(fileList) {
|
|
226
226
|
if (fileList.length === 0) return false;
|
|
227
227
|
|
|
228
228
|
let fileSize = 0;
|
|
@@ -286,7 +286,7 @@ Audio_.prototype = {
|
|
|
286
286
|
return true;
|
|
287
287
|
},
|
|
288
288
|
|
|
289
|
-
async
|
|
289
|
+
async submitURL(url) {
|
|
290
290
|
if (url.length === 0) return false;
|
|
291
291
|
|
|
292
292
|
const file = { name: url.split('/').pop(), size: 0 };
|
|
@@ -174,7 +174,7 @@ Image_.prototype = {
|
|
|
174
174
|
onPastAndDrop({ file }) {
|
|
175
175
|
if (!/^image/.test(file.type)) return;
|
|
176
176
|
|
|
177
|
-
this.
|
|
177
|
+
this.submitFile([file]);
|
|
178
178
|
this.editor.focus();
|
|
179
179
|
|
|
180
180
|
return false;
|
|
@@ -193,9 +193,9 @@ Image_.prototype = {
|
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
if (this.imgInputFile && this.imgInputFile.files.length > 0) {
|
|
196
|
-
return await this.
|
|
196
|
+
return await this.submitFile(this.imgInputFile.files);
|
|
197
197
|
} else if (this.imgUrlFile && this._linkValue.length > 0) {
|
|
198
|
-
return await this.
|
|
198
|
+
return await this.submitURL(this._linkValue);
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
return false;
|
|
@@ -380,7 +380,7 @@ Image_.prototype = {
|
|
|
380
380
|
}
|
|
381
381
|
},
|
|
382
382
|
|
|
383
|
-
async
|
|
383
|
+
async submitFile(fileList) {
|
|
384
384
|
if (fileList.length === 0) return false;
|
|
385
385
|
|
|
386
386
|
let fileSize = 0;
|
|
@@ -443,7 +443,7 @@ Image_.prototype = {
|
|
|
443
443
|
if (result === true || result === NO_EVENT) handler(null);
|
|
444
444
|
},
|
|
445
445
|
|
|
446
|
-
async
|
|
446
|
+
async submitURL(url) {
|
|
447
447
|
if (!url) url = this._linkValue;
|
|
448
448
|
if (!url) return false;
|
|
449
449
|
|
|
@@ -171,7 +171,7 @@ Video.prototype = {
|
|
|
171
171
|
onPastAndDrop({ file }) {
|
|
172
172
|
if (!/^video/.test(file.type)) return;
|
|
173
173
|
|
|
174
|
-
this.
|
|
174
|
+
this.submitFile([file]);
|
|
175
175
|
this.editor.focus();
|
|
176
176
|
|
|
177
177
|
return false;
|
|
@@ -186,9 +186,9 @@ Video.prototype = {
|
|
|
186
186
|
|
|
187
187
|
let result = false;
|
|
188
188
|
if (this.videoInputFile && this.videoInputFile.files.length > 0) {
|
|
189
|
-
result = await this.
|
|
189
|
+
result = await this.submitFile(this.videoInputFile.files);
|
|
190
190
|
} else if (this.videoUrlFile && this._linkValue.length > 0) {
|
|
191
|
-
result = await this.
|
|
191
|
+
result = await this.submitURL(this._linkValue);
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
if (result) this._w.setTimeout(this.component.select.bind(this.component, this._element, 'video'), 0);
|
|
@@ -463,7 +463,7 @@ Video.prototype = {
|
|
|
463
463
|
};
|
|
464
464
|
},
|
|
465
465
|
|
|
466
|
-
async
|
|
466
|
+
async submitFile(fileList) {
|
|
467
467
|
if (fileList.length === 0) return;
|
|
468
468
|
|
|
469
469
|
let fileSize = 0;
|
|
@@ -526,7 +526,7 @@ Video.prototype = {
|
|
|
526
526
|
if (result === true || result === NO_EVENT) handler(null);
|
|
527
527
|
},
|
|
528
528
|
|
|
529
|
-
async
|
|
529
|
+
async submitURL(url) {
|
|
530
530
|
if (!url) url = this._linkValue;
|
|
531
531
|
if (!url) return false;
|
|
532
532
|
|
|
File without changes
|