@syncfusion/ej2-image-editor 27.1.50 → 27.1.51
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.
- package/dist/ej2-image-editor.umd.min.js +2 -2
- package/dist/ej2-image-editor.umd.min.js.map +1 -1
- package/dist/es6/ej2-image-editor.es2015.js +67 -8
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +66 -7
- package/dist/es6/ej2-image-editor.es5.js.map +1 -1
- package/dist/global/ej2-image-editor.min.js +2 -2
- package/dist/global/ej2-image-editor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +8 -8
- package/src/image-editor/action/draw.js +7 -5
- package/src/image-editor/action/undo-redo.js +10 -0
- package/src/image-editor/renderer/toolbar.js +49 -2
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 27.1.
|
|
3
|
+
* version : 27.1.51
|
|
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.
|
|
3
|
+
"_id": "@syncfusion/ej2-image-editor@27.1.50",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-jbOqBMJzNwFx5r4c2P3xYh1n3aW2br4yKOwC8alxYLnRfDY6d5OTbWY62XEAdW30IqaQHH635RpdhZUkHVtGhg==",
|
|
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.
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-27.1.50.tgz",
|
|
27
|
+
"_shasum": "f84391b62e7a8c4e10937b6603abaeb16e3a66d1",
|
|
28
28
|
"_spec": "@syncfusion/ej2-image-editor@*",
|
|
29
29
|
"_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
|
|
30
30
|
"author": {
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"bundleDependencies": false,
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@syncfusion/ej2-base": "~27.1.50",
|
|
36
|
-
"@syncfusion/ej2-buttons": "~27.1.
|
|
37
|
-
"@syncfusion/ej2-dropdowns": "~27.1.
|
|
36
|
+
"@syncfusion/ej2-buttons": "~27.1.51",
|
|
37
|
+
"@syncfusion/ej2-dropdowns": "~27.1.51",
|
|
38
38
|
"@syncfusion/ej2-inputs": "~27.1.50",
|
|
39
|
-
"@syncfusion/ej2-navigations": "~27.1.
|
|
39
|
+
"@syncfusion/ej2-navigations": "~27.1.51",
|
|
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.
|
|
71
|
+
"version": "27.1.51",
|
|
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')) {
|
|
@@ -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;
|
|
@@ -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 = '
|
|
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 = '
|
|
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,50 @@ 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
|
+
if (Browser.isDevice) {
|
|
1889
|
+
canvas.style.display = 'none';
|
|
1890
|
+
}
|
|
1891
|
+
else {
|
|
1892
|
+
ctx.drawImage(tempCanvas, 0, 0);
|
|
1893
|
+
tempCanvas.toBlob((function (blob) {
|
|
1894
|
+
fileSize = Math.floor(blob.size / 1024);
|
|
1895
|
+
if (fileSize > 1000) {
|
|
1896
|
+
var megabytes = fileSize / 1024;
|
|
1897
|
+
imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + megabytes.toFixed(2) + ' MB';
|
|
1898
|
+
fileSize = +megabytes.toFixed(2);
|
|
1899
|
+
}
|
|
1900
|
+
else {
|
|
1901
|
+
imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + fileSize.toFixed(2) + ' KB';
|
|
1902
|
+
fileSize = +fileSize.toFixed(2);
|
|
1903
|
+
}
|
|
1904
|
+
this.fileSize = fileSize;
|
|
1905
|
+
}).bind(this), 'image/png', 1);
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
else if (!isNullOrUndefined(fileType) && fileType.toLowerCase() === 'svg') {
|
|
1909
|
+
if (Browser.isDevice) {
|
|
1910
|
+
canvas.style.display = 'none';
|
|
1911
|
+
}
|
|
1912
|
+
else {
|
|
1913
|
+
ctx.drawImage(tempCanvas, 0, 0);
|
|
1914
|
+
var svgDataUrl = tempCanvas.toDataURL('image/svg+xml');
|
|
1915
|
+
var base64Data = svgDataUrl.split(',')[1];
|
|
1916
|
+
var binaryStringLength = base64Data.length;
|
|
1917
|
+
var rawByteSize = binaryStringLength;
|
|
1918
|
+
var fileSize_1 = Math.floor(rawByteSize / 1024); // KB
|
|
1919
|
+
if (fileSize_1 > 1000) {
|
|
1920
|
+
var megabytes = fileSize_1 / 1024; // Convert to MB
|
|
1921
|
+
imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + megabytes.toFixed(2) + ' MB';
|
|
1922
|
+
fileSize_1 = +megabytes.toFixed(2);
|
|
1923
|
+
}
|
|
1924
|
+
else {
|
|
1925
|
+
imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + fileSize_1.toFixed(2) + ' KB';
|
|
1926
|
+
fileSize_1 = +fileSize_1.toFixed(2);
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
this.fileSize = fileSize;
|
|
1930
|
+
}
|
|
1884
1931
|
else {
|
|
1885
1932
|
if (Browser.isDevice) {
|
|
1886
1933
|
canvas.style.display = 'none';
|