@syncfusion/ej2-image-editor 27.1.50 → 27.1.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 27.1.50
3
+ * version : 27.1.52
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@27.1.48",
3
+ "_id": "@syncfusion/ej2-image-editor@27.1.51",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-hQ/OaazltLroOclcaVb3qFLJxr0+WHINAZ/gJWrvlOQn56aFv72Gmkp9Rp8SEnxxoYLVzMH1M7IwXI2HRQxXRw==",
5
+ "_integrity": "sha512-D2co3Roz/iOn3T1Ef3sXGpOukufgf2f3UqrUr1mYn4nm42eVAZ/RutRLdRXFBGMQa9NZ3h5p8VwCWpV43HXYGg==",
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.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-27.1.48.tgz",
27
- "_shasum": "e9c055d422f49914b4b0fbcb79ebe1bd8529fdea",
26
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-27.1.51.tgz",
27
+ "_shasum": "352f528238cdecb1dccbadc4df5f2dd8ccd50f9a",
28
28
  "_spec": "@syncfusion/ej2-image-editor@*",
29
29
  "_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
30
30
  "author": {
@@ -32,11 +32,11 @@
32
32
  },
33
33
  "bundleDependencies": false,
34
34
  "dependencies": {
35
- "@syncfusion/ej2-base": "~27.1.50",
36
- "@syncfusion/ej2-buttons": "~27.1.50",
37
- "@syncfusion/ej2-dropdowns": "~27.1.50",
35
+ "@syncfusion/ej2-base": "~27.1.52",
36
+ "@syncfusion/ej2-buttons": "~27.1.51",
37
+ "@syncfusion/ej2-dropdowns": "~27.1.52",
38
38
  "@syncfusion/ej2-inputs": "~27.1.50",
39
- "@syncfusion/ej2-navigations": "~27.1.50",
39
+ "@syncfusion/ej2-navigations": "~27.1.52",
40
40
  "@syncfusion/ej2-popups": "~27.1.50",
41
41
  "@syncfusion/ej2-splitbuttons": "~27.1.50"
42
42
  },
@@ -68,7 +68,7 @@
68
68
  "url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/imageeditor"
69
69
  },
70
70
  "typings": "index.d.ts",
71
- "version": "27.1.50",
71
+ "version": "27.1.52",
72
72
  "sideEffects": false,
73
73
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
74
74
  }
@@ -1094,7 +1094,7 @@ var Draw = /** @class */ (function () {
1094
1094
  }
1095
1095
  this.drawArrowHead(canvasDraw, true);
1096
1096
  this.drawArrowHead(canvasDraw, false);
1097
- if (actObj.end === 'none') {
1097
+ if (actObj.end === 'none' && actObj.start !== 'circle' && actObj.start !== 'square') {
1098
1098
  this.shapeLine(canvasDraw, actPoint.startX, actPoint.startY, actPoint.endX, actPoint.endY);
1099
1099
  }
1100
1100
  canvasDraw.fillStyle = tempFillStyle;
@@ -1498,9 +1498,10 @@ var Draw = /** @class */ (function () {
1498
1498
  var isStartArrow = actObj.start === 'arrow';
1499
1499
  var isEndArrow = actObj.end === 'arrow';
1500
1500
  var isEndCircleOrSquare = actObj.end === 'circle' || actObj.end === 'square';
1501
+ var isStartCircleOrSquare = actObj.start === 'circle' || actObj.start === 'square';
1501
1502
  if ((start && actObj.triangleDirection === 'left' || actObj.triangleDirection === 'right') &&
1502
- ((isStartArrow && actObj.end === 'none') || (isStartArrow && !isEndCircleOrSquare)) ||
1503
- (!start && (isEndArrow && actObj.start === 'none' || !isStartArrow && !isEndCircleOrSquare))) {
1503
+ ((isStartArrow && actObj.end === 'none') || (isStartArrow && !isEndCircleOrSquare && !isStartCircleOrSquare)) ||
1504
+ (!start && (isEndArrow && actObj.start === 'none' || !isStartArrow && !isEndCircleOrSquare && !isStartCircleOrSquare))) {
1504
1505
  this.shapeLine(canvasDraw, startX, startY, endX, endY);
1505
1506
  }
1506
1507
  if ((start && actObj.triangleDirection === 'left') || (!start && actObj.triangleDirection === 'right')) {
@@ -1535,9 +1536,10 @@ var Draw = /** @class */ (function () {
1535
1536
  var angle = Math.atan2(this.dy, this.dx);
1536
1537
  var isStartArrowSolid = actObj.start === 'arrowSolid';
1537
1538
  var isEndArrowSolid = actObj.end === 'arrowSolid';
1539
+ var isStartCircleOrSquare = actObj.start === 'circle' || actObj.start === 'square';
1538
1540
  var isEndCircleOrSquare = actObj.end === 'circle' || actObj.end === 'square';
1539
- if ((start && (isStartArrowSolid && actObj.end === 'none') || (isStartArrowSolid && !isEndCircleOrSquare)) ||
1540
- (!start && (isEndArrowSolid && actObj.start === 'none' || !isStartArrowSolid && !isEndCircleOrSquare))) {
1541
+ if ((start && (isStartArrowSolid && actObj.end === 'none') || (isStartArrowSolid && !isEndCircleOrSquare && !isStartCircleOrSquare)) ||
1542
+ (!start && (isEndArrowSolid && actObj.start === 'none' || !isStartArrowSolid && !isEndCircleOrSquare && !isStartCircleOrSquare))) {
1541
1543
  this.shapeLine(canvasDraw, startX, startY, endX, endY);
1542
1544
  }
1543
1545
  if ((start && actObj.triangleDirection === 'left') || (!start && actObj.triangleDirection === 'right')) {
@@ -2106,12 +2108,7 @@ var Draw = /** @class */ (function () {
2106
2108
  var coll = actObj.rotateFlipColl[i];
2107
2109
  tempColl.push(coll);
2108
2110
  if (typeof (coll) === 'number') {
2109
- if (actObj.shapeDegree === 0) {
2110
- tempDegree = coll;
2111
- }
2112
- else {
2113
- tempDegree = coll - actObj.shapeDegree;
2114
- }
2111
+ tempDegree = coll;
2115
2112
  if (tempDegree === -450) {
2116
2113
  tempDegree = -90;
2117
2114
  }
@@ -2211,12 +2208,7 @@ var Draw = /** @class */ (function () {
2211
2208
  var coll = actObj.rotateFlipColl[i];
2212
2209
  tempColl.push(coll);
2213
2210
  if (typeof (coll) === 'number') {
2214
- if (actObj.shapeDegree === 0) {
2215
- tempDegree = coll;
2216
- }
2217
- else {
2218
- tempDegree = coll - actObj.shapeDegree;
2219
- }
2211
+ tempDegree = coll;
2220
2212
  if (tempDegree === -450) {
2221
2213
  tempDegree = -90;
2222
2214
  }
@@ -657,7 +657,7 @@ var Filter = /** @class */ (function () {
657
657
  Filter.prototype.parseFilterString = function (filterString) {
658
658
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
659
659
  var filterArray = [];
660
- if (filterString !== 'none') {
660
+ if (filterString && filterString !== 'none') {
661
661
  filterArray = filterString.split(' ').map(function (filter) {
662
662
  var _a = filter.match(/([a-z-]+)\(([^)]+)\)/).slice(1, 3), name = _a[0], value = _a[1];
663
663
  return { filter: name, value: value };
@@ -3265,6 +3265,7 @@ var Selection = /** @class */ (function () {
3265
3265
  this.triggerShapeChange(shapeResizingArgs, shapeMovingArgs, 'mouse-down');
3266
3266
  parent.activeObj.activePoint = activePoint;
3267
3267
  parent.isShapeDrawing = true;
3268
+ this.tempActiveObj = extend({}, parent.activeObj, {}, true);
3268
3269
  return;
3269
3270
  }
3270
3271
  parent.notify('draw', { prop: 'resetFrameZoom', onPropertyChange: false, value: { isOk: true } });
@@ -1103,12 +1103,22 @@ var UndoRedo = /** @class */ (function () {
1103
1103
  var parent = this.parent;
1104
1104
  for (var i = 0; i < parent.objColl.length; i++) {
1105
1105
  var obj = parent.objColl[i];
1106
+ var isUpdated = false;
1106
1107
  if (obj.shape === 'line' || obj.shape === 'arrow') {
1107
1108
  if (obj.activePoint.width < 0) {
1108
1109
  obj.activePoint.width = Math.abs(obj.activePoint.width);
1110
+ isUpdated = true;
1109
1111
  }
1110
1112
  if (obj.activePoint.height < 0) {
1111
1113
  obj.activePoint.height = Math.abs(obj.activePoint.height);
1114
+ isUpdated = true;
1115
+ }
1116
+ if (isUpdated) {
1117
+ var activeObj = extend({}, parent.activeObj, {}, true);
1118
+ parent.activeObj = obj;
1119
+ parent.notify('shape', { prop: 'updImgRatioForActObj', onPropertyChange: false });
1120
+ obj = parent.activeObj;
1121
+ parent.activeObj = activeObj;
1112
1122
  }
1113
1123
  }
1114
1124
  }
@@ -1390,6 +1390,9 @@ var ToolbarModule = /** @class */ (function () {
1390
1390
  zOrderElement.classList.remove('e-overlay');
1391
1391
  }
1392
1392
  }
1393
+ if (zOrderElement && (parent.shapeColl.length === 0 || (obj['freehandDrawSelectedId'] && parent.shapeColl.length === 1))) {
1394
+ zOrderElement.classList.add('e-overlay');
1395
+ }
1393
1396
  };
1394
1397
  ToolbarModule.prototype.renderStraightenSlider = function () {
1395
1398
  var parent = this.parent;
@@ -1622,7 +1625,7 @@ var ToolbarModule = /** @class */ (function () {
1622
1625
  qualityOptionDiv.appendChild(parent.createElement('button', { id: id + '_qualitybuttonIcon', className: 'e-ie-img-icon-button', attrs: { type: 'button' } }));
1623
1626
  qualityNameDiv.appendChild(qualityOptionDiv);
1624
1627
  if (Browser.isDevice) {
1625
- qualityNameDiv.appendChild(parent.createElement('span', {
1628
+ dialogRightContent.appendChild(parent.createElement('span', {
1626
1629
  id: id + '_qualitySize', className: 'e-ie-img-quality-size'
1627
1630
  }));
1628
1631
  }
@@ -1859,11 +1862,11 @@ var ToolbarModule = /** @class */ (function () {
1859
1862
  fileSize = Math.floor(blob.size / 1024);
1860
1863
  if (fileSize > 1000) {
1861
1864
  var megabytes = fileSize / 1024;
1862
- imageNameLabel.innerHTML = 'Image size: ' + megabytes.toFixed(2) + ' MB';
1865
+ imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + megabytes.toFixed(2) + ' MB';
1863
1866
  fileSize = +megabytes.toFixed(2);
1864
1867
  }
1865
1868
  else {
1866
- imageNameLabel.innerHTML = 'Image size: ' + fileSize.toFixed(2) + ' KB';
1869
+ imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + fileSize.toFixed(2) + ' KB';
1867
1870
  fileSize = +fileSize.toFixed(2);
1868
1871
  }
1869
1872
  if (Browser.isDevice) {
@@ -1881,6 +1884,46 @@ var ToolbarModule = /** @class */ (function () {
1881
1884
  this.fileSize = fileSize;
1882
1885
  }).bind(this), 'image/jpeg', quality);
1883
1886
  }
1887
+ else if (!isNullOrUndefined(fileType) && fileType.toLowerCase() === 'png') {
1888
+ ctx.drawImage(tempCanvas, 0, 0);
1889
+ tempCanvas.toBlob((function (blob) {
1890
+ fileSize = Math.floor(blob.size / 1024);
1891
+ if (fileSize > 1000) {
1892
+ var megabytes = fileSize / 1024;
1893
+ imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + megabytes.toFixed(2) + ' MB';
1894
+ fileSize = +megabytes.toFixed(2);
1895
+ }
1896
+ else {
1897
+ imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + fileSize.toFixed(2) + ' KB';
1898
+ fileSize = +fileSize.toFixed(2);
1899
+ }
1900
+ if (Browser.isDevice) {
1901
+ canvas.style.display = 'none';
1902
+ }
1903
+ this.fileSize = fileSize;
1904
+ }).bind(this), 'image/png', 1);
1905
+ }
1906
+ else if (!isNullOrUndefined(fileType) && fileType.toLowerCase() === 'svg') {
1907
+ ctx.drawImage(tempCanvas, 0, 0);
1908
+ var svgDataUrl = tempCanvas.toDataURL('image/svg+xml');
1909
+ var base64Data = svgDataUrl.split(',')[1];
1910
+ var binaryStringLength = base64Data.length;
1911
+ var rawByteSize = binaryStringLength;
1912
+ var fileSize_1 = Math.floor(rawByteSize / 1024); // KB
1913
+ if (fileSize_1 > 1000) {
1914
+ var megabytes = fileSize_1 / 1024; // Convert to MB
1915
+ imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + megabytes.toFixed(2) + ' MB';
1916
+ fileSize_1 = +megabytes.toFixed(2);
1917
+ }
1918
+ else {
1919
+ imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + fileSize_1.toFixed(2) + ' KB';
1920
+ fileSize_1 = +fileSize_1.toFixed(2);
1921
+ }
1922
+ if (Browser.isDevice) {
1923
+ canvas.style.display = 'none';
1924
+ }
1925
+ this.fileSize = fileSize_1;
1926
+ }
1884
1927
  else {
1885
1928
  if (Browser.isDevice) {
1886
1929
  canvas.style.display = 'none';