@syncfusion/ej2-richtexteditor 19.4.54 → 19.4.55

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 : 19.4.54
3
+ * version : 19.4.55
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. 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@19.4.53",
3
+ "_id": "@syncfusion/ej2-richtexteditor@19.4.54",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-wTMXB43eT3dngxxLXS+5BzGvEwh5tZOHKUd+5lLXgD0eWrFWAljm79JdfitOb89dyPBUGVHvbEcYbentqdKbgg==",
5
+ "_integrity": "sha512-E70Pq8AxDcCeqVsy3fVzowvlB2+hDCyW3MUz4uUZclwpVisLIjWm9otu8fNK3bhw6HBUkAqGSx3BxRAFMzlfUQ==",
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": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-19.4.53.tgz",
30
- "_shasum": "f7a93f74a7396e02d0f4694f12c06a20e088ae84",
29
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-19.4.54.tgz",
30
+ "_shasum": "ddaef5ddb9d9ec7598dfc300179180bd1fcbe491",
31
31
  "_spec": "@syncfusion/ej2-richtexteditor@*",
32
32
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
33
33
  "author": {
@@ -39,10 +39,10 @@
39
39
  "bundleDependencies": false,
40
40
  "dependencies": {
41
41
  "@syncfusion/ej2-base": "~19.4.52",
42
- "@syncfusion/ej2-buttons": "~19.4.53",
42
+ "@syncfusion/ej2-buttons": "~19.4.55",
43
43
  "@syncfusion/ej2-filemanager": "~19.4.52",
44
44
  "@syncfusion/ej2-inputs": "~19.4.52",
45
- "@syncfusion/ej2-navigations": "~19.4.53",
45
+ "@syncfusion/ej2-navigations": "~19.4.55",
46
46
  "@syncfusion/ej2-popups": "~19.4.53",
47
47
  "@syncfusion/ej2-splitbuttons": "~19.4.52"
48
48
  },
@@ -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": "19.4.54",
73
+ "version": "19.4.55",
74
74
  "sideEffects": false
75
75
  }
@@ -218,7 +218,12 @@ var ImageCommand = /** @class */ (function () {
218
218
  ImageCommand.prototype.removeImage = function (e) {
219
219
  if (closest(e.item.selectNode[0], 'a')) {
220
220
  if (e.item.selectNode[0].parentElement.nodeName === 'A' && !isNOU(e.item.selectNode[0].parentElement.innerText)) {
221
- detach(e.item.selectNode[0]);
221
+ if (!isNOU(closest(e.item.selectNode[0], '.' + classes.CLASS_CAPTION))) {
222
+ detach(closest(e.item.selectNode[0], '.' + classes.CLASS_CAPTION));
223
+ }
224
+ else {
225
+ detach(e.item.selectNode[0]);
226
+ }
222
227
  }
223
228
  else {
224
229
  detach(closest(e.item.selectNode[0], 'a'));
@@ -74,6 +74,11 @@ var LinkCommand = /** @class */ (function () {
74
74
  else {
75
75
  var domSelection = new NodeSelection();
76
76
  var range = domSelection.getRange(this.parent.currentDocument);
77
+ if (range.endContainer.nodeName === '#text' && range.startContainer.textContent.length === (range.endOffset + 1) &&
78
+ range.endContainer.textContent.charAt(range.endOffset) === ' ' && range.endContainer.nextSibling.nodeName === 'A') {
79
+ domSelection.setSelectionText(this.parent.currentDocument, range.startContainer, range.endContainer, range.startOffset, range.endOffset + 1);
80
+ range = domSelection.getRange(this.parent.currentDocument);
81
+ }
77
82
  var text = isNOU(e.item.text) ? true : e.item.text.replace(/ /g, '').localeCompare(range.toString()
78
83
  .replace(/\n/g, ' ').replace(/ /g, '')) < 0;
79
84
  if (e.event && e.event.type === 'keydown' && (e.event.keyCode === 32
@@ -407,6 +407,14 @@ var Lists = /** @class */ (function () {
407
407
  };
408
408
  Lists.prototype.applyListsHandler = function (e) {
409
409
  var range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
410
+ if (range.startContainer === range.endContainer && range.startContainer === this.parent.editableElement &&
411
+ range.startOffset === range.endOffset && range.startOffset === 0 &&
412
+ this.parent.editableElement.textContent.length === 0 && (this.parent.editableElement.childNodes[0].nodeName != 'TABLE' &&
413
+ this.parent.editableElement.childNodes[0].nodeName != 'IMG')) {
414
+ var focusNode = range.startContainer.childNodes[0];
415
+ this.parent.nodeSelection.setSelectionText(this.parent.currentDocument, focusNode, focusNode, 0, 0);
416
+ range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
417
+ }
410
418
  this.saveSelection = this.parent.nodeSelection.save(range, this.parent.currentDocument);
411
419
  this.currentAction = e.subCommand;
412
420
  this.currentAction = e.subCommand = this.currentAction === 'NumberFormatList' ? 'OL' : this.currentAction === 'BulletFormatList' ? 'UL' : this.currentAction;
@@ -110,6 +110,7 @@ var SelectionCommands = /** @class */ (function () {
110
110
  };
111
111
  SelectionCommands.insertCursorNode = function (docElement, domSelection, range, isFormatted, nodeCutter, format, value, endNode) {
112
112
  var cursorNodes = domSelection.getNodeCollection(range);
113
+ var domNode = new DOMNode(endNode, docElement);
113
114
  var cursorFormat = (cursorNodes.length > 0) ?
114
115
  (cursorNodes.length > 1 && range.startContainer === range.endContainer) ?
115
116
  this.getCursorFormat(isFormatted, cursorNodes, format, endNode) :
@@ -117,12 +118,17 @@ var SelectionCommands = /** @class */ (function () {
117
118
  var cursorNode = null;
118
119
  if (cursorFormat) {
119
120
  cursorNode = cursorNodes[0];
120
- if (cursorFormat.firstChild.textContent.charCodeAt(0) === 8203) {
121
+ if (cursorFormat.firstChild.textContent.charCodeAt(0) === 8203 && cursorFormat.firstChild.nodeType === 3) {
121
122
  var isCursorEqual = false;
122
123
  var regEx = new RegExp(String.fromCharCode(8203), 'g');
123
124
  var emptySpaceNode = void 0;
124
125
  if (cursorFormat.firstChild === cursorNode) {
125
- cursorNode.textContent = cursorNode.textContent.replace(regEx, '');
126
+ cursorNode.textContent = (cursorFormat.parentElement && (domNode.isBlockNode(cursorFormat.parentElement) &&
127
+ cursorFormat.parentElement.textContent.length <= 1 ? cursorFormat.parentElement.childElementCount > 1 :
128
+ cursorFormat.childElementCount === 0) &&
129
+ (cursorFormat.parentElement.textContent.length > 1 ||
130
+ cursorFormat.parentElement.firstChild && cursorFormat.parentElement.firstChild.nodeType === 1) ?
131
+ cursorNode.textContent : cursorNode.textContent.replace(regEx, ''));
126
132
  emptySpaceNode = cursorNode;
127
133
  isCursorEqual = true;
128
134
  }
@@ -106,7 +106,9 @@ var HtmlEditor = /** @class */ (function () {
106
106
  this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), range.startContainer, pointer);
107
107
  }
108
108
  if (!isNOU(range.startContainer.previousSibling) && !isNOU(range.startContainer.previousSibling.parentElement) &&
109
- range.startContainer.parentElement === range.startContainer.previousSibling.parentElement && range.startContainer.previousSibling.textContent.charCodeAt(0) === 8203) {
109
+ range.startContainer.parentElement === range.startContainer.previousSibling.parentElement &&
110
+ range.startContainer.previousSibling.textContent.charCodeAt(0) === 8203 &&
111
+ range.startContainer.previousSibling.textContent.length <= 1) {
110
112
  range.startContainer.previousSibling.textContent = range.startContainer.previousSibling.textContent.replace(regEx, '');
111
113
  }
112
114
  if (range.endContainer.textContent.charCodeAt(range.endOffset) === 8203) {
@@ -1846,7 +1846,8 @@ var Image = /** @class */ (function () {
1846
1846
  if (activePopupElement) {
1847
1847
  activePopupElement.classList.add(classes.CLS_HIDE);
1848
1848
  }
1849
- if (e.dataTransfer.files.length > 0) { //For external image drag and drop
1849
+ var imgElement = this.parent.inputElement.ownerDocument.querySelector('.' + classes.CLS_RTE_DRAG_IMAGE);
1850
+ if (e.dataTransfer.files.length > 0 && imgElement === null) { //For external image drag and drop
1850
1851
  if (e.dataTransfer.files.length > 1) {
1851
1852
  return;
1852
1853
  }
@@ -1869,7 +1870,6 @@ var Image = /** @class */ (function () {
1869
1870
  }
1870
1871
  else { //For internal image drag and drop
1871
1872
  var range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
1872
- var imgElement = this.parent.inputElement.ownerDocument.querySelector('.' + classes.CLS_RTE_DRAG_IMAGE);
1873
1873
  if (imgElement && imgElement.tagName === 'IMG') {
1874
1874
  if (imgElement.nextElementSibling) {
1875
1875
  if (imgElement.nextElementSibling.classList.contains(classes.CLS_IMG_INNER)) {
@@ -511,7 +511,7 @@ var Table = /** @class */ (function () {
511
511
  return;
512
512
  }
513
513
  var target = e.target || e.targetTouches[0].target;
514
- var closestTable = closest(target, 'table');
514
+ var closestTable = closest(target, 'table.e-rte-table');
515
515
  if (!isNOU(this.curTable) && !isNOU(closestTable) && closestTable !== this.curTable) {
516
516
  this.removeResizeElement();
517
517
  this.removeHelper(e);