@syncfusion/ej2-richtexteditor 21.1.35 → 21.1.39

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.
@@ -3003,8 +3003,9 @@ function decode(value) {
3003
3003
  function sanitizeHelper(value, parent) {
3004
3004
  if (parent.enableHtmlSanitizer) {
3005
3005
  var item = SanitizeHtmlHelper.beforeSanitize();
3006
- if (item.selectors.tags[2] && item.selectors.tags[2].indexOf('iframe') > -1)
3006
+ if (item.selectors.tags[2] && item.selectors.tags[2].indexOf('iframe') > -1) {
3007
3007
  item.selectors.tags[2] = 'iframe:not(.e-rte-embed-url)';
3008
+ }
3008
3009
  var beforeEvent = {
3009
3010
  cancel: false,
3010
3011
  helper: null
@@ -14547,8 +14548,9 @@ var VideoCommand = /** @__PURE__ @class */ (function () {
14547
14548
  : (Browser.isIE ? selectedNode : !e.item.isEmbedUrl ? selectedNode.lastElementChild : selectedNode.querySelector('iframe'));
14548
14549
  videoElm_1.addEventListener(videoElm_1.tagName !== 'IFRAME' ? 'loadeddata' : 'load', function () {
14549
14550
  if (e.value !== 'VideoReplace' || !isReplaced) {
14550
- if (e.item.isEmbedUrl && videoElm_1)
14551
+ if (e.item.isEmbedUrl && videoElm_1) {
14551
14552
  videoElm_1.classList.add('e-rte-embed-url');
14553
+ }
14552
14554
  e.callBack({
14553
14555
  requestType: 'Videos',
14554
14556
  editorMode: 'HTML',
@@ -14979,8 +14981,19 @@ var TableCommand = /** @__PURE__ @class */ (function () {
14979
14981
  if (j === 0 || allCells[maxI][j] !== allCells[maxI][j - 1]) {
14980
14982
  if (1 < parseInt(allCells[maxI][j].getAttribute('rowspan'), 10)) {
14981
14983
  var rowSpanVal = parseInt(allCells[maxI][j].getAttribute('rowspan'), 10) - 1;
14982
- //eslint-disable-next-line
14983
- 1 === rowSpanVal ? allCells[maxI][j].removeAttribute('rowspan') : allCells[maxI][j].setAttribute('rowspan', rowSpanVal.toString());
14984
+ /* eslint-disable */
14985
+ if (1 === rowSpanVal) {
14986
+ allCells[maxI][j].removeAttribute('rowspan');
14987
+ var cell = allCells[maxI][j].cloneNode(true);
14988
+ allCells = this.getCorrespondingColumns();
14989
+ if (allCells[rowSpanVal][j] && allCells[rowSpanVal][j].parentElement) {
14990
+ allCells[rowSpanVal][j].parentElement.insertBefore(cell, allCells[rowSpanVal][j]);
14991
+ }
14992
+ }
14993
+ else {
14994
+ allCells[maxI][j].setAttribute('rowspan', rowSpanVal.toString());
14995
+ }
14996
+ /* eslint-enable */
14984
14997
  }
14985
14998
  }
14986
14999
  // eslint-disable-next-line max-len
@@ -17191,6 +17204,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
17191
17204
  if (!isNullOrUndefined(imgElem[i].getAttribute('v:shapes')) &&
17192
17205
  imgElem[i].getAttribute('v:shapes').indexOf('Picture') < 0 &&
17193
17206
  imgElem[i].getAttribute('v:shapes').indexOf('圖片') < 0 &&
17207
+ imgElem[i].getAttribute('v:shapes').indexOf('Grafik') < 0 &&
17194
17208
  imgElem[i].getAttribute('v:shapes').indexOf('Image') < 0) {
17195
17209
  detach(imgElem[i]);
17196
17210
  }
@@ -17285,7 +17299,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
17285
17299
  MsWordPaste.prototype.hexConversion = function (rtfData) {
17286
17300
  // eslint-disable-next-line
17287
17301
  var picHead = /\{\\pict[\s\S]+?\\bliptag\-?\d+(\\blipupi\-?\d+)?(\{\\\*\\blipuid\s?[\da-fA-F]+)?[\s\}]*?/;
17288
- // eslint-disable-next-line security/detect-non-literal-regexp
17302
+ // eslint-disable-next-line
17289
17303
  var pic = new RegExp('(?:(' + picHead.source + '))([\\da-fA-F\\s]+)\\}', 'g');
17290
17304
  var fullImg = rtfData.match(pic);
17291
17305
  var imgType;
@@ -17349,9 +17363,9 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
17349
17363
  MsWordPaste.prototype.removeUnwantedElements = function (elm) {
17350
17364
  var innerElement = elm.innerHTML;
17351
17365
  for (var i = 0; i < this.removableElements.length; i++) {
17352
- // eslint-disable-next-line security/detect-non-literal-regexp
17366
+ // eslint-disable-next-line
17353
17367
  var regExpStartElem = new RegExp('<' + this.removableElements[i] + '>', 'g');
17354
- // eslint-disable-next-line security/detect-non-literal-regexp
17368
+ // eslint-disable-next-line
17355
17369
  var regExpEndElem = new RegExp('</' + this.removableElements[i] + '>', 'g');
17356
17370
  innerElement = innerElement.replace(regExpStartElem, '');
17357
17371
  innerElement = innerElement.replace(regExpEndElem, '');
@@ -22795,7 +22809,7 @@ var Image = /** @__PURE__ @class */ (function () {
22795
22809
  if (isNullOrUndefined(img.width)) {
22796
22810
  return;
22797
22811
  }
22798
- // eslint-disable-next-line security/detect-unsafe-regex
22812
+ // eslint-disable-next-line
22799
22813
  var width = img.style.width !== '' ? img.style.width.match(/^\d+(\.\d*)?%$/g) ? parseFloat(img.style.width) :
22800
22814
  parseInt(img.style.width, 10) : img.width;
22801
22815
  var height = img.style.height !== '' ? parseInt(img.style.height, 10) : img.height;
@@ -22833,7 +22847,7 @@ var Image = /** @__PURE__ @class */ (function () {
22833
22847
  img.setAttribute('width', (img.width + this.mouseX).toString());
22834
22848
  }
22835
22849
  else {
22836
- var currentWidth = img.offsetWidth === 0 ? img.width + this.mouseX + parseInt(img.style.outlineWidth.split('p')[0]) : img.offsetWidth + this.mouseX;
22850
+ var currentWidth = img.offsetWidth === 0 ? img.width + this.mouseX + parseInt(img.style.outlineWidth.split('p')[0], 10) : img.offsetWidth + this.mouseX;
22837
22851
  img.setAttribute('width', (currentWidth).toString());
22838
22852
  }
22839
22853
  }
@@ -30722,7 +30736,6 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
30722
30736
  var currentEndContainer = range.endContainer;
30723
30737
  var currentStartOffset = range.startOffset;
30724
30738
  var isSameContainer = currentStartContainer === currentEndContainer ? true : false;
30725
- var currentEndOffset = currentEndContainer.textContent.length;
30726
30739
  var endNode = range.endContainer.nodeName === '#text' ? range.endContainer.parentElement :
30727
30740
  range.endContainer;
30728
30741
  var closestLI = closest(endNode, 'LI');