@syncfusion/ej2-image-editor 26.2.14 → 27.1.50

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.
Files changed (186) hide show
  1. package/README.md +1 -1
  2. package/dist/ej2-image-editor.umd.min.js +2 -2
  3. package/dist/ej2-image-editor.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-image-editor.es2015.js +3267 -731
  5. package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
  6. package/dist/es6/ej2-image-editor.es5.js +3345 -795
  7. package/dist/es6/ej2-image-editor.es5.js.map +1 -1
  8. package/dist/global/ej2-image-editor.min.js +2 -2
  9. package/dist/global/ej2-image-editor.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +13 -13
  12. package/src/image-editor/action/crop.d.ts +0 -1
  13. package/src/image-editor/action/crop.js +8 -19
  14. package/src/image-editor/action/draw.d.ts +4 -0
  15. package/src/image-editor/action/draw.js +401 -47
  16. package/src/image-editor/action/export.js +21 -13
  17. package/src/image-editor/action/filter.d.ts +13 -0
  18. package/src/image-editor/action/filter.js +272 -1
  19. package/src/image-editor/action/freehand-draw.d.ts +1 -0
  20. package/src/image-editor/action/freehand-draw.js +44 -23
  21. package/src/image-editor/action/selection.d.ts +9 -0
  22. package/src/image-editor/action/selection.js +420 -98
  23. package/src/image-editor/action/shape.d.ts +5 -0
  24. package/src/image-editor/action/shape.js +291 -141
  25. package/src/image-editor/action/transform.js +56 -82
  26. package/src/image-editor/action/undo-redo.d.ts +2 -0
  27. package/src/image-editor/action/undo-redo.js +100 -1
  28. package/src/image-editor/base/enum.d.ts +11 -0
  29. package/src/image-editor/base/enum.js +12 -0
  30. package/src/image-editor/base/image-editor-model.d.ts +13 -1
  31. package/src/image-editor/base/image-editor.d.ts +142 -20
  32. package/src/image-editor/base/image-editor.js +814 -150
  33. package/src/image-editor/base/interface.d.ts +140 -1
  34. package/src/image-editor/renderer/toolbar.d.ts +8 -0
  35. package/src/image-editor/renderer/toolbar.js +876 -193
  36. package/styles/bootstrap-dark-lite.css +746 -0
  37. package/styles/bootstrap-dark-lite.scss +13 -0
  38. package/styles/bootstrap-dark.css +150 -105
  39. package/styles/bootstrap-dark.scss +1 -0
  40. package/styles/bootstrap-lite.css +747 -0
  41. package/styles/bootstrap-lite.scss +13 -0
  42. package/styles/bootstrap.css +151 -106
  43. package/styles/bootstrap.scss +1 -0
  44. package/styles/bootstrap4-lite.css +747 -0
  45. package/styles/bootstrap4-lite.scss +13 -0
  46. package/styles/bootstrap4.css +150 -105
  47. package/styles/bootstrap4.scss +1 -0
  48. package/styles/bootstrap5-dark-lite.css +757 -0
  49. package/styles/bootstrap5-dark-lite.scss +13 -0
  50. package/styles/bootstrap5-dark.css +152 -113
  51. package/styles/bootstrap5-dark.scss +1 -0
  52. package/styles/bootstrap5-lite.css +757 -0
  53. package/styles/bootstrap5-lite.scss +13 -0
  54. package/styles/bootstrap5.3-lite.css +760 -0
  55. package/styles/bootstrap5.3-lite.scss +13 -0
  56. package/styles/bootstrap5.3.css +867 -0
  57. package/styles/bootstrap5.3.scss +14 -0
  58. package/styles/bootstrap5.css +152 -113
  59. package/styles/bootstrap5.scss +1 -0
  60. package/styles/fabric-dark-lite.css +749 -0
  61. package/styles/fabric-dark-lite.scss +13 -0
  62. package/styles/fabric-dark.css +150 -105
  63. package/styles/fabric-dark.scss +1 -0
  64. package/styles/fabric-lite.css +751 -0
  65. package/styles/fabric-lite.scss +13 -0
  66. package/styles/fabric.css +151 -106
  67. package/styles/fabric.scss +1 -0
  68. package/styles/fluent-dark-lite.css +758 -0
  69. package/styles/fluent-dark-lite.scss +13 -0
  70. package/styles/fluent-dark.css +150 -111
  71. package/styles/fluent-dark.scss +1 -0
  72. package/styles/fluent-lite.css +758 -0
  73. package/styles/fluent-lite.scss +13 -0
  74. package/styles/fluent.css +150 -111
  75. package/styles/fluent.scss +1 -0
  76. package/styles/fluent2-lite.css +791 -0
  77. package/styles/fluent2-lite.scss +13 -0
  78. package/styles/fluent2.css +173 -117
  79. package/styles/fluent2.scss +1 -0
  80. package/styles/highcontrast-light-lite.css +748 -0
  81. package/styles/highcontrast-light-lite.scss +13 -0
  82. package/styles/highcontrast-light.css +149 -104
  83. package/styles/highcontrast-light.scss +1 -0
  84. package/styles/highcontrast-lite.css +753 -0
  85. package/styles/highcontrast-lite.scss +13 -0
  86. package/styles/highcontrast.css +150 -104
  87. package/styles/highcontrast.scss +1 -0
  88. package/styles/image-editor/_bds-definition.scss +3 -1
  89. package/styles/image-editor/_bigger.scss +216 -0
  90. package/styles/image-editor/_bootstrap-dark-definition.scss +3 -1
  91. package/styles/image-editor/_bootstrap-definition.scss +3 -1
  92. package/styles/image-editor/_bootstrap4-definition.scss +3 -1
  93. package/styles/image-editor/_bootstrap5-definition.scss +3 -1
  94. package/styles/image-editor/_bootstrap5.3-definition.scss +3 -1
  95. package/styles/image-editor/_fabric-dark-definition.scss +3 -1
  96. package/styles/image-editor/_fabric-definition.scss +3 -1
  97. package/styles/image-editor/_fluent-definition.scss +3 -1
  98. package/styles/image-editor/_fluent2-definition.scss +4 -2
  99. package/styles/image-editor/_fusionnew-definition.scss +3 -1
  100. package/styles/image-editor/_highcontrast-definition.scss +3 -1
  101. package/styles/image-editor/_highcontrast-light-definition.scss +3 -1
  102. package/styles/image-editor/_layout.scss +75 -212
  103. package/styles/image-editor/_material-dark-definition.scss +3 -1
  104. package/styles/image-editor/_material-definition.scss +3 -1
  105. package/styles/image-editor/_material3-definition.scss +5 -3
  106. package/styles/image-editor/_tailwind-definition.scss +5 -3
  107. package/styles/image-editor/_theme.scss +48 -11
  108. package/styles/image-editor/bootstrap-dark.css +150 -105
  109. package/styles/image-editor/bootstrap-dark.scss +1 -0
  110. package/styles/image-editor/bootstrap.css +151 -106
  111. package/styles/image-editor/bootstrap.scss +1 -0
  112. package/styles/image-editor/bootstrap4.css +150 -105
  113. package/styles/image-editor/bootstrap4.scss +1 -0
  114. package/styles/image-editor/bootstrap5-dark.css +152 -113
  115. package/styles/image-editor/bootstrap5-dark.scss +1 -0
  116. package/styles/image-editor/bootstrap5.3.css +867 -0
  117. package/styles/image-editor/bootstrap5.3.scss +14 -0
  118. package/styles/image-editor/bootstrap5.css +152 -113
  119. package/styles/image-editor/bootstrap5.scss +1 -0
  120. package/styles/image-editor/fabric-dark.css +150 -105
  121. package/styles/image-editor/fabric-dark.scss +1 -0
  122. package/styles/image-editor/fabric.css +151 -106
  123. package/styles/image-editor/fabric.scss +1 -0
  124. package/styles/image-editor/fluent-dark.css +150 -111
  125. package/styles/image-editor/fluent-dark.scss +1 -0
  126. package/styles/image-editor/fluent.css +150 -111
  127. package/styles/image-editor/fluent.scss +1 -0
  128. package/styles/image-editor/fluent2.css +173 -117
  129. package/styles/image-editor/fluent2.scss +1 -0
  130. package/styles/image-editor/highcontrast-light.css +149 -104
  131. package/styles/image-editor/highcontrast-light.scss +1 -0
  132. package/styles/image-editor/highcontrast.css +150 -104
  133. package/styles/image-editor/highcontrast.scss +1 -0
  134. package/styles/image-editor/icons/_bds.scss +10 -1
  135. package/styles/image-editor/icons/_bootstrap-dark.scss +10 -1
  136. package/styles/image-editor/icons/_bootstrap.scss +10 -1
  137. package/styles/image-editor/icons/_bootstrap4.scss +10 -1
  138. package/styles/image-editor/icons/_bootstrap5.3.scss +10 -1
  139. package/styles/image-editor/icons/_bootstrap5.scss +10 -1
  140. package/styles/image-editor/icons/_fabric-dark.scss +10 -1
  141. package/styles/image-editor/icons/_fabric.scss +10 -1
  142. package/styles/image-editor/icons/_fluent.scss +10 -1
  143. package/styles/image-editor/icons/_fluent2.scss +10 -1
  144. package/styles/image-editor/icons/_fusionnew.scss +10 -1
  145. package/styles/image-editor/icons/_highcontrast-light.scss +10 -1
  146. package/styles/image-editor/icons/_highcontrast.scss +10 -1
  147. package/styles/image-editor/icons/_material-dark.scss +10 -1
  148. package/styles/image-editor/icons/_material.scss +10 -1
  149. package/styles/image-editor/icons/_material3.scss +10 -1
  150. package/styles/image-editor/icons/_tailwind.scss +10 -1
  151. package/styles/image-editor/material-dark.css +153 -108
  152. package/styles/image-editor/material-dark.scss +1 -0
  153. package/styles/image-editor/material.css +159 -114
  154. package/styles/image-editor/material.scss +1 -0
  155. package/styles/image-editor/material3-dark.css +171 -123
  156. package/styles/image-editor/material3-dark.scss +1 -0
  157. package/styles/image-editor/material3.css +171 -123
  158. package/styles/image-editor/material3.scss +1 -0
  159. package/styles/image-editor/tailwind-dark.css +154 -116
  160. package/styles/image-editor/tailwind-dark.scss +1 -0
  161. package/styles/image-editor/tailwind.css +154 -116
  162. package/styles/image-editor/tailwind.scss +1 -0
  163. package/styles/material-dark-lite.css +767 -0
  164. package/styles/material-dark-lite.scss +13 -0
  165. package/styles/material-dark.css +153 -108
  166. package/styles/material-dark.scss +1 -0
  167. package/styles/material-lite.css +769 -0
  168. package/styles/material-lite.scss +13 -0
  169. package/styles/material.css +159 -114
  170. package/styles/material.scss +1 -0
  171. package/styles/material3-dark-lite.css +799 -0
  172. package/styles/material3-dark-lite.scss +13 -0
  173. package/styles/material3-dark.css +171 -123
  174. package/styles/material3-dark.scss +1 -0
  175. package/styles/material3-lite.css +801 -0
  176. package/styles/material3-lite.scss +13 -0
  177. package/styles/material3.css +171 -123
  178. package/styles/material3.scss +1 -0
  179. package/styles/tailwind-dark-lite.css +751 -0
  180. package/styles/tailwind-dark-lite.scss +13 -0
  181. package/styles/tailwind-dark.css +154 -116
  182. package/styles/tailwind-dark.scss +1 -0
  183. package/styles/tailwind-lite.css +751 -0
  184. package/styles/tailwind-lite.scss +13 -0
  185. package/styles/tailwind.css +154 -116
  186. package/styles/tailwind.scss +1 -0
@@ -195,7 +195,14 @@ var ToolbarModule = /** @class */ (function () {
195
195
  SendBackward: 'Send Backward',
196
196
  SendToBack: 'Send to Back',
197
197
  BringToFront: 'Bring to Front',
198
- ZOrder: 'Z-Order'
198
+ ZOrder: 'Z-Order',
199
+ Redact: 'Redact',
200
+ Pixelate: 'Pixelate',
201
+ BorderRadius: 'Border Radius',
202
+ TextOutlineColor: 'Outline Color',
203
+ TextOutlineWidth: 'Outline Width',
204
+ PixelSize: 'Pixel Size',
205
+ And: 'and'
199
206
  };
200
207
  this.l10n = new L10n('image-editor', this.defaultLocale, this.parent.locale);
201
208
  };
@@ -319,9 +326,6 @@ var ToolbarModule = /** @class */ (function () {
319
326
  case 'getFrameToolbar':
320
327
  args.value['obj']['bool'] = this.isFrameToolbar;
321
328
  break;
322
- case 'callFrameToolbar':
323
- this.callFrameToolbar();
324
- break;
325
329
  case 'resizeClick':
326
330
  this.resizeClick();
327
331
  break;
@@ -340,6 +344,18 @@ var ToolbarModule = /** @class */ (function () {
340
344
  case 'setInitialSize':
341
345
  this.initialSize = Number(args.value['value']);
342
346
  break;
347
+ case 'widthPress':
348
+ this.widthPress(args.value['e']);
349
+ break;
350
+ case 'heightPress':
351
+ this.heightPress(args.value['e']);
352
+ break;
353
+ case 'widthAspectRatio':
354
+ this.widthAspectRatio(args.value['e']);
355
+ break;
356
+ case 'heightAspectRatio':
357
+ this.heightAspectRatio(args.value['e']);
358
+ break;
343
359
  }
344
360
  };
345
361
  ToolbarModule.prototype.updatePrivateVariables = function () {
@@ -515,17 +531,17 @@ var ToolbarModule = /** @class */ (function () {
515
531
  toolbarObj.appendTo('#' + id + '_quickAccessToolbar');
516
532
  }
517
533
  };
518
- ToolbarModule.prototype.initMainToolbar = function (isApplyOption, isDevice, isOkBtn, isResize, isFrame, isMainToolbar) {
534
+ ToolbarModule.prototype.initMainToolbar = function (isApplyOption, isDevice, isOkBtn, isResize, isFrame, isMainToolbar, isRedact) {
519
535
  var _this = this;
520
536
  var parent = this.parent;
521
537
  var id = parent.element.id;
522
538
  if (this.isToolbar()) {
523
539
  var leftItem = this.getLeftToolbarItem(isOkBtn, isResize);
524
- var rightItem = this.getRightToolbarItem(isOkBtn, isMainToolbar);
525
- var mainItem = this.getMainToolbarItem(isApplyOption, isFrame);
540
+ var rightItem = this.getRightToolbarItem(isOkBtn, isMainToolbar, isRedact);
541
+ var mainItem = this.getMainToolbarItem(isApplyOption, isFrame, isRedact);
526
542
  var zoomItem = this.getZoomToolbarItem();
527
543
  if (isDevice) {
528
- if (isFrame) {
544
+ if (isFrame || isRedact) {
529
545
  this.defToolbarItems = mainItem;
530
546
  }
531
547
  else {
@@ -551,7 +567,7 @@ var ToolbarModule = /** @class */ (function () {
551
567
  parent.trigger('toolbarCreated', { toolbarType: 'main' });
552
568
  }
553
569
  });
554
- if (isDevice && isFrame) {
570
+ if ((isDevice && isFrame) || (isDevice && isRedact)) {
555
571
  toolbarObj.appendTo('#' + id + '_bottomToolbar');
556
572
  }
557
573
  else {
@@ -633,11 +649,11 @@ var ToolbarModule = /** @class */ (function () {
633
649
  }
634
650
  return toolbarItems;
635
651
  };
636
- ToolbarModule.prototype.getRightToolbarItem = function (isOkBtn, isMainToolbar) {
652
+ ToolbarModule.prototype.getRightToolbarItem = function (isOkBtn, isMainToolbar, isRedact) {
637
653
  var parent = this.parent;
638
654
  var id = parent.element.id;
639
655
  var toolbarItems = [];
640
- if (isOkBtn) {
656
+ if (isOkBtn || isRedact) {
641
657
  toolbarItems.push({ id: id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
642
658
  tooltipText: this.l10n.getConstant('OK'), align: 'Right', tabIndex: 0 });
643
659
  toolbarItems.push({ id: id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
@@ -659,7 +675,7 @@ var ToolbarModule = /** @class */ (function () {
659
675
  }
660
676
  return toolbarItems;
661
677
  };
662
- ToolbarModule.prototype.getMainToolbarItem = function (isApplyOption, isFrame) {
678
+ ToolbarModule.prototype.getMainToolbarItem = function (isApplyOption, isFrame, isRedact) {
663
679
  var parent = this.parent;
664
680
  var id = parent.element.id;
665
681
  var toolbarItems = [];
@@ -689,6 +705,16 @@ var ToolbarModule = /** @class */ (function () {
689
705
  tooltipText: this.l10n.getConstant('Hook'), align: 'Center' });
690
706
  }
691
707
  }
708
+ else if (isRedact) {
709
+ toolbarItems.push({ id: id + '_redactBlur', prefixIcon: 'e-icons e-tint', cssClass: 'top-icon e-opacity',
710
+ tooltipText: this.l10n.getConstant('Blur'), align: 'Center' });
711
+ toolbarItems.push({ id: id + '_pixelate', prefixIcon: 'e-icons e-opacity', cssClass: 'top-icon e-opacity',
712
+ tooltipText: this.l10n.getConstant('Pixelate'), align: 'Center' });
713
+ toolbarItems.push({ id: id + '_duplicate', prefixIcon: 'e-icons e-order', cssClass: 'top-icon e-order',
714
+ tooltipText: this.l10n.getConstant('Duplicate'), align: 'Center' });
715
+ toolbarItems.push({ id: id + '_remove', prefixIcon: 'e-icons e-trash', cssClass: 'top-icon e-trash',
716
+ tooltipText: this.l10n.getConstant('Remove'), align: 'Center' });
717
+ }
692
718
  else {
693
719
  if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Crop') > -1)) {
694
720
  toolbarItems.push({ id: id + '_cropTransform', prefixIcon: 'e-icons e-crop', cssClass: 'top-icon e-crop',
@@ -714,6 +740,10 @@ var ToolbarModule = /** @class */ (function () {
714
740
  toolbarItems.push({ id: id + '_resize', prefixIcon: 'e-icons e-resize', cssClass: 'top-icon e-resize',
715
741
  tooltipText: this.l10n.getConstant('Resize'), align: 'Center' });
716
742
  }
743
+ if (isNullOrUndefined(parent.toolbar) || (!isNullOrUndefined(parent.toolbar) && parent.toolbar.indexOf('Redact') > -1)) {
744
+ toolbarItems.push({ id: id + '_redact', prefixIcon: 'e-icons e-redact', cssClass: 'top-icon e-opacity',
745
+ tooltipText: this.l10n.getConstant('Redact'), align: 'Center' });
746
+ }
717
747
  }
718
748
  var tempToolbarItems = this.processToolbar('center');
719
749
  for (var i = 0, len = tempToolbarItems.length; i < len; i++) {
@@ -840,13 +870,11 @@ var ToolbarModule = /** @class */ (function () {
840
870
  zoomIn.addEventListener('mousedown', this.zoomInBtnMouseDownHandler.bind(this));
841
871
  zoomIn.addEventListener('mouseup', this.zoomBtnMouseUpHandler.bind(this));
842
872
  zoomIn.addEventListener('click', this.zoomInBtnClickHandler.bind(this));
843
- zoomIn.addEventListener('touchstart', this.zoomInBtnClickHandler.bind(this));
844
873
  }
845
874
  if (zoomOut) {
846
875
  zoomOut.addEventListener('mousedown', this.zoomOutBtnMouseDownHandler.bind(this));
847
876
  zoomOut.addEventListener('mouseup', this.zoomBtnMouseUpHandler.bind(this));
848
877
  zoomOut.addEventListener('click', this.zoomOutBtnClickHandler.bind(this));
849
- zoomIn.addEventListener('touchstart', this.zoomInBtnClickHandler.bind(this));
850
878
  }
851
879
  };
852
880
  ToolbarModule.prototype.widthPress = function (e) {
@@ -1108,10 +1136,17 @@ var ToolbarModule = /** @class */ (function () {
1108
1136
  }
1109
1137
  var frame = document.querySelector('#' + id + '_frame');
1110
1138
  if (frame && ((parent.currSelectionPoint && parent.currSelectionPoint.shape === 'crop-circle') || parent.isCircleCrop)) {
1111
- frame.classList.add('e-disabled');
1139
+ frame.classList.add('e-overlay');
1112
1140
  }
1113
1141
  else if (frame) {
1114
- frame.classList.remove('e-disabled');
1142
+ frame.classList.remove('e-overlay');
1143
+ }
1144
+ var ratio = document.querySelector('#' + id + '_aspectratio');
1145
+ if (ratio && ((parent.currSelectionPoint && parent.currSelectionPoint.shape === 'crop-circle') || parent.isCircleCrop)) {
1146
+ ratio.classList.add('e-overlay');
1147
+ }
1148
+ else if (ratio) {
1149
+ ratio.classList.remove('e-overlay');
1115
1150
  }
1116
1151
  };
1117
1152
  ToolbarModule.prototype.createLeftToolbarControls = function () {
@@ -1126,6 +1161,7 @@ var ToolbarModule = /** @class */ (function () {
1126
1161
  var uploadBtnElem = uploadDiv.getElementsByTagName('button')[0];
1127
1162
  uploadBtnElem.className = 'e-tbar-btn e-tbtn-txt top-icon';
1128
1163
  uploadBtnElem.innerHTML = '';
1164
+ uploadBtnElem.title = this.l10n.getConstant('Browse');
1129
1165
  uploadBtnElem.appendChild(parent.createElement('span', {
1130
1166
  className: 'e-btn-icon e-icons e-upload-icon e-icon-left'
1131
1167
  }));
@@ -1193,46 +1229,13 @@ var ToolbarModule = /** @class */ (function () {
1193
1229
  }
1194
1230
  var obj = { freehandDrawSelectedId: null };
1195
1231
  parent.notify('freehand-draw', { prop: 'getFreehandDrawSelectedId', onPropertyChange: false, value: { obj: obj } });
1196
- var duplicateElement = document.querySelector('#' + id + '_duplicate');
1197
- var removeElement = document.querySelector('#' + id + '_remove');
1198
- var editTextElement = document.querySelector('#' + id + '_editText');
1199
- var zOrderElement = document.querySelector('#' + id + '_zOrderBtn');
1200
- if ((parent.activeObj.activePoint.width === 0 && parent.activeObj.activePoint.height === 0) &&
1201
- (isNullOrUndefined(parent.activeObj.pointColl) || (parent.activeObj.pointColl
1202
- && parent.activeObj.pointColl.length === 0)) &&
1203
- isNullOrUndefined(obj['freehandDrawSelectedId'])) {
1204
- if (duplicateElement) {
1205
- duplicateElement.classList.add('e-disabled');
1206
- }
1207
- if (removeElement) {
1208
- removeElement.classList.add('e-disabled');
1209
- }
1210
- if (editTextElement) {
1211
- editTextElement.classList.add('e-disabled');
1212
- }
1213
- if (zOrderElement) {
1214
- zOrderElement.classList.add('e-disabled');
1215
- }
1216
- }
1217
- else {
1218
- if (duplicateElement) {
1219
- duplicateElement.classList.remove('e-disabled');
1220
- }
1221
- if (removeElement) {
1222
- removeElement.classList.remove('e-disabled');
1223
- }
1224
- if (editTextElement) {
1225
- editTextElement.classList.remove('e-disabled');
1226
- }
1227
- if (zOrderElement) {
1228
- zOrderElement.classList.remove('e-disabled');
1229
- }
1230
- }
1232
+ var toolbarId = Browser.isDevice ? '#' + id + '_bottomToolbar ' + '#' + id : '#' + id;
1233
+ this.enableDisableCloneBtn(toolbarId, obj);
1231
1234
  var iconCss = isContextualToolbar ? this.getCurrentShapeIcon(parent.activeObj.shape) : 'e-annotation';
1232
1235
  var drpDownBtn = new DropDownButton({ items: items, iconCss: 'e-icons ' + iconCss,
1233
1236
  cssClass: 'e-image-popup',
1234
1237
  open: function (args) {
1235
- if (parent.currObjType.isFiltered) {
1238
+ if (parent.currObjType.isFiltered || parent.currObjType.isRedact) {
1236
1239
  parent.okBtn();
1237
1240
  parent.element.querySelector('#' + id + '_annotationBtn').click();
1238
1241
  }
@@ -1273,11 +1276,16 @@ var ToolbarModule = /** @class */ (function () {
1273
1276
  var prevObj = { shapeSettingsObj: {} };
1274
1277
  var shapeSettings;
1275
1278
  var shapeChangingArgs;
1279
+ var shapes = ['ellipse', 'rectangle', 'text', 'image'];
1280
+ var allowOutofBound;
1276
1281
  drpDownBtn.iconCss = 'e-icons ' + _this.getCurrentShapeIcon(args.item.id);
1277
1282
  parent.notify('draw', { prop: 'updateTempObjColl' });
1278
1283
  parent.notify('draw', { prop: 'updateTempPointColl' });
1284
+ var penStrokeWidthObj = { penStrokeWidth: 2 };
1279
1285
  switch (args.item.id) {
1280
1286
  case 'pen':
1287
+ parent.notify('freehand-draw', { prop: 'getPenStrokeWidth', onPropertyChange: false, value: { obj: penStrokeWidthObj } });
1288
+ parent.notify('draw', { prop: 'setTempStrokeWidth', value: { strokeWidth: penStrokeWidthObj['penStrokeWidth'] } });
1281
1289
  parent.drawingShape = null;
1282
1290
  parent.notify('draw', { prop: 'setTempFreehandCounter', value: { tempFreehandCounter: parent.freehandCounter } });
1283
1291
  parent.notify('draw', { prop: 'setTempCurrentFreehandDrawIndex', value: { tempCurrentFreehandDrawIndex: obj['currentFreehandDrawIndex'] } });
@@ -1285,6 +1293,8 @@ var ToolbarModule = /** @class */ (function () {
1285
1293
  parent.freeHandDraw(true);
1286
1294
  parent.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: prevObj } });
1287
1295
  shapeSettings = prevObj['shapeSettingsObj'];
1296
+ parent.notify('freehand-draw', { prop: 'getPenStrokeWidth', onPropertyChange: false, value: { obj: penStrokeWidthObj } });
1297
+ shapeSettings.strokeWidth = penStrokeWidthObj['penStrokeWidth'];
1288
1298
  shapeSettings.type = ShapeType.FreehandDraw;
1289
1299
  shapeChangingArgs = { cancel: false, action: 'insert', previousShapeSettings: shapeSettings,
1290
1300
  currentShapeSettings: shapeSettings };
@@ -1317,9 +1327,11 @@ var ToolbarModule = /** @class */ (function () {
1317
1327
  isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
1318
1328
  parent.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: prevObj } });
1319
1329
  shapeSettings = prevObj['shapeSettingsObj'];
1330
+ allowOutofBound = shapes.indexOf(_this.parent.activeObj.shape) !== -1 ? false : true;
1320
1331
  shapeChangingArgs = { cancel: false, action: 'insert', previousShapeSettings: shapeSettings,
1321
- currentShapeSettings: shapeSettings };
1332
+ currentShapeSettings: shapeSettings, allowShapeOverflow: allowOutofBound };
1322
1333
  parent.trigger('shapeChanging', shapeChangingArgs);
1334
+ parent.editCompleteArgs = shapeChangingArgs;
1323
1335
  parent.notify('shape', { prop: 'updateShapeChangeEventArgs', value: { shapeSettings: shapeChangingArgs.currentShapeSettings } });
1324
1336
  break;
1325
1337
  }
@@ -1335,6 +1347,50 @@ var ToolbarModule = /** @class */ (function () {
1335
1347
  // Render initialized DropDownButton.
1336
1348
  drpDownBtn.appendTo('#' + id + '_annotationBtn');
1337
1349
  };
1350
+ ToolbarModule.prototype.enableDisableCloneBtn = function (toolbarId, obj) {
1351
+ var parent = this.parent;
1352
+ var isDummyTextClick = false;
1353
+ if (parent.activeObj.shape && parent.activeObj.shape === 'text' &&
1354
+ parent.activeObj.textSettings.fontSize === 11 && Math.floor(parent.activeObj.activePoint.width) === 55 &&
1355
+ Math.floor(parent.activeObj.activePoint.height) === 11) {
1356
+ isDummyTextClick = true;
1357
+ }
1358
+ var duplicateElement = document.querySelector(toolbarId + '_duplicate');
1359
+ var removeElement = document.querySelector(toolbarId + '_remove');
1360
+ var editTextElement = document.querySelector(toolbarId + '_editText');
1361
+ var zOrderElement = document.querySelector(toolbarId + '_zOrderBtn');
1362
+ if (isDummyTextClick || (parent.activeObj.activePoint.width === 0 && parent.activeObj.activePoint.height === 0) &&
1363
+ (isNullOrUndefined(parent.activeObj.pointColl) || (parent.activeObj.pointColl
1364
+ && parent.activeObj.pointColl.length === 0)) &&
1365
+ isNullOrUndefined(obj['freehandDrawSelectedId'])) {
1366
+ if (duplicateElement) {
1367
+ duplicateElement.classList.add('e-overlay');
1368
+ }
1369
+ if (removeElement) {
1370
+ removeElement.classList.add('e-overlay');
1371
+ }
1372
+ if (editTextElement) {
1373
+ editTextElement.classList.add('e-overlay');
1374
+ }
1375
+ if (zOrderElement) {
1376
+ zOrderElement.classList.add('e-overlay');
1377
+ }
1378
+ }
1379
+ else {
1380
+ if (duplicateElement) {
1381
+ duplicateElement.classList.remove('e-overlay');
1382
+ }
1383
+ if (removeElement) {
1384
+ removeElement.classList.remove('e-overlay');
1385
+ }
1386
+ if (editTextElement) {
1387
+ editTextElement.classList.remove('e-overlay');
1388
+ }
1389
+ if (zOrderElement) {
1390
+ zOrderElement.classList.remove('e-overlay');
1391
+ }
1392
+ }
1393
+ };
1338
1394
  ToolbarModule.prototype.renderStraightenSlider = function () {
1339
1395
  var parent = this.parent;
1340
1396
  var id = parent.element.id;
@@ -1683,13 +1739,7 @@ var ToolbarModule = /** @class */ (function () {
1683
1739
  if (args.item.id !== 'jpeg') {
1684
1740
  qualityContainer.style.display = 'none';
1685
1741
  imageNameLabel.style.display = 'block';
1686
- if (_this.initialSize > 1000) {
1687
- var megabytes = _this.initialSize / 1048576;
1688
- imageNameLabel.innerHTML = _this.l10n.getConstant('ImageSize') + ': ' + megabytes.toFixed(2) + ' MB';
1689
- }
1690
- else {
1691
- imageNameLabel.innerHTML = _this.l10n.getConstant('ImageSize') + ': ' + _this.initialSize.toFixed(2) + ' KB';
1692
- }
1742
+ _this.updateImageSize(1, obj['canvas'], _this.fileType);
1693
1743
  if (slider) {
1694
1744
  if (_this.isSlider) {
1695
1745
  getComponent(slider, 'slider').destroy();
@@ -1703,7 +1753,7 @@ var ToolbarModule = /** @class */ (function () {
1703
1753
  removeClass([qualityBtnGrp], 'e-hide');
1704
1754
  slider.style.display = 'none';
1705
1755
  imageNameLabel.style.display = 'block';
1706
- _this.updateImageSize(isNullOrUndefined(_this.currentQuality) ? 1 : _this.currentQuality, obj['canvas']);
1756
+ _this.updateImageSize(isNullOrUndefined(_this.currentQuality) ? 1 : _this.currentQuality, obj['canvas'], _this.fileType);
1707
1757
  document.getElementById(id + '_' + _this.imageQuality).checked = true;
1708
1758
  }
1709
1759
  }
@@ -1719,10 +1769,10 @@ var ToolbarModule = /** @class */ (function () {
1719
1769
  if (Browser.isDevice) {
1720
1770
  document.getElementById(id + '_dialogImgContent').style.display = 'none';
1721
1771
  document.getElementById(id + '_dialogRightContent').style.width = '100%';
1722
- this.updateImageSize(1, obj['canvas']);
1772
+ this.updateImageSize(1, obj['canvas'], this.fileType);
1723
1773
  }
1724
1774
  else {
1725
- this.updateImageSize(1, obj['canvas']);
1775
+ this.updateImageSize(1, obj['canvas'], this.fileType);
1726
1776
  }
1727
1777
  }
1728
1778
  document.getElementById(id + '_' + this.imageQuality).checked = true;
@@ -1759,14 +1809,14 @@ var ToolbarModule = /** @class */ (function () {
1759
1809
  type: 'MinRange',
1760
1810
  width: Browser.isDevice ? '80%' : '190px',
1761
1811
  created: function () {
1762
- _this.updateImageSize(_this.currentQuality, obj['canvas']);
1812
+ _this.updateImageSize(_this.currentQuality, obj['canvas'], 'jpeg');
1763
1813
  qualitySliderValueSpan.innerHTML = (Math.round(_this.currentQuality * 100)).toString();
1764
1814
  },
1765
1815
  changed: function (args) {
1766
1816
  _this.currentQuality = args.value;
1767
1817
  qualitySliderValueSpan.innerHTML = (Math.round(_this.currentQuality * 100)).toString();
1768
1818
  parent.notify('export', { prop: 'setImageQuality', value: { value: args.value } });
1769
- _this.updateImageSize(args.value, obj['canvas']);
1819
+ _this.updateImageSize(args.value, obj['canvas'], 'jpeg');
1770
1820
  }
1771
1821
  });
1772
1822
  sliderObj.appendTo('#' + id + '_qualitySlider');
@@ -1786,10 +1836,10 @@ var ToolbarModule = /** @class */ (function () {
1786
1836
  event.target.previousElementSibling.checked = true;
1787
1837
  this.currentQuality = compressionValues[target.textContent];
1788
1838
  this.imageQuality = target.textContent.toLowerCase();
1789
- this.updateImageSize(compressionValues[target.textContent], obj['canvas']);
1839
+ this.updateImageSize(compressionValues[target.textContent], obj['canvas'], 'jpeg');
1790
1840
  }
1791
1841
  };
1792
- ToolbarModule.prototype.updateImageSize = function (quality, tempCanvas) {
1842
+ ToolbarModule.prototype.updateImageSize = function (quality, tempCanvas, fileType) {
1793
1843
  var fileSize;
1794
1844
  var parent = this.parent;
1795
1845
  var id = parent.element.id;
@@ -1803,32 +1853,49 @@ var ToolbarModule = /** @class */ (function () {
1803
1853
  else {
1804
1854
  imageNameLabel = document.getElementById(id + '_imageNameLabel');
1805
1855
  }
1806
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
1807
- tempCanvas.toBlob((function (blob) {
1808
- fileSize = Math.floor(blob.size / 1024);
1809
- if (fileSize > 1000) {
1810
- var megabytes = fileSize / 1024;
1811
- imageNameLabel.innerHTML = 'Image size: ' + megabytes.toFixed(2) + ' MB';
1812
- fileSize = +megabytes.toFixed(2);
1813
- }
1814
- else {
1815
- imageNameLabel.innerHTML = 'Image size: ' + fileSize.toFixed(2) + ' KB';
1816
- fileSize = +fileSize.toFixed(2);
1817
- }
1856
+ if (fileType.toLowerCase() === 'jpeg') {
1857
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
1858
+ tempCanvas.toBlob((function (blob) {
1859
+ fileSize = Math.floor(blob.size / 1024);
1860
+ if (fileSize > 1000) {
1861
+ var megabytes = fileSize / 1024;
1862
+ imageNameLabel.innerHTML = 'Image size: ' + megabytes.toFixed(2) + ' MB';
1863
+ fileSize = +megabytes.toFixed(2);
1864
+ }
1865
+ else {
1866
+ imageNameLabel.innerHTML = 'Image size: ' + fileSize.toFixed(2) + ' KB';
1867
+ fileSize = +fileSize.toFixed(2);
1868
+ }
1869
+ if (Browser.isDevice) {
1870
+ canvas.style.display = 'none';
1871
+ }
1872
+ else {
1873
+ var compressedImage_1 = new Image();
1874
+ compressedImage_1.src = URL.createObjectURL(blob);
1875
+ // eslint-disable-next-line @typescript-eslint/tslint/config
1876
+ compressedImage_1.onload = function () {
1877
+ ctx.drawImage(compressedImage_1, 0, 0);
1878
+ URL.revokeObjectURL(compressedImage_1.src);
1879
+ };
1880
+ }
1881
+ this.fileSize = fileSize;
1882
+ }).bind(this), 'image/jpeg', quality);
1883
+ }
1884
+ else {
1818
1885
  if (Browser.isDevice) {
1819
1886
  canvas.style.display = 'none';
1820
1887
  }
1821
1888
  else {
1822
- var compressedImage_1 = new Image();
1823
- compressedImage_1.src = URL.createObjectURL(blob);
1824
- // eslint-disable-next-line @typescript-eslint/tslint/config
1825
- compressedImage_1.onload = function () {
1826
- ctx.drawImage(compressedImage_1, 0, 0);
1827
- URL.revokeObjectURL(compressedImage_1.src);
1828
- };
1889
+ ctx.drawImage(tempCanvas, 0, 0);
1890
+ if (this.initialSize > 1000) {
1891
+ var megabytes = this.initialSize / 1048576;
1892
+ imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + megabytes.toFixed(2) + ' MB';
1893
+ }
1894
+ else {
1895
+ imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + this.initialSize.toFixed(2) + ' KB';
1896
+ }
1829
1897
  }
1830
- this.fileSize = fileSize;
1831
- }).bind(this), 'image/jpeg', quality);
1898
+ }
1832
1899
  };
1833
1900
  ToolbarModule.prototype.download = function () {
1834
1901
  var parent = this.parent;
@@ -1908,15 +1975,19 @@ var ToolbarModule = /** @class */ (function () {
1908
1975
  template: '<button id="' + id + '_borderColorBtn"></button>' });
1909
1976
  }
1910
1977
  if (items.indexOf('strokeWidth') > -1) {
1911
- toolbarItems.push({ id: id + '_strokeWidth', cssClass: 'top-icon e-size', tooltipText: 'Stroke Width', align: 'Center',
1978
+ toolbarItems.push({ id: id + '_strokeWidth', cssClass: 'top-icon e-size', tooltipText: this.l10n.getConstant('StrokeWidth'), align: 'Center',
1912
1979
  type: 'Input', template: '<button id="' + id + '_borderWidthBtn"></button>' });
1913
1980
  }
1914
1981
  if (items.indexOf('start') > -1) {
1915
- toolbarItems.push({ id: id + '_start', cssClass: 'top-icon e-size', tooltipText: 'Start', align: 'Center',
1982
+ toolbarItems.push({ id: id + '_start', cssClass: 'top-icon e-size', tooltipText: this.l10n.getConstant('Start'), align: 'Center',
1916
1983
  type: 'Input', template: '<button id="' + id + '_startBtn"></button>' });
1917
1984
  }
1985
+ if (items.indexOf('borderRadius') > -1) {
1986
+ toolbarItems.push({ id: id + '_rectangleRadius', cssClass: 'top-icon e-size', tooltipText: this.l10n.getConstant('BorderRadius'), align: 'Center',
1987
+ type: 'Input', template: '<button id="' + id + '_rectangleRadiusBtn"></button>' });
1988
+ }
1918
1989
  if (items.indexOf('end') > -1) {
1919
- toolbarItems.push({ id: id + '_end', cssClass: 'top-icon e-size', tooltipText: 'End', align: 'Center',
1990
+ toolbarItems.push({ id: id + '_end', cssClass: 'top-icon e-size', tooltipText: this.l10n.getConstant('End'), align: 'Center',
1920
1991
  type: 'Input', template: '<button id="' + id + '_endBtn"></button>' });
1921
1992
  }
1922
1993
  if (items.indexOf('flip') > -1) {
@@ -2104,6 +2175,7 @@ var ToolbarModule = /** @class */ (function () {
2104
2175
  clicked: this.defToolbarClicked.bind(this),
2105
2176
  created: function () {
2106
2177
  _this.renderAnnotationBtn(true);
2178
+ _this.createRectangleRadius(items);
2107
2179
  _this.createShapeColor(items);
2108
2180
  _this.createShapeBtn(items);
2109
2181
  _this.createZOrderBtn(items);
@@ -2144,6 +2216,62 @@ var ToolbarModule = /** @class */ (function () {
2144
2216
  }
2145
2217
  this.enableDisableTbrBtn();
2146
2218
  };
2219
+ ToolbarModule.prototype.createRectangleRadius = function (items) {
2220
+ var _this = this;
2221
+ var parent = this.parent;
2222
+ var id = parent.element.id;
2223
+ if (items.indexOf('borderRadius') > -1) {
2224
+ var strokeWidthItems = [
2225
+ { id: '1', text: this.l10n.getConstant('0') },
2226
+ { id: '2', text: this.l10n.getConstant('20') },
2227
+ { id: '3', text: this.l10n.getConstant('40') },
2228
+ { id: '4', text: this.l10n.getConstant('60') },
2229
+ { id: '5', text: this.l10n.getConstant('80') },
2230
+ { id: '6', text: this.l10n.getConstant('100') }
2231
+ ];
2232
+ var strokeWidthBtn = document.getElementById(id + '_rectangleRadiusBtn');
2233
+ var spanElem_2 = document.createElement('span');
2234
+ spanElem_2.innerHTML = this.l10n.getConstant(parent.frameObj.radius.toString());
2235
+ spanElem_2.className = 'e-shape-rectangle-radius';
2236
+ strokeWidthBtn.appendChild(spanElem_2);
2237
+ // Initialize the DropDownButton component.
2238
+ var drpDownBtn_2 = new DropDownButton({ items: strokeWidthItems,
2239
+ open: function (args) {
2240
+ if (Browser.isDevice) {
2241
+ var parentElem = args.element.parentElement;
2242
+ parentElem.style.top = drpDownBtn_2.element.getBoundingClientRect().top -
2243
+ parentElem.offsetHeight + 'px';
2244
+ }
2245
+ var activeBtn = drpDownBtn_2.element.childNodes[0].textContent;
2246
+ if (activeBtn !== '') {
2247
+ args.element.querySelector('[aria-label = ' + '"' + activeBtn + '"' + ']').classList.add('e-selected-btn');
2248
+ }
2249
+ },
2250
+ select: function (args) {
2251
+ _this.triggerTbarClickEvent(args);
2252
+ spanElem_2.textContent = args.item.text;
2253
+ parent.updateStrokeWidth(args.item.id, 'radius');
2254
+ if (Browser.isDevice) {
2255
+ if (document.getElementById(id + '_bottomToolbar')) {
2256
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
2257
+ var toolbar_7 = getComponent(id + '_bottomToolbar', 'toolbar');
2258
+ toolbar_7.refreshOverflow();
2259
+ }
2260
+ }
2261
+ else {
2262
+ if (document.getElementById(id + '_toolbar')) {
2263
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
2264
+ var toolbar_8 = getComponent(id + '_toolbar', 'toolbar');
2265
+ toolbar_8.refreshOverflow();
2266
+ }
2267
+ }
2268
+ parent.notify('undo-redo', { prop: 'updateUndoRedoStack', onPropertyChange: false });
2269
+ }
2270
+ });
2271
+ // Render initialized DropDownButton.
2272
+ drpDownBtn_2.appendTo('#' + id + '_rectangleRadiusBtn');
2273
+ }
2274
+ };
2147
2275
  ToolbarModule.prototype.beforeModeSwitch = function (args, inst) {
2148
2276
  this.popupLeft = args.element.offsetParent.style.left;
2149
2277
  if (args.mode === 'Picker') {
@@ -2217,7 +2345,9 @@ var ToolbarModule = /** @class */ (function () {
2217
2345
  if (Browser.isDevice) {
2218
2346
  parenElem.style.top = fillDDB_1.element.getBoundingClientRect().top -
2219
2347
  parenElem.offsetHeight + 'px';
2220
- parenElem.style.left = parent.element.offsetLeft + 'px';
2348
+ if (window.innerWidth <= 520) {
2349
+ parenElem.style.left = parent.element.offsetLeft + 'px';
2350
+ }
2221
2351
  }
2222
2352
  },
2223
2353
  target: '.e-shape-fill-color',
@@ -2263,7 +2393,9 @@ var ToolbarModule = /** @class */ (function () {
2263
2393
  if (Browser.isDevice) {
2264
2394
  parenElem.style.top = strokeDDB_1.element.getBoundingClientRect().top -
2265
2395
  parenElem.offsetHeight + 'px';
2266
- parenElem.style.left = parent.element.offsetLeft + 'px';
2396
+ if (window.innerWidth <= 520) {
2397
+ parenElem.style.left = parent.element.offsetLeft + 'px';
2398
+ }
2267
2399
  }
2268
2400
  },
2269
2401
  target: '.e-shape-stroke-color',
@@ -2298,45 +2430,45 @@ var ToolbarModule = /** @class */ (function () {
2298
2430
  ];
2299
2431
  }
2300
2432
  var strokeWidthBtn = document.getElementById(id + '_borderWidthBtn');
2301
- var spanElem_2 = document.createElement('span');
2302
- spanElem_2.innerHTML = this.l10n.getConstant('XSmall');
2303
- spanElem_2.className = 'e-shape-stroke-width';
2304
- strokeWidthBtn.appendChild(spanElem_2);
2433
+ var spanElem_3 = document.createElement('span');
2434
+ spanElem_3.innerHTML = this.l10n.getConstant('XSmall');
2435
+ spanElem_3.className = 'e-shape-stroke-width';
2436
+ strokeWidthBtn.appendChild(spanElem_3);
2305
2437
  // Initialize the DropDownButton component.
2306
- var drpDownBtn_2 = new DropDownButton({ items: strokeWidthItems,
2438
+ var drpDownBtn_3 = new DropDownButton({ items: strokeWidthItems,
2307
2439
  open: function (args) {
2308
2440
  if (Browser.isDevice) {
2309
- args.element.parentElement.style.top = drpDownBtn_2.element.getBoundingClientRect().top -
2441
+ args.element.parentElement.style.top = drpDownBtn_3.element.getBoundingClientRect().top -
2310
2442
  args.element.parentElement.offsetHeight + 'px';
2311
2443
  }
2312
- var activeBtn = spanElem_2.innerHTML;
2444
+ var activeBtn = spanElem_3.innerHTML;
2313
2445
  if (activeBtn !== '') {
2314
2446
  args.element.querySelector('[aria-label = ' + '"' + activeBtn + '"' + ']').classList.add('e-selected-btn');
2315
2447
  }
2316
2448
  },
2317
2449
  select: function (args) {
2318
2450
  _this.triggerTbarClickEvent(args);
2319
- spanElem_2.textContent = args.item.text;
2320
- parent.updateStrokeWidth(args.item.id);
2451
+ spanElem_3.textContent = args.item.text;
2452
+ parent.updateStrokeWidth(args.item.id, 'width', parent.activeObj.shape);
2321
2453
  if (Browser.isDevice) {
2322
2454
  if (document.getElementById(id + '_bottomToolbar')) {
2323
2455
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
2324
- var toolbar_7 = getComponent(id + '_bottomToolbar', 'toolbar');
2325
- toolbar_7.refreshOverflow();
2456
+ var toolbar_9 = getComponent(id + '_bottomToolbar', 'toolbar');
2457
+ toolbar_9.refreshOverflow();
2326
2458
  }
2327
2459
  }
2328
2460
  else {
2329
2461
  if (document.getElementById(id + '_toolbar')) {
2330
2462
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
2331
- var toolbar_8 = getComponent(id + '_toolbar', 'toolbar');
2332
- toolbar_8.refreshOverflow();
2463
+ var toolbar_10 = getComponent(id + '_toolbar', 'toolbar');
2464
+ toolbar_10.refreshOverflow();
2333
2465
  }
2334
2466
  }
2335
2467
  parent.notify('undo-redo', { prop: 'updateUndoRedoStack', onPropertyChange: false });
2336
2468
  }
2337
2469
  });
2338
2470
  // Render initialized DropDownButton.
2339
- drpDownBtn_2.appendTo('#' + id + '_borderWidthBtn');
2471
+ drpDownBtn_3.appendTo('#' + id + '_borderWidthBtn');
2340
2472
  }
2341
2473
  };
2342
2474
  ToolbarModule.prototype.createZOrderBtn = function (items) {
@@ -2351,7 +2483,7 @@ var ToolbarModule = /** @class */ (function () {
2351
2483
  { text: this.l10n.getConstant('SendToBack'), id: 'sendToBack', iconCss: 'e-icons e-send-to-back' }
2352
2484
  ];
2353
2485
  // Initialize the DropDownButton component.
2354
- var drpDownBtn_3 = new DropDownButton({ items: zOrderItems, iconCss: 'e-icons e-layers',
2486
+ var drpDownBtn_4 = new DropDownButton({ items: zOrderItems, iconCss: 'e-icons e-layers',
2355
2487
  beforeOpen: function (args) {
2356
2488
  if (document.getElementById(parent.element.id + '_zOrderBtn').classList.contains('e-disabled')) {
2357
2489
  args.cancel = true;
@@ -2386,7 +2518,7 @@ var ToolbarModule = /** @class */ (function () {
2386
2518
  },
2387
2519
  open: function (args) {
2388
2520
  if (Browser.isDevice) {
2389
- args.element.parentElement.style.top = drpDownBtn_3.element.getBoundingClientRect().top -
2521
+ args.element.parentElement.style.top = drpDownBtn_4.element.getBoundingClientRect().top -
2390
2522
  args.element.parentElement.offsetHeight + 'px';
2391
2523
  }
2392
2524
  },
@@ -2399,15 +2531,15 @@ var ToolbarModule = /** @class */ (function () {
2399
2531
  if (Browser.isDevice) {
2400
2532
  if (document.getElementById(id + '_bottomToolbar')) {
2401
2533
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
2402
- var toolbar_9 = getComponent(id + '_bottomToolbar', 'toolbar');
2403
- toolbar_9.refreshOverflow();
2534
+ var toolbar_11 = getComponent(id + '_bottomToolbar', 'toolbar');
2535
+ toolbar_11.refreshOverflow();
2404
2536
  }
2405
2537
  }
2406
2538
  else {
2407
2539
  if (document.getElementById(id + '_toolbar')) {
2408
2540
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
2409
- var toolbar_10 = getComponent(id + '_toolbar', 'toolbar');
2410
- toolbar_10.refreshOverflow();
2541
+ var toolbar_12 = getComponent(id + '_toolbar', 'toolbar');
2542
+ toolbar_12.refreshOverflow();
2411
2543
  }
2412
2544
  }
2413
2545
  if (shapeId.indexOf('shape') > -1) {
@@ -2419,7 +2551,7 @@ var ToolbarModule = /** @class */ (function () {
2419
2551
  }
2420
2552
  });
2421
2553
  // Render initialized DropDownButton.
2422
- drpDownBtn_3.appendTo('#' + id + '_zOrderBtn');
2554
+ drpDownBtn_4.appendTo('#' + id + '_zOrderBtn');
2423
2555
  }
2424
2556
  };
2425
2557
  ToolbarModule.prototype.createStartBtn = function () {
@@ -2539,6 +2671,17 @@ var ToolbarModule = /** @class */ (function () {
2539
2671
  tooltipText: this.l10n.getConstant('FontColor'), align: 'Center',
2540
2672
  type: 'Input', template: '<button id="' + id + '_fontColorBtn"></button>' });
2541
2673
  }
2674
+ if (items.indexOf('strokeColor') > -1) {
2675
+ toolbarItems.push({ cssClass: 'top-icon e-stroke-text-font-color', id: id + '_stroke_text_color',
2676
+ tooltipText: this.l10n.getConstant('TextOutlineColor'), align: 'Center',
2677
+ type: 'Input', template: '<button id="' + id + '_strokeTextColorBtn"></button>' });
2678
+ }
2679
+ if (items.indexOf('fillColor') > -1) {
2680
+ toolbarItems.push({ cssClass: 'top-icon e-text-background-color', id: id + '_text_backgroundcolor',
2681
+ tooltipText: this.l10n.getConstant('FillColor'), align: 'Center',
2682
+ type: 'Input', template: '<button id="' + id + '_bgColorBtn"></button>'
2683
+ });
2684
+ }
2542
2685
  if (items.indexOf('bold') > -1) {
2543
2686
  toolbarItems.push({ id: id + '_bold', prefixIcon: 'e-icons e-bold', cssClass: 'top-icon e-bold',
2544
2687
  tooltipText: this.l10n.getConstant('Bold'), align: 'Center' });
@@ -2547,6 +2690,10 @@ var ToolbarModule = /** @class */ (function () {
2547
2690
  toolbarItems.push({ id: id + '_italic', prefixIcon: 'e-icons e-italic', cssClass: 'top-icon e-italic',
2548
2691
  tooltipText: this.l10n.getConstant('Italic'), align: 'Center' });
2549
2692
  }
2693
+ if (items.indexOf('strokeWidth') > -1) {
2694
+ toolbarItems.push({ id: id + '_strokeWidth', cssClass: 'top-icon e-size', tooltipText: this.l10n.getConstant('TextOutlineWidth'), align: 'Center',
2695
+ type: 'Input', template: '<button id="' + id + '_borderWidthBtn"></button>' });
2696
+ }
2550
2697
  if (items.indexOf('transparency') > -1) {
2551
2698
  toolbarItems.push({ id: id + '_transparency', prefixIcon: 'e-opacity',
2552
2699
  tooltipText: this.l10n.getConstant('Opacity'), align: 'Center' });
@@ -2628,6 +2775,9 @@ var ToolbarModule = /** @class */ (function () {
2628
2775
  created: function () {
2629
2776
  _this.renderAnnotationBtn(true);
2630
2777
  _this.createTextColor(items);
2778
+ _this.createStrokeTextColor(items);
2779
+ _this.createShapeBtn(items);
2780
+ _this.createBackgroundColor(items);
2631
2781
  _this.createTextBtn(items);
2632
2782
  _this.createZOrderBtn(items);
2633
2783
  _this.wireZoomBtnEvents();
@@ -2675,7 +2825,7 @@ var ToolbarModule = /** @class */ (function () {
2675
2825
  },
2676
2826
  presetColors: this.presetColors,
2677
2827
  change: function (args) {
2678
- parent.updateFontColor(args.value);
2828
+ parent.updateFontColor(args.value, 'Text');
2679
2829
  strokeDDB_2.element.children[0].style.backgroundColor = args.currentValue.rgba;
2680
2830
  strokeDDB_2.toggle();
2681
2831
  if (parent.activeObj.activePoint.width !== 0 || parent.activeObj.activePoint.height !== 0) {
@@ -2698,7 +2848,9 @@ var ToolbarModule = /** @class */ (function () {
2698
2848
  if (Browser.isDevice) {
2699
2849
  parenElem.style.top = strokeDDB_2.element.getBoundingClientRect().top -
2700
2850
  parenElem.offsetHeight + 'px';
2701
- parenElem.style.left = parent.element.offsetLeft + 'px';
2851
+ if (window.innerWidth <= 520) {
2852
+ parenElem.style.left = parent.element.offsetLeft + 'px';
2853
+ }
2702
2854
  }
2703
2855
  },
2704
2856
  target: '.e-text-fontt-color',
@@ -2711,23 +2863,179 @@ var ToolbarModule = /** @class */ (function () {
2711
2863
  = '#fff';
2712
2864
  }
2713
2865
  };
2866
+ ToolbarModule.prototype.createBackgroundColor = function (items) {
2867
+ var _this = this;
2868
+ var parent = this.parent;
2869
+ var id = parent.element.id;
2870
+ if (items.indexOf('fillColor') > -1 && parent.element.querySelector('.e-template.e-text-background-color')) {
2871
+ parent.element.querySelector('.e-template.e-text-background-color').appendChild(parent.createElement('input', {
2872
+ id: id + '_text_bgColor'
2873
+ }));
2874
+ var backgroundColor_1 = new ColorPicker({
2875
+ modeSwitcher: true, noColor: true, value: '', inline: true,
2876
+ showButtons: false, mode: 'Palette', cssClass: 'e-text-fontt-color',
2877
+ beforeModeSwitch: function (args) {
2878
+ _this.popupLeft = args.element.offsetParent.style.left;
2879
+ _this.beforeModeSwitch(args, backgroundColor_1);
2880
+ },
2881
+ presetColors: {
2882
+ 'custom': ['', '#f44336', '#e91e63', '#9c27b0', '#673ab7', '#2196f3',
2883
+ '#03a9f4', '#00bcd4', '#009688', '#ffeb3b', '#ffffff', '#ffebee', '#fce4ec', '#f3e5f5', '#ede7f6', '#e3f2fd',
2884
+ '#e1f5fe', '#e0f7fa', '#e0f2f1', '#fffde7', '#f2f2f2', '#ffcdd2', '#f8bbd0', '#e1bee7', '#d1c4e9', '#bbdefb',
2885
+ '#b3e5fc', '#b2ebf2', '#b2dfdb', '#fff9c4', '#e6e6e6', '#ef9a9a', '#f48fb1', '#ce93d8', '#b39ddb', '#90caf9',
2886
+ '#81d4fa', '#80deea', '#80cbc4', '#fff59d', '#cccccc', '#e57373', '#f06292', '#ba68c8', '#9575cd', '#64b5f6',
2887
+ '#4fc3f7', '#4dd0e1', '#4db6ac', '#fff176', '#b3b3b3', '#ef5350', '#ec407a', '#ab47bc', '#7e57c2', '#42a5f5',
2888
+ '#29b6f6', '#26c6da', '#26a69a', '#ffee58', '#999999', '#e53935', '#d81b60', '#8e24aa', '#5e35b1', '#1e88e5',
2889
+ '#039be5', '#00acc1', '#00897b', '#fdd835', '#808080', '#d32f2f', '#c2185b', '#7b1fa2', '#512da8', '#1976d2',
2890
+ '#0288d1', '#0097a7', '#00796b', '#fbc02d', '#666666', '#c62828', '#ad1457', '#6a1b9a', '#4527a0', '#1565c0',
2891
+ '#0277bd', '#00838f', '#00695c', '#f9a825', '#4d4d4d', '#b71c1c', '#880e4f', '#4a148c', '#311b92', '#0d47a1',
2892
+ '#01579b', '#006064', '#004d40', '#f57f17']
2893
+ },
2894
+ beforeTileRender: function (args) {
2895
+ if (args.value === '') {
2896
+ args.element.classList.add('e-nocolor-item');
2897
+ }
2898
+ },
2899
+ change: function (args) {
2900
+ parent.updateFontColor(args.value, 'Background');
2901
+ if (args.currentValue.rgba === '') {
2902
+ strokeDDB_3.element.children[0].classList.add('e-nocolor-item');
2903
+ }
2904
+ else {
2905
+ strokeDDB_3.element.children[0].classList.remove('e-nocolor-item');
2906
+ strokeDDB_3.element.children[0].style.backgroundColor = args.currentValue.rgba;
2907
+ }
2908
+ strokeDDB_3.toggle();
2909
+ if (parent.activeObj.activePoint.width !== 0 || parent.activeObj.activePoint.height !== 0) {
2910
+ parent.notify('undo-redo', { prop: 'updateUndoRedoStack', onPropertyChange: false });
2911
+ }
2912
+ },
2913
+ onModeSwitch: function (args) {
2914
+ if (Browser.isDevice) {
2915
+ args.element.parentElement.parentElement.style.left = _this.popupLeft;
2916
+ args.element.parentElement.parentElement.style.top = (strokeDDB_3.element.getBoundingClientRect().top - args.element.parentElement.parentElement.offsetHeight) + 'px';
2917
+ }
2918
+ },
2919
+ beforeClose: function () {
2920
+ strokeDDB_3.toggle();
2921
+ }
2922
+ }, '#' + id + '_text_bgColor');
2923
+ var strokeDDB_3 = new DropDownButton({
2924
+ open: function (args) {
2925
+ var parenElem = args.element.parentElement;
2926
+ if (Browser.isDevice) {
2927
+ parenElem.style.top = strokeDDB_3.element.getBoundingClientRect().top -
2928
+ parenElem.offsetHeight + 'px';
2929
+ if (window.innerWidth <= 520) {
2930
+ parenElem.style.left = parent.element.offsetLeft + 'px';
2931
+ }
2932
+ }
2933
+ },
2934
+ target: '.e-text-fontt-color',
2935
+ iconCss: 'e-dropdownbtn-preview',
2936
+ cssClass: 'e-ie-ddb-popup'
2937
+ }, '#' + id + '_bgColorBtn');
2938
+ backgroundColor_1.inline = true;
2939
+ backgroundColor_1.value = backgroundColor_1.getValue(backgroundColor_1.value, 'rgba');
2940
+ parent.element.querySelector('.e-text-background-color.e-template .e-dropdownbtn-preview').style.background
2941
+ = '#fff';
2942
+ }
2943
+ };
2944
+ ToolbarModule.prototype.createStrokeTextColor = function (items) {
2945
+ var _this = this;
2946
+ var parent = this.parent;
2947
+ var id = parent.element.id;
2948
+ if (items.indexOf('strokeColor') > -1 && parent.element.querySelector('.e-template.e-stroke-text-font-color')) {
2949
+ parent.element.querySelector('.e-template.e-stroke-text-font-color').appendChild(parent.createElement('input', {
2950
+ id: id + '_stroke_text'
2951
+ }));
2952
+ var fontColor_2 = new ColorPicker({
2953
+ modeSwitcher: true, noColor: true, value: '', inline: true,
2954
+ showButtons: false, mode: 'Palette', cssClass: 'e-text-fontt-color',
2955
+ beforeModeSwitch: function (args) {
2956
+ _this.popupLeft = args.element.offsetParent.style.left;
2957
+ _this.beforeModeSwitch(args, fontColor_2);
2958
+ },
2959
+ presetColors: {
2960
+ 'custom': ['', '#f44336', '#e91e63', '#9c27b0', '#673ab7', '#2196f3',
2961
+ '#03a9f4', '#00bcd4', '#009688', '#ffeb3b', '#ffffff', '#ffebee', '#fce4ec', '#f3e5f5', '#ede7f6', '#e3f2fd',
2962
+ '#e1f5fe', '#e0f7fa', '#e0f2f1', '#fffde7', '#f2f2f2', '#ffcdd2', '#f8bbd0', '#e1bee7', '#d1c4e9', '#bbdefb',
2963
+ '#b3e5fc', '#b2ebf2', '#b2dfdb', '#fff9c4', '#e6e6e6', '#ef9a9a', '#f48fb1', '#ce93d8', '#b39ddb', '#90caf9',
2964
+ '#81d4fa', '#80deea', '#80cbc4', '#fff59d', '#cccccc', '#e57373', '#f06292', '#ba68c8', '#9575cd', '#64b5f6',
2965
+ '#4fc3f7', '#4dd0e1', '#4db6ac', '#fff176', '#b3b3b3', '#ef5350', '#ec407a', '#ab47bc', '#7e57c2', '#42a5f5',
2966
+ '#29b6f6', '#26c6da', '#26a69a', '#ffee58', '#999999', '#e53935', '#d81b60', '#8e24aa', '#5e35b1', '#1e88e5',
2967
+ '#039be5', '#00acc1', '#00897b', '#fdd835', '#808080', '#d32f2f', '#c2185b', '#7b1fa2', '#512da8', '#1976d2',
2968
+ '#0288d1', '#0097a7', '#00796b', '#fbc02d', '#666666', '#c62828', '#ad1457', '#6a1b9a', '#4527a0', '#1565c0',
2969
+ '#0277bd', '#00838f', '#00695c', '#f9a825', '#4d4d4d', '#b71c1c', '#880e4f', '#4a148c', '#311b92', '#0d47a1',
2970
+ '#01579b', '#006064', '#004d40', '#f57f17']
2971
+ },
2972
+ beforeTileRender: function (args) {
2973
+ if (args.value === '') {
2974
+ args.element.classList.add('e-nocolor-item');
2975
+ }
2976
+ },
2977
+ change: function (args) {
2978
+ parent.updateStrokeTextColor(args.value);
2979
+ if (args.currentValue.rgba === '') {
2980
+ strokeDDB_4.element.children[0].classList.add('e-nocolor-item');
2981
+ }
2982
+ else {
2983
+ strokeDDB_4.element.children[0].classList.remove('e-nocolor-item');
2984
+ strokeDDB_4.element.children[0].style.backgroundColor = args.currentValue.rgba;
2985
+ }
2986
+ strokeDDB_4.toggle();
2987
+ if (parent.activeObj.activePoint.width !== 0 || parent.activeObj.activePoint.height !== 0) {
2988
+ parent.notify('undo-redo', { prop: 'updateUndoRedoStack', onPropertyChange: false });
2989
+ }
2990
+ },
2991
+ onModeSwitch: function (args) {
2992
+ if (Browser.isDevice) {
2993
+ args.element.parentElement.parentElement.style.left = _this.popupLeft;
2994
+ args.element.parentElement.parentElement.style.top = (strokeDDB_4.element.getBoundingClientRect().top - args.element.parentElement.parentElement.offsetHeight) + 'px';
2995
+ }
2996
+ },
2997
+ beforeClose: function () {
2998
+ strokeDDB_4.toggle();
2999
+ }
3000
+ }, '#' + id + '_stroke_text');
3001
+ var strokeDDB_4 = new DropDownButton({
3002
+ open: function (args) {
3003
+ var parenElem = args.element.parentElement;
3004
+ if (Browser.isDevice) {
3005
+ parenElem.style.top = strokeDDB_4.element.getBoundingClientRect().top -
3006
+ parenElem.offsetHeight + 'px';
3007
+ if (window.innerWidth <= 520) {
3008
+ parenElem.style.left = parent.element.offsetLeft + 'px';
3009
+ }
3010
+ }
3011
+ },
3012
+ target: '.e-text-fontt-color',
3013
+ iconCss: 'e-dropdownbtn-preview',
3014
+ cssClass: 'e-ie-ddb-popup'
3015
+ }, '#' + id + '_strokeTextColorBtn');
3016
+ fontColor_2.inline = true;
3017
+ fontColor_2.value = fontColor_2.getValue(fontColor_2.value, 'rgba');
3018
+ parent.element.querySelector('.e-stroke-text-font-color.e-template .e-dropdownbtn-preview').style.background
3019
+ = '#fff';
3020
+ }
3021
+ };
2714
3022
  ToolbarModule.prototype.createTextBtn = function (items) {
2715
3023
  var _this = this;
2716
3024
  var parent = this.parent;
2717
3025
  var id = parent.element.id;
2718
3026
  if (items.indexOf('fontFamily') > -1) {
2719
3027
  var fontNameBtn = document.getElementById(id + '_fontFamilyBtn');
2720
- var spanElem_3 = document.createElement('span');
3028
+ var spanElem_4 = document.createElement('span');
2721
3029
  if (Browser.isDevice) {
2722
- spanElem_3.innerHTML = 'ABC';
2723
- spanElem_3.setAttribute('style', 'font-family: ' + parent.fontFamily.default.toLowerCase() + '\'');
3030
+ spanElem_4.innerHTML = 'ABC';
3031
+ spanElem_4.setAttribute('style', 'font-family: ' + parent.fontFamily.default.toLowerCase() + '\'');
2724
3032
  }
2725
3033
  else {
2726
- spanElem_3.innerHTML = parent.fontFamily.default;
3034
+ spanElem_4.innerHTML = parent.fontFamily.default;
2727
3035
  }
2728
- spanElem_3.className = 'e-text-font-family';
3036
+ spanElem_4.className = 'e-text-font-family';
2729
3037
  if (fontNameBtn) {
2730
- fontNameBtn.appendChild(spanElem_3);
3038
+ fontNameBtn.appendChild(spanElem_4);
2731
3039
  }
2732
3040
  var fontFamilyBtn_1 = new DropDownButton({ items: this.getFontFamilyItems(),
2733
3041
  cssClass: 'e-font-family',
@@ -2754,12 +3062,16 @@ var ToolbarModule = /** @class */ (function () {
2754
3062
  },
2755
3063
  select: function (args) {
2756
3064
  _this.triggerTbarClickEvent(args);
2757
- spanElem_3.textContent = args.item.text;
3065
+ spanElem_4.textContent = args.item.text;
2758
3066
  if (Browser.isDevice) {
2759
- spanElem_3.setAttribute('style', 'font-family:' + args.item.id);
3067
+ spanElem_4.setAttribute('style', 'font-family:' + args.item.id);
2760
3068
  }
2761
3069
  parent.updateFontFamily(args.item.id);
2762
3070
  parent.notify('undo-redo', { prop: 'updateUndoRedoStack', onPropertyChange: false });
3071
+ var toolbar = document.getElementById(parent.element.id + '_toolbar');
3072
+ if (toolbar && toolbar.classList.contains('e-control')) {
3073
+ getComponent(toolbar, 'toolbar').refreshOverflow();
3074
+ }
2763
3075
  }
2764
3076
  });
2765
3077
  fontFamilyBtn_1.appendTo('#' + id + '_fontFamilyBtn');
@@ -2814,9 +3126,9 @@ var ToolbarModule = /** @class */ (function () {
2814
3126
  toolbarElement.innerHTML = '';
2815
3127
  }
2816
3128
  if (toolbarElement && (this.defToolbarItems.length > 0 || parent.toolbar && parent.toolbar.length > 0 && parent.toolbar.indexOf('Open') === -1)) {
2817
- var toolbar_11 = getComponent(toolbarElement, 'toolbar');
2818
- if (!isNullOrUndefined(toolbar_11)) {
2819
- toolbar_11.destroy();
3129
+ var toolbar_13 = getComponent(toolbarElement, 'toolbar');
3130
+ if (!isNullOrUndefined(toolbar_13)) {
3131
+ toolbar_13.destroy();
2820
3132
  document.getElementById(parent.element.id + '_toolbar').innerHTML = '';
2821
3133
  }
2822
3134
  }
@@ -2868,6 +3180,9 @@ var ToolbarModule = /** @class */ (function () {
2868
3180
  else if (parent.activeObj.shape === 'image') {
2869
3181
  args.toolbarItems = ['flip', 'z-order', 'duplicate', 'remove', 'transparency'];
2870
3182
  }
3183
+ else if (parent.activeObj.shape === 'rectangle') {
3184
+ args.toolbarItems = ['fillColor', 'strokeColor', 'strokeWidth', 'borderRadius', 'z-order', 'duplicate', 'remove'];
3185
+ }
2871
3186
  else {
2872
3187
  args.toolbarItems = ['fillColor', 'strokeColor', 'strokeWidth', 'z-order', 'duplicate', 'remove'];
2873
3188
  }
@@ -2886,7 +3201,7 @@ var ToolbarModule = /** @class */ (function () {
2886
3201
  if (Browser.isDevice) {
2887
3202
  this.initMainToolbar(false, true, true);
2888
3203
  }
2889
- args.toolbarItems = ['fontFamily', 'fontSize', 'fontColor', 'bold', 'italic', 'z-order', 'duplicate', 'remove', 'text'];
3204
+ args.toolbarItems = ['fontFamily', 'fontSize', 'fontColor', 'fillColor', 'strokeColor', 'strokeWidth', 'bold', 'italic', 'z-order', 'duplicate', 'remove', 'text'];
2890
3205
  this.initTextToolbarItem(args.toolbarItems);
2891
3206
  break;
2892
3207
  case 'pen':
@@ -2943,6 +3258,9 @@ var ToolbarModule = /** @class */ (function () {
2943
3258
  if (Browser.isDevice && this.isToolbar()) {
2944
3259
  this.updateContextualToolbar('color', 'straighten', true);
2945
3260
  }
3261
+ if (parent.isMaskImage) {
3262
+ this.refreshToolbar('main');
3263
+ }
2946
3264
  break;
2947
3265
  case 'frame':
2948
3266
  this.isFrameToolbar = true;
@@ -2963,11 +3281,59 @@ var ToolbarModule = /** @class */ (function () {
2963
3281
  }
2964
3282
  parent.notify('draw', { prop: 'render-image', value: { isMouseWheel: null, isPreventClearRect: null, isFrame: true } });
2965
3283
  break;
3284
+ case 'redact':
3285
+ if (Browser.isDevice) {
3286
+ this.initMainToolbar(false, true, true);
3287
+ this.initMainToolbar(false, true, true, null, null, null, true);
3288
+ }
3289
+ else {
3290
+ this.initMainToolbar(isApplyBtn, Browser.isDevice, null, null, null, null, true);
3291
+ }
3292
+ this.enableDisableTbrBtn();
3293
+ if (parent.activeObj.redactType === 'blur') {
3294
+ var redactBlurElement = parent.element.querySelector('#' + id + '_' + 'redactBlur');
3295
+ if (redactBlurElement) {
3296
+ redactBlurElement.classList.add('e-selected-btn');
3297
+ }
3298
+ }
3299
+ else {
3300
+ var pixelateElement = parent.element.querySelector('#' + id + '_' + 'pixelate');
3301
+ if (pixelateElement) {
3302
+ pixelateElement.classList.add('e-selected-btn');
3303
+ }
3304
+ }
3305
+ this.redactSlider(parent.activeObj.redactType);
3306
+ break;
2966
3307
  }
2967
3308
  this.refreshDropDownBtn(isCropping);
2968
3309
  this.updateKBDNavigation(type);
2969
3310
  this.currToolbar = type;
2970
3311
  };
3312
+ ToolbarModule.prototype.updateRedactObj = function () {
3313
+ var parent = this.parent;
3314
+ var objColl = extend([], parent.objColl, [], true);
3315
+ parent.objColl = [];
3316
+ var activeObj = extend({}, parent.activeObj, {}, true);
3317
+ parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
3318
+ parent.notify('draw', { prop: 'render-image', value: { isMouseWheel: null, isPreventClearRect: null, isFrame: true } });
3319
+ parent.objColl = objColl;
3320
+ for (var i = 0; i < parent.objColl.length; i++) {
3321
+ var obj = parent.objColl[i];
3322
+ if (obj.shape === 'redact') {
3323
+ obj.redactImage = parent.createElement('canvas');
3324
+ obj.redactImage.width = obj.activePoint.width;
3325
+ obj.redactImage.height = obj.activePoint.height;
3326
+ obj.redactImage.getContext('2d').drawImage(parent.lowerCanvas, obj.activePoint.startX, obj.activePoint.startY, obj.activePoint.width, obj.activePoint.height, 0, 0, obj.redactImage.width, obj.redactImage.height);
3327
+ }
3328
+ }
3329
+ parent.isCropTab = false;
3330
+ parent.notify('draw', { prop: 'render-image', value: { isMouseWheel: null, isPreventClearRect: null, isFrame: true } });
3331
+ parent.isCropTab = true;
3332
+ if (activeObj) {
3333
+ parent.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate', obj: activeObj,
3334
+ isCropRatio: null, points: null, isPreventDrag: true } });
3335
+ }
3336
+ };
2971
3337
  ToolbarModule.prototype.updateKBDNavigation = function (type) {
2972
3338
  var parent = this.parent;
2973
3339
  var id = parent.element.id;
@@ -2994,6 +3360,12 @@ var ToolbarModule = /** @class */ (function () {
2994
3360
  if (type === 'resize' && tempElem) {
2995
3361
  tbarInitialBtn_1 = tempElem;
2996
3362
  }
3363
+ if (type === 'filter') {
3364
+ var defaultFilter_1 = document.querySelector('#' + id + '_defaultCanvas');
3365
+ if (defaultFilter_1) {
3366
+ setTimeout(function () { return defaultFilter_1.focus(); }, 50);
3367
+ }
3368
+ }
2997
3369
  if (tbarInitialBtn_1) {
2998
3370
  if (type === 'main') {
2999
3371
  setTimeout(function () { return tbarInitialBtn_1.focus(); }, 50);
@@ -3010,7 +3382,7 @@ var ToolbarModule = /** @class */ (function () {
3010
3382
  if (isNullOrUndefined(isTransform)) {
3011
3383
  parent.notify('draw', { prop: 'setTempStraightenZoomDeg' });
3012
3384
  parent.tempStraighten = parent.transform.straighten;
3013
- if (parent.currObjType.isFiltered) {
3385
+ if (parent.currObjType.isFiltered || parent.currObjType.isRedact) {
3014
3386
  parent.okBtn();
3015
3387
  }
3016
3388
  parent.isStraightening = true;
@@ -3274,18 +3646,20 @@ var ToolbarModule = /** @class */ (function () {
3274
3646
  change: function (args) {
3275
3647
  parent.updatePenStrokeColor(args.currentValue.hex);
3276
3648
  _this.selFhdColor = args.currentValue.hex;
3277
- strokeDDB_3.element.children[0].style.backgroundColor = args.currentValue.rgba;
3278
- strokeDDB_3.toggle();
3649
+ strokeDDB_5.element.children[0].style.backgroundColor = args.currentValue.rgba;
3650
+ strokeDDB_5.toggle();
3279
3651
  parent.notify('undo-redo', { prop: 'updateUndoRedoStack', value: { isPenDraw: true } });
3280
3652
  }
3281
3653
  }, '#' + id + '_pen_stroke');
3282
- var strokeDDB_3 = new DropDownButton({
3654
+ var strokeDDB_5 = new DropDownButton({
3283
3655
  open: function (args) {
3284
3656
  var parentElem = args.element.parentElement;
3285
3657
  if (Browser.isDevice) {
3286
- parentElem.style.top = strokeDDB_3.element.getBoundingClientRect().top -
3658
+ parentElem.style.top = strokeDDB_5.element.getBoundingClientRect().top -
3287
3659
  parentElem.offsetHeight + 'px';
3288
- parentElem.style.left = parent.element.offsetLeft + 'px';
3660
+ if (window.innerWidth <= 520) {
3661
+ parentElem.style.left = parent.element.offsetLeft + 'px';
3662
+ }
3289
3663
  }
3290
3664
  },
3291
3665
  target: '.e-pen-color',
@@ -3325,56 +3699,59 @@ var ToolbarModule = /** @class */ (function () {
3325
3699
  ];
3326
3700
  if (items.indexOf('strokeWidth') > -1) {
3327
3701
  var strokeWidthBtn = document.getElementById(id + '_penStrokeWidth');
3328
- var spanElem_4 = document.createElement('span');
3702
+ var spanElem_5 = document.createElement('span');
3329
3703
  var indexObj = { freehandSelectedIndex: null };
3330
3704
  parent.notify('freehand-draw', { prop: 'getFreehandSelectedIndex', onPropertyChange: false, value: { obj: indexObj } });
3331
3705
  if (!isNullOrUndefined(indexObj['freehandSelectedIndex']) && indexObj['freehandSelectedIndex'] > -1) {
3332
- spanElem_4.innerHTML = this.getPenStroke(parent.pointColl[indexObj['freehandSelectedIndex']].strokeWidth);
3706
+ spanElem_5.innerHTML = this.getPenStroke(parent.pointColl[indexObj['freehandSelectedIndex']].strokeWidth);
3333
3707
  }
3334
3708
  else {
3335
3709
  var obj = { penStrokeWidth: 2 };
3336
3710
  parent.notify('freehand-draw', { prop: 'getPenStrokeWidth', onPropertyChange: false, value: { obj: obj } });
3337
3711
  if (obj['penStrokeWidth']) {
3338
- spanElem_4.innerHTML = this.getPenStroke(obj['penStrokeWidth']);
3712
+ spanElem_5.innerHTML = this.getPenStroke(obj['penStrokeWidth']);
3339
3713
  }
3340
3714
  else {
3341
- spanElem_4.innerHTML = this.l10n.getConstant('Small');
3715
+ spanElem_5.innerHTML = this.l10n.getConstant('Small');
3342
3716
  }
3343
3717
  }
3344
- spanElem_4.className = 'e-pen-stroke-width';
3345
- strokeWidthBtn.appendChild(spanElem_4);
3346
- var drpDownBtn_4 = new DropDownButton({ items: strokeWidthItems,
3718
+ spanElem_5.className = 'e-pen-stroke-width';
3719
+ strokeWidthBtn.appendChild(spanElem_5);
3720
+ var drpDownBtn_5 = new DropDownButton({ items: strokeWidthItems,
3347
3721
  open: function (args) {
3348
3722
  if (Browser.isDevice) {
3349
- args.element.parentElement.style.top = drpDownBtn_4.element.getBoundingClientRect().top -
3723
+ args.element.parentElement.style.top = drpDownBtn_5.element.getBoundingClientRect().top -
3350
3724
  args.element.parentElement.offsetHeight + 'px';
3351
3725
  }
3352
- var activeBtn = spanElem_4.innerHTML;
3726
+ var activeBtn = spanElem_5.innerHTML;
3353
3727
  args.element.querySelector('[aria-label = ' + '"' + activeBtn + '"' + ']').classList.add('e-selected-btn');
3354
3728
  },
3355
3729
  select: function (args) {
3356
3730
  _this.triggerTbarClickEvent(args);
3357
- spanElem_4.textContent = args.item.text;
3731
+ spanElem_5.textContent = args.item.text;
3358
3732
  parent.updatePenStrokeWidth(args.item.id);
3359
3733
  if (Browser.isDevice) {
3360
3734
  if (document.getElementById(id + '_bottomToolbar')) {
3361
3735
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
3362
- var toolbar_12 = getComponent(id + '_bottomToolbar', 'toolbar');
3363
- toolbar_12.refreshOverflow();
3736
+ var toolbar_14 = getComponent(id + '_bottomToolbar', 'toolbar');
3737
+ toolbar_14.refreshOverflow();
3364
3738
  }
3365
3739
  }
3366
3740
  else {
3367
3741
  if (document.getElementById(id + '_toolbar')) {
3368
3742
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
3369
- var toolbar_13 = getComponent(id + '_toolbar', 'toolbar');
3370
- toolbar_13.refreshOverflow();
3743
+ var toolbar_15 = getComponent(id + '_toolbar', 'toolbar');
3744
+ toolbar_15.refreshOverflow();
3371
3745
  }
3372
3746
  }
3747
+ var widthObj = { penStrokeWidth: null };
3748
+ parent.notify('freehand-draw', { prop: 'getPenStrokeWidth', onPropertyChange: false, value: { obj: widthObj } });
3373
3749
  parent.notify('undo-redo', { prop: 'updateUndoRedoStack', value: { isPenDraw: true } });
3750
+ parent.notify('freehand-draw', { prop: 'setPenStrokeWidth', onPropertyChange: false, value: { value: widthObj['penStrokeWidth'] } });
3374
3751
  }
3375
3752
  });
3376
3753
  // Render initialized DropDownButton.
3377
- drpDownBtn_4.appendTo('#' + id + '_penStrokeWidth');
3754
+ drpDownBtn_5.appendTo('#' + id + '_penStrokeWidth');
3378
3755
  }
3379
3756
  };
3380
3757
  ToolbarModule.prototype.getPenStroke = function (value) {
@@ -3554,7 +3931,9 @@ var ToolbarModule = /** @class */ (function () {
3554
3931
  var parentElem = args.element.parentElement;
3555
3932
  parentElem.style.top = fillDDB.element.getBoundingClientRect().top -
3556
3933
  parentElem.offsetHeight + 'px';
3557
- parentElem.style.left = parent.element.offsetLeft + 'px';
3934
+ if (window.innerWidth <= 520) {
3935
+ parentElem.style.left = parent.element.offsetLeft + 'px';
3936
+ }
3558
3937
  }
3559
3938
  },
3560
3939
  target: '.e-frame-gradient-fill-color',
@@ -3623,7 +4002,9 @@ var ToolbarModule = /** @class */ (function () {
3623
4002
  var parentElem = args.element.parentElement;
3624
4003
  parentElem.style.top = fillDDB.element.getBoundingClientRect().top -
3625
4004
  parentElem.offsetHeight + 'px';
3626
- parentElem.style.left = parent.element.offsetLeft + 'px';
4005
+ if (window.innerWidth <= 520) {
4006
+ parentElem.style.left = parent.element.offsetLeft + 'px';
4007
+ }
3627
4008
  }
3628
4009
  },
3629
4010
  target: '.e-frame-fill-color',
@@ -3695,15 +4076,15 @@ var ToolbarModule = /** @class */ (function () {
3695
4076
  if (Browser.isDevice) {
3696
4077
  if (document.getElementById(id + '_bottomToolbar')) {
3697
4078
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
3698
- var toolbar_14 = getComponent(id + '_bottomToolbar', 'toolbar');
3699
- toolbar_14.refreshOverflow();
4079
+ var toolbar_16 = getComponent(id + '_bottomToolbar', 'toolbar');
4080
+ toolbar_16.refreshOverflow();
3700
4081
  }
3701
4082
  }
3702
4083
  else {
3703
4084
  if (document.getElementById(id + '_toolbar')) {
3704
4085
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
3705
- var toolbar_15 = getComponent(id + '_toolbar', 'toolbar');
3706
- toolbar_15.refreshOverflow();
4086
+ var toolbar_17 = getComponent(id + '_toolbar', 'toolbar');
4087
+ toolbar_17.refreshOverflow();
3707
4088
  }
3708
4089
  }
3709
4090
  }
@@ -3773,15 +4154,15 @@ var ToolbarModule = /** @class */ (function () {
3773
4154
  if (Browser.isDevice) {
3774
4155
  if (document.getElementById(id + '_bottomToolbar')) {
3775
4156
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
3776
- var toolbar_16 = getComponent(id + '_bottomToolbar', 'toolbar');
3777
- toolbar_16.refreshOverflow();
4157
+ var toolbar_18 = getComponent(id + '_bottomToolbar', 'toolbar');
4158
+ toolbar_18.refreshOverflow();
3778
4159
  }
3779
4160
  }
3780
4161
  else {
3781
4162
  if (document.getElementById(id + '_toolbar')) {
3782
4163
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
3783
- var toolbar_17 = getComponent(id + '_toolbar', 'toolbar');
3784
- toolbar_17.refreshOverflow();
4164
+ var toolbar_19 = getComponent(id + '_toolbar', 'toolbar');
4165
+ toolbar_19.refreshOverflow();
3785
4166
  }
3786
4167
  }
3787
4168
  }
@@ -3851,15 +4232,15 @@ var ToolbarModule = /** @class */ (function () {
3851
4232
  if (Browser.isDevice) {
3852
4233
  if (document.getElementById(id + '_bottomToolbar')) {
3853
4234
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
3854
- var toolbar_18 = getComponent(id + '_bottomToolbar', 'toolbar');
3855
- toolbar_18.refreshOverflow();
4235
+ var toolbar_20 = getComponent(id + '_bottomToolbar', 'toolbar');
4236
+ toolbar_20.refreshOverflow();
3856
4237
  }
3857
4238
  }
3858
4239
  else {
3859
4240
  if (document.getElementById(id + '_toolbar')) {
3860
4241
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
3861
- var toolbar_19 = getComponent(id + '_toolbar', 'toolbar');
3862
- toolbar_19.refreshOverflow();
4242
+ var toolbar_21 = getComponent(id + '_toolbar', 'toolbar');
4243
+ toolbar_21.refreshOverflow();
3863
4244
  }
3864
4245
  }
3865
4246
  }
@@ -3931,15 +4312,15 @@ var ToolbarModule = /** @class */ (function () {
3931
4312
  if (Browser.isDevice) {
3932
4313
  if (document.getElementById(id + '_bottomToolbar')) {
3933
4314
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
3934
- var toolbar_20 = getComponent(id + '_bottomToolbar', 'toolbar');
3935
- toolbar_20.refreshOverflow();
4315
+ var toolbar_22 = getComponent(id + '_bottomToolbar', 'toolbar');
4316
+ toolbar_22.refreshOverflow();
3936
4317
  }
3937
4318
  }
3938
4319
  else {
3939
4320
  if (document.getElementById(id + '_toolbar')) {
3940
4321
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
3941
- var toolbar_21 = getComponent(id + '_toolbar', 'toolbar');
3942
- toolbar_21.refreshOverflow();
4322
+ var toolbar_23 = getComponent(id + '_toolbar', 'toolbar');
4323
+ toolbar_23.refreshOverflow();
3943
4324
  }
3944
4325
  }
3945
4326
  }
@@ -4008,15 +4389,15 @@ var ToolbarModule = /** @class */ (function () {
4008
4389
  if (Browser.isDevice) {
4009
4390
  if (document.getElementById(id + '_bottomToolbar')) {
4010
4391
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
4011
- var toolbar_22 = getComponent(id + '_bottomToolbar', 'toolbar');
4012
- toolbar_22.refreshOverflow();
4392
+ var toolbar_24 = getComponent(id + '_bottomToolbar', 'toolbar');
4393
+ toolbar_24.refreshOverflow();
4013
4394
  }
4014
4395
  }
4015
4396
  else {
4016
4397
  if (document.getElementById(id + '_toolbar')) {
4017
4398
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
4018
- var toolbar_23 = getComponent(id + '_toolbar', 'toolbar');
4019
- toolbar_23.refreshOverflow();
4399
+ var toolbar_25 = getComponent(id + '_toolbar', 'toolbar');
4400
+ toolbar_25.refreshOverflow();
4020
4401
  }
4021
4402
  }
4022
4403
  }
@@ -4083,15 +4464,15 @@ var ToolbarModule = /** @class */ (function () {
4083
4464
  if (Browser.isDevice) {
4084
4465
  if (document.getElementById(id + '_bottomToolbar')) {
4085
4466
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
4086
- var toolbar_24 = getComponent(id + '_bottomToolbar', 'toolbar');
4087
- toolbar_24.refreshOverflow();
4467
+ var toolbar_26 = getComponent(id + '_bottomToolbar', 'toolbar');
4468
+ toolbar_26.refreshOverflow();
4088
4469
  }
4089
4470
  }
4090
4471
  else {
4091
4472
  if (document.getElementById(id + '_toolbar')) {
4092
4473
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
4093
- var toolbar_25 = getComponent(id + '_toolbar', 'toolbar');
4094
- toolbar_25.refreshOverflow();
4474
+ var toolbar_27 = getComponent(id + '_toolbar', 'toolbar');
4475
+ toolbar_27.refreshOverflow();
4095
4476
  }
4096
4477
  }
4097
4478
  }
@@ -4170,6 +4551,9 @@ var ToolbarModule = /** @class */ (function () {
4170
4551
  filter.style.height = '100px';
4171
4552
  parent.notify('filter', { prop: 'updateAdj', value: { type: type, value: null, isPreview: true, ctx: ctx } });
4172
4553
  ctx.drawImage(this.inMemoryCanvas, 0, 0, 300, 150);
4554
+ if (parent.isSafari) {
4555
+ parent.notify('filter', { prop: 'apply-filter', onPropertyChange: false, value: { context: ctx } });
4556
+ }
4173
4557
  }
4174
4558
  };
4175
4559
  ToolbarModule.prototype.getQuickAccessToolbarItem = function (isPenEdit) {
@@ -4181,7 +4565,9 @@ var ToolbarModule = /** @class */ (function () {
4181
4565
  if (parent.activeObj.shape === 'image') {
4182
4566
  toolbarItems.push('Flip');
4183
4567
  }
4184
- toolbarItems.push('BringToFront');
4568
+ if (parent.activeObj.shape !== 'redact') {
4569
+ toolbarItems.push('BringToFront');
4570
+ }
4185
4571
  toolbarItems.push('Clone');
4186
4572
  toolbarItems.push('Delete');
4187
4573
  if (parent.activeObj.shape === 'text') {
@@ -4254,16 +4640,19 @@ var ToolbarModule = /** @class */ (function () {
4254
4640
  toolbarObj.appendTo('#' + id + '_quickAccessToolbar');
4255
4641
  }
4256
4642
  var height = this.toolbarHeight && this.toolbarHeight !== 0 ? this.toolbarHeight : qtArea.clientHeight;
4643
+ var wrapperElement = parent.element.querySelector('#' + id + '_headWrapper');
4257
4644
  if (isNullOrUndefined(isPenEdit) && (parent.activeObj.activePoint.width !== 0 ||
4258
4645
  parent.activeObj.activePoint.height !== 0 ||
4259
4646
  (parent.activeObj.shape && parent.activeObj.shape === 'path' && parent.activeObj.pointColl.length > 0))) {
4260
4647
  var orderObj = { order: null };
4261
4648
  parent.notify('shape', { prop: 'getHighestOrder', onPropertyChange: false, value: { obj: orderObj } });
4262
- if (parent.activeObj.order > orderObj['order']) {
4263
- document.getElementById(parent.element.id + '_bringToFront').classList.add('e-disabled');
4649
+ if (parent.activeObj.order > orderObj['order'] && document.getElementById(parent.element.id + '_bringToFront')) {
4650
+ document.getElementById(parent.element.id + '_bringToFront').classList.add('e-overlay');
4264
4651
  }
4265
4652
  else {
4266
- document.getElementById(parent.element.id + '_bringToFront').classList.remove('e-disabled');
4653
+ if (document.getElementById(parent.element.id + '_bringToFront')) {
4654
+ document.getElementById(parent.element.id + '_bringToFront').classList.remove('e-overlay');
4655
+ }
4267
4656
  }
4268
4657
  qtArea.style.width = 'auto';
4269
4658
  parent.activeObj.activePoint.width = Math.abs(parent.activeObj.activePoint.width);
@@ -4293,10 +4682,19 @@ var ToolbarModule = /** @class */ (function () {
4293
4682
  var diff = (x + (width / 2)) - (parseFloat(qtArea.style.left) + (qtArea.clientWidth / 2));
4294
4683
  qtArea.style.left = parseFloat(qtArea.style.left) + diff + 'px';
4295
4684
  }
4685
+ if (wrapperElement) {
4686
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4687
+ height = wrapperElement.offsetHeight + height;
4688
+ }
4296
4689
  if (y - (height + (height / 1.5)) < parent.img.destTop) {
4297
4690
  qtArea.style.top = parent.img.destTop + 'px';
4691
+ if (wrapperElement) {
4692
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4693
+ qtArea.style.top = (parent.img.destTop < 0 ? 0 : parent.img.destTop) + wrapperElement.offsetHeight + 'px';
4694
+ }
4298
4695
  }
4299
4696
  else {
4697
+ height = this.toolbarHeight;
4300
4698
  qtArea.style.top = y - (height + (height / 1.5)) + 'px';
4301
4699
  }
4302
4700
  }
@@ -4306,11 +4704,13 @@ var ToolbarModule = /** @class */ (function () {
4306
4704
  var orderObj = { order: null };
4307
4705
  parent.notify('shape', { prop: 'getHighestOrder', onPropertyChange: false, value: { obj: orderObj } });
4308
4706
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4309
- if (parent.getObjFromId(parent.pointColl[indexObj['freehandSelectedIndex']].id).order >= orderObj['order']) {
4310
- document.getElementById(parent.element.id + '_bringToFront').classList.add('e-disabled');
4707
+ if (parent.getObjFromId(parent.pointColl[indexObj['freehandSelectedIndex']].id).order >= orderObj['order'] && document.getElementById(parent.element.id + '_bringToFront')) {
4708
+ document.getElementById(parent.element.id + '_bringToFront').classList.add('e-overlay');
4311
4709
  }
4312
4710
  else {
4313
- document.getElementById(parent.element.id + '_bringToFront').classList.remove('e-disabled');
4711
+ if (document.getElementById(parent.element.id + '_bringToFront')) {
4712
+ document.getElementById(parent.element.id + '_bringToFront').classList.remove('e-overlay');
4713
+ }
4314
4714
  }
4315
4715
  var obj = { activePoint: null };
4316
4716
  parent.notify('freehand-draw', { prop: 'getSqPtFD',
@@ -4430,7 +4830,7 @@ var ToolbarModule = /** @class */ (function () {
4430
4830
  var orderObj = { order: null };
4431
4831
  switch (type) {
4432
4832
  case 'duplicate':
4433
- if (!parent.element.querySelector('#' + id + '_duplicate').classList.contains('e-disabled')) {
4833
+ if (!parent.element.querySelector('#' + id + '_duplicate').classList.contains('e-overlay')) {
4434
4834
  this.refreshSlider();
4435
4835
  if (!pathObject['isNewPath'] && JSON.stringify(object['tempObj']) === JSON.stringify(parent.activeObj)) {
4436
4836
  isPreventUndoRedo = true;
@@ -4439,14 +4839,14 @@ var ToolbarModule = /** @class */ (function () {
4439
4839
  }
4440
4840
  break;
4441
4841
  case 'remove':
4442
- if (!parent.element.querySelector('#' + id + '_remove').classList.contains('e-disabled')) {
4842
+ if (!parent.element.querySelector('#' + id + '_remove').classList.contains('e-overlay')) {
4443
4843
  parent.noPushUndo = false;
4444
4844
  this.refreshSlider();
4445
4845
  parent.notify('selection', { prop: 'deleteItem', onPropertyChange: false });
4446
4846
  }
4447
4847
  break;
4448
4848
  case 'edittext':
4449
- if (!parent.element.querySelector('#' + id + '_editText').classList.contains('e-disabled')) {
4849
+ if (!parent.element.querySelector('#' + id + '_editText').classList.contains('e-overlay')) {
4450
4850
  this.editText();
4451
4851
  }
4452
4852
  break;
@@ -4475,7 +4875,7 @@ var ToolbarModule = /** @class */ (function () {
4475
4875
  parent.notify('undo-redo', { prop: 'updateUndoRedoStack', onPropertyChange: false });
4476
4876
  break;
4477
4877
  case 'bringtofront':
4478
- if (!parent.element.querySelector('#' + id + '_bringToFront').classList.contains('e-disabled')) {
4878
+ if (!parent.element.querySelector('#' + id + '_bringToFront').classList.contains('e-overlay')) {
4479
4879
  parent.notify('freehand-draw', { prop: 'getFreehandSelectedIndex', onPropertyChange: false, value: { obj: indexObj } });
4480
4880
  shapeId = indexObj['freehandSelectedIndex'] !== null ? parent.pointColl[indexObj['freehandSelectedIndex']].id :
4481
4881
  parent.activeObj.currIndex;
@@ -4494,10 +4894,10 @@ var ToolbarModule = /** @class */ (function () {
4494
4894
  isDisabled = order > orderObj['order'] ? true : false;
4495
4895
  }
4496
4896
  if (isDisabled) {
4497
- document.getElementById(parent.element.id + '_bringToFront').classList.add('e-disabled');
4897
+ document.getElementById(parent.element.id + '_bringToFront').classList.add('e-overlay');
4498
4898
  }
4499
4899
  else {
4500
- document.getElementById(parent.element.id + '_bringToFront').classList.remove('e-disabled');
4900
+ document.getElementById(parent.element.id + '_bringToFront').classList.remove('e-overlay');
4501
4901
  }
4502
4902
  parent.notify('undo-redo', { prop: 'updateUndoRedoStack', onPropertyChange: false });
4503
4903
  }
@@ -4652,7 +5052,21 @@ var ToolbarModule = /** @class */ (function () {
4652
5052
  parent.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate', obj: parent.activeObj,
4653
5053
  isCropRatio: null, points: null, isPreventDrag: true } });
4654
5054
  parent.notify('undo-redo', { prop: 'updateUrObj', onPropertyChange: false, value: { objColl: objColl } });
5055
+ parent.notify('shape', { prop: 'applyActObj', onPropertyChange: false, value: { isMouseDown: true } });
5056
+ parent.noPushUndo = false;
5057
+ parent.notify('undo-redo', { prop: 'updateCurrUrc', value: { type: 'ok' } });
5058
+ parent.noPushUndo = true;
5059
+ parent.notify('selection', { prop: 'redrawShape', onPropertyChange: false,
5060
+ value: { obj: parent.objColl[parent.objColl.length - 1] } });
5061
+ var id = parent.element.id;
5062
+ var toolbarId = Browser.isDevice ? '#' + id + '_bottomToolbar ' + '#' + id : '#' + id;
5063
+ var object = { freehandDrawSelectedId: null };
5064
+ parent.notify('freehand-draw', { prop: 'getFreehandDrawSelectedId', onPropertyChange: false, value: { obj: object } });
5065
+ this.enableDisableCloneBtn(toolbarId, object);
4655
5066
  this.renderQAT();
5067
+ if (parent.activeObj.shape && parent.activeObj.shape === 'redact') {
5068
+ this.redactSlider(parent.activeObj.redactType);
5069
+ }
4656
5070
  };
4657
5071
  ToolbarModule.prototype.defToolbarClicked = function (args) {
4658
5072
  var parent = this.parent;
@@ -4710,6 +5124,8 @@ var ToolbarModule = /** @class */ (function () {
4710
5124
  var isCropSelection = false;
4711
5125
  var panBtn;
4712
5126
  var splitWords;
5127
+ var actionType;
5128
+ var actionArgs;
4713
5129
  if (parent.activeObj.shape !== undefined) {
4714
5130
  splitWords = parent.activeObj.shape.split('-');
4715
5131
  }
@@ -4723,6 +5139,7 @@ var ToolbarModule = /** @class */ (function () {
4723
5139
  switch (type) {
4724
5140
  case 'pan':
4725
5141
  parent.currObjType.isCustomCrop = parent.currObjType.isFiltered = false;
5142
+ parent.currObjType.isRedact = false;
4726
5143
  if (parent.currObjType.isUndoAction) {
4727
5144
  parent.notify('undo-redo', { prop: 'refreshUrc', value: { bool: null } });
4728
5145
  }
@@ -4758,9 +5175,18 @@ var ToolbarModule = /** @class */ (function () {
4758
5175
  this.refreshToolbar('main');
4759
5176
  break;
4760
5177
  case 'cancel':
5178
+ if (parent.currObjType.isRedact) {
5179
+ parent.currObjType.isRedact = false;
5180
+ }
5181
+ if (this.isFrameToolbar && parent.element.querySelector('.e-contextual-toolbar-wrapper') && !parent.element.querySelector('.e-contextual-toolbar-wrapper').classList.contains('e-hide')) {
5182
+ parent.element.querySelector('.e-contextual-toolbar-wrapper').classList.add('e-hide');
5183
+ }
4761
5184
  parent.notify('draw', { prop: 'performCancel', value: { isContextualToolbar: isContextualToolbar, isFinalCancel: true } });
4762
5185
  break;
4763
5186
  case 'ok':
5187
+ if (Browser.isDevice && this.isFrameToolbar && parent.element.querySelector('.e-contextual-toolbar-wrapper') && !parent.element.querySelector('.e-contextual-toolbar-wrapper').classList.contains('e-hide')) {
5188
+ parent.element.querySelector('.e-contextual-toolbar-wrapper').classList.add('e-hide');
5189
+ }
4764
5190
  parent.okBtn(null, true);
4765
5191
  parent.drawingShape = null;
4766
5192
  this.refreshDropDownBtn(false);
@@ -4834,14 +5260,14 @@ var ToolbarModule = /** @class */ (function () {
4834
5260
  this.refreshToolbar('resize');
4835
5261
  break;
4836
5262
  case 'resize':
4837
- if (parent.currObjType.isFiltered) {
5263
+ if (parent.currObjType.isFiltered || parent.currObjType.isRedact) {
4838
5264
  parent.okBtn();
4839
5265
  }
4840
5266
  this.resizeClick();
4841
5267
  break;
4842
5268
  case 'adjustment':
4843
5269
  if (!isDisabledAdjustment) {
4844
- if (parent.currObjType.isFiltered) {
5270
+ if (parent.currObjType.isFiltered || parent.currObjType.isRedact) {
4845
5271
  parent.okBtn();
4846
5272
  }
4847
5273
  this.refreshToolbar('adjustment');
@@ -4949,6 +5375,7 @@ var ToolbarModule = /** @class */ (function () {
4949
5375
  case 'horizontalflip':
4950
5376
  case 'verticalflip':
4951
5377
  parent.transformSelect(type);
5378
+ this.updateRedactObj();
4952
5379
  if (type === 'rotateleft' || type === 'rotateright') {
4953
5380
  parent.notify('draw', { prop: 'resetStraightenDestPoints' });
4954
5381
  parent.notify('draw', { prop: 'setDestForStraighten' });
@@ -4957,6 +5384,10 @@ var ToolbarModule = /** @class */ (function () {
4957
5384
  if (Browser.isDevice) {
4958
5385
  this.updateContextualToolbar('color', 'straighten');
4959
5386
  }
5387
+ actionType = type === 'rotateleft' || type === 'rotateright' ?
5388
+ 'rotate' : 'flip';
5389
+ actionArgs = { action: actionType, actionEventArgs: parent.editCompleteArgs };
5390
+ parent.triggerEditCompleteEvent(actionArgs);
4960
5391
  break;
4961
5392
  case 'save':
4962
5393
  parent.noPushUndo = false;
@@ -4995,10 +5426,100 @@ var ToolbarModule = /** @class */ (function () {
4995
5426
  parent.notify('draw', { prop: 'render-image', value: { isMouseWheel: null, isPreventClearRect: null, isFrame: true } });
4996
5427
  parent.isFrameBtnClick = true;
4997
5428
  parent.curFrameObjEvent = { previousFrameSetting: parent.tempFrameObj, currentFrameSetting: parent.frameObj };
5429
+ parent.notify('draw', { prop: 'triggerFrameChange', value: { prevFrameSettings: parent.tempFrameObj, obj: { frameChangeEventArgs: null } } });
5430
+ break;
5431
+ case 'redact':
5432
+ parent.currObjType.isRedact = true;
5433
+ parent.drawingShape = 'redact';
5434
+ if (isNullOrUndefined(parent.activeObj.redactBlur)) {
5435
+ parent.activeObj.redactBlur = 20;
5436
+ }
5437
+ if (isNullOrUndefined(parent.activeObj.redactPixelate)) {
5438
+ parent.activeObj.redactPixelate = 20;
5439
+ }
5440
+ parent.notify('selection', { prop: 'annotate', value: { shape: 'redact' } });
5441
+ this.refreshToolbar('redact');
5442
+ this.redactSlider(parent.activeObj.redactType);
5443
+ break;
5444
+ case 'pixelate':
5445
+ parent.currObjType.isRedact = true;
5446
+ parent.drawingShape = 'redact';
5447
+ parent.notify('selection', { prop: 'annotate', value: { shape: 'redact' } });
5448
+ if (parent.activeObj.redactType === 'blur') {
5449
+ this.updateRedactType('pixelate');
5450
+ }
5451
+ parent.notify('shape', { prop: 'setRedactType', onPropertyChange: false,
5452
+ value: { redactType: 'pixelate' } });
5453
+ if (parent.activeObj.redactType === 'pixelate') {
5454
+ var pixelateBtn = parent.element.querySelector('#' + id + '_' + 'pixelate');
5455
+ var redactBlurBtn = parent.element.querySelector('#' + id + '_' + 'redactBlur');
5456
+ if (pixelateBtn) {
5457
+ pixelateBtn.classList.add('e-selected-btn');
5458
+ }
5459
+ if (redactBlurBtn && redactBlurBtn.classList.contains('e-selected-btn')) {
5460
+ redactBlurBtn.classList.remove('e-selected-btn');
5461
+ }
5462
+ }
5463
+ else {
5464
+ var redactBlurBtn = parent.element.querySelector('#' + id + '_' + 'redactBlur');
5465
+ if (redactBlurBtn) {
5466
+ redactBlurBtn.classList.add('e-selected-btn');
5467
+ }
5468
+ }
5469
+ this.redactSlider(parent.activeObj.redactType);
5470
+ if (parent.activeObj.activePoint.width !== 0 || parent.activeObj.activePoint.height !== 0) {
5471
+ parent.notify('undo-redo', { prop: 'updateUndoRedoColl', onPropertyChange: false,
5472
+ value: { operation: 'shapeTransform', previousObj: null, previousObjColl: null,
5473
+ previousPointColl: null, previousSelPointColl: null,
5474
+ previousCropObj: null, previousText: null,
5475
+ currentText: null, previousFilter: null, isCircleCrop: null } });
5476
+ }
5477
+ break;
5478
+ case 'redactblur':
5479
+ parent.currObjType.isRedact = true;
5480
+ parent.drawingShape = 'redact';
5481
+ parent.notify('selection', { prop: 'annotate', value: { shape: 'redact' } });
5482
+ parent.notify('shape', { prop: 'setRedactType', onPropertyChange: false,
5483
+ value: { redactType: 'blur' } });
5484
+ if (parent.activeObj.redactType === 'pixelate') {
5485
+ this.updateRedactType('blur');
5486
+ }
5487
+ parent.notify('shape', { prop: 'setRedactType', onPropertyChange: false, value: { redactType: 'blur' } });
5488
+ if (parent.activeObj.redactType === 'blur') {
5489
+ var redactBlurBtn = parent.element.querySelector('#' + id + '_' + 'redactBlur');
5490
+ var pixelateBtn = parent.element.querySelector('#' + id + '_' + 'pixelate');
5491
+ if (redactBlurBtn) {
5492
+ redactBlurBtn.classList.add('e-selected-btn');
5493
+ }
5494
+ if (pixelateBtn && pixelateBtn.classList.contains('e-selected-btn')) {
5495
+ pixelateBtn.classList.remove('e-selected-btn');
5496
+ }
5497
+ }
5498
+ else {
5499
+ var pixelateBtn = parent.element.querySelector('#' + id + '_' + 'pixelate');
5500
+ if (pixelateBtn) {
5501
+ pixelateBtn.classList.add('e-selected-btn');
5502
+ }
5503
+ }
5504
+ this.redactSlider(parent.activeObj.redactType);
5505
+ if (parent.activeObj.activePoint.width !== 0 || parent.activeObj.activePoint.height !== 0) {
5506
+ parent.notify('undo-redo', { prop: 'updateUndoRedoColl', onPropertyChange: false,
5507
+ value: { operation: 'shapeTransform', previousObj: null, previousObjColl: null,
5508
+ previousPointColl: null, previousSelPointColl: null,
5509
+ previousCropObj: null, previousText: null,
5510
+ currentText: null, previousFilter: null, isCircleCrop: null } });
5511
+ }
4998
5512
  break;
4999
5513
  }
5000
5514
  }
5001
5515
  };
5516
+ ToolbarModule.prototype.updateRedactType = function (value) {
5517
+ var parent = this.parent;
5518
+ parent.activeObj.redactType = value;
5519
+ parent.notify('shape', { prop: 'setRedactType', value: { type: value } });
5520
+ this.parent.objColl.push(parent.activeObj);
5521
+ parent.notify('selection', { prop: 'redrawShape', value: { obj: parent.objColl[parent.objColl.length - 1] } });
5522
+ };
5002
5523
  ToolbarModule.prototype.frameToolbarClick = function () {
5003
5524
  var parent = this.parent;
5004
5525
  var id = parent.element.id;
@@ -5007,10 +5528,10 @@ var ToolbarModule = /** @class */ (function () {
5007
5528
  var frameObj;
5008
5529
  var tempFrameObj;
5009
5530
  parent.notify('draw', { prop: 'updateCropSelection', onPropertyChange: false });
5010
- if (parent.currObjType.isFiltered) {
5531
+ if (parent.currObjType.isFiltered || parent.currObjType.isRedact) {
5011
5532
  parent.okBtn();
5012
5533
  }
5013
- if (frame && !frame.classList.contains('e-disabled')) {
5534
+ if (frame && !frame.classList.contains('e-overlay')) {
5014
5535
  zoom = parent.transform.zoomFactor;
5015
5536
  parent.frameDestPoints = extend({}, parent.img, {}, true);
5016
5537
  if (isNullOrUndefined(parent.cxtTbarHeight)) {
@@ -5032,6 +5553,7 @@ var ToolbarModule = /** @class */ (function () {
5032
5553
  parent.img.destTop += (parent.cxtTbarHeight / 2);
5033
5554
  }
5034
5555
  this.callFrameToolbar();
5556
+ parent.notify('draw', { prop: 'triggerFrameChange', value: { prevFrameSettings: parent.frameObj, obj: { frameChangeEventArgs: null } } });
5035
5557
  }
5036
5558
  };
5037
5559
  ToolbarModule.prototype.zoomToFrameRange = function () {
@@ -5089,6 +5611,7 @@ var ToolbarModule = /** @class */ (function () {
5089
5611
  var type = args.item.id.replace(parent.element.id, '').split('_')[1];
5090
5612
  var imageFiltering = { filter: parent.toPascalCase(type), cancel: false };
5091
5613
  parent.trigger('imageFiltering', imageFiltering);
5614
+ parent.editCompleteArgs = imageFiltering;
5092
5615
  if (imageFiltering.cancel) {
5093
5616
  return;
5094
5617
  }
@@ -5148,6 +5671,7 @@ var ToolbarModule = /** @class */ (function () {
5148
5671
  parent_1.isZoomBtnClick = true;
5149
5672
  this.applyPreviewFilter();
5150
5673
  parent_1.currObjType.isFiltered = false;
5674
+ parent_1.currObjType.isRedact = false;
5151
5675
  if (parent_1.togglePen) {
5152
5676
  parent_1.currObjType.isZoomed = true;
5153
5677
  parent_1.freeHandDraw(false);
@@ -5166,6 +5690,12 @@ var ToolbarModule = /** @class */ (function () {
5166
5690
  parent_1.notify('draw', { prop: 'resetStraightenDestPoints' });
5167
5691
  parent_1.notify('draw', { prop: 'setDestForStraighten' });
5168
5692
  }
5693
+ var actionArgs = { action: 'zoom-in',
5694
+ actionEventArgs: parent_1.editCompleteArgs };
5695
+ parent_1.triggerEditCompleteEvent(actionArgs);
5696
+ if (Browser.isDevice) {
5697
+ zoomIn.focus();
5698
+ }
5169
5699
  }
5170
5700
  }
5171
5701
  };
@@ -5206,6 +5736,7 @@ var ToolbarModule = /** @class */ (function () {
5206
5736
  parent_2.isZoomBtnClick = true;
5207
5737
  this.applyPreviewFilter();
5208
5738
  parent_2.currObjType.isFiltered = false;
5739
+ parent_2.currObjType.isRedact = false;
5209
5740
  if (parent_2.togglePen) {
5210
5741
  parent_2.currObjType.isZoomed = true;
5211
5742
  parent_2.freeHandDraw(false);
@@ -5224,6 +5755,12 @@ var ToolbarModule = /** @class */ (function () {
5224
5755
  parent_2.notify('draw', { prop: 'resetStraightenDestPoints' });
5225
5756
  parent_2.notify('draw', { prop: 'setDestForStraighten' });
5226
5757
  }
5758
+ var actionArgs = { action: 'zoom-out',
5759
+ actionEventArgs: parent_2.editCompleteArgs };
5760
+ parent_2.triggerEditCompleteEvent(actionArgs);
5761
+ if (Browser.isDevice) {
5762
+ zoomOut.focus();
5763
+ }
5227
5764
  }
5228
5765
  }
5229
5766
  };
@@ -5560,8 +6097,11 @@ var ToolbarModule = /** @class */ (function () {
5560
6097
  var selFillElem = parent.element.querySelector('.e-fill.e-template .e-dropdownbtn-preview');
5561
6098
  var selStrokeElem = parent.element.querySelector('.e-stroke.e-template .e-dropdownbtn-preview');
5562
6099
  var selTextStrokeElem = parent.element.querySelector('.e-text-font-color.e-template .e-dropdownbtn-preview');
6100
+ var selStrokeTextColorElem = parent.element.querySelector('.e-stroke-text-font-color.e-template .e-dropdownbtn-preview');
6101
+ var selTextBGElem = parent.element.querySelector('.e-text-background-color.e-template .e-dropdownbtn-preview');
5563
6102
  var selPenStrokeElem = parent.element.querySelector('.e-pen-stroke-color.e-template .e-dropdownbtn-preview');
5564
6103
  var strokeWidthElem = parent.element.querySelector('.e-shape-stroke-width');
6104
+ var rectangleRadiusElem = parent.element.querySelector('.e-shape-rectangle-radius');
5565
6105
  var fontFamilyElem = parent.element.querySelector('.e-text-font-family');
5566
6106
  var fontSizeElem = parent.element.querySelector('.e-text-font-size');
5567
6107
  var boldBtn = parent.element.querySelector('#' + id + '_bold');
@@ -5570,6 +6110,9 @@ var ToolbarModule = /** @class */ (function () {
5570
6110
  if (isNullOrUndefined(parent.activeObj.strokeSettings.strokeWidth)) {
5571
6111
  parent.activeObj.strokeSettings.strokeWidth = 2;
5572
6112
  }
6113
+ if (isNullOrUndefined(parent.activeObj.strokeSettings.outlineWidth)) {
6114
+ parent.activeObj.strokeSettings.outlineWidth = 2;
6115
+ }
5573
6116
  if (selFillElem) {
5574
6117
  var value = parent.activeObj.strokeSettings.fillColor;
5575
6118
  if (parent.activeObj.strokeSettings.fillColor === '') {
@@ -5597,6 +6140,32 @@ var ToolbarModule = /** @class */ (function () {
5597
6140
  getComponent(id + '_text_font', 'colorpicker').value = value;
5598
6141
  }
5599
6142
  }
6143
+ if (selStrokeTextColorElem) {
6144
+ var value = parent.activeObj.strokeSettings.outlineColor;
6145
+ if (!/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$|^[a-zA-Z]+$/.test(parent.activeObj.strokeSettings.outlineColor)) {
6146
+ selStrokeTextColorElem.classList.add('e-nocolor-item');
6147
+ }
6148
+ else {
6149
+ selStrokeTextColorElem.classList.remove('e-nocolor-item');
6150
+ selStrokeTextColorElem.style.background = value;
6151
+ }
6152
+ if (document.querySelector('#' + id + '_stroke_text')) {
6153
+ getComponent(id + '_stroke_text', 'colorpicker').value = value;
6154
+ }
6155
+ }
6156
+ if (selTextBGElem) {
6157
+ var value = parent.activeObj.strokeSettings.fillColor;
6158
+ if (parent.activeObj.strokeSettings.fillColor === '' || parent.activeObj.strokeSettings.fillColor === 'transparent') {
6159
+ selTextBGElem.classList.add('e-nocolor-item');
6160
+ }
6161
+ else {
6162
+ selTextBGElem.classList.remove('e-nocolor-item');
6163
+ selTextBGElem.style.background = value;
6164
+ }
6165
+ if (document.querySelector('#' + id + '_text_bgColor')) {
6166
+ getComponent(id + '_text_bgColor', 'colorpicker').value = value;
6167
+ }
6168
+ }
5600
6169
  if (selPenStrokeElem) {
5601
6170
  var value = parent.activeObj.strokeSettings.strokeColor;
5602
6171
  selPenStrokeElem.style.background = value;
@@ -5639,9 +6208,14 @@ var ToolbarModule = /** @class */ (function () {
5639
6208
  }
5640
6209
  }
5641
6210
  if (strokeWidthElem) {
5642
- var strokeWidth = Math.round((parent.activeObj.strokeSettings.strokeWidth)).toString();
6211
+ var width = parent.activeObj.shape === 'text' ? parent.activeObj.strokeSettings.outlineWidth : parent.activeObj.strokeSettings.strokeWidth;
6212
+ var strokeWidth = Math.round(width).toString();
5643
6213
  strokeWidthElem.textContent = this.getStrokeWidth(strokeWidth);
5644
6214
  }
6215
+ if (rectangleRadiusElem) {
6216
+ var rectRadius = Math.round((parent.activeObj.strokeSettings.radius)).toString();
6217
+ rectangleRadiusElem.textContent = this.getRectRadius(rectRadius);
6218
+ }
5645
6219
  }
5646
6220
  }
5647
6221
  };
@@ -5670,6 +6244,31 @@ var ToolbarModule = /** @class */ (function () {
5670
6244
  }
5671
6245
  return strokeWidth;
5672
6246
  };
6247
+ ToolbarModule.prototype.getRectRadius = function (text) {
6248
+ var rectRadius;
6249
+ var currentWidth = parseInt(text, 10) / 2;
6250
+ switch (currentWidth) {
6251
+ case 0:
6252
+ rectRadius = this.l10n.getConstant('0');
6253
+ break;
6254
+ case 1:
6255
+ rectRadius = this.l10n.getConstant('20');
6256
+ break;
6257
+ case 2:
6258
+ rectRadius = this.l10n.getConstant('40');
6259
+ break;
6260
+ case 3:
6261
+ rectRadius = this.l10n.getConstant('60');
6262
+ break;
6263
+ case 4:
6264
+ rectRadius = this.l10n.getConstant('80');
6265
+ break;
6266
+ case 5:
6267
+ rectRadius = this.l10n.getConstant('100');
6268
+ break;
6269
+ }
6270
+ return rectRadius;
6271
+ };
5673
6272
  ToolbarModule.prototype.cancelPan = function () {
5674
6273
  var parent = this.parent;
5675
6274
  parent.notify('shape', { prop: 'applyActObj', onPropertyChange: false, value: { isMouseDown: true } });
@@ -5796,6 +6395,90 @@ var ToolbarModule = /** @class */ (function () {
5796
6395
  ToolbarModule.prototype.getModuleName = function () {
5797
6396
  return 'toolbar-module';
5798
6397
  };
6398
+ ToolbarModule.prototype.redactSlider = function (type) {
6399
+ var parent = this.parent;
6400
+ var id = parent.element.id;
6401
+ var toolbarArea = parent.element.querySelector('#' + id + '_toolbarArea');
6402
+ var contextualToolbarArea = parent.element.querySelector('#' + id + '_contextualToolbarArea');
6403
+ if (!contextualToolbarArea) {
6404
+ return;
6405
+ }
6406
+ contextualToolbarArea.classList.remove('e-hide');
6407
+ contextualToolbarArea.style.left = toolbarArea.offsetLeft + 'px';
6408
+ var canvasWrapper = document.querySelector('#' + id + '_contextualToolbarArea');
6409
+ var hdrWrapper = document.querySelector('#' + id + '_headWrapper');
6410
+ var labelWrapper = document.querySelector('#' + id + '_labelWrapper');
6411
+ var ctxTbar = document.querySelector('#' + id + '_contextualToolbar');
6412
+ if (hdrWrapper) {
6413
+ hdrWrapper.remove();
6414
+ labelWrapper.remove();
6415
+ }
6416
+ if (ctxTbar) {
6417
+ ctxTbar.remove();
6418
+ this.createContextualToolbar();
6419
+ }
6420
+ hdrWrapper = canvasWrapper.appendChild(parent.createElement('div', {
6421
+ id: id + '_headWrapper',
6422
+ styles: 'position: relative'
6423
+ }));
6424
+ labelWrapper = hdrWrapper.appendChild(parent.createElement('label', {
6425
+ id: id + '_labelWrapper',
6426
+ className: 'e-ie-finetune-slider-label',
6427
+ styles: Browser.isDevice ? ('position: absolute; top: 31%; left: calc(50% - 160px); font-size: 15px; text-transform: capitalize; font-weight: 400;')
6428
+ : 'position: absolute; top: 25%; left: calc(50% - 226px); font-size: 15px; text-transform: capitalize; font-weight: 400;'
6429
+ }));
6430
+ var text = type === 'blur' ? this.l10n.getConstant('Blur') : this.l10n.getConstant('PixelSize');
6431
+ labelWrapper.textContent = text;
6432
+ var sliderWrapper = hdrWrapper.appendChild(parent.createElement('div', {
6433
+ id: id + '_sliderWrapper',
6434
+ className: 'e-ie-finetune-slider-wrap',
6435
+ styles: 'position: absolute'
6436
+ }));
6437
+ hdrWrapper.appendChild(parent.createElement('label', {
6438
+ id: id + '_redactSpan',
6439
+ className: 'e-ie-redact-value-span',
6440
+ styles: Browser.isDevice ? ('position: absolute; top: 30%; margin-left: 20px; font-size: 15px; text-transform: capitalize; font-weight: 400;') :
6441
+ 'position: absolute; top: 30%; left: calc(50% + 190px); font-size: 15px; text-transform: capitalize; font-weight: 400;'
6442
+ }));
6443
+ sliderWrapper.parentElement.classList.add('e-finetune-slider');
6444
+ var value = parent.activeObj.redactType === 'blur' ? parent.activeObj.redactBlur :
6445
+ parent.activeObj.redactPixelate;
6446
+ var redactSlider = new Slider({
6447
+ tooltip: { placement: 'Before', isVisible: true, showOn: 'Focus' },
6448
+ min: 10, max: 100, step: 1, value: value,
6449
+ type: 'MinRange',
6450
+ width: Browser.isDevice ? '130px' : '300px',
6451
+ created: function () {
6452
+ parent.element.querySelector('.e-ie-redact-value-span').innerText = value.toString();
6453
+ },
6454
+ change: function (args) {
6455
+ parent.element.querySelector('.e-ie-redact-value-span').innerText = args.value.toString();
6456
+ if (parent.activeObj.redactType === 'blur') {
6457
+ parent.activeObj.redactBlur = parent.tempRedactBlur = args.value;
6458
+ }
6459
+ else if (parent.activeObj.redactType === 'pixelate') {
6460
+ parent.activeObj.redactPixelate = parent.tempRedactPixel = args.value;
6461
+ }
6462
+ parent.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate', obj: parent.activeObj, isCropRatio: null,
6463
+ points: null, isPreventDrag: true, saveContext: null, isPreventSelection: true } });
6464
+ },
6465
+ changed: function () {
6466
+ setTimeout(function () {
6467
+ parent.notify('undo-redo', { prop: 'updateUndoRedoStack', onPropertyChange: false });
6468
+ }, 50);
6469
+ }
6470
+ });
6471
+ redactSlider.appendTo('#' + id + '_sliderWrapper');
6472
+ if (Browser.isDevice) {
6473
+ var cHt = contextualToolbarArea.offsetHeight + 1;
6474
+ var cusWrapper = parent.element.querySelector('#' + id + '_customizeWrapper');
6475
+ if (this.isFrameToolbar && cusWrapper) {
6476
+ cHt = cusWrapper.offsetHeight + 2;
6477
+ }
6478
+ var ht = parent.element.querySelector('#' + id + '_canvasWrapper').offsetHeight;
6479
+ contextualToolbarArea.style.top = this.toolbarHeight + 1 + ht - cHt + 'px';
6480
+ }
6481
+ };
5799
6482
  return ToolbarModule;
5800
6483
  }());
5801
6484
  export { ToolbarModule };