@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.
@@ -7036,6 +7036,9 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
7036
7036
  case 'reset':
7037
7037
  this.reset();
7038
7038
  break;
7039
+ case 'triggerShapeChanging':
7040
+ this.triggerShapeChanging(args.value['shapeChangingArgs']);
7041
+ break;
7039
7042
  }
7040
7043
  };
7041
7044
  FreehandDrawing.prototype.updateFhdPvtVar = function () {
@@ -13567,6 +13570,8 @@ var Shape = /** @__PURE__ @class */ (function () {
13567
13570
  endX: parent.activeObj.activePoint.startX + parent.activeObj.activePoint.width,
13568
13571
  endY: parent.activeObj.activePoint.startY + parent.activeObj.activePoint.height,
13569
13572
  width: selectionSettings.width, height: selectionSettings.height };
13573
+ parent.activeObj.activePoint.endX = parent.activeObj.activePoint.startX + parent.activeObj.activePoint.width;
13574
+ parent.activeObj.activePoint.endY = parent.activeObj.activePoint.startY + parent.activeObj.activePoint.height;
13570
13575
  };
13571
13576
  Shape.prototype.updateShapeChangeEventArgs = function (shapeSettings) {
13572
13577
  var parent = this.parent;
@@ -13625,6 +13630,7 @@ var Shape = /** @__PURE__ @class */ (function () {
13625
13630
  if (shapeSettings.degree) {
13626
13631
  parent.activeObj.rotatedAngle = shapeSettings.degree * (Math.PI / 180);
13627
13632
  }
13633
+ this.updateFontRatio(parent.activeObj);
13628
13634
  break;
13629
13635
  case 'rectangle':
13630
13636
  case 'image':
@@ -16273,7 +16279,7 @@ var Transform = /** @__PURE__ @class */ (function () {
16273
16279
  this.resetZoom();
16274
16280
  break;
16275
16281
  case 'pan':
16276
- this.pan(args.value['value']);
16282
+ this.pan(args.value['value'], args.value['x'], args.value['y']);
16277
16283
  break;
16278
16284
  case 'zoom':
16279
16285
  this.zoom(args.value['zoomFactor'], args.value['zoomPoint']);
@@ -17286,12 +17292,12 @@ var Transform = /** @__PURE__ @class */ (function () {
17286
17292
  parent.notify('selection', { prop: 'getPanDown', onPropertyChange: false, value: { obj: obj } });
17287
17293
  var panEventArgs = { startPoint: obj['panDown'], endPoint: this.panMove, cancel: false };
17288
17294
  parent.trigger('panning', panEventArgs);
17289
- this.panEvent(panEventArgs, xDiff, yDiff);
17290
- };
17291
- Transform.prototype.panEvent = function (panEventArgs, xDiff, yDiff) {
17292
17295
  if (panEventArgs.cancel) {
17293
17296
  return;
17294
17297
  }
17298
+ this.panEvent(xDiff, yDiff);
17299
+ };
17300
+ Transform.prototype.panEvent = function (xDiff, yDiff, isPanMethod) {
17295
17301
  var parent = this.parent;
17296
17302
  var isObjCreated = false;
17297
17303
  if (parent.activeObj.shape && parent.activeObj.shape === 'shape') {
@@ -17329,8 +17335,13 @@ var Transform = /** @__PURE__ @class */ (function () {
17329
17335
  }
17330
17336
  if (parent.transform.degree === 0) {
17331
17337
  var point = void 0;
17332
- if (isNullOrUndefined(xDiff) && isNullOrUndefined(yDiff)) {
17333
- point = this.updatePanPoints();
17338
+ if ((isNullOrUndefined(xDiff) && isNullOrUndefined(yDiff)) || isPanMethod) {
17339
+ if (isPanMethod) {
17340
+ point = this.updatePanPoints(xDiff, yDiff);
17341
+ }
17342
+ else {
17343
+ point = this.updatePanPoints();
17344
+ }
17334
17345
  }
17335
17346
  else {
17336
17347
  point = { x: xDiff, y: yDiff };
@@ -17351,8 +17362,13 @@ var Transform = /** @__PURE__ @class */ (function () {
17351
17362
  else {
17352
17363
  var tempFlipState = parent.transform.currFlipState;
17353
17364
  parent.isCropTab = true;
17354
- if (isNullOrUndefined(xDiff) && isNullOrUndefined(yDiff)) {
17355
- parent.panPoint.currentPannedPoint = this.updatePanPoints();
17365
+ if ((isNullOrUndefined(xDiff) && isNullOrUndefined(yDiff)) || isPanMethod) {
17366
+ if (isPanMethod) {
17367
+ parent.panPoint.currentPannedPoint = this.updatePanPoints(xDiff, yDiff);
17368
+ }
17369
+ else {
17370
+ parent.panPoint.currentPannedPoint = this.updatePanPoints();
17371
+ }
17356
17372
  }
17357
17373
  else {
17358
17374
  parent.panPoint.currentPannedPoint = { x: xDiff, y: yDiff };
@@ -17639,7 +17655,7 @@ var Transform = /** @__PURE__ @class */ (function () {
17639
17655
  parent.notify('draw', { prop: 'updateActiveObject', onPropertyChange: false, value: { actPoint: actPoint,
17640
17656
  obj: parent.activeObj, isMouseMove: null, x: null, y: null } });
17641
17657
  };
17642
- Transform.prototype.pan = function (value) {
17658
+ Transform.prototype.pan = function (value, x, y) {
17643
17659
  var parent = this.parent;
17644
17660
  if (!parent.disabled && parent.isImageLoaded) {
17645
17661
  if (value) {
@@ -17649,6 +17665,15 @@ var Transform = /** @__PURE__ @class */ (function () {
17649
17665
  parent.notify('selection', { prop: 'setDragCanvas', value: { bool: true } });
17650
17666
  parent.lowerCanvas.style.cursor = parent.upperCanvas.style.cursor = parent.cursor = 'grab';
17651
17667
  parent.notify('selection', { prop: 'setPanDown', onPropertyChange: false, value: { panDown: null } });
17668
+ if (x || y) {
17669
+ x = x ? x : 0;
17670
+ y = y ? y : 0;
17671
+ if (isNullOrUndefined(this.tempPanMove)) {
17672
+ this.tempPanMove = { x: this.panMove.x, y: this.panMove.y };
17673
+ }
17674
+ this.panEvent(x, y, true);
17675
+ this.tempPanMove = null;
17676
+ }
17652
17677
  }
17653
17678
  else {
17654
17679
  parent.togglePan = parent.currObjType.isCustomCrop = false;
@@ -17781,8 +17806,9 @@ var Transform = /** @__PURE__ @class */ (function () {
17781
17806
  toolbarHeight = obj['toolbarHeight'];
17782
17807
  }
17783
17808
  }
17784
- if (Browser.isDevice && straightenObj['bool']) {
17785
- cxtTbarHeight = parent.element.querySelector('#' + parent.element.id + '_contextualToolbarArea').clientHeight;
17809
+ var ctxTbarArea = parent.element.querySelector('#' + parent.element.id + '_contextualToolbarArea');
17810
+ if (Browser.isDevice && straightenObj['bool'] && ctxTbarArea) {
17811
+ cxtTbarHeight = ctxTbarArea.clientHeight;
17786
17812
  }
17787
17813
  parent.notify('toolbar', { prop: 'setToolbarHeight', value: { height: toolbarHeight } });
17788
17814
  if (Browser.isDevice) {
@@ -17962,6 +17988,9 @@ var Transform = /** @__PURE__ @class */ (function () {
17962
17988
  var cxtTbar = parent.element.querySelector('#' + parent.element.id + '_contextualToolbarArea');
17963
17989
  canvasMaxHeight -= cxtTbar ? cxtTbar.clientHeight : 0;
17964
17990
  }
17991
+ if (!isImgShape && parent.element.clientHeight === 0) {
17992
+ canvasMaxHeight = 0;
17993
+ }
17965
17994
  if (isNullOrUndefined(isImgShape)) {
17966
17995
  if (canvasMaxWidth > 30) {
17967
17996
  canvasMaxWidth -= 30;
@@ -17998,7 +18027,7 @@ var Transform = /** @__PURE__ @class */ (function () {
17998
18027
  }
17999
18028
  return { width: cssMaxWidth, height: cssMaxHeight };
18000
18029
  };
18001
- Transform.prototype.updatePanPoints = function () {
18030
+ Transform.prototype.updatePanPoints = function (x, y) {
18002
18031
  var parent = this.parent;
18003
18032
  var tempActObj = extend({}, parent.activeObj, {}, true);
18004
18033
  var tempDestLeft = parent.img.destLeft;
@@ -18008,6 +18037,10 @@ var Transform = /** @__PURE__ @class */ (function () {
18008
18037
  }
18009
18038
  var xDiff = this.panMove.x - this.tempPanMove.x;
18010
18039
  var yDiff = this.panMove.y - this.tempPanMove.y;
18040
+ if (x || y) {
18041
+ xDiff = x;
18042
+ yDiff = y;
18043
+ }
18011
18044
  parent.img.destLeft += xDiff;
18012
18045
  parent.img.destTop += yDiff;
18013
18046
  this.limitPan();
@@ -19162,32 +19195,6 @@ var UndoRedo = /** @__PURE__ @class */ (function () {
19162
19195
  parent.notify('filter', { prop: 'setAdjustmentValue', onPropertyChange: false, value: { adjustmentValue: this.lowerContext.filter } });
19163
19196
  parent.currObjType.isCustomCrop = false;
19164
19197
  };
19165
- UndoRedo.prototype.getImageAction = function (operation) {
19166
- if (['brightness', 'contrast', 'saturation', 'opacity', 'blur', 'hue'].indexOf(operation) !== -1) {
19167
- return 'FinetuneApplied';
19168
- }
19169
- else if (['chrome', 'cold', 'warm', 'grayscale', 'blackandwhite', 'sepia', 'invert'].indexOf(operation) !== -1) {
19170
- return 'FilterApplied';
19171
- }
19172
- else if (operation === 'frame') {
19173
- return 'FrameApplied';
19174
- }
19175
- else if (operation === 'resize') {
19176
- return 'ImageResized';
19177
- }
19178
- else if (['deleteFreehandDrawing', 'deleteObj'].indexOf(operation) !== -1) {
19179
- return 'ShapeDeleted';
19180
- }
19181
- else if (operation === 'crop') {
19182
- return 'Cropped';
19183
- }
19184
- else if (['shapeInsert', 'freehanddraw', 'freehand-draw'].indexOf(operation) !== -1) {
19185
- return 'ShapeInserted';
19186
- }
19187
- else {
19188
- return 'ShapeCustomized';
19189
- }
19190
- };
19191
19198
  UndoRedo.prototype.updateUrc = function (operation, previousObj, previousObjColl, previousPointColl, previousSelPointColl, previousCropObj, previousText, currentText, previousFilter, isCircleCrop) {
19192
19199
  var parent = this.parent;
19193
19200
  if (parent.isResize || this.isPreventing) {
@@ -19947,7 +19954,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
19947
19954
  ImageEditor.prototype.createDropUploader = function () {
19948
19955
  var _this = this;
19949
19956
  var uploadObj = new Uploader({
19950
- dropArea: document.getElementsByClassName('e-canvas-wrapper')[0],
19957
+ dropArea: this.element.getElementsByClassName('e-canvas-wrapper')[0],
19951
19958
  allowedExtensions: '.jpg, .jpeg, .png,.svg',
19952
19959
  multiple: false,
19953
19960
  selected: function (args) {
@@ -20233,7 +20240,8 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
20233
20240
  ImageEditor.prototype.notifyResetForAllModules = function () {
20234
20241
  var modules = this.requiredModules();
20235
20242
  for (var i = 0; i < modules.length; i++) {
20236
- this.notify(modules[i].member, { prop: 'reset', onPropertyChange: false });
20243
+ var module = modules[i].member;
20244
+ this.notify(module === 'toolbar-module' ? 'toolbar' : module, { prop: 'reset', onPropertyChange: false });
20237
20245
  }
20238
20246
  };
20239
20247
  ImageEditor.prototype.allowShape = function (x, y) {
@@ -20537,14 +20545,16 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
20537
20545
  * Enable or disable a panning on the Image Editor.
20538
20546
  *
20539
20547
  * @param {boolean} value - Specifies a value whether enable or disable panning.
20548
+ * @param {number} x - Optional, Specifies a value to pan the image horizontally.
20549
+ * @param {number} y - Optional, Specifies a value to pan the image vertically.
20540
20550
  *
20541
20551
  * @remarks
20542
20552
  * This option will take into effect once the image's visibility is hidden when zooming an image or selection has been performed.
20543
20553
  *
20544
20554
  * @returns {void}.
20545
20555
  */
20546
- ImageEditor.prototype.pan = function (value) {
20547
- this.notify('transform', { prop: 'pan', onPropertyChange: false, value: { value: value } });
20556
+ ImageEditor.prototype.pan = function (value, x, y) {
20557
+ this.notify('transform', { prop: 'pan', onPropertyChange: false, value: { value: value, x: x, y: y } });
20548
20558
  };
20549
20559
  /**
20550
20560
  * Zoom in or out on a point in the image editor.
@@ -21052,8 +21062,19 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
21052
21062
  this.notify('shape', { prop: 'selectShape', onPropertyChange: false, value: { id: setting.id, obj: obj } });
21053
21063
  this.notify('selection', { prop: 'getFreehandDrawEditing', onPropertyChange: false, value: { obj: freehandObj } });
21054
21064
  if (obj['isSelected']) {
21065
+ var tempFontSize = this.activeObj.textSettings.fontSize;
21055
21066
  this.notify('shape', { prop: 'updateShapeChangeEventArgs', onPropertyChange: false,
21056
21067
  value: { shapeSettings: setting } });
21068
+ if (this.activeObj.shape === 'text' && tempFontSize) {
21069
+ var diff = this.activeObj.textSettings.fontSize - tempFontSize;
21070
+ if (diff !== 0) {
21071
+ this.activeObj.activePoint.height += diff;
21072
+ this.activeObj.activePoint.startY -= (diff / 2);
21073
+ this.activeObj.activePoint.endY += (diff / 2);
21074
+ this.notify('draw', { prop: 'updateActiveObject', onPropertyChange: false, value: { actPoint: this.activeObj.activePoint, obj: this.activeObj,
21075
+ isMouseMove: null, x: null, y: null } });
21076
+ }
21077
+ }
21057
21078
  var activeObj = extend({}, this.activeObj, {}, true);
21058
21079
  this.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
21059
21080
  this.notify('draw', { prop: 'render-image', value: { isMouseWheel: null, isPreventClearRect: null, isFrame: null } });
@@ -23351,12 +23372,6 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
23351
23372
  case 'setSelectedFreehandColor':
23352
23373
  this.selFhdColor = args.value['color'];
23353
23374
  break;
23354
- case 'getCurrentFilter':
23355
- args.value['obj']['currentFilter'] = parent.currentFilter;
23356
- break;
23357
- case 'setCurrentFilter':
23358
- parent.currentFilter = args.value['filter'];
23359
- break;
23360
23375
  case 'setInitialAdjustmentValue':
23361
23376
  parent.initialAdjustmentValue = args.value['value'];
23362
23377
  break;
@@ -23378,9 +23393,6 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
23378
23393
  case 'refreshSlider':
23379
23394
  this.refreshSlider();
23380
23395
  break;
23381
- case 'renderSlider':
23382
- this.renderSlider(args.value['type']);
23383
- break;
23384
23396
  case 'getCurrAdjustmentValue':
23385
23397
  parent.getCurrAdjustmentValue(args.value['type']);
23386
23398
  break;
@@ -23390,18 +23402,6 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
23390
23402
  case 'refreshShapeDrawing':
23391
23403
  this.refreshShapeDrawing();
23392
23404
  break;
23393
- case 'getCropToolbar':
23394
- args.value['obj']['isCropToolbar'] = parent.isCropToolbar;
23395
- break;
23396
- case 'getPrevCurrSelectionPoint':
23397
- args.value['obj']['prevCurrSelectionPoint'] = parent.prevCurrSelectionPoint;
23398
- break;
23399
- case 'setPrevCurrSelectionPoint':
23400
- parent.prevCurrSelectionPoint = args.value['point'];
23401
- break;
23402
- case 'updateCropTransformItems':
23403
- parent.updateCropTransformItems();
23404
- break;
23405
23405
  case 'setEnableDisableUndoRedo':
23406
23406
  this.preventEnableDisableUr = args.value['isPrevent'];
23407
23407
  break;
@@ -23452,7 +23452,6 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
23452
23452
  };
23453
23453
  ToolbarModule.prototype.reset = function () {
23454
23454
  var parent = this.parent;
23455
- this.defToolbarItems = [];
23456
23455
  this.toolbarHeight = 46;
23457
23456
  parent.prevCurrSelectionPoint = null;
23458
23457
  this.zoomBtnHold = null;
@@ -24243,6 +24242,10 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
24243
24242
  this.parent.showDialogPopup();
24244
24243
  }
24245
24244
  };
24245
+ ToolbarModule.prototype.triggerTbarClickEvent = function (args) {
24246
+ var clickEvent = { item: args.item, originalEvent: args.event };
24247
+ this.parent.trigger('toolbarItemClicked', clickEvent);
24248
+ };
24246
24249
  ToolbarModule.prototype.renderAnnotationBtn = function (isContextualToolbar) {
24247
24250
  var _this = this;
24248
24251
  var parent = this.parent;
@@ -24332,6 +24335,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
24332
24335
  }
24333
24336
  },
24334
24337
  select: function (args) {
24338
+ _this.triggerTbarClickEvent(args);
24335
24339
  parent.okBtn();
24336
24340
  var isCropSelection = false;
24337
24341
  var splitWords;
@@ -24352,6 +24356,9 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
24352
24356
  }
24353
24357
  var obj = { currentFreehandDrawIndex: null };
24354
24358
  parent.notify('freehand-draw', { prop: 'getCurrentFreehandDrawIndex', value: { obj: obj } });
24359
+ var prevObj = { shapeSettingsObj: {} };
24360
+ var shapeSettings;
24361
+ var shapeChangingArgs;
24355
24362
  drpDownBtn.iconCss = 'e-icons ' + _this.getCurrentShapeIcon(args.item.id);
24356
24363
  switch (args.item.id) {
24357
24364
  case 'pen':
@@ -24359,6 +24366,12 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
24359
24366
  parent.notify('draw', { prop: 'setTempCurrentFreehandDrawIndex', value: { tempCurrentFreehandDrawIndex: obj['currentFreehandDrawIndex'] } });
24360
24367
  _this.currentToolbar = 'pen';
24361
24368
  parent.freeHandDraw(true);
24369
+ parent.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: prevObj } });
24370
+ shapeSettings = prevObj['shapeSettingsObj'];
24371
+ shapeSettings.type = ShapeType.FreehandDraw;
24372
+ shapeChangingArgs = { cancel: false, action: 'insert', previousShapeSettings: shapeSettings,
24373
+ currentShapeSettings: shapeSettings };
24374
+ parent.notify('freehand-draw', { prop: 'triggerShapeChanging', value: { shapeChangingArgs: shapeChangingArgs } });
24362
24375
  break;
24363
24376
  case 'text':
24364
24377
  _this.currentToolbar = 'text';
@@ -24368,12 +24381,22 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
24368
24381
  _this.currentToolbar = 'shapes';
24369
24382
  parent.element.querySelector('#' + id + '_fileUpload').click();
24370
24383
  break;
24371
- default:
24384
+ case 'ellipse':
24385
+ case 'arrow':
24386
+ case 'line':
24387
+ case 'rectangle':
24388
+ case 'path':
24372
24389
  _this.currentToolbar = 'shapes';
24373
24390
  _this.setInitialShapeSettings(args);
24374
24391
  parent.notify('selection', { prop: 'annotate', value: { shape: args.item.id } });
24375
24392
  parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'shapes',
24376
24393
  isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
24394
+ parent.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: prevObj } });
24395
+ shapeSettings = prevObj['shapeSettingsObj'];
24396
+ shapeChangingArgs = { cancel: false, action: 'insert', previousShapeSettings: shapeSettings,
24397
+ currentShapeSettings: shapeSettings };
24398
+ parent.trigger('shapeChanging', shapeChangingArgs);
24399
+ parent.notify('shape', { prop: 'updateShapeChangeEventArgs', value: { shapeSettings: shapeChangingArgs.currentShapeSettings } });
24377
24400
  break;
24378
24401
  }
24379
24402
  _this.updateToolbarItems();
@@ -24479,6 +24502,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
24479
24502
  },
24480
24503
  items: items,
24481
24504
  select: function (args) {
24505
+ _this.triggerTbarClickEvent(args);
24482
24506
  _this.cropSelect(args);
24483
24507
  drpDownBtn.iconCss = 'e-icons ' + _this.getCurrentShapeIcon('crop-' + args.item.id);
24484
24508
  drpDownBtn.content = Browser.isDevice ? null : parent.toPascalCase(args.item.id);
@@ -24489,6 +24513,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
24489
24513
  drpDownBtn.appendTo('#' + parent.element.id + '_cropBtn');
24490
24514
  };
24491
24515
  ToolbarModule.prototype.renderTransformBtn = function () {
24516
+ var _this = this;
24492
24517
  var parent = this.parent;
24493
24518
  var items = [];
24494
24519
  if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('RotateLeft') > -1)) {
@@ -24513,12 +24538,17 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
24513
24538
  elem.style.display = 'block';
24514
24539
  }
24515
24540
  },
24516
- items: items, select: parent.transformSelect.bind(this),
24541
+ items: items,
24542
+ select: function (args) {
24543
+ _this.triggerTbarClickEvent(args);
24544
+ parent.transformSelect.bind(_this);
24545
+ },
24517
24546
  iconCss: 'e-icons e-transform', cssClass: 'e-image-popup'
24518
24547
  });
24519
24548
  drpDownBtn.appendTo('#' + parent.element.id + '_transformBtn');
24520
24549
  };
24521
24550
  ToolbarModule.prototype.renderSaveBtn = function () {
24551
+ var _this = this;
24522
24552
  var parent = this.parent;
24523
24553
  var id = parent.element.id;
24524
24554
  var saveItems = [
@@ -24531,6 +24561,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
24531
24561
  // Initialize the DropDownButton component.
24532
24562
  var saveDrpDownBtn = new DropDownButton({ items: saveItems, cssClass: 'e-caret-hide e-image-popup', iconCss: 'e-icons e-save',
24533
24563
  select: function (args) {
24564
+ _this.triggerTbarClickEvent(args);
24534
24565
  parent.export(args.item.text);
24535
24566
  parent.isChangesSaved = true;
24536
24567
  parent.notify('draw', { prop: 'redrawDownScale' });
@@ -24968,6 +24999,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
24968
24999
  }
24969
25000
  };
24970
25001
  ToolbarModule.prototype.createShapeBtn = function (items) {
25002
+ var _this = this;
24971
25003
  var parent = this.parent;
24972
25004
  var id = parent.element.id;
24973
25005
  if (items.indexOf('strokeWidth') > -1) {
@@ -25006,6 +25038,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
25006
25038
  }
25007
25039
  },
25008
25040
  select: function (args) {
25041
+ _this.triggerTbarClickEvent(args);
25009
25042
  spanElem_1.textContent = args.item.text;
25010
25043
  parent.updateStrokeWidth(args.item.id);
25011
25044
  if (Browser.isDevice) {
@@ -25029,6 +25062,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
25029
25062
  }
25030
25063
  };
25031
25064
  ToolbarModule.prototype.createStartBtn = function () {
25065
+ var _this = this;
25032
25066
  var parent = this.parent;
25033
25067
  var id = parent.element.id;
25034
25068
  var strokeWidthItems = [
@@ -25062,6 +25096,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
25062
25096
  }
25063
25097
  },
25064
25098
  select: function (args) {
25099
+ _this.triggerTbarClickEvent(args);
25065
25100
  spanElem.textContent = args.item.text;
25066
25101
  parent.updateArrow('startArrow', args.item.id);
25067
25102
  }
@@ -25070,6 +25105,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
25070
25105
  drpDownBtn.appendTo('#' + id + '_startBtn');
25071
25106
  };
25072
25107
  ToolbarModule.prototype.createEndBtn = function () {
25108
+ var _this = this;
25073
25109
  var parent = this.parent;
25074
25110
  var id = parent.element.id;
25075
25111
  var strokeWidthItems = [
@@ -25103,6 +25139,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
25103
25139
  }
25104
25140
  },
25105
25141
  select: function (args) {
25142
+ _this.triggerTbarClickEvent(args);
25106
25143
  spanElem.textContent = args.item.text;
25107
25144
  parent.updateArrow('endArrow', args.item.id);
25108
25145
  }
@@ -25301,6 +25338,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
25301
25338
  }
25302
25339
  };
25303
25340
  ToolbarModule.prototype.createTextBtn = function (items) {
25341
+ var _this = this;
25304
25342
  var parent = this.parent;
25305
25343
  var id = parent.element.id;
25306
25344
  if (items.indexOf('fontFamily') > -1) {
@@ -25341,6 +25379,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
25341
25379
  }
25342
25380
  },
25343
25381
  select: function (args) {
25382
+ _this.triggerTbarClickEvent(args);
25344
25383
  spanElem_2.textContent = args.item.text;
25345
25384
  if (Browser.isDevice) {
25346
25385
  spanElem_2.setAttribute('style', 'font-family:' + args.item.id);
@@ -25369,6 +25408,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
25369
25408
  args.element.querySelector('[aria-label *= ' + '"' + activeBtn + '"' + ']').classList.add('e-selected-btn');
25370
25409
  },
25371
25410
  select: function (args) {
25411
+ _this.triggerTbarClickEvent(args);
25372
25412
  fontSizeSpanElem_1.textContent = args.item.text;
25373
25413
  parent.updateFontSize(args.item.text);
25374
25414
  }
@@ -25802,6 +25842,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
25802
25842
  parent.element.querySelector('.e-template.e-pen-stroke-color').appendChild(parent.createElement('input', {
25803
25843
  id: id + '_pen_stroke'
25804
25844
  }));
25845
+ var presentVal = parent.activeObj.strokeSettings.strokeColor;
25805
25846
  var penColor = new ColorPicker({
25806
25847
  modeSwitcher: false, value: '#fff',
25807
25848
  showButtons: false, mode: 'Palette', cssClass: 'e-pen-color',
@@ -25827,6 +25868,9 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
25827
25868
  }, '#' + id + '_penColorBtn');
25828
25869
  penColor.inline = true;
25829
25870
  penColor.value = penColor.getValue(parent.activeObj.strokeSettings.strokeColor, 'rgba');
25871
+ if (penColor.value === 'null') {
25872
+ penColor.value = presentVal;
25873
+ }
25830
25874
  var obj = { tempFreeHandDrawEditingStyles: null };
25831
25875
  parent.notify('freehand-draw', { prop: 'getTempFreeHandDrawEditingStyles', value: { obj: obj } });
25832
25876
  var indexObj = { freehandSelectedIndex: null };
@@ -25843,6 +25887,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
25843
25887
  }
25844
25888
  };
25845
25889
  ToolbarModule.prototype.createPenBtn = function (items) {
25890
+ var _this = this;
25846
25891
  var parent = this.parent;
25847
25892
  var id = parent.element.id;
25848
25893
  var strokeWidthItems = [
@@ -25875,6 +25920,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
25875
25920
  args.element.querySelector('[aria-label = ' + '"' + activeBtn + '"' + ']').classList.add('e-selected-btn');
25876
25921
  },
25877
25922
  select: function (args) {
25923
+ _this.triggerTbarClickEvent(args);
25878
25924
  spanElem_3.textContent = args.item.text;
25879
25925
  parent.updatePenStrokeWidth(args.item.id);
25880
25926
  if (Browser.isDevice) {
@@ -26154,6 +26200,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
26154
26200
  parent.element.querySelector('.e-stroke.e-template .e-dropdownbtn-preview').style.background = parent.frameObj.color;
26155
26201
  };
26156
26202
  ToolbarModule.prototype.createFrameSize = function () {
26203
+ var _this = this;
26157
26204
  var parent = this.parent;
26158
26205
  var prevFrameSettings;
26159
26206
  var obj = { frameChangeEventArgs: null };
@@ -26184,6 +26231,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
26184
26231
  }
26185
26232
  },
26186
26233
  select: function (args) {
26234
+ _this.triggerTbarClickEvent(args);
26187
26235
  prevFrameSettings = { type: parent.toPascalCase(parent.frameObj.type), color: parent.frameObj.color,
26188
26236
  gradientColor: parent.frameObj.gradientColor, size: parent.frameObj.size, inset: parent.frameObj.inset,
26189
26237
  offset: parent.frameObj.offset, borderRadius: parent.frameObj.radius, frameLineStyle: parent.toPascalCase(parent.frameObj.border),
@@ -26229,6 +26277,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
26229
26277
  drpDownBtn.appendTo('#' + id + '_frameSizeBtn');
26230
26278
  };
26231
26279
  ToolbarModule.prototype.createFrameInset = function () {
26280
+ var _this = this;
26232
26281
  var parent = this.parent;
26233
26282
  var prevFrameSettings;
26234
26283
  var obj = { frameChangeEventArgs: null };
@@ -26259,6 +26308,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
26259
26308
  }
26260
26309
  },
26261
26310
  select: function (args) {
26311
+ _this.triggerTbarClickEvent(args);
26262
26312
  prevFrameSettings = { type: parent.toPascalCase(parent.frameObj.type), color: parent.frameObj.color,
26263
26313
  gradientColor: parent.frameObj.gradientColor, size: parent.frameObj.size, inset: parent.frameObj.inset,
26264
26314
  offset: parent.frameObj.offset, borderRadius: parent.frameObj.radius, frameLineStyle: parent.toPascalCase(parent.frameObj.border),
@@ -26304,6 +26354,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
26304
26354
  drpDownBtn.appendTo('#' + id + '_frameInsetBtn');
26305
26355
  };
26306
26356
  ToolbarModule.prototype.createFrameOffset = function () {
26357
+ var _this = this;
26307
26358
  var parent = this.parent;
26308
26359
  var prevFrameSettings;
26309
26360
  var obj = { frameChangeEventArgs: null };
@@ -26334,6 +26385,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
26334
26385
  }
26335
26386
  },
26336
26387
  select: function (args) {
26388
+ _this.triggerTbarClickEvent(args);
26337
26389
  prevFrameSettings = { type: parent.toPascalCase(parent.frameObj.type), color: parent.frameObj.color,
26338
26390
  gradientColor: parent.frameObj.gradientColor, size: parent.frameObj.size, inset: parent.frameObj.inset,
26339
26391
  offset: parent.frameObj.offset, borderRadius: parent.frameObj.radius, frameLineStyle: parent.toPascalCase(parent.frameObj.border),
@@ -26379,6 +26431,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
26379
26431
  drpDownBtn.appendTo('#' + id + '_frameOffsetBtn');
26380
26432
  };
26381
26433
  ToolbarModule.prototype.createFrameRadius = function () {
26434
+ var _this = this;
26382
26435
  var parent = this.parent;
26383
26436
  var prevFrameSettings;
26384
26437
  var obj = { frameChangeEventArgs: null };
@@ -26410,6 +26463,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
26410
26463
  }
26411
26464
  },
26412
26465
  select: function (args) {
26466
+ _this.triggerTbarClickEvent(args);
26413
26467
  prevFrameSettings = { type: parent.toPascalCase(parent.frameObj.type), color: parent.frameObj.color,
26414
26468
  gradientColor: parent.frameObj.gradientColor, size: parent.frameObj.size, inset: parent.frameObj.inset,
26415
26469
  offset: parent.frameObj.offset, borderRadius: parent.frameObj.radius, frameLineStyle: parent.toPascalCase(parent.frameObj.border),
@@ -26455,6 +26509,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
26455
26509
  drpDownBtn.appendTo('#' + id + '_frameRadiusBtn');
26456
26510
  };
26457
26511
  ToolbarModule.prototype.createFrameAmount = function () {
26512
+ var _this = this;
26458
26513
  var parent = this.parent;
26459
26514
  var prevFrameSettings;
26460
26515
  var obj = { frameChangeEventArgs: null };
@@ -26485,6 +26540,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
26485
26540
  }
26486
26541
  },
26487
26542
  select: function (args) {
26543
+ _this.triggerTbarClickEvent(args);
26488
26544
  prevFrameSettings = { type: parent.toPascalCase(parent.frameObj.type), color: parent.frameObj.color,
26489
26545
  gradientColor: parent.frameObj.gradientColor, size: parent.frameObj.size, inset: parent.frameObj.inset,
26490
26546
  offset: parent.frameObj.offset, borderRadius: parent.frameObj.radius, frameLineStyle: parent.toPascalCase(parent.frameObj.border),
@@ -26530,6 +26586,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
26530
26586
  drpDownBtn.appendTo('#' + id + '_frameAmountBtn');
26531
26587
  };
26532
26588
  ToolbarModule.prototype.createFrameBorder = function () {
26589
+ var _this = this;
26533
26590
  var parent = this.parent;
26534
26591
  var prevFrameSettings;
26535
26592
  var obj = { frameChangeEventArgs: null };
@@ -26558,6 +26615,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
26558
26615
  }
26559
26616
  },
26560
26617
  select: function (args) {
26618
+ _this.triggerTbarClickEvent(args);
26561
26619
  prevFrameSettings = { type: parent.toPascalCase(parent.frameObj.type), color: parent.frameObj.color,
26562
26620
  gradientColor: parent.frameObj.gradientColor, size: parent.frameObj.size, inset: parent.frameObj.inset,
26563
26621
  offset: parent.frameObj.offset, borderRadius: parent.frameObj.radius, frameLineStyle: parent.toPascalCase(parent.frameObj.border),