@syncfusion/ej2-richtexteditor 23.1.40 → 23.1.43

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.1.40
3
+ * version : 23.1.43
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.1.39",
3
+ "_id": "@syncfusion/ej2-richtexteditor@23.1.41",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-V6HvyVC8YYc6eSNz2M5jIO8qngm8IPaoMoSlPX+k2yj4b32y7X1jed6kwH+alM9z7Ze1A/AKIZTKHzhMPpMlyQ==",
5
+ "_integrity": "sha512-CIPlpeV1ZJSthFtQHaNVAdANuI0M5aDYUT/Ar7obSF9TC4jwgwVIY0UdZ6KZC/dXzsAqRq1q7+QE8F5OzjvG7A==",
6
6
  "_location": "/@syncfusion/ej2-richtexteditor",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -26,8 +26,8 @@
26
26
  "/@syncfusion/ej2-react-richtexteditor",
27
27
  "/@syncfusion/ej2-vue-richtexteditor"
28
28
  ],
29
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-23.1.39.tgz",
30
- "_shasum": "cc5669f0dd4098e1c15fe63e0cd31cded1e50be3",
29
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-23.1.41.tgz",
30
+ "_shasum": "a9c6e53775552699f2528d6f4cf619a806d4660e",
31
31
  "_spec": "@syncfusion/ej2-richtexteditor@*",
32
32
  "_where": "/jenkins/workspace/elease-automation_release_23.1.1/packages/included",
33
33
  "author": {
@@ -38,13 +38,13 @@
38
38
  },
39
39
  "bundleDependencies": false,
40
40
  "dependencies": {
41
- "@syncfusion/ej2-base": "~23.1.38",
42
- "@syncfusion/ej2-buttons": "~23.1.39",
43
- "@syncfusion/ej2-filemanager": "~23.1.40",
44
- "@syncfusion/ej2-inputs": "~23.1.40",
45
- "@syncfusion/ej2-navigations": "~23.1.40",
46
- "@syncfusion/ej2-popups": "~23.1.38",
47
- "@syncfusion/ej2-splitbuttons": "~23.1.36"
41
+ "@syncfusion/ej2-base": "~23.1.41",
42
+ "@syncfusion/ej2-buttons": "~23.1.43",
43
+ "@syncfusion/ej2-filemanager": "~23.1.43",
44
+ "@syncfusion/ej2-inputs": "~23.1.43",
45
+ "@syncfusion/ej2-navigations": "~23.1.43",
46
+ "@syncfusion/ej2-popups": "~23.1.43",
47
+ "@syncfusion/ej2-splitbuttons": "~23.1.43"
48
48
  },
49
49
  "deprecated": false,
50
50
  "description": "Essential JS 2 RichTextEditor component",
@@ -70,6 +70,6 @@
70
70
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
71
71
  },
72
72
  "typings": "index.d.ts",
73
- "version": "23.1.40",
73
+ "version": "23.1.43",
74
74
  "sideEffects": false
75
75
  }
@@ -10,7 +10,7 @@ var EmojiPickerAction = /** @class */ (function () {
10
10
  };
11
11
  EmojiPickerAction.prototype.emojiInsert = function (args) {
12
12
  var node = document.createTextNode(args.value);
13
- var selection = window.getSelection();
13
+ var selection = this.parent.currentDocument.getSelection();
14
14
  var range = selection.getRangeAt(0);
15
15
  var cursorPos = range.startOffset;
16
16
  for (var i = cursorPos - 1; i >= cursorPos - 15; i--) {
@@ -319,10 +319,15 @@ var FormatPainterActions = /** @class */ (function () {
319
319
  return this.INVALID_TAGS.indexOf(node.tagName) > -1;
320
320
  };
321
321
  FormatPainterActions.prototype.findCurrentContext = function (parentElem) {
322
- if (closest(parentElem, 'p')) {
322
+ var closestParagraph = closest(parentElem, 'p');
323
+ var closestList = closest(parentElem, 'li');
324
+ if (closestParagraph && !closestList) {
323
325
  return 'Text';
324
326
  }
325
327
  else if (closest(parentElem, 'li')) {
328
+ if (!isNOU(closestParagraph) && !isNOU(closestList) && closestParagraph.textContent.trim() !== closestList.textContent.trim()) {
329
+ return 'Text';
330
+ }
326
331
  return 'List';
327
332
  }
328
333
  else if (closest(parentElem, 'td') || closest(parentElem, 'tr') || closest(parentElem, 'th')) {
@@ -380,7 +385,7 @@ var FormatPainterActions = /** @class */ (function () {
380
385
  var cloneElementNode = isNOU(cloneListParentNode) ? element : element.firstChild;
381
386
  for (var index = 0; index < nodes.length; index++) {
382
387
  if (this.INVALID_TAGS.indexOf(nodes[index].nodeName) > -1 ||
383
- nodes[index].querySelectorAll('a,img,audio,video,iframe').length > 0) {
388
+ nodes[index].querySelectorAll('img,audio,video,iframe').length > 0) {
384
389
  continue;
385
390
  }
386
391
  var cloneParentNode = cloneElementNode.cloneNode(false);
@@ -344,6 +344,11 @@ var InsertHtml = /** @class */ (function () {
344
344
  : lastSelectionNode.previousSibling) : lastSelectionNode;
345
345
  while (!isNOU(lastSelectionNode) && lastSelectionNode.nodeName !== '#text' && lastSelectionNode.nodeName !== 'IMG' &&
346
346
  lastSelectionNode.nodeName !== 'BR' && lastSelectionNode.nodeName !== 'HR') {
347
+ if (!isNOU(lastSelectionNode.lastChild) && (lastSelectionNode.lastChild.nodeName === 'P' &&
348
+ lastSelectionNode.lastChild.innerHTML === '')) {
349
+ var lineBreak = createElement('br');
350
+ lastSelectionNode.lastChild.appendChild(lineBreak);
351
+ }
347
352
  lastSelectionNode = lastSelectionNode.lastChild;
348
353
  }
349
354
  lastSelectionNode = isNOU(lastSelectionNode) ? node : lastSelectionNode;
@@ -275,7 +275,7 @@ var LinkCommand = /** @class */ (function () {
275
275
  for (var i = 0; i < blockNodes.length; i++) {
276
276
  var linkNode = blockNodes[i].querySelectorAll('a');
277
277
  for (var j = 0; j < linkNode.length; j++) {
278
- if (document.getSelection().containsNode(linkNode[j], true)) {
278
+ if (this.parent.currentDocument.getSelection().containsNode(linkNode[j], true)) {
279
279
  linkNode[j].outerHTML = linkNode[j].innerHTML;
280
280
  }
281
281
  }
@@ -307,8 +307,10 @@ var MsWordPaste = /** @class */ (function () {
307
307
  else {
308
308
  continue;
309
309
  }
310
- isCroppedImage = this.extractCropValue('cropl', fullImg[i]) > 0 &&
311
- this.extractCropValue('cropt', fullImg[i]) > 0 ? true : false;
310
+ isCroppedImage = ((this.extractCropValue('cropl', fullImg[i]) > 0 &&
311
+ this.extractCropValue('cropt', fullImg[i]) > 0) ||
312
+ this.extractCropValue('cropr', fullImg[i]) > 0 ||
313
+ this.extractCropValue('cropb', fullImg[i])) ? true : false;
312
314
  if (isCroppedImage) {
313
315
  goalWidth = this.extractCropValue('wgoal', fullImg[i]);
314
316
  goalHeight = this.extractCropValue('hgoal', fullImg[i]);
@@ -335,7 +337,7 @@ var MsWordPaste = /** @class */ (function () {
335
337
  };
336
338
  MsWordPaste.prototype.extractCropValue = function (crop, rtfData) {
337
339
  // eslint-disable-next-line security/detect-non-literal-regexp
338
- var result = new RegExp('\\\\pic' + crop + '(\\-?\\d+)\\\\').exec(rtfData.replace('\r\n\\', '\\'))[1];
340
+ var result = new RegExp('\\\\pic' + crop + '(\\-?\\d+)\\\\').exec(rtfData.replace(/\r\n\\/g, '\\').replace(/\n/g, '\\'))[1];
339
341
  return parseInt(result, 10);
340
342
  };
341
343
  MsWordPaste.prototype.removeClassName = function (elm) {
@@ -374,6 +376,10 @@ var MsWordPaste = /** @class */ (function () {
374
376
  return removableElement;
375
377
  };
376
378
  MsWordPaste.prototype.removeUnwantedElements = function (elm) {
379
+ var styleElm = elm.querySelector('style');
380
+ if (!isNOU(styleElm)) {
381
+ detach(styleElm);
382
+ }
377
383
  var innerElement = elm.innerHTML;
378
384
  for (var i = 0; i < this.removableElements.length; i++) {
379
385
  // eslint-disable-next-line security/detect-non-literal-regexp
@@ -671,10 +677,8 @@ var MsWordPaste = /** @class */ (function () {
671
677
  }
672
678
  if (!isNOU(listNodes[i].getAttribute('style'))) {
673
679
  listNodes[i].setAttribute('style', listNodes[i].getAttribute('style').replace('text-align:start;', ''));
674
- if (listNodes[i].style.textAlign !== '') {
675
- listNodes[i].setAttribute('style', 'text-align:' + listNodes[i].style.textAlign);
676
- currentListStyle = listNodes[i].getAttribute('style');
677
- }
680
+ listNodes[i].style.textIndent = '';
681
+ currentListStyle = listNodes[i].getAttribute('style');
678
682
  }
679
683
  collection.push({
680
684
  listType: type, content: tempNode, nestedLevel: level, class: currentClassName,
@@ -882,8 +886,7 @@ var MsWordPaste = /** @class */ (function () {
882
886
  }
883
887
  }
884
888
  prevList.setAttribute('class', collection[index].class);
885
- var currentStyle = prevList.getAttribute('style');
886
- prevList.setAttribute('style', (!isNOU(currentStyle) ? currentStyle : ''));
889
+ prevList.setAttribute('style', (!isNOU(collection[index].listStyle) ? collection[index].listStyle : ''));
887
890
  pLevel = collection[index].nestedLevel;
888
891
  listCount++;
889
892
  if (!isNOU(collection[index].start)) {
@@ -49,7 +49,7 @@ var NodeCutter = /** @class */ (function () {
49
49
  node = parent_1.childNodes[index];
50
50
  fragment = this.spliceEmptyNode(fragment, false);
51
51
  if (fragment && fragment.childNodes.length > 0) {
52
- var isEmpty = (fragment.childNodes.length === 1 && fragment.childNodes[0].nodeName !== 'IMG'
52
+ var isEmpty = (fragment.childNodes.length === 1 && fragment.childNodes[0].nodeName !== 'IMG' && !(fragment.querySelectorAll('img').length > 0)
53
53
  && this.isRteElm(fragment) && fragment.textContent === '') ? true : false;
54
54
  if (!isEmpty) {
55
55
  if (node) {
@@ -86,7 +86,7 @@ var EmojiPicker = /** @class */ (function () {
86
86
  }
87
87
  else if (isNOU(args.x) && isNOU(args.y) && !this.parent.inlineMode.enable && isNOU(this.parent.quickToolbarSettings.text)) {
88
88
  target = this.parent.inputElement;
89
- if (window.getSelection().rangeCount > 0) {
89
+ if (this.parent.contentModule.getDocument().getSelection().rangeCount > 0) {
90
90
  var coordinates = this.getCoordinates();
91
91
  xValue = coordinates.left;
92
92
  yValue = coordinates.top;
@@ -94,7 +94,7 @@ var EmojiPicker = /** @class */ (function () {
94
94
  }
95
95
  else if (isNOU(args.x) && isNOU(args.y) && (this.parent.inlineMode.enable || !isNOU(this.parent.quickToolbarSettings.text))) {
96
96
  this.parent.notify(events.hidePopup, {});
97
- if (window.getSelection().rangeCount > 0) {
97
+ if (this.parent.contentModule.getDocument().getSelection().rangeCount > 0) {
98
98
  var coordinates = this.getCoordinates();
99
99
  xValue = coordinates.left;
100
100
  yValue = coordinates.top;
@@ -683,7 +683,7 @@ var EmojiPicker = /** @class */ (function () {
683
683
  };
684
684
  EmojiPicker.prototype.onkeyPress = function (e) {
685
685
  var originalEvent = e.args;
686
- var selection = window.getSelection();
686
+ var selection = this.parent.contentModule.getDocument().getSelection();
687
687
  if (selection.rangeCount <= 0) {
688
688
  return;
689
689
  }
@@ -713,7 +713,10 @@ var EmojiPicker = /** @class */ (function () {
713
713
  };
714
714
  EmojiPicker.prototype.onkeyUp = function (e) {
715
715
  var originalEvent = e.args;
716
- var selection = window.getSelection();
716
+ var selection = this.parent.contentModule.getDocument().getSelection();
717
+ if (selection.rangeCount <= 0) {
718
+ return;
719
+ }
717
720
  var range = selection.getRangeAt(0);
718
721
  var cursorPos = range.startOffset;
719
722
  // eslint-disable-next-line
@@ -736,7 +739,7 @@ var EmojiPicker = /** @class */ (function () {
736
739
  };
737
740
  EmojiPicker.prototype.getCoordinates = function () {
738
741
  var coordinates;
739
- var selection = window.getSelection();
742
+ var selection = this.parent.contentModule.getDocument().getSelection();
740
743
  var range = selection.getRangeAt(0);
741
744
  var firstChild;
742
745
  if (range.startContainer.nodeName === 'P' || range.startContainer.nodeName === 'DIV') {
@@ -236,7 +236,7 @@ var EnterKeyAction = /** @class */ (function () {
236
236
  }
237
237
  _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), insertElem.nextElementSibling, 0);
238
238
  }
239
- else if (nearBlockNode.textContent.length === 0 && !(!isNOU(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG')) {
239
+ else if (nearBlockNode.textContent.length === 0 && !(!isNOU(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG') && !(nearBlockNode.querySelectorAll('img').length > 0)) {
240
240
  if (!isNOU(nearBlockNode.children[0]) && nearBlockNode.children[0].tagName !== 'BR') {
241
241
  var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
242
242
  _this.parent.formatter.editorManager.domNode.insertAfter(newElem, nearBlockNode);
@@ -151,7 +151,7 @@ var HtmlEditor = /** @class */ (function () {
151
151
  detach(currentChildNode[i]);
152
152
  i--;
153
153
  }
154
- if (focusNode.textContent.replace(regEx, '') === currentChildNode[i].textContent) {
154
+ if (!isNOU(currentChildNode[i]) && focusNode.textContent.replace(regEx, '') === currentChildNode[i].textContent) {
155
155
  pointer = focusNode.textContent.length > 1 ?
156
156
  (focusNode.textContent === currentChildNode[i].textContent ? pointer :
157
157
  pointer - (focusNode.textContent.length - focusNode.textContent.replace(regEx, '').length)) :
@@ -16,6 +16,7 @@ import { ToolbarAction } from './toolbar-action';
16
16
  */
17
17
  var Toolbar = /** @class */ (function () {
18
18
  function Toolbar(parent, serviceLocator) {
19
+ this.tools = {};
19
20
  this.parent = parent;
20
21
  this.isToolbar = false;
21
22
  this.locator = serviceLocator;
@@ -1534,6 +1534,7 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
1534
1534
  private getUpdatedValue;
1535
1535
  private updateValueOnIdle;
1536
1536
  private updateIntervalValue;
1537
+ private removeResizeElement;
1537
1538
  private updateStatus;
1538
1539
  private onDocumentClick;
1539
1540
  private blurHandler;
@@ -743,13 +743,14 @@ var RichTextEditor = /** @class */ (function (_super) {
743
743
  this.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(), range.startContainer, range.startOffset);
744
744
  }
745
745
  }
746
- var notFormatPainterCopy = !isNOU(e.action) && e.action !== 'format-copy';
747
- if (this.formatter.getUndoRedoStack().length === 0 && notFormatPainterCopy) {
746
+ var notFormatPainterCopy = isNOU(e.action) ? true : (e.action !== 'format-copy' ? true : false);
747
+ if (this.formatter.getUndoRedoStack().length === 0 && notFormatPainterCopy &&
748
+ !(e.altKey || e.shiftKey || (e.altKey && e.shiftKey && e.which === 67))) {
748
749
  this.formatter.saveData();
749
750
  }
750
751
  if (e.action !== 'insert-link' &&
751
752
  e.action !== 'format-copy' && e.action !== 'format-paste' &&
752
- (!e.target || (e.target.classList.contains('e-mention') && e.code !== 'Tab')) &&
753
+ (!e.target || !(e.target.classList.contains('e-mention') && e.code === 'Tab')) &&
753
754
  (e.action && e.action !== 'paste' && e.action !== 'space'
754
755
  || e.which === 9 || (e.code === 'Backspace' && e.which === 8))) {
755
756
  var FormatPainterEscapeAction = false;
@@ -1864,8 +1865,8 @@ var RichTextEditor = /** @class */ (function (_super) {
1864
1865
  }
1865
1866
  else {
1866
1867
  if (target === 'windowResize' && heightPercent) {
1867
- // cntEle hide the borderBottom of RichTextEditor. so removed the 2px of cntEle height.
1868
- heightValue = parseInt(heightValue) - 2 + 'px';
1868
+ //cntEle hide the borderBottom of RichTextEditor. so removed the 2px of cntEle height.
1869
+ heightValue = parseInt(heightValue, 10) - 2 + 'px';
1869
1870
  }
1870
1871
  setStyleAttribute(cntEle, { height: heightValue, marginTop: topValue + 'px' });
1871
1872
  }
@@ -1889,7 +1890,7 @@ var RichTextEditor = /** @class */ (function (_super) {
1889
1890
  * @public
1890
1891
  */
1891
1892
  RichTextEditor.prototype.getHtml = function () {
1892
- var htmlValue = this.contentModule.getEditPanel().innerHTML;
1893
+ var htmlValue = this.removeResizeElement(this.contentModule.getEditPanel().innerHTML);
1893
1894
  return (this.enableXhtml && (htmlValue === '<p><br></p>' || htmlValue === '<div><br></div>' ||
1894
1895
  htmlValue === '<br>') ? null : this.serializeValue(htmlValue));
1895
1896
  };
@@ -1900,7 +1901,7 @@ var RichTextEditor = /** @class */ (function (_super) {
1900
1901
  * @public
1901
1902
  */
1902
1903
  RichTextEditor.prototype.getXhtml = function () {
1903
- var currentValue = this.value;
1904
+ var currentValue = this.removeResizeElement(this.value);
1904
1905
  if (!isNOU(currentValue) && this.enableXhtml) {
1905
1906
  currentValue = this.htmlEditorModule.xhtmlValidation.selfEncloseValidation(currentValue);
1906
1907
  }
@@ -2141,14 +2142,11 @@ var RichTextEditor = /** @class */ (function (_super) {
2141
2142
  };
2142
2143
  RichTextEditor.prototype.getUpdatedValue = function () {
2143
2144
  var value;
2144
- if (!isNOU(this.tableModule)) {
2145
- this.tableModule.removeResizeElement();
2146
- }
2147
2145
  var getTextArea = this.element.querySelector('.e-rte-srctextarea');
2148
2146
  if (this.editorMode === 'HTML') {
2149
2147
  value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
2150
2148
  this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
2151
- this.encode(decode(this.inputElement.innerHTML)) : this.inputElement.innerHTML;
2149
+ this.encode(decode(this.removeResizeElement(this.inputElement.innerHTML))) : this.inputElement.innerHTML;
2152
2150
  if (getTextArea && getTextArea.style.display === 'block') {
2153
2151
  value = getTextArea.value;
2154
2152
  }
@@ -2157,6 +2155,9 @@ var RichTextEditor = /** @class */ (function (_super) {
2157
2155
  value = this.inputElement.value === '' ? null :
2158
2156
  this.inputElement.value;
2159
2157
  }
2158
+ if (value != null && !this.enableHtmlEncode) {
2159
+ value = this.removeResizeElement(value);
2160
+ }
2160
2161
  return value;
2161
2162
  };
2162
2163
  RichTextEditor.prototype.updateValueOnIdle = function () {
@@ -2172,6 +2173,17 @@ var RichTextEditor = /** @class */ (function (_super) {
2172
2173
  clearTimeout(this.idleInterval);
2173
2174
  this.idleInterval = setTimeout(this.updateValueOnIdle.bind(this), 0);
2174
2175
  };
2176
+ RichTextEditor.prototype.removeResizeElement = function (value) {
2177
+ var valueElementWrapper = document.createElement("div");
2178
+ valueElementWrapper.innerHTML = value;
2179
+ var item = valueElementWrapper.querySelectorAll('.e-column-resize, .e-row-resize, .e-table-box, .e-table-rhelper, .e-img-resize');
2180
+ if (item.length > 0) {
2181
+ for (var i = 0; i < item.length; i++) {
2182
+ detach(item[i]);
2183
+ }
2184
+ }
2185
+ return valueElementWrapper.innerHTML;
2186
+ };
2175
2187
  RichTextEditor.prototype.updateStatus = function (e) {
2176
2188
  if (!isNOU(e.html) || !isNOU(e.markdown)) {
2177
2189
  var status_1 = this.formatter.editorManager.undoRedoManager.getUndoStatus();
@@ -2220,6 +2232,7 @@ var RichTextEditor = /** @class */ (function (_super) {
2220
2232
  this.notify(events.focusChange, {});
2221
2233
  var value = this.getUpdatedValue();
2222
2234
  this.setProperties({ value: value });
2235
+ this.valueContainer.value = this.value;
2223
2236
  this.notify(events.toolbarRefresh, { args: e, documentNode: document });
2224
2237
  this.isValueChangeBlurhandler = true;
2225
2238
  this.invokeChangeEvent();
@@ -69,20 +69,20 @@ var Formatter = /** @class */ (function () {
69
69
  }
70
70
  if (isNOU(args)) {
71
71
  var action_1 = event.action;
72
+ args = {};
73
+ var items = {
74
+ originalEvent: event, cancel: false,
75
+ requestType: action_1 || (event.key + 'Key'),
76
+ itemCollection: value
77
+ };
78
+ extend(args, args, items, true);
72
79
  if (action_1 !== 'tab' && action_1 !== 'enter' && action_1 !== 'space' && action_1 !== 'escape') {
73
- args = {};
74
80
  if (self.editorMode === 'Markdown' && action_1 === 'insert-table') {
75
81
  value = {
76
82
  'headingText': self.localeObj.getConstant('TableHeadingText'),
77
83
  'colText': self.localeObj.getConstant('TableColText')
78
84
  };
79
85
  }
80
- var items = {
81
- originalEvent: event, cancel: false,
82
- requestType: action_1 || (event.key + 'Key'),
83
- itemCollection: value
84
- };
85
- extend(args, args, items, true);
86
86
  self.trigger(CONSTANT.actionBegin, args, function (actionBeginArgs) {
87
87
  if (actionBeginArgs.cancel) {
88
88
  if (action_1 === 'paste' || action_1 === 'cut' || action_1 === 'copy') {
@@ -91,20 +91,22 @@ var Formatter = /** @class */ (function () {
91
91
  }
92
92
  });
93
93
  }
94
- var isTableModule = isNOU(self.tableModule) ? true : self.tableModule ?
95
- self.tableModule.ensureInsideTableList : false;
96
- if ((event.which === 9 && isTableModule) || event.which !== 9) {
97
- if (event.which === 13 && self.editorMode === 'HTML') {
98
- value = {
99
- 'enterAction': self.enterKey
100
- };
94
+ if (!args.cancel) {
95
+ var isTableModule = isNOU(self.tableModule) ? true : self.tableModule ?
96
+ self.tableModule.ensureInsideTableList : false;
97
+ if ((event.which === 9 && isTableModule) || event.which !== 9) {
98
+ if (event.which === 13 && self.editorMode === 'HTML') {
99
+ value = {
100
+ 'enterAction': self.enterKey
101
+ };
102
+ }
103
+ this.editorManager.observer.notify((event.type === 'keydown' ? KEY_DOWN : KEY_UP), {
104
+ event: event,
105
+ callBack: this.onSuccess.bind(this, self),
106
+ value: value,
107
+ enterAction: self.enterKey
108
+ });
101
109
  }
102
- this.editorManager.observer.notify((event.type === 'keydown' ? KEY_DOWN : KEY_UP), {
103
- event: event,
104
- callBack: this.onSuccess.bind(this, self),
105
- value: value,
106
- enterAction: self.enterKey
107
- });
108
110
  }
109
111
  }
110
112
  else if (!isNOU(args) && args.item.command && args.item.subCommand && ((args.item.command !== args.item.subCommand
@@ -58,10 +58,10 @@ var ToolbarRenderer = /** @class */ (function () {
58
58
  if (!this.parent.enabled) {
59
59
  return;
60
60
  }
61
+ this.parent.trigger('toolbarClick', args);
61
62
  if (!this.parent.readonly || isNullOrUndefined(args.item)) {
62
63
  this.parent.notify(events.toolbarClick, args);
63
64
  }
64
- this.parent.trigger('toolbarClick', args);
65
65
  };
66
66
  ToolbarRenderer.prototype.dropDownSelected = function (args) {
67
67
  this.parent.notify(events.dropDownSelect, args);
@@ -250,6 +250,7 @@ var ToolbarRenderer = /** @class */ (function () {
250
250
  args.cancel = true;
251
251
  return;
252
252
  }
253
+ proxy.parent.notify(events.selectionRestore, {});
253
254
  var element = (args.event) ? args.event.target : null;
254
255
  proxy.currentElement = dropDown.element;
255
256
  proxy.currentDropdown = dropDown;
@@ -276,6 +277,12 @@ var ToolbarRenderer = /** @class */ (function () {
276
277
  }
277
278
  args.element.tabIndex = -1;
278
279
  dropDown.element.removeAttribute('type');
280
+ dropDown.element.onmousedown = function () {
281
+ proxy.parent.notify(events.selectionSave, {});
282
+ };
283
+ dropDown.element.onkeydown = function () {
284
+ proxy.parent.notify(events.selectionSave, {});
285
+ };
279
286
  return dropDown;
280
287
  };
281
288
  // eslint-disable-next-line