@syncfusion/ej2-richtexteditor 24.1.45 → 24.1.46

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.
@@ -3574,7 +3574,7 @@ class ToolbarRenderer {
3574
3574
  }
3575
3575
  }
3576
3576
  //Formats preselect
3577
- if (args.items[0].command === 'Formats') {
3577
+ if (args.items[0].command === 'Formats' || args.items[0].command === 'Font') {
3578
3578
  for (let index = 0; index < args.element.childNodes.length; index++) {
3579
3579
  const divNode = this.parent.createElement('div');
3580
3580
  divNode.innerHTML = dropDown.content.trim();
@@ -4872,7 +4872,7 @@ class Toolbar$2 {
4872
4872
  return;
4873
4873
  }
4874
4874
  else {
4875
- if (this.parent.toolbarSettings.enableFloating && !this.parent.inlineMode.enable) {
4875
+ if (!this.parent.inlineMode.enable) {
4876
4876
  this.tbWrapper = this.parent.createElement('div', {
4877
4877
  id: this.parent.getID() + '_toolbar_wrapper',
4878
4878
  innerHTML: this.tbElement.outerHTML,
@@ -12738,7 +12738,7 @@ class NodeCutter {
12738
12738
  if ((indexes.indexOf(range.startOffset) >= 0)
12739
12739
  || ((indexes.indexOf(range.startOffset - 1) >= 0) && (range.startOffset !== 1
12740
12740
  || (range.startOffset === 1 && new RegExp('\\s').test(str[0])))
12741
- || (((indexes[indexes.length - 1] - 1) === range.startOffset) && !new RegExp('\\s').test(str[0])))) {
12741
+ || (((indexes[indexes.length - 1] - 1) === range.startOffset) && range.endOffset !== (str.length - 1) && !new RegExp('\\s').test(str[0])))) {
12742
12742
  cursorRange = range;
12743
12743
  this.position = 1;
12744
12744
  }
@@ -13917,6 +13917,9 @@ class LinkCommand {
13917
13917
  if (!isNullOrUndefined(e.item.target)) {
13918
13918
  anchorEle.setAttribute('target', e.item.target);
13919
13919
  }
13920
+ if (!isNullOrUndefined(e.item.ariaLabel)) {
13921
+ anchorEle.setAttribute('aria-label', e.item.ariaLabel);
13922
+ }
13920
13923
  return anchorEle;
13921
13924
  }
13922
13925
  getSelectionNodes(nodeCollection) {
@@ -20518,7 +20521,7 @@ class HtmlEditor {
20518
20521
  else {
20519
20522
  this.parent.notify(enterHandler, { args: e.args });
20520
20523
  const newRange = this.parent.getRange();
20521
- if (!isNullOrUndefined(newRange.startContainer) && newRange.startContainer === this.parent.inputElement.lastChild && newRange.startContainer.nodeName !== '#text') {
20524
+ if (!isNullOrUndefined(newRange.startContainer) && newRange.startContainer === this.parent.inputElement.lastChild && newRange.startContainer.nodeName !== '#text' && this.parent.height !== 'auto') {
20522
20525
  newRange.startContainer.scrollIntoView({ block: "end", inline: "nearest" });
20523
20526
  }
20524
20527
  }
@@ -20839,7 +20842,7 @@ class HtmlEditor {
20839
20842
  for (let j = 0; j < splitTextContent.length; j++) {
20840
20843
  if (splitTextContent[j].match(httpRegex) || splitTextContent[j].match(wwwRegex)) {
20841
20844
  resultSplitContent += '<a class="e-rte-anchor" href="' + splitTextContent[j] +
20842
- '" title="' + splitTextContent[j] + '"target="_blank">' + splitTextContent[j] + ' </a>';
20845
+ '" title="' + splitTextContent[j] + '" target="_blank"' + ' aria-label="' + this.parent.serviceLocator.getService('rteLocale').getConstant("linkAriaLabel") + '">' + splitTextContent[j] + ' </a>';
20843
20846
  }
20844
20847
  else {
20845
20848
  resultSplitContent += splitTextContent[j] + ' ';
@@ -21838,7 +21841,7 @@ class PasteCleanup {
21838
21841
  }
21839
21842
  }
21840
21843
  this.parent.trigger(afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: filesData }, (updatedArgs) => { value = updatedArgs.value; });
21841
- clipBoardElem.innerHTML = value;
21844
+ clipBoardElem.innerHTML = this.parent.addAnchorAriaLabel(value);
21842
21845
  clipBoardElem = this.addTableClass(clipBoardElem);
21843
21846
  this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, (returnArgs) => {
21844
21847
  extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
@@ -32548,6 +32551,7 @@ let RichTextEditor = class RichTextEditor extends Component {
32548
32551
  * @deprecated
32549
32552
  */
32550
32553
  render() {
32554
+ this.value = (!(this.editorMode === 'Markdown') && !isNullOrUndefined(this.value)) ? this.addAnchorAriaLabel(this.value) : this.value;
32551
32555
  if (this.value && !this.valueTemplate) {
32552
32556
  this.setProperties({ value: this.serializeValue(this.value) }, true);
32553
32557
  }
@@ -34221,6 +34225,17 @@ let RichTextEditor = class RichTextEditor extends Component {
34221
34225
  const value = this.removeResizeElement(args.value);
34222
34226
  args.callBack(value);
34223
34227
  }
34228
+ addAnchorAriaLabel(value) {
34229
+ let valueElementWrapper = document.createElement("div");
34230
+ valueElementWrapper.innerHTML = value;
34231
+ let item = valueElementWrapper.querySelectorAll("a");
34232
+ if (item.length > 0) {
34233
+ for (let i = 0; i < item.length; i++) {
34234
+ (item[i].hasAttribute("target") && item[i].getAttribute("target") === '_blank') ? item[i].setAttribute("aria-label", this.serviceLocator.getService('rteLocale').getConstant("linkAriaLabel")) : item[i];
34235
+ }
34236
+ }
34237
+ return valueElementWrapper.innerHTML;
34238
+ }
34224
34239
  removeResizeElement(value) {
34225
34240
  let valueElementWrapper = document.createElement("div");
34226
34241
  valueElementWrapper.innerHTML = value;