@syncfusion/ej2-image-editor 31.1.17 → 31.1.21
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 +63 -7
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +63 -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 +14 -46
- package/src/image-editor/action/export.js +6 -2
- package/src/image-editor/action/freehand-draw.d.ts +1 -0
- package/src/image-editor/action/freehand-draw.js +30 -3
- package/src/image-editor/action/selection.js +14 -2
- package/src/image-editor/action/undo-redo.js +10 -0
- package/src/image-editor/renderer/toolbar.js +3 -0
- package/dist/ts/image-editor/action/crop.d.ts +0 -44
- package/dist/ts/image-editor/action/crop.ts +0 -867
- package/dist/ts/image-editor/action/draw.d.ts +0 -187
- package/dist/ts/image-editor/action/draw.ts +0 -4924
- package/dist/ts/image-editor/action/export.d.ts +0 -29
- package/dist/ts/image-editor/action/export.ts +0 -509
- package/dist/ts/image-editor/action/filter.d.ts +0 -48
- package/dist/ts/image-editor/action/filter.ts +0 -872
- package/dist/ts/image-editor/action/freehand-draw.d.ts +0 -68
- package/dist/ts/image-editor/action/freehand-draw.ts +0 -1135
- package/dist/ts/image-editor/action/index.d.ts +0 -9
- package/dist/ts/image-editor/action/index.ts +0 -9
- package/dist/ts/image-editor/action/selection.d.ts +0 -178
- package/dist/ts/image-editor/action/selection.ts +0 -5241
- package/dist/ts/image-editor/action/shape.d.ts +0 -130
- package/dist/ts/image-editor/action/shape.ts +0 -3917
- package/dist/ts/image-editor/action/transform.d.ts +0 -77
- package/dist/ts/image-editor/action/transform.ts +0 -2008
- package/dist/ts/image-editor/action/undo-redo.d.ts +0 -52
- package/dist/ts/image-editor/action/undo-redo.ts +0 -1169
- package/dist/ts/image-editor/base/enum.d.ts +0 -277
- package/dist/ts/image-editor/base/enum.ts +0 -288
- package/dist/ts/image-editor/base/image-editor-model.d.ts +0 -770
- package/dist/ts/image-editor/base/image-editor.d.ts +0 -1928
- package/dist/ts/image-editor/base/image-editor.ts +0 -5496
- package/dist/ts/image-editor/base/index.d.ts +0 -4
- package/dist/ts/image-editor/base/index.ts +0 -4
- package/dist/ts/image-editor/base/interface.d.ts +0 -1637
- package/dist/ts/image-editor/base/interface.ts +0 -1709
- package/dist/ts/image-editor/index.d.ts +0 -3
- package/dist/ts/image-editor/index.ts +0 -3
- package/dist/ts/image-editor/renderer/index.d.ts +0 -1
- package/dist/ts/image-editor/renderer/index.ts +0 -1
- package/dist/ts/image-editor/renderer/toolbar.d.ts +0 -171
- package/dist/ts/image-editor/renderer/toolbar.ts +0 -6356
- package/dist/ts/index.d.ts +0 -4
- package/dist/ts/index.ts +0 -4
|
@@ -6437,8 +6437,12 @@ var Export = /** @__PURE__ @class */ (function () {
|
|
|
6437
6437
|
type = type ? type : 'Png';
|
|
6438
6438
|
parent.notify('shape', { prop: 'redrawActObj', onPropertyChange: false,
|
|
6439
6439
|
value: { x: null, y: null, isMouseDown: null } });
|
|
6440
|
+
var imageQualityObj = { currentImageQuality: 1 };
|
|
6441
|
+
if (type.toLowerCase() === 'jpeg') {
|
|
6442
|
+
parent.notify('toolbar', { prop: 'getcurrentImageQuality', onPropertyChange: false, value: { obj: imageQualityObj } });
|
|
6443
|
+
}
|
|
6440
6444
|
var beforeSave = { cancel: false, fileName: fileName ? fileName : imageName,
|
|
6441
|
-
fileType: type, imageQuality: imgQuality };
|
|
6445
|
+
fileType: type, imageQuality: imgQuality || imageQualityObj['currentImageQuality'] };
|
|
6442
6446
|
parent.trigger('beforeSave', beforeSave);
|
|
6443
6447
|
this.beforeSaveEvent(beforeSave, type, fileName, imageName, imgQuality);
|
|
6444
6448
|
}
|
|
@@ -6454,7 +6458,7 @@ var Export = /** @__PURE__ @class */ (function () {
|
|
|
6454
6458
|
this.toSVGImg(fileName);
|
|
6455
6459
|
}
|
|
6456
6460
|
else {
|
|
6457
|
-
this.toBlobFn(fileName, lowerCaseType, imgQuality);
|
|
6461
|
+
this.toBlobFn(fileName, lowerCaseType, observableSaveArgs.imageQuality || imgQuality);
|
|
6458
6462
|
}
|
|
6459
6463
|
var saved = { fileName: fileName ? fileName : imageName, fileType: type };
|
|
6460
6464
|
parent.trigger('saved', saved);
|
|
@@ -7937,6 +7941,15 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
|
|
|
7937
7941
|
case 'resetFreehandDrawSelectedId':
|
|
7938
7942
|
this.fhdSelID = null;
|
|
7939
7943
|
break;
|
|
7944
|
+
case 'getFHDSelected':
|
|
7945
|
+
args.value['obj']['isSelected'] = (this.parent.pointColl[this.fhdSelIdx] && this.parent.pointColl[this.fhdSelIdx].isSelected) ? this.parent.pointColl[this.fhdSelIdx].isSelected : false;
|
|
7946
|
+
break;
|
|
7947
|
+
case 'resetFHDIdx':
|
|
7948
|
+
this.fhdHovIdx = this.fhdSelID = this.fhdSelIdx = null;
|
|
7949
|
+
break;
|
|
7950
|
+
case 'getHighestOrder':
|
|
7951
|
+
this.getHighestOrder();
|
|
7952
|
+
break;
|
|
7940
7953
|
case 'getTempFreeHandDrawEditingStyles':
|
|
7941
7954
|
args.value['obj']['tempFreeHandDrawEditingStyles'] = this.tempFHDStyles;
|
|
7942
7955
|
break;
|
|
@@ -8119,10 +8132,11 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
|
|
|
8119
8132
|
parent.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false, value: { obj: selPointCollObj } });
|
|
8120
8133
|
prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
|
|
8121
8134
|
var fhCnt = parent.freehandCounter;
|
|
8122
|
-
var
|
|
8135
|
+
var penIndex = this.getHighestOrder();
|
|
8136
|
+
var order = parent.objColl.length + penIndex + 1;
|
|
8123
8137
|
parent.pointColl[fhCnt] = { points: extend([], parent.points), strokeColor: parent.activeObj.strokeSettings.strokeColor,
|
|
8124
8138
|
strokeWidth: this.penStrokeWidth, flipState: parent.transform.currFlipState,
|
|
8125
|
-
id: 'pen_' + (
|
|
8139
|
+
id: 'pen_' + (penIndex + 1), order: order };
|
|
8126
8140
|
parent.points = [];
|
|
8127
8141
|
this.dummyPoints = [];
|
|
8128
8142
|
this.selPointColl[fhCnt] = { points: extend([], this.selPoints) };
|
|
@@ -8137,7 +8151,7 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
|
|
|
8137
8151
|
previousCropObj: prevCropObj, previousText: null,
|
|
8138
8152
|
currentText: null, previousFilter: null, isCircleCrop: null } });
|
|
8139
8153
|
}
|
|
8140
|
-
var shapeSettings = { id: 'pen_' + (
|
|
8154
|
+
var shapeSettings = { id: 'pen_' + (penIndex + 1), type: ShapeType.FreehandDraw,
|
|
8141
8155
|
startX: this.freehandDownPoint.x, startY: this.freehandDownPoint.y,
|
|
8142
8156
|
strokeColor: parent.activeObj.strokeSettings.strokeColor, strokeWidth: this.penStrokeWidth,
|
|
8143
8157
|
points: parent.pointColl[this.currFHDIdx].points, index: order };
|
|
@@ -8146,6 +8160,17 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
|
|
|
8146
8160
|
this.triggerShapeChanging(shapeChangingArgs);
|
|
8147
8161
|
this.currFHDIdx++;
|
|
8148
8162
|
};
|
|
8163
|
+
FreehandDrawing.prototype.getHighestOrder = function () {
|
|
8164
|
+
var parent = this.parent;
|
|
8165
|
+
var index = 0;
|
|
8166
|
+
for (var i = 0; i < parent.pointColl.length; i++) {
|
|
8167
|
+
var value = parseInt(parent.pointColl[i].id.split('_')[1], 10);
|
|
8168
|
+
if (index < value) {
|
|
8169
|
+
index = value;
|
|
8170
|
+
}
|
|
8171
|
+
}
|
|
8172
|
+
return index;
|
|
8173
|
+
};
|
|
8149
8174
|
FreehandDrawing.prototype.freehandMoveHandler = function (e) {
|
|
8150
8175
|
this.isFreehandPointMoved = true;
|
|
8151
8176
|
var rect = this.parent.upperCanvas.getBoundingClientRect();
|
|
@@ -8534,6 +8559,7 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
|
|
|
8534
8559
|
}
|
|
8535
8560
|
parent.freehandCounter -= 1;
|
|
8536
8561
|
this.fhdHovIdx = this.fhdSelIdx = null;
|
|
8562
|
+
this.currFHDIdx--;
|
|
8537
8563
|
parent.notify('selection', { prop: 'resetFreehandDrawVariables' });
|
|
8538
8564
|
parent.notify('draw', { prop: 'render-image', value: { isMouseWheel: null } });
|
|
8539
8565
|
parent.notify('toolbar', { prop: 'refresh-main-toolbar', onPropertyChange: false });
|
|
@@ -8930,6 +8956,11 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
|
|
|
8930
8956
|
var parent = this.parent;
|
|
8931
8957
|
var point = parent.pointColl[this.fhdSelIdx];
|
|
8932
8958
|
parent.trigger('shapeChanging', shapeChangingArgs);
|
|
8959
|
+
if (shapeChangingArgs.cancel) {
|
|
8960
|
+
parent.editCompleteArgs = shapeChangingArgs;
|
|
8961
|
+
this.cancelFhd();
|
|
8962
|
+
return;
|
|
8963
|
+
}
|
|
8933
8964
|
if (parent.element.getAttribute('data-value') === 'mask-drawing' && !this.isMasking) {
|
|
8934
8965
|
this.isMasking = true;
|
|
8935
8966
|
parent.upperCanvas.style.cursor = 'crosshair';
|
|
@@ -12454,6 +12485,9 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12454
12485
|
var objColl = extend([], parent.objColl, [], true);
|
|
12455
12486
|
if (!isNullOrUndefined(obj['index']) && obj['index'] > -1) {
|
|
12456
12487
|
parent.notify('freehand-draw', { prop: 'selectFhd', value: { type: 'ok' } });
|
|
12488
|
+
if (!this.isFhdPoint) {
|
|
12489
|
+
return;
|
|
12490
|
+
}
|
|
12457
12491
|
parent.notify('freehand-draw', { prop: 'hoverFhd', onPropertyChange: false,
|
|
12458
12492
|
value: { strokeColor: null, strokeWidth: null } });
|
|
12459
12493
|
parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: true } });
|
|
@@ -12998,7 +13032,9 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12998
13032
|
this.currentDrawingShape = parent.drawingShape.toLowerCase();
|
|
12999
13033
|
if (dummyClick) {
|
|
13000
13034
|
parent.enableShapeDrawing(parent.toPascalCase(parent.drawingShape), true);
|
|
13001
|
-
parent.
|
|
13035
|
+
if (parent.cursor !== 'move') {
|
|
13036
|
+
parent.upperCanvas.style.cursor = 'crosshair';
|
|
13037
|
+
}
|
|
13002
13038
|
}
|
|
13003
13039
|
}
|
|
13004
13040
|
parent.isShapeDrawing = false;
|
|
@@ -14020,7 +14056,14 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
14020
14056
|
}
|
|
14021
14057
|
if (!this.isCropSelection && parent.activeObj.shape !== 'redact') {
|
|
14022
14058
|
parent.trigger('shapeChanging', shapeChangingArgs);
|
|
14023
|
-
|
|
14059
|
+
if (shapeChangingArgs.cancel) {
|
|
14060
|
+
parent.objColl.splice(i, 0, temp);
|
|
14061
|
+
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
14062
|
+
parent.notify('draw', { prop: 'render-image', value: { isMouseWheel: null } });
|
|
14063
|
+
}
|
|
14064
|
+
else {
|
|
14065
|
+
this.shapeEvent(shapeChangingArgs);
|
|
14066
|
+
}
|
|
14024
14067
|
parent.editCompleteArgs = shapeChangingArgs;
|
|
14025
14068
|
}
|
|
14026
14069
|
else {
|
|
@@ -21536,6 +21579,12 @@ var UndoRedo = /** @__PURE__ @class */ (function () {
|
|
|
21536
21579
|
parent.initialAdjustmentValue = this.lowerContext.filter;
|
|
21537
21580
|
parent.notify('filter', { prop: 'setBevelFilter', onPropertyChange: false, value: { bevelFilter: this.lowerContext.filter } });
|
|
21538
21581
|
var editCompleteArgs = { action: this.getUndoRedoAction(obj.operation) };
|
|
21582
|
+
var isSelected = void 0;
|
|
21583
|
+
if (obj.operation === 'freehanddraw' || obj.operation === 'freehand-draw') {
|
|
21584
|
+
var object = { isSelected: null };
|
|
21585
|
+
parent.notify('freehand-draw', { prop: 'getFHDSelected', onPropertyChange: false, value: { obj: object } });
|
|
21586
|
+
isSelected = object['isSelected'];
|
|
21587
|
+
}
|
|
21539
21588
|
switch (obj.operation) {
|
|
21540
21589
|
case 'shapeTransform':
|
|
21541
21590
|
case 'brightness':
|
|
@@ -21563,6 +21612,10 @@ var UndoRedo = /** @__PURE__ @class */ (function () {
|
|
|
21563
21612
|
this.updateFreehandDraw(obj.previousPointColl, obj.previousSelPointColl);
|
|
21564
21613
|
parent.notify('freehand-draw', { prop: 'setCurrentFreehandDrawIndex',
|
|
21565
21614
|
value: { value: parent.pointColl.length } });
|
|
21615
|
+
if (isSelected) {
|
|
21616
|
+
parent.notify('freehand-draw', { prop: 'resetFHDIdx' });
|
|
21617
|
+
parent.notify('selection', { prop: 'resetFreehandDrawVariables' });
|
|
21618
|
+
}
|
|
21566
21619
|
break;
|
|
21567
21620
|
case 'freehanddrawCustomized':
|
|
21568
21621
|
this.updateFreehandDrawCustomized(obj.previousObjColl, obj.previousPointColl);
|
|
@@ -27946,6 +27999,9 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
27946
27999
|
case 'getToolbarHeight':
|
|
27947
28000
|
args.value['obj']['toolbarHeight'] = this.toolbarHeight;
|
|
27948
28001
|
break;
|
|
28002
|
+
case 'getcurrentImageQuality':
|
|
28003
|
+
args.value['obj']['currentImageQuality'] = this.currentQuality;
|
|
28004
|
+
break;
|
|
27949
28005
|
case 'setToolbarHeight':
|
|
27950
28006
|
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.length > 0 && parent.toolbar.indexOf('Open') > -1)) {
|
|
27951
28007
|
this.toolbarHeight = args.value['height'];
|