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.
@@ -1532,16 +1532,16 @@ Table.prototype = {
1532
1532
  },
1533
1533
 
1534
1534
  _setResizeLinePosition(figure, target, resizeLine, isLeftEdge) {
1535
- const tdOffset = this.offset.get(target);
1536
- const tableOffset = this.offset.get(figure);
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.get(target);
1544
- const tableOffset = this.offset.get(figure);
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._submitFile([file]);
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._submitFile(this.audioInputFile.files);
111
+ return this.submitFile(this.audioInputFile.files);
112
112
  } else if (this.audioUrlFile && this.urlValue.length > 0) {
113
- return this._submitURL(this.urlValue);
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 _submitFile(fileList) {
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 _submitURL(url) {
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._submitFile([file]);
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._submitFile(this.imgInputFile.files);
196
+ return await this.submitFile(this.imgInputFile.files);
197
197
  } else if (this.imgUrlFile && this._linkValue.length > 0) {
198
- return await this._submitURL(this._linkValue);
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 _submitFile(fileList) {
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 _submitURL(url) {
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._submitFile([file]);
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._submitFile(this.videoInputFile.files);
189
+ result = await this.submitFile(this.videoInputFile.files);
190
190
  } else if (this.videoUrlFile && this._linkValue.length > 0) {
191
- result = await this._submitURL(this._linkValue);
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 _submitFile(fileList) {
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 _submitURL(url) {
529
+ async submitURL(url) {
530
530
  if (!url) url = this._linkValue;
531
531
  if (!url) return false;
532
532