@syncfusion/ej2-richtexteditor 23.1.43 → 23.1.44

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 23.1.43
3
+ * version : 23.1.44
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-richtexteditor@*",
3
- "_id": "@syncfusion/ej2-richtexteditor@23.1.41",
3
+ "_id": "@syncfusion/ej2-richtexteditor@23.1.43",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-CIPlpeV1ZJSthFtQHaNVAdANuI0M5aDYUT/Ar7obSF9TC4jwgwVIY0UdZ6KZC/dXzsAqRq1q7+QE8F5OzjvG7A==",
5
+ "_integrity": "sha512-jgzplcFRi5rmn0kbDEri7p8DT1c7WyfUq6Gc4tDWhQX0voLlzxQaCv0VOf/zK/PB4PSbu4eaTIsuvOQlY7bmzA==",
6
6
  "_location": "/@syncfusion/ej2-richtexteditor",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -26,8 +26,8 @@
26
26
  "/@syncfusion/ej2-react-richtexteditor",
27
27
  "/@syncfusion/ej2-vue-richtexteditor"
28
28
  ],
29
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-23.1.41.tgz",
30
- "_shasum": "a9c6e53775552699f2528d6f4cf619a806d4660e",
29
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-23.1.43.tgz",
30
+ "_shasum": "c003b36ae31089222d8492e3cdb00d29a82d6703",
31
31
  "_spec": "@syncfusion/ej2-richtexteditor@*",
32
32
  "_where": "/jenkins/workspace/elease-automation_release_23.1.1/packages/included",
33
33
  "author": {
@@ -42,8 +42,8 @@
42
42
  "@syncfusion/ej2-buttons": "~23.1.43",
43
43
  "@syncfusion/ej2-filemanager": "~23.1.43",
44
44
  "@syncfusion/ej2-inputs": "~23.1.43",
45
- "@syncfusion/ej2-navigations": "~23.1.43",
46
- "@syncfusion/ej2-popups": "~23.1.43",
45
+ "@syncfusion/ej2-navigations": "~23.1.44",
46
+ "@syncfusion/ej2-popups": "~23.1.44",
47
47
  "@syncfusion/ej2-splitbuttons": "~23.1.43"
48
48
  },
49
49
  "deprecated": false,
@@ -70,6 +70,6 @@
70
70
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
71
71
  },
72
72
  "typings": "index.d.ts",
73
- "version": "23.1.43",
73
+ "version": "23.1.44",
74
74
  "sideEffects": false
75
75
  }
@@ -503,14 +503,18 @@ var InsertHtml = /** @class */ (function () {
503
503
  };
504
504
  InsertHtml.removeEmptyElements = function (element) {
505
505
  var emptyElements = element.querySelectorAll(':empty');
506
- for (var i = 0; i < emptyElements.length; i++) {
506
+ var nonSvgEmptyElements = Array.from(emptyElements).filter(function (element) {
507
+ // Check if the element is an SVG element or an ancestor of an SVG element
508
+ return !element.closest('svg') && !element.closest('canvas');
509
+ });
510
+ for (var i = 0; i < nonSvgEmptyElements.length; i++) {
507
511
  var lineWithDiv = true;
508
- if (emptyElements[i].tagName === 'DIV') {
509
- lineWithDiv = emptyElements[i].style.borderBottom === 'none' ||
510
- emptyElements[i].style.borderBottom === '' ? true : false;
512
+ if (nonSvgEmptyElements[i].tagName === 'DIV') {
513
+ lineWithDiv = nonSvgEmptyElements[i].style.borderBottom === 'none' ||
514
+ nonSvgEmptyElements[i].style.borderBottom === '' ? true : false;
511
515
  }
512
- if (CONSTANT.SELF_CLOSING_TAGS.indexOf(emptyElements[i].tagName.toLowerCase()) < 0 && lineWithDiv) {
513
- var detachableElement = this.findDetachEmptyElem(emptyElements[i]);
516
+ if (CONSTANT.SELF_CLOSING_TAGS.indexOf(nonSvgEmptyElements[i].tagName.toLowerCase()) < 0 && lineWithDiv) {
517
+ var detachableElement = this.findDetachEmptyElem(nonSvgEmptyElements[i]);
514
518
  if (!isNOU(detachableElement)) {
515
519
  detach(detachableElement);
516
520
  }
@@ -85,6 +85,12 @@ var LinkCommand = /** @class */ (function () {
85
85
  || e.event.keyCode === 13) || e.item.action === 'Paste' || range.collapsed || text) {
86
86
  var anchor = this.createAchorNode(e);
87
87
  anchor.innerText = e.item.text === '' ? e.item.url : e.item.text;
88
+ var text_1 = anchor.innerText;
89
+ // Replace spaces with non-breaking spaces
90
+ var modifiedText = text_1.replace(/ +/g, function (match) {
91
+ return '\u00A0'.repeat(match.length);
92
+ });
93
+ anchor.innerText = modifiedText;
88
94
  e.item.selection.restore();
89
95
  InsertHtml.Insert(this.parent.currentDocument, anchor, this.parent.editableElement);
90
96
  if (e.event && e.event.type === 'keydown' && (e.event.keyCode === 32
@@ -482,6 +482,14 @@ var EnterKeyAction = /** @class */ (function () {
482
482
  else if ((this.parent.enterKey === 'P' && !shiftKey) || (this.parent.shiftEnterKey === 'P' && shiftKey)) {
483
483
  insertElem = this.parent.createElement('p');
484
484
  }
485
+ var previousBlockNode = this.parent.formatter.editorManager.domNode.blockNodes()[0].previousSibling;
486
+ var nextBlockNode = this.parent.formatter.editorManager.domNode.blockNodes()[0].nextSibling;
487
+ if (!isNOU(previousBlockNode) && previousBlockNode.hasAttribute('style')) {
488
+ insertElem.setAttribute('style', previousBlockNode.getAttribute('style'));
489
+ }
490
+ if (isNOU(previousBlockNode) && !isNOU(nextBlockNode) && nextBlockNode.hasAttribute('style')) {
491
+ insertElem.setAttribute('style', nextBlockNode.getAttribute('style'));
492
+ }
485
493
  return insertElem;
486
494
  };
487
495
  return EnterKeyAction;
@@ -1046,9 +1046,10 @@ var Image = /** @class */ (function () {
1046
1046
  var getAlt = (e.selectNode[0].getAttribute('alt') === null) ? '' :
1047
1047
  e.selectNode[0].getAttribute('alt');
1048
1048
  var content = '<div class="e-rte-field' + ' ' + this.parent.cssClass + '">' +
1049
- '<input type="text" spellcheck="false" value="' + getAlt + '" class="e-input e-img-alt' + ' ' + this.parent.cssClass + '" placeholder="' + altText + '"/>' +
1049
+ '<input type="text" spellcheck="false" class="e-input e-img-alt' + ' ' + this.parent.cssClass + '" placeholder="' + altText + '"/>' +
1050
1050
  '</div>';
1051
1051
  var contentElem = parseHtml(content);
1052
+ contentElem.querySelector('input').setAttribute('value', getAlt);
1052
1053
  altWrap.appendChild(contentElem);
1053
1054
  var inputAlt = altWrap.querySelector('.e-img-alt');
1054
1055
  var altArgs_1 = {
@@ -1584,14 +1585,12 @@ var Image = /** @class */ (function () {
1584
1585
  this.changedWidthValue = null;
1585
1586
  this.changedHeightValue = null;
1586
1587
  var content = '<div class="e-rte-label' + ' ' + this.parent.cssClass + '"><label>' + imgWidth +
1587
- '</label></div><div class="e-rte-field' + ' ' + this.parent.cssClass + '"><input type="text" id="imgwidth" class="e-img-width' + ' ' + this.parent.cssClass + '" value=' +
1588
- widthVal
1589
- + ' /></div>' +
1588
+ '</label></div><div class="e-rte-field' + ' ' + this.parent.cssClass + '"><input type="text" id="imgwidth" class="e-img-width' + ' ' + this.parent.cssClass + '/></div>' +
1590
1589
  '<div class="e-rte-label' + ' ' + this.parent.cssClass + '">' + '<label>' + imgHeight + '</label></div><div class="e-rte-field' + ' ' + this.parent.cssClass + '"> ' +
1591
- '<input type="text" id="imgheight" class="e-img-height' + ' ' + this.parent.cssClass + '" value=' +
1592
- heightVal
1593
- + ' /></div>';
1590
+ '<input type="text" id="imgheight" class="e-img-height' + ' ' + this.parent.cssClass + '"/></div>';
1594
1591
  var contentElem = parseHtml(content);
1592
+ contentElem.getElementById('imgwidth').setAttribute('value', widthVal);
1593
+ contentElem.getElementById('imgheight').setAttribute('value', heightVal);
1595
1594
  imgSizeWrap.appendChild(contentElem);
1596
1595
  this.widthNum = new TextBox({
1597
1596
  value: formatUnit(widthVal),