@syncfusion/ej2-richtexteditor 20.4.42 → 20.4.43

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 : 20.4.42
3
+ * version : 20.4.43
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@20.4.40",
3
+ "_id": "@syncfusion/ej2-richtexteditor@20.4.42",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-ZukcHwmMRufizhf2PBts+HIiwO1zIpUm+h8zLxPLWG6KMnls5UpMuAqlGWpi7DsNhhUJQW3DZzcp00tpVm4jlg==",
5
+ "_integrity": "sha512-6Q5JaOeGQcmOpqZLxpR9o6ogvnsJeAW3sJdpshqeRUAKt4w7yd/ly3Ny0qolUjjplp00hESAS1Kh3l6BbK98jw==",
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-20.4.40.tgz",
30
- "_shasum": "a1ba4e9e14bfac4857e949a8e9a5de064fec7034",
29
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-20.4.42.tgz",
30
+ "_shasum": "67c24a82816a8ebbedfafbb18e734dfbffc17144",
31
31
  "_spec": "@syncfusion/ej2-richtexteditor@*",
32
32
  "_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
33
33
  "author": {
@@ -40,10 +40,10 @@
40
40
  "dependencies": {
41
41
  "@syncfusion/ej2-base": "~20.4.42",
42
42
  "@syncfusion/ej2-buttons": "~20.4.42",
43
- "@syncfusion/ej2-filemanager": "~20.4.42",
43
+ "@syncfusion/ej2-filemanager": "~20.4.43",
44
44
  "@syncfusion/ej2-inputs": "~20.4.42",
45
- "@syncfusion/ej2-navigations": "~20.4.42",
46
- "@syncfusion/ej2-popups": "~20.4.42",
45
+ "@syncfusion/ej2-navigations": "~20.4.43",
46
+ "@syncfusion/ej2-popups": "~20.4.43",
47
47
  "@syncfusion/ej2-splitbuttons": "~20.4.42"
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": "20.4.42",
73
+ "version": "20.4.43",
74
74
  "sideEffects": false
75
75
  }
@@ -247,52 +247,62 @@ var InsertHtml = /** @class */ (function () {
247
247
  }
248
248
  }
249
249
  else {
250
- this.insertTempNode(range, node, nodes, nodeCutter, editNode);
251
- var isFirstTextNode = true;
252
- var isPreviousInlineElem = void 0;
253
- var paraElm = void 0;
254
- var previousParent = void 0;
255
- if (!this.contentsDeleted) {
256
- range.deleteContents();
257
- }
258
- while (node.firstChild) {
259
- if (node.firstChild.nodeName === '#text' && node.firstChild.textContent.trim() === '') {
260
- detach(node.firstChild);
261
- continue;
250
+ var parentElem = range.startContainer;
251
+ while (!isNOU(parentElem) && parentElem.nodeName !== 'PRE' && parentElem !== editNode) {
252
+ parentElem = parentElem.parentElement;
253
+ }
254
+ if (!isNOU(node) && !isNOU(parentElem) && parentElem.nodeName === 'PRE') {
255
+ range.insertNode(node);
256
+ lastSelectionNode = node.lastChild;
257
+ }
258
+ else {
259
+ this.insertTempNode(range, node, nodes, nodeCutter, editNode);
260
+ var isFirstTextNode = true;
261
+ var isPreviousInlineElem = void 0;
262
+ var paraElm = void 0;
263
+ var previousParent = void 0;
264
+ if (!this.contentsDeleted) {
265
+ range.deleteContents();
262
266
  }
263
- if (node.firstChild.nodeName === '#text' && isFirstTextNode ||
264
- (this.inlineNode.indexOf(node.firstChild.nodeName.toLocaleLowerCase()) >= 0 && isFirstTextNode)) {
265
- lastSelectionNode = node.firstChild;
266
- if (isNOU(node.previousElementSibling)) {
267
- var firstParaElm = createElement('p');
268
- node.parentElement.insertBefore(firstParaElm, node);
267
+ while (node.firstChild) {
268
+ if (node.firstChild.nodeName === '#text' && node.firstChild.textContent.trim() === '') {
269
+ detach(node.firstChild);
270
+ continue;
269
271
  }
270
- node.previousElementSibling.appendChild(node.firstChild);
271
- }
272
- else {
273
- lastSelectionNode = node.firstChild;
274
- if (node.firstChild.nodeName === '#text' ||
275
- (this.inlineNode.indexOf(node.firstChild.nodeName.toLocaleLowerCase()) >= 0)) {
276
- if (!isPreviousInlineElem) {
277
- paraElm = createElement('p');
278
- paraElm.appendChild(node.firstChild);
279
- fragment.appendChild(paraElm);
280
- }
281
- else {
282
- previousParent.appendChild(node.firstChild);
283
- fragment.appendChild(previousParent);
272
+ if (node.firstChild.nodeName === '#text' && isFirstTextNode ||
273
+ (this.inlineNode.indexOf(node.firstChild.nodeName.toLocaleLowerCase()) >= 0 && isFirstTextNode)) {
274
+ lastSelectionNode = node.firstChild;
275
+ if (isNOU(node.previousElementSibling)) {
276
+ var firstParaElm = createElement('p');
277
+ node.parentElement.insertBefore(firstParaElm, node);
284
278
  }
285
- previousParent = paraElm;
286
- isPreviousInlineElem = true;
279
+ node.previousElementSibling.appendChild(node.firstChild);
287
280
  }
288
281
  else {
289
- fragment.appendChild(node.firstChild);
290
- isPreviousInlineElem = false;
282
+ lastSelectionNode = node.firstChild;
283
+ if (node.firstChild.nodeName === '#text' ||
284
+ (this.inlineNode.indexOf(node.firstChild.nodeName.toLocaleLowerCase()) >= 0)) {
285
+ if (!isPreviousInlineElem) {
286
+ paraElm = createElement('p');
287
+ paraElm.appendChild(node.firstChild);
288
+ fragment.appendChild(paraElm);
289
+ }
290
+ else {
291
+ previousParent.appendChild(node.firstChild);
292
+ fragment.appendChild(previousParent);
293
+ }
294
+ previousParent = paraElm;
295
+ isPreviousInlineElem = true;
296
+ }
297
+ else {
298
+ fragment.appendChild(node.firstChild);
299
+ isPreviousInlineElem = false;
300
+ }
301
+ isFirstTextNode = false;
291
302
  }
292
- isFirstTextNode = false;
293
303
  }
304
+ node.parentNode.replaceChild(fragment, node);
294
305
  }
295
- node.parentNode.replaceChild(fragment, node);
296
306
  }
297
307
  if (lastSelectionNode.nodeName === '#text') {
298
308
  this.placeCursorEnd(lastSelectionNode, node, nodeSelection, docElement, editNode);
@@ -109,10 +109,12 @@ var HtmlEditor = /** @class */ (function () {
109
109
  // eslint-disable-next-line
110
110
  var regEx = new RegExp(String.fromCharCode(8203), 'g');
111
111
  var pointer;
112
+ var isRootParent = false;
112
113
  if (restrictKeys.indexOf(args.keyCode) < 0 && !args.shiftKey && !args.ctrlKey && !args.altKey) {
113
114
  pointer = range.startOffset;
114
115
  // eslint-disable-next-line @typescript-eslint/no-unused-expressions
115
- range.startContainer.nodeName === '#text' ? range.startContainer.parentElement.classList.add('currentStartMark') : range.startContainer.classList.add('currentStartMark');
116
+ range.startContainer.nodeName === '#text' ? range.startContainer.parentElement !== this.parent.inputElement ? range.startContainer.parentElement.classList.add('currentStartMark')
117
+ : isRootParent = true : range.startContainer.classList.add('currentStartMark');
116
118
  if (range.startContainer.textContent.charCodeAt(0) === 8203) {
117
119
  pointer = range.startOffset === 0 ? range.startOffset : range.startOffset - 1;
118
120
  range.startContainer.textContent = range.startContainer.textContent.replace(regEx, '');
@@ -121,7 +123,7 @@ var HtmlEditor = /** @class */ (function () {
121
123
  var previousLength = this.parent.inputElement.innerHTML.length;
122
124
  var currentLength = this.parent.inputElement.innerHTML.replace(regEx, '').length;
123
125
  var focusNode = range.startContainer;
124
- if (previousLength > currentLength) {
126
+ if (previousLength > currentLength && !isRootParent) {
125
127
  var currentChild = this.parent.inputElement.firstChild;
126
128
  while (!isNOU(currentChild) && currentChild.textContent.replace(regEx, '').trim().length > 0) {
127
129
  currentChild.innerHTML = currentChild.innerHTML.replace(regEx, '');
@@ -97,8 +97,8 @@ export interface RichTextEditorModel extends ComponentModel{
97
97
  * * enable - Set Boolean value to enable, the editors content is placed in an iframe and isolated from the rest of the page.
98
98
  * * attributes - Custom style to be used inside the iframe to display content. This style is added to the iframe body.
99
99
  * * resources - we can add both styles and scripts to the iframe.
100
- * 1. styles[] - An array of CSS style files to inject inside the iframe to display content
101
- * 2. scripts[] - An array of JS script files to inject inside the iframe
100
+ * 1. styles[] - An array of CSS style files to inject inside the iframe to display content.
101
+ * 2. scripts[] - An array of JS script files to inject inside the iframe.
102
102
  *
103
103
  * {% codeBlock src='rich-text-editor/iframe-settings/index.md' %}{% endcodeBlock %}
104
104
  *
@@ -267,8 +267,8 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
267
267
  * * enable - Set Boolean value to enable, the editors content is placed in an iframe and isolated from the rest of the page.
268
268
  * * attributes - Custom style to be used inside the iframe to display content. This style is added to the iframe body.
269
269
  * * resources - we can add both styles and scripts to the iframe.
270
- * 1. styles[] - An array of CSS style files to inject inside the iframe to display content
271
- * 2. scripts[] - An array of JS script files to inject inside the iframe
270
+ * 1. styles[] - An array of CSS style files to inject inside the iframe to display content.
271
+ * 2. scripts[] - An array of JS script files to inject inside the iframe.
272
272
  *
273
273
  * {% codeBlock src='rich-text-editor/iframe-settings/index.md' %}{% endcodeBlock %}
274
274
  *
@@ -456,6 +456,10 @@ var Image = /** @class */ (function () {
456
456
  });
457
457
  };
458
458
  Image.prototype.resizing = function (e) {
459
+ if (!this.parent) {
460
+ this.cancelResizeAction();
461
+ return;
462
+ }
459
463
  if (this.imgEle.offsetWidth >= this.parent.getInsertImgMaxWidth()) {
460
464
  this.imgEle.style.maxHeight = this.imgEle.offsetHeight + 'px';
461
465
  }
@@ -465,9 +465,10 @@ var Table = /** @class */ (function () {
465
465
  var range_1 = this.parent.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument());
466
466
  this.parent.formatter.editorManager.nodeSelection.save(range_1, this.contentModule.getDocument());
467
467
  this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument());
468
+ var pageX = (this.parent.iframeSettings.enable) ? window.pageXOffset + this.parent.element.getBoundingClientRect().left + args.clientX : args.pageX;
468
469
  var pageY = (this.parent.iframeSettings.enable) ? window.pageYOffset +
469
470
  this.parent.element.getBoundingClientRect().top + args.clientY : args.pageY;
470
- this.quickToolObj.tableQTBar.showPopup(args.pageX, pageY, target);
471
+ this.quickToolObj.tableQTBar.showPopup(pageX, pageY, target);
471
472
  this.parent.formatter.editorManager.nodeSelection.restore();
472
473
  }
473
474
  else {