@syncfusion/ej2-image-editor 23.1.39 → 23.1.41
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 +15 -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 +179 -38
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +178 -37
- 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/action/transform.js +13 -6
- package/src/image-editor/action/undo-redo.js +2 -1
- package/src/image-editor/base/image-editor.d.ts +9 -2
- package/src/image-editor/base/image-editor.js +145 -24
- package/src/image-editor/renderer/toolbar.js +19 -7
|
@@ -15280,7 +15280,8 @@ var Transform = /** @__PURE__ @class */ (function () {
|
|
|
15280
15280
|
parent.rotateFlipColl = obj['collection'];
|
|
15281
15281
|
if (parent.cropObj.activeObj.shape && !this.isPreventSelect) {
|
|
15282
15282
|
this.isPreventSelect = true;
|
|
15283
|
-
parent.
|
|
15283
|
+
parent.notify('draw', { prop: 'select', onPropertyChange: false,
|
|
15284
|
+
value: { type: 'custom', startX: null, startY: null, width: null, height: null } });
|
|
15284
15285
|
this.isPreventSelect = false;
|
|
15285
15286
|
parent.setProperties({ zoomSettings: { zoomFactor: 1 } }, true);
|
|
15286
15287
|
this.prevZoomValue = parent.zoomSettings.zoomFactor;
|
|
@@ -15547,7 +15548,8 @@ var Transform = /** @__PURE__ @class */ (function () {
|
|
|
15547
15548
|
parent.rotateFlipColl = obj['collection'];
|
|
15548
15549
|
if (parent.cropObj.activeObj.shape && !this.isPreventSelect) {
|
|
15549
15550
|
this.isPreventSelect = true;
|
|
15550
|
-
parent.
|
|
15551
|
+
parent.notify('draw', { prop: 'select', onPropertyChange: false,
|
|
15552
|
+
value: { type: 'custom', startX: null, startY: null, width: null, height: null } });
|
|
15551
15553
|
this.isPreventSelect = false;
|
|
15552
15554
|
parent.setProperties({ zoomSettings: { zoomFactor: 1 } }, true);
|
|
15553
15555
|
this.prevZoomValue = parent.zoomSettings.zoomFactor;
|
|
@@ -17099,13 +17101,17 @@ var Transform = /** @__PURE__ @class */ (function () {
|
|
|
17099
17101
|
}
|
|
17100
17102
|
else if (parent.img.srcWidth === parent.baseImgCanvas.width && parent.img.srcHeight === parent.baseImgCanvas.height) {
|
|
17101
17103
|
parent.currSelectionPoint = null;
|
|
17102
|
-
parent.
|
|
17104
|
+
parent.notify('draw', { prop: 'select', onPropertyChange: false,
|
|
17105
|
+
value: { type: 'custom', startX: null, startY: null, width: null, height: null } });
|
|
17103
17106
|
}
|
|
17104
17107
|
if (isNullOrUndefined(parent.currSelectionPoint)) {
|
|
17105
|
-
parent.
|
|
17108
|
+
parent.notify('draw', { prop: 'select', onPropertyChange: false,
|
|
17109
|
+
value: { type: 'custom', startX: parent.img.destLeft, startY: parent.img.destTop,
|
|
17110
|
+
width: parent.img.destWidth, height: parent.img.destHeight } });
|
|
17106
17111
|
}
|
|
17107
17112
|
else {
|
|
17108
|
-
parent.
|
|
17113
|
+
parent.notify('draw', { prop: 'select', onPropertyChange: false,
|
|
17114
|
+
value: { type: 'custom', startX: null, startY: null, width: null, height: null } });
|
|
17109
17115
|
}
|
|
17110
17116
|
width = parent.activeObj.activePoint.width * widthRatio;
|
|
17111
17117
|
height = parent.activeObj.activePoint.height * heightRatio;
|
|
@@ -17113,7 +17119,8 @@ var Transform = /** @__PURE__ @class */ (function () {
|
|
|
17113
17119
|
var sy = (parent.activeObj.activePoint.startY + (parent.activeObj.activePoint.height / 2)) - (height / 2);
|
|
17114
17120
|
parent.transform.defaultZoomFactor = 0;
|
|
17115
17121
|
parent.notify('draw', { prop: 'setResizeSelect', value: { bool: true } });
|
|
17116
|
-
parent.
|
|
17122
|
+
parent.notify('draw', { prop: 'select', onPropertyChange: false,
|
|
17123
|
+
value: { type: 'custom', startX: sx, startY: sy, width: width, height: height } });
|
|
17117
17124
|
parent.notify('draw', { prop: 'setResizeSelect', value: { bool: false } });
|
|
17118
17125
|
parent.isCropToolbar = true;
|
|
17119
17126
|
parent.crop();
|
|
@@ -17580,7 +17587,8 @@ var UndoRedo = /** @__PURE__ @class */ (function () {
|
|
|
17580
17587
|
}
|
|
17581
17588
|
}
|
|
17582
17589
|
parent.updateCropTransformItems();
|
|
17583
|
-
parent.
|
|
17590
|
+
parent.notify('draw', { prop: 'select', onPropertyChange: false,
|
|
17591
|
+
value: { type: 'custom', startX: null, startY: null, width: null, height: null } });
|
|
17584
17592
|
if (parent.isCircleCrop) {
|
|
17585
17593
|
parent.isCircleCrop = false;
|
|
17586
17594
|
this.tempCurrSelPoint = extend({}, parent.currSelectionPoint, {}, true);
|
|
@@ -18458,6 +18466,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
18458
18466
|
* @private
|
|
18459
18467
|
*/
|
|
18460
18468
|
ImageEditor.prototype.onPropertyChanged = function (newProperties, oldProperties) {
|
|
18469
|
+
var indexObj;
|
|
18461
18470
|
for (var _i = 0, _a = Object.keys(newProperties); _i < _a.length; _i++) {
|
|
18462
18471
|
var prop = _a[_i];
|
|
18463
18472
|
switch (prop) {
|
|
@@ -18481,9 +18490,11 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
18481
18490
|
break;
|
|
18482
18491
|
case 'height':
|
|
18483
18492
|
this.element.style.height = newProperties.height;
|
|
18493
|
+
this.update();
|
|
18484
18494
|
break;
|
|
18485
18495
|
case 'width':
|
|
18486
18496
|
this.element.style.width = newProperties.width;
|
|
18497
|
+
this.update();
|
|
18487
18498
|
break;
|
|
18488
18499
|
case 'theme':
|
|
18489
18500
|
if (newProperties.theme) {
|
|
@@ -18495,6 +18506,13 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
18495
18506
|
}
|
|
18496
18507
|
this.upperContext.strokeStyle = this.themeColl[this.theme]['primaryColor'];
|
|
18497
18508
|
this.upperContext.fillStyle = this.themeColl[this.theme]['secondaryColor'];
|
|
18509
|
+
if (isBlazor()) {
|
|
18510
|
+
this.updateToolbar(this.element, 'imageLoaded');
|
|
18511
|
+
}
|
|
18512
|
+
else {
|
|
18513
|
+
this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
|
|
18514
|
+
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
18515
|
+
}
|
|
18498
18516
|
}
|
|
18499
18517
|
break;
|
|
18500
18518
|
case 'finetuneSettings':
|
|
@@ -18506,8 +18524,13 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
18506
18524
|
case 'locale':
|
|
18507
18525
|
if (newProperties.locale) {
|
|
18508
18526
|
this.notify('toolbar', { prop: 'setLocale', onPropertyChange: false, value: { locale: newProperties.locale } });
|
|
18509
|
-
|
|
18510
|
-
|
|
18527
|
+
if (isBlazor()) {
|
|
18528
|
+
this.updateToolbar(this.element, 'imageLoaded');
|
|
18529
|
+
}
|
|
18530
|
+
else {
|
|
18531
|
+
this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
|
|
18532
|
+
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
18533
|
+
}
|
|
18511
18534
|
}
|
|
18512
18535
|
break;
|
|
18513
18536
|
case 'allowUndoRedo':
|
|
@@ -18517,18 +18540,47 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
18517
18540
|
else {
|
|
18518
18541
|
this.allowUndoRedo = false;
|
|
18519
18542
|
}
|
|
18520
|
-
|
|
18521
|
-
|
|
18543
|
+
if (isBlazor()) {
|
|
18544
|
+
this.updateToolbar(this.element, 'imageLoaded');
|
|
18545
|
+
}
|
|
18546
|
+
else {
|
|
18547
|
+
this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
|
|
18548
|
+
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
18549
|
+
}
|
|
18522
18550
|
break;
|
|
18523
18551
|
case 'showQuickAccessToolbar':
|
|
18524
18552
|
if (newProperties.showQuickAccessToolbar) {
|
|
18525
18553
|
this.showQuickAccessToolbar = true;
|
|
18526
|
-
|
|
18527
|
-
|
|
18554
|
+
if (!isBlazor()) {
|
|
18555
|
+
this.notify('toolbar', { prop: 'create-qa-toolbar', onPropertyChange: false });
|
|
18556
|
+
}
|
|
18557
|
+
indexObj = { freehandSelectedIndex: null };
|
|
18558
|
+
this.notify('freehand-draw', { prop: 'getFreehandSelectedIndex', onPropertyChange: false, value: { obj: indexObj } });
|
|
18559
|
+
if (this.activeObj.shape) {
|
|
18560
|
+
if (isBlazor()) {
|
|
18561
|
+
this.updateToolbar(this.element, 'quickAccessToolbar', this.activeObj.shape);
|
|
18562
|
+
}
|
|
18563
|
+
else {
|
|
18564
|
+
this.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
|
|
18565
|
+
}
|
|
18566
|
+
}
|
|
18567
|
+
else if (indexObj['freehandSelectedIndex']) {
|
|
18568
|
+
if (isBlazor()) {
|
|
18569
|
+
this.updateToolbar(this.element, 'quickAccessToolbar', 'pen');
|
|
18570
|
+
}
|
|
18571
|
+
else {
|
|
18572
|
+
this.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: true } });
|
|
18573
|
+
}
|
|
18574
|
+
}
|
|
18528
18575
|
}
|
|
18529
18576
|
else {
|
|
18530
18577
|
this.showQuickAccessToolbar = false;
|
|
18531
|
-
|
|
18578
|
+
if (isBlazor()) {
|
|
18579
|
+
this.updateToolbar(this.element, 'destroyQuickAccessToolbar');
|
|
18580
|
+
}
|
|
18581
|
+
else {
|
|
18582
|
+
this.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
|
|
18583
|
+
}
|
|
18532
18584
|
}
|
|
18533
18585
|
break;
|
|
18534
18586
|
case 'zoomSettings':
|
|
@@ -18538,12 +18590,22 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
18538
18590
|
if (isNullOrUndefined(this.zoomSettings.zoomTrigger)) {
|
|
18539
18591
|
this.zoomSettings.zoomTrigger = (ZoomTrigger.MouseWheel | ZoomTrigger.Pinch | ZoomTrigger.Toolbar |
|
|
18540
18592
|
ZoomTrigger.Commands);
|
|
18541
|
-
|
|
18542
|
-
|
|
18593
|
+
if (isBlazor()) {
|
|
18594
|
+
this.updateToolbar(this.element, 'imageLoaded');
|
|
18595
|
+
}
|
|
18596
|
+
else {
|
|
18597
|
+
this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
|
|
18598
|
+
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
18599
|
+
}
|
|
18543
18600
|
}
|
|
18544
18601
|
else if ((newProperties.zoomSettings.zoomTrigger & ZoomTrigger.Toolbar) === ZoomTrigger.Toolbar) {
|
|
18545
|
-
|
|
18546
|
-
|
|
18602
|
+
if (isBlazor()) {
|
|
18603
|
+
this.updateToolbar(this.element, 'imageLoaded');
|
|
18604
|
+
}
|
|
18605
|
+
else {
|
|
18606
|
+
this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
|
|
18607
|
+
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
18608
|
+
}
|
|
18547
18609
|
}
|
|
18548
18610
|
break;
|
|
18549
18611
|
case 'selectionSettings':
|
|
@@ -18555,6 +18617,38 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
18555
18617
|
}
|
|
18556
18618
|
}
|
|
18557
18619
|
break;
|
|
18620
|
+
case 'toolbar':
|
|
18621
|
+
if (newProperties.toolbar) {
|
|
18622
|
+
this.toolbar = newProperties.toolbar;
|
|
18623
|
+
if (isBlazor()) {
|
|
18624
|
+
this.updateToolbar(this.element, 'imageLoaded');
|
|
18625
|
+
}
|
|
18626
|
+
else {
|
|
18627
|
+
this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
|
|
18628
|
+
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
18629
|
+
}
|
|
18630
|
+
}
|
|
18631
|
+
break;
|
|
18632
|
+
case 'toolbarTemplate':
|
|
18633
|
+
if (newProperties.toolbarTemplate) {
|
|
18634
|
+
if (!isBlazor()) {
|
|
18635
|
+
this.notify('toolbar', { prop: 'destroy-bottom-toolbar', onPropertyChange: false });
|
|
18636
|
+
this.notify('toolbar', { prop: 'destroy-top-toolbar', onPropertyChange: false });
|
|
18637
|
+
this.element.appendChild(this.createElement('div', {
|
|
18638
|
+
id: this.element.id + '_toolbarArea', className: 'e-toolbar-area'
|
|
18639
|
+
}));
|
|
18640
|
+
this.toolbarTemplateFn();
|
|
18641
|
+
}
|
|
18642
|
+
}
|
|
18643
|
+
break;
|
|
18644
|
+
case 'quickAccessToolbarTemplate':
|
|
18645
|
+
if (newProperties.quickAccessToolbarTemplate) {
|
|
18646
|
+
if (!isBlazor()) {
|
|
18647
|
+
this.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
|
|
18648
|
+
this.quickAccessToolbarTemplateFn();
|
|
18649
|
+
}
|
|
18650
|
+
}
|
|
18651
|
+
break;
|
|
18558
18652
|
}
|
|
18559
18653
|
}
|
|
18560
18654
|
};
|
|
@@ -18639,15 +18733,20 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
18639
18733
|
var uploadObj = new Uploader({
|
|
18640
18734
|
dropArea: document.getElementsByClassName('e-canvas-wrapper')[0],
|
|
18641
18735
|
allowedExtensions: '.jpg, .jpeg, .png,.svg',
|
|
18736
|
+
multiple: false,
|
|
18642
18737
|
selected: function (args) {
|
|
18643
18738
|
if (args.event.type === 'change' || args.event.type === 'drop') {
|
|
18644
18739
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
18645
18740
|
var type = args.filesData[0].type;
|
|
18646
|
-
|
|
18741
|
+
var errType = 'unsupported';
|
|
18742
|
+
if ((args.event.type === 'change' || (args.event.type === 'drop' && args.event.dataTransfer.files.length === 1)) && (type === 'png' || type === 'jpg' || type === 'jpeg' || type === 'svg')) {
|
|
18647
18743
|
_this.notify('draw', { prop: 'fileSelect', value: { inputElement: _this.element.querySelector('#' + _this.element.id + '_dropfileUpload'), args: args } });
|
|
18648
18744
|
}
|
|
18649
18745
|
else {
|
|
18650
|
-
|
|
18746
|
+
if (args.event.type === 'drop' && args.event.dataTransfer.files.length > 1) {
|
|
18747
|
+
errType = 'multi-select-image';
|
|
18748
|
+
}
|
|
18749
|
+
_this.showDialogPopup(errType);
|
|
18651
18750
|
}
|
|
18652
18751
|
}
|
|
18653
18752
|
}
|
|
@@ -18657,20 +18756,39 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
18657
18756
|
ImageEditor.prototype.dlgCloseBtnClick = function () {
|
|
18658
18757
|
getComponent(document.getElementById(this.element.id + '_dialog'), 'dialog').destroy();
|
|
18659
18758
|
};
|
|
18660
|
-
|
|
18759
|
+
/**
|
|
18760
|
+
* Show dialog popup for unsupported files.
|
|
18761
|
+
*
|
|
18762
|
+
* @param { string } type - Specifies the type of error.
|
|
18763
|
+
* @hidden
|
|
18764
|
+
* @returns {void}.
|
|
18765
|
+
*/
|
|
18766
|
+
ImageEditor.prototype.showDialogPopup = function (type) {
|
|
18767
|
+
var content = '';
|
|
18661
18768
|
this.element.querySelector('#' + this.element.id + '_dialog').style.display = 'block';
|
|
18662
|
-
var headerObj
|
|
18663
|
-
this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: headerObj } });
|
|
18664
|
-
var contentObj = { key: 'AlertDialogContent' };
|
|
18665
|
-
this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: contentObj } });
|
|
18666
|
-
var supportObj = { key: 'SupportText' };
|
|
18667
|
-
this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: supportObj } });
|
|
18769
|
+
var headerObj;
|
|
18668
18770
|
var okObj = { key: 'OK' };
|
|
18669
18771
|
this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: okObj } });
|
|
18772
|
+
if (type === 'multi-select-image') {
|
|
18773
|
+
headerObj = { key: 'ImageErrorDialogHeader' };
|
|
18774
|
+
this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: headerObj } });
|
|
18775
|
+
var contentObj = { key: 'ImageErrorDialogContent' };
|
|
18776
|
+
this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: contentObj } });
|
|
18777
|
+
content = '<span>' + contentObj['value'] + '</span>';
|
|
18778
|
+
}
|
|
18779
|
+
else {
|
|
18780
|
+
headerObj = { key: 'AlertDialogHeader' };
|
|
18781
|
+
this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: headerObj } });
|
|
18782
|
+
var contentObj = { key: 'AlertDialogContent' };
|
|
18783
|
+
this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: contentObj } });
|
|
18784
|
+
var supportObj = { key: 'SupportText' };
|
|
18785
|
+
this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: supportObj } });
|
|
18786
|
+
content = '<span>' + contentObj['value'] + ' ' + supportObj['value'] + '<b> JPG, PNG, and SVG</b></span>';
|
|
18787
|
+
}
|
|
18670
18788
|
var dialog = new Dialog({
|
|
18671
18789
|
header: headerObj['value'],
|
|
18672
18790
|
closeOnEscape: true,
|
|
18673
|
-
content:
|
|
18791
|
+
content: content,
|
|
18674
18792
|
target: document.getElementById('target'),
|
|
18675
18793
|
width: '285px',
|
|
18676
18794
|
isModal: true,
|
|
@@ -19116,6 +19234,8 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
19116
19234
|
ImageEditor.prototype.select = function (type, startX, startY, width, height) {
|
|
19117
19235
|
this.notify('draw', { prop: 'select', onPropertyChange: false,
|
|
19118
19236
|
value: { type: type, startX: startX, startY: startY, width: width, height: height } });
|
|
19237
|
+
this.notify('draw', { prop: 'select', onPropertyChange: false,
|
|
19238
|
+
value: { type: type, startX: startX, startY: startY, width: width, height: height } });
|
|
19119
19239
|
};
|
|
19120
19240
|
/**
|
|
19121
19241
|
* Enable or disable a freehand drawing option in an Image Editor.
|
|
@@ -19538,10 +19658,18 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
19538
19658
|
ImageEditor.prototype.drawFrame = function (frameType, color, gradientColor, size, inset, offset, borderRadius, frameLineStyle, lineCount) {
|
|
19539
19659
|
var isFrame = false;
|
|
19540
19660
|
var obj = { frameChangeEventArgs: null };
|
|
19661
|
+
color = color ? color : '#fff';
|
|
19662
|
+
gradientColor = gradientColor ? gradientColor : '';
|
|
19663
|
+
size = size ? size : 20;
|
|
19664
|
+
inset = inset ? inset : 0;
|
|
19665
|
+
offset = offset ? offset : 0;
|
|
19666
|
+
borderRadius = borderRadius ? borderRadius : 0;
|
|
19667
|
+
frameLineStyle = frameLineStyle ? frameLineStyle : FrameLineStyle.Solid;
|
|
19668
|
+
lineCount = lineCount ? lineCount : 0;
|
|
19541
19669
|
var prevFrameSettings = { type: this.toPascalCase(this.frameObj.type), color: this.frameObj.color,
|
|
19542
19670
|
gradientColor: this.frameObj.gradientColor, size: this.frameObj.size, inset: this.frameObj.inset,
|
|
19543
|
-
offset: this.frameObj.offset, borderRadius: this.frameObj.radius,
|
|
19544
|
-
lineCount: this.frameObj.amount };
|
|
19671
|
+
offset: this.frameObj.offset, borderRadius: this.frameObj.radius,
|
|
19672
|
+
frameLineStyle: this.toPascalCase(this.frameObj.border), lineCount: this.frameObj.amount };
|
|
19545
19673
|
extend(this.tempFrameObj, this.frameObj);
|
|
19546
19674
|
this.tempFrameZoomLevel = this.transform.zoomFactor;
|
|
19547
19675
|
this.frameDestPoints = extend({}, this.img, {}, true);
|
|
@@ -19549,6 +19677,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
19549
19677
|
this.notify('toolbar', { prop: 'frameToolbarClick' });
|
|
19550
19678
|
}
|
|
19551
19679
|
else {
|
|
19680
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19552
19681
|
this.performFrameClick();
|
|
19553
19682
|
}
|
|
19554
19683
|
this.frameObj.type = frameType.toLowerCase();
|
|
@@ -21485,7 +21614,9 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21485
21614
|
AlertDialogHeader: 'Unsupported file',
|
|
21486
21615
|
AlertDialogContent: 'The dropped file is unsupported.',
|
|
21487
21616
|
Yes: 'Yes',
|
|
21488
|
-
No: 'No'
|
|
21617
|
+
No: 'No',
|
|
21618
|
+
ImageErrorDialogHeader: 'Image Selection Error',
|
|
21619
|
+
ImageErrorDialogContent: 'Please select only one image to open.'
|
|
21489
21620
|
};
|
|
21490
21621
|
this.l10n = new L10n('image-editor', this.defaultLocale, this.parent.locale);
|
|
21491
21622
|
};
|
|
@@ -21695,7 +21826,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21695
21826
|
id: parent.element.id + '_toolbarArea', className: 'e-toolbar-area'
|
|
21696
21827
|
}));
|
|
21697
21828
|
var toolbarItems = { cssClass: 'e-image-upload', align: 'Left', type: 'Input',
|
|
21698
|
-
tooltipText: this.l10n.getConstant('Browse'), template: new Uploader({ allowedExtensions: '.jpg, .jpeg, .png,.svg' }) };
|
|
21829
|
+
tooltipText: this.l10n.getConstant('Browse'), template: new Uploader({ allowedExtensions: '.jpg, .jpeg, .png,.svg', multiple: false }) };
|
|
21699
21830
|
if (isNullOrUndefined(this.defToolbarItems)) {
|
|
21700
21831
|
this.defToolbarItems = [];
|
|
21701
21832
|
}
|
|
@@ -21712,6 +21843,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21712
21843
|
tooltipText: this.l10n.getConstant('Browse'),
|
|
21713
21844
|
template: new Uploader({
|
|
21714
21845
|
allowedExtensions: '.jpg, .jpeg, .png,.svg',
|
|
21846
|
+
multiple: false,
|
|
21715
21847
|
selected: function () {
|
|
21716
21848
|
if (!parent.disabled) {
|
|
21717
21849
|
if (Browser.isDevice) {
|
|
@@ -21785,7 +21917,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21785
21917
|
var parent = this.parent;
|
|
21786
21918
|
if (parent.showQuickAccessToolbar) {
|
|
21787
21919
|
var toolbarItems = { cssClass: 'e-image-upload', align: 'Left', type: 'Input',
|
|
21788
|
-
tooltipText: this.l10n.getConstant('Browse'), template: new Uploader({ allowedExtensions: '.jpg, .jpeg, .png,.svg' }) };
|
|
21920
|
+
tooltipText: this.l10n.getConstant('Browse'), template: new Uploader({ allowedExtensions: '.jpg, .jpeg, .png,.svg', multiple: false }) };
|
|
21789
21921
|
if (isNullOrUndefined(this.defToolbarItems)) {
|
|
21790
21922
|
this.defToolbarItems = [];
|
|
21791
21923
|
}
|
|
@@ -21872,7 +22004,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21872
22004
|
var parent = this.parent;
|
|
21873
22005
|
var toolbarItems = [];
|
|
21874
22006
|
if (!isOkBtn || isResize) {
|
|
21875
|
-
toolbarItems.push({ id: parent.element.id + '_upload', cssClass: 'e-image-upload', align: 'Left', type: 'Input', template: new Uploader({ allowedExtensions: '.jpg, .jpeg, .png,.svg' }) });
|
|
22007
|
+
toolbarItems.push({ id: parent.element.id + '_upload', cssClass: 'e-image-upload', align: 'Left', type: 'Input', template: new Uploader({ allowedExtensions: '.jpg, .jpeg, .png,.svg', multiple: false }) });
|
|
21876
22008
|
toolbarItems.push({ visible: false, cssClass: 'e-image-position e-btn e-flat', tooltipText: this.l10n.getConstant('Browse'), align: 'Left' });
|
|
21877
22009
|
}
|
|
21878
22010
|
if (parent.allowUndoRedo && !isResize) {
|
|
@@ -22298,7 +22430,13 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
22298
22430
|
}
|
|
22299
22431
|
};
|
|
22300
22432
|
ToolbarModule.prototype.fileSelect = function (inputElement, args) {
|
|
22301
|
-
|
|
22433
|
+
var type = inputElement.files[0].type.split('/')[1];
|
|
22434
|
+
if (type === 'png' || type === 'jpg' || type === 'jpeg' || type === 'svg') {
|
|
22435
|
+
this.parent.notify('draw', { prop: 'fileSelect', value: { inputElement: inputElement, args: args } });
|
|
22436
|
+
}
|
|
22437
|
+
else {
|
|
22438
|
+
this.parent.showDialogPopup();
|
|
22439
|
+
}
|
|
22302
22440
|
};
|
|
22303
22441
|
ToolbarModule.prototype.renderAnnotationBtn = function (isContextualToolbar) {
|
|
22304
22442
|
var _this = this;
|
|
@@ -22704,7 +22842,9 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
22704
22842
|
}
|
|
22705
22843
|
}
|
|
22706
22844
|
if (document.getElementById(parent.element.id + '_cropBtn')) {
|
|
22707
|
-
parent.
|
|
22845
|
+
parent.notify('draw', { prop: 'select', onPropertyChange: false,
|
|
22846
|
+
value: { type: document.getElementById(parent.element.id + '_cropBtn').textContent.toLowerCase(),
|
|
22847
|
+
startX: null, startY: null, width: null, height: null } });
|
|
22708
22848
|
}
|
|
22709
22849
|
}
|
|
22710
22850
|
});
|
|
@@ -24620,7 +24760,8 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
24620
24760
|
var text = args.item.id;
|
|
24621
24761
|
this.currentToolbar = 'crop';
|
|
24622
24762
|
parent.currSelectionPoint = null;
|
|
24623
|
-
parent.select
|
|
24763
|
+
parent.notify('draw', { prop: 'select', onPropertyChange: false,
|
|
24764
|
+
value: { type: text, startX: null, startY: null, width: null, height: null } });
|
|
24624
24765
|
this.enableDisableTbrBtn();
|
|
24625
24766
|
parent.notify('transform', { prop: 'disableZoomOutBtn', value: { isZoomOut: true } });
|
|
24626
24767
|
};
|