@syncfusion/ej2-image-editor 26.1.41 → 26.2.5

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 (53) hide show
  1. package/dist/ej2-image-editor.umd.min.js +2 -2
  2. package/dist/ej2-image-editor.umd.min.js.map +1 -1
  3. package/dist/es6/ej2-image-editor.es2015.js +83 -19
  4. package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
  5. package/dist/es6/ej2-image-editor.es5.js +82 -18
  6. package/dist/es6/ej2-image-editor.es5.js.map +1 -1
  7. package/dist/global/ej2-image-editor.min.js +2 -2
  8. package/dist/global/ej2-image-editor.min.js.map +1 -1
  9. package/dist/global/index.d.ts +1 -1
  10. package/hotfix/26.1.35_Vol2.txt +1 -0
  11. package/package.json +12 -12
  12. package/src/image-editor/action/selection.js +6 -3
  13. package/src/image-editor/action/transform.js +2 -1
  14. package/src/image-editor/base/image-editor.js +56 -7
  15. package/src/image-editor/renderer/toolbar.js +18 -7
  16. package/styles/bootstrap-dark.css +0 -2
  17. package/styles/bootstrap.css +0 -2
  18. package/styles/bootstrap4.css +2 -0
  19. package/styles/bootstrap5-dark.css +2 -0
  20. package/styles/bootstrap5.css +2 -0
  21. package/styles/fabric-dark.css +1 -2
  22. package/styles/fabric.css +1 -2
  23. package/styles/fluent-dark.css +3 -2
  24. package/styles/fluent.css +3 -2
  25. package/styles/fluent2.css +26 -12
  26. package/styles/highcontrast-light.css +3 -2
  27. package/styles/highcontrast.css +3 -2
  28. package/styles/image-editor/_layout.scss +16 -0
  29. package/styles/image-editor/_theme.scss +34 -1
  30. package/styles/image-editor/bootstrap-dark.css +0 -2
  31. package/styles/image-editor/bootstrap.css +0 -2
  32. package/styles/image-editor/bootstrap4.css +2 -0
  33. package/styles/image-editor/bootstrap5-dark.css +2 -0
  34. package/styles/image-editor/bootstrap5.css +2 -0
  35. package/styles/image-editor/fabric-dark.css +1 -2
  36. package/styles/image-editor/fabric.css +1 -2
  37. package/styles/image-editor/fluent-dark.css +3 -2
  38. package/styles/image-editor/fluent.css +3 -2
  39. package/styles/image-editor/fluent2.css +26 -12
  40. package/styles/image-editor/highcontrast-light.css +3 -2
  41. package/styles/image-editor/highcontrast.css +3 -2
  42. package/styles/image-editor/material-dark.css +0 -2
  43. package/styles/image-editor/material.css +0 -2
  44. package/styles/image-editor/material3-dark.css +2 -3
  45. package/styles/image-editor/material3.css +2 -3
  46. package/styles/image-editor/tailwind-dark.css +2 -2
  47. package/styles/image-editor/tailwind.css +2 -2
  48. package/styles/material-dark.css +0 -2
  49. package/styles/material.css +0 -2
  50. package/styles/material3-dark.css +2 -3
  51. package/styles/material3.css +2 -3
  52. package/styles/tailwind-dark.css +2 -2
  53. package/styles/tailwind.css +2 -2
@@ -9048,6 +9048,10 @@ class Selection {
9048
9048
  return;
9049
9049
  }
9050
9050
  const actObj = extend({}, obj[i], {}, true);
9051
+ if (actObj.activePoint.width === 0 && actObj.activePoint.height === 0) {
9052
+ obj.splice(i, 1);
9053
+ return;
9054
+ }
9051
9055
  this.cursorTargetId = actObj.currIndex;
9052
9056
  if (actObj.shape === 'line' || actObj.shape === 'arrow') {
9053
9057
  this.setCursorForLineArrow(actObj, x, y, upperCanvas);
@@ -11636,7 +11640,6 @@ class Selection {
11636
11640
  const tempObj = extend({}, parent.objColl[parent.objColl.length - 1], {}, true);
11637
11641
  parent.objColl.pop();
11638
11642
  this.redrawShape(tempObj);
11639
- parent.objColl.push(tempObj);
11640
11643
  this.tempObjColl = undefined;
11641
11644
  }
11642
11645
  if (!this.isFhdEditing) {
@@ -12122,10 +12125,10 @@ class Selection {
12122
12125
  this.panDown = null;
12123
12126
  parent.notify('transform', { prop: 'setPanMove', onPropertyChange: false,
12124
12127
  value: { point: null } });
12125
- parent.notify('transform', { prop: 'setTempPanMove', onPropertyChange: false,
12126
- value: { point: null } });
12127
12128
  }
12128
12129
  }
12130
+ parent.notify('transform', { prop: 'setTempPanMove', onPropertyChange: false,
12131
+ value: { point: null } });
12129
12132
  if (this.currentDrawingShape !== 'path') {
12130
12133
  parent.currObjType.isDragging = false;
12131
12134
  }
@@ -12321,7 +12324,7 @@ class Selection {
12321
12324
  focusRatioBtn() {
12322
12325
  const id = this.parent.element.id;
12323
12326
  if (this.parent.isKBDNavigation) {
12324
- setTimeout(function () {
12327
+ setTimeout(() => {
12325
12328
  if (document.getElementById(id + '_aspectratio')) {
12326
12329
  document.getElementById(id + '_aspectratio').focus();
12327
12330
  }
@@ -18627,7 +18630,8 @@ class Transform {
18627
18630
  if (freehandObj['bool']) {
18628
18631
  parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
18629
18632
  }
18630
- if (parent.activeObj.shape !== undefined) {
18633
+ const actPoint = extend({}, parent.activeObj.activePoint, {}, true);
18634
+ if (parent.activeObj.shape && (actPoint.width !== 0 || actPoint.height !== 0)) {
18631
18635
  isActiveObj = true;
18632
18636
  if (parent.textArea.style.display === 'block' || parent.textArea.style.display === 'inline-block') {
18633
18637
  parent.notify('shape', { prop: 'redrawActObj', onPropertyChange: false,
@@ -22893,7 +22897,12 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
22893
22897
  * @returns {void}.
22894
22898
  */
22895
22899
  updateArrow(type, id) {
22900
+ let isObjPushed = false;
22901
+ const collLength = this.objColl.length;
22896
22902
  this.notify('shape', { prop: 'pushActItemIntoObj' });
22903
+ if (collLength !== this.objColl.length) {
22904
+ isObjPushed = true;
22905
+ }
22897
22906
  const prevCropObj = extend({}, this.cropObj, {}, true);
22898
22907
  const object = { currObj: {} };
22899
22908
  const objt = { shapeSettingsObj: {} };
@@ -22904,7 +22913,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
22904
22913
  prevObj.objColl = extend([], this.objColl, [], true);
22905
22914
  prevObj.pointColl = extend([], this.pointColl, [], true);
22906
22915
  prevObj.afterCropActions = extend([], this.afterCropActions, [], true);
22907
- this.objColl.pop();
22916
+ if (isObjPushed) {
22917
+ this.objColl.pop();
22918
+ }
22908
22919
  if (type === 'startArrow') {
22909
22920
  this.activeObj.start = this.getTextFromId(id);
22910
22921
  }
@@ -22948,7 +22959,12 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
22948
22959
  */
22949
22960
  updateFontFamily(id) {
22950
22961
  this.notify('selection', { prop: 'setInitialTextEdit', value: { bool: false } });
22962
+ let isObjPushed = false;
22963
+ const collLength = this.objColl.length;
22951
22964
  this.notify('shape', { prop: 'pushActItemIntoObj' });
22965
+ if (collLength !== this.objColl.length) {
22966
+ isObjPushed = true;
22967
+ }
22952
22968
  const objColl = extend([], this.objColl, [], true);
22953
22969
  const prevCropObj = extend({}, this.cropObj, {}, true);
22954
22970
  const objt = { shapeSettingsObj: {} };
@@ -22964,7 +22980,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
22964
22980
  this.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false,
22965
22981
  value: { obj: selPointCollObj } });
22966
22982
  prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
22967
- this.objColl.pop();
22983
+ if (isObjPushed) {
22984
+ this.objColl.pop();
22985
+ }
22968
22986
  if (this.textArea.style.display === 'block' || this.textArea.style.display === 'inline-block') {
22969
22987
  this.notify('shape', { prop: 'updateFontRatio', onPropertyChange: false,
22970
22988
  value: { obj: this.activeObj, isTextArea: true } });
@@ -23024,7 +23042,12 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
23024
23042
  updateFontSize(text) {
23025
23043
  const itemText = text;
23026
23044
  this.notify('selection', { prop: 'setInitialTextEdit', value: { bool: false } });
23045
+ let isObjPushed = false;
23046
+ const collLength = this.objColl.length;
23027
23047
  this.notify('shape', { prop: 'pushActItemIntoObj' });
23048
+ if (collLength !== this.objColl.length) {
23049
+ isObjPushed = true;
23050
+ }
23028
23051
  const prevCropObj = extend({}, this.cropObj, {}, true);
23029
23052
  const objt = { shapeSettingsObj: {} };
23030
23053
  this.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: objt } });
@@ -23039,7 +23062,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
23039
23062
  this.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false,
23040
23063
  value: { obj: selPointCollObj } });
23041
23064
  prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
23042
- this.objColl.pop();
23065
+ if (isObjPushed) {
23066
+ this.objColl.pop();
23067
+ }
23043
23068
  if (this.textArea.style.display === 'block' || this.textArea.style.display === 'inline-block') {
23044
23069
  this.notify('shape', { prop: 'updateFontRatio', onPropertyChange: false,
23045
23070
  value: { obj: this.activeObj, isTextArea: true } });
@@ -23127,7 +23152,12 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
23127
23152
  */
23128
23153
  updateFontColor(value) {
23129
23154
  this.notify('selection', { prop: 'setInitialTextEdit', value: { bool: false } });
23155
+ let isObjPushed = false;
23156
+ const collLength = this.objColl.length;
23130
23157
  this.notify('shape', { prop: 'pushActItemIntoObj' });
23158
+ if (collLength !== this.objColl.length) {
23159
+ isObjPushed = true;
23160
+ }
23131
23161
  const prevCropObj = extend({}, this.cropObj, {}, true);
23132
23162
  const objt = { shapeSettingsObj: {} };
23133
23163
  this.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: objt } });
@@ -23142,7 +23172,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
23142
23172
  this.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false,
23143
23173
  value: { obj: selPointCollObj } });
23144
23174
  prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
23145
- this.objColl.pop();
23175
+ if (isObjPushed) {
23176
+ this.objColl.pop();
23177
+ }
23146
23178
  if (this.textArea.style.display === 'none') {
23147
23179
  this.activeObj.strokeSettings.strokeColor = value;
23148
23180
  this.notify('shape', { prop: 'setStrokeSettings', value: { strokeSettings: null,
@@ -23319,7 +23351,12 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
23319
23351
  const obj = { shapeSettingsObj: {} };
23320
23352
  this.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: obj } });
23321
23353
  const shapeSettings = obj['shapeSettingsObj'];
23354
+ let isObjPushed = false;
23355
+ const collLength = this.objColl.length;
23322
23356
  this.notify('shape', { prop: 'pushActItemIntoObj' });
23357
+ if (collLength !== this.objColl.length) {
23358
+ isObjPushed = true;
23359
+ }
23323
23360
  const prevCropObj = extend({}, this.cropObj, {}, true);
23324
23361
  const object = { currObj: {} };
23325
23362
  this.notify('filter', { prop: 'getCurrentObj', onPropertyChange: false, value: { object: object } });
@@ -23331,7 +23368,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
23331
23368
  this.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false,
23332
23369
  value: { obj: selPointCollObj } });
23333
23370
  prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
23334
- this.objColl.pop();
23371
+ if (isObjPushed) {
23372
+ this.objColl.pop();
23373
+ }
23335
23374
  this.activeObj.strokeSettings.strokeWidth = parseInt(id, 10);
23336
23375
  if (this.activeObj.shape === 'rectangle' || this.activeObj.shape === 'ellipse') {
23337
23376
  this.activeObj.strokeSettings.strokeWidth = parseInt(id, 10) - 1;
@@ -23373,7 +23412,12 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
23373
23412
  const shapeSettings = objt['shapeSettingsObj'];
23374
23413
  if (this.activeObj.shape && (this.activeObj.shape !== 'path' || (this.activeObj.shape === 'path' &&
23375
23414
  this.activeObj.pointColl.length > 0))) {
23415
+ let isObjPushed = false;
23416
+ const collLength = this.objColl.length;
23376
23417
  this.notify('shape', { prop: 'pushActItemIntoObj' });
23418
+ if (collLength !== this.objColl.length) {
23419
+ isObjPushed = true;
23420
+ }
23377
23421
  const prevCropObj = extend({}, this.cropObj, {}, true);
23378
23422
  const object = { currObj: {} };
23379
23423
  this.notify('filter', { prop: 'getCurrentObj', onPropertyChange: false, value: { object: object } });
@@ -23385,7 +23429,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
23385
23429
  this.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false,
23386
23430
  value: { obj: selPointCollObj } });
23387
23431
  prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
23388
- this.objColl.pop();
23432
+ if (isObjPushed) {
23433
+ this.objColl.pop();
23434
+ }
23389
23435
  this.activeObj.strokeSettings.strokeColor = value;
23390
23436
  this.notify('shape', { prop: 'setStrokeSettings', value: { strokeSettings: null, strokeColor: this.activeObj.strokeSettings.strokeColor, fillColor: null, strokeWidth: null } });
23391
23437
  if (!this.togglePen) {
@@ -23420,7 +23466,12 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
23420
23466
  const obj = { shapeSettingsObj: {} };
23421
23467
  this.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: obj } });
23422
23468
  const shapeSettings = obj['shapeSettingsObj'];
23469
+ let isObjPushed = false;
23470
+ const collLength = this.objColl.length;
23423
23471
  this.notify('shape', { prop: 'pushActItemIntoObj' });
23472
+ if (collLength !== this.objColl.length) {
23473
+ isObjPushed = true;
23474
+ }
23424
23475
  const prevCropObj = extend({}, this.cropObj, {}, true);
23425
23476
  const object = { currObj: {} };
23426
23477
  this.notify('filter', { prop: 'getCurrentObj', onPropertyChange: false, value: { object: object } });
@@ -23432,7 +23483,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
23432
23483
  this.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false,
23433
23484
  value: { obj: selPointCollObj } });
23434
23485
  prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
23435
- this.objColl.pop();
23486
+ if (isObjPushed) {
23487
+ this.objColl.pop();
23488
+ }
23436
23489
  this.activeObj.strokeSettings.fillColor = value;
23437
23490
  this.notify('shape', { prop: 'setStrokeSettings',
23438
23491
  value: { strokeSettings: null, strokeColor: null, fillColor: this.activeObj.strokeSettings.fillColor,
@@ -25998,7 +26051,7 @@ class ToolbarModule {
25998
26051
  }
25999
26052
  const fileObj = { fileName: '', fileType: '' };
26000
26053
  parent.notify('draw', { prop: 'getFileName', onPropertyChange: false, value: { obj: fileObj } });
26001
- this.fileType = fileObj['fileType'];
26054
+ this.fileType = fileObj['fileType'] ? fileObj['fileType'] : 'JPEG';
26002
26055
  parent.notify('export', { prop: 'exportToCanvas', value: { object: obj } });
26003
26056
  const tempCanvas = obj['canvas'];
26004
26057
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
@@ -26010,7 +26063,7 @@ class ToolbarModule {
26010
26063
  const ddbElem = document.getElementById(id + '_saveDropdownbtn');
26011
26064
  if (ddbElem) {
26012
26065
  const spanElem = document.createElement('span');
26013
- spanElem.innerHTML = fileObj['fileType'].toUpperCase();
26066
+ spanElem.innerHTML = this.fileType.toUpperCase();
26014
26067
  if (ddbElem) {
26015
26068
  ddbElem.appendChild(spanElem);
26016
26069
  }
@@ -27210,6 +27263,15 @@ class ToolbarModule {
27210
27263
  args.toolbarItems = ['fillColor', 'strokeColor', 'strokeWidth', 'z-order', 'duplicate', 'remove'];
27211
27264
  }
27212
27265
  this.initShapesToolbarItem(args.toolbarItems);
27266
+ if (parent.activeObj.shape === 'image') {
27267
+ const actObj = extend({}, parent.activeObj, {}, true);
27268
+ parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
27269
+ parent.notify('draw', { prop: 'render-image', value: { isMouseWheel: null, isPreventClearRect: null, isFrame: true } });
27270
+ parent.activeObj = actObj;
27271
+ parent.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate', obj: parent.activeObj,
27272
+ isCropRatio: null, points: null, isPreventDrag: true } });
27273
+ this.renderQAT(false);
27274
+ }
27213
27275
  break;
27214
27276
  case 'text':
27215
27277
  if (Browser.isDevice) {
@@ -27293,14 +27355,14 @@ class ToolbarModule {
27293
27355
  parent.notify('draw', { prop: 'render-image', value: { isMouseWheel: null, isPreventClearRect: null, isFrame: true } });
27294
27356
  break;
27295
27357
  }
27296
- this.currToolbar = type;
27297
27358
  this.refreshDropDownBtn(isCropping);
27298
- this.updateKBDNavigation(this.currToolbar);
27359
+ this.updateKBDNavigation(type);
27360
+ this.currToolbar = type;
27299
27361
  }
27300
27362
  updateKBDNavigation(type) {
27301
27363
  const parent = this.parent;
27302
27364
  const id = parent.element.id;
27303
- if (!parent.isKBDNavigation) {
27365
+ if (!parent.isKBDNavigation || this.currToolbar === type) {
27304
27366
  return;
27305
27367
  }
27306
27368
  if (this.isToolbar()) {
@@ -29779,8 +29841,10 @@ class ToolbarModule {
29779
29841
  }
29780
29842
  parent.notify('selection', { prop: 'setSliderActive', onPropertyChange: false, value: { bool: false } });
29781
29843
  if (type === 'transparency') {
29782
- parent.notify('undo-redo', { prop: 'updateUndoRedoStack', onPropertyChange: false });
29783
- parent.element.querySelector('#' + parent.element.id + '_transparency').click();
29844
+ setTimeout(() => {
29845
+ parent.notify('undo-redo', { prop: 'updateUndoRedoStack', onPropertyChange: false });
29846
+ parent.element.querySelector('#' + parent.element.id + '_transparency').click();
29847
+ }, 50);
29784
29848
  }
29785
29849
  }
29786
29850
  });