@syncfusion/ej2-image-editor 20.3.50 → 20.3.56
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/CHANGELOG.md +16 -2
- 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 +149 -125
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +149 -125
- 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 +12 -12
- package/src/image-editor/image-editor-model.d.ts +1 -1
- package/src/image-editor/image-editor.d.ts +12 -1
- package/src/image-editor/image-editor.js +149 -125
- package/styles/image-editor/bootstrap-dark.scss +1 -0
- package/styles/image-editor/bootstrap.scss +1 -0
- package/styles/image-editor/bootstrap4.scss +1 -0
- package/styles/image-editor/bootstrap5-dark.scss +1 -0
- package/styles/image-editor/bootstrap5.scss +1 -0
- package/styles/image-editor/fabric-dark.scss +1 -0
- package/styles/image-editor/fabric.scss +1 -0
- package/styles/image-editor/fluent-dark.scss +1 -0
- package/styles/image-editor/fluent.scss +1 -0
- package/styles/image-editor/highcontrast-light.scss +1 -0
- package/styles/image-editor/highcontrast.scss +1 -0
- package/styles/image-editor/material-dark.scss +1 -0
- package/styles/image-editor/material.scss +1 -0
- package/styles/image-editor/tailwind-dark.scss +1 -0
- package/styles/image-editor/tailwind.scss +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Browser, Event, EventHandler, L10n, NotifyPropertyChanges, Property, addClass, compile, extend, getComponent, getInstance, getUniqueID, isNullOrUndefined, removeClass } from '@syncfusion/ej2-base';
|
|
1
|
+
import { Browser, Event, EventHandler, L10n, NotifyPropertyChanges, Property, addClass, compile, detach, extend, getComponent, getInstance, getUniqueID, isNullOrUndefined, removeClass, select } from '@syncfusion/ej2-base';
|
|
2
2
|
import { ColorPicker, SignatureBase, Uploader } from '@syncfusion/ej2-inputs';
|
|
3
3
|
import { Toolbar } from '@syncfusion/ej2-navigations';
|
|
4
4
|
import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
|
|
@@ -260,6 +260,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
260
260
|
if (!this.element.getAttribute('class')) {
|
|
261
261
|
this.element.removeAttribute('class');
|
|
262
262
|
}
|
|
263
|
+
this.destroySubComponents();
|
|
263
264
|
this.unwireEvent();
|
|
264
265
|
_super.prototype.destroy.call(this);
|
|
265
266
|
this.element.innerHTML = '';
|
|
@@ -326,6 +327,27 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
326
327
|
EventHandler.remove(this.lowerCanvas, 'mouseup', this.canvasMouseUpHandler);
|
|
327
328
|
EventHandler.remove(document, 'mouseup', this.canvasMouseUpHandler);
|
|
328
329
|
};
|
|
330
|
+
ImageEditor.prototype.destroySubComponents = function () {
|
|
331
|
+
var inputElement = this.element.querySelectorAll('input.e-control');
|
|
332
|
+
var divElement = this.element.querySelectorAll('div.e-control:not(.e-handle)');
|
|
333
|
+
var btnElement = this.element.querySelectorAll('button.e-control');
|
|
334
|
+
for (var i = 0, len = inputElement.length; i < len; i++) {
|
|
335
|
+
if (inputElement[i].classList.contains('e-color-picker')) {
|
|
336
|
+
getComponent(inputElement[i], 'color-picker').destroy();
|
|
337
|
+
detach(select('input#' + inputElement[i].id, this.element));
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
for (var i = 0, len = btnElement.length; i < len; i++) {
|
|
341
|
+
if (btnElement[i].classList.contains('e-dropdown-btn')) {
|
|
342
|
+
getComponent(btnElement[i], 'dropdown-btn').destroy();
|
|
343
|
+
detach(select('button#' + btnElement[i].id, this.element));
|
|
344
|
+
}
|
|
345
|
+
else if (btnElement[i].classList.contains('e-btn')) {
|
|
346
|
+
getComponent(btnElement[i], 'btn').destroy();
|
|
347
|
+
detach(select('button#' + btnElement[i].id, this.element));
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
};
|
|
329
351
|
ImageEditor.prototype.updateTheme = function () {
|
|
330
352
|
if (this.theme !== '') {
|
|
331
353
|
this.theme = this.toPascalCase(this.theme);
|
|
@@ -1055,7 +1077,9 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
1055
1077
|
args.element.parentElement.offsetHeight + 'px';
|
|
1056
1078
|
}
|
|
1057
1079
|
var activeBtn = spanElem_1.innerHTML;
|
|
1058
|
-
|
|
1080
|
+
if (activeBtn !== '') {
|
|
1081
|
+
args.element.querySelector('[aria-label = ' + '"' + activeBtn + '"' + ']').classList.add('e-selected-btn');
|
|
1082
|
+
}
|
|
1059
1083
|
},
|
|
1060
1084
|
select: function (args) {
|
|
1061
1085
|
spanElem_1.textContent = args.item.text;
|
|
@@ -1671,75 +1695,9 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
1671
1695
|
}
|
|
1672
1696
|
this.callMainToolbar(false);
|
|
1673
1697
|
break;
|
|
1674
|
-
case 'text':
|
|
1675
|
-
this.currObjType.isCustomCrop = false;
|
|
1676
|
-
imageEditorObj.drawShapeText();
|
|
1677
|
-
this.refreshToolbar(type);
|
|
1678
|
-
break;
|
|
1679
|
-
case 'pen':
|
|
1680
|
-
this.currObjType.isCustomCrop = false;
|
|
1681
|
-
this.freeHandDraw(true);
|
|
1682
|
-
this.refreshToolbar(type);
|
|
1683
|
-
break;
|
|
1684
1698
|
case 'reset':
|
|
1685
1699
|
imageEditorObj.reset();
|
|
1686
1700
|
break;
|
|
1687
|
-
case 'load':
|
|
1688
|
-
break;
|
|
1689
|
-
case 'save':
|
|
1690
|
-
break;
|
|
1691
|
-
case 'select':
|
|
1692
|
-
break;
|
|
1693
|
-
case 'bold':
|
|
1694
|
-
this.currObjType.isCustomCrop = false;
|
|
1695
|
-
if (!this.isBoldbtn) {
|
|
1696
|
-
this.activeObj.textSettings.bold = true;
|
|
1697
|
-
this.isBoldbtn = true;
|
|
1698
|
-
this.redrawText(ratio);
|
|
1699
|
-
}
|
|
1700
|
-
else {
|
|
1701
|
-
this.activeObj.textSettings.bold = false;
|
|
1702
|
-
this.isBoldbtn = false;
|
|
1703
|
-
this.redrawText(ratio);
|
|
1704
|
-
}
|
|
1705
|
-
break;
|
|
1706
|
-
case 'italic':
|
|
1707
|
-
this.currObjType.isCustomCrop = false;
|
|
1708
|
-
if (!this.isItalicbtn) {
|
|
1709
|
-
this.activeObj.textSettings.italic = true;
|
|
1710
|
-
if (this.activeObj.textSettings.bold) {
|
|
1711
|
-
this.upperContext.font = 'italic bold ' + this.activeObj.textSettings.fontSize + 'px' +
|
|
1712
|
-
' ' + this.activeObj.textSettings.fontFamily;
|
|
1713
|
-
}
|
|
1714
|
-
else {
|
|
1715
|
-
this.upperContext.font = 'italic ' + this.activeObj.textSettings.fontSize + 'px' + ' ' +
|
|
1716
|
-
this.activeObj.textSettings.fontFamily;
|
|
1717
|
-
}
|
|
1718
|
-
var width = this.upperContext.measureText(this.activeObj.keyHistory).width +
|
|
1719
|
-
this.activeObj.textSettings.fontSize * 0.5;
|
|
1720
|
-
var height = this.activeObj.textSettings.fontSize + this.activeObj.textSettings.fontSize * 0.25;
|
|
1721
|
-
this.setTextSelection(width, height);
|
|
1722
|
-
this.updateActiveObject(ratio, this.activeObj.activePoint, this.activeObj);
|
|
1723
|
-
this.redrawShape(this.activeObj);
|
|
1724
|
-
this.isItalicbtn = true;
|
|
1725
|
-
}
|
|
1726
|
-
else {
|
|
1727
|
-
this.activeObj.textSettings.italic = false;
|
|
1728
|
-
if (this.activeObj.textSettings.bold) {
|
|
1729
|
-
this.upperContext.font = 'bold ' + this.activeObj.textSettings.fontSize + 'px' + ' ' + this.activeObj.textSettings.fontFamily;
|
|
1730
|
-
}
|
|
1731
|
-
else {
|
|
1732
|
-
this.upperContext.font = this.activeObj.textSettings.fontSize + 'px' + ' ' + this.activeObj.textSettings.fontFamily;
|
|
1733
|
-
}
|
|
1734
|
-
var width = this.upperContext.measureText(this.activeObj.keyHistory).width +
|
|
1735
|
-
this.activeObj.textSettings.fontSize * 0.5;
|
|
1736
|
-
var height = this.activeObj.textSettings.fontSize + this.activeObj.textSettings.fontSize * 0.25;
|
|
1737
|
-
this.setTextSelection(width, height);
|
|
1738
|
-
this.updateActiveObject(ratio, this.activeObj.activePoint, this.activeObj);
|
|
1739
|
-
this.redrawShape(this.activeObj);
|
|
1740
|
-
this.isItalicbtn = false;
|
|
1741
|
-
}
|
|
1742
|
-
break;
|
|
1743
1701
|
}
|
|
1744
1702
|
}
|
|
1745
1703
|
this.trigger('toolbarItemClicked', args);
|
|
@@ -2928,7 +2886,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
2928
2886
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
2929
2887
|
var proxy = this;
|
|
2930
2888
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
2931
|
-
var xform = new DOMMatrix();
|
|
2889
|
+
var xform = new DOMMatrix([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
|
|
2932
2890
|
ctx.getTransform = function () {
|
|
2933
2891
|
return xform;
|
|
2934
2892
|
};
|
|
@@ -2969,7 +2927,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
2969
2927
|
var transform = ctx.transform;
|
|
2970
2928
|
ctx.transform = function (a, b, c, d, e, f) {
|
|
2971
2929
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
2972
|
-
var m2 = new DOMMatrix();
|
|
2930
|
+
var m2 = new DOMMatrix([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
|
|
2973
2931
|
m2.a = a;
|
|
2974
2932
|
m2.b = b;
|
|
2975
2933
|
m2.c = c;
|
|
@@ -6097,22 +6055,6 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
6097
6055
|
this.updateActiveObject(ratio, this.objColl[i].activePoint, this.objColl[i]);
|
|
6098
6056
|
}
|
|
6099
6057
|
}
|
|
6100
|
-
else if (degree === 'zoom') {
|
|
6101
|
-
for (var i = 0; i < this.objColl.length; i++) {
|
|
6102
|
-
this.objColl[i].activePoint.startX /= ratio.width;
|
|
6103
|
-
this.objColl[i].activePoint.startY /= ratio.height;
|
|
6104
|
-
this.objColl[i].activePoint.endX /= ratio.width;
|
|
6105
|
-
this.objColl[i].activePoint.endY /= ratio.height;
|
|
6106
|
-
this.objColl[i].activePoint.height = this.objColl[i].activePoint.endX - this.objColl[i].activePoint.startX;
|
|
6107
|
-
this.objColl[i].activePoint.width = this.objColl[i].activePoint.endY - this.objColl[i].activePoint.startY;
|
|
6108
|
-
this.objColl[i].activePoint.startX *= ratio.width;
|
|
6109
|
-
this.objColl[i].activePoint.startY *= ratio.height;
|
|
6110
|
-
this.objColl[i].activePoint.endX *= ratio.width;
|
|
6111
|
-
this.objColl[i].activePoint.endY *= ratio.height;
|
|
6112
|
-
this.objColl[i].activePoint.width = this.objColl[i].activePoint.endX - this.objColl[i].activePoint.startX;
|
|
6113
|
-
this.objColl[i].activePoint.height = this.objColl[i].activePoint.endY - this.objColl[i].activePoint.startY;
|
|
6114
|
-
}
|
|
6115
|
-
}
|
|
6116
6058
|
};
|
|
6117
6059
|
ImageEditor.prototype.calcCurrPoints = function (degree, obj) {
|
|
6118
6060
|
var oldRatio = this.calcPrevRatio();
|
|
@@ -6448,6 +6390,51 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
6448
6390
|
}
|
|
6449
6391
|
return inRange;
|
|
6450
6392
|
};
|
|
6393
|
+
ImageEditor.prototype.rotateMultiple = function (length, degree) {
|
|
6394
|
+
for (var i = 0; i < length; i++) {
|
|
6395
|
+
if (degree > 0) {
|
|
6396
|
+
this.degree += 90;
|
|
6397
|
+
}
|
|
6398
|
+
else {
|
|
6399
|
+
this.degree -= 90;
|
|
6400
|
+
}
|
|
6401
|
+
if (this.degree === 360) {
|
|
6402
|
+
this.degree = 0;
|
|
6403
|
+
}
|
|
6404
|
+
this.lowerContext.save();
|
|
6405
|
+
this.setMaximumDimension(90 * (i + 1));
|
|
6406
|
+
this.lowerContext.translate(this.lowerCanvas.width / 2, this.lowerCanvas.height / 2);
|
|
6407
|
+
if (degree > 0) {
|
|
6408
|
+
this.lowerContext.rotate(Math.PI / 180 * 90);
|
|
6409
|
+
}
|
|
6410
|
+
else {
|
|
6411
|
+
this.lowerContext.rotate(Math.PI / 180 * -90);
|
|
6412
|
+
}
|
|
6413
|
+
this.lowerCanvas.style.left = this.upperCanvas.style.left = (this.element.clientWidth - parseInt(this.lowerCanvas.style.maxWidth, 10) - 18) / 2 + 1 + 'px';
|
|
6414
|
+
this.lowerCanvas.style.top = this.upperCanvas.style.top = (this.element.clientHeight - this.toolbarHeight - parseInt(this.lowerCanvas.style.maxHeight, 10)) / 2 + 1 + 'px';
|
|
6415
|
+
this.lowerContext.drawImage(this.inMemoryCanvas, -this.lowerCanvas.height / 2, -this.lowerCanvas.width / 2);
|
|
6416
|
+
if (degree > 0) {
|
|
6417
|
+
this.lowerContext.rotate(Math.PI / 180 * -90);
|
|
6418
|
+
}
|
|
6419
|
+
else {
|
|
6420
|
+
this.lowerContext.rotate(Math.PI / 180 * 90);
|
|
6421
|
+
}
|
|
6422
|
+
this.lowerContext.translate(-this.lowerCanvas.width / 2, -this.lowerCanvas.height / 2);
|
|
6423
|
+
this.lowerContext.restore();
|
|
6424
|
+
this.currImgData = this.lowerContext.getImageData(0, 0, this.lowerCanvas.width, this.lowerCanvas.height);
|
|
6425
|
+
this.inMemoryContext.clearRect(0, 0, this.lowerCanvas.width, this.lowerCanvas.height);
|
|
6426
|
+
this.inMemoryCanvas.width = this.currImgData.width;
|
|
6427
|
+
this.inMemoryCanvas.height = this.currImgData.height;
|
|
6428
|
+
this.inMemoryContext.putImageData(this.currImgData, 0, 0);
|
|
6429
|
+
this.lowerContext.drawImage(this.inMemoryCanvas, 0, 0);
|
|
6430
|
+
if (degree > 0) {
|
|
6431
|
+
this.redrawObj(90);
|
|
6432
|
+
}
|
|
6433
|
+
else {
|
|
6434
|
+
this.redrawObj(-90);
|
|
6435
|
+
}
|
|
6436
|
+
}
|
|
6437
|
+
};
|
|
6451
6438
|
/**
|
|
6452
6439
|
* Clear a current selection.
|
|
6453
6440
|
*
|
|
@@ -6896,8 +6883,6 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
6896
6883
|
isRotate = true;
|
|
6897
6884
|
var transitionArgs = { degree: degree };
|
|
6898
6885
|
this.trigger('rotating', transitionArgs);
|
|
6899
|
-
this.rotateMethod = true;
|
|
6900
|
-
this.lastAction = 'rotate';
|
|
6901
6886
|
var splitWords = [];
|
|
6902
6887
|
var activeObjShape = void 0;
|
|
6903
6888
|
if (!isNullOrUndefined(this.activeObj.activePoint)) {
|
|
@@ -6909,32 +6894,40 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
6909
6894
|
}
|
|
6910
6895
|
}
|
|
6911
6896
|
this.redrawActObj();
|
|
6897
|
+
var factor = this.factor;
|
|
6912
6898
|
if (this.factor !== 1) {
|
|
6913
6899
|
this.lowerContext.setTransform(1, 0, 0, 1, 0, 0);
|
|
6914
6900
|
this.upperContext.setTransform(1, 0, 0, 1, 0, 0);
|
|
6915
6901
|
this.factor = 1;
|
|
6916
6902
|
this.refreshToolbar('main');
|
|
6917
6903
|
}
|
|
6918
|
-
|
|
6919
|
-
if (
|
|
6920
|
-
this.degree
|
|
6904
|
+
var length_1 = Math.abs(degree / 90);
|
|
6905
|
+
if (length_1 > 1) {
|
|
6906
|
+
this.rotateMultiple(length_1, degree);
|
|
6907
|
+
}
|
|
6908
|
+
else {
|
|
6909
|
+
this.degree += degree;
|
|
6910
|
+
if (this.degree === 360) {
|
|
6911
|
+
this.degree = 0;
|
|
6912
|
+
}
|
|
6913
|
+
this.lowerContext.save();
|
|
6914
|
+
this.setMaximumDimension(this.degree);
|
|
6915
|
+
this.lowerContext.translate(this.lowerCanvas.width / 2, this.lowerCanvas.height / 2);
|
|
6916
|
+
this.lowerContext.rotate(Math.PI / 180 * degree);
|
|
6917
|
+
this.lowerCanvas.style.left = this.upperCanvas.style.left = (this.element.clientWidth - parseInt(this.lowerCanvas.style.maxWidth, 10) - 18) / 2 + 1 + 'px';
|
|
6918
|
+
this.lowerCanvas.style.top = this.upperCanvas.style.top = (this.element.clientHeight - this.toolbarHeight - parseInt(this.lowerCanvas.style.maxHeight, 10)) / 2 + 1 + 'px';
|
|
6919
|
+
this.lowerContext.drawImage(this.inMemoryCanvas, -this.lowerCanvas.height / 2, -this.lowerCanvas.width / 2);
|
|
6920
|
+
this.lowerContext.rotate(Math.PI / 180 * -degree);
|
|
6921
|
+
this.lowerContext.translate(-this.lowerCanvas.width / 2, -this.lowerCanvas.height / 2);
|
|
6922
|
+
this.lowerContext.restore();
|
|
6923
|
+
this.currImgData = this.lowerContext.getImageData(0, 0, this.lowerCanvas.width, this.lowerCanvas.height);
|
|
6924
|
+
this.inMemoryContext.clearRect(0, 0, this.lowerCanvas.width, this.lowerCanvas.height);
|
|
6925
|
+
this.inMemoryCanvas.width = this.currImgData.width;
|
|
6926
|
+
this.inMemoryCanvas.height = this.currImgData.height;
|
|
6927
|
+
this.inMemoryContext.putImageData(this.currImgData, 0, 0);
|
|
6928
|
+
this.lowerContext.drawImage(this.inMemoryCanvas, 0, 0);
|
|
6929
|
+
this.redrawObj(degree);
|
|
6921
6930
|
}
|
|
6922
|
-
this.lowerContext.save();
|
|
6923
|
-
this.setMaximumDimension(this.degree);
|
|
6924
|
-
this.lowerContext.translate(this.lowerCanvas.width / 2, this.lowerCanvas.height / 2);
|
|
6925
|
-
this.lowerContext.rotate(Math.PI / 180 * degree);
|
|
6926
|
-
this.lowerCanvas.style.left = this.upperCanvas.style.left = (this.element.clientWidth - parseInt(this.lowerCanvas.style.maxWidth, 10) - 18) / 2 + 1 + 'px';
|
|
6927
|
-
this.lowerCanvas.style.top = this.upperCanvas.style.top = (this.element.clientHeight - this.toolbarHeight - parseInt(this.lowerCanvas.style.maxHeight, 10)) / 2 + 1 + 'px';
|
|
6928
|
-
this.lowerContext.drawImage(this.inMemoryCanvas, -this.lowerCanvas.height / 2, -this.lowerCanvas.width / 2);
|
|
6929
|
-
this.lowerContext.rotate(Math.PI / 180 * -degree);
|
|
6930
|
-
this.lowerContext.translate(-this.lowerCanvas.width / 2, -this.lowerCanvas.height / 2);
|
|
6931
|
-
this.lowerContext.restore();
|
|
6932
|
-
this.currImgData = this.lowerContext.getImageData(0, 0, this.lowerCanvas.width, this.lowerCanvas.height);
|
|
6933
|
-
this.inMemoryContext.clearRect(0, 0, this.lowerCanvas.width, this.lowerCanvas.height);
|
|
6934
|
-
this.inMemoryCanvas.width = this.currImgData.width;
|
|
6935
|
-
this.inMemoryCanvas.height = this.currImgData.height;
|
|
6936
|
-
this.inMemoryContext.putImageData(this.currImgData, 0, 0);
|
|
6937
|
-
this.redrawObj(degree);
|
|
6938
6931
|
if (!isNullOrUndefined(activeObjShape)) {
|
|
6939
6932
|
if (activeObjShape === 'custom') {
|
|
6940
6933
|
var endPoint = { x: this.lowerCanvas.width - this.pannEnd.startX, y: this.lowerCanvas.height - this.pannEnd.startY };
|
|
@@ -6950,11 +6943,11 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
6950
6943
|
}
|
|
6951
6944
|
this.factor = 1;
|
|
6952
6945
|
if (!this.isUndoRedo) {
|
|
6953
|
-
this.updateUndoRedoColl('rotate', degree, this.objColl);
|
|
6946
|
+
this.updateUndoRedoColl('rotate', degree, this.objColl, null);
|
|
6954
6947
|
}
|
|
6955
6948
|
this.isUndoRedo = false;
|
|
6949
|
+
this.refreshToolbar('main');
|
|
6956
6950
|
}
|
|
6957
|
-
this.rotateMethod = false;
|
|
6958
6951
|
return isRotate;
|
|
6959
6952
|
};
|
|
6960
6953
|
/**
|
|
@@ -6987,8 +6980,8 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
6987
6980
|
}
|
|
6988
6981
|
type = type ? type : 'Png';
|
|
6989
6982
|
this.redrawActObj();
|
|
6990
|
-
var beforeSave = { cancel: false, fileName: 'ImageEditor', fileType: type };
|
|
6991
|
-
var saved_1 = { fileName: 'ImageEditor', fileType: type };
|
|
6983
|
+
var beforeSave = { cancel: false, fileName: fileName ? fileName : 'ImageEditor', fileType: type };
|
|
6984
|
+
var saved_1 = { fileName: fileName ? fileName : 'ImageEditor', fileType: type };
|
|
6992
6985
|
this.trigger('beforeSave', beforeSave, function (observableSaveArgs) {
|
|
6993
6986
|
if (!observableSaveArgs.cancel) {
|
|
6994
6987
|
fileName = observableSaveArgs.fileName ? observableSaveArgs.fileName : fileName;
|
|
@@ -7098,7 +7091,8 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
7098
7091
|
*
|
|
7099
7092
|
* @param {boolean} value - Specifies a value whether enable or disable freehand drawing.
|
|
7100
7093
|
*
|
|
7101
|
-
*
|
|
7094
|
+
* @returns {void}.
|
|
7095
|
+
* @private
|
|
7102
7096
|
*/
|
|
7103
7097
|
ImageEditor.prototype.freeHandDraw = function (value) {
|
|
7104
7098
|
if (value) {
|
|
@@ -7112,6 +7106,16 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
7112
7106
|
}
|
|
7113
7107
|
this.refreshToolbar('pen');
|
|
7114
7108
|
};
|
|
7109
|
+
/**
|
|
7110
|
+
* Enable or disable a freehand drawing in an Image Editor.
|
|
7111
|
+
*
|
|
7112
|
+
* @param {boolean} value - Specifies a value whether enable or disable freehand drawing.
|
|
7113
|
+
*
|
|
7114
|
+
* @returns {void}.
|
|
7115
|
+
*/
|
|
7116
|
+
ImageEditor.prototype.freehandDraw = function (value) {
|
|
7117
|
+
this.freeHandDraw(value);
|
|
7118
|
+
};
|
|
7115
7119
|
/**
|
|
7116
7120
|
* Enable or disable a panning on the Image Editor.
|
|
7117
7121
|
*
|
|
@@ -7392,7 +7396,15 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
7392
7396
|
isSelected = true;
|
|
7393
7397
|
this.activeObj = obj;
|
|
7394
7398
|
this.redrawShape(this.activeObj);
|
|
7395
|
-
this.
|
|
7399
|
+
if (this.activeObj.shape === 'text') {
|
|
7400
|
+
this.refreshToolbar('text');
|
|
7401
|
+
}
|
|
7402
|
+
else if (this.activeObj.shape === 'pen') {
|
|
7403
|
+
this.refreshToolbar('pen');
|
|
7404
|
+
}
|
|
7405
|
+
else {
|
|
7406
|
+
this.refreshToolbar('shapes');
|
|
7407
|
+
}
|
|
7396
7408
|
this.updateToolbarItems(this.calcRatio());
|
|
7397
7409
|
}
|
|
7398
7410
|
return isSelected;
|
|
@@ -7504,7 +7516,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
7504
7516
|
* @private
|
|
7505
7517
|
*/
|
|
7506
7518
|
ImageEditor.prototype.canUndo = function () {
|
|
7507
|
-
return
|
|
7519
|
+
return false;
|
|
7508
7520
|
};
|
|
7509
7521
|
/**
|
|
7510
7522
|
* To check whether the redo collection is empty or not.
|
|
@@ -7513,7 +7525,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
7513
7525
|
* @private
|
|
7514
7526
|
*/
|
|
7515
7527
|
ImageEditor.prototype.canRedo = function () {
|
|
7516
|
-
return
|
|
7528
|
+
return false;
|
|
7517
7529
|
};
|
|
7518
7530
|
/**
|
|
7519
7531
|
* Erases all the signature strokes signed by user.
|
|
@@ -7522,7 +7534,9 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
7522
7534
|
* @private
|
|
7523
7535
|
*/
|
|
7524
7536
|
ImageEditor.prototype.clear = function () {
|
|
7525
|
-
|
|
7537
|
+
if (this.getModuleName() !== 'image-editor') {
|
|
7538
|
+
_super.prototype.clear.call(this);
|
|
7539
|
+
}
|
|
7526
7540
|
};
|
|
7527
7541
|
/**
|
|
7528
7542
|
* To draw the signature based on the given text, with the font family and font size.
|
|
@@ -7535,7 +7549,9 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
7535
7549
|
* @private
|
|
7536
7550
|
*/
|
|
7537
7551
|
ImageEditor.prototype.draw = function (text, fontFamily, fontSize) {
|
|
7538
|
-
|
|
7552
|
+
if (this.getModuleName() !== 'image-editor') {
|
|
7553
|
+
_super.prototype.draw.call(this, text, fontFamily, fontSize);
|
|
7554
|
+
}
|
|
7539
7555
|
};
|
|
7540
7556
|
/**
|
|
7541
7557
|
* To get the signature as Blob.
|
|
@@ -7545,7 +7561,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
7545
7561
|
* @private
|
|
7546
7562
|
*/
|
|
7547
7563
|
ImageEditor.prototype.getBlob = function (url) {
|
|
7548
|
-
return
|
|
7564
|
+
return null;
|
|
7549
7565
|
};
|
|
7550
7566
|
/**
|
|
7551
7567
|
* To check whether the signature is empty or not.
|
|
@@ -7554,7 +7570,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
7554
7570
|
* @private
|
|
7555
7571
|
*/
|
|
7556
7572
|
ImageEditor.prototype.isEmpty = function () {
|
|
7557
|
-
return
|
|
7573
|
+
return false;
|
|
7558
7574
|
};
|
|
7559
7575
|
/**
|
|
7560
7576
|
* To load the signature with the given base 64 string, height and width.
|
|
@@ -7566,7 +7582,9 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
7566
7582
|
* @private
|
|
7567
7583
|
*/
|
|
7568
7584
|
ImageEditor.prototype.load = function (signature, width, height) {
|
|
7569
|
-
|
|
7585
|
+
if (this.getModuleName() !== 'image-editor') {
|
|
7586
|
+
_super.prototype.load.call(this, signature, width, height);
|
|
7587
|
+
}
|
|
7570
7588
|
};
|
|
7571
7589
|
/**
|
|
7572
7590
|
* Undo the last user action.
|
|
@@ -7575,7 +7593,9 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
7575
7593
|
* @private
|
|
7576
7594
|
*/
|
|
7577
7595
|
ImageEditor.prototype.undo = function () {
|
|
7578
|
-
|
|
7596
|
+
if (this.getModuleName() !== 'image-editor') {
|
|
7597
|
+
_super.prototype.undo.call(this);
|
|
7598
|
+
}
|
|
7579
7599
|
};
|
|
7580
7600
|
/**
|
|
7581
7601
|
* Redo the last user action.
|
|
@@ -7584,7 +7604,9 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
7584
7604
|
* @private
|
|
7585
7605
|
*/
|
|
7586
7606
|
ImageEditor.prototype.redo = function () {
|
|
7587
|
-
|
|
7607
|
+
if (this.getModuleName() !== 'image-editor') {
|
|
7608
|
+
_super.prototype.redo.call(this);
|
|
7609
|
+
}
|
|
7588
7610
|
};
|
|
7589
7611
|
/**
|
|
7590
7612
|
* To save the signature with the given file type and file name.
|
|
@@ -7596,7 +7618,9 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
7596
7618
|
* @private
|
|
7597
7619
|
*/
|
|
7598
7620
|
ImageEditor.prototype.save = function (type, fileName) {
|
|
7599
|
-
|
|
7621
|
+
if (this.getModuleName() !== 'image-editor') {
|
|
7622
|
+
_super.prototype.save.call(this, type, fileName);
|
|
7623
|
+
}
|
|
7600
7624
|
};
|
|
7601
7625
|
/**
|
|
7602
7626
|
* To save the signature as Blob.
|
|
@@ -7605,7 +7629,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
7605
7629
|
* @private
|
|
7606
7630
|
*/
|
|
7607
7631
|
ImageEditor.prototype.saveAsBlob = function () {
|
|
7608
|
-
return
|
|
7632
|
+
return null;
|
|
7609
7633
|
};
|
|
7610
7634
|
/**
|
|
7611
7635
|
* Returns the persistence data for component.
|
|
@@ -7614,7 +7638,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
7614
7638
|
* @private
|
|
7615
7639
|
*/
|
|
7616
7640
|
ImageEditor.prototype.getLocalData = function () {
|
|
7617
|
-
return
|
|
7641
|
+
return null;
|
|
7618
7642
|
};
|
|
7619
7643
|
var ImageEditor_1;
|
|
7620
7644
|
__decorate([
|