@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.
@@ -3570,7 +3570,7 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
3570
3570
  }
3571
3571
  }
3572
3572
  //Formats preselect
3573
- if (args.items[0].command === 'Formats') {
3573
+ if (args.items[0].command === 'Formats' || args.items[0].command === 'Font') {
3574
3574
  for (var index = 0; index < args.element.childNodes.length; index++) {
3575
3575
  var divNode = _this.parent.createElement('div');
3576
3576
  divNode.innerHTML = dropDown.content.trim();
@@ -4887,7 +4887,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
4887
4887
  return;
4888
4888
  }
4889
4889
  else {
4890
- if (this.parent.toolbarSettings.enableFloating && !this.parent.inlineMode.enable) {
4890
+ if (!this.parent.inlineMode.enable) {
4891
4891
  this.tbWrapper = this.parent.createElement('div', {
4892
4892
  id: this.parent.getID() + '_toolbar_wrapper',
4893
4893
  innerHTML: this.tbElement.outerHTML,
@@ -12832,7 +12832,7 @@ var NodeCutter = /** @__PURE__ @class */ (function () {
12832
12832
  if ((indexes.indexOf(range.startOffset) >= 0)
12833
12833
  || ((indexes.indexOf(range.startOffset - 1) >= 0) && (range.startOffset !== 1
12834
12834
  || (range.startOffset === 1 && new RegExp('\\s').test(str[0])))
12835
- || (((indexes[indexes.length - 1] - 1) === range.startOffset) && !new RegExp('\\s').test(str[0])))) {
12835
+ || (((indexes[indexes.length - 1] - 1) === range.startOffset) && range.endOffset !== (str.length - 1) && !new RegExp('\\s').test(str[0])))) {
12836
12836
  cursorRange = range;
12837
12837
  this.position = 1;
12838
12838
  }
@@ -14016,6 +14016,9 @@ var LinkCommand = /** @__PURE__ @class */ (function () {
14016
14016
  if (!isNullOrUndefined(e.item.target)) {
14017
14017
  anchorEle.setAttribute('target', e.item.target);
14018
14018
  }
14019
+ if (!isNullOrUndefined(e.item.ariaLabel)) {
14020
+ anchorEle.setAttribute('aria-label', e.item.ariaLabel);
14021
+ }
14019
14022
  return anchorEle;
14020
14023
  };
14021
14024
  LinkCommand.prototype.getSelectionNodes = function (nodeCollection) {
@@ -20593,7 +20596,7 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
20593
20596
  else {
20594
20597
  this.parent.notify(enterHandler, { args: e.args });
20595
20598
  var newRange = this.parent.getRange();
20596
- if (!isNullOrUndefined(newRange.startContainer) && newRange.startContainer === this.parent.inputElement.lastChild && newRange.startContainer.nodeName !== '#text') {
20599
+ if (!isNullOrUndefined(newRange.startContainer) && newRange.startContainer === this.parent.inputElement.lastChild && newRange.startContainer.nodeName !== '#text' && this.parent.height !== 'auto') {
20597
20600
  newRange.startContainer.scrollIntoView({ block: "end", inline: "nearest" });
20598
20601
  }
20599
20602
  }
@@ -20914,7 +20917,7 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
20914
20917
  for (var j = 0; j < splitTextContent.length; j++) {
20915
20918
  if (splitTextContent[j].match(httpRegex) || splitTextContent[j].match(wwwRegex)) {
20916
20919
  resultSplitContent += '<a class="e-rte-anchor" href="' + splitTextContent[j] +
20917
- '" title="' + splitTextContent[j] + '"target="_blank">' + splitTextContent[j] + ' </a>';
20920
+ '" title="' + splitTextContent[j] + '" target="_blank"' + ' aria-label="' + this.parent.serviceLocator.getService('rteLocale').getConstant("linkAriaLabel") + '">' + splitTextContent[j] + ' </a>';
20918
20921
  }
20919
20922
  else {
20920
20923
  resultSplitContent += splitTextContent[j] + ' ';
@@ -21921,7 +21924,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
21921
21924
  }
21922
21925
  }
21923
21926
  this.parent.trigger(afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: filesData }, function (updatedArgs) { value = updatedArgs.value; });
21924
- clipBoardElem.innerHTML = value;
21927
+ clipBoardElem.innerHTML = this.parent.addAnchorAriaLabel(value);
21925
21928
  clipBoardElem = this.addTableClass(clipBoardElem);
21926
21929
  this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
21927
21930
  extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
@@ -32859,6 +32862,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
32859
32862
  * @deprecated
32860
32863
  */
32861
32864
  RichTextEditor.prototype.render = function () {
32865
+ this.value = (!(this.editorMode === 'Markdown') && !isNullOrUndefined(this.value)) ? this.addAnchorAriaLabel(this.value) : this.value;
32862
32866
  if (this.value && !this.valueTemplate) {
32863
32867
  this.setProperties({ value: this.serializeValue(this.value) }, true);
32864
32868
  }
@@ -34537,6 +34541,17 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
34537
34541
  var value = this.removeResizeElement(args.value);
34538
34542
  args.callBack(value);
34539
34543
  };
34544
+ RichTextEditor.prototype.addAnchorAriaLabel = function (value) {
34545
+ var valueElementWrapper = document.createElement("div");
34546
+ valueElementWrapper.innerHTML = value;
34547
+ var item = valueElementWrapper.querySelectorAll("a");
34548
+ if (item.length > 0) {
34549
+ for (var i = 0; i < item.length; i++) {
34550
+ (item[i].hasAttribute("target") && item[i].getAttribute("target") === '_blank') ? item[i].setAttribute("aria-label", this.serviceLocator.getService('rteLocale').getConstant("linkAriaLabel")) : item[i];
34551
+ }
34552
+ }
34553
+ return valueElementWrapper.innerHTML;
34554
+ };
34540
34555
  RichTextEditor.prototype.removeResizeElement = function (value) {
34541
34556
  var valueElementWrapper = document.createElement("div");
34542
34557
  valueElementWrapper.innerHTML = value;