@syncfusion/ej2-image-editor 31.1.21 → 31.2.2

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.
@@ -14733,6 +14733,7 @@ var Shape = /** @__PURE__ @class */ (function () {
14733
14733
  this.keyHistory = ''; // text history
14734
14734
  this.preventFrameAnnotation = false;
14735
14735
  this.redactType = 'blur';
14736
+ this.isPublicUpdateShape = false;
14736
14737
  this.parent = parent;
14737
14738
  this.addEventListener();
14738
14739
  }
@@ -15006,6 +15007,9 @@ var Shape = /** @__PURE__ @class */ (function () {
15006
15007
  case 'setRedactType':
15007
15008
  this.redactType = args.value['redactType'];
15008
15009
  break;
15010
+ case 'setPublicUpdateShape':
15011
+ this.isPublicUpdateShape = args.value['isPublicUpdateShape'];
15012
+ break;
15009
15013
  }
15010
15014
  };
15011
15015
  Shape.prototype.getModuleName = function () {
@@ -15032,7 +15036,7 @@ var Shape = /** @__PURE__ @class */ (function () {
15032
15036
  this.textSettings =
15033
15037
  { text: 'Enter Text', fontFamily: this.parent.fontFamily.default, fontSize: null, fontRatio: null, bold: false, italic: false, underline: false, strikethrough: false };
15034
15038
  this.strokeSettings = { strokeColor: '#fff', fillColor: '', strokeWidth: null, radius: null, outlineColor: '', outlineWidth: null };
15035
- this.preventFrameAnnotation = false;
15039
+ this.preventFrameAnnotation = this.isPublicUpdateShape = false;
15036
15040
  };
15037
15041
  Shape.prototype.drawEllipse = function (x, y, radiusX, radiusY, strokeWidth, strokeColor, fillColor, degree, isSelected) {
15038
15042
  this.initializeShape('ellipse');
@@ -15744,7 +15748,7 @@ var Shape = /** @__PURE__ @class */ (function () {
15744
15748
  }
15745
15749
  parent.notify('selection', { prop: 'setTextSelection', onPropertyChange: false,
15746
15750
  value: { width: width, height: height } });
15747
- if (parent.activeObj.rotatedAngle !== 0) {
15751
+ if (parent.activeObj.rotatedAngle !== 0 && !this.isPublicUpdateShape) {
15748
15752
  var width_1 = parent.activeObj.activePoint.width - tempActiveObj.activePoint.width;
15749
15753
  var height_1 = parent.activeObj.activePoint.height - tempActiveObj.activePoint.height;
15750
15754
  var value = '';
@@ -15763,6 +15767,20 @@ var Shape = /** @__PURE__ @class */ (function () {
15763
15767
  parent.notify('shape', { prop: 'updateFontSize', onPropertyChange: false,
15764
15768
  value: { obj: parent.activeObj } });
15765
15769
  }
15770
+ else if (this.isPublicUpdateShape) {
15771
+ var width_2 = parent.activeObj.activePoint.width - tempActiveObj.activePoint.width;
15772
+ var height_2 = parent.activeObj.activePoint.height - tempActiveObj.activePoint.height;
15773
+ var value = '';
15774
+ if (parent.transform.degree === 0 || parent.transform.degree === 180) {
15775
+ value = 'width';
15776
+ }
15777
+ else if (parent.transform.degree === 90 || parent.transform.degree === 270) {
15778
+ value = 'height';
15779
+ }
15780
+ parent.activeObj.activePoint = extend({}, tempActiveObj.activePoint, {}, true);
15781
+ parent.notify('selection', { prop: 'adjustRotationPoints', onPropertyChange: false, value: { rectangle: parent.activeObj.activePoint,
15782
+ x: width_2, y: height_2, angle: parent.activeObj.rotatedAngle, type: 'text', elem: value } });
15783
+ }
15766
15784
  parent.notify('draw', { prop: 'updateActiveObject', onPropertyChange: false, value: { actPoint: parent.activeObj.activePoint, obj: parent.activeObj,
15767
15785
  isMouseMove: null, x: null, y: null } });
15768
15786
  this.updImgRatioForActObj();
@@ -24237,6 +24255,9 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
24237
24255
  *
24238
24256
  */
24239
24257
  ImageEditor.prototype.updateShape = function (setting, isSelected) {
24258
+ if (setting.type.toLowerCase() === 'text') {
24259
+ this.notify('shape', { prop: 'setPublicUpdateShape', onPropertyChange: false, value: { isPublicUpdateShape: true } });
24260
+ }
24240
24261
  var obj = { isSelected: false };
24241
24262
  var isTextArea = false;
24242
24263
  var freehandObj = { bool: false };
@@ -24308,6 +24329,9 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
24308
24329
  }
24309
24330
  }
24310
24331
  }
24332
+ if (setting.type.toLowerCase() === 'text') {
24333
+ this.notify('shape', { prop: 'setPublicUpdateShape', onPropertyChange: false, value: { isPublicUpdateShape: false } });
24334
+ }
24311
24335
  return obj['isSelected'];
24312
24336
  };
24313
24337
  /**
@@ -24521,7 +24545,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
24521
24545
  * @returns {void}.
24522
24546
  */
24523
24547
  ImageEditor.prototype.undo = function () {
24524
- this.manageActiveAction();
24548
+ this.handlePenActiveState();
24525
24549
  this.notify('undo-redo', { prop: 'undo', onPropertyChange: false });
24526
24550
  this.notify('draw', { prop: 'redrawDownScale' });
24527
24551
  };
@@ -24533,7 +24557,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
24533
24557
  * @returns {void}.
24534
24558
  */
24535
24559
  ImageEditor.prototype.redo = function () {
24536
- this.manageActiveAction();
24560
+ this.handlePenActiveState();
24537
24561
  this.notify('undo-redo', { prop: 'redo', onPropertyChange: false });
24538
24562
  this.notify('draw', { prop: 'redrawDownScale' });
24539
24563
  };
@@ -27301,6 +27325,13 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
27301
27325
  }
27302
27326
  return isRedact;
27303
27327
  };
27328
+ ImageEditor.prototype.handlePenActiveState = function () {
27329
+ var freehandDrawObj = { freehandDrawSelectedId: null };
27330
+ this.notify('freehand-draw', { prop: 'getFreehandDrawSelectedId', onPropertyChange: false, value: { obj: freehandDrawObj } });
27331
+ if (isNullOrUndefined(freehandDrawObj['freehandDrawSelectedId'])) {
27332
+ this.manageActiveAction();
27333
+ }
27334
+ };
27304
27335
  var ImageEditor_1;
27305
27336
  __decorate([
27306
27337
  Property('')