@syncfusion/ej2-image-editor 25.1.35 → 25.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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 25.1.35
3
+ * version : 25.1.38
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.39",
3
+ "_id": "@syncfusion/ej2-image-editor@25.1.37",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-Bdm3mWoAozafsWzcwq/tVWXF5iazfTB4cNKx2CpLf8lgCwTIBF99Dhb44pQWnbmLi3n3iJQh1XO2cr19ZeAjEA==",
5
+ "_integrity": "sha512-k5viiMPSSZkFq+Ur5QJcKly3iE73p7Jew5PXHnHJR3B0lB6GBEev/A7TNwPF8+65AKjpK4NiMrdhliQptSyctg==",
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.syncfusioninternal.com/repository/ej2-release/@syncfusion/ej2-image-editor/-/ej2-image-editor-23.1.39.tgz",
27
- "_shasum": "5bb6d65f3282fb4af0523a82d81f9c0d54121e8f",
26
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-25.1.37.tgz",
27
+ "_shasum": "25d63005eaf646b526c90f9b4edfb8213a0fe7eb",
28
28
  "_spec": "@syncfusion/ej2-image-editor@*",
29
29
  "_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
30
30
  "author": {
@@ -34,10 +34,10 @@
34
34
  "dependencies": {
35
35
  "@syncfusion/ej2-base": "~25.1.35",
36
36
  "@syncfusion/ej2-buttons": "~25.1.35",
37
- "@syncfusion/ej2-inputs": "~25.1.35",
38
- "@syncfusion/ej2-navigations": "~25.1.35",
39
- "@syncfusion/ej2-popups": "~25.1.35",
40
- "@syncfusion/ej2-splitbuttons": "~25.1.35"
37
+ "@syncfusion/ej2-inputs": "~25.1.38",
38
+ "@syncfusion/ej2-navigations": "~25.1.38",
39
+ "@syncfusion/ej2-popups": "~25.1.38",
40
+ "@syncfusion/ej2-splitbuttons": "~25.1.38"
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": "25.1.35",
70
+ "version": "25.1.38",
71
71
  "sideEffects": false,
72
72
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
73
73
  }
@@ -179,6 +179,9 @@ var FreehandDrawing = /** @class */ (function () {
179
179
  case 'reset':
180
180
  this.reset();
181
181
  break;
182
+ case 'triggerShapeChanging':
183
+ this.triggerShapeChanging(args.value['shapeChangingArgs']);
184
+ break;
182
185
  }
183
186
  };
184
187
  FreehandDrawing.prototype.updateFhdPvtVar = function () {
@@ -711,6 +711,8 @@ var Shape = /** @class */ (function () {
711
711
  endX: parent.activeObj.activePoint.startX + parent.activeObj.activePoint.width,
712
712
  endY: parent.activeObj.activePoint.startY + parent.activeObj.activePoint.height,
713
713
  width: selectionSettings.width, height: selectionSettings.height };
714
+ parent.activeObj.activePoint.endX = parent.activeObj.activePoint.startX + parent.activeObj.activePoint.width;
715
+ parent.activeObj.activePoint.endY = parent.activeObj.activePoint.startY + parent.activeObj.activePoint.height;
714
716
  };
715
717
  Shape.prototype.updateShapeChangeEventArgs = function (shapeSettings) {
716
718
  var parent = this.parent;
@@ -769,6 +771,7 @@ var Shape = /** @class */ (function () {
769
771
  if (shapeSettings.degree) {
770
772
  parent.activeObj.rotatedAngle = shapeSettings.degree * (Math.PI / 180);
771
773
  }
774
+ this.updateFontRatio(parent.activeObj);
772
775
  break;
773
776
  case 'rectangle':
774
777
  case 'image':
@@ -78,7 +78,7 @@ var Transform = /** @class */ (function () {
78
78
  this.resetZoom();
79
79
  break;
80
80
  case 'pan':
81
- this.pan(args.value['value']);
81
+ this.pan(args.value['value'], args.value['x'], args.value['y']);
82
82
  break;
83
83
  case 'zoom':
84
84
  this.zoom(args.value['zoomFactor'], args.value['zoomPoint']);
@@ -1091,12 +1091,12 @@ var Transform = /** @class */ (function () {
1091
1091
  parent.notify('selection', { prop: 'getPanDown', onPropertyChange: false, value: { obj: obj } });
1092
1092
  var panEventArgs = { startPoint: obj['panDown'], endPoint: this.panMove, cancel: false };
1093
1093
  parent.trigger('panning', panEventArgs);
1094
- this.panEvent(panEventArgs, xDiff, yDiff);
1095
- };
1096
- Transform.prototype.panEvent = function (panEventArgs, xDiff, yDiff) {
1097
1094
  if (panEventArgs.cancel) {
1098
1095
  return;
1099
1096
  }
1097
+ this.panEvent(xDiff, yDiff);
1098
+ };
1099
+ Transform.prototype.panEvent = function (xDiff, yDiff, isPanMethod) {
1100
1100
  var parent = this.parent;
1101
1101
  var isObjCreated = false;
1102
1102
  if (parent.activeObj.shape && parent.activeObj.shape === 'shape') {
@@ -1134,8 +1134,13 @@ var Transform = /** @class */ (function () {
1134
1134
  }
1135
1135
  if (parent.transform.degree === 0) {
1136
1136
  var point = void 0;
1137
- if (isNullOrUndefined(xDiff) && isNullOrUndefined(yDiff)) {
1138
- point = this.updatePanPoints();
1137
+ if ((isNullOrUndefined(xDiff) && isNullOrUndefined(yDiff)) || isPanMethod) {
1138
+ if (isPanMethod) {
1139
+ point = this.updatePanPoints(xDiff, yDiff);
1140
+ }
1141
+ else {
1142
+ point = this.updatePanPoints();
1143
+ }
1139
1144
  }
1140
1145
  else {
1141
1146
  point = { x: xDiff, y: yDiff };
@@ -1156,8 +1161,13 @@ var Transform = /** @class */ (function () {
1156
1161
  else {
1157
1162
  var tempFlipState = parent.transform.currFlipState;
1158
1163
  parent.isCropTab = true;
1159
- if (isNullOrUndefined(xDiff) && isNullOrUndefined(yDiff)) {
1160
- parent.panPoint.currentPannedPoint = this.updatePanPoints();
1164
+ if ((isNullOrUndefined(xDiff) && isNullOrUndefined(yDiff)) || isPanMethod) {
1165
+ if (isPanMethod) {
1166
+ parent.panPoint.currentPannedPoint = this.updatePanPoints(xDiff, yDiff);
1167
+ }
1168
+ else {
1169
+ parent.panPoint.currentPannedPoint = this.updatePanPoints();
1170
+ }
1161
1171
  }
1162
1172
  else {
1163
1173
  parent.panPoint.currentPannedPoint = { x: xDiff, y: yDiff };
@@ -1444,7 +1454,7 @@ var Transform = /** @class */ (function () {
1444
1454
  parent.notify('draw', { prop: 'updateActiveObject', onPropertyChange: false, value: { actPoint: actPoint,
1445
1455
  obj: parent.activeObj, isMouseMove: null, x: null, y: null } });
1446
1456
  };
1447
- Transform.prototype.pan = function (value) {
1457
+ Transform.prototype.pan = function (value, x, y) {
1448
1458
  var parent = this.parent;
1449
1459
  if (!parent.disabled && parent.isImageLoaded) {
1450
1460
  if (value) {
@@ -1454,6 +1464,15 @@ var Transform = /** @class */ (function () {
1454
1464
  parent.notify('selection', { prop: 'setDragCanvas', value: { bool: true } });
1455
1465
  parent.lowerCanvas.style.cursor = parent.upperCanvas.style.cursor = parent.cursor = 'grab';
1456
1466
  parent.notify('selection', { prop: 'setPanDown', onPropertyChange: false, value: { panDown: null } });
1467
+ if (x || y) {
1468
+ x = x ? x : 0;
1469
+ y = y ? y : 0;
1470
+ if (isNullOrUndefined(this.tempPanMove)) {
1471
+ this.tempPanMove = { x: this.panMove.x, y: this.panMove.y };
1472
+ }
1473
+ this.panEvent(x, y, true);
1474
+ this.tempPanMove = null;
1475
+ }
1457
1476
  }
1458
1477
  else {
1459
1478
  parent.togglePan = parent.currObjType.isCustomCrop = false;
@@ -1586,8 +1605,9 @@ var Transform = /** @class */ (function () {
1586
1605
  toolbarHeight = obj['toolbarHeight'];
1587
1606
  }
1588
1607
  }
1589
- if (Browser.isDevice && straightenObj['bool']) {
1590
- cxtTbarHeight = parent.element.querySelector('#' + parent.element.id + '_contextualToolbarArea').clientHeight;
1608
+ var ctxTbarArea = parent.element.querySelector('#' + parent.element.id + '_contextualToolbarArea');
1609
+ if (Browser.isDevice && straightenObj['bool'] && ctxTbarArea) {
1610
+ cxtTbarHeight = ctxTbarArea.clientHeight;
1591
1611
  }
1592
1612
  parent.notify('toolbar', { prop: 'setToolbarHeight', value: { height: toolbarHeight } });
1593
1613
  if (Browser.isDevice) {
@@ -1767,6 +1787,9 @@ var Transform = /** @class */ (function () {
1767
1787
  var cxtTbar = parent.element.querySelector('#' + parent.element.id + '_contextualToolbarArea');
1768
1788
  canvasMaxHeight -= cxtTbar ? cxtTbar.clientHeight : 0;
1769
1789
  }
1790
+ if (!isImgShape && parent.element.clientHeight === 0) {
1791
+ canvasMaxHeight = 0;
1792
+ }
1770
1793
  if (isNullOrUndefined(isImgShape)) {
1771
1794
  if (canvasMaxWidth > 30) {
1772
1795
  canvasMaxWidth -= 30;
@@ -1803,7 +1826,7 @@ var Transform = /** @class */ (function () {
1803
1826
  }
1804
1827
  return { width: cssMaxWidth, height: cssMaxHeight };
1805
1828
  };
1806
- Transform.prototype.updatePanPoints = function () {
1829
+ Transform.prototype.updatePanPoints = function (x, y) {
1807
1830
  var parent = this.parent;
1808
1831
  var tempActObj = extend({}, parent.activeObj, {}, true);
1809
1832
  var tempDestLeft = parent.img.destLeft;
@@ -1813,6 +1836,10 @@ var Transform = /** @class */ (function () {
1813
1836
  }
1814
1837
  var xDiff = this.panMove.x - this.tempPanMove.x;
1815
1838
  var yDiff = this.panMove.y - this.tempPanMove.y;
1839
+ if (x || y) {
1840
+ xDiff = x;
1841
+ yDiff = y;
1842
+ }
1816
1843
  parent.img.destLeft += xDiff;
1817
1844
  parent.img.destTop += yDiff;
1818
1845
  this.limitPan();
@@ -38,7 +38,6 @@ export declare class UndoRedo {
38
38
  private updateTextBox;
39
39
  private undoDefault;
40
40
  private endUndoRedo;
41
- private getImageAction;
42
41
  private updateUrc;
43
42
  private updateUrObj;
44
43
  private updateUndoRedo;
@@ -753,32 +753,6 @@ var UndoRedo = /** @class */ (function () {
753
753
  parent.notify('filter', { prop: 'setAdjustmentValue', onPropertyChange: false, value: { adjustmentValue: this.lowerContext.filter } });
754
754
  parent.currObjType.isCustomCrop = false;
755
755
  };
756
- UndoRedo.prototype.getImageAction = function (operation) {
757
- if (['brightness', 'contrast', 'saturation', 'opacity', 'blur', 'hue'].indexOf(operation) !== -1) {
758
- return 'FinetuneApplied';
759
- }
760
- else if (['chrome', 'cold', 'warm', 'grayscale', 'blackandwhite', 'sepia', 'invert'].indexOf(operation) !== -1) {
761
- return 'FilterApplied';
762
- }
763
- else if (operation === 'frame') {
764
- return 'FrameApplied';
765
- }
766
- else if (operation === 'resize') {
767
- return 'ImageResized';
768
- }
769
- else if (['deleteFreehandDrawing', 'deleteObj'].indexOf(operation) !== -1) {
770
- return 'ShapeDeleted';
771
- }
772
- else if (operation === 'crop') {
773
- return 'Cropped';
774
- }
775
- else if (['shapeInsert', 'freehanddraw', 'freehand-draw'].indexOf(operation) !== -1) {
776
- return 'ShapeInserted';
777
- }
778
- else {
779
- return 'ShapeCustomized';
780
- }
781
- };
782
756
  UndoRedo.prototype.updateUrc = function (operation, previousObj, previousObjColl, previousPointColl, previousSelPointColl, previousCropObj, previousText, currentText, previousFilter, isCircleCrop) {
783
757
  var parent = this.parent;
784
758
  if (parent.isResize || this.isPreventing) {
@@ -282,14 +282,19 @@ export interface ImageEditorModel extends ComponentModel{
282
282
  * If the property is defined as empty collection, the toolbar will not be rendered.
283
283
  * The preconfigured toolbar commands are
284
284
  * - Crop: helps to crop an image as ellipse, square, various ratio aspects, custom selection with resize, drag and drop.
285
+ * - Straightening: helps to rotate an image by a specified angle.
285
286
  * - Annotate: help to insert a shape on image that supports rectangle, ellipse, line, arrow, path, text, image and freehand drawing with resize, drag and drop, and customize its appearance.
286
287
  * - Transform: helps to rotate and flip an image.
287
288
  * - Finetunes: helps to perform adjustments on an image.
288
289
  * - Filters: helps to perform predefined color filters.
290
+ * - Frame: helps to add decorative borders or frames around images.
291
+ * - Resize: helps to modify the dimensions of an image.
289
292
  * - ZoomIn: performs zoom-in an image.
290
293
  * - ZoomOut: performs zoom-out an image.
291
294
  * - Save: save the modified image.
292
295
  * - Open: open an image to perform editing.
296
+ * - Undo: helps to revert the last action.
297
+ * - Redo: helps to redo the last action.
293
298
  * - Reset: reset the modification and restore the original image.
294
299
  *
295
300
  * {% codeBlock src='image-editor/toolbar/index.md' %}{% endcodeBlock %}
@@ -428,14 +428,19 @@ export declare class ImageEditor extends Component<HTMLDivElement> implements IN
428
428
  * If the property is defined as empty collection, the toolbar will not be rendered.
429
429
  * The preconfigured toolbar commands are
430
430
  * - Crop: helps to crop an image as ellipse, square, various ratio aspects, custom selection with resize, drag and drop.
431
+ * - Straightening: helps to rotate an image by a specified angle.
431
432
  * - Annotate: help to insert a shape on image that supports rectangle, ellipse, line, arrow, path, text, image and freehand drawing with resize, drag and drop, and customize its appearance.
432
433
  * - Transform: helps to rotate and flip an image.
433
434
  * - Finetunes: helps to perform adjustments on an image.
434
435
  * - Filters: helps to perform predefined color filters.
436
+ * - Frame: helps to add decorative borders or frames around images.
437
+ * - Resize: helps to modify the dimensions of an image.
435
438
  * - ZoomIn: performs zoom-in an image.
436
439
  * - ZoomOut: performs zoom-out an image.
437
440
  * - Save: save the modified image.
438
441
  * - Open: open an image to perform editing.
442
+ * - Undo: helps to revert the last action.
443
+ * - Redo: helps to redo the last action.
439
444
  * - Reset: reset the modification and restore the original image.
440
445
  *
441
446
  * {% codeBlock src='image-editor/toolbar/index.md' %}{% endcodeBlock %}
@@ -1007,13 +1012,15 @@ export declare class ImageEditor extends Component<HTMLDivElement> implements IN
1007
1012
  * Enable or disable a panning on the Image Editor.
1008
1013
  *
1009
1014
  * @param {boolean} value - Specifies a value whether enable or disable panning.
1015
+ * @param {number} x - Optional, Specifies a value to pan the image horizontally.
1016
+ * @param {number} y - Optional, Specifies a value to pan the image vertically.
1010
1017
  *
1011
1018
  * @remarks
1012
1019
  * This option will take into effect once the image's visibility is hidden when zooming an image or selection has been performed.
1013
1020
  *
1014
1021
  * @returns {void}.
1015
1022
  */
1016
- pan(value: boolean): void;
1023
+ pan(value: boolean, x?: number, y?: number): void;
1017
1024
  /**
1018
1025
  * Zoom in or out on a point in the image editor.
1019
1026
  *
@@ -539,7 +539,7 @@ var ImageEditor = /** @class */ (function (_super) {
539
539
  ImageEditor.prototype.createDropUploader = function () {
540
540
  var _this = this;
541
541
  var uploadObj = new Uploader({
542
- dropArea: document.getElementsByClassName('e-canvas-wrapper')[0],
542
+ dropArea: this.element.getElementsByClassName('e-canvas-wrapper')[0],
543
543
  allowedExtensions: '.jpg, .jpeg, .png,.svg',
544
544
  multiple: false,
545
545
  selected: function (args) {
@@ -825,7 +825,8 @@ var ImageEditor = /** @class */ (function (_super) {
825
825
  ImageEditor.prototype.notifyResetForAllModules = function () {
826
826
  var modules = this.requiredModules();
827
827
  for (var i = 0; i < modules.length; i++) {
828
- this.notify(modules[i].member, { prop: 'reset', onPropertyChange: false });
828
+ var module = modules[i].member;
829
+ this.notify(module === 'toolbar-module' ? 'toolbar' : module, { prop: 'reset', onPropertyChange: false });
829
830
  }
830
831
  };
831
832
  ImageEditor.prototype.allowShape = function (x, y) {
@@ -1129,14 +1130,16 @@ var ImageEditor = /** @class */ (function (_super) {
1129
1130
  * Enable or disable a panning on the Image Editor.
1130
1131
  *
1131
1132
  * @param {boolean} value - Specifies a value whether enable or disable panning.
1133
+ * @param {number} x - Optional, Specifies a value to pan the image horizontally.
1134
+ * @param {number} y - Optional, Specifies a value to pan the image vertically.
1132
1135
  *
1133
1136
  * @remarks
1134
1137
  * This option will take into effect once the image's visibility is hidden when zooming an image or selection has been performed.
1135
1138
  *
1136
1139
  * @returns {void}.
1137
1140
  */
1138
- ImageEditor.prototype.pan = function (value) {
1139
- this.notify('transform', { prop: 'pan', onPropertyChange: false, value: { value: value } });
1141
+ ImageEditor.prototype.pan = function (value, x, y) {
1142
+ this.notify('transform', { prop: 'pan', onPropertyChange: false, value: { value: value, x: x, y: y } });
1140
1143
  };
1141
1144
  /**
1142
1145
  * Zoom in or out on a point in the image editor.
@@ -1644,8 +1647,19 @@ var ImageEditor = /** @class */ (function (_super) {
1644
1647
  this.notify('shape', { prop: 'selectShape', onPropertyChange: false, value: { id: setting.id, obj: obj } });
1645
1648
  this.notify('selection', { prop: 'getFreehandDrawEditing', onPropertyChange: false, value: { obj: freehandObj } });
1646
1649
  if (obj['isSelected']) {
1650
+ var tempFontSize = this.activeObj.textSettings.fontSize;
1647
1651
  this.notify('shape', { prop: 'updateShapeChangeEventArgs', onPropertyChange: false,
1648
1652
  value: { shapeSettings: setting } });
1653
+ if (this.activeObj.shape === 'text' && tempFontSize) {
1654
+ var diff = this.activeObj.textSettings.fontSize - tempFontSize;
1655
+ if (diff !== 0) {
1656
+ this.activeObj.activePoint.height += diff;
1657
+ this.activeObj.activePoint.startY -= (diff / 2);
1658
+ this.activeObj.activePoint.endY += (diff / 2);
1659
+ this.notify('draw', { prop: 'updateActiveObject', onPropertyChange: false, value: { actPoint: this.activeObj.activePoint, obj: this.activeObj,
1660
+ isMouseMove: null, x: null, y: null } });
1661
+ }
1662
+ }
1649
1663
  var activeObj = extend({}, this.activeObj, {}, true);
1650
1664
  this.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
1651
1665
  this.notify('draw', { prop: 'render-image', value: { isMouseWheel: null, isPreventClearRect: null, isFrame: null } });
@@ -56,6 +56,7 @@ export declare class ToolbarModule {
56
56
  private enableDisableTbrBtn;
57
57
  private createLeftToolbarControls;
58
58
  private fileSelect;
59
+ private triggerTbarClickEvent;
59
60
  private renderAnnotationBtn;
60
61
  private renderStraightenSlider;
61
62
  private renderCropBtn;