@syncfusion/ej2-richtexteditor 27.2.4 → 27.2.5

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 : 27.2.4
3
+ * version : 27.2.5
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@27.2.3",
3
+ "_id": "@syncfusion/ej2-richtexteditor@27.2.4",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-pp9x/DFwkNSSE2Tan2Lp5VmSNG56ukyqIdbHdqMEBOKVTCqX5nlYCpEjTU4T6piBi4BlbeiEcjasWJxtc3ZhNw==",
5
+ "_integrity": "sha512-1De20+Us2+PA3L4shDlbnUqadpJYfdbvv5DWyflNR5/axtshaR3WcqqfUCpCPxexCl3jVgznaEhnKv85YWf/zw==",
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.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-27.2.3.tgz",
29
- "_shasum": "c4636a9f71acd2f9a8a0a63cbfb22593f71ac168",
28
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-27.2.4.tgz",
29
+ "_shasum": "5360188d231a7d646f0647d8de7e2745384588f6",
30
30
  "_spec": "@syncfusion/ej2-richtexteditor@*",
31
31
  "_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
32
32
  "author": {
@@ -37,12 +37,12 @@
37
37
  },
38
38
  "bundleDependencies": false,
39
39
  "dependencies": {
40
- "@syncfusion/ej2-base": "~27.2.2",
40
+ "@syncfusion/ej2-base": "~27.2.5",
41
41
  "@syncfusion/ej2-buttons": "~27.2.4",
42
- "@syncfusion/ej2-dropdowns": "~27.2.4",
43
- "@syncfusion/ej2-filemanager": "~27.2.3",
42
+ "@syncfusion/ej2-dropdowns": "~27.2.5",
43
+ "@syncfusion/ej2-filemanager": "~27.2.5",
44
44
  "@syncfusion/ej2-inputs": "~27.2.4",
45
- "@syncfusion/ej2-navigations": "~27.2.4",
45
+ "@syncfusion/ej2-navigations": "~27.2.5",
46
46
  "@syncfusion/ej2-popups": "~27.2.2",
47
47
  "@syncfusion/ej2-splitbuttons": "~27.2.2"
48
48
  },
@@ -80,6 +80,6 @@
80
80
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
81
81
  },
82
82
  "typings": "index.d.ts",
83
- "version": "27.2.4",
83
+ "version": "27.2.5",
84
84
  "sideEffects": false
85
85
  }
@@ -89,7 +89,7 @@ var Indents = /** @class */ (function () {
89
89
  isRtl ? (parentNode.style.marginRight = indentsValue) : (parentNode.style.marginLeft = indentsValue);
90
90
  }
91
91
  else {
92
- indentsValue = (marginLeftOrRight === '' || marginLeftOrRight === '0px' || marginLeftOrRight === '0in') ? '' : parseInt(marginLeftOrRight, null) - this.indentValue + 'px';
92
+ indentsValue = (marginLeftOrRight === '' || marginLeftOrRight === '0px' || marginLeftOrRight === '0in') ? '' : (parseInt(marginLeftOrRight, null) - this.indentValue < 0) ? '0px' : (parseInt(marginLeftOrRight, null) - this.indentValue) + 'px';
93
93
  isRtl ? (parentNode.style.marginRight = indentsValue) : (parentNode.style.marginLeft = indentsValue);
94
94
  /* eslint-enable */
95
95
  }
@@ -18,6 +18,7 @@ export declare class InsertHtml {
18
18
  private static pasteInsertHTML;
19
19
  private static listCleanUp;
20
20
  private static cleanUpListItems;
21
+ private static cleanUpFlattenListContainer;
21
22
  private static cleanUpListContainer;
22
23
  private static placeCursorEnd;
23
24
  private static getNodeCollection;
@@ -406,27 +406,33 @@ var InsertHtml = /** @class */ (function () {
406
406
  var range = nodeSelection.getRange(docElement);
407
407
  var startContainer = range.startContainer;
408
408
  var startOffset = range.startOffset;
409
- if (range.startContainer.parentElement.closest('ol,ul') !== null && range.endContainer.parentElement.closest('ol,ul') !== null) {
410
- var haslistCleanUp = this.cleanUpListItems(range.startContainer.parentElement.closest('ol,ul'));
411
- var haslistContainerCleanUp = this.cleanUpListContainer(range.startContainer.parentElement.closest('ol,ul'));
412
- if (haslistCleanUp || haslistContainerCleanUp) {
413
- range.setStart(startContainer, startOffset);
414
- range.setEnd(startContainer, startOffset);
409
+ var startParentElement = range.startContainer.parentElement;
410
+ var endParentElement = range.endContainer.parentElement;
411
+ if (!isNOU(startParentElement) && !isNOU(endParentElement)) {
412
+ var startClosestList = startParentElement.closest('ol, ul');
413
+ var endClosestList = endParentElement.closest('ol, ul');
414
+ if (!isNOU(startClosestList) && !isNOU(endClosestList)) {
415
+ var hasListCleanUp = this.cleanUpListItems(startClosestList);
416
+ var hasListContainerCleanUp = this.cleanUpListContainer(startClosestList);
417
+ if (hasListCleanUp || hasListContainerCleanUp) {
418
+ range.setStart(startContainer, startOffset);
419
+ range.setEnd(startContainer, startOffset);
420
+ }
415
421
  }
416
422
  }
417
423
  };
418
424
  InsertHtml.cleanUpListItems = function (parentContainer) {
419
425
  var _this = this;
420
426
  var hasListCleanUp = false;
421
- var listItems = parentContainer.closest('ol, ul').querySelectorAll('li');
422
- if (listItems.length === 0) {
427
+ var listItems;
428
+ if (!isNOU(parentContainer.closest('ol, ul'))) {
429
+ listItems = parentContainer.closest('ol, ul').querySelectorAll('li');
430
+ }
431
+ if (isNOU(listItems) || listItems.length === 0) {
423
432
  return false;
424
433
  }
425
434
  var nearestListItem = null;
426
435
  listItems.forEach(function (listItem) {
427
- if (!isNOU(listItem.firstChild) && (listItem.firstChild.nodeName === 'OL' || listItem.firstChild.nodeName === 'UL')) {
428
- listItem.style.listStyleType = 'none';
429
- }
430
436
  var parentElement = listItem.parentElement;
431
437
  if (!isNOU(parentElement) && parentElement.nodeName !== 'OL' && parentElement.nodeName !== 'UL') {
432
438
  if (isNOU(nearestListItem)) {
@@ -453,15 +459,38 @@ var InsertHtml = /** @class */ (function () {
453
459
  var closestList = parentElement.closest('ol, ul');
454
460
  nearestListItem.insertAdjacentElement('afterend', listItem);
455
461
  nearestListItem = nearestListItem.nextSibling;
456
- _this.removeEmptyElements(closestList);
462
+ if (!isNOU(closestList)) {
463
+ _this.removeEmptyElements(closestList);
464
+ }
457
465
  hasListCleanUp = true;
458
466
  }
459
467
  }
468
+ });
469
+ var cleanUpFlattenListContainer = this.cleanUpFlattenListContainer(parentContainer);
470
+ hasListCleanUp = cleanUpFlattenListContainer ? cleanUpFlattenListContainer : hasListCleanUp;
471
+ return hasListCleanUp;
472
+ };
473
+ InsertHtml.cleanUpFlattenListContainer = function (parentContainer) {
474
+ var hasListCleanUp = false;
475
+ var listItems;
476
+ if (!isNOU(parentContainer.closest('ol, ul'))) {
477
+ listItems = parentContainer.closest('ol, ul').querySelectorAll('li');
478
+ }
479
+ if (isNOU(listItems) || listItems.length === 0) {
480
+ return false;
481
+ }
482
+ listItems.forEach(function (listItem) {
483
+ if (!isNOU(listItem.firstChild) && (listItem.firstChild.nodeName === 'OL' || listItem.firstChild.nodeName === 'UL')) {
484
+ listItem.style.listStyleType = 'none';
485
+ }
460
486
  var nestedLi = Array.from(listItem.children).find(function (child) {
461
487
  return child.tagName === 'LI' && (child.parentElement && child.parentElement.tagName !== 'OL' && child.parentElement.tagName !== 'UL');
462
488
  });
463
- if (nestedLi && listItem.parentNode) {
489
+ if (!isNOU(nestedLi) && !isNOU(listItem.parentNode)) {
464
490
  listItem.parentNode.replaceChild(nestedLi, listItem);
491
+ if (isNOU(nestedLi.textContent) || nestedLi.textContent.trim() === '') {
492
+ nestedLi.remove();
493
+ }
465
494
  hasListCleanUp = true;
466
495
  }
467
496
  });
@@ -204,6 +204,10 @@ var MsWordPaste = /** @class */ (function () {
204
204
  for (var i = 0; i < imgElem.length; i++) {
205
205
  imgSrc.push(imgElem[i].getAttribute('src'));
206
206
  imgName.push(imgElem[i].getAttribute('src').split('/')[imgElem[i].getAttribute('src').split('/').length - 1].split('.')[0]);
207
+ if (!isNOU(imgSrc) && imgSrc[i] !== '') {
208
+ var imgType = imgSrc[i].split('.').pop().toLowerCase();
209
+ imgElem[i].setAttribute('data-image-type', imgType);
210
+ }
207
211
  }
208
212
  var hexValue = this.hexConversion(rtfData);
209
213
  for (var i = 0; i < hexValue.length; i++) {
@@ -1031,9 +1035,22 @@ var MsWordPaste = /** @class */ (function () {
1031
1035
  }
1032
1036
  }
1033
1037
  var listOrder = firstChild.querySelector('span[style="mso-list:Ignore"]');
1038
+ var isEmptyMarkerSpan = isNOU(listOrder);
1039
+ listOrder = isEmptyMarkerSpan ? firstChild : listOrder;
1034
1040
  if (!isNOU(listOrder)) {
1035
- this.listContents.push(listOrder.textContent.trim());
1036
- detach(listOrder);
1041
+ var textContent = listOrder.textContent.trim();
1042
+ if (isEmptyMarkerSpan) {
1043
+ var bulletPattern = /^(\d{1,2}|[a-zA-Z]|[*#~•○■])(\.|\)|-)\s*/;
1044
+ var textContentMatch = textContent.match(bulletPattern);
1045
+ if (!isNOU(textContentMatch)) {
1046
+ textContent = textContentMatch[0].trim();
1047
+ listOrder.textContent = listOrder.textContent.trim().substring(textContent.length).trim();
1048
+ }
1049
+ }
1050
+ this.listContents.push(textContent);
1051
+ if (!isEmptyMarkerSpan) {
1052
+ detach(listOrder);
1053
+ }
1037
1054
  this.removingComments(elem);
1038
1055
  this.removeUnwantedElements(elem);
1039
1056
  }
@@ -32,4 +32,5 @@ export declare class SelectionCommands {
32
32
  private static formatPainterCleanup;
33
33
  private static concatenateTextExcludingList;
34
34
  private static conCatenateTextNode;
35
+ private static hasColorsEqual;
35
36
  }
@@ -509,12 +509,6 @@ var SelectionCommands = /** @class */ (function () {
509
509
  if (!isNOU(bgStyle) && bgStyle !== '') {
510
510
  currentNodeElem.style.backgroundColor = bgStyle;
511
511
  }
512
- if ((format === 'backgroundcolor' && !isNOU(fontStyle) && fontStyle !== '') &&
513
- currentNodeElem.parentElement.innerHTML === currentNodeElem.outerHTML) {
514
- var curParentElem = currentNodeElem.parentElement;
515
- curParentElem.parentElement.insertBefore(currentNodeElem, curParentElem);
516
- detach(curParentElem);
517
- }
518
512
  if (format === 'fontsize' || format === 'fontcolor') {
519
513
  var liElement = nodes[index].parentElement;
520
514
  var parentElement = nodes[index].parentElement;
@@ -996,12 +990,12 @@ var SelectionCommands = /** @class */ (function () {
996
990
  case 'fontcolor':
997
991
  liElement.querySelectorAll('span').forEach(function (span) {
998
992
  colorStyle = span.style.color;
999
- if (colorStyle === constVal) {
993
+ if (SelectionCommands.hasColorsEqual(colorStyle, constVal)) {
1000
994
  result = result + span.textContent;
1001
995
  }
1002
996
  });
1003
- if (result === value) {
1004
- liElement.style.color = colorStyle;
997
+ if (!isNOU(result) && !isNOU(value) && result !== '' && value !== '' && result.replace(/\s+/g, '') === value.replace(/\s+/g, '')) {
998
+ liElement.style.color = constVal;
1005
999
  liElement.style.textDecoration = 'inherit';
1006
1000
  }
1007
1001
  break;
@@ -1012,8 +1006,8 @@ var SelectionCommands = /** @class */ (function () {
1012
1006
  result = result + span.textContent;
1013
1007
  }
1014
1008
  });
1015
- if (result === value) {
1016
- liElement.style.fontSize = fontSize;
1009
+ if (!isNOU(result) && !isNOU(value) && result !== '' && value !== '' && result.replace(/\s+/g, '') === value.replace(/\s+/g, '')) {
1010
+ liElement.style.fontSize = constVal;
1017
1011
  }
1018
1012
  break;
1019
1013
  case 'fontname':
@@ -1024,12 +1018,24 @@ var SelectionCommands = /** @class */ (function () {
1024
1018
  result = result + span.textContent;
1025
1019
  }
1026
1020
  });
1027
- if (result === value) {
1028
- liElement.style.fontFamily = fontFamily;
1021
+ if (!isNOU(result) && !isNOU(value) && result !== '' && value !== '' && result.replace(/\s+/g, '') === value.replace(/\s+/g, '')) {
1022
+ liElement.style.fontFamily = constVal;
1029
1023
  }
1030
1024
  break;
1031
1025
  }
1032
1026
  };
1027
+ SelectionCommands.hasColorsEqual = function (color1, color2) {
1028
+ if (isNOU(color1) || isNOU(color2) || color1.trim() === '' || color2.trim() === '') {
1029
+ return color1 === color2;
1030
+ }
1031
+ if (color1.startsWith('rgb(')) {
1032
+ color1 = color1.replace('rgb(', 'rgba(').slice(0, -1) + ',1)';
1033
+ }
1034
+ if (color2.startsWith('rgb(')) {
1035
+ color2 = color2.replace('rgb(', 'rgba(').slice(0, -1) + ',1)';
1036
+ }
1037
+ return color1.replace(/\s+/g, '') === color2.replace(/\s+/g, '');
1038
+ };
1033
1039
  SelectionCommands.enterAction = 'P';
1034
1040
  return SelectionCommands;
1035
1041
  }());
@@ -112,6 +112,7 @@ var PasteCleanup = /** @class */ (function () {
112
112
  var value = null;
113
113
  var isClipboardHTMLDataNull = false;
114
114
  var imageproperties;
115
+ var allowedTypes = this.parent.insertImageSettings.allowedTypes;
115
116
  if (e.args && !isNOU(e.args.clipboardData)) {
116
117
  value = e.args.clipboardData.getData('text/html');
117
118
  }
@@ -131,6 +132,14 @@ var PasteCleanup = /** @class */ (function () {
131
132
  (!isNOU(e.args.clipboardData.items[1]) ?
132
133
  e.args.clipboardData.items[1].getAsFile() : null) :
133
134
  e.args.clipboardData.items[0].getAsFile()) : null;
135
+ if (file) {
136
+ var fileNameParts = file.name;
137
+ var imgType_1 = fileNameParts.substring(fileNameParts.lastIndexOf('.'));
138
+ if (allowedTypes.every(function (type) { return type.toLowerCase() !== imgType_1; })) {
139
+ e.args.preventDefault();
140
+ return;
141
+ }
142
+ }
134
143
  this.parent.notify(events.paste, {
135
144
  file: file,
136
145
  args: e.args,
@@ -179,6 +188,28 @@ var PasteCleanup = /** @class */ (function () {
179
188
  value = tempDivElem.innerHTML;
180
189
  var isValueNotEmpty = tempDivElem.textContent !== '' || !isNOU(tempDivElem.querySelector('img')) ||
181
190
  !isNOU(tempDivElem.querySelector('table'));
191
+ var imgElements = tempDivElem.querySelectorAll('img');
192
+ imgElements.forEach(function (imgElement) {
193
+ var imageFileFormat;
194
+ var imgElementSrc = imgElement.getAttribute('src');
195
+ if (!isNullOrUndefined(imgElementSrc) && imgElementSrc !== '') {
196
+ if (!isNullOrUndefined(imgElement.getAttribute('data-image-type'))) {
197
+ imageFileFormat = imgElement.getAttribute('data-image-type');
198
+ }
199
+ else if (imgElementSrc.indexOf('base64') > -1 && imgElementSrc.indexOf('data:') > -1) {
200
+ imageFileFormat = imgElementSrc.split(';')[0].split('/')[1];
201
+ }
202
+ else {
203
+ imageFileFormat = imgElementSrc.split('.').pop().toLowerCase();
204
+ }
205
+ if (!isNullOrUndefined(imageFileFormat) &&
206
+ allowedTypes.every(function (type) { return imageFileFormat !== type.substring(1).toLowerCase(); }) &&
207
+ imgElementSrc.indexOf('blob') === -1) {
208
+ detach(imgElement);
209
+ }
210
+ }
211
+ });
212
+ value = tempDivElem.innerHTML;
182
213
  this.parent.notify(events.cleanupResizeElements, {
183
214
  value: value,
184
215
  callBack: function (currentValue) {
@@ -10,6 +10,7 @@ export declare class Resize {
10
10
  protected touchEndEvent: string;
11
11
  private isDestroyed;
12
12
  private isResizing;
13
+ private iframeElement;
13
14
  private iframeMouseUpBoundFn;
14
15
  private constructor();
15
16
  private addEventListener;
@@ -20,6 +20,7 @@ var Resize = /** @class */ (function () {
20
20
  this.parent.on(events.destroy, this.destroy, this);
21
21
  };
22
22
  Resize.prototype.renderResizable = function () {
23
+ var _this = this;
23
24
  var enableRtlClass = (this.parent.enableRtl) ? classes.CLS_RTE_RES_WEST : classes.CLS_RTE_RES_EAST;
24
25
  this.resizer = this.parent.createElement('div', {
25
26
  id: this.parent.getID() + '-resizable', className: 'e-icons'
@@ -32,6 +33,12 @@ var Resize = /** @class */ (function () {
32
33
  this.parent.inputElement.classList.add('e-resize-enabled');
33
34
  this.parent.contentModule.getDocument().addEventListener('mouseup', this.iframeMouseUpBoundFn);
34
35
  }
36
+ this.iframeElement = this.parent.contentModule.getDocument().querySelectorAll('iframe');
37
+ if (!isNullOrUndefined(this.iframeElement)) {
38
+ this.iframeElement.forEach(function (iframe) {
39
+ EventHandler.add(iframe.contentDocument, 'mouseup', _this.stopResize, _this);
40
+ });
41
+ }
35
42
  this.touchStartEvent = (Browser.info.name === 'msie') ? 'pointerdown' : 'touchstart';
36
43
  EventHandler.add(this.resizer, 'mousedown', this.resizeStart, this);
37
44
  EventHandler.add(this.resizer, this.touchStartEvent, this.resizeStart, this);
@@ -130,6 +137,7 @@ var Resize = /** @class */ (function () {
130
137
  this.isDestroyed = true;
131
138
  };
132
139
  Resize.prototype.removeEventListener = function () {
140
+ var _this = this;
133
141
  this.parent.off(events.initialEnd, this.renderResizable);
134
142
  this.parent.element.classList.remove(classes.CLS_RTE_RES_CNT);
135
143
  if (this.parent && this.parent.rootContainer && this.parent.rootContainer.classList.contains('e-resize-enabled')) {
@@ -139,6 +147,11 @@ var Resize = /** @class */ (function () {
139
147
  this.parent.inputElement.classList.remove('e-resize-enabled');
140
148
  this.parent.contentModule.getDocument().removeEventListener('mouseup', this.iframeMouseUpBoundFn);
141
149
  }
150
+ if (!isNullOrUndefined(this.iframeElement)) {
151
+ this.iframeElement.forEach(function (iframe) {
152
+ EventHandler.remove(iframe.contentDocument, 'mouseup', _this.stopResize);
153
+ });
154
+ }
142
155
  if (this.resizer) {
143
156
  EventHandler.remove(this.resizer, 'mousedown', this.resizeStart);
144
157
  EventHandler.remove(this.resizer, this.touchStartEvent, this.resizeStart);
@@ -151,6 +164,9 @@ var Resize = /** @class */ (function () {
151
164
  if (this.isResizing) {
152
165
  this.stopResize(e);
153
166
  }
167
+ else {
168
+ return;
169
+ }
154
170
  };
155
171
  /**
156
172
  * For internal use only - Get the module name.
@@ -155,6 +155,12 @@ export declare function decode(value: string): string;
155
155
  * @hidden
156
156
  */
157
157
  export declare function sanitizeHelper(value: string, parent: IRichTextEditor): string;
158
+ /**
159
+ * @param {string} value - specifies the string value
160
+ * @returns {string} - returns the string value
161
+ * @hidden
162
+ */
163
+ export declare function parseHelper(value: string): string;
158
164
  /**
159
165
  * @param {string} dataUrl - specifies the string value
160
166
  * @returns {BaseToolbar} - returns the value
@@ -559,8 +559,57 @@ export function sanitizeHelper(value, parent) {
559
559
  value = SanitizeHtmlHelper.serializeValue(item, value);
560
560
  }
561
561
  }
562
+ value = parseHelper(value);
562
563
  return value;
563
564
  }
565
+ /**
566
+ * @param {string} value - specifies the string value
567
+ * @returns {string} - returns the string value
568
+ * @hidden
569
+ */
570
+ export function parseHelper(value) {
571
+ var temp = createElement('div');
572
+ temp.innerHTML = value;
573
+ var fontElements = temp.querySelectorAll('font');
574
+ fontElements.forEach(function (font) {
575
+ var span = document.createElement('span');
576
+ var style = (font.getAttribute('style') || '').replace(/style:/gi, '').trim();
577
+ if (!isNOU(style) && style.trim() !== '' && !style.endsWith(';')) {
578
+ style += ';';
579
+ }
580
+ Array.from(font.attributes).forEach(function (attr) {
581
+ var name = attr.name.toLowerCase();
582
+ var value = attr.value;
583
+ switch (name) {
584
+ case 'size':
585
+ style += "font-size:" + value + ";";
586
+ break;
587
+ case 'face':
588
+ style += "font-family:" + value + ";";
589
+ break;
590
+ case 'bgcolor':
591
+ style += "background-color:" + value + ";";
592
+ break;
593
+ case 'style':
594
+ break;
595
+ default:
596
+ style += name + ":" + value + ";";
597
+ break;
598
+ }
599
+ });
600
+ if (!isNOU(style) && style.trim() !== '') {
601
+ style = style.replace(/;;+/g, ';');
602
+ span.setAttribute('style', style);
603
+ }
604
+ span.innerHTML = font.innerHTML;
605
+ if (!isNOU(font.parentNode)) {
606
+ font.parentNode.replaceChild(span, font);
607
+ }
608
+ });
609
+ var parsedValue = temp.innerHTML;
610
+ temp.remove();
611
+ return parsedValue;
612
+ }
564
613
  /**
565
614
  * @param {string} dataUrl - specifies the string value
566
615
  * @returns {BaseToolbar} - returns the value
@@ -1612,6 +1612,8 @@ var Image = /** @class */ (function () {
1612
1612
  if (proxy.parent.formatter.getUndoRedoStack().length === 0) {
1613
1613
  proxy.parent.formatter.saveData();
1614
1614
  }
1615
+ var previousSubCommand = this.args.item.subCommand;
1616
+ this.args.item.subCommand = e.target.innerHTML === 'Update' ? 'Replace' : this.args.item.subCommand;
1615
1617
  if (!isNOU(proxy.uploadUrl) && proxy.uploadUrl.url !== '') {
1616
1618
  proxy.uploadUrl.cssClass = (proxy.parent.insertImageSettings.display === 'inline' ?
1617
1619
  classes.CLS_IMGINLINE : classes.CLS_IMGBREAK);
@@ -1655,6 +1657,7 @@ var Image = /** @class */ (function () {
1655
1657
  }
1656
1658
  proxy.parent.formatter.process(proxy.parent, this.args, this.args.originalEvent, value);
1657
1659
  }
1660
+ this.args.item.subCommand = previousSubCommand;
1658
1661
  };
1659
1662
  Image.prototype.imgsizeInput = function (e) {
1660
1663
  var _this = this;