@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
|
@@ -2106,12 +2106,21 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends SignatureBase {
|
|
|
2106
2106
|
wrapperWidth = this.element.clientWidth;
|
|
2107
2107
|
}
|
|
2108
2108
|
const maxDimension = this.calcMaxDimension(this.baseImg.width, this.baseImg.height);
|
|
2109
|
+
let toolbarHeight = 0;
|
|
2110
|
+
if (!isNullOrUndefined(this.toolbarTemplate) && !isNullOrUndefined(document.querySelector('.e-toolbar'))) {
|
|
2111
|
+
toolbarHeight = document.querySelector('.e-toolbar').clientHeight;
|
|
2112
|
+
maxDimension.width -= toolbarHeight;
|
|
2113
|
+
maxDimension.height -= toolbarHeight;
|
|
2114
|
+
}
|
|
2109
2115
|
this.lowerContext.clearRect(0, 0, this.lowerCanvas.width, this.lowerCanvas.height);
|
|
2110
2116
|
this.lowerCanvas.width = this.upperCanvas.width = this.inMemoryCanvas.width = this.baseImg.width;
|
|
2111
2117
|
this.lowerCanvas.height = this.upperCanvas.height = this.inMemoryCanvas.height = this.baseImg.height;
|
|
2112
2118
|
this.lowerCanvas.style.maxWidth = this.upperCanvas.style.maxWidth = maxDimension.width + 'px';
|
|
2113
2119
|
this.lowerCanvas.style.maxHeight = this.upperCanvas.style.maxHeight = maxDimension.height + 'px';
|
|
2114
2120
|
this.lowerCanvas.style.left = this.upperCanvas.style.left = (wrapperWidth - maxDimension.width) / 2 + 1 + 'px';
|
|
2121
|
+
if (!isNullOrUndefined(this.toolbarTemplate)) {
|
|
2122
|
+
this.lowerCanvas.style.left = parseFloat(this.lowerCanvas.style.left) + (toolbarHeight / 2) + 'px';
|
|
2123
|
+
}
|
|
2115
2124
|
if (canvasWrapper) {
|
|
2116
2125
|
this.lowerCanvas.style.top = this.upperCanvas.style.top = (parseFloat(canvasWrapper.style.height) - maxDimension.height - 1) / 2 + 'px';
|
|
2117
2126
|
}
|
|
@@ -6738,7 +6747,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends SignatureBase {
|
|
|
6738
6747
|
(isNullOrUndefined(document.getElementById(this.element.id + '_toolbar')))) {
|
|
6739
6748
|
this.toolbarHeight = 0;
|
|
6740
6749
|
}
|
|
6741
|
-
this.
|
|
6750
|
+
if (isNullOrUndefined(this.toolbarTemplate)) {
|
|
6751
|
+
this.update();
|
|
6752
|
+
}
|
|
6742
6753
|
const type = typeof (data);
|
|
6743
6754
|
if (type === 'string') {
|
|
6744
6755
|
this.imageOnLoad(data);
|
|
@@ -7205,7 +7216,7 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends SignatureBase {
|
|
|
7205
7216
|
}
|
|
7206
7217
|
this.currObjType.isCustomCrop = false;
|
|
7207
7218
|
const start = { x: x, y: y };
|
|
7208
|
-
this.drawShape('
|
|
7219
|
+
this.drawShape('ellipse', strokeWidth, strokeColor, fillColor, start, radiusX, radiusY);
|
|
7209
7220
|
}
|
|
7210
7221
|
return isEllipse;
|
|
7211
7222
|
}
|
|
@@ -7449,6 +7460,125 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends SignatureBase {
|
|
|
7449
7460
|
this.lowerContext.clearRect(0, 0, this.lowerCanvas.width, this.lowerCanvas.height);
|
|
7450
7461
|
this.upperContext.clearRect(0, 0, this.upperCanvas.width, this.upperCanvas.height);
|
|
7451
7462
|
}
|
|
7463
|
+
/**
|
|
7464
|
+
* To check whether the undo collection is empty or not.
|
|
7465
|
+
*
|
|
7466
|
+
* @returns {boolean}.
|
|
7467
|
+
* @private
|
|
7468
|
+
*/
|
|
7469
|
+
canUndo() {
|
|
7470
|
+
return super.canUndo();
|
|
7471
|
+
}
|
|
7472
|
+
/**
|
|
7473
|
+
* To check whether the redo collection is empty or not.
|
|
7474
|
+
*
|
|
7475
|
+
* @returns {boolean}.
|
|
7476
|
+
* @private
|
|
7477
|
+
*/
|
|
7478
|
+
canRedo() {
|
|
7479
|
+
return super.canRedo();
|
|
7480
|
+
}
|
|
7481
|
+
/**
|
|
7482
|
+
* Erases all the signature strokes signed by user.
|
|
7483
|
+
*
|
|
7484
|
+
* @returns {void}.
|
|
7485
|
+
* @private
|
|
7486
|
+
*/
|
|
7487
|
+
clear() {
|
|
7488
|
+
super.clear();
|
|
7489
|
+
}
|
|
7490
|
+
/**
|
|
7491
|
+
* To draw the signature based on the given text, with the font family and font size.
|
|
7492
|
+
*
|
|
7493
|
+
* @param {string} text - specify text to be drawn as signature.
|
|
7494
|
+
* @param {string} fontFamily - specify font family of a signature.
|
|
7495
|
+
* @param {number} fontSize - specify font size of a signature.
|
|
7496
|
+
*
|
|
7497
|
+
* @returns {void}.
|
|
7498
|
+
* @private
|
|
7499
|
+
*/
|
|
7500
|
+
draw(text, fontFamily, fontSize) {
|
|
7501
|
+
super.draw(text, fontFamily, fontSize);
|
|
7502
|
+
}
|
|
7503
|
+
/**
|
|
7504
|
+
* To get the signature as Blob.
|
|
7505
|
+
*
|
|
7506
|
+
* @param {string} url - specify the url/base 64 string to get blob of the signature.
|
|
7507
|
+
* @returns {Blob}.
|
|
7508
|
+
* @private
|
|
7509
|
+
*/
|
|
7510
|
+
getBlob(url) {
|
|
7511
|
+
return super.getBlob(url);
|
|
7512
|
+
}
|
|
7513
|
+
/**
|
|
7514
|
+
* To check whether the signature is empty or not.
|
|
7515
|
+
*
|
|
7516
|
+
* @returns {boolean}.
|
|
7517
|
+
* @private
|
|
7518
|
+
*/
|
|
7519
|
+
isEmpty() {
|
|
7520
|
+
return super.isEmpty();
|
|
7521
|
+
}
|
|
7522
|
+
/**
|
|
7523
|
+
* To load the signature with the given base 64 string, height and width.
|
|
7524
|
+
*
|
|
7525
|
+
* @param {string} signature - specify the url/base 64 string to be drawn as signature.
|
|
7526
|
+
* @param {number} width - specify the width of the loaded signature image.
|
|
7527
|
+
* @param {number} height - specify the height of the loaded signature image.
|
|
7528
|
+
* @returns {void}.
|
|
7529
|
+
* @private
|
|
7530
|
+
*/
|
|
7531
|
+
load(signature, width, height) {
|
|
7532
|
+
super.load(signature, width, height);
|
|
7533
|
+
}
|
|
7534
|
+
/**
|
|
7535
|
+
* Undo the last user action.
|
|
7536
|
+
*
|
|
7537
|
+
* @returns {void}.
|
|
7538
|
+
* @private
|
|
7539
|
+
*/
|
|
7540
|
+
undo() {
|
|
7541
|
+
super.undo();
|
|
7542
|
+
}
|
|
7543
|
+
/**
|
|
7544
|
+
* Redo the last user action.
|
|
7545
|
+
*
|
|
7546
|
+
* @returns {void}.
|
|
7547
|
+
* @private
|
|
7548
|
+
*/
|
|
7549
|
+
redo() {
|
|
7550
|
+
super.redo();
|
|
7551
|
+
}
|
|
7552
|
+
/**
|
|
7553
|
+
* To save the signature with the given file type and file name.
|
|
7554
|
+
*
|
|
7555
|
+
* @param {SignatureFileType} type - specify type of the file to be saved a signature.
|
|
7556
|
+
* @param {string} fileName - specify name of the file to be saved a signature.
|
|
7557
|
+
*
|
|
7558
|
+
* @returns {void}.
|
|
7559
|
+
* @private
|
|
7560
|
+
*/
|
|
7561
|
+
save(type, fileName) {
|
|
7562
|
+
super.save(type, fileName);
|
|
7563
|
+
}
|
|
7564
|
+
/**
|
|
7565
|
+
* To save the signature as Blob.
|
|
7566
|
+
*
|
|
7567
|
+
* @returns {Blob}.
|
|
7568
|
+
* @private
|
|
7569
|
+
*/
|
|
7570
|
+
saveAsBlob() {
|
|
7571
|
+
return super.saveAsBlob();
|
|
7572
|
+
}
|
|
7573
|
+
/**
|
|
7574
|
+
* Returns the persistence data for component.
|
|
7575
|
+
*
|
|
7576
|
+
* @returns any.
|
|
7577
|
+
* @private
|
|
7578
|
+
*/
|
|
7579
|
+
getLocalData() {
|
|
7580
|
+
return super.getLocalData();
|
|
7581
|
+
}
|
|
7452
7582
|
};
|
|
7453
7583
|
__decorate([
|
|
7454
7584
|
Property('')
|
|
@@ -7471,6 +7601,36 @@ __decorate([
|
|
|
7471
7601
|
__decorate([
|
|
7472
7602
|
Property('100%')
|
|
7473
7603
|
], ImageEditor.prototype, "width", void 0);
|
|
7604
|
+
__decorate([
|
|
7605
|
+
Property('')
|
|
7606
|
+
], ImageEditor.prototype, "backgroundColor", void 0);
|
|
7607
|
+
__decorate([
|
|
7608
|
+
Property('')
|
|
7609
|
+
], ImageEditor.prototype, "backgroundImage", void 0);
|
|
7610
|
+
__decorate([
|
|
7611
|
+
Property(false)
|
|
7612
|
+
], ImageEditor.prototype, "isReadOnly", void 0);
|
|
7613
|
+
__decorate([
|
|
7614
|
+
Property(true)
|
|
7615
|
+
], ImageEditor.prototype, "saveWithBackground", void 0);
|
|
7616
|
+
__decorate([
|
|
7617
|
+
Property('#000000')
|
|
7618
|
+
], ImageEditor.prototype, "strokeColor", void 0);
|
|
7619
|
+
__decorate([
|
|
7620
|
+
Property(0.5)
|
|
7621
|
+
], ImageEditor.prototype, "minStrokeWidth", void 0);
|
|
7622
|
+
__decorate([
|
|
7623
|
+
Property(2)
|
|
7624
|
+
], ImageEditor.prototype, "maxStrokeWidth", void 0);
|
|
7625
|
+
__decorate([
|
|
7626
|
+
Property(0.7)
|
|
7627
|
+
], ImageEditor.prototype, "velocity", void 0);
|
|
7628
|
+
__decorate([
|
|
7629
|
+
Property(false)
|
|
7630
|
+
], ImageEditor.prototype, "enableRtl", void 0);
|
|
7631
|
+
__decorate([
|
|
7632
|
+
Property(false)
|
|
7633
|
+
], ImageEditor.prototype, "enablePersistence", void 0);
|
|
7474
7634
|
__decorate([
|
|
7475
7635
|
Event()
|
|
7476
7636
|
], ImageEditor.prototype, "beforeSave", void 0);
|