@syncfusion/ej2-image-editor 23.1.36 → 23.1.38

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.
Files changed (54) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/ej2-image-editor.umd.min.js +3 -3
  3. package/dist/ej2-image-editor.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-image-editor.es2015.js +216 -30
  5. package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
  6. package/dist/es6/ej2-image-editor.es5.js +233 -47
  7. package/dist/es6/ej2-image-editor.es5.js.map +1 -1
  8. package/dist/global/ej2-image-editor.min.js +3 -3
  9. package/dist/global/ej2-image-editor.min.js.map +1 -1
  10. package/dist/global/index.d.ts +2 -2
  11. package/package.json +8 -8
  12. package/src/image-editor/action/freehand-draw.d.ts +1 -0
  13. package/src/image-editor/action/freehand-draw.js +52 -26
  14. package/src/image-editor/action/selection.js +38 -3
  15. package/src/image-editor/action/shape.js +33 -16
  16. package/src/image-editor/base/image-editor-model.d.ts +1 -1
  17. package/src/image-editor/base/image-editor.d.ts +8 -0
  18. package/src/image-editor/base/image-editor.js +110 -3
  19. package/src/image-editor/renderer/toolbar.js +1 -0
  20. package/styles/bootstrap-dark.css +5 -0
  21. package/styles/bootstrap.css +5 -0
  22. package/styles/bootstrap4.css +5 -0
  23. package/styles/bootstrap5-dark.css +5 -0
  24. package/styles/bootstrap5.css +5 -0
  25. package/styles/fabric-dark.css +5 -0
  26. package/styles/fabric.css +5 -0
  27. package/styles/fluent-dark.css +5 -0
  28. package/styles/fluent.css +5 -0
  29. package/styles/highcontrast-light.css +5 -0
  30. package/styles/highcontrast.css +5 -0
  31. package/styles/image-editor/_layout.scss +6 -0
  32. package/styles/image-editor/bootstrap-dark.css +5 -0
  33. package/styles/image-editor/bootstrap.css +5 -0
  34. package/styles/image-editor/bootstrap4.css +5 -0
  35. package/styles/image-editor/bootstrap5-dark.css +5 -0
  36. package/styles/image-editor/bootstrap5.css +5 -0
  37. package/styles/image-editor/fabric-dark.css +5 -0
  38. package/styles/image-editor/fabric.css +5 -0
  39. package/styles/image-editor/fluent-dark.css +5 -0
  40. package/styles/image-editor/fluent.css +5 -0
  41. package/styles/image-editor/highcontrast-light.css +5 -0
  42. package/styles/image-editor/highcontrast.css +5 -0
  43. package/styles/image-editor/material-dark.css +5 -0
  44. package/styles/image-editor/material.css +5 -0
  45. package/styles/image-editor/material3-dark.css +5 -0
  46. package/styles/image-editor/material3.css +5 -0
  47. package/styles/image-editor/tailwind-dark.css +5 -0
  48. package/styles/image-editor/tailwind.css +5 -0
  49. package/styles/material-dark.css +5 -0
  50. package/styles/material.css +5 -0
  51. package/styles/material3-dark.css +5 -0
  52. package/styles/material3.css +5 -0
  53. package/styles/tailwind-dark.css +5 -0
  54. package/styles/tailwind.css +5 -0
@@ -6255,6 +6255,13 @@ class FreehandDrawing {
6255
6255
  }
6256
6256
  this.isFreehandPointMoved = false;
6257
6257
  EventHandler.add(canvas, 'mousemove touchmove', this.freehandMoveHandler, this);
6258
+ const shapeSettings = { id: 'pen_' + (this.currFHDIdx + 1), type: ShapeType.FreehandDraw,
6259
+ startX: this.freehandDownPoint.x, startY: this.freehandDownPoint.y,
6260
+ strokeColor: this.parent.activeObj.strokeSettings.strokeColor, strokeWidth: this.parent.activeObj.strokeSettings.strokeWidth,
6261
+ points: null };
6262
+ const shapeChangingArgs = { action: 'draw-start', previousShapeSettings: shapeSettings,
6263
+ currentShapeSettings: shapeSettings };
6264
+ this.triggerShapeChanging(shapeChangingArgs);
6258
6265
  }
6259
6266
  freehandUpHandler(e, canvas, context) {
6260
6267
  const rect = canvas.getBoundingClientRect();
@@ -6299,13 +6306,20 @@ class FreehandDrawing {
6299
6306
  this.selPoints = [];
6300
6307
  this.pointCounter = 0;
6301
6308
  parent.freehandCounter++;
6302
- this.currFHDIdx++;
6303
6309
  this.isFreehandDrawing = false;
6304
6310
  parent.notify('undo-redo', { prop: 'updateUndoRedoColl', onPropertyChange: false,
6305
6311
  value: { operation: 'freehand-draw', previousObj: prevObj, previousObjColl: prevObj.objColl,
6306
6312
  previousPointColl: prevObj.pointColl, previousSelPointColl: prevObj.selPointColl,
6307
6313
  previousCropObj: prevCropObj, previousText: null,
6308
6314
  currentText: null, previousFilter: null, isCircleCrop: null } });
6315
+ const shapeSettings = { id: 'pen_' + (this.currFHDIdx + 1), type: ShapeType.FreehandDraw,
6316
+ startX: this.freehandDownPoint.x, startY: this.freehandDownPoint.y,
6317
+ strokeColor: this.parent.activeObj.strokeSettings.strokeColor, strokeWidth: this.parent.activeObj.strokeSettings.strokeWidth,
6318
+ points: this.parent.pointColl[this.currFHDIdx].points };
6319
+ const shapeChangingArgs = { action: 'draw-end', previousShapeSettings: shapeSettings,
6320
+ currentShapeSettings: shapeSettings };
6321
+ this.triggerShapeChanging(shapeChangingArgs);
6322
+ this.currFHDIdx++;
6309
6323
  }
6310
6324
  freehandMoveHandler(e) {
6311
6325
  this.isFreehandPointMoved = true;
@@ -6671,30 +6685,7 @@ class FreehandDrawing {
6671
6685
  points: parent.pointColl[this.fhdSelIdx].points };
6672
6686
  const shapeChangingArgs = { action: 'select', previousShapeSettings: shapeSettings,
6673
6687
  currentShapeSettings: shapeSettings };
6674
- if (isBlazor() && parent.events && parent.events.shapeChanging.hasDelegate === true) {
6675
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
6676
- parent.dotNetRef.invokeMethodAsync('ShapeEventAsync', 'OnShape', shapeChangingArgs).then((shapeChangingArgs) => {
6677
- parent.activeObj.strokeSettings.strokeColor = parent.pointColl[this.fhdSelIdx].strokeColor =
6678
- shapeChangingArgs.currentShapeSettings.strokeColor;
6679
- parent.activeObj.strokeSettings.strokeWidth = parent.pointColl[this.fhdSelIdx].strokeWidth =
6680
- shapeChangingArgs.currentShapeSettings.strokeWidth;
6681
- parent.pointColl[this.fhdSelIdx].points = shapeChangingArgs.currentShapeSettings.points;
6682
- this.freehandRedraw(this.upperContext);
6683
- parent.updateToolbar(parent.element, 'imageLoaded');
6684
- parent.updateToolbar(parent.element, 'pen');
6685
- });
6686
- }
6687
- else {
6688
- parent.trigger('shapeChanging', shapeChangingArgs);
6689
- parent.activeObj.strokeSettings.strokeColor = parent.pointColl[this.fhdSelIdx].strokeColor =
6690
- shapeChangingArgs.currentShapeSettings.strokeColor;
6691
- parent.activeObj.strokeSettings.strokeWidth = parent.pointColl[this.fhdSelIdx].strokeWidth =
6692
- shapeChangingArgs.currentShapeSettings.strokeWidth;
6693
- parent.pointColl[this.fhdSelIdx].points = shapeChangingArgs.currentShapeSettings.points;
6694
- this.freehandRedraw(this.upperContext);
6695
- parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'pen',
6696
- isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
6697
- }
6688
+ this.triggerShapeChanging(shapeChangingArgs);
6698
6689
  }
6699
6690
  else {
6700
6691
  parent.okBtn();
@@ -7074,6 +7065,41 @@ class FreehandDrawing {
7074
7065
  }
7075
7066
  }
7076
7067
  }
7068
+ triggerShapeChanging(shapeChangingArgs) {
7069
+ const parent = this.parent;
7070
+ if (isBlazor() && parent.events && parent.events.shapeChanging.hasDelegate === true) {
7071
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
7072
+ parent.dotNetRef.invokeMethodAsync('ShapeEventAsync', 'OnShape', shapeChangingArgs).then((shapeChangingArgs) => {
7073
+ parent.activeObj.strokeSettings.strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
7074
+ parent.activeObj.strokeSettings.strokeWidth = shapeChangingArgs.currentShapeSettings.strokeWidth;
7075
+ if (this.fhdSelID) {
7076
+ parent.pointColl[this.fhdSelIdx].strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
7077
+ parent.pointColl[this.fhdSelIdx].strokeWidth = shapeChangingArgs.currentShapeSettings.strokeWidth;
7078
+ parent.pointColl[this.fhdSelIdx].points = shapeChangingArgs.currentShapeSettings.points;
7079
+ }
7080
+ if (shapeChangingArgs.action === 'select') {
7081
+ this.freehandRedraw(this.upperContext);
7082
+ parent.updateToolbar(parent.element, 'imageLoaded');
7083
+ parent.updateToolbar(parent.element, 'pen');
7084
+ }
7085
+ });
7086
+ }
7087
+ else {
7088
+ parent.trigger('shapeChanging', shapeChangingArgs);
7089
+ parent.activeObj.strokeSettings.strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
7090
+ parent.activeObj.strokeSettings.strokeWidth = shapeChangingArgs.currentShapeSettings.strokeWidth;
7091
+ if (this.fhdSelID) {
7092
+ parent.pointColl[this.fhdSelIdx].strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
7093
+ parent.pointColl[this.fhdSelIdx].strokeWidth = shapeChangingArgs.currentShapeSettings.strokeWidth;
7094
+ parent.pointColl[this.fhdSelIdx].points = shapeChangingArgs.currentShapeSettings.points;
7095
+ }
7096
+ if (shapeChangingArgs.action === 'select') {
7097
+ this.freehandRedraw(this.upperContext);
7098
+ parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'pen',
7099
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
7100
+ }
7101
+ }
7102
+ }
7077
7103
  }
7078
7104
 
7079
7105
  class Selection {
@@ -7331,6 +7357,9 @@ class Selection {
7331
7357
  case 'upgradeImageQuality':
7332
7358
  this.upgradeImageQuality();
7333
7359
  break;
7360
+ case 'triggerShapeChange':
7361
+ this.triggerShapeChange(args.value['shapeResizingArgs'], args.value['shapeMovingArgs'], args.value['type']);
7362
+ break;
7334
7363
  }
7335
7364
  }
7336
7365
  getModuleName() {
@@ -8152,8 +8181,14 @@ class Selection {
8152
8181
  parent.activeObj.activePoint.width = parent.activeObj.activePoint.endX - parent.activeObj.activePoint.startX;
8153
8182
  parent.activeObj.activePoint.height = parent.activeObj.activePoint.endY - parent.activeObj.activePoint.startY;
8154
8183
  const currentShapeSettings = this.updatePrevShapeSettings();
8155
- shapeResizingArgs.currentShapeSettings = this.shapeResizingArgs.currentShapeSettings = currentShapeSettings;
8156
- shapeMovingArgs.currentShapeSettings = this.shapeMovingArgs.currentShapeSettings = currentShapeSettings;
8184
+ if (!isNullOrUndefined(this.shapeResizingArgs) && !isNullOrUndefined(this.shapeMovingArgs)) {
8185
+ shapeResizingArgs.currentShapeSettings = this.shapeResizingArgs.currentShapeSettings = currentShapeSettings;
8186
+ shapeMovingArgs.currentShapeSettings = this.shapeMovingArgs.currentShapeSettings = currentShapeSettings;
8187
+ }
8188
+ else {
8189
+ shapeResizingArgs.currentShapeSettings = currentShapeSettings;
8190
+ shapeMovingArgs.currentShapeSettings = currentShapeSettings;
8191
+ }
8157
8192
  if (type === 'resize') {
8158
8193
  this.isCropSelection = false;
8159
8194
  let splitWords;
@@ -8208,6 +8243,20 @@ class Selection {
8208
8243
  }
8209
8244
  }
8210
8245
  }
8246
+ else if (type === 'mouse-down' || type === 'mouse-up') {
8247
+ if (isBlazor() && parent.events && parent.events.shapeChanging.hasDelegate === true) {
8248
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
8249
+ parent.dotNetRef.invokeMethodAsync('ShapeEventAsync', 'OnShape', shapeResizingArgs).then((shapeResizingArgs) => {
8250
+ parent.notify('shape', { prop: 'updateShapeChangeEventArgs', onPropertyChange: false,
8251
+ value: { shapeSettings: shapeResizingArgs.currentShapeSettings } });
8252
+ });
8253
+ }
8254
+ else {
8255
+ parent.trigger('shapeChanging', shapeResizingArgs);
8256
+ parent.notify('shape', { prop: 'updateShapeChangeEventArgs', onPropertyChange: false,
8257
+ value: { shapeSettings: shapeResizingArgs.currentShapeSettings } });
8258
+ }
8259
+ }
8211
8260
  else {
8212
8261
  if (isBlazor() && isNullOrUndefined(this.parent.eventType) && parent.events &&
8213
8262
  parent.events.onShapeDragStart.hasDelegate === true) {
@@ -9917,6 +9966,12 @@ class Selection {
9917
9966
  parent.activeObj.activePoint.endX = parent.activeObj.activePoint.startX;
9918
9967
  parent.activeObj.activePoint.endY = parent.activeObj.activePoint.startY;
9919
9968
  parent.currObjType.isDragging = true;
9969
+ const previousShapeSettings = this.updatePrevShapeSettings();
9970
+ const shapeResizingArgs = { action: 'draw-start', previousShapeSettings: previousShapeSettings };
9971
+ const shapeMovingArgs = { action: 'move', previousShapeSettings: previousShapeSettings };
9972
+ this.shapeResizingArgs = shapeResizingArgs;
9973
+ this.shapeMovingArgs = shapeMovingArgs;
9974
+ this.triggerShapeChange(shapeResizingArgs, shapeMovingArgs, 'mouse-down');
9920
9975
  return;
9921
9976
  }
9922
9977
  parent.notify('draw', { prop: 'resetFrameZoom', onPropertyChange: false });
@@ -10320,7 +10375,7 @@ class Selection {
10320
10375
  }
10321
10376
  if (this.currentDrawingShape === 'path') {
10322
10377
  const elem = e.srcElement;
10323
- if (e.currentTarget !== parent.upperCanvas && e.currentTarget !== parent.lowerCanvas &&
10378
+ if (e.currentTarget !== parent.upperCanvas && e.currentTarget !== parent.lowerCanvas && parent.activeObj.pointColl.length > 0 &&
10324
10379
  (elem.classList.contains('e-upload-icon') || elem.parentElement.id === parent.element.id + '_zoomIn' ||
10325
10380
  elem.parentElement.id === parent.element.id + '_zoomOut' || elem.parentElement.id === parent.element.id + '_annotationBtn' ||
10326
10381
  elem.parentElement.id === parent.element.id + '_borderColorBtn' || elem.parentElement.id === parent.element.id + '_borderWidthBtn' ||
@@ -10351,6 +10406,12 @@ class Selection {
10351
10406
  if (parent.activeObj.activePoint.width === 0 && parent.activeObj.activePoint.height === 0) {
10352
10407
  parent.notify('draw', { prop: 'performCancel', value: { isContextualToolbar: null } });
10353
10408
  }
10409
+ const previousShapeSettings = this.updatePrevShapeSettings();
10410
+ const shapeResizingArgs = { action: 'draw-end', previousShapeSettings: previousShapeSettings };
10411
+ const shapeMovingArgs = { action: 'move', previousShapeSettings: previousShapeSettings };
10412
+ this.shapeResizingArgs = shapeResizingArgs;
10413
+ this.shapeMovingArgs = shapeMovingArgs;
10414
+ this.triggerShapeChange(shapeResizingArgs, shapeMovingArgs, 'mouse-up');
10354
10415
  }
10355
10416
  this.adjustActObjForLineArrow();
10356
10417
  this.updPtCollForShpRot();
@@ -12684,6 +12745,9 @@ class Shape {
12684
12745
  parent.activeObj.activePoint.endY = parent.activeObj.activePoint.startY + parent.activeObj.activePoint.height;
12685
12746
  parent.activeObj.strokeSettings.strokeColor = shapeSettings.strokeColor;
12686
12747
  parent.activeObj.strokeSettings.fillColor = shapeSettings.fillColor;
12748
+ if (isNullOrUndefined(shapeSettings.degree)) {
12749
+ shapeSettings.degree = 0;
12750
+ }
12687
12751
  switch (parent.activeObj.shape) {
12688
12752
  case 'ellipse':
12689
12753
  parent.activeObj.activePoint.width = shapeSettings.radius * 2;
@@ -13514,6 +13578,13 @@ class Shape {
13514
13578
  else {
13515
13579
  parent.updateToolbar(parent.element, 'quickAccessToolbar', parent.activeObj.shape);
13516
13580
  }
13581
+ const obj = { shapeSettingsObj: {} };
13582
+ parent.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: obj } });
13583
+ const shapeSettings = obj['shapeSettingsObj'];
13584
+ const shapeResizingArgs = { action: 'draw-end', previousShapeSettings: shapeSettings };
13585
+ const shapeMovingArgs = { action: 'move', previousShapeSettings: shapeSettings };
13586
+ parent.notify('selection', { prop: 'triggerShapeChange', onPropertyChange: false,
13587
+ value: { shapeResizingArgs: shapeResizingArgs, shapeMovingArgs: shapeMovingArgs, type: 'mouse-up' } });
13517
13588
  }
13518
13589
  }
13519
13590
  }
@@ -14009,6 +14080,9 @@ class Shape {
14009
14080
  }
14010
14081
  applyFontStyle(item) {
14011
14082
  const parent = this.parent;
14083
+ const obj = { shapeSettingsObj: {} };
14084
+ parent.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: obj } });
14085
+ const shapeSettings = obj['shapeSettingsObj'];
14012
14086
  this.pushActItemIntoObj();
14013
14087
  const objColl = extend([], parent.objColl, [], true);
14014
14088
  parent.objColl.pop();
@@ -14032,6 +14106,10 @@ class Shape {
14032
14106
  this.updateFontStyle(item, objColl, 'bold', 'italic');
14033
14107
  break;
14034
14108
  }
14109
+ const shapeChangedArgs = { action: 'font-style', previousShapeSettings: extend({}, shapeSettings, {}, true),
14110
+ currentShapeSettings: extend({}, shapeSettings, {}, true) };
14111
+ shapeChangedArgs.currentShapeSettings.fontStyle = [item];
14112
+ parent.triggerShapeChanged(shapeChangedArgs);
14035
14113
  }
14036
14114
  updateFontStyle(item, objColl, fontWeight, fontStyle) {
14037
14115
  const parent = this.parent;
@@ -18444,6 +18522,10 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
18444
18522
  this.notify('toolbar', { prop: 'create-contextual-toolbar', onPropertyChange: false });
18445
18523
  }
18446
18524
  this.createCanvas();
18525
+ if (this.element.offsetWidth > 359 && this.element.querySelector('.e-ie-min-drop-content') && this.element.querySelector('.e-ie-drop-content')) {
18526
+ this.element.querySelector('.e-ie-min-drop-content').style.display = 'none';
18527
+ this.element.querySelector('.e-ie-drop-content').style.display = 'block';
18528
+ }
18447
18529
  this.createDropUploader();
18448
18530
  if (this.showQuickAccessToolbar) {
18449
18531
  const canvasWrapper = document.querySelector('#' + this.element.id + '_canvasWrapper');
@@ -18601,18 +18683,26 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
18601
18683
  }));
18602
18684
  const dragObj = { key: 'DragText' };
18603
18685
  this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: dragObj } });
18686
+ const dropObj = { key: 'DropText' };
18687
+ this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: dropObj } });
18604
18688
  const browseObj = { key: 'BrowseText' };
18605
18689
  this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: browseObj } });
18606
18690
  const supportObj = { key: 'SupportText' };
18607
18691
  this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: supportObj } });
18608
18692
  const dropAreaElement = this.createElement('div', { id: this.element.id + '_dropArea', className: 'e-ie-drop-area', attrs: { style: 'position: relative;' } });
18609
18693
  const dropIconElement = this.createElement('span', { className: 'e-ie-drop-icon e-icons e-image', attrs: { style: 'position: absolute;' } });
18610
- const dropContentElement = this.createElement('span', { className: 'e-ie-drop-content', attrs: { style: 'position: absolute;' } });
18694
+ const dropContentElement = this.createElement('span', { className: 'e-ie-drop-content', attrs: { style: 'position: absolute; display: none;' } });
18611
18695
  dropContentElement.textContent = dragObj['value'] + ' ';
18696
+ const minDropContentElem = this.createElement('span', { className: 'e-ie-min-drop-content', attrs: { style: 'position: absolute;' } });
18697
+ minDropContentElem.textContent = dropObj['value'] + ' ';
18612
18698
  const dropAnchorElement = this.createElement('a', { id: this.element.id + '_dropBrowse', className: 'e-ie-drop-browse' });
18613
18699
  dropAnchorElement.textContent = browseObj['value'];
18700
+ const minDropAnchorElem = this.createElement('a', { id: this.element.id + '_dropBrowse', className: 'e-ie-drop-browse' });
18701
+ minDropAnchorElem.textContent = browseObj['value'];
18614
18702
  dropContentElement.appendChild(dropAnchorElement);
18703
+ minDropContentElem.appendChild(minDropAnchorElem);
18615
18704
  dropAnchorElement.href = '';
18705
+ minDropAnchorElem.href = '';
18616
18706
  const dropInfoElement = this.createElement('span', { className: 'e-ie-drop-info', attrs: { position: 'absolute' } });
18617
18707
  dropInfoElement.textContent = supportObj['value'] + ' SVG, PNG, and JPG';
18618
18708
  const dropUploader = dropAreaElement.appendChild(this.createElement('input', {
@@ -18622,6 +18712,7 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
18622
18712
  dropUploader.setAttribute('accept', 'image/*');
18623
18713
  dropAreaElement.appendChild(dropIconElement);
18624
18714
  dropAreaElement.appendChild(dropContentElement);
18715
+ dropAreaElement.appendChild(minDropContentElem);
18625
18716
  dropAreaElement.appendChild(dropInfoElement);
18626
18717
  canvasWrapper.appendChild(dropAreaElement);
18627
18718
  this.lowerCanvas = canvasWrapper.appendChild(this.createElement('canvas', {
@@ -19628,7 +19719,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
19628
19719
  * @returns {void}.
19629
19720
  */
19630
19721
  okBtn(isMouseDown) {
19631
- this.element.querySelector('.e-contextual-toolbar-wrapper').classList.remove('e-frame-wrapper');
19722
+ if (this.element.querySelector('.e-contextual-toolbar-wrapper')) {
19723
+ this.element.querySelector('.e-contextual-toolbar-wrapper').classList.remove('e-frame-wrapper');
19724
+ }
19632
19725
  let isCropSelection = false;
19633
19726
  let splitWords;
19634
19727
  const aspectIcon = this.element.querySelector('#' + this.element.id + '_aspectratio');
@@ -19645,6 +19738,17 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
19645
19738
  isCropSelection = true;
19646
19739
  }
19647
19740
  this.allowDownScale = true;
19741
+ if ((this.activeObj.shape && this.activeObj.shape !== 'image' || this.togglePen) && !isCropSelection) {
19742
+ const objt = { shapeSettingsObj: {} };
19743
+ this.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: objt } });
19744
+ const shapeSettings = objt['shapeSettingsObj'];
19745
+ if (this.togglePen) {
19746
+ shapeSettings.type = ShapeType.FreehandDraw;
19747
+ }
19748
+ const shapeChangedArgs = { action: 'apply', previousShapeSettings: extend({}, shapeSettings, {}, true),
19749
+ currentShapeSettings: extend({}, shapeSettings, {}, true) };
19750
+ this.triggerShapeChanged(shapeChangedArgs);
19751
+ }
19648
19752
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
19649
19753
  if (aspectIcon || nonAspectIcon || (isBlazor() && this.currentToolbar === 'resize-toolbar')) {
19650
19754
  const obj = { width: null, height: null };
@@ -19940,6 +20044,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
19940
20044
  this.notify('shape', { prop: 'pushActItemIntoObj' });
19941
20045
  const prevCropObj = extend({}, this.cropObj, {}, true);
19942
20046
  const object = { currObj: {} };
20047
+ const objt = { shapeSettingsObj: {} };
20048
+ this.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: objt } });
20049
+ const shapeSettings = objt['shapeSettingsObj'];
19943
20050
  this.notify('filter', { prop: 'getCurrentObj', onPropertyChange: false, value: { object: object } });
19944
20051
  const prevObj = object['currObj'];
19945
20052
  prevObj.objColl = extend([], this.objColl, [], true);
@@ -19976,6 +20083,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
19976
20083
  }
19977
20084
  }
19978
20085
  }
20086
+ const shapeChangedArgs = { action: type, previousShapeSettings: extend({}, shapeSettings, {}, true),
20087
+ currentShapeSettings: extend({}, shapeSettings, {}, true) };
20088
+ this.triggerShapeChanged(shapeChangedArgs);
19979
20089
  }
19980
20090
  /**
19981
20091
  * Apply Font style for text.
@@ -19989,6 +20099,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
19989
20099
  this.notify('shape', { prop: 'pushActItemIntoObj' });
19990
20100
  const objColl = extend([], this.objColl, [], true);
19991
20101
  const prevCropObj = extend({}, this.cropObj, {}, true);
20102
+ const objt = { shapeSettingsObj: {} };
20103
+ this.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: objt } });
20104
+ const shapeSettings = objt['shapeSettingsObj'];
19992
20105
  const object = { currObj: {} };
19993
20106
  this.notify('filter', { prop: 'getCurrentObj', onPropertyChange: false, value: { object: object } });
19994
20107
  const prevObj = object['currObj'];
@@ -20037,6 +20150,10 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
20037
20150
  currentText: null, previousFilter: null, isCircleCrop: null } });
20038
20151
  this.notify('selection', { prop: 'redrawShape', value: { obj: this.objColl[this.objColl.length - 1] } });
20039
20152
  }
20153
+ const shapeChangedArgs = { action: 'font-family', previousShapeSettings: extend({}, shapeSettings, {}, true),
20154
+ currentShapeSettings: extend({}, shapeSettings, {}, true) };
20155
+ shapeChangedArgs.currentShapeSettings.fontFamily = this.textArea.style.fontFamily;
20156
+ this.triggerShapeChanged(shapeChangedArgs);
20040
20157
  }
20041
20158
  /**
20042
20159
  * Apply Font size for text.
@@ -20050,6 +20167,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
20050
20167
  this.notify('selection', { prop: 'setInitialTextEdit', value: { bool: false } });
20051
20168
  this.notify('shape', { prop: 'pushActItemIntoObj' });
20052
20169
  const prevCropObj = extend({}, this.cropObj, {}, true);
20170
+ const objt = { shapeSettingsObj: {} };
20171
+ this.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: objt } });
20172
+ const shapeSettings = objt['shapeSettingsObj'];
20053
20173
  const object = { currObj: {} };
20054
20174
  this.notify('filter', { prop: 'getCurrentObj', onPropertyChange: false, value: { object: object } });
20055
20175
  const prevObj = object['currObj'];
@@ -20129,6 +20249,10 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
20129
20249
  currentText: null, previousFilter: null, isCircleCrop: null } });
20130
20250
  this.notify('selection', { prop: 'redrawShape', value: { obj: this.objColl[this.objColl.length - 1] } });
20131
20251
  }
20252
+ const shapeChangedArgs = { action: 'font-size', previousShapeSettings: extend({}, shapeSettings, {}, true),
20253
+ currentShapeSettings: extend({}, shapeSettings, {}, true) };
20254
+ shapeChangedArgs.currentShapeSettings.fontSize = this.activeObj.textSettings.fontSize;
20255
+ this.triggerShapeChanged(shapeChangedArgs);
20132
20256
  }
20133
20257
  /**
20134
20258
  * Apply Font color for text.
@@ -20141,6 +20265,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
20141
20265
  this.notify('selection', { prop: 'setInitialTextEdit', value: { bool: false } });
20142
20266
  this.notify('shape', { prop: 'pushActItemIntoObj' });
20143
20267
  const prevCropObj = extend({}, this.cropObj, {}, true);
20268
+ const objt = { shapeSettingsObj: {} };
20269
+ this.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: objt } });
20270
+ const shapeSettings = objt['shapeSettingsObj'];
20144
20271
  const object = { currObj: {} };
20145
20272
  this.notify('filter', { prop: 'getCurrentObj', onPropertyChange: false, value: { object: object } });
20146
20273
  const prevObj = object['currObj'];
@@ -20188,6 +20315,10 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
20188
20315
  currentText: null, previousFilter: null, isCircleCrop: null } });
20189
20316
  this.notify('selection', { prop: 'redrawShape', value: { obj: this.objColl[this.objColl.length - 1] } });
20190
20317
  }
20318
+ const shapeChangedArgs = { action: 'font-color', previousShapeSettings: extend({}, shapeSettings, {}, true),
20319
+ currentShapeSettings: extend({}, shapeSettings, {}, true) };
20320
+ shapeChangedArgs.currentShapeSettings.fillColor = value;
20321
+ this.triggerShapeChanged(shapeChangedArgs);
20191
20322
  }
20192
20323
  /**
20193
20324
  * Apply Pen stroke width.
@@ -20201,6 +20332,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
20201
20332
  const temp = extend([], this.pointColl, [], true);
20202
20333
  this.updateFreehandDrawColorChange();
20203
20334
  const prevCropObj = extend({}, this.cropObj, {}, true);
20335
+ const objt = { shapeSettingsObj: {} };
20336
+ this.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: objt } });
20337
+ let shapeSettings = objt['shapeSettingsObj'];
20204
20338
  const object = { currObj: {} };
20205
20339
  this.notify('filter', { prop: 'getCurrentObj', onPropertyChange: false, value: { object: object } });
20206
20340
  const prevObj = object['currObj'];
@@ -20231,6 +20365,11 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
20231
20365
  previousCropObj: prevCropObj, previousText: null,
20232
20366
  currentText: null, previousFilter: null, isCircleCrop: null } });
20233
20367
  }
20368
+ shapeSettings.type = ShapeType.FreehandDraw;
20369
+ const shapeChangedArgs = { action: 'stroke-width', previousShapeSettings: extend({}, shapeSettings, {}, true),
20370
+ currentShapeSettings: extend({}, shapeSettings, {}, true) };
20371
+ shapeChangedArgs.currentShapeSettings.strokeWidth = this.activeObj.strokeSettings.strokeWidth;
20372
+ this.triggerShapeChanged(shapeChangedArgs);
20234
20373
  }
20235
20374
  /**
20236
20375
  * Apply Pen stroke color.
@@ -20244,6 +20383,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
20244
20383
  const temp = extend([], this.pointColl, [], true);
20245
20384
  this.updateFreehandDrawColorChange();
20246
20385
  const prevCropObj = extend({}, this.cropObj, {}, true);
20386
+ const objt = { shapeSettingsObj: {} };
20387
+ this.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: objt } });
20388
+ const shapeSettings = objt['shapeSettingsObj'];
20247
20389
  const object = { currObj: {} };
20248
20390
  this.notify('filter', { prop: 'getCurrentObj', onPropertyChange: false, value: { object: object } });
20249
20391
  const prevObj = object['currObj'];
@@ -20275,6 +20417,11 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
20275
20417
  else if (!this.togglePen) {
20276
20418
  this.notify('selection', { prop: 'redrawShape', value: { obj: this.activeObj } });
20277
20419
  }
20420
+ shapeSettings.type = ShapeType.FreehandDraw;
20421
+ const shapeChangedArgs = { action: 'stroke-color', previousShapeSettings: extend({}, shapeSettings, {}, true),
20422
+ currentShapeSettings: extend({}, shapeSettings, {}, true) };
20423
+ shapeChangedArgs.currentShapeSettings.strokeColor = value;
20424
+ this.triggerShapeChanged(shapeChangedArgs);
20278
20425
  }
20279
20426
  /**
20280
20427
  * Apply Shape stroke width.
@@ -20286,6 +20433,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
20286
20433
  updateStrokeWidth(id) {
20287
20434
  if (this.activeObj.shape && (this.activeObj.shape !== 'path' || (this.activeObj.shape === 'path' &&
20288
20435
  this.activeObj.pointColl.length > 0))) {
20436
+ const obj = { shapeSettingsObj: {} };
20437
+ this.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: obj } });
20438
+ const shapeSettings = obj['shapeSettingsObj'];
20289
20439
  this.notify('shape', { prop: 'pushActItemIntoObj' });
20290
20440
  const prevCropObj = extend({}, this.cropObj, {}, true);
20291
20441
  const object = { currObj: {} };
@@ -20310,6 +20460,10 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
20310
20460
  previousCropObj: prevCropObj, previousText: null,
20311
20461
  currentText: null, previousFilter: null, isCircleCrop: null } });
20312
20462
  this.notify('selection', { prop: 'redrawShape', value: { obj: this.objColl[this.objColl.length - 1] } });
20463
+ const shapeChangedArgs = { action: 'stroke-width', previousShapeSettings: extend({}, shapeSettings, {}, true),
20464
+ currentShapeSettings: extend({}, shapeSettings, {}, true) };
20465
+ shapeChangedArgs.currentShapeSettings.strokeWidth = this.activeObj.strokeSettings.strokeWidth;
20466
+ this.triggerShapeChanged(shapeChangedArgs);
20313
20467
  }
20314
20468
  else if (this.activeObj.shape && (this.activeObj.shape === 'path' &&
20315
20469
  this.activeObj.pointColl.length === 0)) {
@@ -20327,6 +20481,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
20327
20481
  * @returns {void}.
20328
20482
  */
20329
20483
  updateStrokeColor(value) {
20484
+ const objt = { shapeSettingsObj: {} };
20485
+ this.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: objt } });
20486
+ const shapeSettings = objt['shapeSettingsObj'];
20330
20487
  if (this.activeObj.shape && (this.activeObj.shape !== 'path' || (this.activeObj.shape === 'path' &&
20331
20488
  this.activeObj.pointColl.length > 0))) {
20332
20489
  this.notify('shape', { prop: 'pushActItemIntoObj' });
@@ -20359,6 +20516,10 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
20359
20516
  this.activeObj.strokeSettings.strokeColor = value;
20360
20517
  this.notify('shape', { prop: 'setStrokeSettings', value: { strokeSettings: null, strokeColor: this.activeObj.strokeSettings.strokeColor, fillColor: null, strokeWidth: null } });
20361
20518
  }
20519
+ const shapeChangedArgs = { action: 'stroke-color', previousShapeSettings: extend({}, shapeSettings, {}, true),
20520
+ currentShapeSettings: extend({}, shapeSettings, {}, true) };
20521
+ shapeChangedArgs.currentShapeSettings.strokeColor = value;
20522
+ this.triggerShapeChanged(shapeChangedArgs);
20362
20523
  }
20363
20524
  /**
20364
20525
  * Apply Shape fill color.
@@ -20368,6 +20529,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
20368
20529
  * @returns {void}.
20369
20530
  */
20370
20531
  updateFillColor(value) {
20532
+ const obj = { shapeSettingsObj: {} };
20533
+ this.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: obj } });
20534
+ const shapeSettings = obj['shapeSettingsObj'];
20371
20535
  this.notify('shape', { prop: 'pushActItemIntoObj' });
20372
20536
  const prevCropObj = extend({}, this.cropObj, {}, true);
20373
20537
  const object = { currObj: {} };
@@ -20392,6 +20556,10 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
20392
20556
  previousCropObj: prevCropObj, previousText: null,
20393
20557
  currentText: null, previousFilter: null, isCircleCrop: null } });
20394
20558
  this.notify('selection', { prop: 'redrawShape', value: { obj: this.objColl[this.objColl.length - 1] } });
20559
+ const shapeChangedArgs = { action: 'fill-color', previousShapeSettings: extend({}, shapeSettings, {}, true),
20560
+ currentShapeSettings: extend({}, shapeSettings, {}, true) };
20561
+ shapeChangedArgs.currentShapeSettings.fillColor = value;
20562
+ this.triggerShapeChanged(shapeChangedArgs);
20395
20563
  }
20396
20564
  /**
20397
20565
  * Apply horizontal flip.
@@ -20588,6 +20756,10 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
20588
20756
  if (isBlazor() && this.element.querySelector('.place-holder')) {
20589
20757
  this.element.querySelector('.place-holder').remove();
20590
20758
  }
20759
+ if (this.element.offsetWidth > 359 && this.element.querySelector('.e-ie-min-drop-content') && this.element.querySelector('.e-ie-drop-content')) {
20760
+ this.element.querySelector('.e-ie-min-drop-content').style.display = 'none';
20761
+ this.element.querySelector('.e-ie-drop-content').style.display = 'block';
20762
+ }
20591
20763
  if (isBlazor() && this.element.querySelector('.e-ie-drop-area')) {
20592
20764
  this.element.querySelector('.e-ie-drop-area').style.display = 'block';
20593
20765
  }
@@ -20692,6 +20864,19 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
20692
20864
  // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
20693
20865
  updateToolbar(element, type, value) {
20694
20866
  }
20867
+ /**
20868
+ * Trigger the shapeChanging event for after the shape applied.
20869
+ *
20870
+ * @param { ShapeChangeEventArgs } shapeChangedArgs - Specifies the shapeChaning event args.
20871
+ * @hidden
20872
+ * @returns {void}.
20873
+ */
20874
+ triggerShapeChanged(shapeChangedArgs) {
20875
+ if (isBlazor() && this.events && this.events.shapeChanged.hasDelegate === true) {
20876
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
20877
+ this.dotNetRef.invokeMethodAsync('ShapeEventAsync', 'ShapeChanged', shapeChangedArgs);
20878
+ }
20879
+ }
20695
20880
  };
20696
20881
  __decorate([
20697
20882
  Property('')
@@ -21164,6 +21349,7 @@ class ToolbarModule {
21164
21349
  W: 'W',
21165
21350
  H: 'H',
21166
21351
  DragText: 'Drag and drop your image here or',
21352
+ DropText: 'Drop your image here or',
21167
21353
  BrowseText: 'Browse here...',
21168
21354
  SupportText: 'Supports:',
21169
21355
  Frame: 'Frame',