@syncfusion/ej2-image-editor 23.2.5 → 23.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 23.2.5
3
+ * version : 23.2.7
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-image-editor@*",
3
- "_id": "@syncfusion/ej2-image-editor@23.2.4",
3
+ "_id": "@syncfusion/ej2-image-editor@23.2.6",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-I4as+N/x0dKzKJU//hvvuAqcU1Ux9TWdDtsSEHiYqtDL4e2pmY5sF+1l+dp/ZAIy7/qVC/okaEP/i9LNDJqciQ==",
5
+ "_integrity": "sha512-RP/xIi6rWDW3xEdVwXpCJbbYUkZLXBPl3yMd75ep5PS7/CxFhDon95uL0dEMLC67CBRgGAa0i+WIgzHaj99lPg==",
6
6
  "_location": "/@syncfusion/ej2-image-editor",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,8 +23,8 @@
23
23
  "/@syncfusion/ej2-react-image-editor",
24
24
  "/@syncfusion/ej2-vue-image-editor"
25
25
  ],
26
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-23.2.4.tgz",
27
- "_shasum": "8cb435fac82ccfec5a3cba0a7d86d2eaa11ef074",
26
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-23.2.6.tgz",
27
+ "_shasum": "291bd6b3ae2ea5c346fb23a4896592267d767594",
28
28
  "_spec": "@syncfusion/ej2-image-editor@*",
29
29
  "_where": "/jenkins/workspace/elease-automation_release_23.1.1/packages/included",
30
30
  "author": {
@@ -32,10 +32,10 @@
32
32
  },
33
33
  "bundleDependencies": false,
34
34
  "dependencies": {
35
- "@syncfusion/ej2-base": "~23.2.4",
36
- "@syncfusion/ej2-buttons": "~23.2.4",
35
+ "@syncfusion/ej2-base": "~23.2.6",
36
+ "@syncfusion/ej2-buttons": "~23.2.7",
37
37
  "@syncfusion/ej2-inputs": "~23.2.4",
38
- "@syncfusion/ej2-navigations": "~23.2.5",
38
+ "@syncfusion/ej2-navigations": "~23.2.7",
39
39
  "@syncfusion/ej2-popups": "~23.2.4",
40
40
  "@syncfusion/ej2-splitbuttons": "~23.2.4"
41
41
  },
@@ -67,7 +67,7 @@
67
67
  "url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/imageeditor"
68
68
  },
69
69
  "typings": "index.d.ts",
70
- "version": "23.2.5",
70
+ "version": "23.2.7",
71
71
  "sideEffects": false,
72
72
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
73
73
  }
@@ -1068,8 +1068,14 @@ var FreehandDrawing = /** @class */ (function () {
1068
1068
  if (isBlazor() && parent.events && parent.events.shapeChanging.hasDelegate === true) {
1069
1069
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
1070
1070
  parent.dotNetRef.invokeMethodAsync('ShapeEventAsync', 'OnShape', shapeChangingArgs).then(function (shapeChangingArgs) {
1071
- parent.activeObj.strokeSettings.strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
1072
1071
  _this.penStrokeWidth = shapeChangingArgs.currentShapeSettings.strokeWidth;
1072
+ if (parent.activeObj.strokeSettings.strokeColor !== shapeChangingArgs.currentShapeSettings.strokeColor) {
1073
+ parent.activeObj.strokeSettings.strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
1074
+ var penColorElement = parent.element.querySelector('.e-ie-toolbar-e-pen-color .e-dropdownbtn-preview');
1075
+ if (penColorElement) {
1076
+ penColorElement.style.background = shapeChangingArgs.currentShapeSettings.strokeColor;
1077
+ }
1078
+ }
1073
1079
  if (_this.fhdSelID) {
1074
1080
  parent.pointColl[_this.fhdSelIdx].strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
1075
1081
  parent.pointColl[_this.fhdSelIdx].strokeWidth = shapeChangingArgs.currentShapeSettings.strokeWidth;
@@ -1084,8 +1090,11 @@ var FreehandDrawing = /** @class */ (function () {
1084
1090
  }
1085
1091
  else {
1086
1092
  parent.trigger('shapeChanging', shapeChangingArgs);
1087
- parent.activeObj.strokeSettings.strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
1088
1093
  this.penStrokeWidth = shapeChangingArgs.currentShapeSettings.strokeWidth;
1094
+ if (parent.activeObj.strokeSettings.strokeColor !== shapeChangingArgs.currentShapeSettings.strokeColor) {
1095
+ parent.activeObj.strokeSettings.strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
1096
+ parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
1097
+ }
1089
1098
  if (this.fhdSelID) {
1090
1099
  parent.pointColl[this.fhdSelIdx].strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
1091
1100
  parent.pointColl[this.fhdSelIdx].strokeWidth = shapeChangingArgs.currentShapeSettings.strokeWidth;
@@ -143,4 +143,5 @@ export declare class Selection {
143
143
  private getRectanglePoints;
144
144
  private getTransRotationPoint;
145
145
  private getNumTextValue;
146
+ private isValueUpdated;
146
147
  }
@@ -3920,6 +3920,10 @@ var Selection = /** @class */ (function () {
3920
3920
  Selection.prototype.performEnterAction = function (e) {
3921
3921
  var parent = this.parent;
3922
3922
  if (parent.isResize) {
3923
+ var isValue = this.isValueUpdated();
3924
+ if (!isValue) {
3925
+ return;
3926
+ }
3923
3927
  var point = this.getNumTextValue();
3924
3928
  var aspectRatioElement = this.parent.element.querySelector('#' + this.parent.element.id + '_aspectratio');
3925
3929
  var blrAspRatElem = this.parent.element.querySelector('.e-ie-toolbar-aspect-ratio-btn');
@@ -3949,15 +3953,19 @@ var Selection = /** @class */ (function () {
3949
3953
  var aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
3950
3954
  var aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
3951
3955
  if (isNullOrUndefined(aspectRatioElement)) {
3952
- var elem = getComponent(aspectRatioHeight, 'numerictextbox');
3953
- if (aspectRatioHeight && isNullOrUndefined(elem.value)) {
3954
- elem.value = parseFloat(elem.placeholder);
3955
- aspectRatioHeight.value = Math.floor(parent.img.destHeight).toString() + ' px';
3956
+ if (aspectRatioHeight) {
3957
+ var elem = getComponent(aspectRatioHeight, 'numerictextbox');
3958
+ if (aspectRatioHeight && isNullOrUndefined(elem.value)) {
3959
+ elem.value = parseFloat(elem.placeholder);
3960
+ aspectRatioHeight.value = Math.floor(parent.img.destHeight).toString() + ' px';
3961
+ }
3956
3962
  }
3957
- elem = getComponent(aspectRatioWidth, 'numerictextbox');
3958
- if (aspectRatioWidth && isNullOrUndefined(elem.value)) {
3959
- elem.value = parseFloat(elem.placeholder);
3960
- aspectRatioWidth.value = Math.floor(parent.img.destWidth).toString() + ' px';
3963
+ if (aspectRatioWidth) {
3964
+ var elem = getComponent(aspectRatioWidth, 'numerictextbox');
3965
+ if (aspectRatioWidth && isNullOrUndefined(elem.value)) {
3966
+ elem.value = parseFloat(elem.placeholder);
3967
+ aspectRatioWidth.value = Math.floor(parent.img.destWidth).toString() + ' px';
3968
+ }
3961
3969
  }
3962
3970
  }
3963
3971
  }
@@ -4934,6 +4942,25 @@ var Selection = /** @class */ (function () {
4934
4942
  }
4935
4943
  return { x: width, y: height };
4936
4944
  };
4945
+ Selection.prototype.isValueUpdated = function () {
4946
+ var isValue = true;
4947
+ var widthElement;
4948
+ var heightElement;
4949
+ if (!isBlazor()) {
4950
+ widthElement = this.parent.element.querySelector('#' + this.parent.element.id + '_resizeWidth');
4951
+ heightElement = this.parent.element.querySelector('#' + this.parent.element.id + '_resizeHeight');
4952
+ }
4953
+ else {
4954
+ widthElement = this.parent.element.querySelector('.e-ie-toolbar-e-resize-width-input .e-numerictextbox');
4955
+ heightElement = this.parent.element.querySelector('.e-ie-toolbar-e-resize-height-input .e-numerictextbox');
4956
+ }
4957
+ if (widthElement && heightElement) {
4958
+ if (heightElement.value.replace(/,/g, '') === '' && widthElement.value.replace(/,/g, '') === '') {
4959
+ isValue = false;
4960
+ }
4961
+ }
4962
+ return isValue;
4963
+ };
4937
4964
  return Selection;
4938
4965
  }());
4939
4966
  export { Selection };
@@ -1528,7 +1528,8 @@ var Transform = /** @class */ (function () {
1528
1528
  }
1529
1529
  };
1530
1530
  Transform.prototype.getCurrentZoomFactor = function (zoomFactor) {
1531
- return (zoomFactor - this.prevZoomValue) * 0.1;
1531
+ return zoomFactor >= 1 ? (this.prevZoomValue < 1 ? (zoomFactor - this.prevZoomValue) : (zoomFactor - this.prevZoomValue) * 0.1) :
1532
+ (zoomFactor - this.prevZoomValue);
1532
1533
  };
1533
1534
  Transform.prototype.setCurrPanRegion = function (region, type, obj) {
1534
1535
  var panRegion = region;
@@ -999,6 +999,7 @@ var ImageEditor = /** @class */ (function (_super) {
999
999
  this.currentFilter = '';
1000
1000
  this.tempFrameZoomLevel = null;
1001
1001
  this.cxtTbarHeight = null;
1002
+ this.aspectWidth = this.aspectHeight = null;
1002
1003
  var obj_1 = { initialZoomValue: false };
1003
1004
  this.notify('draw', { prop: 'getInitialZoomValue', onPropertyChange: false, value: { obj: obj_1 } });
1004
1005
  if (obj_1['initialZoomValue']) {
@@ -832,13 +832,17 @@ var ToolbarModule = /** @class */ (function () {
832
832
  ToolbarModule.prototype.getResizeToolbarItem = function () {
833
833
  var toolbarItems = [];
834
834
  var isResize = this.parent.aspectWidth && this.parent.aspectHeight ? true : false;
835
+ var width = this.parent.transform.degree % 90 === 0 && this.parent.transform.degree % 180 !== 0 ?
836
+ Math.ceil(this.parent.img.srcHeight).toString() : Math.ceil(this.parent.img.srcWidth).toString();
837
+ var height = this.parent.transform.degree % 90 === 0 && this.parent.transform.degree % 180 !== 0 ?
838
+ Math.ceil(this.parent.img.srcWidth).toString() : Math.ceil(this.parent.img.srcHeight).toString();
835
839
  var spanWidth = document.createElement('span');
836
840
  spanWidth.innerHTML = this.l10n.getConstant('W');
837
841
  toolbarItems.push({ id: this.parent.element.id + '_width', cssClass: 'e-ie-resize-width', template: spanWidth, align: 'Center' });
838
842
  toolbarItems.push({ id: this.parent.element.id + '_resizeWidth', prefixIcon: 'e-icons e-anti-clock-wise',
839
843
  tooltipText: this.l10n.getConstant('Width'), align: 'Center', type: 'Input', template: new NumericTextBox({ width: 75, htmlAttributes: { maxLength: "4" },
840
844
  showSpinButton: false, value: isResize ? this.parent.aspectWidth : null,
841
- placeholder: isResize ? null : Math.ceil(this.parent.img.srcWidth).toString(), format: '###.## px' })
845
+ placeholder: isResize ? null : width, format: '###.## px' })
842
846
  });
843
847
  var spanHeight = document.createElement('span');
844
848
  spanHeight.innerHTML = this.l10n.getConstant('H');
@@ -846,7 +850,7 @@ var ToolbarModule = /** @class */ (function () {
846
850
  toolbarItems.push({ id: this.parent.element.id + '_resizeHeight', prefixIcon: 'e-icons e-clock-wise',
847
851
  tooltipText: this.l10n.getConstant('Height'), align: 'Center', type: 'Input', template: new NumericTextBox({ width: 75, htmlAttributes: { maxLength: "4" },
848
852
  showSpinButton: false, value: isResize ? this.parent.aspectHeight : null,
849
- placeholder: isResize ? null : Math.ceil(this.parent.img.srcHeight).toString(), format: '###.## px' })
853
+ placeholder: isResize ? null : height, format: '###.## px' })
850
854
  });
851
855
  if (!this.isAspectRatio) {
852
856
  toolbarItems.push({ id: this.parent.element.id + '_aspectratio', prefixIcon: 'e-icons e-lock', align: 'Center', tooltipText: this.l10n.getConstant('AspectRatio'), type: 'Button' });