@syncfusion/ej2-richtexteditor 24.1.43 → 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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 24.1.43
3
+ * version : 24.1.46
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@24.1.41",
3
+ "_id": "@syncfusion/ej2-richtexteditor@24.1.45",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-h4DVBcoJwsAW5vm0Y6Ffg3KcNNeCxkj2MwOW+z+Aa8puZZETLQitQl8yt76IFRoxTY/MCdkoTWVILD5mstwkFg==",
5
+ "_integrity": "sha512-639ZpTHnu5BdfPiBTllfJndDTien1yXWHPyQDGWulZXC92dAMtipXgiuEcsVLtVVJv0FbVgg5X9zX4T8PBq/4Q==",
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.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-24.1.41.tgz",
29
- "_shasum": "b0643450fa79cf814e9386718d1e011876c3946a",
28
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-24.1.45.tgz",
29
+ "_shasum": "1fe5762cdca0998b044c81caa60c22dd0e47df75",
30
30
  "_spec": "@syncfusion/ej2-richtexteditor@*",
31
31
  "_where": "/jenkins/workspace/elease-automation_release_24.1.1/packages/included",
32
32
  "author": {
@@ -37,13 +37,13 @@
37
37
  },
38
38
  "bundleDependencies": false,
39
39
  "dependencies": {
40
- "@syncfusion/ej2-base": "~24.1.42",
41
- "@syncfusion/ej2-buttons": "~24.1.41",
42
- "@syncfusion/ej2-filemanager": "~24.1.43",
43
- "@syncfusion/ej2-inputs": "~24.1.41",
44
- "@syncfusion/ej2-navigations": "~24.1.41",
45
- "@syncfusion/ej2-popups": "~24.1.41",
46
- "@syncfusion/ej2-splitbuttons": "~24.1.41"
40
+ "@syncfusion/ej2-base": "~24.1.46",
41
+ "@syncfusion/ej2-buttons": "~24.1.46",
42
+ "@syncfusion/ej2-filemanager": "~24.1.45",
43
+ "@syncfusion/ej2-inputs": "~24.1.45",
44
+ "@syncfusion/ej2-navigations": "~24.1.46",
45
+ "@syncfusion/ej2-popups": "~24.1.46",
46
+ "@syncfusion/ej2-splitbuttons": "~24.1.46"
47
47
  },
48
48
  "deprecated": false,
49
49
  "description": "Essential JS 2 RichTextEditor component",
@@ -69,6 +69,6 @@
69
69
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
70
70
  },
71
71
  "typings": "index.d.ts",
72
- "version": "24.1.43",
72
+ "version": "24.1.46",
73
73
  "sideEffects": false
74
74
  }
@@ -230,6 +230,9 @@ var LinkCommand = /** @class */ (function () {
230
230
  if (!isNOU(e.item.target)) {
231
231
  anchorEle.setAttribute('target', e.item.target);
232
232
  }
233
+ if (!isNOU(e.item.ariaLabel)) {
234
+ anchorEle.setAttribute('aria-label', e.item.ariaLabel);
235
+ }
233
236
  return anchorEle;
234
237
  };
235
238
  LinkCommand.prototype.getSelectionNodes = function (nodeCollection) {
@@ -171,7 +171,7 @@ var NodeCutter = /** @class */ (function () {
171
171
  if ((indexes.indexOf(range.startOffset) >= 0)
172
172
  || ((indexes.indexOf(range.startOffset - 1) >= 0) && (range.startOffset !== 1
173
173
  || (range.startOffset === 1 && new RegExp('\\s').test(str[0])))
174
- || (((indexes[indexes.length - 1] - 1) === range.startOffset) && !new RegExp('\\s').test(str[0])))) {
174
+ || (((indexes[indexes.length - 1] - 1) === range.startOffset) && range.endOffset !== (str.length - 1) && !new RegExp('\\s').test(str[0])))) {
175
175
  cursorRange = range;
176
176
  this.position = 1;
177
177
  }
@@ -185,8 +185,7 @@ var SelectionCommands = /** @class */ (function () {
185
185
  cursorNodes[0].firstElementChild.tagName.toLowerCase() === 'br')) {
186
186
  cursorNodes[0].innerHTML = '';
187
187
  }
188
- if (cursorNodes.length === 1 && range.startOffset === 0 && (cursorNodes[0].nodeName === 'BR' ||
189
- cursorNodes[0].nextSibling.nodeName === 'BR')) {
188
+ if (cursorNodes.length === 1 && range.startOffset === 0 && (cursorNodes[0].nodeName === 'BR' || (isNOU(cursorNodes[0].nextSibling) ? false : cursorNodes[0].nextSibling.nodeName === 'BR'))) {
190
189
  detach(cursorNodes[0].nodeName === '#text' ? cursorNodes[0].nextSibling : cursorNodes[0]);
191
190
  }
192
191
  cursorNode = this.getInsertNode(docElement, range, format, value).firstChild;
@@ -2,6 +2,7 @@ import { IsFormatted } from './isformatted';
2
2
  import * as CONSTANT from './../base/constant';
3
3
  import { NodeSelection } from './../../selection/index';
4
4
  import { getDefaultHtmlTbStatus } from './../../common/util';
5
+ import { isNullOrUndefined } from '@syncfusion/ej2-base';
5
6
  /**
6
7
  * Update Toolbar Status
7
8
  *
@@ -250,7 +251,8 @@ var ToolbarStatus = /** @class */ (function () {
250
251
  // eslint-disable-next-line
251
252
  var pattern = new RegExp(name, 'i');
252
253
  if ((value.replace(/"/g, '').replace(/ /g, '').toLowerCase() === name.replace(/"/g, '').replace(/ /g, '').toLowerCase()) ||
253
- (value.split(',')[0] && value.split(',')[0].search(pattern) > -1)) {
254
+ (value.split(',')[0] && !isNullOrUndefined(value.split(',')[0].trim().match(pattern)) &&
255
+ value.split(',')[0].trim() === value.split(',')[0].trim().match(pattern)[0])) {
254
256
  index = pos;
255
257
  }
256
258
  }) && (index !== null)))) {
@@ -233,7 +233,7 @@ var HtmlEditor = /** @class */ (function () {
233
233
  else {
234
234
  this.parent.notify(events.enterHandler, { args: e.args });
235
235
  var newRange = this.parent.getRange();
236
- if (!isNOU(newRange.startContainer) && newRange.startContainer === this.parent.inputElement.lastChild && newRange.startContainer.nodeName !== '#text') {
236
+ if (!isNOU(newRange.startContainer) && newRange.startContainer === this.parent.inputElement.lastChild && newRange.startContainer.nodeName !== '#text' && this.parent.height !== 'auto') {
237
237
  newRange.startContainer.scrollIntoView({ block: "end", inline: "nearest" });
238
238
  }
239
239
  }
@@ -554,7 +554,7 @@ var HtmlEditor = /** @class */ (function () {
554
554
  for (var j = 0; j < splitTextContent.length; j++) {
555
555
  if (splitTextContent[j].match(httpRegex) || splitTextContent[j].match(wwwRegex)) {
556
556
  resultSplitContent += '<a class="e-rte-anchor" href="' + splitTextContent[j] +
557
- '" title="' + splitTextContent[j] + '"target="_blank">' + splitTextContent[j] + ' </a>';
557
+ '" title="' + splitTextContent[j] + '" target="_blank"' + ' aria-label="' + this.parent.serviceLocator.getService('rteLocale').getConstant("linkAriaLabel") + '">' + splitTextContent[j] + ' </a>';
558
558
  }
559
559
  else {
560
560
  resultSplitContent += splitTextContent[j] + ' ';
@@ -690,7 +690,7 @@ var PasteCleanup = /** @class */ (function () {
690
690
  }
691
691
  }
692
692
  this.parent.trigger(events.afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: filesData }, function (updatedArgs) { value = updatedArgs.value; });
693
- clipBoardElem.innerHTML = value;
693
+ clipBoardElem.innerHTML = this.parent.addAnchorAriaLabel(value);
694
694
  clipBoardElem = this.addTableClass(clipBoardElem);
695
695
  this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
696
696
  extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
@@ -64,7 +64,7 @@ var Toolbar = /** @class */ (function () {
64
64
  return;
65
65
  }
66
66
  else {
67
- if (this.parent.toolbarSettings.enableFloating && !this.parent.inlineMode.enable) {
67
+ if (!this.parent.inlineMode.enable) {
68
68
  this.tbWrapper = this.parent.createElement('div', {
69
69
  id: this.parent.getID() + '_toolbar_wrapper',
70
70
  innerHTML: this.tbElement.outerHTML,
@@ -196,6 +196,7 @@ export interface IRichTextEditor extends Component<HTMLElement> {
196
196
  currentTarget: HTMLElement;
197
197
  focusIn(): void;
198
198
  showEmojiPicker?(x?: number, y?: number): void;
199
+ addAnchorAriaLabel?(value: string): string;
199
200
  }
200
201
  /**
201
202
 
@@ -1543,6 +1543,7 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
1543
1543
  private updateValueOnIdle;
1544
1544
  private updateIntervalValue;
1545
1545
  private cleanupResizeElements;
1546
+ addAnchorAriaLabel(value: string): string;
1546
1547
  private removeResizeElement;
1547
1548
  private updateStatus;
1548
1549
  private onDocumentClick;
@@ -551,6 +551,7 @@ var RichTextEditor = /** @class */ (function (_super) {
551
551
 
552
552
  */
553
553
  RichTextEditor.prototype.render = function () {
554
+ this.value = (!(this.editorMode === 'Markdown') && !isNOU(this.value)) ? this.addAnchorAriaLabel(this.value) : this.value;
554
555
  if (this.value && !this.valueTemplate) {
555
556
  this.setProperties({ value: this.serializeValue(this.value) }, true);
556
557
  }
@@ -2229,6 +2230,17 @@ var RichTextEditor = /** @class */ (function (_super) {
2229
2230
  var value = this.removeResizeElement(args.value);
2230
2231
  args.callBack(value);
2231
2232
  };
2233
+ RichTextEditor.prototype.addAnchorAriaLabel = function (value) {
2234
+ var valueElementWrapper = document.createElement("div");
2235
+ valueElementWrapper.innerHTML = value;
2236
+ var item = valueElementWrapper.querySelectorAll("a");
2237
+ if (item.length > 0) {
2238
+ for (var i = 0; i < item.length; i++) {
2239
+ (item[i].hasAttribute("target") && item[i].getAttribute("target") === '_blank') ? item[i].setAttribute("aria-label", this.serviceLocator.getService('rteLocale').getConstant("linkAriaLabel")) : item[i];
2240
+ }
2241
+ }
2242
+ return valueElementWrapper.innerHTML;
2243
+ };
2232
2244
  RichTextEditor.prototype.removeResizeElement = function (value) {
2233
2245
  var valueElementWrapper = document.createElement("div");
2234
2246
  valueElementWrapper.innerHTML = value;
@@ -2491,6 +2503,7 @@ var RichTextEditor = /** @class */ (function (_super) {
2491
2503
  }
2492
2504
  EventHandler.add(this.inputElement, 'keyup', this.keyUp, this);
2493
2505
  EventHandler.add(this.inputElement, 'paste', this.onPaste, this);
2506
+ EventHandler.add(this.inputElement, 'content-changed', this.contentChanged, this);
2494
2507
  EventHandler.add(this.inputElement, Browser.touchEndEvent, debounce(this.mouseUp, 30), this);
2495
2508
  EventHandler.add(this.inputElement, Browser.touchStartEvent, this.mouseDownHandler, this);
2496
2509
  this.wireContextEvent();
@@ -2553,6 +2566,7 @@ var RichTextEditor = /** @class */ (function (_super) {
2553
2566
  }
2554
2567
  EventHandler.remove(this.inputElement, 'keyup', this.keyUp);
2555
2568
  EventHandler.remove(this.inputElement, 'paste', this.onPaste);
2569
+ EventHandler.remove(this.inputElement, 'content-changed', this.contentChanged);
2556
2570
  EventHandler.remove(this.inputElement, Browser.touchEndEvent, debounce(this.mouseUp, 30));
2557
2571
  EventHandler.remove(this.inputElement, Browser.touchStartEvent, this.mouseDownHandler);
2558
2572
  this.unWireContextEvent();
@@ -243,7 +243,7 @@ var ToolbarRenderer = /** @class */ (function () {
243
243
  }
244
244
  }
245
245
  //Formats preselect
246
- if (args.items[0].command === 'Formats') {
246
+ if (args.items[0].command === 'Formats' || args.items[0].command === 'Font') {
247
247
  for (var index = 0; index < args.element.childNodes.length; index++) {
248
248
  var divNode = _this.parent.createElement('div');
249
249
  divNode.innerHTML = dropDown.content.trim();