@syncfusion/ej2-image-editor 20.3.48 → 20.3.50
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 +8 -0
- 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 +162 -2
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +162 -2
- 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 +10 -10
- package/src/image-editor/image-editor-model.d.ts +93 -0
- package/src/image-editor/image-editor.d.ts +184 -0
- package/src/image-editor/image-editor.js +162 -2
|
@@ -2139,12 +2139,21 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
2139
2139
|
wrapperWidth = this.element.clientWidth;
|
|
2140
2140
|
}
|
|
2141
2141
|
var maxDimension = this.calcMaxDimension(this.baseImg.width, this.baseImg.height);
|
|
2142
|
+
var toolbarHeight = 0;
|
|
2143
|
+
if (!isNullOrUndefined(this.toolbarTemplate) && !isNullOrUndefined(document.querySelector('.e-toolbar'))) {
|
|
2144
|
+
toolbarHeight = document.querySelector('.e-toolbar').clientHeight;
|
|
2145
|
+
maxDimension.width -= toolbarHeight;
|
|
2146
|
+
maxDimension.height -= toolbarHeight;
|
|
2147
|
+
}
|
|
2142
2148
|
this.lowerContext.clearRect(0, 0, this.lowerCanvas.width, this.lowerCanvas.height);
|
|
2143
2149
|
this.lowerCanvas.width = this.upperCanvas.width = this.inMemoryCanvas.width = this.baseImg.width;
|
|
2144
2150
|
this.lowerCanvas.height = this.upperCanvas.height = this.inMemoryCanvas.height = this.baseImg.height;
|
|
2145
2151
|
this.lowerCanvas.style.maxWidth = this.upperCanvas.style.maxWidth = maxDimension.width + 'px';
|
|
2146
2152
|
this.lowerCanvas.style.maxHeight = this.upperCanvas.style.maxHeight = maxDimension.height + 'px';
|
|
2147
2153
|
this.lowerCanvas.style.left = this.upperCanvas.style.left = (wrapperWidth - maxDimension.width) / 2 + 1 + 'px';
|
|
2154
|
+
if (!isNullOrUndefined(this.toolbarTemplate)) {
|
|
2155
|
+
this.lowerCanvas.style.left = parseFloat(this.lowerCanvas.style.left) + (toolbarHeight / 2) + 'px';
|
|
2156
|
+
}
|
|
2148
2157
|
if (canvasWrapper) {
|
|
2149
2158
|
this.lowerCanvas.style.top = this.upperCanvas.style.top = (parseFloat(canvasWrapper.style.height) - maxDimension.height - 1) / 2 + 'px';
|
|
2150
2159
|
}
|
|
@@ -6774,7 +6783,9 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
6774
6783
|
(isNullOrUndefined(document.getElementById(this.element.id + '_toolbar')))) {
|
|
6775
6784
|
this.toolbarHeight = 0;
|
|
6776
6785
|
}
|
|
6777
|
-
this.
|
|
6786
|
+
if (isNullOrUndefined(this.toolbarTemplate)) {
|
|
6787
|
+
this.update();
|
|
6788
|
+
}
|
|
6778
6789
|
var type = typeof (data);
|
|
6779
6790
|
if (type === 'string') {
|
|
6780
6791
|
this.imageOnLoad(data);
|
|
@@ -7242,7 +7253,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
7242
7253
|
}
|
|
7243
7254
|
this.currObjType.isCustomCrop = false;
|
|
7244
7255
|
var start = { x: x, y: y };
|
|
7245
|
-
this.drawShape('
|
|
7256
|
+
this.drawShape('ellipse', strokeWidth, strokeColor, fillColor, start, radiusX, radiusY);
|
|
7246
7257
|
}
|
|
7247
7258
|
return isEllipse;
|
|
7248
7259
|
};
|
|
@@ -7486,6 +7497,125 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
7486
7497
|
this.lowerContext.clearRect(0, 0, this.lowerCanvas.width, this.lowerCanvas.height);
|
|
7487
7498
|
this.upperContext.clearRect(0, 0, this.upperCanvas.width, this.upperCanvas.height);
|
|
7488
7499
|
};
|
|
7500
|
+
/**
|
|
7501
|
+
* To check whether the undo collection is empty or not.
|
|
7502
|
+
*
|
|
7503
|
+
* @returns {boolean}.
|
|
7504
|
+
* @private
|
|
7505
|
+
*/
|
|
7506
|
+
ImageEditor.prototype.canUndo = function () {
|
|
7507
|
+
return _super.prototype.canUndo.call(this);
|
|
7508
|
+
};
|
|
7509
|
+
/**
|
|
7510
|
+
* To check whether the redo collection is empty or not.
|
|
7511
|
+
*
|
|
7512
|
+
* @returns {boolean}.
|
|
7513
|
+
* @private
|
|
7514
|
+
*/
|
|
7515
|
+
ImageEditor.prototype.canRedo = function () {
|
|
7516
|
+
return _super.prototype.canRedo.call(this);
|
|
7517
|
+
};
|
|
7518
|
+
/**
|
|
7519
|
+
* Erases all the signature strokes signed by user.
|
|
7520
|
+
*
|
|
7521
|
+
* @returns {void}.
|
|
7522
|
+
* @private
|
|
7523
|
+
*/
|
|
7524
|
+
ImageEditor.prototype.clear = function () {
|
|
7525
|
+
_super.prototype.clear.call(this);
|
|
7526
|
+
};
|
|
7527
|
+
/**
|
|
7528
|
+
* To draw the signature based on the given text, with the font family and font size.
|
|
7529
|
+
*
|
|
7530
|
+
* @param {string} text - specify text to be drawn as signature.
|
|
7531
|
+
* @param {string} fontFamily - specify font family of a signature.
|
|
7532
|
+
* @param {number} fontSize - specify font size of a signature.
|
|
7533
|
+
*
|
|
7534
|
+
* @returns {void}.
|
|
7535
|
+
* @private
|
|
7536
|
+
*/
|
|
7537
|
+
ImageEditor.prototype.draw = function (text, fontFamily, fontSize) {
|
|
7538
|
+
_super.prototype.draw.call(this, text, fontFamily, fontSize);
|
|
7539
|
+
};
|
|
7540
|
+
/**
|
|
7541
|
+
* To get the signature as Blob.
|
|
7542
|
+
*
|
|
7543
|
+
* @param {string} url - specify the url/base 64 string to get blob of the signature.
|
|
7544
|
+
* @returns {Blob}.
|
|
7545
|
+
* @private
|
|
7546
|
+
*/
|
|
7547
|
+
ImageEditor.prototype.getBlob = function (url) {
|
|
7548
|
+
return _super.prototype.getBlob.call(this, url);
|
|
7549
|
+
};
|
|
7550
|
+
/**
|
|
7551
|
+
* To check whether the signature is empty or not.
|
|
7552
|
+
*
|
|
7553
|
+
* @returns {boolean}.
|
|
7554
|
+
* @private
|
|
7555
|
+
*/
|
|
7556
|
+
ImageEditor.prototype.isEmpty = function () {
|
|
7557
|
+
return _super.prototype.isEmpty.call(this);
|
|
7558
|
+
};
|
|
7559
|
+
/**
|
|
7560
|
+
* To load the signature with the given base 64 string, height and width.
|
|
7561
|
+
*
|
|
7562
|
+
* @param {string} signature - specify the url/base 64 string to be drawn as signature.
|
|
7563
|
+
* @param {number} width - specify the width of the loaded signature image.
|
|
7564
|
+
* @param {number} height - specify the height of the loaded signature image.
|
|
7565
|
+
* @returns {void}.
|
|
7566
|
+
* @private
|
|
7567
|
+
*/
|
|
7568
|
+
ImageEditor.prototype.load = function (signature, width, height) {
|
|
7569
|
+
_super.prototype.load.call(this, signature, width, height);
|
|
7570
|
+
};
|
|
7571
|
+
/**
|
|
7572
|
+
* Undo the last user action.
|
|
7573
|
+
*
|
|
7574
|
+
* @returns {void}.
|
|
7575
|
+
* @private
|
|
7576
|
+
*/
|
|
7577
|
+
ImageEditor.prototype.undo = function () {
|
|
7578
|
+
_super.prototype.undo.call(this);
|
|
7579
|
+
};
|
|
7580
|
+
/**
|
|
7581
|
+
* Redo the last user action.
|
|
7582
|
+
*
|
|
7583
|
+
* @returns {void}.
|
|
7584
|
+
* @private
|
|
7585
|
+
*/
|
|
7586
|
+
ImageEditor.prototype.redo = function () {
|
|
7587
|
+
_super.prototype.redo.call(this);
|
|
7588
|
+
};
|
|
7589
|
+
/**
|
|
7590
|
+
* To save the signature with the given file type and file name.
|
|
7591
|
+
*
|
|
7592
|
+
* @param {SignatureFileType} type - specify type of the file to be saved a signature.
|
|
7593
|
+
* @param {string} fileName - specify name of the file to be saved a signature.
|
|
7594
|
+
*
|
|
7595
|
+
* @returns {void}.
|
|
7596
|
+
* @private
|
|
7597
|
+
*/
|
|
7598
|
+
ImageEditor.prototype.save = function (type, fileName) {
|
|
7599
|
+
_super.prototype.save.call(this, type, fileName);
|
|
7600
|
+
};
|
|
7601
|
+
/**
|
|
7602
|
+
* To save the signature as Blob.
|
|
7603
|
+
*
|
|
7604
|
+
* @returns {Blob}.
|
|
7605
|
+
* @private
|
|
7606
|
+
*/
|
|
7607
|
+
ImageEditor.prototype.saveAsBlob = function () {
|
|
7608
|
+
return _super.prototype.saveAsBlob.call(this);
|
|
7609
|
+
};
|
|
7610
|
+
/**
|
|
7611
|
+
* Returns the persistence data for component.
|
|
7612
|
+
*
|
|
7613
|
+
* @returns any.
|
|
7614
|
+
* @private
|
|
7615
|
+
*/
|
|
7616
|
+
ImageEditor.prototype.getLocalData = function () {
|
|
7617
|
+
return _super.prototype.getLocalData.call(this);
|
|
7618
|
+
};
|
|
7489
7619
|
var ImageEditor_1;
|
|
7490
7620
|
__decorate([
|
|
7491
7621
|
Property('')
|
|
@@ -7508,6 +7638,36 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
7508
7638
|
__decorate([
|
|
7509
7639
|
Property('100%')
|
|
7510
7640
|
], ImageEditor.prototype, "width", void 0);
|
|
7641
|
+
__decorate([
|
|
7642
|
+
Property('')
|
|
7643
|
+
], ImageEditor.prototype, "backgroundColor", void 0);
|
|
7644
|
+
__decorate([
|
|
7645
|
+
Property('')
|
|
7646
|
+
], ImageEditor.prototype, "backgroundImage", void 0);
|
|
7647
|
+
__decorate([
|
|
7648
|
+
Property(false)
|
|
7649
|
+
], ImageEditor.prototype, "isReadOnly", void 0);
|
|
7650
|
+
__decorate([
|
|
7651
|
+
Property(true)
|
|
7652
|
+
], ImageEditor.prototype, "saveWithBackground", void 0);
|
|
7653
|
+
__decorate([
|
|
7654
|
+
Property('#000000')
|
|
7655
|
+
], ImageEditor.prototype, "strokeColor", void 0);
|
|
7656
|
+
__decorate([
|
|
7657
|
+
Property(0.5)
|
|
7658
|
+
], ImageEditor.prototype, "minStrokeWidth", void 0);
|
|
7659
|
+
__decorate([
|
|
7660
|
+
Property(2)
|
|
7661
|
+
], ImageEditor.prototype, "maxStrokeWidth", void 0);
|
|
7662
|
+
__decorate([
|
|
7663
|
+
Property(0.7)
|
|
7664
|
+
], ImageEditor.prototype, "velocity", void 0);
|
|
7665
|
+
__decorate([
|
|
7666
|
+
Property(false)
|
|
7667
|
+
], ImageEditor.prototype, "enableRtl", void 0);
|
|
7668
|
+
__decorate([
|
|
7669
|
+
Property(false)
|
|
7670
|
+
], ImageEditor.prototype, "enablePersistence", void 0);
|
|
7511
7671
|
__decorate([
|
|
7512
7672
|
Event()
|
|
7513
7673
|
], ImageEditor.prototype, "beforeSave", void 0);
|