@syncfusion/ej2-image-editor 26.1.40 → 26.2.4
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 +197 -40
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +196 -40
- 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/hotfix/26.1.35_Vol2.txt +1 -0
- package/package.json +12 -12
- package/src/image-editor/action/draw.js +1 -2
- package/src/image-editor/action/export.js +11 -7
- package/src/image-editor/action/selection.d.ts +1 -0
- package/src/image-editor/action/selection.js +49 -1
- package/src/image-editor/action/transform.js +2 -1
- package/src/image-editor/action/undo-redo.js +4 -2
- package/src/image-editor/base/image-editor.d.ts +4 -1
- package/src/image-editor/base/image-editor.js +62 -10
- package/src/image-editor/base/interface.d.ts +4 -0
- package/src/image-editor/renderer/toolbar.d.ts +1 -0
- package/src/image-editor/renderer/toolbar.js +67 -17
- package/styles/bootstrap-dark.css +0 -2
- package/styles/bootstrap.css +0 -2
- package/styles/bootstrap4.css +2 -0
- package/styles/bootstrap5-dark.css +2 -0
- package/styles/bootstrap5.css +2 -0
- package/styles/fabric-dark.css +1 -2
- package/styles/fabric.css +1 -2
- package/styles/fluent-dark.css +3 -2
- package/styles/fluent.css +3 -2
- package/styles/fluent2.css +26 -12
- package/styles/highcontrast-light.css +3 -2
- package/styles/highcontrast.css +3 -2
- package/styles/image-editor/_layout.scss +16 -0
- package/styles/image-editor/_theme.scss +34 -1
- package/styles/image-editor/bootstrap-dark.css +0 -2
- package/styles/image-editor/bootstrap.css +0 -2
- package/styles/image-editor/bootstrap4.css +2 -0
- package/styles/image-editor/bootstrap5-dark.css +2 -0
- package/styles/image-editor/bootstrap5.css +2 -0
- package/styles/image-editor/fabric-dark.css +1 -2
- package/styles/image-editor/fabric.css +1 -2
- package/styles/image-editor/fluent-dark.css +3 -2
- package/styles/image-editor/fluent.css +3 -2
- package/styles/image-editor/fluent2.css +26 -12
- package/styles/image-editor/highcontrast-light.css +3 -2
- package/styles/image-editor/highcontrast.css +3 -2
- package/styles/image-editor/material-dark.css +0 -2
- package/styles/image-editor/material.css +0 -2
- package/styles/image-editor/material3-dark.css +2 -3
- package/styles/image-editor/material3.css +2 -3
- package/styles/image-editor/tailwind-dark.css +2 -2
- package/styles/image-editor/tailwind.css +2 -2
- package/styles/material-dark.css +0 -2
- package/styles/material.css +0 -2
- package/styles/material3-dark.css +2 -3
- package/styles/material3.css +2 -3
- package/styles/tailwind-dark.css +2 -2
- package/styles/tailwind.css +2 -2
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 26.
|
|
3
|
+
* version : 26.2.4
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
hotfix/26.1.35_Vol2
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-image-editor@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-image-editor@26.1.
|
|
3
|
+
"_id": "@syncfusion/ej2-image-editor@26.1.41",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-zZXE7n9Ic961tD024D+IHoiqYTDcOMCUuZpX2OGtor7T/IE1dreqOsTWvAQwLE8KXjjLMw7L7xg2z7q8R+vYJw==",
|
|
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-26.1.
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-26.1.41.tgz",
|
|
27
|
+
"_shasum": "6d79b44758b74b906e47f94e827eedd7def4b8b1",
|
|
28
28
|
"_spec": "@syncfusion/ej2-image-editor@*",
|
|
29
29
|
"_where": "/jenkins/workspace/elease-automation_release_26.1.1/packages/included",
|
|
30
30
|
"author": {
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
},
|
|
33
33
|
"bundleDependencies": false,
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@syncfusion/ej2-base": "~26.
|
|
36
|
-
"@syncfusion/ej2-buttons": "~26.
|
|
37
|
-
"@syncfusion/ej2-dropdowns": "~26.
|
|
38
|
-
"@syncfusion/ej2-inputs": "~26.
|
|
39
|
-
"@syncfusion/ej2-navigations": "~26.
|
|
40
|
-
"@syncfusion/ej2-popups": "~26.
|
|
41
|
-
"@syncfusion/ej2-splitbuttons": "~26.
|
|
35
|
+
"@syncfusion/ej2-base": "~26.2.4",
|
|
36
|
+
"@syncfusion/ej2-buttons": "~26.2.4",
|
|
37
|
+
"@syncfusion/ej2-dropdowns": "~26.2.4",
|
|
38
|
+
"@syncfusion/ej2-inputs": "~26.2.4",
|
|
39
|
+
"@syncfusion/ej2-navigations": "~26.2.4",
|
|
40
|
+
"@syncfusion/ej2-popups": "~26.2.4",
|
|
41
|
+
"@syncfusion/ej2-splitbuttons": "~26.2.4"
|
|
42
42
|
},
|
|
43
43
|
"deprecated": false,
|
|
44
44
|
"description": "Essential JS 2 ImageEditor",
|
|
@@ -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": "26.
|
|
71
|
+
"version": "26.2.4",
|
|
72
72
|
"sideEffects": false,
|
|
73
73
|
"homepage": "https://www.syncfusion.com/javascript-ui-controls"
|
|
74
74
|
}
|
|
@@ -235,7 +235,7 @@ var Draw = /** @class */ (function () {
|
|
|
235
235
|
args.value['obj']['isNewPath'] = this.isNewPath;
|
|
236
236
|
break;
|
|
237
237
|
case 'getArrowDimension':
|
|
238
|
-
args.value['obj']['arrowDimension'] = this.arrowDimension;
|
|
238
|
+
args.value['obj']['arrowDimension'] = extend({}, this.arrowDimension, {}, true);
|
|
239
239
|
break;
|
|
240
240
|
case 'setArrowDimension':
|
|
241
241
|
this.arrowDimension = args.value['arrowDimension'];
|
|
@@ -3806,7 +3806,6 @@ var Draw = /** @class */ (function () {
|
|
|
3806
3806
|
return [3 /*break*/, 3];
|
|
3807
3807
|
case 2:
|
|
3808
3808
|
ex_1 = _a.sent();
|
|
3809
|
-
console.log(ex_1.message);
|
|
3810
3809
|
return [3 /*break*/, 3];
|
|
3811
3810
|
case 3: return [2 /*return*/];
|
|
3812
3811
|
}
|
|
@@ -24,7 +24,7 @@ var Export = /** @class */ (function () {
|
|
|
24
24
|
this.updatePvtVar();
|
|
25
25
|
switch (args.prop) {
|
|
26
26
|
case 'export':
|
|
27
|
-
this.exportImg(args.value['type'], args.value['fileName']);
|
|
27
|
+
this.exportImg(args.value['type'], args.value['fileName'], args.value['imgQuality']);
|
|
28
28
|
break;
|
|
29
29
|
case 'exportToCanvas':
|
|
30
30
|
this.exportToCanvas(args.value['object']);
|
|
@@ -45,7 +45,7 @@ var Export = /** @class */ (function () {
|
|
|
45
45
|
this.lowerContext = parent.lowerCanvas.getContext('2d');
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
Export.prototype.exportImg = function (type, fileName) {
|
|
48
|
+
Export.prototype.exportImg = function (type, fileName, imgQuality) {
|
|
49
49
|
var parent = this.parent;
|
|
50
50
|
var obj = { fileName: '' };
|
|
51
51
|
parent.notify('draw', { prop: 'getFileName', onPropertyChange: false, value: { obj: obj } });
|
|
@@ -71,12 +71,12 @@ var Export = /** @class */ (function () {
|
|
|
71
71
|
parent.notify('shape', { prop: 'redrawActObj', onPropertyChange: false,
|
|
72
72
|
value: { x: null, y: null, isMouseDown: null } });
|
|
73
73
|
var beforeSave = { cancel: false, fileName: fileName ? fileName : imageName,
|
|
74
|
-
fileType: type };
|
|
74
|
+
fileType: type, imageQuality: imgQuality };
|
|
75
75
|
parent.trigger('beforeSave', beforeSave);
|
|
76
|
-
this.beforeSaveEvent(beforeSave, type, fileName, imageName);
|
|
76
|
+
this.beforeSaveEvent(beforeSave, type, fileName, imageName, imgQuality);
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
|
-
Export.prototype.beforeSaveEvent = function (observableSaveArgs, type, fileName, imageName) {
|
|
79
|
+
Export.prototype.beforeSaveEvent = function (observableSaveArgs, type, fileName, imageName, imgQuality) {
|
|
80
80
|
var parent = this.parent;
|
|
81
81
|
if (!observableSaveArgs.cancel) {
|
|
82
82
|
parent.currObjType.isSave = true;
|
|
@@ -87,7 +87,7 @@ var Export = /** @class */ (function () {
|
|
|
87
87
|
this.toSVGImg(fileName);
|
|
88
88
|
}
|
|
89
89
|
else {
|
|
90
|
-
this.toBlobFn(fileName, lowerCaseType);
|
|
90
|
+
this.toBlobFn(fileName, lowerCaseType, imgQuality);
|
|
91
91
|
}
|
|
92
92
|
var saved = { fileName: fileName ? fileName : imageName, fileType: type };
|
|
93
93
|
parent.trigger('saved', saved);
|
|
@@ -130,12 +130,16 @@ var Export = /** @class */ (function () {
|
|
|
130
130
|
return null;
|
|
131
131
|
}
|
|
132
132
|
};
|
|
133
|
-
Export.prototype.toBlobFn = function (fileName, type) {
|
|
133
|
+
Export.prototype.toBlobFn = function (fileName, type, imgQuality) {
|
|
134
134
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
135
135
|
var proxy = this;
|
|
136
136
|
var parent = this.parent;
|
|
137
137
|
showSpinner(parent.element);
|
|
138
138
|
parent.element.style.opacity = '0.5';
|
|
139
|
+
if (!isNullOrUndefined(imgQuality)) {
|
|
140
|
+
imgQuality = imgQuality > 1 ? 1 : (imgQuality <= 0 ? 0.01 : imgQuality);
|
|
141
|
+
this.imageQuality = imgQuality ? imgQuality : null;
|
|
142
|
+
}
|
|
139
143
|
var tempCanvas = this.exportToCanvas();
|
|
140
144
|
var imagetype = type !== 'jpeg' ? 'image/png' : 'image/jpeg';
|
|
141
145
|
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
@@ -366,6 +366,7 @@ var Selection = /** @class */ (function () {
|
|
|
366
366
|
parent.notify('undo-redo', { prop: 'updateCurrUrc', value: { type: 'ok' } });
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
|
+
parent.isKBDNavigation = true;
|
|
369
370
|
};
|
|
370
371
|
Selection.prototype.selMouseUpEvent = function () {
|
|
371
372
|
this.oldPoint.x = undefined;
|
|
@@ -949,6 +950,10 @@ var Selection = /** @class */ (function () {
|
|
|
949
950
|
return;
|
|
950
951
|
}
|
|
951
952
|
var actObj = extend({}, obj[i], {}, true);
|
|
953
|
+
if (actObj.activePoint.width === 0 && actObj.activePoint.height === 0) {
|
|
954
|
+
obj.splice(i, 1);
|
|
955
|
+
return;
|
|
956
|
+
}
|
|
952
957
|
this.cursorTargetId = actObj.currIndex;
|
|
953
958
|
if (actObj.shape === 'line' || actObj.shape === 'arrow') {
|
|
954
959
|
this.setCursorForLineArrow(actObj, x, y, upperCanvas);
|
|
@@ -2926,6 +2931,7 @@ var Selection = /** @class */ (function () {
|
|
|
2926
2931
|
};
|
|
2927
2932
|
Selection.prototype.mouseDownEventHandler = function (e) {
|
|
2928
2933
|
var parent = this.parent;
|
|
2934
|
+
parent.isKBDNavigation = false;
|
|
2929
2935
|
this.mouseDown = e.currentTarget === parent.lowerCanvas || e.currentTarget === parent.upperCanvas ?
|
|
2930
2936
|
'canvas' : '';
|
|
2931
2937
|
if (e.type === 'touchstart') {
|
|
@@ -3386,6 +3392,7 @@ var Selection = /** @class */ (function () {
|
|
|
3386
3392
|
Selection.prototype.mouseUpEventHandler = function (e) {
|
|
3387
3393
|
var parent = this.parent;
|
|
3388
3394
|
var id = parent.element.id;
|
|
3395
|
+
parent.isKBDNavigation = false;
|
|
3389
3396
|
if (!Browser.isDevice && ((parent.element.querySelector('#' + id + '_contextualToolbar') &&
|
|
3390
3397
|
!parent.element.querySelector('#' + id + '_contextualToolbar').parentElement.classList.contains('e-hide')) ||
|
|
3391
3398
|
(parent.element.querySelector('#' + id + '_headWrapper')
|
|
@@ -3533,7 +3540,9 @@ var Selection = /** @class */ (function () {
|
|
|
3533
3540
|
previousCropObj: prevCropObj, previousText: null,
|
|
3534
3541
|
currentText: null, previousFilter: null, isCircleCrop: null } });
|
|
3535
3542
|
}
|
|
3536
|
-
|
|
3543
|
+
var tempObj = extend({}, parent.objColl[parent.objColl.length - 1], {}, true);
|
|
3544
|
+
parent.objColl.pop();
|
|
3545
|
+
this.redrawShape(tempObj);
|
|
3537
3546
|
this.tempObjColl = undefined;
|
|
3538
3547
|
}
|
|
3539
3548
|
if (!this.isFhdEditing) {
|
|
@@ -3583,6 +3592,7 @@ var Selection = /** @class */ (function () {
|
|
|
3583
3592
|
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
3584
3593
|
}
|
|
3585
3594
|
if (!isCropSelection_1) {
|
|
3595
|
+
this.adjustActObjForLineArrow();
|
|
3586
3596
|
if (parent.isShapeDrawing) {
|
|
3587
3597
|
var temp = this.currentDrawingShape;
|
|
3588
3598
|
parent.notify('undo-redo', { prop: 'updateUndoRedoStack', onPropertyChange: false });
|
|
@@ -3608,8 +3618,11 @@ var Selection = /** @class */ (function () {
|
|
|
3608
3618
|
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
3609
3619
|
}
|
|
3610
3620
|
else {
|
|
3621
|
+
var temp = this.currentDrawingShape;
|
|
3622
|
+
this.currentDrawingShape = '';
|
|
3611
3623
|
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'shapes',
|
|
3612
3624
|
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
3625
|
+
this.currentDrawingShape = temp;
|
|
3613
3626
|
}
|
|
3614
3627
|
parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
|
|
3615
3628
|
parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
|
|
@@ -4143,8 +4156,15 @@ var Selection = /** @class */ (function () {
|
|
|
4143
4156
|
Selection.prototype.performEnterAction = function (e) {
|
|
4144
4157
|
var parent = this.parent;
|
|
4145
4158
|
if (parent.isResize) {
|
|
4159
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
4160
|
+
var target = e.target;
|
|
4161
|
+
var isIcon = target.id.indexOf('aspectratio') ||
|
|
4162
|
+
target.id.indexOf('non-aspectratio') > -1 ? true : false;
|
|
4146
4163
|
var isValue = this.isValueUpdated();
|
|
4147
4164
|
if (!isValue) {
|
|
4165
|
+
if (isIcon) {
|
|
4166
|
+
this.focusRatioBtn();
|
|
4167
|
+
}
|
|
4148
4168
|
return;
|
|
4149
4169
|
}
|
|
4150
4170
|
var point = this.getNumTextValue();
|
|
@@ -4177,6 +4197,21 @@ var Selection = /** @class */ (function () {
|
|
|
4177
4197
|
}
|
|
4178
4198
|
}
|
|
4179
4199
|
parent.notify('draw', { prop: 'redrawDownScale' });
|
|
4200
|
+
if (isIcon) {
|
|
4201
|
+
this.focusRatioBtn();
|
|
4202
|
+
}
|
|
4203
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
4204
|
+
}
|
|
4205
|
+
else if (e.target.classList.contains('e-upload')) {
|
|
4206
|
+
var upload = parent.element.querySelector('.e-image-upload');
|
|
4207
|
+
if (upload && upload.querySelector('.e-tbar-btn')) {
|
|
4208
|
+
upload.querySelector('.e-tbar-btn').click();
|
|
4209
|
+
}
|
|
4210
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
4211
|
+
}
|
|
4212
|
+
else if (e.target.classList.contains('filter-wrapper')) {
|
|
4213
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
4214
|
+
e.target.parentElement.click();
|
|
4180
4215
|
}
|
|
4181
4216
|
else {
|
|
4182
4217
|
var splitWords = void 0;
|
|
@@ -4189,6 +4224,19 @@ var Selection = /** @class */ (function () {
|
|
|
4189
4224
|
}
|
|
4190
4225
|
}
|
|
4191
4226
|
};
|
|
4227
|
+
Selection.prototype.focusRatioBtn = function () {
|
|
4228
|
+
var id = this.parent.element.id;
|
|
4229
|
+
if (this.parent.isKBDNavigation) {
|
|
4230
|
+
setTimeout(function () {
|
|
4231
|
+
if (document.getElementById(id + '_aspectratio')) {
|
|
4232
|
+
document.getElementById(id + '_aspectratio').focus();
|
|
4233
|
+
}
|
|
4234
|
+
else if (document.getElementById(id + '_nonaspectratio')) {
|
|
4235
|
+
document.getElementById(id + '_nonaspectratio').focus();
|
|
4236
|
+
}
|
|
4237
|
+
}, 50);
|
|
4238
|
+
}
|
|
4239
|
+
};
|
|
4192
4240
|
Selection.prototype.isKeyBoardCrop = function (e) {
|
|
4193
4241
|
var bool = false;
|
|
4194
4242
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
@@ -1557,7 +1557,8 @@ var Transform = /** @class */ (function () {
|
|
|
1557
1557
|
if (freehandObj['bool']) {
|
|
1558
1558
|
parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
|
|
1559
1559
|
}
|
|
1560
|
-
|
|
1560
|
+
var actPoint = extend({}, parent.activeObj.activePoint, {}, true);
|
|
1561
|
+
if (parent.activeObj.shape && (actPoint.width !== 0 || actPoint.height !== 0)) {
|
|
1561
1562
|
isActiveObj = true;
|
|
1562
1563
|
if (parent.textArea.style.display === 'block' || parent.textArea.style.display === 'inline-block') {
|
|
1563
1564
|
parent.notify('shape', { prop: 'redrawActObj', onPropertyChange: false,
|
|
@@ -327,7 +327,8 @@ var UndoRedo = /** @class */ (function () {
|
|
|
327
327
|
case 'freehanddraw':
|
|
328
328
|
case 'freehand-draw':
|
|
329
329
|
this.updateFreehandDraw(obj.previousPointColl, obj.previousSelPointColl);
|
|
330
|
-
parent.notify('freehand-draw', { prop: 'setCurrentFreehandDrawIndex',
|
|
330
|
+
parent.notify('freehand-draw', { prop: 'setCurrentFreehandDrawIndex',
|
|
331
|
+
value: { value: parent.pointColl.length } });
|
|
331
332
|
break;
|
|
332
333
|
case 'freehanddrawCustomized':
|
|
333
334
|
this.updateFreehandDrawCustomized(obj.previousObjColl, obj.previousPointColl);
|
|
@@ -458,7 +459,8 @@ var UndoRedo = /** @class */ (function () {
|
|
|
458
459
|
case 'freehanddraw':
|
|
459
460
|
case 'freehand-draw':
|
|
460
461
|
this.updateFreehandDraw(obj.currentPointColl, obj.currentSelPointColl);
|
|
461
|
-
parent.notify('freehand-draw', { prop: 'setCurrentFreehandDrawIndex',
|
|
462
|
+
parent.notify('freehand-draw', { prop: 'setCurrentFreehandDrawIndex',
|
|
463
|
+
value: { value: parent.pointColl.length } });
|
|
462
464
|
break;
|
|
463
465
|
case 'freehanddrawCustomized':
|
|
464
466
|
this.updateFreehandDrawCustomized(obj.currentObjColl, obj.currentPointColl);
|
|
@@ -374,6 +374,8 @@ export declare class ImageEditor extends Component<HTMLDivElement> implements IN
|
|
|
374
374
|
shapeColl: any;
|
|
375
375
|
/** @hidden */
|
|
376
376
|
imgSrc: string;
|
|
377
|
+
/** @hidden */
|
|
378
|
+
isKBDNavigation: boolean;
|
|
377
379
|
private lowerContext;
|
|
378
380
|
private upperContext;
|
|
379
381
|
private inMemoryContext;
|
|
@@ -977,13 +979,14 @@ export declare class ImageEditor extends Component<HTMLDivElement> implements IN
|
|
|
977
979
|
*
|
|
978
980
|
* @param {string} type - Specifies a format of image to be saved.
|
|
979
981
|
* @param {string} fileName – Specifies a file name to be saved
|
|
982
|
+
* @param {number} imageQuality – Specifies the quality of an image to be saved. The default value is “1” which represents the original size of the image if not specified.
|
|
980
983
|
*
|
|
981
984
|
* @remarks
|
|
982
985
|
* The supported file types are JPG, JPEG, PNG, and SVG.
|
|
983
986
|
*
|
|
984
987
|
* @returns {void}.
|
|
985
988
|
*/
|
|
986
|
-
export(type?: string, fileName?: string): void;
|
|
989
|
+
export(type?: string, fileName?: string, imageQuality?: number): void;
|
|
987
990
|
/**
|
|
988
991
|
* Perform selection in an image editor. The selection helps to crop an image.
|
|
989
992
|
*
|
|
@@ -261,6 +261,8 @@ var ImageEditor = /** @class */ (function (_super) {
|
|
|
261
261
|
/** @hidden */
|
|
262
262
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
263
263
|
_this.shapeColl = [];
|
|
264
|
+
/** @hidden */
|
|
265
|
+
_this.isKBDNavigation = false;
|
|
264
266
|
ImageEditor_1.Inject(Crop, Draw, Selection, Transform, Export, ToolbarModule);
|
|
265
267
|
ImageEditor_1.Inject(UndoRedo);
|
|
266
268
|
ImageEditor_1.Inject(Filter);
|
|
@@ -1019,7 +1021,7 @@ var ImageEditor = /** @class */ (function (_super) {
|
|
|
1019
1021
|
this.aspectWidth = this.aspectHeight = null;
|
|
1020
1022
|
this.isResize = false;
|
|
1021
1023
|
this.drawingShape = null;
|
|
1022
|
-
this.isShapeDrawing = this.noPushUndo = this.isUndoRedoStack = false;
|
|
1024
|
+
this.isShapeDrawing = this.noPushUndo = this.isUndoRedoStack = this.isKBDNavigation = false;
|
|
1023
1025
|
this.shapeColl = [];
|
|
1024
1026
|
var obj_1 = { initialZoomValue: false };
|
|
1025
1027
|
this.notify('draw', { prop: 'getInitialZoomValue', onPropertyChange: false, value: { obj: obj_1 } });
|
|
@@ -1085,15 +1087,16 @@ var ImageEditor = /** @class */ (function (_super) {
|
|
|
1085
1087
|
*
|
|
1086
1088
|
* @param {string} type - Specifies a format of image to be saved.
|
|
1087
1089
|
* @param {string} fileName – Specifies a file name to be saved
|
|
1090
|
+
* @param {number} imageQuality – Specifies the quality of an image to be saved. The default value is “1” which represents the original size of the image if not specified.
|
|
1088
1091
|
*
|
|
1089
1092
|
* @remarks
|
|
1090
1093
|
* The supported file types are JPG, JPEG, PNG, and SVG.
|
|
1091
1094
|
*
|
|
1092
1095
|
* @returns {void}.
|
|
1093
1096
|
*/
|
|
1094
|
-
ImageEditor.prototype.export = function (type, fileName) {
|
|
1097
|
+
ImageEditor.prototype.export = function (type, fileName, imageQuality) {
|
|
1095
1098
|
this.applyShapes();
|
|
1096
|
-
this.notify('export', { prop: 'export', onPropertyChange: false, value: { type: type, fileName: fileName } });
|
|
1099
|
+
this.notify('export', { prop: 'export', onPropertyChange: false, value: { type: type, fileName: fileName, imgQuality: imageQuality } });
|
|
1097
1100
|
};
|
|
1098
1101
|
/**
|
|
1099
1102
|
* Perform selection in an image editor. The selection helps to crop an image.
|
|
@@ -2573,7 +2576,12 @@ var ImageEditor = /** @class */ (function (_super) {
|
|
|
2573
2576
|
* @returns {void}.
|
|
2574
2577
|
*/
|
|
2575
2578
|
ImageEditor.prototype.updateArrow = function (type, id) {
|
|
2579
|
+
var isObjPushed = false;
|
|
2580
|
+
var collLength = this.objColl.length;
|
|
2576
2581
|
this.notify('shape', { prop: 'pushActItemIntoObj' });
|
|
2582
|
+
if (collLength !== this.objColl.length) {
|
|
2583
|
+
isObjPushed = true;
|
|
2584
|
+
}
|
|
2577
2585
|
var prevCropObj = extend({}, this.cropObj, {}, true);
|
|
2578
2586
|
var object = { currObj: {} };
|
|
2579
2587
|
var objt = { shapeSettingsObj: {} };
|
|
@@ -2584,7 +2592,9 @@ var ImageEditor = /** @class */ (function (_super) {
|
|
|
2584
2592
|
prevObj.objColl = extend([], this.objColl, [], true);
|
|
2585
2593
|
prevObj.pointColl = extend([], this.pointColl, [], true);
|
|
2586
2594
|
prevObj.afterCropActions = extend([], this.afterCropActions, [], true);
|
|
2587
|
-
|
|
2595
|
+
if (isObjPushed) {
|
|
2596
|
+
this.objColl.pop();
|
|
2597
|
+
}
|
|
2588
2598
|
if (type === 'startArrow') {
|
|
2589
2599
|
this.activeObj.start = this.getTextFromId(id);
|
|
2590
2600
|
}
|
|
@@ -2628,7 +2638,12 @@ var ImageEditor = /** @class */ (function (_super) {
|
|
|
2628
2638
|
*/
|
|
2629
2639
|
ImageEditor.prototype.updateFontFamily = function (id) {
|
|
2630
2640
|
this.notify('selection', { prop: 'setInitialTextEdit', value: { bool: false } });
|
|
2641
|
+
var isObjPushed = false;
|
|
2642
|
+
var collLength = this.objColl.length;
|
|
2631
2643
|
this.notify('shape', { prop: 'pushActItemIntoObj' });
|
|
2644
|
+
if (collLength !== this.objColl.length) {
|
|
2645
|
+
isObjPushed = true;
|
|
2646
|
+
}
|
|
2632
2647
|
var objColl = extend([], this.objColl, [], true);
|
|
2633
2648
|
var prevCropObj = extend({}, this.cropObj, {}, true);
|
|
2634
2649
|
var objt = { shapeSettingsObj: {} };
|
|
@@ -2644,7 +2659,9 @@ var ImageEditor = /** @class */ (function (_super) {
|
|
|
2644
2659
|
this.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false,
|
|
2645
2660
|
value: { obj: selPointCollObj } });
|
|
2646
2661
|
prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
|
|
2647
|
-
|
|
2662
|
+
if (isObjPushed) {
|
|
2663
|
+
this.objColl.pop();
|
|
2664
|
+
}
|
|
2648
2665
|
if (this.textArea.style.display === 'block' || this.textArea.style.display === 'inline-block') {
|
|
2649
2666
|
this.notify('shape', { prop: 'updateFontRatio', onPropertyChange: false,
|
|
2650
2667
|
value: { obj: this.activeObj, isTextArea: true } });
|
|
@@ -2704,7 +2721,12 @@ var ImageEditor = /** @class */ (function (_super) {
|
|
|
2704
2721
|
ImageEditor.prototype.updateFontSize = function (text) {
|
|
2705
2722
|
var itemText = text;
|
|
2706
2723
|
this.notify('selection', { prop: 'setInitialTextEdit', value: { bool: false } });
|
|
2724
|
+
var isObjPushed = false;
|
|
2725
|
+
var collLength = this.objColl.length;
|
|
2707
2726
|
this.notify('shape', { prop: 'pushActItemIntoObj' });
|
|
2727
|
+
if (collLength !== this.objColl.length) {
|
|
2728
|
+
isObjPushed = true;
|
|
2729
|
+
}
|
|
2708
2730
|
var prevCropObj = extend({}, this.cropObj, {}, true);
|
|
2709
2731
|
var objt = { shapeSettingsObj: {} };
|
|
2710
2732
|
this.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: objt } });
|
|
@@ -2719,7 +2741,9 @@ var ImageEditor = /** @class */ (function (_super) {
|
|
|
2719
2741
|
this.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false,
|
|
2720
2742
|
value: { obj: selPointCollObj } });
|
|
2721
2743
|
prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
|
|
2722
|
-
|
|
2744
|
+
if (isObjPushed) {
|
|
2745
|
+
this.objColl.pop();
|
|
2746
|
+
}
|
|
2723
2747
|
if (this.textArea.style.display === 'block' || this.textArea.style.display === 'inline-block') {
|
|
2724
2748
|
this.notify('shape', { prop: 'updateFontRatio', onPropertyChange: false,
|
|
2725
2749
|
value: { obj: this.activeObj, isTextArea: true } });
|
|
@@ -2807,7 +2831,12 @@ var ImageEditor = /** @class */ (function (_super) {
|
|
|
2807
2831
|
*/
|
|
2808
2832
|
ImageEditor.prototype.updateFontColor = function (value) {
|
|
2809
2833
|
this.notify('selection', { prop: 'setInitialTextEdit', value: { bool: false } });
|
|
2834
|
+
var isObjPushed = false;
|
|
2835
|
+
var collLength = this.objColl.length;
|
|
2810
2836
|
this.notify('shape', { prop: 'pushActItemIntoObj' });
|
|
2837
|
+
if (collLength !== this.objColl.length) {
|
|
2838
|
+
isObjPushed = true;
|
|
2839
|
+
}
|
|
2811
2840
|
var prevCropObj = extend({}, this.cropObj, {}, true);
|
|
2812
2841
|
var objt = { shapeSettingsObj: {} };
|
|
2813
2842
|
this.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: objt } });
|
|
@@ -2822,7 +2851,9 @@ var ImageEditor = /** @class */ (function (_super) {
|
|
|
2822
2851
|
this.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false,
|
|
2823
2852
|
value: { obj: selPointCollObj } });
|
|
2824
2853
|
prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
|
|
2825
|
-
|
|
2854
|
+
if (isObjPushed) {
|
|
2855
|
+
this.objColl.pop();
|
|
2856
|
+
}
|
|
2826
2857
|
if (this.textArea.style.display === 'none') {
|
|
2827
2858
|
this.activeObj.strokeSettings.strokeColor = value;
|
|
2828
2859
|
this.notify('shape', { prop: 'setStrokeSettings', value: { strokeSettings: null,
|
|
@@ -2999,7 +3030,12 @@ var ImageEditor = /** @class */ (function (_super) {
|
|
|
2999
3030
|
var obj = { shapeSettingsObj: {} };
|
|
3000
3031
|
this.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: obj } });
|
|
3001
3032
|
var shapeSettings = obj['shapeSettingsObj'];
|
|
3033
|
+
var isObjPushed = false;
|
|
3034
|
+
var collLength = this.objColl.length;
|
|
3002
3035
|
this.notify('shape', { prop: 'pushActItemIntoObj' });
|
|
3036
|
+
if (collLength !== this.objColl.length) {
|
|
3037
|
+
isObjPushed = true;
|
|
3038
|
+
}
|
|
3003
3039
|
var prevCropObj = extend({}, this.cropObj, {}, true);
|
|
3004
3040
|
var object = { currObj: {} };
|
|
3005
3041
|
this.notify('filter', { prop: 'getCurrentObj', onPropertyChange: false, value: { object: object } });
|
|
@@ -3011,7 +3047,9 @@ var ImageEditor = /** @class */ (function (_super) {
|
|
|
3011
3047
|
this.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false,
|
|
3012
3048
|
value: { obj: selPointCollObj } });
|
|
3013
3049
|
prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
|
|
3014
|
-
|
|
3050
|
+
if (isObjPushed) {
|
|
3051
|
+
this.objColl.pop();
|
|
3052
|
+
}
|
|
3015
3053
|
this.activeObj.strokeSettings.strokeWidth = parseInt(id, 10);
|
|
3016
3054
|
if (this.activeObj.shape === 'rectangle' || this.activeObj.shape === 'ellipse') {
|
|
3017
3055
|
this.activeObj.strokeSettings.strokeWidth = parseInt(id, 10) - 1;
|
|
@@ -3053,7 +3091,12 @@ var ImageEditor = /** @class */ (function (_super) {
|
|
|
3053
3091
|
var shapeSettings = objt['shapeSettingsObj'];
|
|
3054
3092
|
if (this.activeObj.shape && (this.activeObj.shape !== 'path' || (this.activeObj.shape === 'path' &&
|
|
3055
3093
|
this.activeObj.pointColl.length > 0))) {
|
|
3094
|
+
var isObjPushed = false;
|
|
3095
|
+
var collLength = this.objColl.length;
|
|
3056
3096
|
this.notify('shape', { prop: 'pushActItemIntoObj' });
|
|
3097
|
+
if (collLength !== this.objColl.length) {
|
|
3098
|
+
isObjPushed = true;
|
|
3099
|
+
}
|
|
3057
3100
|
var prevCropObj = extend({}, this.cropObj, {}, true);
|
|
3058
3101
|
var object = { currObj: {} };
|
|
3059
3102
|
this.notify('filter', { prop: 'getCurrentObj', onPropertyChange: false, value: { object: object } });
|
|
@@ -3065,7 +3108,9 @@ var ImageEditor = /** @class */ (function (_super) {
|
|
|
3065
3108
|
this.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false,
|
|
3066
3109
|
value: { obj: selPointCollObj } });
|
|
3067
3110
|
prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
|
|
3068
|
-
|
|
3111
|
+
if (isObjPushed) {
|
|
3112
|
+
this.objColl.pop();
|
|
3113
|
+
}
|
|
3069
3114
|
this.activeObj.strokeSettings.strokeColor = value;
|
|
3070
3115
|
this.notify('shape', { prop: 'setStrokeSettings', value: { strokeSettings: null, strokeColor: this.activeObj.strokeSettings.strokeColor, fillColor: null, strokeWidth: null } });
|
|
3071
3116
|
if (!this.togglePen) {
|
|
@@ -3100,7 +3145,12 @@ var ImageEditor = /** @class */ (function (_super) {
|
|
|
3100
3145
|
var obj = { shapeSettingsObj: {} };
|
|
3101
3146
|
this.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: obj } });
|
|
3102
3147
|
var shapeSettings = obj['shapeSettingsObj'];
|
|
3148
|
+
var isObjPushed = false;
|
|
3149
|
+
var collLength = this.objColl.length;
|
|
3103
3150
|
this.notify('shape', { prop: 'pushActItemIntoObj' });
|
|
3151
|
+
if (collLength !== this.objColl.length) {
|
|
3152
|
+
isObjPushed = true;
|
|
3153
|
+
}
|
|
3104
3154
|
var prevCropObj = extend({}, this.cropObj, {}, true);
|
|
3105
3155
|
var object = { currObj: {} };
|
|
3106
3156
|
this.notify('filter', { prop: 'getCurrentObj', onPropertyChange: false, value: { object: object } });
|
|
@@ -3112,7 +3162,9 @@ var ImageEditor = /** @class */ (function (_super) {
|
|
|
3112
3162
|
this.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false,
|
|
3113
3163
|
value: { obj: selPointCollObj } });
|
|
3114
3164
|
prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
|
|
3115
|
-
|
|
3165
|
+
if (isObjPushed) {
|
|
3166
|
+
this.objColl.pop();
|
|
3167
|
+
}
|
|
3116
3168
|
this.activeObj.strokeSettings.fillColor = value;
|
|
3117
3169
|
this.notify('shape', { prop: 'setStrokeSettings',
|
|
3118
3170
|
value: { strokeSettings: null, strokeColor: null, fillColor: this.activeObj.strokeSettings.fillColor,
|
|
@@ -278,6 +278,10 @@ export interface BeforeSaveEventArgs {
|
|
|
278
278
|
* Returns the file type for an image.
|
|
279
279
|
*/
|
|
280
280
|
fileType: FileType;
|
|
281
|
+
/**
|
|
282
|
+
* Returns the Quality of an image.
|
|
283
|
+
*/
|
|
284
|
+
imageQuality?: number;
|
|
281
285
|
}
|
|
282
286
|
/**
|
|
283
287
|
* The Interface which contains the properties for Point Object in the image editor.
|