@syncfusion/ej2-image-editor 20.3.50 → 20.3.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 20.3.50
3
+ * version : 20.3.56
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-image-editor@*",
3
- "_id": "@syncfusion/ej2-image-editor@20.3.48",
3
+ "_id": "@syncfusion/ej2-image-editor@20.3.50",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-wiorIhe8Z3pnWog2Pj0FgkCtduL1PYYRBCGoMOlpMKfFObs06BZvKHOuoW84LvK84Z6DluTEExS6iEGap4ByiQ==",
5
+ "_integrity": "sha512-GC3GXiioSuat7lNj1+alap+EKHpfZE82vt3zXFUkkLapiv6l0ANzbwAnyDgb26HhgtTw1eRSISKw3WFy2gJxXw==",
6
6
  "_location": "/@syncfusion/ej2-image-editor",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,21 +23,21 @@
23
23
  "/@syncfusion/ej2-react-image-editor",
24
24
  "/@syncfusion/ej2-vue-image-editor"
25
25
  ],
26
- "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-20.3.48.tgz",
27
- "_shasum": "00e57bec580b475a0afdee744e70de4dfd3c8053",
26
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-20.3.50.tgz",
27
+ "_shasum": "d3a275b9552ab924a714250cea4033a379403075",
28
28
  "_spec": "@syncfusion/ej2-image-editor@*",
29
- "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
29
+ "_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
30
30
  "author": {
31
31
  "name": "Syncfusion Inc."
32
32
  },
33
33
  "bundleDependencies": false,
34
34
  "dependencies": {
35
- "@syncfusion/ej2-base": "~20.3.50",
36
- "@syncfusion/ej2-buttons": "~20.3.50",
37
- "@syncfusion/ej2-inputs": "~20.3.50",
38
- "@syncfusion/ej2-navigations": "~20.3.50",
39
- "@syncfusion/ej2-popups": "~20.3.50",
40
- "@syncfusion/ej2-splitbuttons": "~20.3.47"
35
+ "@syncfusion/ej2-base": "~20.3.56",
36
+ "@syncfusion/ej2-buttons": "~20.3.56",
37
+ "@syncfusion/ej2-inputs": "~20.3.56",
38
+ "@syncfusion/ej2-navigations": "~20.3.56",
39
+ "@syncfusion/ej2-popups": "~20.3.56",
40
+ "@syncfusion/ej2-splitbuttons": "~20.3.56"
41
41
  },
42
42
  "deprecated": false,
43
43
  "description": "Essential JS 2 ImageEditor",
@@ -69,6 +69,6 @@
69
69
  "url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/imageeditor"
70
70
  },
71
71
  "typings": "index.d.ts",
72
- "version": "20.3.50",
72
+ "version": "20.3.56",
73
73
  "sideEffects": false
74
74
  }
@@ -1,4 +1,4 @@
1
- import { NotifyPropertyChanges, INotifyPropertyChanged, Property, addClass, removeClass, extend } from '@syncfusion/ej2-base';
1
+ import { NotifyPropertyChanges, INotifyPropertyChanged, Property, addClass, removeClass, extend } from '@syncfusion/ej2-base';
2
2
  import {Theme,ImageEditorCommands,SaveEventArgs,BeforeSaveEventArgs,ZoomEventArgs,PanEventArgs,CropEventArgs,RotateEventArgs,FlipEventArgs,ShapeChangeEventArgs,ToolbarEventArgs} from "./image-editor";
3
3
 
4
4
  /**
@@ -414,6 +414,7 @@ export declare class ImageEditor extends SignatureBase implements INotifyPropert
414
414
  * @returns {void}.
415
415
  */
416
416
  private unwireEvent;
417
+ private destroySubComponents;
417
418
  private updateTheme;
418
419
  private toPascalCase;
419
420
  private createCanvas;
@@ -563,6 +564,7 @@ export declare class ImageEditor extends SignatureBase implements INotifyPropert
563
564
  private drawPen;
564
565
  private getObjDetails;
565
566
  private isPointsInRange;
567
+ private rotateMultiple;
566
568
  /**
567
569
  * Clear a current selection.
568
570
  *
@@ -651,9 +653,18 @@ export declare class ImageEditor extends SignatureBase implements INotifyPropert
651
653
  *
652
654
  * @param {boolean} value - Specifies a value whether enable or disable freehand drawing.
653
655
  *
654
- * @returns {void}.
656
+ * @returns {void}.
657
+ * @private
655
658
  */
656
659
  freeHandDraw(value: boolean): void;
660
+ /**
661
+ * Enable or disable a freehand drawing in an Image Editor.
662
+ *
663
+ * @param {boolean} value - Specifies a value whether enable or disable freehand drawing.
664
+ *
665
+ * @returns {void}.
666
+ */
667
+ freehandDraw(value: boolean): void;
657
668
  /**
658
669
  * Enable or disable a panning on the Image Editor.
659
670
  *
@@ -24,7 +24,7 @@ import { Toolbar } from '@syncfusion/ej2-navigations';
24
24
  import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
25
25
  import { ColorPicker, Uploader } from '@syncfusion/ej2-inputs';
26
26
  import { createSpinner, showSpinner, hideSpinner } from '@syncfusion/ej2-popups';
27
- import { compile, compile as templateCompiler, Browser } from '@syncfusion/ej2-base';
27
+ import { compile, compile as templateCompiler, Browser, detach, select } from '@syncfusion/ej2-base';
28
28
  /**
29
29
  * Image Editor is a graphical user interface that helps to edit an image by performing actions like selection,
30
30
  * cropping, rotating, inserting text and shapes (rectangles, ellipses, lines), and drawing free hand on top of an image.
@@ -262,6 +262,7 @@ var ImageEditor = /** @class */ (function (_super) {
262
262
  if (!this.element.getAttribute('class')) {
263
263
  this.element.removeAttribute('class');
264
264
  }
265
+ this.destroySubComponents();
265
266
  this.unwireEvent();
266
267
  _super.prototype.destroy.call(this);
267
268
  this.element.innerHTML = '';
@@ -328,6 +329,27 @@ var ImageEditor = /** @class */ (function (_super) {
328
329
  EventHandler.remove(this.lowerCanvas, 'mouseup', this.canvasMouseUpHandler);
329
330
  EventHandler.remove(document, 'mouseup', this.canvasMouseUpHandler);
330
331
  };
332
+ ImageEditor.prototype.destroySubComponents = function () {
333
+ var inputElement = this.element.querySelectorAll('input.e-control');
334
+ var divElement = this.element.querySelectorAll('div.e-control:not(.e-handle)');
335
+ var btnElement = this.element.querySelectorAll('button.e-control');
336
+ for (var i = 0, len = inputElement.length; i < len; i++) {
337
+ if (inputElement[i].classList.contains('e-color-picker')) {
338
+ getComponent(inputElement[i], 'color-picker').destroy();
339
+ detach(select('input#' + inputElement[i].id, this.element));
340
+ }
341
+ }
342
+ for (var i = 0, len = btnElement.length; i < len; i++) {
343
+ if (btnElement[i].classList.contains('e-dropdown-btn')) {
344
+ getComponent(btnElement[i], 'dropdown-btn').destroy();
345
+ detach(select('button#' + btnElement[i].id, this.element));
346
+ }
347
+ else if (btnElement[i].classList.contains('e-btn')) {
348
+ getComponent(btnElement[i], 'btn').destroy();
349
+ detach(select('button#' + btnElement[i].id, this.element));
350
+ }
351
+ }
352
+ };
331
353
  ImageEditor.prototype.updateTheme = function () {
332
354
  if (this.theme !== '') {
333
355
  this.theme = this.toPascalCase(this.theme);
@@ -1057,7 +1079,9 @@ var ImageEditor = /** @class */ (function (_super) {
1057
1079
  args.element.parentElement.offsetHeight + 'px';
1058
1080
  }
1059
1081
  var activeBtn = spanElem_1.innerHTML;
1060
- args.element.querySelector('[aria-label = ' + '"' + activeBtn + '"' + ']').classList.add('e-selected-btn');
1082
+ if (activeBtn !== '') {
1083
+ args.element.querySelector('[aria-label = ' + '"' + activeBtn + '"' + ']').classList.add('e-selected-btn');
1084
+ }
1061
1085
  },
1062
1086
  select: function (args) {
1063
1087
  spanElem_1.textContent = args.item.text;
@@ -1673,75 +1697,9 @@ var ImageEditor = /** @class */ (function (_super) {
1673
1697
  }
1674
1698
  this.callMainToolbar(false);
1675
1699
  break;
1676
- case 'text':
1677
- this.currObjType.isCustomCrop = false;
1678
- imageEditorObj.drawShapeText();
1679
- this.refreshToolbar(type);
1680
- break;
1681
- case 'pen':
1682
- this.currObjType.isCustomCrop = false;
1683
- this.freeHandDraw(true);
1684
- this.refreshToolbar(type);
1685
- break;
1686
1700
  case 'reset':
1687
1701
  imageEditorObj.reset();
1688
1702
  break;
1689
- case 'load':
1690
- break;
1691
- case 'save':
1692
- break;
1693
- case 'select':
1694
- break;
1695
- case 'bold':
1696
- this.currObjType.isCustomCrop = false;
1697
- if (!this.isBoldbtn) {
1698
- this.activeObj.textSettings.bold = true;
1699
- this.isBoldbtn = true;
1700
- this.redrawText(ratio);
1701
- }
1702
- else {
1703
- this.activeObj.textSettings.bold = false;
1704
- this.isBoldbtn = false;
1705
- this.redrawText(ratio);
1706
- }
1707
- break;
1708
- case 'italic':
1709
- this.currObjType.isCustomCrop = false;
1710
- if (!this.isItalicbtn) {
1711
- this.activeObj.textSettings.italic = true;
1712
- if (this.activeObj.textSettings.bold) {
1713
- this.upperContext.font = 'italic bold ' + this.activeObj.textSettings.fontSize + 'px' +
1714
- ' ' + this.activeObj.textSettings.fontFamily;
1715
- }
1716
- else {
1717
- this.upperContext.font = 'italic ' + this.activeObj.textSettings.fontSize + 'px' + ' ' +
1718
- this.activeObj.textSettings.fontFamily;
1719
- }
1720
- var width = this.upperContext.measureText(this.activeObj.keyHistory).width +
1721
- this.activeObj.textSettings.fontSize * 0.5;
1722
- var height = this.activeObj.textSettings.fontSize + this.activeObj.textSettings.fontSize * 0.25;
1723
- this.setTextSelection(width, height);
1724
- this.updateActiveObject(ratio, this.activeObj.activePoint, this.activeObj);
1725
- this.redrawShape(this.activeObj);
1726
- this.isItalicbtn = true;
1727
- }
1728
- else {
1729
- this.activeObj.textSettings.italic = false;
1730
- if (this.activeObj.textSettings.bold) {
1731
- this.upperContext.font = 'bold ' + this.activeObj.textSettings.fontSize + 'px' + ' ' + this.activeObj.textSettings.fontFamily;
1732
- }
1733
- else {
1734
- this.upperContext.font = this.activeObj.textSettings.fontSize + 'px' + ' ' + this.activeObj.textSettings.fontFamily;
1735
- }
1736
- var width = this.upperContext.measureText(this.activeObj.keyHistory).width +
1737
- this.activeObj.textSettings.fontSize * 0.5;
1738
- var height = this.activeObj.textSettings.fontSize + this.activeObj.textSettings.fontSize * 0.25;
1739
- this.setTextSelection(width, height);
1740
- this.updateActiveObject(ratio, this.activeObj.activePoint, this.activeObj);
1741
- this.redrawShape(this.activeObj);
1742
- this.isItalicbtn = false;
1743
- }
1744
- break;
1745
1703
  }
1746
1704
  }
1747
1705
  this.trigger('toolbarItemClicked', args);
@@ -2930,7 +2888,7 @@ var ImageEditor = /** @class */ (function (_super) {
2930
2888
  // eslint-disable-next-line @typescript-eslint/no-this-alias
2931
2889
  var proxy = this;
2932
2890
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
2933
- var xform = new DOMMatrix();
2891
+ var xform = new DOMMatrix([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
2934
2892
  ctx.getTransform = function () {
2935
2893
  return xform;
2936
2894
  };
@@ -2971,7 +2929,7 @@ var ImageEditor = /** @class */ (function (_super) {
2971
2929
  var transform = ctx.transform;
2972
2930
  ctx.transform = function (a, b, c, d, e, f) {
2973
2931
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
2974
- var m2 = new DOMMatrix();
2932
+ var m2 = new DOMMatrix([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
2975
2933
  m2.a = a;
2976
2934
  m2.b = b;
2977
2935
  m2.c = c;
@@ -6099,22 +6057,6 @@ var ImageEditor = /** @class */ (function (_super) {
6099
6057
  this.updateActiveObject(ratio, this.objColl[i].activePoint, this.objColl[i]);
6100
6058
  }
6101
6059
  }
6102
- else if (degree === 'zoom') {
6103
- for (var i = 0; i < this.objColl.length; i++) {
6104
- this.objColl[i].activePoint.startX /= ratio.width;
6105
- this.objColl[i].activePoint.startY /= ratio.height;
6106
- this.objColl[i].activePoint.endX /= ratio.width;
6107
- this.objColl[i].activePoint.endY /= ratio.height;
6108
- this.objColl[i].activePoint.height = this.objColl[i].activePoint.endX - this.objColl[i].activePoint.startX;
6109
- this.objColl[i].activePoint.width = this.objColl[i].activePoint.endY - this.objColl[i].activePoint.startY;
6110
- this.objColl[i].activePoint.startX *= ratio.width;
6111
- this.objColl[i].activePoint.startY *= ratio.height;
6112
- this.objColl[i].activePoint.endX *= ratio.width;
6113
- this.objColl[i].activePoint.endY *= ratio.height;
6114
- this.objColl[i].activePoint.width = this.objColl[i].activePoint.endX - this.objColl[i].activePoint.startX;
6115
- this.objColl[i].activePoint.height = this.objColl[i].activePoint.endY - this.objColl[i].activePoint.startY;
6116
- }
6117
- }
6118
6060
  };
6119
6061
  ImageEditor.prototype.calcCurrPoints = function (degree, obj) {
6120
6062
  var oldRatio = this.calcPrevRatio();
@@ -6450,6 +6392,51 @@ var ImageEditor = /** @class */ (function (_super) {
6450
6392
  }
6451
6393
  return inRange;
6452
6394
  };
6395
+ ImageEditor.prototype.rotateMultiple = function (length, degree) {
6396
+ for (var i = 0; i < length; i++) {
6397
+ if (degree > 0) {
6398
+ this.degree += 90;
6399
+ }
6400
+ else {
6401
+ this.degree -= 90;
6402
+ }
6403
+ if (this.degree === 360) {
6404
+ this.degree = 0;
6405
+ }
6406
+ this.lowerContext.save();
6407
+ this.setMaximumDimension(90 * (i + 1));
6408
+ this.lowerContext.translate(this.lowerCanvas.width / 2, this.lowerCanvas.height / 2);
6409
+ if (degree > 0) {
6410
+ this.lowerContext.rotate(Math.PI / 180 * 90);
6411
+ }
6412
+ else {
6413
+ this.lowerContext.rotate(Math.PI / 180 * -90);
6414
+ }
6415
+ this.lowerCanvas.style.left = this.upperCanvas.style.left = (this.element.clientWidth - parseInt(this.lowerCanvas.style.maxWidth, 10) - 18) / 2 + 1 + 'px';
6416
+ this.lowerCanvas.style.top = this.upperCanvas.style.top = (this.element.clientHeight - this.toolbarHeight - parseInt(this.lowerCanvas.style.maxHeight, 10)) / 2 + 1 + 'px';
6417
+ this.lowerContext.drawImage(this.inMemoryCanvas, -this.lowerCanvas.height / 2, -this.lowerCanvas.width / 2);
6418
+ if (degree > 0) {
6419
+ this.lowerContext.rotate(Math.PI / 180 * -90);
6420
+ }
6421
+ else {
6422
+ this.lowerContext.rotate(Math.PI / 180 * 90);
6423
+ }
6424
+ this.lowerContext.translate(-this.lowerCanvas.width / 2, -this.lowerCanvas.height / 2);
6425
+ this.lowerContext.restore();
6426
+ this.currImgData = this.lowerContext.getImageData(0, 0, this.lowerCanvas.width, this.lowerCanvas.height);
6427
+ this.inMemoryContext.clearRect(0, 0, this.lowerCanvas.width, this.lowerCanvas.height);
6428
+ this.inMemoryCanvas.width = this.currImgData.width;
6429
+ this.inMemoryCanvas.height = this.currImgData.height;
6430
+ this.inMemoryContext.putImageData(this.currImgData, 0, 0);
6431
+ this.lowerContext.drawImage(this.inMemoryCanvas, 0, 0);
6432
+ if (degree > 0) {
6433
+ this.redrawObj(90);
6434
+ }
6435
+ else {
6436
+ this.redrawObj(-90);
6437
+ }
6438
+ }
6439
+ };
6453
6440
  /**
6454
6441
  * Clear a current selection.
6455
6442
  *
@@ -6898,8 +6885,6 @@ var ImageEditor = /** @class */ (function (_super) {
6898
6885
  isRotate = true;
6899
6886
  var transitionArgs = { degree: degree };
6900
6887
  this.trigger('rotating', transitionArgs);
6901
- this.rotateMethod = true;
6902
- this.lastAction = 'rotate';
6903
6888
  var splitWords = [];
6904
6889
  var activeObjShape = void 0;
6905
6890
  if (!isNullOrUndefined(this.activeObj.activePoint)) {
@@ -6911,32 +6896,40 @@ var ImageEditor = /** @class */ (function (_super) {
6911
6896
  }
6912
6897
  }
6913
6898
  this.redrawActObj();
6899
+ var factor = this.factor;
6914
6900
  if (this.factor !== 1) {
6915
6901
  this.lowerContext.setTransform(1, 0, 0, 1, 0, 0);
6916
6902
  this.upperContext.setTransform(1, 0, 0, 1, 0, 0);
6917
6903
  this.factor = 1;
6918
6904
  this.refreshToolbar('main');
6919
6905
  }
6920
- this.degree += degree;
6921
- if (this.degree === 360) {
6922
- this.degree = 0;
6906
+ var length_1 = Math.abs(degree / 90);
6907
+ if (length_1 > 1) {
6908
+ this.rotateMultiple(length_1, degree);
6909
+ }
6910
+ else {
6911
+ this.degree += degree;
6912
+ if (this.degree === 360) {
6913
+ this.degree = 0;
6914
+ }
6915
+ this.lowerContext.save();
6916
+ this.setMaximumDimension(this.degree);
6917
+ this.lowerContext.translate(this.lowerCanvas.width / 2, this.lowerCanvas.height / 2);
6918
+ this.lowerContext.rotate(Math.PI / 180 * degree);
6919
+ this.lowerCanvas.style.left = this.upperCanvas.style.left = (this.element.clientWidth - parseInt(this.lowerCanvas.style.maxWidth, 10) - 18) / 2 + 1 + 'px';
6920
+ this.lowerCanvas.style.top = this.upperCanvas.style.top = (this.element.clientHeight - this.toolbarHeight - parseInt(this.lowerCanvas.style.maxHeight, 10)) / 2 + 1 + 'px';
6921
+ this.lowerContext.drawImage(this.inMemoryCanvas, -this.lowerCanvas.height / 2, -this.lowerCanvas.width / 2);
6922
+ this.lowerContext.rotate(Math.PI / 180 * -degree);
6923
+ this.lowerContext.translate(-this.lowerCanvas.width / 2, -this.lowerCanvas.height / 2);
6924
+ this.lowerContext.restore();
6925
+ this.currImgData = this.lowerContext.getImageData(0, 0, this.lowerCanvas.width, this.lowerCanvas.height);
6926
+ this.inMemoryContext.clearRect(0, 0, this.lowerCanvas.width, this.lowerCanvas.height);
6927
+ this.inMemoryCanvas.width = this.currImgData.width;
6928
+ this.inMemoryCanvas.height = this.currImgData.height;
6929
+ this.inMemoryContext.putImageData(this.currImgData, 0, 0);
6930
+ this.lowerContext.drawImage(this.inMemoryCanvas, 0, 0);
6931
+ this.redrawObj(degree);
6923
6932
  }
6924
- this.lowerContext.save();
6925
- this.setMaximumDimension(this.degree);
6926
- this.lowerContext.translate(this.lowerCanvas.width / 2, this.lowerCanvas.height / 2);
6927
- this.lowerContext.rotate(Math.PI / 180 * degree);
6928
- this.lowerCanvas.style.left = this.upperCanvas.style.left = (this.element.clientWidth - parseInt(this.lowerCanvas.style.maxWidth, 10) - 18) / 2 + 1 + 'px';
6929
- this.lowerCanvas.style.top = this.upperCanvas.style.top = (this.element.clientHeight - this.toolbarHeight - parseInt(this.lowerCanvas.style.maxHeight, 10)) / 2 + 1 + 'px';
6930
- this.lowerContext.drawImage(this.inMemoryCanvas, -this.lowerCanvas.height / 2, -this.lowerCanvas.width / 2);
6931
- this.lowerContext.rotate(Math.PI / 180 * -degree);
6932
- this.lowerContext.translate(-this.lowerCanvas.width / 2, -this.lowerCanvas.height / 2);
6933
- this.lowerContext.restore();
6934
- this.currImgData = this.lowerContext.getImageData(0, 0, this.lowerCanvas.width, this.lowerCanvas.height);
6935
- this.inMemoryContext.clearRect(0, 0, this.lowerCanvas.width, this.lowerCanvas.height);
6936
- this.inMemoryCanvas.width = this.currImgData.width;
6937
- this.inMemoryCanvas.height = this.currImgData.height;
6938
- this.inMemoryContext.putImageData(this.currImgData, 0, 0);
6939
- this.redrawObj(degree);
6940
6933
  if (!isNullOrUndefined(activeObjShape)) {
6941
6934
  if (activeObjShape === 'custom') {
6942
6935
  var endPoint = { x: this.lowerCanvas.width - this.pannEnd.startX, y: this.lowerCanvas.height - this.pannEnd.startY };
@@ -6952,11 +6945,11 @@ var ImageEditor = /** @class */ (function (_super) {
6952
6945
  }
6953
6946
  this.factor = 1;
6954
6947
  if (!this.isUndoRedo) {
6955
- this.updateUndoRedoColl('rotate', degree, this.objColl);
6948
+ this.updateUndoRedoColl('rotate', degree, this.objColl, null);
6956
6949
  }
6957
6950
  this.isUndoRedo = false;
6951
+ this.refreshToolbar('main');
6958
6952
  }
6959
- this.rotateMethod = false;
6960
6953
  return isRotate;
6961
6954
  };
6962
6955
  /**
@@ -6989,8 +6982,8 @@ var ImageEditor = /** @class */ (function (_super) {
6989
6982
  }
6990
6983
  type = type ? type : 'Png';
6991
6984
  this.redrawActObj();
6992
- var beforeSave = { cancel: false, fileName: 'ImageEditor', fileType: type };
6993
- var saved_1 = { fileName: 'ImageEditor', fileType: type };
6985
+ var beforeSave = { cancel: false, fileName: fileName ? fileName : 'ImageEditor', fileType: type };
6986
+ var saved_1 = { fileName: fileName ? fileName : 'ImageEditor', fileType: type };
6994
6987
  this.trigger('beforeSave', beforeSave, function (observableSaveArgs) {
6995
6988
  if (!observableSaveArgs.cancel) {
6996
6989
  fileName = observableSaveArgs.fileName ? observableSaveArgs.fileName : fileName;
@@ -7100,7 +7093,8 @@ var ImageEditor = /** @class */ (function (_super) {
7100
7093
  *
7101
7094
  * @param {boolean} value - Specifies a value whether enable or disable freehand drawing.
7102
7095
  *
7103
- * @returns {void}.
7096
+ * @returns {void}.
7097
+ * @private
7104
7098
  */
7105
7099
  ImageEditor.prototype.freeHandDraw = function (value) {
7106
7100
  if (value) {
@@ -7114,6 +7108,16 @@ var ImageEditor = /** @class */ (function (_super) {
7114
7108
  }
7115
7109
  this.refreshToolbar('pen');
7116
7110
  };
7111
+ /**
7112
+ * Enable or disable a freehand drawing in an Image Editor.
7113
+ *
7114
+ * @param {boolean} value - Specifies a value whether enable or disable freehand drawing.
7115
+ *
7116
+ * @returns {void}.
7117
+ */
7118
+ ImageEditor.prototype.freehandDraw = function (value) {
7119
+ this.freeHandDraw(value);
7120
+ };
7117
7121
  /**
7118
7122
  * Enable or disable a panning on the Image Editor.
7119
7123
  *
@@ -7394,7 +7398,15 @@ var ImageEditor = /** @class */ (function (_super) {
7394
7398
  isSelected = true;
7395
7399
  this.activeObj = obj;
7396
7400
  this.redrawShape(this.activeObj);
7397
- this.refreshToolbar('shapes');
7401
+ if (this.activeObj.shape === 'text') {
7402
+ this.refreshToolbar('text');
7403
+ }
7404
+ else if (this.activeObj.shape === 'pen') {
7405
+ this.refreshToolbar('pen');
7406
+ }
7407
+ else {
7408
+ this.refreshToolbar('shapes');
7409
+ }
7398
7410
  this.updateToolbarItems(this.calcRatio());
7399
7411
  }
7400
7412
  return isSelected;
@@ -7506,7 +7518,7 @@ var ImageEditor = /** @class */ (function (_super) {
7506
7518
  * @private
7507
7519
  */
7508
7520
  ImageEditor.prototype.canUndo = function () {
7509
- return _super.prototype.canUndo.call(this);
7521
+ return false;
7510
7522
  };
7511
7523
  /**
7512
7524
  * To check whether the redo collection is empty or not.
@@ -7515,7 +7527,7 @@ var ImageEditor = /** @class */ (function (_super) {
7515
7527
  * @private
7516
7528
  */
7517
7529
  ImageEditor.prototype.canRedo = function () {
7518
- return _super.prototype.canRedo.call(this);
7530
+ return false;
7519
7531
  };
7520
7532
  /**
7521
7533
  * Erases all the signature strokes signed by user.
@@ -7524,7 +7536,9 @@ var ImageEditor = /** @class */ (function (_super) {
7524
7536
  * @private
7525
7537
  */
7526
7538
  ImageEditor.prototype.clear = function () {
7527
- _super.prototype.clear.call(this);
7539
+ if (this.getModuleName() !== 'image-editor') {
7540
+ _super.prototype.clear.call(this);
7541
+ }
7528
7542
  };
7529
7543
  /**
7530
7544
  * To draw the signature based on the given text, with the font family and font size.
@@ -7537,7 +7551,9 @@ var ImageEditor = /** @class */ (function (_super) {
7537
7551
  * @private
7538
7552
  */
7539
7553
  ImageEditor.prototype.draw = function (text, fontFamily, fontSize) {
7540
- _super.prototype.draw.call(this, text, fontFamily, fontSize);
7554
+ if (this.getModuleName() !== 'image-editor') {
7555
+ _super.prototype.draw.call(this, text, fontFamily, fontSize);
7556
+ }
7541
7557
  };
7542
7558
  /**
7543
7559
  * To get the signature as Blob.
@@ -7547,7 +7563,7 @@ var ImageEditor = /** @class */ (function (_super) {
7547
7563
  * @private
7548
7564
  */
7549
7565
  ImageEditor.prototype.getBlob = function (url) {
7550
- return _super.prototype.getBlob.call(this, url);
7566
+ return null;
7551
7567
  };
7552
7568
  /**
7553
7569
  * To check whether the signature is empty or not.
@@ -7556,7 +7572,7 @@ var ImageEditor = /** @class */ (function (_super) {
7556
7572
  * @private
7557
7573
  */
7558
7574
  ImageEditor.prototype.isEmpty = function () {
7559
- return _super.prototype.isEmpty.call(this);
7575
+ return false;
7560
7576
  };
7561
7577
  /**
7562
7578
  * To load the signature with the given base 64 string, height and width.
@@ -7568,7 +7584,9 @@ var ImageEditor = /** @class */ (function (_super) {
7568
7584
  * @private
7569
7585
  */
7570
7586
  ImageEditor.prototype.load = function (signature, width, height) {
7571
- _super.prototype.load.call(this, signature, width, height);
7587
+ if (this.getModuleName() !== 'image-editor') {
7588
+ _super.prototype.load.call(this, signature, width, height);
7589
+ }
7572
7590
  };
7573
7591
  /**
7574
7592
  * Undo the last user action.
@@ -7577,7 +7595,9 @@ var ImageEditor = /** @class */ (function (_super) {
7577
7595
  * @private
7578
7596
  */
7579
7597
  ImageEditor.prototype.undo = function () {
7580
- _super.prototype.undo.call(this);
7598
+ if (this.getModuleName() !== 'image-editor') {
7599
+ _super.prototype.undo.call(this);
7600
+ }
7581
7601
  };
7582
7602
  /**
7583
7603
  * Redo the last user action.
@@ -7586,7 +7606,9 @@ var ImageEditor = /** @class */ (function (_super) {
7586
7606
  * @private
7587
7607
  */
7588
7608
  ImageEditor.prototype.redo = function () {
7589
- _super.prototype.redo.call(this);
7609
+ if (this.getModuleName() !== 'image-editor') {
7610
+ _super.prototype.redo.call(this);
7611
+ }
7590
7612
  };
7591
7613
  /**
7592
7614
  * To save the signature with the given file type and file name.
@@ -7598,7 +7620,9 @@ var ImageEditor = /** @class */ (function (_super) {
7598
7620
  * @private
7599
7621
  */
7600
7622
  ImageEditor.prototype.save = function (type, fileName) {
7601
- _super.prototype.save.call(this, type, fileName);
7623
+ if (this.getModuleName() !== 'image-editor') {
7624
+ _super.prototype.save.call(this, type, fileName);
7625
+ }
7602
7626
  };
7603
7627
  /**
7604
7628
  * To save the signature as Blob.
@@ -7607,7 +7631,7 @@ var ImageEditor = /** @class */ (function (_super) {
7607
7631
  * @private
7608
7632
  */
7609
7633
  ImageEditor.prototype.saveAsBlob = function () {
7610
- return _super.prototype.saveAsBlob.call(this);
7634
+ return null;
7611
7635
  };
7612
7636
  /**
7613
7637
  * Returns the persistence data for component.
@@ -7616,7 +7640,7 @@ var ImageEditor = /** @class */ (function (_super) {
7616
7640
  * @private
7617
7641
  */
7618
7642
  ImageEditor.prototype.getLocalData = function () {
7619
- return _super.prototype.getLocalData.call(this);
7643
+ return null;
7620
7644
  };
7621
7645
  var ImageEditor_1;
7622
7646
  __decorate([
@@ -5,6 +5,7 @@
5
5
  @import 'ej2-inputs/styles/textbox/bootstrap-dark-definition.scss';
6
6
  @import 'ej2-inputs/styles/uploader/bootstrap-dark-definition.scss';
7
7
  @import 'ej2-popups/styles/tooltip/bootstrap-dark-definition.scss';
8
+ @import 'ej2-inputs/styles/color-picker/bootstrap-dark-definition.scss';
8
9
  @import 'ej2-navigations/styles/toolbar/bootstrap-dark-definition.scss';
9
10
  @import 'ej2-popups/styles/spinner/bootstrap-dark-definition.scss';
10
11
  @import 'bootstrap-dark-definition.scss';
@@ -5,6 +5,7 @@
5
5
  @import 'ej2-inputs/styles/textbox/bootstrap-definition.scss';
6
6
  @import 'ej2-inputs/styles/uploader/bootstrap-definition.scss';
7
7
  @import 'ej2-popups/styles/tooltip/bootstrap-definition.scss';
8
+ @import 'ej2-inputs/styles/color-picker/bootstrap-definition.scss';
8
9
  @import 'ej2-navigations/styles/toolbar/bootstrap-definition.scss';
9
10
  @import 'ej2-popups/styles/spinner/bootstrap-definition.scss';
10
11
  @import 'bootstrap-definition.scss';
@@ -5,6 +5,7 @@
5
5
  @import 'ej2-inputs/styles/textbox/bootstrap4-definition.scss';
6
6
  @import 'ej2-inputs/styles/uploader/bootstrap4-definition.scss';
7
7
  @import 'ej2-popups/styles/tooltip/bootstrap4-definition.scss';
8
+ @import 'ej2-inputs/styles/color-picker/bootstrap4-definition.scss';
8
9
  @import 'ej2-navigations/styles/toolbar/bootstrap4-definition.scss';
9
10
  @import 'ej2-popups/styles/spinner/bootstrap4-definition.scss';
10
11
  @import 'bootstrap4-definition.scss';
@@ -5,6 +5,7 @@
5
5
  @import 'ej2-inputs/styles/textbox/bootstrap5-dark-definition.scss';
6
6
  @import 'ej2-inputs/styles/uploader/bootstrap5-dark-definition.scss';
7
7
  @import 'ej2-popups/styles/tooltip/bootstrap5-dark-definition.scss';
8
+ @import 'ej2-inputs/styles/color-picker/bootstrap5-dark-definition.scss';
8
9
  @import 'ej2-navigations/styles/toolbar/bootstrap5-dark-definition.scss';
9
10
  @import 'ej2-popups/styles/spinner/bootstrap5-dark-definition.scss';
10
11
  @import 'bootstrap5-dark-definition.scss';
@@ -5,6 +5,7 @@
5
5
  @import 'ej2-inputs/styles/textbox/bootstrap5-definition.scss';
6
6
  @import 'ej2-inputs/styles/uploader/bootstrap5-definition.scss';
7
7
  @import 'ej2-popups/styles/tooltip/bootstrap5-definition.scss';
8
+ @import 'ej2-inputs/styles/color-picker/bootstrap5-definition.scss';
8
9
  @import 'ej2-navigations/styles/toolbar/bootstrap5-definition.scss';
9
10
  @import 'ej2-popups/styles/spinner/bootstrap5-definition.scss';
10
11
  @import 'bootstrap5-definition.scss';
@@ -5,6 +5,7 @@
5
5
  @import 'ej2-inputs/styles/textbox/fabric-dark-definition.scss';
6
6
  @import 'ej2-inputs/styles/uploader/fabric-dark-definition.scss';
7
7
  @import 'ej2-popups/styles/tooltip/fabric-dark-definition.scss';
8
+ @import 'ej2-inputs/styles/color-picker/fabric-dark-definition.scss';
8
9
  @import 'ej2-navigations/styles/toolbar/fabric-dark-definition.scss';
9
10
  @import 'ej2-popups/styles/spinner/fabric-dark-definition.scss';
10
11
  @import 'fabric-dark-definition.scss';
@@ -5,6 +5,7 @@
5
5
  @import 'ej2-inputs/styles/textbox/fabric-definition.scss';
6
6
  @import 'ej2-inputs/styles/uploader/fabric-definition.scss';
7
7
  @import 'ej2-popups/styles/tooltip/fabric-definition.scss';
8
+ @import 'ej2-inputs/styles/color-picker/fabric-definition.scss';
8
9
  @import 'ej2-navigations/styles/toolbar/fabric-definition.scss';
9
10
  @import 'ej2-popups/styles/spinner/fabric-definition.scss';
10
11
  @import 'fabric-definition.scss';
@@ -5,6 +5,7 @@
5
5
  @import 'ej2-inputs/styles/textbox/fluent-dark-definition.scss';
6
6
  @import 'ej2-inputs/styles/uploader/fluent-dark-definition.scss';
7
7
  @import 'ej2-popups/styles/tooltip/fluent-dark-definition.scss';
8
+ @import 'ej2-inputs/styles/color-picker/fluent-dark-definition.scss';
8
9
  @import 'ej2-navigations/styles/toolbar/fluent-dark-definition.scss';
9
10
  @import 'ej2-popups/styles/spinner/fluent-dark-definition.scss';
10
11
  @import 'fluent-dark-definition.scss';
@@ -5,6 +5,7 @@
5
5
  @import 'ej2-inputs/styles/textbox/fluent-definition.scss';
6
6
  @import 'ej2-inputs/styles/uploader/fluent-definition.scss';
7
7
  @import 'ej2-popups/styles/tooltip/fluent-definition.scss';
8
+ @import 'ej2-inputs/styles/color-picker/fluent-definition.scss';
8
9
  @import 'ej2-navigations/styles/toolbar/fluent-definition.scss';
9
10
  @import 'ej2-popups/styles/spinner/fluent-definition.scss';
10
11
  @import 'fluent-definition.scss';