@syncfusion/ej2-richtexteditor 23.2.5 → 23.2.6

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 : 23.2.5
3
+ * version : 23.2.6
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@23.2.4",
3
+ "_id": "@syncfusion/ej2-richtexteditor@23.2.5",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-gQoJXBFkuekaa+gB0U2JpQldeFdkRz6T+N7qkqYNBpSDw0+zF71ScmwYy42dxjGVEJRdZT/HHRwtV5KgLEAhAQ==",
5
+ "_integrity": "sha512-LDSabG1NiIxMf92vUcISlwF+vT/mAsvve1XDfHd1nOik3PCWxJk1nYnhkWYlDvBLE2nTJGLZ3yTU9cWvQXSgFw==",
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-23.2.4.tgz",
29
- "_shasum": "53e152500eb6b7a1c1215748894fb8de196fec14",
28
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-23.2.5.tgz",
29
+ "_shasum": "3197d4da512b1f6bebfda2e43c93a35204c6f6a5",
30
30
  "_spec": "@syncfusion/ej2-richtexteditor@*",
31
31
  "_where": "/jenkins/workspace/elease-automation_release_23.1.1/packages/included",
32
32
  "author": {
@@ -37,9 +37,9 @@
37
37
  },
38
38
  "bundleDependencies": false,
39
39
  "dependencies": {
40
- "@syncfusion/ej2-base": "~23.2.4",
40
+ "@syncfusion/ej2-base": "~23.2.6",
41
41
  "@syncfusion/ej2-buttons": "~23.2.4",
42
- "@syncfusion/ej2-filemanager": "~23.2.4",
42
+ "@syncfusion/ej2-filemanager": "~23.2.6",
43
43
  "@syncfusion/ej2-inputs": "~23.2.4",
44
44
  "@syncfusion/ej2-navigations": "~23.2.5",
45
45
  "@syncfusion/ej2-popups": "~23.2.4",
@@ -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": "23.2.5",
72
+ "version": "23.2.6",
73
73
  "sideEffects": false
74
74
  }
@@ -124,6 +124,7 @@ export interface IHtmlItemArgs {
124
124
  captionClass?: string;
125
125
  action?: string;
126
126
  formatPainterAction?: IFormatPainterActionValue;
127
+ ariaLabel?: string;
127
128
  }
128
129
  /**
129
130
 
@@ -58,9 +58,11 @@ var LinkCommand = /** @class */ (function () {
58
58
  }
59
59
  if (!isNOU(e.item.target)) {
60
60
  anchorEle.setAttribute('target', e.item.target);
61
+ anchorEle.setAttribute('aria-label', e.item.ariaLabel);
61
62
  }
62
63
  else {
63
64
  anchorEle.removeAttribute('target');
65
+ anchorEle.removeAttribute('aria-label');
64
66
  }
65
67
  if (linkText === e.item.text) {
66
68
  e.item.selection.setSelectionText(this.parent.currentDocument, anchorEle, anchorEle, 1, 1);
@@ -800,6 +800,9 @@ var HtmlEditor = /** @class */ (function () {
800
800
  */
801
801
  HtmlEditor.prototype.onPropertyChanged = function (e) {
802
802
  // On property code change here
803
+ if (!isNOU(e) && !isNOU(e.newProp.toolbarSettings) && !isNOU(e.newProp.toolbarSettings.enable)) {
804
+ this.toolbarUpdate = new HtmlToolbarStatus(this.parent);
805
+ }
803
806
  if (!isNullOrUndefined(e.newProp.formatter)) {
804
807
  var editElement = this.contentRenderer.getEditPanel();
805
808
  var option = { undoRedoSteps: this.parent.undoRedoSteps,
@@ -149,7 +149,7 @@ var QuickToolbar = /** @class */ (function () {
149
149
 
150
150
  */
151
151
  QuickToolbar.prototype.showInlineQTBar = function (x, y, target) {
152
- if (this.parent.readonly || target.tagName.toLowerCase() === 'img') {
152
+ if (isNOU(this.parent) || this.parent.readonly || target.tagName.toLowerCase() === 'img') {
153
153
  return;
154
154
  }
155
155
  this.inlineQTBar.showPopup(x, y, target);
@@ -519,6 +519,9 @@ var QuickToolbar = /** @class */ (function () {
519
519
  this.parent.off(events.rtlMode, this.setRtl);
520
520
  this.parent.off(events.bindCssClass, this.setCssClass);
521
521
  this.parent.off(events.hidePopup, this.hideQuickToolbars);
522
+ if (this.deBouncer) {
523
+ clearTimeout(this.deBouncer);
524
+ }
522
525
  };
523
526
  /**
524
527
  * Called internally if any of the property value changed.
@@ -156,7 +156,6 @@ export declare class Toolbar {
156
156
  private focusChangeHandler;
157
157
  private dropDownBeforeOpenHandler;
158
158
  private tbFocusHandler;
159
- private tbKeydownHandler;
160
159
  private toolbarClickHandler;
161
160
  protected wireEvents(): void;
162
161
  protected unWireEvents(): void;
@@ -557,12 +557,6 @@ var Toolbar = /** @class */ (function () {
557
557
  }
558
558
  }
559
559
  };
560
- Toolbar.prototype.tbKeydownHandler = function (e) {
561
- if (e.target.classList.contains('e-dropdown-btn') ||
562
- e.target.getAttribute('id') === this.parent.getID() + '_toolbar_CreateTable') {
563
- e.target.setAttribute('tabindex', '0');
564
- }
565
- };
566
560
  Toolbar.prototype.toolbarClickHandler = function (e) {
567
561
  var trg = closest(e.originalEvent.target, '.e-hor-nav');
568
562
  if (trg && this.parent.toolbarSettings.type === ToolbarType.Expand && !isNOU(trg)) {
@@ -592,11 +586,9 @@ var Toolbar = /** @class */ (function () {
592
586
  return;
593
587
  }
594
588
  EventHandler.add(this.tbElement, 'focusin', this.tbFocusHandler, this);
595
- EventHandler.add(this.tbElement, 'keydown', this.tbKeydownHandler, this);
596
589
  };
597
590
  Toolbar.prototype.unWireEvents = function () {
598
591
  EventHandler.remove(this.tbElement, 'focusin', this.tbFocusHandler);
599
- EventHandler.remove(this.tbElement, 'keydown', this.tbKeydownHandler);
600
592
  };
601
593
  Toolbar.prototype.addEventListener = function () {
602
594
  if (this.parent.isDestroyed) {
@@ -601,3 +601,8 @@ export declare const CLS_RTE_TB_ENABLED: string;
601
601
 
602
602
  */
603
603
  export declare const CLS_RTE_RES_WEST: string;
604
+ /**
605
+ * @hidden
606
+
607
+ */
608
+ export declare const CLS_RTE_SOURCE_CODE_TXTAREA: string;
@@ -601,3 +601,8 @@ export var CLS_RTE_TB_ENABLED = 'e-rte-toolbar-enabled';
601
601
 
602
602
  */
603
603
  export var CLS_RTE_RES_WEST = 'e-south-west';
604
+ /**
605
+ * @hidden
606
+
607
+ */
608
+ export var CLS_RTE_SOURCE_CODE_TXTAREA = 'e-rte-srctextarea';
@@ -258,6 +258,7 @@ export interface NotifyArgs {
258
258
  allowedStylePropertiesArray?: string[];
259
259
  formatPainterSettings?: FormatPainterSettingsModel;
260
260
  emojiPickerSettings?: EmojiSettingsModel;
261
+ ariaLabel?: string;
261
262
  }
262
263
  /**
263
264
  * Provides information about the current and previous cssClass property .
@@ -1585,4 +1585,16 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
1585
1585
  private editorKeyDown;
1586
1586
  private unWireEvents;
1587
1587
  private unbindEvents;
1588
+ /**
1589
+ *
1590
+ * @param e Focus event
1591
+ * @returns string Returns the current focus either `editArea` or `toolbar` or `textArea` or `sourceCode` or `outside` of the RichTextEditor.
1592
+ * @hidden
1593
+ */
1594
+ private getCurrentFocus;
1595
+ /**
1596
+ * @param {FocusEvent} e - specifies the event.
1597
+ * @hidden
1598
+ */
1599
+ private resetToolbarTabIndex;
1588
1600
  }
@@ -762,10 +762,10 @@ var RichTextEditor = /** @class */ (function (_super) {
762
762
  }
763
763
  switch (e.action) {
764
764
  case 'toolbar-focus':
765
- if (this.toolbarSettings.enable) {
766
- // eslint-disable-next-line
767
- var selector = '.e-toolbar-item[title] [tabindex]';
768
- this.toolbarModule.baseToolbar.toolbarObj.element.querySelector(selector).focus();
765
+ if (this.toolbarSettings.enable && this.getToolbarElement()) {
766
+ var firstActiveItem = this.getToolbarElement().querySelector('.e-toolbar-item:not(.e-overlay)[title]');
767
+ firstActiveItem.firstElementChild.removeAttribute('tabindex');
768
+ firstActiveItem.firstElementChild.focus();
769
769
  }
770
770
  break;
771
771
  case 'escape':
@@ -2128,15 +2128,10 @@ var RichTextEditor = /** @class */ (function (_super) {
2128
2128
  }
2129
2129
  EventHandler.add(document, 'mousedown', this.onDocumentClick, this);
2130
2130
  }
2131
- if (!isNOU(this.getToolbarElement())) {
2132
- var toolbarItem = this.getToolbarElement().querySelectorAll('input,select,button,a,[tabindex]');
2133
- for (var i = 0; i < toolbarItem.length; i++) {
2134
- if ((!toolbarItem[i].classList.contains('e-rte-dropdown-btn') &&
2135
- !toolbarItem[i].classList.contains('e-insert-table-btn')) &&
2136
- (!toolbarItem[i].hasAttribute('tabindex') ||
2137
- toolbarItem[i].getAttribute('tabindex') !== '-1')) {
2138
- toolbarItem[i].setAttribute('tabindex', '-1');
2139
- }
2131
+ if (!this.readonly) {
2132
+ var currentFocus = this.getCurrentFocus(e);
2133
+ if (currentFocus === 'editArea' || currentFocus === 'textArea' || currentFocus === 'sourceCode') {
2134
+ this.resetToolbarTabIndex();
2140
2135
  }
2141
2136
  }
2142
2137
  };
@@ -2253,6 +2248,9 @@ var RichTextEditor = /** @class */ (function (_super) {
2253
2248
  else {
2254
2249
  this.isRTE = true;
2255
2250
  }
2251
+ if (!this.readonly && this.getCurrentFocus(e) === 'outside') {
2252
+ this.resetToolbarTabIndex();
2253
+ }
2256
2254
  };
2257
2255
  /**
2258
2256
  * invokeChangeEvent method
@@ -2507,6 +2505,44 @@ var RichTextEditor = /** @class */ (function (_super) {
2507
2505
  }
2508
2506
  this.unWireScrollElementsEvents();
2509
2507
  };
2508
+ /**
2509
+ *
2510
+ * @param e Focus event
2511
+ * @returns string Returns the current focus either `editArea` or `toolbar` or `textArea` or `sourceCode` or `outside` of the RichTextEditor.
2512
+ * @hidden
2513
+ */
2514
+ RichTextEditor.prototype.getCurrentFocus = function (e) {
2515
+ if (e.target === this.inputElement && document.activeElement === this.inputElement) {
2516
+ return 'editArea';
2517
+ }
2518
+ else if (e.target === this.getToolbarElement() || (!isNOU(e.relatedTarget) && closest(e.relatedTarget, '.e-rte-toolbar') === this.getToolbarElement())) {
2519
+ return 'toolbar';
2520
+ }
2521
+ else if (e.target === this.valueContainer && document.activeElement === this.valueContainer) {
2522
+ return 'textArea';
2523
+ }
2524
+ else if (!isNOU(e.target) && e.target.classList.contains(classes.CLS_RTE_SOURCE_CODE_TXTAREA) && document.activeElement === e.target) {
2525
+ return 'sourceCode';
2526
+ }
2527
+ return 'outside';
2528
+ };
2529
+ /**
2530
+ * @param {FocusEvent} e - specifies the event.
2531
+ * @hidden
2532
+ */
2533
+ RichTextEditor.prototype.resetToolbarTabIndex = function () {
2534
+ if (this.getToolbarElement()) {
2535
+ var toolbarItem = this.getToolbarElement().querySelectorAll('input,select,button,a,[tabindex]');
2536
+ for (var i = 0; i < toolbarItem.length; i++) {
2537
+ if ((!toolbarItem[i].classList.contains('e-rte-dropdown-btn') &&
2538
+ !toolbarItem[i].classList.contains('e-insert-table-btn')) &&
2539
+ (!toolbarItem[i].hasAttribute('tabindex') ||
2540
+ toolbarItem[i].getAttribute('tabindex') !== '-1')) {
2541
+ toolbarItem[i].setAttribute('tabindex', '-1');
2542
+ }
2543
+ }
2544
+ }
2545
+ };
2510
2546
  __decorate([
2511
2547
  Complex({}, ToolbarSettings)
2512
2548
  ], RichTextEditor.prototype, "toolbarSettings", void 0);
@@ -198,6 +198,7 @@ export var defaultLocale = {
198
198
  'emojiPickerTypeToFind': 'Type to find',
199
199
  'emojiPickerNoResultFound': 'No results found',
200
200
  'emojiPickerTrySomethingElse': 'Try something else',
201
+ 'linkAriaLabel': 'Open in new window',
201
202
  };
202
203
  export var toolsLocale = {
203
204
  'alignments': 'alignments',
@@ -365,6 +365,7 @@ var Link = /** @class */ (function () {
365
365
  linkTitle = linkEle.querySelector('.e-rte-linkTitle').value;
366
366
  }
367
367
  var target = (this.selfLink.checkBoxObj.checked) ? '_blank' : null;
368
+ var linkLabel = (this.selfLink.checkBoxObj.checked) ? this.selfLink.i10n.getConstant('linkAriaLabel') : null;
368
369
  if (linkUrl === '') {
369
370
  this.selfLink.checkUrl(true);
370
371
  return;
@@ -395,7 +396,7 @@ var Link = /** @class */ (function () {
395
396
  this.selectParent = proxy.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
396
397
  }
397
398
  var value = {
398
- url: linkUrl, text: linkText, title: linkTitle, target: target,
399
+ url: linkUrl, text: linkText, title: linkTitle, target: target, ariaLabel: linkLabel,
399
400
  selection: this.selection, selectParent: this.selectParent
400
401
  };
401
402
  if (document.body.contains(proxy.dialogObj.element)) {
@@ -1351,7 +1351,7 @@ var Table = /** @class */ (function () {
1351
1351
  value: 3,
1352
1352
  placeholder: tableRow,
1353
1353
  floatLabelType: 'Auto',
1354
- max: 50,
1354
+ max: 1000,
1355
1355
  enableRtl: this.parent.enableRtl, locale: this.parent.locale,
1356
1356
  cssClass: this.parent.cssClass
1357
1357
  });
@@ -1,6 +1,6 @@
1
1
  import { removeClass, selectAll, isNullOrUndefined, EventHandler } from '@syncfusion/ej2-base';
2
2
  import * as events from '../base/constant';
3
- import { CLS_EXPAND_OPEN, CLS_TB_ITEM, CLS_ACTIVE } from '../base/classes';
3
+ import { CLS_EXPAND_OPEN, CLS_TB_ITEM, CLS_ACTIVE, CLS_RTE_SOURCE_CODE_TXTAREA } from '../base/classes';
4
4
  import * as CONSTANT from '../../common/constant';
5
5
  import { RenderType } from '../base/enum';
6
6
  import { KeyboardEvents } from '../actions/keyboard';
@@ -44,7 +44,7 @@ var ViewSource = /** @class */ (function () {
44
44
  this.parent.formatter.editorManager.observer.off(CONSTANT.KEY_DOWN_HANDLER, this.onKeyDown);
45
45
  };
46
46
  ViewSource.prototype.getSourceCode = function () {
47
- return this.parent.createElement('textarea', { className: 'e-rte-srctextarea' + ' ' + this.parent.cssClass });
47
+ return this.parent.createElement('textarea', { className: CLS_RTE_SOURCE_CODE_TXTAREA + ' ' + this.parent.cssClass });
48
48
  };
49
49
  ViewSource.prototype.wireEvent = function (element) {
50
50
  this.keyboardModule = new KeyboardEvents(element, {
@@ -78,9 +78,10 @@ var ViewSource = /** @class */ (function () {
78
78
  event.preventDefault();
79
79
  break;
80
80
  case 'toolbar-focus':
81
- if (this.parent.toolbarSettings.enable) {
82
- var selector = '.e-toolbar-item[title] [tabindex]';
83
- this.parent.toolbarModule.baseToolbar.toolbarObj.element.querySelector(selector).focus();
81
+ if (this.parent.toolbarSettings.enable && this.parent.getToolbarElement()) {
82
+ var firstActiveItem = this.parent.getToolbarElement().querySelector('.e-toolbar-item:not(.e-overlay)[title]');
83
+ firstActiveItem.firstElementChild.removeAttribute('tabindex');
84
+ firstActiveItem.firstElementChild.focus();
84
85
  }
85
86
  break;
86
87
  }