@syncfusion/ej2-richtexteditor 23.1.43 → 23.2.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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 23.1.43
3
+ * version : 23.2.4
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.44",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-CIPlpeV1ZJSthFtQHaNVAdANuI0M5aDYUT/Ar7obSF9TC4jwgwVIY0UdZ6KZC/dXzsAqRq1q7+QE8F5OzjvG7A==",
5
+ "_integrity": "sha512-fsFkpynFC1d3CrTaX57BGcF3GHHRX5jbxs8gdEOvx/Ctg4DPFrWsTQUthkZT1UpZJfqv7YTC0TmK3OoNt65p3g==",
6
6
  "_location": "/@syncfusion/ej2-richtexteditor",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -22,12 +22,11 @@
22
22
  "/@syncfusion/ej2-angular-richtexteditor",
23
23
  "/@syncfusion/ej2-gantt",
24
24
  "/@syncfusion/ej2-inplace-editor",
25
- "/@syncfusion/ej2-pdfviewer",
26
25
  "/@syncfusion/ej2-react-richtexteditor",
27
26
  "/@syncfusion/ej2-vue-richtexteditor"
28
27
  ],
29
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-23.1.41.tgz",
30
- "_shasum": "a9c6e53775552699f2528d6f4cf619a806d4660e",
28
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-23.1.44.tgz",
29
+ "_shasum": "da1060a6d62d138984f4565a75c86a4cf069b513",
31
30
  "_spec": "@syncfusion/ej2-richtexteditor@*",
32
31
  "_where": "/jenkins/workspace/elease-automation_release_23.1.1/packages/included",
33
32
  "author": {
@@ -38,13 +37,13 @@
38
37
  },
39
38
  "bundleDependencies": false,
40
39
  "dependencies": {
41
- "@syncfusion/ej2-base": "~23.1.41",
42
- "@syncfusion/ej2-buttons": "~23.1.43",
43
- "@syncfusion/ej2-filemanager": "~23.1.43",
44
- "@syncfusion/ej2-inputs": "~23.1.43",
45
- "@syncfusion/ej2-navigations": "~23.1.43",
46
- "@syncfusion/ej2-popups": "~23.1.43",
47
- "@syncfusion/ej2-splitbuttons": "~23.1.43"
40
+ "@syncfusion/ej2-base": "~23.2.4",
41
+ "@syncfusion/ej2-buttons": "~23.2.4",
42
+ "@syncfusion/ej2-filemanager": "~23.2.4",
43
+ "@syncfusion/ej2-inputs": "~23.2.4",
44
+ "@syncfusion/ej2-navigations": "~23.2.4",
45
+ "@syncfusion/ej2-popups": "~23.2.4",
46
+ "@syncfusion/ej2-splitbuttons": "~23.2.4"
48
47
  },
49
48
  "deprecated": false,
50
49
  "description": "Essential JS 2 RichTextEditor component",
@@ -70,6 +69,6 @@
70
69
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
71
70
  },
72
71
  "typings": "index.d.ts",
73
- "version": "23.1.43",
72
+ "version": "23.2.4",
74
73
  "sideEffects": false
75
74
  }
@@ -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
@@ -288,7 +288,14 @@ var SelectionCommands = /** @class */ (function () {
288
288
  }
289
289
  var formatNodeStyles = formatNode.getAttribute('style');
290
290
  var formatNodeTagName = formatNode.tagName;
291
- var child = InsertMethods.unwrap(formatNode);
291
+ var child;
292
+ if (formatNodeTagName === 'A' && format === 'underline') {
293
+ formatNode.style.textDecoration = 'none';
294
+ child = [formatNode];
295
+ }
296
+ else {
297
+ child = InsertMethods.unwrap(formatNode);
298
+ }
292
299
  if (child[0] && !isFontStyle) {
293
300
  var nodeTraverse = child[index] ? child[index] : child[0];
294
301
  var textNode = nodeTraverse;
@@ -80,12 +80,18 @@ var ToolbarStatus = /** @class */ (function () {
80
80
  if ((index === 0 && formatCollection.fontcolor) || !formatCollection.fontcolor) {
81
81
  nodeCollection.fontcolor = formatCollection.fontcolor;
82
82
  }
83
- if ((index === 0 && formatCollection.fontname) || !formatCollection.fontname) {
83
+ if (index === 0 && formatCollection.fontname) {
84
84
  nodeCollection.fontname = formatCollection.fontname;
85
85
  }
86
- if ((index === 0 && formatCollection.fontsize) || !formatCollection.fontsize) {
86
+ else {
87
+ nodeCollection.fontname = formatCollection.fontname === nodeCollection.fontname ? formatCollection.fontname : 'empty';
88
+ }
89
+ if (index === 0 && formatCollection.fontsize) {
87
90
  nodeCollection.fontsize = formatCollection.fontsize;
88
91
  }
92
+ else {
93
+ nodeCollection.fontsize = formatCollection.fontsize === nodeCollection.fontsize ? formatCollection.fontsize : 'empty';
94
+ }
89
95
  if ((index === 0 && formatCollection.backgroundcolor) || !formatCollection.backgroundcolor) {
90
96
  nodeCollection.backgroundcolor = formatCollection.backgroundcolor;
91
97
  }
@@ -98,9 +104,12 @@ var ToolbarStatus = /** @class */ (function () {
98
104
  if ((index === 0 && formatCollection.alignments) || !formatCollection.alignments) {
99
105
  nodeCollection.alignments = formatCollection.alignments;
100
106
  }
101
- if ((index === 0 && formatCollection.formats) || !formatCollection.formats) {
107
+ if (index === 0 && formatCollection.formats) {
102
108
  nodeCollection.formats = formatCollection.formats;
103
109
  }
110
+ else {
111
+ nodeCollection.formats = formatCollection.formats === nodeCollection.formats ? formatCollection.formats : 'empty';
112
+ }
104
113
  if ((index === 0 && formatCollection.createlink) || !formatCollection.createlink) {
105
114
  nodeCollection.createlink = formatCollection.createlink;
106
115
  }
@@ -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;
@@ -175,7 +175,7 @@ export function setToolbarStatus(e, isPopToolbar, self) {
175
175
  var formatItems = e.parent.format.types;
176
176
  var formatContent = isNOU(e.parent.format.default) ? formatItems[0].text :
177
177
  e.parent.format.default;
178
- result = getDropDownValue(formatItems, value, 'subCommand', 'text');
178
+ result = value === 'empty' ? '' : getDropDownValue(formatItems, value, 'subCommand', 'text');
179
179
  dropDown.formatDropDown.content = ('<span style="display: inline-flex;' +
180
180
  'width:' + e.parent.format.width + '" >' +
181
181
  '<span class="e-rte-dropdown-btn-text' + (isNOU(e.parent.cssClass) ? '' : ' ' + e.parent.cssClass) + '">'
@@ -201,7 +201,7 @@ export function setToolbarStatus(e, isPopToolbar, self) {
201
201
  break;
202
202
  }
203
203
  var fontNameItems = e.parent.fontFamily.items;
204
- result = getDropDownValue(fontNameItems, value, 'value', 'text');
204
+ result = value === 'empty' ? '' : getDropDownValue(fontNameItems, value, 'value', 'text');
205
205
  var fontNameContent = isNOU(e.parent.fontFamily.default) ? fontNameItems[0].text :
206
206
  e.parent.fontFamily.default;
207
207
  var name_1 = (isNOU(result) ? fontNameContent : result);
@@ -220,7 +220,7 @@ export function setToolbarStatus(e, isPopToolbar, self) {
220
220
  var fontSizeItems = e.parent.fontSize.items;
221
221
  var fontSizeContent = isNOU(e.parent.fontSize.default) ? fontSizeItems[1].text :
222
222
  e.parent.fontSize.default;
223
- result = getDropDownValue(fontSizeItems, (value === '' ? fontSizeContent.replace(/\s/g, '') : value), 'value', 'text');
223
+ result = value === 'empty' ? '' : getDropDownValue(fontSizeItems, (value === '' ? fontSizeContent.replace(/\s/g, '') : value), 'value', 'text');
224
224
  dropDown.fontSizeDropDown.content = ('<span style="display: inline-flex;' +
225
225
  'width:' + e.parent.fontSize.width + '" >' +
226
226
  '<span class="e-rte-dropdown-btn-text' + (isNOU(e.parent.cssClass) ? '' : ' ' + e.parent.cssClass) + '">'
@@ -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),