@syncfusion/ej2-richtexteditor 26.2.7 → 26.2.8

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 : 26.2.7
3
+ * version : 26.2.8
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@26.2.5",
3
+ "_id": "@syncfusion/ej2-richtexteditor@26.2.7",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-FH3/ajh5xDss4l/7hmKai/Zf8+vn0cuPbN//GiPILPfKwkCX7b4iUQDycSF3gFGiATUID48cMuWp4EfO629Ibg==",
5
+ "_integrity": "sha512-/1ycFr5+hj4YYc/mHnJ9NAW4KMmdJiRzQiMpOYNoOZ9RThOe6MH/JGco9ewyTsV24kIeWfRNqbsNDGEpPEMxfQ==",
6
6
  "_location": "/@syncfusion/ej2-richtexteditor",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -25,8 +25,8 @@
25
25
  "/@syncfusion/ej2-react-richtexteditor",
26
26
  "/@syncfusion/ej2-vue-richtexteditor"
27
27
  ],
28
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-26.2.5.tgz",
29
- "_shasum": "f7cbd3a9c28d9420011a5af406c2a397639de4aa",
28
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-26.2.7.tgz",
29
+ "_shasum": "a6b4da665f0af8fdf8f041451868bebd2ffac41e",
30
30
  "_spec": "@syncfusion/ej2-richtexteditor@*",
31
31
  "_where": "/jenkins/workspace/elease-automation_release_26.1.1/packages/included",
32
32
  "author": {
@@ -38,11 +38,11 @@
38
38
  "bundleDependencies": false,
39
39
  "dependencies": {
40
40
  "@syncfusion/ej2-base": "~26.2.5",
41
- "@syncfusion/ej2-buttons": "~26.2.7",
41
+ "@syncfusion/ej2-buttons": "~26.2.8",
42
42
  "@syncfusion/ej2-filemanager": "~26.2.7",
43
43
  "@syncfusion/ej2-inputs": "~26.2.5",
44
- "@syncfusion/ej2-navigations": "~26.2.7",
45
- "@syncfusion/ej2-popups": "~26.2.5",
44
+ "@syncfusion/ej2-navigations": "~26.2.8",
45
+ "@syncfusion/ej2-popups": "~26.2.8",
46
46
  "@syncfusion/ej2-splitbuttons": "~26.2.5"
47
47
  },
48
48
  "deprecated": false,
@@ -79,6 +79,6 @@
79
79
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
80
80
  },
81
81
  "typings": "index.d.ts",
82
- "version": "26.2.7",
82
+ "version": "26.2.8",
83
83
  "sideEffects": false
84
84
  }
@@ -27,4 +27,5 @@ export declare class InsertHtml {
27
27
  private static removeEmptyElements;
28
28
  private static closestEle;
29
29
  private static insertTableInList;
30
+ private static alignCheck;
30
31
  }
@@ -203,7 +203,6 @@ var InsertHtml = /** @class */ (function () {
203
203
  return null;
204
204
  };
205
205
  InsertHtml.pasteInsertHTML = function (nodes, node, range, nodeSelection, nodeCutter, docElement, isCollapsed, closestParentNode, editNode, enterAction) {
206
- var _this = this;
207
206
  var isCursor = range.startOffset === range.endOffset &&
208
207
  range.startContainer === range.endContainer;
209
208
  if (isCursor && range.startContainer === editNode && editNode.textContent === '') {
@@ -282,6 +281,9 @@ var InsertHtml = /** @class */ (function () {
282
281
  var rangeElement = closest(nearestAnchor, 'span');
283
282
  rangeElement.appendChild(tempSpan);
284
283
  }
284
+ else if (nodes[0].nodeName === '#text' && nodes[0].nodeValue.includes('\u200B') && !isNOU(nodes[0].parentElement) && !isNOU(nodes[0].parentElement.previousElementSibling) && nodes[0].parentElement.previousElementSibling.classList.contains('e-mention-chip')) {
285
+ range.startContainer.parentElement.insertAdjacentElement('afterend', tempSpan);
286
+ }
285
287
  else {
286
288
  range.insertNode(tempSpan);
287
289
  }
@@ -370,17 +372,7 @@ var InsertHtml = /** @class */ (function () {
370
372
  else {
371
373
  this.cursorPos(lastSelectionNode, node, nodeSelection, docElement, editNode, enterAction);
372
374
  }
373
- var spanAligns = editNode.querySelectorAll('span[style*="text-align"]');
374
- if (spanAligns.length > 0) {
375
- spanAligns.forEach(function (spanAlign) {
376
- if (!isNOU(spanAlign)) {
377
- var blockAlign = _this.getImmediateBlockNode(spanAlign, null);
378
- if (blockAlign && blockAlign.textContent.trim() === spanAlign.textContent.trim()) {
379
- blockAlign.style.textAlign = spanAlign.style.textAlign;
380
- }
381
- }
382
- });
383
- }
375
+ this.alignCheck(editNode);
384
376
  };
385
377
  InsertHtml.placeCursorEnd = function (lastSelectionNode, node, nodeSelection, docElement, editNode) {
386
378
  lastSelectionNode = lastSelectionNode.nodeName === 'BR' ? (isNOU(lastSelectionNode.previousSibling) ? lastSelectionNode.parentNode
@@ -620,6 +612,27 @@ var InsertHtml = /** @class */ (function () {
620
612
  }
621
613
  insertNode.classList.add('ignore-table');
622
614
  };
615
+ InsertHtml.alignCheck = function (editNode) {
616
+ var spanAligns = editNode.querySelectorAll('span[style*="text-align"]');
617
+ for (var i = 0; i < spanAligns.length; i++) {
618
+ var spanAlign = spanAligns[i];
619
+ if (spanAlign) {
620
+ var blockAlign = this.getImmediateBlockNode(spanAlign, null);
621
+ if (blockAlign) {
622
+ var totalSpanText = '';
623
+ for (var j = 0; j < spanAligns.length; j++) {
624
+ var span = spanAligns[j];
625
+ if (blockAlign.contains(span)) {
626
+ totalSpanText += span.textContent;
627
+ }
628
+ }
629
+ if (blockAlign.textContent.trim() === totalSpanText.trim()) {
630
+ blockAlign.style.textAlign = spanAlign.style.textAlign;
631
+ }
632
+ }
633
+ }
634
+ }
635
+ };
623
636
  /**
624
637
  * Insert method
625
638
  *
@@ -49,4 +49,5 @@ export declare class Lists {
49
49
  private openTag;
50
50
  private closeTag;
51
51
  destroy(): void;
52
+ areAllListItemsSelected(list: HTMLElement, range: Range): boolean;
52
53
  }
@@ -323,7 +323,9 @@ var Lists = /** @class */ (function () {
323
323
  && (!isNullOrUndefined(closest(startNode, 'ul')) || !isNullOrUndefined(closest(startNode, 'ol')))
324
324
  && (!isNullOrUndefined(closest(endNode, 'ul')) || !isNullOrUndefined(closest(endNode, 'ol')))
325
325
  && ((commonAncestor.lastElementChild === closest(endNode, 'li') && commonAncestor.lastChild !== endNode)) && !range.collapsed) {
326
- detach(commonAncestor);
326
+ if (this.areAllListItemsSelected(commonAncestor, range)) {
327
+ detach(commonAncestor);
328
+ }
327
329
  }
328
330
  this.removeList(range, e);
329
331
  }
@@ -1004,6 +1006,18 @@ var Lists = /** @class */ (function () {
1004
1006
  this.domNode = null;
1005
1007
  }
1006
1008
  };
1009
+ Lists.prototype.areAllListItemsSelected = function (list, range) {
1010
+ var listItems = list.querySelectorAll('li');
1011
+ for (var i = 0; i < listItems.length; i++) {
1012
+ var listItem = listItems[i];
1013
+ var listItemRange = this.parent.currentDocument.createRange();
1014
+ listItemRange.selectNodeContents(listItem);
1015
+ if (!range.intersectsNode(listItem)) {
1016
+ return false;
1017
+ }
1018
+ }
1019
+ return true;
1020
+ };
1007
1021
  return Lists;
1008
1022
  }());
1009
1023
  export { Lists };
@@ -186,8 +186,6 @@ var RichTextEditor = /** @class */ (function (_super) {
186
186
  */
187
187
  RichTextEditor.prototype.preRender = function () {
188
188
  this.initializeValue();
189
- this.onBlurHandler = this.blurHandler.bind(this);
190
- this.onFocusHandler = this.focusHandler.bind(this);
191
189
  this.clickPoints = { clientX: 0, clientY: 0 };
192
190
  this.initialValue = this.value;
193
191
  this.serviceLocator = new ServiceLocator;
@@ -827,7 +825,7 @@ var RichTextEditor = /** @class */ (function (_super) {
827
825
  this.inputElement.innerHTML = this.enterKey !== 'BR' ? '<' + this.enterKey + '><br></' + this.enterKey + '>' : '<br>';
828
826
  this.isSelectAll = false;
829
827
  }
830
- if (selection.rangeCount > 0) {
828
+ if (selection.rangeCount > 0 && this.contentModule.getDocument().activeElement.tagName !== 'INPUT' && this.inputElement.contains(this.contentModule.getDocument().activeElement)) {
831
829
  selection.removeAllRanges();
832
830
  selection.addRange(currentRange);
833
831
  }
@@ -2437,6 +2435,9 @@ var RichTextEditor = /** @class */ (function (_super) {
2437
2435
  }
2438
2436
  };
2439
2437
  RichTextEditor.prototype.wireEvents = function () {
2438
+ this.onResizeHandler = this.resizeHandler.bind(this);
2439
+ this.onBlurHandler = this.blurHandler.bind(this);
2440
+ this.onFocusHandler = this.focusHandler.bind(this);
2440
2441
  this.element.addEventListener('focusin', this.onFocusHandler, true);
2441
2442
  this.element.addEventListener('focusout', this.onBlurHandler, true);
2442
2443
  this.on(events.contentChanged, this.contentChanged, this);
@@ -2492,7 +2493,6 @@ var RichTextEditor = /** @class */ (function (_super) {
2492
2493
  EventHandler.add(this.inputElement, 'input', this.inputHandler, this);
2493
2494
  this.wireContextEvent();
2494
2495
  this.formatter.editorManager.observer.on(CONSTANT.KEY_DOWN_HANDLER, this.editorKeyDown, this);
2495
- this.onResizeHandler = this.resizeHandler.bind(this);
2496
2496
  this.element.ownerDocument.defaultView.addEventListener('resize', this.onResizeHandler, true);
2497
2497
  if (this.iframeSettings.enable) {
2498
2498
  EventHandler.add(this.inputElement, 'focusin', this.focusHandler, this);
@@ -62,6 +62,7 @@ var Audio = /** @class */ (function () {
62
62
  EventHandler.remove(this.parent.contentModule.getEditPanel(), Browser.touchStartEvent, this.touchStart);
63
63
  EventHandler.remove(this.contentModule.getEditPanel(), Browser.touchEndEvent, this.audioClick);
64
64
  this.parent.element.ownerDocument.removeEventListener('mousedown', this.docClick, true);
65
+ this.docClick = null;
65
66
  }
66
67
  };
67
68
  Audio.prototype.afterRender = function () {
@@ -99,6 +99,7 @@ var Image = /** @class */ (function () {
99
99
  if (this.parent.insertImageSettings.resize) {
100
100
  EventHandler.remove(this.parent.contentModule.getEditPanel(), Browser.touchStartEvent, this.resizeStart);
101
101
  this.parent.element.ownerDocument.removeEventListener('mousedown', this.docClick, true);
102
+ this.docClick = null;
102
103
  EventHandler.remove(this.contentModule.getEditPanel(), 'cut', this.onCutHandler);
103
104
  EventHandler.remove(this.contentModule.getDocument(), Browser.touchMoveEvent, this.resizing);
104
105
  }
@@ -157,6 +157,7 @@ var ToolbarRenderer = /** @class */ (function () {
157
157
  openDelay: 400,
158
158
  opensOn: 'Hover',
159
159
  beforeRender: this.tooltipBeforeRender.bind(this),
160
+ beforeOpen: this.tooltipBeforeOpen.bind(this),
160
161
  cssClass: this.parent.getCssClass(),
161
162
  windowCollision: true,
162
163
  position: 'BottomCenter'
@@ -74,6 +74,7 @@ var Video = /** @class */ (function () {
74
74
  if (this.parent.insertVideoSettings.resize) {
75
75
  EventHandler.remove(this.parent.contentModule.getEditPanel(), Browser.touchStartEvent, this.resizeStart);
76
76
  this.parent.element.ownerDocument.removeEventListener('mousedown', this.docClick, true);
77
+ this.docClick = null;
77
78
  EventHandler.remove(this.contentModule.getEditPanel(), 'cut', this.onCutHandler);
78
79
  EventHandler.remove(this.contentModule.getDocument(), Browser.touchMoveEvent, this.resizing);
79
80
  }