@syncfusion/ej2-image-editor 23.1.38 → 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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 23.1.38
3
+ * version : 23.1.41
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-image-editor@*",
3
- "_id": "@syncfusion/ej2-image-editor@23.1.36",
3
+ "_id": "@syncfusion/ej2-image-editor@23.1.39",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-A6bph2XTzzn8GAjli/kAtAz4JPSrDYTzAQF6UOa0I+RqOKB3/w2/7CBmLNKlQVFd3I5nyY45z1M26X0ua0+48w==",
5
+ "_integrity": "sha512-yXE6senui8QfJwD5w3m9xCNYfdR2mauymav0ICQwvlSfxaBxpCmLpLFCKmC9IfYmpHNL/UTgAImhwbH9Wv1J4w==",
6
6
  "_location": "/@syncfusion/ej2-image-editor",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,8 +23,8 @@
23
23
  "/@syncfusion/ej2-react-image-editor",
24
24
  "/@syncfusion/ej2-vue-image-editor"
25
25
  ],
26
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-23.1.36.tgz",
27
- "_shasum": "b13260748329c7b0412240bdd9714f2bbeb97281",
26
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-23.1.39.tgz",
27
+ "_shasum": "0054fb7af397eb92d72f5984b54deb791519fb03",
28
28
  "_spec": "@syncfusion/ej2-image-editor@*",
29
29
  "_where": "/jenkins/workspace/elease-automation_release_23.1.1/packages/included",
30
30
  "author": {
@@ -32,12 +32,12 @@
32
32
  },
33
33
  "bundleDependencies": false,
34
34
  "dependencies": {
35
- "@syncfusion/ej2-base": "~23.1.38",
36
- "@syncfusion/ej2-buttons": "~23.1.36",
37
- "@syncfusion/ej2-inputs": "~23.1.38",
38
- "@syncfusion/ej2-navigations": "~23.1.36",
35
+ "@syncfusion/ej2-base": "~23.1.41",
36
+ "@syncfusion/ej2-buttons": "~23.1.41",
37
+ "@syncfusion/ej2-inputs": "~23.1.40",
38
+ "@syncfusion/ej2-navigations": "~23.1.41",
39
39
  "@syncfusion/ej2-popups": "~23.1.38",
40
- "@syncfusion/ej2-splitbuttons": "~23.1.36"
40
+ "@syncfusion/ej2-splitbuttons": "~23.1.41"
41
41
  },
42
42
  "deprecated": false,
43
43
  "description": "Essential JS 2 ImageEditor",
@@ -67,7 +67,7 @@
67
67
  "url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/imageeditor"
68
68
  },
69
69
  "typings": "index.d.ts",
70
- "version": "23.1.38",
70
+ "version": "23.1.41",
71
71
  "sideEffects": false,
72
72
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
73
73
  }
@@ -3434,7 +3434,11 @@ var Draw = /** @class */ (function () {
3434
3434
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
3435
3435
  filesData = fileData = args.filesData[0].rawFile;
3436
3436
  }
3437
- var fileExtension = fileData.name && fileData.name.split('.')[1].toLowerCase();
3437
+ var fileExtension = void 0;
3438
+ if (fileData.name) {
3439
+ var fileExtensionArray = fileData.name.split('.');
3440
+ fileExtension = fileExtensionArray[fileExtensionArray.length - 1].toLowerCase();
3441
+ }
3438
3442
  if (fileExtension && ['jpg', 'jpeg', 'png', 'svg'].indexOf(fileExtension) === -1) {
3439
3443
  this.errorLoading();
3440
3444
  return;
@@ -253,7 +253,7 @@ var FreehandDrawing = /** @class */ (function () {
253
253
  EventHandler.add(canvas, 'mousemove touchmove', this.freehandMoveHandler, this);
254
254
  var shapeSettings = { id: 'pen_' + (this.currFHDIdx + 1), type: ShapeType.FreehandDraw,
255
255
  startX: this.freehandDownPoint.x, startY: this.freehandDownPoint.y,
256
- strokeColor: this.parent.activeObj.strokeSettings.strokeColor, strokeWidth: this.parent.activeObj.strokeSettings.strokeWidth,
256
+ strokeColor: this.parent.activeObj.strokeSettings.strokeColor, strokeWidth: this.penStrokeWidth,
257
257
  points: null };
258
258
  var shapeChangingArgs = { action: 'draw-start', previousShapeSettings: shapeSettings,
259
259
  currentShapeSettings: shapeSettings };
@@ -310,7 +310,7 @@ var FreehandDrawing = /** @class */ (function () {
310
310
  currentText: null, previousFilter: null, isCircleCrop: null } });
311
311
  var shapeSettings = { id: 'pen_' + (this.currFHDIdx + 1), type: ShapeType.FreehandDraw,
312
312
  startX: this.freehandDownPoint.x, startY: this.freehandDownPoint.y,
313
- strokeColor: this.parent.activeObj.strokeSettings.strokeColor, strokeWidth: this.parent.activeObj.strokeSettings.strokeWidth,
313
+ strokeColor: this.parent.activeObj.strokeSettings.strokeColor, strokeWidth: this.penStrokeWidth,
314
314
  points: this.parent.pointColl[this.currFHDIdx].points };
315
315
  var shapeChangingArgs = { action: 'draw-end', previousShapeSettings: shapeSettings,
316
316
  currentShapeSettings: shapeSettings };
@@ -331,6 +331,7 @@ var FreehandDrawing = /** @class */ (function () {
331
331
  y = e.touches[0].clientY - rect.top;
332
332
  }
333
333
  if (this.isFreehandDrawing) {
334
+ this.upperContext.fillStyle = this.parent.activeObj.strokeSettings.strokeColor;
334
335
  this.processPoint(x, y, false, this.upperContext);
335
336
  }
336
337
  };
@@ -1068,7 +1069,7 @@ var FreehandDrawing = /** @class */ (function () {
1068
1069
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
1069
1070
  parent.dotNetRef.invokeMethodAsync('ShapeEventAsync', 'OnShape', shapeChangingArgs).then(function (shapeChangingArgs) {
1070
1071
  parent.activeObj.strokeSettings.strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
1071
- parent.activeObj.strokeSettings.strokeWidth = shapeChangingArgs.currentShapeSettings.strokeWidth;
1072
+ _this.penStrokeWidth = shapeChangingArgs.currentShapeSettings.strokeWidth;
1072
1073
  if (_this.fhdSelID) {
1073
1074
  parent.pointColl[_this.fhdSelIdx].strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
1074
1075
  parent.pointColl[_this.fhdSelIdx].strokeWidth = shapeChangingArgs.currentShapeSettings.strokeWidth;
@@ -1084,7 +1085,7 @@ var FreehandDrawing = /** @class */ (function () {
1084
1085
  else {
1085
1086
  parent.trigger('shapeChanging', shapeChangingArgs);
1086
1087
  parent.activeObj.strokeSettings.strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
1087
- parent.activeObj.strokeSettings.strokeWidth = shapeChangingArgs.currentShapeSettings.strokeWidth;
1088
+ this.penStrokeWidth = shapeChangingArgs.currentShapeSettings.strokeWidth;
1088
1089
  if (this.fhdSelID) {
1089
1090
  parent.pointColl[this.fhdSelIdx].strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
1090
1091
  parent.pointColl[this.fhdSelIdx].strokeWidth = shapeChangingArgs.currentShapeSettings.strokeWidth;
@@ -268,7 +268,8 @@ var Transform = /** @class */ (function () {
268
268
  parent.rotateFlipColl = obj['collection'];
269
269
  if (parent.cropObj.activeObj.shape && !this.isPreventSelect) {
270
270
  this.isPreventSelect = true;
271
- parent.select('custom');
271
+ parent.notify('draw', { prop: 'select', onPropertyChange: false,
272
+ value: { type: 'custom', startX: null, startY: null, width: null, height: null } });
272
273
  this.isPreventSelect = false;
273
274
  parent.setProperties({ zoomSettings: { zoomFactor: 1 } }, true);
274
275
  this.prevZoomValue = parent.zoomSettings.zoomFactor;
@@ -535,7 +536,8 @@ var Transform = /** @class */ (function () {
535
536
  parent.rotateFlipColl = obj['collection'];
536
537
  if (parent.cropObj.activeObj.shape && !this.isPreventSelect) {
537
538
  this.isPreventSelect = true;
538
- parent.select('custom');
539
+ parent.notify('draw', { prop: 'select', onPropertyChange: false,
540
+ value: { type: 'custom', startX: null, startY: null, width: null, height: null } });
539
541
  this.isPreventSelect = false;
540
542
  parent.setProperties({ zoomSettings: { zoomFactor: 1 } }, true);
541
543
  this.prevZoomValue = parent.zoomSettings.zoomFactor;
@@ -2087,13 +2089,17 @@ var Transform = /** @class */ (function () {
2087
2089
  }
2088
2090
  else if (parent.img.srcWidth === parent.baseImgCanvas.width && parent.img.srcHeight === parent.baseImgCanvas.height) {
2089
2091
  parent.currSelectionPoint = null;
2090
- parent.select('custom');
2092
+ parent.notify('draw', { prop: 'select', onPropertyChange: false,
2093
+ value: { type: 'custom', startX: null, startY: null, width: null, height: null } });
2091
2094
  }
2092
2095
  if (isNullOrUndefined(parent.currSelectionPoint)) {
2093
- parent.select('custom', parent.img.destLeft, parent.img.destTop, parent.img.destWidth, parent.img.destHeight);
2096
+ parent.notify('draw', { prop: 'select', onPropertyChange: false,
2097
+ value: { type: 'custom', startX: parent.img.destLeft, startY: parent.img.destTop,
2098
+ width: parent.img.destWidth, height: parent.img.destHeight } });
2094
2099
  }
2095
2100
  else {
2096
- parent.select('custom');
2101
+ parent.notify('draw', { prop: 'select', onPropertyChange: false,
2102
+ value: { type: 'custom', startX: null, startY: null, width: null, height: null } });
2097
2103
  }
2098
2104
  width = parent.activeObj.activePoint.width * widthRatio;
2099
2105
  height = parent.activeObj.activePoint.height * heightRatio;
@@ -2101,7 +2107,8 @@ var Transform = /** @class */ (function () {
2101
2107
  var sy = (parent.activeObj.activePoint.startY + (parent.activeObj.activePoint.height / 2)) - (height / 2);
2102
2108
  parent.transform.defaultZoomFactor = 0;
2103
2109
  parent.notify('draw', { prop: 'setResizeSelect', value: { bool: true } });
2104
- parent.select('custom', sx, sy, width, height);
2110
+ parent.notify('draw', { prop: 'select', onPropertyChange: false,
2111
+ value: { type: 'custom', startX: sx, startY: sy, width: width, height: height } });
2105
2112
  parent.notify('draw', { prop: 'setResizeSelect', value: { bool: false } });
2106
2113
  parent.isCropToolbar = true;
2107
2114
  parent.crop();
@@ -348,7 +348,8 @@ var UndoRedo = /** @class */ (function () {
348
348
  }
349
349
  }
350
350
  parent.updateCropTransformItems();
351
- parent.select('custom');
351
+ parent.notify('draw', { prop: 'select', onPropertyChange: false,
352
+ value: { type: 'custom', startX: null, startY: null, width: null, height: null } });
352
353
  if (parent.isCircleCrop) {
353
354
  parent.isCircleCrop = false;
354
355
  this.tempCurrSelPoint = extend({}, parent.currSelectionPoint, {}, true);
@@ -122,7 +122,34 @@ export declare enum ImageEditorCommand {
122
122
  RotateLeft = "RotateLeft",
123
123
  RotateRight = "RotateRight",
124
124
  FlipHorizontal = "FlipHorizontal",
125
- FlipVertical = "FlipVertical"
125
+ FlipVertical = "FlipVertical",
126
+ Undo = "Undo",
127
+ Redo = "Redo",
128
+ None = "None",
129
+ Mat = "Mat",
130
+ Bevel = "Bevel",
131
+ Inset = "Inset",
132
+ Hook = "Hook",
133
+ Finetune = "Finetune",
134
+ Filter = "Filter",
135
+ Frame = "Frame",
136
+ Resize = "Resize",
137
+ HorizontalFlip = "HorizontalFlip",
138
+ VerticalFlip = "VerticalFlip",
139
+ Brightness = "Brightness",
140
+ Contrast = "Contrast",
141
+ Hue = "Hue",
142
+ Saturation = "Saturation",
143
+ Opacity = "Opacity",
144
+ Blur = "Blur",
145
+ Exposure = "Exposure",
146
+ Default = "Default",
147
+ Chrome = "Chrome",
148
+ Cold = "Cold",
149
+ Warm = "Warm",
150
+ Grayscale = "Grayscale",
151
+ Sepia = "Sepia",
152
+ Invert = "Invert"
126
153
  }
127
154
  /**
128
155
  * An enumeration of available image filter options.
@@ -129,6 +129,33 @@ export var ImageEditorCommand;
129
129
  ImageEditorCommand["RotateRight"] = "RotateRight";
130
130
  ImageEditorCommand["FlipHorizontal"] = "FlipHorizontal";
131
131
  ImageEditorCommand["FlipVertical"] = "FlipVertical";
132
+ ImageEditorCommand["Undo"] = "Undo";
133
+ ImageEditorCommand["Redo"] = "Redo";
134
+ ImageEditorCommand["None"] = "None";
135
+ ImageEditorCommand["Mat"] = "Mat";
136
+ ImageEditorCommand["Bevel"] = "Bevel";
137
+ ImageEditorCommand["Inset"] = "Inset";
138
+ ImageEditorCommand["Hook"] = "Hook";
139
+ ImageEditorCommand["Finetune"] = "Finetune";
140
+ ImageEditorCommand["Filter"] = "Filter";
141
+ ImageEditorCommand["Frame"] = "Frame";
142
+ ImageEditorCommand["Resize"] = "Resize";
143
+ ImageEditorCommand["HorizontalFlip"] = "HorizontalFlip";
144
+ ImageEditorCommand["VerticalFlip"] = "VerticalFlip";
145
+ ImageEditorCommand["Brightness"] = "Brightness";
146
+ ImageEditorCommand["Contrast"] = "Contrast";
147
+ ImageEditorCommand["Hue"] = "Hue";
148
+ ImageEditorCommand["Saturation"] = "Saturation";
149
+ ImageEditorCommand["Opacity"] = "Opacity";
150
+ ImageEditorCommand["Blur"] = "Blur";
151
+ ImageEditorCommand["Exposure"] = "Exposure";
152
+ ImageEditorCommand["Default"] = "Default";
153
+ ImageEditorCommand["Chrome"] = "Chrome";
154
+ ImageEditorCommand["Cold"] = "Cold";
155
+ ImageEditorCommand["Warm"] = "Warm";
156
+ ImageEditorCommand["Grayscale"] = "Grayscale";
157
+ ImageEditorCommand["Sepia"] = "Sepia";
158
+ ImageEditorCommand["Invert"] = "Invert";
132
159
  })(ImageEditorCommand || (ImageEditorCommand = {}));
133
160
  /**
134
161
  * An enumeration of available image filter options.
@@ -774,7 +774,14 @@ export declare class ImageEditor extends Component<HTMLDivElement> implements IN
774
774
  initialize(): void;
775
775
  private createDropUploader;
776
776
  private dlgCloseBtnClick;
777
- private showDialogPopup;
777
+ /**
778
+ * Show dialog popup for unsupported files.
779
+ *
780
+ * @param { string } type - Specifies the type of error.
781
+ * @hidden
782
+ * @returns {void}.
783
+ */
784
+ showDialogPopup(type?: string): void;
778
785
  /**
779
786
  *
780
787
  * This Method will add events to component (element, event, method, current reference)
@@ -1172,7 +1179,7 @@ export declare class ImageEditor extends Component<HTMLDivElement> implements IN
1172
1179
  *
1173
1180
  * @returns {boolean}.
1174
1181
  */
1175
- drawFrame(frameType: FrameType, color: string, gradientColor: string, size: number, inset: number, offset: number, borderRadius: number, frameLineStyle: FrameLineStyle, lineCount: number): boolean;
1182
+ drawFrame(frameType: FrameType, color?: string, gradientColor?: string, size?: number, inset?: number, offset?: number, borderRadius?: number, frameLineStyle?: FrameLineStyle, lineCount?: number): boolean;
1176
1183
  private toolbarTemplateFn;
1177
1184
  private quickAccessToolbarTemplateFn;
1178
1185
  private templateParser;
@@ -21,7 +21,7 @@ import { Component, NotifyPropertyChanges, Property, addClass, removeClass, exte
21
21
  import { Event, EventHandler, getComponent, isNullOrUndefined, getUniqueID } from '@syncfusion/ej2-base';
22
22
  import { Dialog, createSpinner } from '@syncfusion/ej2-popups';
23
23
  import { Complex, Browser, ChildProperty, compile as templateCompiler, compile } from '@syncfusion/ej2-base';
24
- import { ToolbarModule, Crop, Draw, Filter, FreehandDrawing, Selection, Shape, Transform, UndoRedo, Export, ShapeType } from './../index';
24
+ import { ToolbarModule, Crop, Draw, Filter, FreehandDrawing, Selection, Shape, Transform, UndoRedo, Export, FrameLineStyle, ShapeType } from './../index';
25
25
  import { ZoomTrigger, ImageFinetuneOption } from './../index';
26
26
  import { Uploader } from '@syncfusion/ej2-inputs';
27
27
  /**
@@ -306,6 +306,7 @@ var ImageEditor = /** @class */ (function (_super) {
306
306
  * @private
307
307
  */
308
308
  ImageEditor.prototype.onPropertyChanged = function (newProperties, oldProperties) {
309
+ var indexObj;
309
310
  for (var _i = 0, _a = Object.keys(newProperties); _i < _a.length; _i++) {
310
311
  var prop = _a[_i];
311
312
  switch (prop) {
@@ -329,9 +330,11 @@ var ImageEditor = /** @class */ (function (_super) {
329
330
  break;
330
331
  case 'height':
331
332
  this.element.style.height = newProperties.height;
333
+ this.update();
332
334
  break;
333
335
  case 'width':
334
336
  this.element.style.width = newProperties.width;
337
+ this.update();
335
338
  break;
336
339
  case 'theme':
337
340
  if (newProperties.theme) {
@@ -343,6 +346,13 @@ var ImageEditor = /** @class */ (function (_super) {
343
346
  }
344
347
  this.upperContext.strokeStyle = this.themeColl[this.theme]['primaryColor'];
345
348
  this.upperContext.fillStyle = this.themeColl[this.theme]['secondaryColor'];
349
+ if (isBlazor()) {
350
+ this.updateToolbar(this.element, 'imageLoaded');
351
+ }
352
+ else {
353
+ this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
354
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
355
+ }
346
356
  }
347
357
  break;
348
358
  case 'finetuneSettings':
@@ -354,8 +364,13 @@ var ImageEditor = /** @class */ (function (_super) {
354
364
  case 'locale':
355
365
  if (newProperties.locale) {
356
366
  this.notify('toolbar', { prop: 'setLocale', onPropertyChange: false, value: { locale: newProperties.locale } });
357
- this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
358
- isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
367
+ if (isBlazor()) {
368
+ this.updateToolbar(this.element, 'imageLoaded');
369
+ }
370
+ else {
371
+ this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
372
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
373
+ }
359
374
  }
360
375
  break;
361
376
  case 'allowUndoRedo':
@@ -365,18 +380,47 @@ var ImageEditor = /** @class */ (function (_super) {
365
380
  else {
366
381
  this.allowUndoRedo = false;
367
382
  }
368
- this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
369
- isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
383
+ if (isBlazor()) {
384
+ this.updateToolbar(this.element, 'imageLoaded');
385
+ }
386
+ else {
387
+ this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
388
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
389
+ }
370
390
  break;
371
391
  case 'showQuickAccessToolbar':
372
392
  if (newProperties.showQuickAccessToolbar) {
373
393
  this.showQuickAccessToolbar = true;
374
- this.notify('toolbar', { prop: 'create-qa-toolbar', onPropertyChange: false });
375
- this.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
394
+ if (!isBlazor()) {
395
+ this.notify('toolbar', { prop: 'create-qa-toolbar', onPropertyChange: false });
396
+ }
397
+ indexObj = { freehandSelectedIndex: null };
398
+ this.notify('freehand-draw', { prop: 'getFreehandSelectedIndex', onPropertyChange: false, value: { obj: indexObj } });
399
+ if (this.activeObj.shape) {
400
+ if (isBlazor()) {
401
+ this.updateToolbar(this.element, 'quickAccessToolbar', this.activeObj.shape);
402
+ }
403
+ else {
404
+ this.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
405
+ }
406
+ }
407
+ else if (indexObj['freehandSelectedIndex']) {
408
+ if (isBlazor()) {
409
+ this.updateToolbar(this.element, 'quickAccessToolbar', 'pen');
410
+ }
411
+ else {
412
+ this.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: true } });
413
+ }
414
+ }
376
415
  }
377
416
  else {
378
417
  this.showQuickAccessToolbar = false;
379
- this.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
418
+ if (isBlazor()) {
419
+ this.updateToolbar(this.element, 'destroyQuickAccessToolbar');
420
+ }
421
+ else {
422
+ this.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
423
+ }
380
424
  }
381
425
  break;
382
426
  case 'zoomSettings':
@@ -386,12 +430,22 @@ var ImageEditor = /** @class */ (function (_super) {
386
430
  if (isNullOrUndefined(this.zoomSettings.zoomTrigger)) {
387
431
  this.zoomSettings.zoomTrigger = (ZoomTrigger.MouseWheel | ZoomTrigger.Pinch | ZoomTrigger.Toolbar |
388
432
  ZoomTrigger.Commands);
389
- this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
390
- isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
433
+ if (isBlazor()) {
434
+ this.updateToolbar(this.element, 'imageLoaded');
435
+ }
436
+ else {
437
+ this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
438
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
439
+ }
391
440
  }
392
441
  else if ((newProperties.zoomSettings.zoomTrigger & ZoomTrigger.Toolbar) === ZoomTrigger.Toolbar) {
393
- this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
394
- isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
442
+ if (isBlazor()) {
443
+ this.updateToolbar(this.element, 'imageLoaded');
444
+ }
445
+ else {
446
+ this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
447
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
448
+ }
395
449
  }
396
450
  break;
397
451
  case 'selectionSettings':
@@ -403,6 +457,38 @@ var ImageEditor = /** @class */ (function (_super) {
403
457
  }
404
458
  }
405
459
  break;
460
+ case 'toolbar':
461
+ if (newProperties.toolbar) {
462
+ this.toolbar = newProperties.toolbar;
463
+ if (isBlazor()) {
464
+ this.updateToolbar(this.element, 'imageLoaded');
465
+ }
466
+ else {
467
+ this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
468
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
469
+ }
470
+ }
471
+ break;
472
+ case 'toolbarTemplate':
473
+ if (newProperties.toolbarTemplate) {
474
+ if (!isBlazor()) {
475
+ this.notify('toolbar', { prop: 'destroy-bottom-toolbar', onPropertyChange: false });
476
+ this.notify('toolbar', { prop: 'destroy-top-toolbar', onPropertyChange: false });
477
+ this.element.appendChild(this.createElement('div', {
478
+ id: this.element.id + '_toolbarArea', className: 'e-toolbar-area'
479
+ }));
480
+ this.toolbarTemplateFn();
481
+ }
482
+ }
483
+ break;
484
+ case 'quickAccessToolbarTemplate':
485
+ if (newProperties.quickAccessToolbarTemplate) {
486
+ if (!isBlazor()) {
487
+ this.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
488
+ this.quickAccessToolbarTemplateFn();
489
+ }
490
+ }
491
+ break;
406
492
  }
407
493
  }
408
494
  };
@@ -487,15 +573,20 @@ var ImageEditor = /** @class */ (function (_super) {
487
573
  var uploadObj = new Uploader({
488
574
  dropArea: document.getElementsByClassName('e-canvas-wrapper')[0],
489
575
  allowedExtensions: '.jpg, .jpeg, .png,.svg',
576
+ multiple: false,
490
577
  selected: function (args) {
491
578
  if (args.event.type === 'change' || args.event.type === 'drop') {
492
579
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
493
580
  var type = args.filesData[0].type;
494
- if (type === 'png' || type === 'jpg' || type === 'jpeg' || type === 'svg') {
581
+ var errType = 'unsupported';
582
+ if ((args.event.type === 'change' || (args.event.type === 'drop' && args.event.dataTransfer.files.length === 1)) && (type === 'png' || type === 'jpg' || type === 'jpeg' || type === 'svg')) {
495
583
  _this.notify('draw', { prop: 'fileSelect', value: { inputElement: _this.element.querySelector('#' + _this.element.id + '_dropfileUpload'), args: args } });
496
584
  }
497
585
  else {
498
- _this.showDialogPopup();
586
+ if (args.event.type === 'drop' && args.event.dataTransfer.files.length > 1) {
587
+ errType = 'multi-select-image';
588
+ }
589
+ _this.showDialogPopup(errType);
499
590
  }
500
591
  }
501
592
  }
@@ -505,20 +596,39 @@ var ImageEditor = /** @class */ (function (_super) {
505
596
  ImageEditor.prototype.dlgCloseBtnClick = function () {
506
597
  getComponent(document.getElementById(this.element.id + '_dialog'), 'dialog').destroy();
507
598
  };
508
- ImageEditor.prototype.showDialogPopup = function () {
599
+ /**
600
+ * Show dialog popup for unsupported files.
601
+ *
602
+ * @param { string } type - Specifies the type of error.
603
+ * @hidden
604
+ * @returns {void}.
605
+ */
606
+ ImageEditor.prototype.showDialogPopup = function (type) {
607
+ var content = '';
509
608
  this.element.querySelector('#' + this.element.id + '_dialog').style.display = 'block';
510
- var headerObj = { key: 'AlertDialogHeader' };
511
- this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: headerObj } });
512
- var contentObj = { key: 'AlertDialogContent' };
513
- this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: contentObj } });
514
- var supportObj = { key: 'SupportText' };
515
- this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: supportObj } });
609
+ var headerObj;
516
610
  var okObj = { key: 'OK' };
517
611
  this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: okObj } });
612
+ if (type === 'multi-select-image') {
613
+ headerObj = { key: 'ImageErrorDialogHeader' };
614
+ this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: headerObj } });
615
+ var contentObj = { key: 'ImageErrorDialogContent' };
616
+ this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: contentObj } });
617
+ content = '<span>' + contentObj['value'] + '</span>';
618
+ }
619
+ else {
620
+ headerObj = { key: 'AlertDialogHeader' };
621
+ this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: headerObj } });
622
+ var contentObj = { key: 'AlertDialogContent' };
623
+ this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: contentObj } });
624
+ var supportObj = { key: 'SupportText' };
625
+ this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: supportObj } });
626
+ content = '<span>' + contentObj['value'] + ' ' + supportObj['value'] + '<b> JPG, PNG, and SVG</b></span>';
627
+ }
518
628
  var dialog = new Dialog({
519
629
  header: headerObj['value'],
520
630
  closeOnEscape: true,
521
- content: '<span>' + contentObj['value'] + ' ' + supportObj['value'] + '<b> JPG, PNG, and SVG</b></span>',
631
+ content: content,
522
632
  target: document.getElementById('target'),
523
633
  width: '285px',
524
634
  isModal: true,
@@ -964,6 +1074,8 @@ var ImageEditor = /** @class */ (function (_super) {
964
1074
  ImageEditor.prototype.select = function (type, startX, startY, width, height) {
965
1075
  this.notify('draw', { prop: 'select', onPropertyChange: false,
966
1076
  value: { type: type, startX: startX, startY: startY, width: width, height: height } });
1077
+ this.notify('draw', { prop: 'select', onPropertyChange: false,
1078
+ value: { type: type, startX: startX, startY: startY, width: width, height: height } });
967
1079
  };
968
1080
  /**
969
1081
  * Enable or disable a freehand drawing option in an Image Editor.
@@ -1386,10 +1498,18 @@ var ImageEditor = /** @class */ (function (_super) {
1386
1498
  ImageEditor.prototype.drawFrame = function (frameType, color, gradientColor, size, inset, offset, borderRadius, frameLineStyle, lineCount) {
1387
1499
  var isFrame = false;
1388
1500
  var obj = { frameChangeEventArgs: null };
1501
+ color = color ? color : '#fff';
1502
+ gradientColor = gradientColor ? gradientColor : '';
1503
+ size = size ? size : 20;
1504
+ inset = inset ? inset : 0;
1505
+ offset = offset ? offset : 0;
1506
+ borderRadius = borderRadius ? borderRadius : 0;
1507
+ frameLineStyle = frameLineStyle ? frameLineStyle : FrameLineStyle.Solid;
1508
+ lineCount = lineCount ? lineCount : 0;
1389
1509
  var prevFrameSettings = { type: this.toPascalCase(this.frameObj.type), color: this.frameObj.color,
1390
1510
  gradientColor: this.frameObj.gradientColor, size: this.frameObj.size, inset: this.frameObj.inset,
1391
- offset: this.frameObj.offset, borderRadius: this.frameObj.radius, frameLineStyle: this.toPascalCase(this.frameObj.border),
1392
- lineCount: this.frameObj.amount };
1511
+ offset: this.frameObj.offset, borderRadius: this.frameObj.radius,
1512
+ frameLineStyle: this.toPascalCase(this.frameObj.border), lineCount: this.frameObj.amount };
1393
1513
  extend(this.tempFrameObj, this.frameObj);
1394
1514
  this.tempFrameZoomLevel = this.transform.zoomFactor;
1395
1515
  this.frameDestPoints = extend({}, this.img, {}, true);
@@ -1397,6 +1517,7 @@ var ImageEditor = /** @class */ (function (_super) {
1397
1517
  this.notify('toolbar', { prop: 'frameToolbarClick' });
1398
1518
  }
1399
1519
  else {
1520
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1400
1521
  this.performFrameClick();
1401
1522
  }
1402
1523
  this.frameObj.type = frameType.toLowerCase();
@@ -156,7 +156,9 @@ var ToolbarModule = /** @class */ (function () {
156
156
  AlertDialogHeader: 'Unsupported file',
157
157
  AlertDialogContent: 'The dropped file is unsupported.',
158
158
  Yes: 'Yes',
159
- No: 'No'
159
+ No: 'No',
160
+ ImageErrorDialogHeader: 'Image Selection Error',
161
+ ImageErrorDialogContent: 'Please select only one image to open.'
160
162
  };
161
163
  this.l10n = new L10n('image-editor', this.defaultLocale, this.parent.locale);
162
164
  };
@@ -366,7 +368,7 @@ var ToolbarModule = /** @class */ (function () {
366
368
  id: parent.element.id + '_toolbarArea', className: 'e-toolbar-area'
367
369
  }));
368
370
  var toolbarItems = { cssClass: 'e-image-upload', align: 'Left', type: 'Input',
369
- tooltipText: this.l10n.getConstant('Browse'), template: new Uploader({ allowedExtensions: '.jpg, .jpeg, .png,.svg' }) };
371
+ tooltipText: this.l10n.getConstant('Browse'), template: new Uploader({ allowedExtensions: '.jpg, .jpeg, .png,.svg', multiple: false }) };
370
372
  if (isNullOrUndefined(this.defToolbarItems)) {
371
373
  this.defToolbarItems = [];
372
374
  }
@@ -383,6 +385,7 @@ var ToolbarModule = /** @class */ (function () {
383
385
  tooltipText: this.l10n.getConstant('Browse'),
384
386
  template: new Uploader({
385
387
  allowedExtensions: '.jpg, .jpeg, .png,.svg',
388
+ multiple: false,
386
389
  selected: function () {
387
390
  if (!parent.disabled) {
388
391
  if (Browser.isDevice) {
@@ -456,7 +459,7 @@ var ToolbarModule = /** @class */ (function () {
456
459
  var parent = this.parent;
457
460
  if (parent.showQuickAccessToolbar) {
458
461
  var toolbarItems = { cssClass: 'e-image-upload', align: 'Left', type: 'Input',
459
- tooltipText: this.l10n.getConstant('Browse'), template: new Uploader({ allowedExtensions: '.jpg, .jpeg, .png,.svg' }) };
462
+ tooltipText: this.l10n.getConstant('Browse'), template: new Uploader({ allowedExtensions: '.jpg, .jpeg, .png,.svg', multiple: false }) };
460
463
  if (isNullOrUndefined(this.defToolbarItems)) {
461
464
  this.defToolbarItems = [];
462
465
  }
@@ -543,7 +546,7 @@ var ToolbarModule = /** @class */ (function () {
543
546
  var parent = this.parent;
544
547
  var toolbarItems = [];
545
548
  if (!isOkBtn || isResize) {
546
- toolbarItems.push({ id: parent.element.id + '_upload', cssClass: 'e-image-upload', align: 'Left', type: 'Input', template: new Uploader({ allowedExtensions: '.jpg, .jpeg, .png,.svg' }) });
549
+ 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 }) });
547
550
  toolbarItems.push({ visible: false, cssClass: 'e-image-position e-btn e-flat', tooltipText: this.l10n.getConstant('Browse'), align: 'Left' });
548
551
  }
549
552
  if (parent.allowUndoRedo && !isResize) {
@@ -969,7 +972,13 @@ var ToolbarModule = /** @class */ (function () {
969
972
  }
970
973
  };
971
974
  ToolbarModule.prototype.fileSelect = function (inputElement, args) {
972
- this.parent.notify('draw', { prop: 'fileSelect', value: { inputElement: inputElement, args: args } });
975
+ var type = inputElement.files[0].type.split('/')[1];
976
+ if (type === 'png' || type === 'jpg' || type === 'jpeg' || type === 'svg') {
977
+ this.parent.notify('draw', { prop: 'fileSelect', value: { inputElement: inputElement, args: args } });
978
+ }
979
+ else {
980
+ this.parent.showDialogPopup();
981
+ }
973
982
  };
974
983
  ToolbarModule.prototype.renderAnnotationBtn = function (isContextualToolbar) {
975
984
  var _this = this;
@@ -1375,7 +1384,9 @@ var ToolbarModule = /** @class */ (function () {
1375
1384
  }
1376
1385
  }
1377
1386
  if (document.getElementById(parent.element.id + '_cropBtn')) {
1378
- parent.select(document.getElementById(parent.element.id + '_cropBtn').textContent.toLowerCase());
1387
+ parent.notify('draw', { prop: 'select', onPropertyChange: false,
1388
+ value: { type: document.getElementById(parent.element.id + '_cropBtn').textContent.toLowerCase(),
1389
+ startX: null, startY: null, width: null, height: null } });
1379
1390
  }
1380
1391
  }
1381
1392
  });
@@ -3291,7 +3302,8 @@ var ToolbarModule = /** @class */ (function () {
3291
3302
  var text = args.item.id;
3292
3303
  this.currentToolbar = 'crop';
3293
3304
  parent.currSelectionPoint = null;
3294
- parent.select(text);
3305
+ parent.notify('draw', { prop: 'select', onPropertyChange: false,
3306
+ value: { type: text, startX: null, startY: null, width: null, height: null } });
3295
3307
  this.enableDisableTbrBtn();
3296
3308
  parent.notify('transform', { prop: 'disableZoomOutBtn', value: { isZoomOut: true } });
3297
3309
  };