@syncfusion/ej2-image-editor 26.2.10 → 27.1.48

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 (187) 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 +3207 -732
  5. package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
  6. package/dist/es6/ej2-image-editor.es5.js +3286 -797
  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 +14 -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 +377 -45
  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 +6 -0
  22. package/src/image-editor/action/selection.js +382 -97
  23. package/src/image-editor/action/shape.d.ts +5 -0
  24. package/src/image-editor/action/shape.js +287 -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 +816 -149
  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 +873 -191
  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
  187. package/hotfix/26.1.35_Vol2.txt +0 -1
@@ -194,6 +194,7 @@ var Transform = /** @class */ (function () {
194
194
  currentDegree: Math.abs(parent.transform.degree + degree) === 360 ? 0 : parent.transform.degree + degree };
195
195
  if (!this.isPreventSelect) {
196
196
  parent.trigger('rotating', transitionArgs);
197
+ parent.editCompleteArgs = transitionArgs;
197
198
  }
198
199
  this.rotateEvent(transitionArgs, degree);
199
200
  };
@@ -336,11 +337,6 @@ var Transform = /** @class */ (function () {
336
337
  height: parent.img.destHeight };
337
338
  parent.objColl = [];
338
339
  parent.objColl.push(extend({}, parent.currSelectionPoint, {}, true));
339
- if (isNullOrUndefined(parent.objColl[0].imageRatio)) {
340
- parent.activeObj = parent.objColl[0];
341
- parent.notify('shape', { prop: 'updImgRatioForActObj', onPropertyChange: false });
342
- parent.objColl[0] = parent.activeObj;
343
- }
344
340
  parent.img = { srcLeft: 0, srcTop: 0, srcWidth: parent.baseImgCanvas.width, srcHeight: parent.baseImgCanvas.height,
345
341
  destLeft: this.currDestPoint.startX, destTop: this.currDestPoint.startY, destWidth: this.currDestPoint.width,
346
342
  destHeight: this.currDestPoint.height };
@@ -365,6 +361,7 @@ var Transform = /** @class */ (function () {
365
361
  previousDirection: parent.toPascalCase(parent.transform.currFlipState || direction) };
366
362
  if (!this.isPreventSelect) {
367
363
  parent.trigger('flipping', transitionArgs);
364
+ parent.editCompleteArgs = transitionArgs;
368
365
  }
369
366
  this.flipEvent(transitionArgs, direction);
370
367
  };
@@ -626,7 +623,9 @@ var Transform = /** @class */ (function () {
626
623
  this.tempActiveObj = extend({}, parent.activeObj, {}, true);
627
624
  parent.isCropTab = true;
628
625
  }
629
- else if (parent.activeObj.shape && splitWords[0] !== 'crop') {
626
+ else if (parent.activeObj.shape && splitWords[0] !== 'crop' &&
627
+ (parent.activeObj.activePoint.width !== 0 || parent.activeObj.activePoint.height !== 0) ||
628
+ (parent.activeObj.shape === 'path' && parent.activeObj.pointColl.length > 0)) {
630
629
  this.isShape = true;
631
630
  }
632
631
  var obj = { zoomType: null };
@@ -648,18 +647,25 @@ var Transform = /** @class */ (function () {
648
647
  currentZoomFactor: parent.zoomSettings.zoomFactor, zoomTrigger: obj['zoomType'] };
649
648
  if (!parent.isCropToolbar && parent.isZoomBtnClick) {
650
649
  parent.trigger('zooming', zoomEventArgs);
650
+ parent.editCompleteArgs = zoomEventArgs;
651
651
  }
652
652
  this.zoomEvent(zoomEventArgs, zoomFactor, isPreventApply);
653
653
  }
654
654
  };
655
655
  Transform.prototype.zoomEvent = function (zoomEventArgs, zoomFact, isPreventApply) {
656
656
  var parent = this.parent;
657
+ var shapeId;
657
658
  var _a = parent.zoomSettings, zoomFactor = _a.zoomFactor, minZoomFactor = _a.minZoomFactor;
658
659
  if (zoomEventArgs.cancel) {
659
660
  parent.isZoomBtnClick = false;
660
661
  return;
661
662
  }
662
- parent.notify('toolbar', { prop: 'close-contextual-toolbar', onPropertyChange: false });
663
+ if (this.parent.activeObj.redactType !== 'blur' && this.parent.activeObj.redactType !== 'pixelate') {
664
+ parent.notify('toolbar', { prop: 'close-contextual-toolbar', onPropertyChange: false });
665
+ }
666
+ if (!parent.isCropTab && parent.activeObj.shape) {
667
+ shapeId = parent.activeObj.currIndex;
668
+ }
663
669
  parent.notify('shape', { prop: 'redrawActObj', onPropertyChange: false,
664
670
  value: { x: null, y: null, isMouseDown: true } });
665
671
  parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
@@ -774,16 +780,20 @@ var Transform = /** @class */ (function () {
774
780
  if (parent.activeObj.shape === 'crop-custom') {
775
781
  parent.currObjType.isCustomCrop = true;
776
782
  }
777
- var panBtn = parent.element.querySelector('.e-img-pan .e-btn');
778
- if (panBtn && parent.togglePan) {
779
- panBtn.classList.add('e-selected-btn');
780
- }
781
- else if (panBtn) {
782
- panBtn.classList.remove('e-selected-btn');
783
- }
784
783
  if (this.isShape) {
785
- parent.activeObj = extend({}, parent.objColl[parent.objColl.length - 1], {}, true);
786
- parent.objColl.pop();
784
+ if (shapeId) {
785
+ for (var i = 0, len = parent.objColl.length; i < len; i++) {
786
+ if (parent.objColl[i].currIndex === shapeId) {
787
+ parent.activeObj = extend({}, parent.objColl[i], {}, true);
788
+ parent.objColl.splice(i, 1);
789
+ break;
790
+ }
791
+ }
792
+ }
793
+ else {
794
+ parent.activeObj = extend({}, parent.objColl[parent.objColl.length - 1], {}, true);
795
+ parent.objColl.pop();
796
+ }
787
797
  parent.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate', obj: parent.activeObj, isCropRatio: null,
788
798
  points: null, isPreventDrag: true, saveContext: null, isPreventSelection: null } });
789
799
  parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
@@ -802,24 +812,32 @@ var Transform = /** @class */ (function () {
802
812
  parent.activeObj = activeObj;
803
813
  if (activeObj.activePoint.width > 0 || activeObj.activePoint.height > 0 ||
804
814
  (activeObj.pointColl && activeObj.pointColl.length > 0)) {
815
+ if (activeObj.shape === 'redact') {
816
+ parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
817
+ }
805
818
  var zOrderElem = parent.element.querySelector('#' + parent.element.id + '_zOrderBtn');
806
819
  var dupElem = parent.element.querySelector('#' + parent.element.id + '_duplicate');
807
820
  var removeElem = parent.element.querySelector('#' + parent.element.id + '_remove');
808
821
  var editTextElem = parent.element.querySelector('#' + parent.element.id + '_editText');
809
822
  if (zOrderElem) {
810
- zOrderElem.classList.remove('e-disabled');
823
+ zOrderElem.classList.remove('e-overlay');
811
824
  }
812
825
  if (dupElem) {
813
- dupElem.classList.remove('e-disabled');
826
+ dupElem.classList.remove('e-overlay');
814
827
  }
815
828
  if (removeElem) {
816
- removeElem.classList.remove('e-disabled');
829
+ removeElem.classList.remove('e-overlay');
817
830
  }
818
831
  if (editTextElem) {
819
- editTextElem.classList.remove('e-disabled');
832
+ editTextElem.classList.remove('e-overlay');
820
833
  }
821
834
  }
822
835
  }
836
+ else if (parent.activeObj.shape && parent.activeObj.shape === 'redact') {
837
+ parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'redact',
838
+ isApplyBtn: false, isCropping: false } });
839
+ parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
840
+ }
823
841
  };
824
842
  Transform.prototype.disableZoomOutBtn = function (isZoomOut) {
825
843
  var parent = this.parent;
@@ -997,24 +1015,14 @@ var Transform = /** @class */ (function () {
997
1015
  var destLeft = parent.img.destLeft;
998
1016
  var destTop = parent.img.destTop;
999
1017
  var maxDimension = { width: 0, height: 0 };
1000
- if (parent.img.srcLeft === 0 || parent.img.srcTop === 0) {
1001
- if (isNullOrUndefined(selectionObj)) {
1002
- maxDimension = this.setZoomDimension(value, null);
1003
- }
1004
- else {
1005
- maxDimension = this.setZoomDimension(value, selectionObj);
1006
- }
1018
+ if (parent.transform.degree % 90 === 0 && parent.transform.degree % 180 !== 0) {
1019
+ maxDimension = this.calcMaxDimension(parent.img.srcHeight, parent.img.srcWidth);
1007
1020
  }
1008
1021
  else {
1009
- if (parent.transform.degree % 90 === 0 && parent.transform.degree % 180 !== 0) {
1010
- maxDimension = this.calcMaxDimension(parent.img.srcHeight, parent.img.srcWidth);
1011
- }
1012
- else {
1013
- maxDimension = this.calcMaxDimension(parent.img.srcWidth, parent.img.srcHeight);
1014
- }
1015
- maxDimension.width += (maxDimension.width * parent.transform.zoomFactor);
1016
- maxDimension.height += (maxDimension.height * parent.transform.zoomFactor);
1022
+ maxDimension = this.calcMaxDimension(parent.img.srcWidth, parent.img.srcHeight);
1017
1023
  }
1024
+ maxDimension.width += (maxDimension.width * parent.transform.zoomFactor);
1025
+ maxDimension.height += (maxDimension.height * parent.transform.zoomFactor);
1018
1026
  parent.img.destLeft = destLeft - ((maxDimension.width - parent.img.destWidth) / 2);
1019
1027
  parent.img.destTop = destTop - ((maxDimension.height - parent.img.destHeight) / 2);
1020
1028
  destLeft = parent.img.destLeft;
@@ -1273,9 +1281,6 @@ var Transform = /** @class */ (function () {
1273
1281
  };
1274
1282
  Transform.prototype.performTransformation = function (text) {
1275
1283
  var parent = this.parent;
1276
- var tempZoomFactor = parent.transform.defaultZoomFactor;
1277
- var isUndoRedo = parent.isUndoRedo;
1278
- var prevCropObj = extend({}, parent.cropObj, {}, true);
1279
1284
  this.resetZoom();
1280
1285
  this.updateTransform(text);
1281
1286
  for (var i = 0, len = parent.objColl.length; i < len; i++) {
@@ -1289,24 +1294,6 @@ var Transform = /** @class */ (function () {
1289
1294
  }
1290
1295
  }
1291
1296
  }
1292
- if (tempZoomFactor !== 0) {
1293
- parent.isUndoRedo = true;
1294
- this.zoomAction(tempZoomFactor);
1295
- parent.isUndoRedo = isUndoRedo;
1296
- var state = '';
1297
- if (text === 'rotateleft' || text === 'rotateright') {
1298
- state = 'rotate';
1299
- }
1300
- else if (text === 'horizontalflip' || text === 'verticalflip') {
1301
- state = 'flip';
1302
- }
1303
- parent.notify('undo-redo', { prop: 'updateUndoRedoColl', onPropertyChange: false,
1304
- value: { operation: state, previousObj: this.transCurrObj, previousObjColl: this.transCurrObj.objColl,
1305
- previousPointColl: this.transCurrObj.pointColl, previousSelPointColl: this.transCurrObj.selPointColl,
1306
- previousCropObj: prevCropObj, previousText: null,
1307
- currentText: null, previousFilter: null, isCircleCrop: null } });
1308
- this.transCurrObj = null;
1309
- }
1310
1297
  };
1311
1298
  Transform.prototype.updateTransform = function (text) {
1312
1299
  switch (text.toLowerCase()) {
@@ -1479,6 +1466,9 @@ var Transform = /** @class */ (function () {
1479
1466
  value: { x: zoomPoint.x, y: zoomPoint.y, type: type, isResize: null } });
1480
1467
  }
1481
1468
  }
1469
+ var actionArgs = { action: value > 0 ? 'zoom-in' : 'zoom-out',
1470
+ actionEventArgs: parent.editCompleteArgs };
1471
+ parent.triggerEditCompleteEvent(actionArgs);
1482
1472
  }
1483
1473
  };
1484
1474
  Transform.prototype.getCurrentZoomFactor = function (zoomFactor) {
@@ -1520,7 +1510,6 @@ var Transform = /** @class */ (function () {
1520
1510
  Transform.prototype.update = function () {
1521
1511
  var parent = this.parent;
1522
1512
  var toolbarHeight = 0;
1523
- var isFrameToolbar = false;
1524
1513
  var isActiveObj = false;
1525
1514
  var freehandObj = { bool: false };
1526
1515
  var straightenObj = { bool: parent.isStraightening };
@@ -1577,7 +1566,7 @@ var Transform = /** @class */ (function () {
1577
1566
  if (canvasWrapper) {
1578
1567
  canvasWrapper.style.width = parent.element.offsetWidth - 2 + 'px';
1579
1568
  }
1580
- parent.lowerCanvas.width = parent.upperCanvas.width = parent.element.offsetWidth - 2;
1569
+ parent.lowerCanvas.width = parent.upperCanvas.width = parent.maskCanvas.width = parent.element.offsetWidth - 2;
1581
1570
  if (parent.toolbarTemplate) {
1582
1571
  toolbarHeight = parent.element.querySelector('#' + parent.element.id + '_toolbarArea').clientHeight;
1583
1572
  }
@@ -1637,8 +1626,10 @@ var Transform = /** @class */ (function () {
1637
1626
  canvasWrapper.style.height = (parseFloat(canvasWrapper.style.height) - obj_1['toolbarHeight']) - 2 + 'px';
1638
1627
  }
1639
1628
  }
1640
- parent.lowerCanvas.width = parent.upperCanvas.width = parseFloat(canvasWrapper.style.width);
1641
- parent.lowerCanvas.height = parent.upperCanvas.height = parseFloat(canvasWrapper.style.height);
1629
+ parent.lowerCanvas.width = parent.upperCanvas.width = parent.maskCanvas.width =
1630
+ parseFloat(canvasWrapper.style.width);
1631
+ parent.lowerCanvas.height = parent.upperCanvas.height = parent.maskCanvas.height =
1632
+ parseFloat(canvasWrapper.style.height);
1642
1633
  this.lowerContext.filter = tempFilter;
1643
1634
  var obj = { width: 0, height: 0 };
1644
1635
  this.calcMaxDimension(parent.img.srcWidth, parent.img.srcHeight, obj);
@@ -1685,7 +1676,9 @@ var Transform = /** @class */ (function () {
1685
1676
  if (obj1['defToolbarItems'] && obj1['defToolbarItems'].length > 0 && document.getElementById(parent.element.id + '_toolbar')) {
1686
1677
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
1687
1678
  var toolbar_1 = getComponent(parent.element.id + '_toolbar', 'toolbar');
1688
- toolbar_1.refreshOverflow();
1679
+ if (toolbar_1) {
1680
+ toolbar_1.refreshOverflow();
1681
+ }
1689
1682
  if (ctWrapper && !straightenObj['bool']) {
1690
1683
  ctWrapper.classList.add('e-hide');
1691
1684
  }
@@ -1719,10 +1712,7 @@ var Transform = /** @class */ (function () {
1719
1712
  if (freehandObj['bool']) {
1720
1713
  parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: true } });
1721
1714
  }
1722
- if (isFrameToolbar) {
1723
- parent.notify('toolbar', { prop: 'callFrameToolbar', onPropertyChange: false });
1724
- }
1725
- else if (parent.isResize) {
1715
+ if (parent.isResize) {
1726
1716
  parent.aspectWidth = Math.ceil(parent.img.destWidth);
1727
1717
  parent.aspectHeight = Math.ceil(parent.img.destHeight);
1728
1718
  parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'resize',
@@ -2126,6 +2116,7 @@ var Transform = /** @class */ (function () {
2126
2116
  (isAspectRatio ? Math.ceil(parseFloat(aspectHeight)) : Math.ceil(parent.img.destHeight)),
2127
2117
  isAspectRatio: isAspectRatio ? isAspectRatio : false };
2128
2118
  parent.trigger('resizing', resizeEventArgs);
2119
+ parent.editCompleteArgs = resizeEventArgs;
2129
2120
  if (!resizeEventArgs.cancel) {
2130
2121
  this.resizeEventHandler(resizeEventArgs);
2131
2122
  }
@@ -2139,8 +2130,6 @@ var Transform = /** @class */ (function () {
2139
2130
  var isRotate;
2140
2131
  var aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
2141
2132
  var aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
2142
- var heightElem = parent.element.querySelector('.e-ie-toolbar-e-resize-height-input .e-textbox');
2143
- var widthElem = parent.element.querySelector('.e-ie-toolbar-e-resize-width-input .e-textbox');
2144
2133
  if (args.isAspectRatio) {
2145
2134
  if (this.resizedImgAngle == null || this.resizedImgAngle !== parent.transform.degree) {
2146
2135
  this.resizedImgAngle = parent.transform.degree;
@@ -2170,21 +2159,6 @@ var Transform = /** @class */ (function () {
2170
2159
  parent.aspectWidth = width;
2171
2160
  }
2172
2161
  }
2173
- else if (heightElem) {
2174
- var value = aspectRatioWidthValue / (originalWidth / originalHeight);
2175
- // eslint-disable-next-line max-len
2176
- var height = value % 1 >= 0.5 || value % 1 <= -0.5 ? Math.round(value) : (value < 0) ? Math.ceil(value) : Math.floor(value);
2177
- heightElem.value = height.toString();
2178
- parent.aspectHeight = height;
2179
- if (widthElem && widthElem.value === '') {
2180
- var aspectRatioHeightValue = parseFloat(heightElem.value === '' ? heightElem.placeholder : heightElem.value);
2181
- value = aspectRatioHeightValue / (originalHeight / originalWidth);
2182
- // eslint-disable-next-line max-len
2183
- var width = value % 1 >= 0.5 || value % 1 <= -0.5 ? Math.round(value) : (value < 0) ? Math.ceil(value) : Math.floor(value);
2184
- widthElem.value = width.toString();
2185
- parent.aspectWidth = width;
2186
- }
2187
- }
2188
2162
  }
2189
2163
  else {
2190
2164
  parent.notify('transform', { prop: 'resizeImage', value: { width: args.width, height: null } });
@@ -21,6 +21,8 @@ export declare class UndoRedo {
21
21
  private reset;
22
22
  private refreshUrc;
23
23
  private updateCurrUrc;
24
+ private triggerActionCompletedEvent;
25
+ private getUndoRedoAction;
24
26
  private cancelCropSelection;
25
27
  private refreshToolbarActions;
26
28
  private applyCurrentChanges;
@@ -105,6 +105,9 @@ var UndoRedo = /** @class */ (function () {
105
105
  };
106
106
  UndoRedo.prototype.refreshUrc = function (refreshToolbar) {
107
107
  var parent = this.parent;
108
+ if (parent.isImageUpdated) {
109
+ return;
110
+ }
108
111
  refreshToolbar = refreshToolbar ? refreshToolbar : false;
109
112
  if (refreshToolbar) {
110
113
  parent.notify('toolbar', { prop: 'setEnableDisableUndoRedo', value: { isPrevent: true } });
@@ -165,6 +168,9 @@ var UndoRedo = /** @class */ (function () {
165
168
  prevObj.currentObj.currentFilter = parent.currentFilter;
166
169
  }
167
170
  this.appliedUndoRedoColl.push(prevObj);
171
+ if (!isCancel) {
172
+ this.triggerActionCompletedEvent(prevObj.operation);
173
+ }
168
174
  }
169
175
  this.tempUndoRedoColl = [];
170
176
  this.tempUndoRedoStep = 0;
@@ -190,6 +196,18 @@ var UndoRedo = /** @class */ (function () {
190
196
  JSON.stringify(lastObj.currentPointColl) === JSON.stringify(lastPrevObj.currentPointColl))) {
191
197
  this.appliedUndoRedoColl.splice(this.appliedUndoRedoColl.length - 1, 1);
192
198
  }
199
+ else if (this.undoRedoStep !== this.appliedUndoRedoColl.length - 1) {
200
+ lastObj = this.appliedUndoRedoColl[this.appliedUndoRedoColl.length - 1];
201
+ lastPrevObj = this.appliedUndoRedoColl[this.undoRedoStep];
202
+ if (lastObj && lastPrevObj && lastObj.operation === 'shapeTransform' &&
203
+ lastPrevObj.operation === 'shapeTransform' &&
204
+ JSON.stringify(lastObj.currentObjColl) === JSON.stringify(lastPrevObj.previousObjColl)) {
205
+ this.appliedUndoRedoColl.splice(this.appliedUndoRedoColl.length - 1, 1);
206
+ this.undoRedoColl = [];
207
+ this.undoRedoColl = extend([], this.appliedUndoRedoColl, [], true);
208
+ return;
209
+ }
210
+ }
193
211
  }
194
212
  this.undoRedoColl = [];
195
213
  this.undoRedoColl = extend([], this.appliedUndoRedoColl, [], true);
@@ -202,6 +220,35 @@ var UndoRedo = /** @class */ (function () {
202
220
  parent.notify('selection', { prop: 'setDragCanvas', value: { bool: true } });
203
221
  }
204
222
  };
223
+ UndoRedo.prototype.triggerActionCompletedEvent = function (action) {
224
+ var parent = this.parent;
225
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
226
+ var actionMap = { 'brightness': 'fine-tune', 'contrast': 'fine-tune', 'hue': 'fine-tune',
227
+ 'saturation': 'fine-tune', 'opacity': 'fine-tune', 'blur': 'fine-tune', 'exposure': 'fine-tune',
228
+ 'default': 'filter', 'chrome': 'filter', 'cold': 'filter', 'warm': 'filter',
229
+ 'grayscale': 'filter', 'sepia': 'filter', 'invert': 'filter',
230
+ 'deleteObj': 'shape-delete', 'deleteFreehandDrawing': 'freehand-draw-delete',
231
+ 'shapeInsert': 'shape-insert', 'shapeTransform': 'shape-customize',
232
+ 'freehanddrawCustomized': 'freehand-draw-customize'
233
+ };
234
+ var actionResult = actionMap[action] || action;
235
+ var actionArgs = { action: actionResult, actionEventArgs: parent.editCompleteArgs };
236
+ parent.triggerEditCompleteEvent(actionArgs);
237
+ };
238
+ UndoRedo.prototype.getUndoRedoAction = function (action) {
239
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
240
+ var actionMap = { 'brightness': 'fine-tune', 'contrast': 'fine-tune', 'hue': 'fine-tune',
241
+ 'saturation': 'fine-tune', 'opacity': 'fine-tune', 'blur': 'fine-tune', 'exposure': 'fine-tune',
242
+ 'default': 'filter', 'chrome': 'filter', 'cold': 'filter', 'warm': 'filter',
243
+ 'grayscale': 'filter', 'sepia': 'filter', 'invert': 'filter',
244
+ 'deleteObj': 'shape-delete', 'deleteFreehandDrawing': 'freehand-drawing-delete',
245
+ 'shapeInsert': 'shape-insert', 'shapeTransform': 'shape-customize', 'imageRotate': 'shape-customize',
246
+ 'freehanddraw': 'freehand-draw', 'freehanddrawCustomized': 'freehand-draw-customize',
247
+ 'textAreaCustomization': 'text-area-customization', 'imageHFlip': 'shape-customize',
248
+ 'imageVFlip': 'shape-customize', 'bgColor': 'background-color', 'updateImage': 'image-update'
249
+ };
250
+ return actionMap[action] || action;
251
+ };
205
252
  UndoRedo.prototype.cancelCropSelection = function () {
206
253
  var parent = this.parent;
207
254
  var isCropSelection = false;
@@ -302,6 +349,7 @@ var UndoRedo = /** @class */ (function () {
302
349
  parent.canvasFilter = this.lowerContext.filter;
303
350
  parent.initialAdjustmentValue = this.lowerContext.filter;
304
351
  parent.notify('filter', { prop: 'setBevelFilter', onPropertyChange: false, value: { bevelFilter: this.lowerContext.filter } });
352
+ var editCompleteArgs = { action: this.getUndoRedoAction(obj.operation) };
305
353
  switch (obj.operation) {
306
354
  case 'shapeTransform':
307
355
  case 'brightness':
@@ -358,6 +406,26 @@ var UndoRedo = /** @class */ (function () {
358
406
  case 'imageVFlip':
359
407
  this.imageFlip('vertical', obj.previousObjColl);
360
408
  break;
409
+ case 'bgColor':
410
+ parent.notify('draw', { prop: 'imageBackgroundColor', onPropertyChange: false, value: { color: obj.previousObj.bgColor } });
411
+ parent.notify('draw', { prop: 'render-image', value: { isMouseWheel: false } });
412
+ break;
413
+ case 'updateImage':
414
+ parent.isImageUpdated = true;
415
+ parent.baseImg.src = obj.previousObj.imageSource;
416
+ setTimeout(function () {
417
+ if (parent.cropObj.straighten !== 0) {
418
+ parent.notify('toolbar', { prop: 'performCropTransformClick', value: { shape: 'crop-' + 'custom' } });
419
+ parent.noPushUndo = true;
420
+ parent.crop();
421
+ parent.noPushUndo = false;
422
+ }
423
+ else {
424
+ parent.notify('draw', { prop: 'render-image', value: { isMouseWheel: false } });
425
+ }
426
+ parent.isImageUpdated = false;
427
+ });
428
+ break;
361
429
  default:
362
430
  this.undoDefault(obj, true);
363
431
  parent.notify('filter', { prop: 'set-adjustment', value: { operation: obj.operation } });
@@ -379,7 +447,10 @@ var UndoRedo = /** @class */ (function () {
379
447
  this.tempCurrSelPoint = extend({}, parent.currSelectionPoint, {}, true);
380
448
  parent.currSelectionPoint = null;
381
449
  }
450
+ var tempCircleCrop = parent.cancelCropSelection.isCircleCrop;
451
+ parent.cancelCropSelection.isCircleCrop = false;
382
452
  parent.notify('draw', { prop: 'performCancel', value: { isContextualToolbar: null, isUndoRedo: true } });
453
+ parent.cancelCropSelection.isCircleCrop = tempCircleCrop;
383
454
  parent.currObjType.isActiveObj = false;
384
455
  if (parent.transform.straighten !== 0) {
385
456
  parent.notify('draw', { prop: 'setStraightenActObj', value: { activeObj: null } });
@@ -395,6 +466,8 @@ var UndoRedo = /** @class */ (function () {
395
466
  value: { context: this.lowerContext, isSave: null, isFlip: null } });
396
467
  }
397
468
  this.endUndoRedo(obj.operation, true);
469
+ var action = { action: 'undo', actionEventArgs: editCompleteArgs };
470
+ parent.triggerEditCompleteEvent(action);
398
471
  }
399
472
  }
400
473
  };
@@ -434,6 +507,7 @@ var UndoRedo = /** @class */ (function () {
434
507
  parent.initialAdjustmentValue = this.lowerContext.filter;
435
508
  parent.notify('filter', { prop: 'setBevelFilter', onPropertyChange: false, value: { bevelFilter: this.lowerContext.filter } });
436
509
  var activeObj = void 0;
510
+ var editCompleteArgs = { action: this.getUndoRedoAction(obj.operation) };
437
511
  switch (obj.operation) {
438
512
  case 'shapeTransform':
439
513
  case 'brightness':
@@ -486,6 +560,26 @@ var UndoRedo = /** @class */ (function () {
486
560
  case 'imageVFlip':
487
561
  this.imageFlip('vertical', obj.currentObjColl);
488
562
  break;
563
+ case 'bgColor':
564
+ parent.notify('draw', { prop: 'imageBackgroundColor', onPropertyChange: false, value: { color: obj.currentObj.bgColor } });
565
+ parent.notify('draw', { prop: 'render-image', value: { isMouseWheel: false } });
566
+ break;
567
+ case 'updateImage':
568
+ parent.isImageUpdated = true;
569
+ parent.baseImg.src = obj.currentObj.imageSource;
570
+ setTimeout(function () {
571
+ if (parent.cropObj.straighten !== 0) {
572
+ parent.notify('toolbar', { prop: 'performCropTransformClick', value: { shape: 'crop-' + 'custom' } });
573
+ parent.noPushUndo = true;
574
+ parent.crop();
575
+ parent.noPushUndo = false;
576
+ }
577
+ else {
578
+ parent.notify('draw', { prop: 'render-image', value: { isMouseWheel: false } });
579
+ }
580
+ parent.isImageUpdated = false;
581
+ });
582
+ break;
489
583
  default:
490
584
  parent.objColl = [];
491
585
  parent.pointColl = [];
@@ -535,6 +629,8 @@ var UndoRedo = /** @class */ (function () {
535
629
  parent.currSelectionPoint = extend({}, parent.cropObj.activeObj, {}, true);
536
630
  }
537
631
  this.endUndoRedo(obj.operation, false);
632
+ var action = { action: 'redo', actionEventArgs: editCompleteArgs };
633
+ parent.triggerEditCompleteEvent(action);
538
634
  }
539
635
  }
540
636
  };
@@ -732,7 +828,8 @@ var UndoRedo = /** @class */ (function () {
732
828
  parent.freehandCounter = 0;
733
829
  parent.notify('freehand-draw', { prop: 'setSelPointColl', onPropertyChange: false,
734
830
  value: { obj: { selPointColl: [] } } });
735
- parent.notify('draw', { prop: 'setCurrentObj', onPropertyChange: false, value: { obj: obj.previousObj, isUndoRedo: isUndoRedo } });
831
+ var isCircleCrop = !isUndoRedo ? obj.isCircleCrop : false;
832
+ parent.notify('draw', { prop: 'setCurrentObj', onPropertyChange: false, value: { obj: obj.previousObj, isUndoRedo: isUndoRedo, isCircleCrop: isCircleCrop } });
736
833
  parent.prevStraightenedDegree = parent.transform.straighten;
737
834
  this.upperContext.clearRect(0, 0, parent.upperCanvas.width, parent.upperCanvas.height);
738
835
  parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
@@ -1046,6 +1143,7 @@ var UndoRedo = /** @class */ (function () {
1046
1143
  parent.okBtn();
1047
1144
  parent.noPushUndo = temp;
1048
1145
  if (obj['freehandDrawSelectedId']) {
1146
+ parent.noRedact = true;
1049
1147
  parent.selectShape(obj['freehandDrawSelectedId']);
1050
1148
  }
1051
1149
  else {
@@ -1057,6 +1155,7 @@ var UndoRedo = /** @class */ (function () {
1057
1155
  var shapeId = parent.activeObj.currIndex;
1058
1156
  parent.okBtn();
1059
1157
  parent.noPushUndo = temp;
1158
+ parent.noRedact = true;
1060
1159
  parent.selectShape(shapeId);
1061
1160
  if (parent.drawingShape) {
1062
1161
  parent.notify('selection', { prop: 'setCurrentDrawingShape', onPropertyChange: false, value: { value: parent.drawingShape.toLowerCase() } });
@@ -256,3 +256,14 @@ export declare enum FrameLineStyle {
256
256
  /** Represents a dotted line. */
257
257
  Dotted = "Dotted"
258
258
  }
259
+ /**
260
+ * An enumeration representing the type of redaction to be added in the image editor.
261
+ *
262
+ * @enum {string}
263
+ */
264
+ export declare enum RedactType {
265
+ /** Represents a blur redaction. */
266
+ Blur = "Blur",
267
+ /** Represents a pixelate redaction. */
268
+ Pixelate = "Pixelate"
269
+ }
@@ -267,3 +267,15 @@ export var FrameLineStyle;
267
267
  /** Represents a dotted line. */
268
268
  FrameLineStyle["Dotted"] = "Dotted";
269
269
  })(FrameLineStyle || (FrameLineStyle = {}));
270
+ /**
271
+ * An enumeration representing the type of redaction to be added in the image editor.
272
+ *
273
+ * @enum {string}
274
+ */
275
+ export var RedactType;
276
+ (function (RedactType) {
277
+ /** Represents a blur redaction. */
278
+ RedactType["Blur"] = "Blur";
279
+ /** Represents a pixelate redaction. */
280
+ RedactType["Pixelate"] = "Pixelate";
281
+ })(RedactType || (RedactType = {}));
@@ -1,4 +1,4 @@
1
- import { Component, NotifyPropertyChanges, INotifyPropertyChanged, Property, addClass, removeClass, ModuleDeclaration, extend } from '@syncfusion/ej2-base';
1
+ import { Component, NotifyPropertyChanges, INotifyPropertyChanged, Property, addClass, removeClass, ModuleDeclaration, extend } from '@syncfusion/ej2-base';
2
2
  import {ComponentModel} from '@syncfusion/ej2-base';
3
3
 
4
4
  /**
@@ -679,4 +679,16 @@ export interface ImageEditorModel extends ComponentModel{
679
679
  */
680
680
  frameChange?: EmitType<FrameChangeEventArgs>
681
681
 
682
+ /**
683
+  * Event callback that is triggered after the completion of an editing action in the image editor.
684
+ *
685
+ * This event occurs after the image editor canvas has been updated through following actions such as cropping, drawing annotations, applying filters, fine-tuning, or other customizations.
686
+ *
687
+ * It provides an opportunity to perform additional tasks, such as comparing the current image data with previous states or triggering further processing based on the changes.
688
+ *
689
+ * @event editComplete
690
+ *
691
+  */
692
+ editComplete?: EmitType<EditCompleteEventArgs >
693
+
682
694
  }