@syncfusion/ej2-image-editor 24.2.8 → 25.1.37

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 (77) hide show
  1. package/CHANGELOG.md +5 -45
  2. package/dist/ej2-image-editor.umd.min.js +2 -2
  3. package/dist/ej2-image-editor.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-image-editor.es2015.js +958 -1922
  5. package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
  6. package/dist/es6/ej2-image-editor.es5.js +993 -1974
  7. package/dist/es6/ej2-image-editor.es5.js.map +1 -1
  8. package/dist/global/ej2-image-editor.min.js +2 -2
  9. package/dist/global/ej2-image-editor.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +12 -12
  12. package/src/image-editor/action/crop.js +9 -45
  13. package/src/image-editor/action/draw.js +52 -207
  14. package/src/image-editor/action/export.js +6 -35
  15. package/src/image-editor/action/freehand-draw.js +26 -80
  16. package/src/image-editor/action/selection.js +122 -326
  17. package/src/image-editor/action/shape.js +133 -242
  18. package/src/image-editor/action/transform.d.ts +0 -1
  19. package/src/image-editor/action/transform.js +80 -291
  20. package/src/image-editor/action/undo-redo.d.ts +0 -1
  21. package/src/image-editor/action/undo-redo.js +32 -127
  22. package/src/image-editor/base/image-editor-model.d.ts +1 -1
  23. package/src/image-editor/base/image-editor.d.ts +51 -42
  24. package/src/image-editor/base/image-editor.js +316 -425
  25. package/src/image-editor/renderer/toolbar.d.ts +1 -0
  26. package/src/image-editor/renderer/toolbar.js +228 -207
  27. package/styles/bootstrap-dark.css +0 -12
  28. package/styles/bootstrap.css +0 -12
  29. package/styles/bootstrap4.css +0 -12
  30. package/styles/bootstrap5-dark.css +0 -12
  31. package/styles/bootstrap5.css +0 -12
  32. package/styles/fabric-dark.css +0 -12
  33. package/styles/fabric.css +0 -12
  34. package/styles/fluent-dark.css +0 -12
  35. package/styles/fluent.css +0 -12
  36. package/styles/highcontrast-light.css +0 -12
  37. package/styles/highcontrast.css +0 -12
  38. package/styles/image-editor/_bds-definition.scss +21 -0
  39. package/styles/image-editor/_bootstrap-dark-definition.scss +0 -1
  40. package/styles/image-editor/_bootstrap-definition.scss +0 -1
  41. package/styles/image-editor/_bootstrap4-definition.scss +0 -1
  42. package/styles/image-editor/_bootstrap5-definition.scss +0 -1
  43. package/styles/image-editor/_fabric-dark-definition.scss +0 -1
  44. package/styles/image-editor/_fabric-definition.scss +0 -1
  45. package/styles/image-editor/_fluent-definition.scss +0 -1
  46. package/styles/image-editor/_fusionnew-definition.scss +0 -1
  47. package/styles/image-editor/_highcontrast-definition.scss +0 -1
  48. package/styles/image-editor/_highcontrast-light-definition.scss +0 -1
  49. package/styles/image-editor/_layout.scss +5 -32
  50. package/styles/image-editor/_material-dark-definition.scss +0 -1
  51. package/styles/image-editor/_material-definition.scss +0 -1
  52. package/styles/image-editor/_material3-definition.scss +2 -3
  53. package/styles/image-editor/_tailwind-definition.scss +0 -1
  54. package/styles/image-editor/bootstrap-dark.css +0 -12
  55. package/styles/image-editor/bootstrap.css +0 -12
  56. package/styles/image-editor/bootstrap4.css +0 -12
  57. package/styles/image-editor/bootstrap5-dark.css +0 -12
  58. package/styles/image-editor/bootstrap5.css +0 -12
  59. package/styles/image-editor/fabric-dark.css +0 -12
  60. package/styles/image-editor/fabric.css +0 -12
  61. package/styles/image-editor/fluent-dark.css +0 -12
  62. package/styles/image-editor/fluent.css +0 -12
  63. package/styles/image-editor/highcontrast-light.css +0 -12
  64. package/styles/image-editor/highcontrast.css +0 -12
  65. package/styles/image-editor/icons/_bds.scss +411 -0
  66. package/styles/image-editor/material-dark.css +0 -12
  67. package/styles/image-editor/material.css +0 -12
  68. package/styles/image-editor/material3-dark.css +5 -25
  69. package/styles/image-editor/material3.css +5 -25
  70. package/styles/image-editor/tailwind-dark.css +2 -14
  71. package/styles/image-editor/tailwind.css +2 -14
  72. package/styles/material-dark.css +0 -12
  73. package/styles/material.css +0 -12
  74. package/styles/material3-dark.css +5 -25
  75. package/styles/material3.css +5 -25
  76. package/styles/tailwind-dark.css +2 -14
  77. package/styles/tailwind.css +2 -14
@@ -1,4 +1,4 @@
1
- import { EventHandler, extend, isBlazor, isNullOrUndefined } from '@syncfusion/ej2-base';
1
+ import { EventHandler, extend, isNullOrUndefined } from '@syncfusion/ej2-base';
2
2
  import { ShapeType } from '../index';
3
3
  var Shape = /** @class */ (function () {
4
4
  function Shape(parent) {
@@ -28,22 +28,22 @@ var Shape = /** @class */ (function () {
28
28
  var uploader;
29
29
  switch (args.prop) {
30
30
  case 'drawEllipse':
31
- this.drawEllipse(args.value['x'], args.value['y'], args.value['radiusX'], args.value['radiusY'], args.value['strokeWidth'], args.value['strokeColor'], args.value['fillColor'], args.value['degree']);
31
+ this.drawEllipse(args.value['x'], args.value['y'], args.value['radiusX'], args.value['radiusY'], args.value['strokeWidth'], args.value['strokeColor'], args.value['fillColor'], args.value['degree'], args.value['isSelected']);
32
32
  break;
33
33
  case 'drawLine':
34
- this.drawLine(args.value['startX'], args.value['startY'], args.value['endX'], args.value['endY'], args.value['strokeWidth'], args.value['strokeColor']);
34
+ this.drawLine(args.value['startX'], args.value['startY'], args.value['endX'], args.value['endY'], args.value['strokeWidth'], args.value['strokeColor'], args.value['isSelected']);
35
35
  break;
36
36
  case 'drawArrow':
37
- this.drawArrow(args.value['startX'], args.value['startY'], args.value['endX'], args.value['endY'], args.value['strokeWidth'], args.value['strokeColor'], args.value['arrowStart'], args.value['arrowEnd']);
37
+ this.drawArrow(args.value['startX'], args.value['startY'], args.value['endX'], args.value['endY'], args.value['strokeWidth'], args.value['strokeColor'], args.value['arrowStart'], args.value['arrowEnd'], args.value['isSelected']);
38
38
  break;
39
39
  case 'drawPath':
40
- this.drawPath(args.value['pointColl'], args.value['strokeWidth'], args.value['strokeColor']);
40
+ this.drawPath(args.value['pointColl'], args.value['strokeWidth'], args.value['strokeColor'], args.value['isSelected']);
41
41
  break;
42
42
  case 'drawRectangle':
43
- this.drawRectangle(args.value['x'], args.value['y'], args.value['width'], args.value['height'], args.value['strokeWidth'], args.value['strokeColor'], args.value['fillColor'], args.value['degree']);
43
+ this.drawRectangle(args.value['x'], args.value['y'], args.value['width'], args.value['height'], args.value['strokeWidth'], args.value['strokeColor'], args.value['fillColor'], args.value['degree'], args.value['isSelected']);
44
44
  break;
45
45
  case 'drawText':
46
- this.drawText(args.value['x'], args.value['y'], args.value['text'], args.value['fontFamily'], args.value['fontSize'], args.value['bold'], args.value['italic'], args.value['color']);
46
+ this.drawText(args.value['x'], args.value['y'], args.value['text'], args.value['fontFamily'], args.value['fontSize'], args.value['bold'], args.value['italic'], args.value['color'], args.value['isSelected']);
47
47
  break;
48
48
  case 'redrawActObj':
49
49
  this.redrawActObj(args.value['x'], args.value['y'], args.value['isMouseDown']);
@@ -217,7 +217,7 @@ var Shape = /** @class */ (function () {
217
217
  this.getSquarePointForRotatedShape(args.value['obj'], args.value['object']);
218
218
  break;
219
219
  case 'drawImage':
220
- this.drawImage(args.value['x'], args.value['y'], args.value['width'], args.value['height'], args.value['src'], args.value['degree'], args.value['isAspectRatio'], args.value['opacity']);
220
+ this.drawImage(args.value['x'], args.value['y'], args.value['width'], args.value['height'], args.value['src'], args.value['degree'], args.value['isAspectRatio'], args.value['opacity'], args.value['isSelected']);
221
221
  break;
222
222
  case 'reset':
223
223
  this.reset();
@@ -279,26 +279,26 @@ var Shape = /** @class */ (function () {
279
279
  { text: 'Enter Text', fontFamily: this.parent.fontFamily.default, fontSize: null, fontRatio: null, bold: false, italic: false, underline: false };
280
280
  this.strokeSettings = { strokeColor: '#fff', fillColor: '', strokeWidth: null };
281
281
  };
282
- Shape.prototype.drawEllipse = function (x, y, radiusX, radiusY, strokeWidth, strokeColor, fillColor, degree) {
282
+ Shape.prototype.drawEllipse = function (x, y, radiusX, radiusY, strokeWidth, strokeColor, fillColor, degree, isSelected) {
283
283
  this.initializeShape('ellipse');
284
284
  var start = x && y ? { x: x, y: y } : null;
285
- this.drawShape('ellipse', strokeWidth, strokeColor, fillColor, start, radiusX, radiusY, null, null, null, degree);
285
+ this.drawShape('ellipse', strokeWidth, strokeColor, fillColor, start, radiusX, radiusY, null, null, null, degree, null, isSelected);
286
286
  };
287
- Shape.prototype.drawLine = function (startX, startY, endX, endY, strokeWidth, strokeColor) {
287
+ Shape.prototype.drawLine = function (startX, startY, endX, endY, strokeWidth, strokeColor, isSelected) {
288
288
  this.initializeShape('line');
289
289
  var start = startX && startY ? { x: startX, y: startY } : null;
290
290
  var width = endX - startX;
291
291
  var height = endY - startY;
292
- this.drawShape('line', strokeWidth, strokeColor, null, start, width, height);
292
+ this.drawShape('line', strokeWidth, strokeColor, null, start, width, height, null, null, null, null, null, isSelected);
293
293
  };
294
- Shape.prototype.drawPath = function (pointColl, strokeWidth, strokeColor) {
294
+ Shape.prototype.drawPath = function (pointColl, strokeWidth, strokeColor, isSelected) {
295
295
  var parent = this.parent;
296
296
  this.initializeShape('path');
297
297
  if (pointColl) {
298
- this.drawShape('path', strokeWidth, strokeColor, null, null, null, null, pointColl);
298
+ this.drawShape('path', strokeWidth, strokeColor, null, null, null, null, pointColl, null, null, null, null, isSelected);
299
299
  }
300
300
  else {
301
- this.drawShape('line', strokeWidth, strokeColor);
301
+ this.drawShape('line', strokeWidth, strokeColor, null, null, null, null, null, null, null, null, null, isSelected);
302
302
  var obj = extend({}, parent.objColl[parent.objColl.length - 1], null, true);
303
303
  obj.shape = 'path';
304
304
  obj.lineDraw = null;
@@ -307,20 +307,20 @@ var Shape = /** @class */ (function () {
307
307
  parent.objColl[parent.objColl.length - 1] = obj;
308
308
  }
309
309
  };
310
- Shape.prototype.drawArrow = function (startX, startY, endX, endY, strokeWidth, strokeColor, arrowStart, arrowEnd) {
310
+ Shape.prototype.drawArrow = function (startX, startY, endX, endY, strokeWidth, strokeColor, arrowStart, arrowEnd, isSelected) {
311
311
  this.initializeShape('arrow');
312
312
  var start = startX && startY ? { x: startX, y: startY } : null;
313
313
  var width = endX - startX;
314
314
  var height = endY - startY;
315
- this.drawShape('arrow', strokeWidth, strokeColor, null, start, width, height, null, arrowStart, arrowEnd);
315
+ this.drawShape('arrow', strokeWidth, strokeColor, null, start, width, height, null, arrowStart, arrowEnd, null, null, isSelected);
316
316
  };
317
- Shape.prototype.drawRectangle = function (x, y, width, height, strokeWidth, strokeColor, fillColor, degree) {
317
+ Shape.prototype.drawRectangle = function (x, y, width, height, strokeWidth, strokeColor, fillColor, degree, isSelected) {
318
318
  this.initializeShape('rectangle');
319
319
  var start = x && y ? { x: x, y: y } : null;
320
- this.drawShape('rectangle', strokeWidth, strokeColor, fillColor, start, width, height, null, null, null, degree);
320
+ this.drawShape('rectangle', strokeWidth, strokeColor, fillColor, start, width, height, null, null, null, degree, null, isSelected);
321
321
  };
322
- Shape.prototype.drawText = function (x, y, text, fontFamily, fontSize, bold, italic, color) {
323
- this.drawShapeText(text, fontFamily, fontSize, bold, italic, color, x, y);
322
+ Shape.prototype.drawText = function (x, y, text, fontFamily, fontSize, bold, italic, color, isSelected) {
323
+ this.drawShapeText(text, fontFamily, fontSize, bold, italic, color, x, y, isSelected);
324
324
  };
325
325
  Shape.prototype.initializeShape = function (type) {
326
326
  var parent = this.parent;
@@ -358,13 +358,12 @@ var Shape = /** @class */ (function () {
358
358
  }
359
359
  return arrowType;
360
360
  };
361
- Shape.prototype.drawShape = function (type, strokeWidth, strokeColor, fillColor, start, width, height, pointColl, arrowStart, arrowEnd, degree, opacity) {
362
- var _this = this;
361
+ Shape.prototype.drawShape = function (type, strokeWidth, strokeColor, fillColor, start, width, height, pointColl, arrowStart, arrowEnd, degree, opacity, isSelected) {
363
362
  var parent = this.parent;
364
363
  if (!parent.disabled && parent.isImageLoaded) {
365
364
  parent.notify('draw', { prop: 'setImageEdited', onPropertyChange: false });
366
365
  this.redrawActObj();
367
- var objColl_1 = extend([], parent.objColl, [], true);
366
+ var objColl = extend([], parent.objColl, [], true);
368
367
  parent.togglePen = false;
369
368
  this.keyHistory = '';
370
369
  parent.upperCanvas.style.display = 'block';
@@ -375,11 +374,9 @@ var Shape = /** @class */ (function () {
375
374
  parent.activeObj.pointColl = [];
376
375
  parent.upperCanvas.style.cursor = parent.cursor = 'crosshair';
377
376
  parent.notify('selection', { prop: 'setCurrentDrawingShape', onPropertyChange: false, value: { value: 'path' } });
378
- if (!isBlazor()) {
379
- parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'shapes',
380
- isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
381
- parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
382
- }
377
+ parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'shapes',
378
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
379
+ parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
383
380
  }
384
381
  else {
385
382
  if (type !== 'freehanddraw' && type !== '') {
@@ -437,50 +434,24 @@ var Shape = /** @class */ (function () {
437
434
  var shapeSettings = obj['shapeSettingsObj'];
438
435
  var shapeChangingArgs = { cancel: false, action: 'insert', previousShapeSettings: shapeSettings,
439
436
  currentShapeSettings: shapeSettings };
440
- if (isBlazor() && parent.events && parent.events.shapeChanging.hasDelegate === true) {
441
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
442
- parent.dotNetRef.invokeMethodAsync('ShapeEventAsync', 'OnShape', shapeChangingArgs, null).then(function (shapeChangingArgs) {
443
- _this.updateShapeChangeEventArgs(shapeChangingArgs.currentShapeSettings);
444
- _this.setDimension(width, height);
445
- parent.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate' } });
446
- if (degree) {
447
- parent.activeObj.rotatedAngle = degree * (Math.PI / 180);
448
- parent.notify('selection', { prop: 'updPtCollForShpRot', onPropertyChange: false, value: { obj: parent.activeObj } });
449
- }
450
- parent.updateToolbar(parent.element, 'quickAccessToolbar', 'shape');
451
- parent.notify('selection', { prop: 'isShapeInserted', onPropertyChange: false, value: { bool: true } });
452
- parent.notify('undo-redo', { prop: 'updateUrObj', onPropertyChange: false, value: { objColl: objColl_1 } });
453
- if (parent.isPublicMethod) {
454
- parent.notify('undo-redo', { prop: 'updateUndoRedo', value: { operation: 'shapeInsert' }, onPropertyChange: false });
455
- }
456
- parent.isPublicMethod = false;
457
- });
437
+ parent.trigger('shapeChanging', shapeChangingArgs);
438
+ this.updateShapeChangeEventArgs(shapeChangingArgs.currentShapeSettings);
439
+ this.setDimension(width, height);
440
+ parent.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate' } });
441
+ if (degree) {
442
+ parent.activeObj.rotatedAngle = degree * (Math.PI / 180);
443
+ parent.notify('selection', { prop: 'updPtCollForShpRot', onPropertyChange: false, value: { obj: parent.activeObj } });
458
444
  }
459
- else {
460
- parent.trigger('shapeChanging', shapeChangingArgs);
461
- this.updateShapeChangeEventArgs(shapeChangingArgs.currentShapeSettings);
462
- this.setDimension(width, height);
463
- parent.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate' } });
464
- if (degree) {
465
- parent.activeObj.rotatedAngle = degree * (Math.PI / 180);
466
- parent.notify('selection', { prop: 'updPtCollForShpRot', onPropertyChange: false, value: { obj: parent.activeObj } });
467
- }
468
- if (!isBlazor()) {
469
- parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
470
- }
471
- else {
472
- parent.updateToolbar(parent.element, 'quickAccessToolbar', 'shape');
473
- }
474
- parent.notify('selection', { prop: 'isShapeInserted', onPropertyChange: false, value: { bool: true } });
475
- parent.notify('undo-redo', { prop: 'updateUrObj', onPropertyChange: false, value: { objColl: objColl_1 } });
476
- parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'shapes',
477
- isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
478
- parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
479
- if (parent.isPublicMethod) {
480
- parent.notify('undo-redo', { prop: 'updateUndoRedo', value: { operation: 'shapeInsert' }, onPropertyChange: false });
481
- }
482
- parent.isPublicMethod = false;
445
+ parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
446
+ parent.notify('selection', { prop: 'isShapeInserted', onPropertyChange: false, value: { bool: true } });
447
+ parent.notify('undo-redo', { prop: 'updateUrObj', onPropertyChange: false, value: { objColl: objColl } });
448
+ parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'shapes',
449
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
450
+ parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
451
+ if (parent.isPublicMethod && !isSelected) {
452
+ parent.notify('undo-redo', { prop: 'updateUndoRedo', value: { operation: 'shapeInsert' }, onPropertyChange: false });
483
453
  }
454
+ parent.isPublicMethod = false;
484
455
  }
485
456
  }
486
457
  }
@@ -521,8 +492,7 @@ var Shape = /** @class */ (function () {
521
492
  value: { obj: selPointCollObj } });
522
493
  this.prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
523
494
  };
524
- Shape.prototype.drawShapeText = function (text, fontFamily, fontSize, bold, italic, strokeColor, x, y) {
525
- var _this = this;
495
+ Shape.prototype.drawShapeText = function (text, fontFamily, fontSize, bold, italic, strokeColor, x, y, isSelected) {
526
496
  var parent = this.parent;
527
497
  if (!parent.disabled && parent.isImageLoaded) {
528
498
  if (parent.currObjType.shape === 'freehanddraw') {
@@ -570,24 +540,12 @@ var Shape = /** @class */ (function () {
570
540
  var shapeSettings = obj['shapeSettingsObj'];
571
541
  var shapeChangingArgs = { cancel: false, action: 'insert', previousShapeSettings: shapeSettings,
572
542
  currentShapeSettings: shapeSettings };
573
- if (isBlazor() && parent.events && parent.events.shapeChanging.hasDelegate === true) {
574
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
575
- parent.dotNetRef.invokeMethodAsync('ShapeEventAsync', 'OnShape', shapeChangingArgs, null).then(function (shapeChangingArgs) {
576
- _this.drawShapeTextEvent(shapeChangingArgs);
577
- if (parent.isPublicMethod) {
578
- parent.notify('undo-redo', { prop: 'updateUndoRedo', value: { operation: 'shapeInsert' }, onPropertyChange: false });
579
- }
580
- parent.isPublicMethod = false;
581
- });
582
- }
583
- else {
584
- parent.trigger('shapeChanging', shapeChangingArgs);
585
- this.drawShapeTextEvent(shapeChangingArgs);
586
- if (parent.isPublicMethod) {
587
- parent.notify('undo-redo', { prop: 'updateUndoRedo', value: { operation: 'shapeInsert' }, onPropertyChange: false });
588
- }
589
- parent.isPublicMethod = false;
543
+ parent.trigger('shapeChanging', shapeChangingArgs);
544
+ this.drawShapeTextEvent(shapeChangingArgs);
545
+ if (parent.isPublicMethod && !isSelected) {
546
+ parent.notify('undo-redo', { prop: 'updateUndoRedo', value: { operation: 'shapeInsert' }, onPropertyChange: false });
590
547
  }
548
+ parent.isPublicMethod = false;
591
549
  }
592
550
  };
593
551
  Shape.prototype.drawShapeImageEvent = function (shapeChangingArgs, isSelect) {
@@ -603,16 +561,10 @@ var Shape = /** @class */ (function () {
603
561
  parent.notify('selection', { prop: 'redrawShape', onPropertyChange: false,
604
562
  value: { obj: parent.objColl[parent.objColl.length - 1] } });
605
563
  if (isSelect) {
606
- if (!isBlazor()) {
607
- parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'shapes',
608
- isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
609
- parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
610
- parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
611
- }
612
- else {
613
- parent.updateToolbar(parent.element, parent.activeObj.shape);
614
- parent.updateToolbar(parent.element, 'quickAccessToolbar', parent.activeObj.shape);
615
- }
564
+ parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'shapes',
565
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
566
+ parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
567
+ parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
616
568
  }
617
569
  else {
618
570
  parent.okBtn();
@@ -633,22 +585,11 @@ var Shape = /** @class */ (function () {
633
585
  previousCropObj: prevCropObj, previousText: null, currentText: null, previousFilter: null, isCircleCrop: null } });
634
586
  parent.notify('selection', { prop: 'redrawShape', onPropertyChange: false,
635
587
  value: { obj: parent.objColl[parent.objColl.length - 1] } });
636
- if (isBlazor()) {
637
- parent.updateToolbar(parent.element, 'quickAccessToolbar', 'text');
638
- }
639
- else {
640
- parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
641
- }
588
+ parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
642
589
  parent.notify('selection', { prop: 'isShapeInserted', onPropertyChange: false, value: { bool: true } });
643
- if (isBlazor()) {
644
- parent.updateToolbar(parent.element, 'text');
645
- parent.getFontSizes();
646
- }
647
- else {
648
- parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'text',
649
- isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
650
- parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
651
- }
590
+ parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'text',
591
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
592
+ parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
652
593
  };
653
594
  Shape.prototype.initializeTextShape = function (text, fontFamily, fontSize, bold, italic, strokeColor) {
654
595
  var parent = this.parent;
@@ -667,9 +608,9 @@ var Shape = /** @class */ (function () {
667
608
  parent.activeObj.textSettings.bold = bold || parent.activeObj.textSettings.bold;
668
609
  parent.activeObj.textSettings.italic = italic || parent.activeObj.textSettings.italic;
669
610
  };
670
- Shape.prototype.drawImage = function (x, y, width, height, src, degree, isAspectRatio, opacity) {
611
+ Shape.prototype.drawImage = function (x, y, width, height, src, degree, isAspectRatio, opacity, isSelected) {
671
612
  this.initializeShape('image');
672
- this.onLoadImgShape(x, y, width, height, src, null, degree, isAspectRatio, opacity);
613
+ this.onLoadImgShape(x, y, width, height, src, null, degree, isAspectRatio, opacity, isSelected);
673
614
  };
674
615
  Shape.prototype.redrawActObj = function (x, y, isMouseDown) {
675
616
  var splitWords;
@@ -770,6 +711,8 @@ var Shape = /** @class */ (function () {
770
711
  endX: parent.activeObj.activePoint.startX + parent.activeObj.activePoint.width,
771
712
  endY: parent.activeObj.activePoint.startY + parent.activeObj.activePoint.height,
772
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;
773
716
  };
774
717
  Shape.prototype.updateShapeChangeEventArgs = function (shapeSettings) {
775
718
  var parent = this.parent;
@@ -800,15 +743,10 @@ var Shape = /** @class */ (function () {
800
743
  }
801
744
  switch (parent.activeObj.shape) {
802
745
  case 'ellipse':
803
- if (isBlazor()) {
804
- parent.activeObj.activePoint.width = shapeSettings.radius;
805
- }
806
- else {
807
- parent.activeObj.activePoint.width = shapeSettings.radiusX * 2;
808
- parent.activeObj.activePoint.height = shapeSettings.radiusY * 2;
809
- parent.activeObj.activePoint.endX = parent.activeObj.activePoint.startX + parent.activeObj.activePoint.width;
810
- parent.activeObj.activePoint.endY = parent.activeObj.activePoint.startY + parent.activeObj.activePoint.height;
811
- }
746
+ parent.activeObj.activePoint.width = shapeSettings.radiusX * 2;
747
+ parent.activeObj.activePoint.height = shapeSettings.radiusY * 2;
748
+ parent.activeObj.activePoint.endX = parent.activeObj.activePoint.startX + parent.activeObj.activePoint.width;
749
+ parent.activeObj.activePoint.endY = parent.activeObj.activePoint.startY + parent.activeObj.activePoint.height;
812
750
  if (shapeSettings.degree) {
813
751
  parent.activeObj.rotatedAngle = shapeSettings.degree * (Math.PI / 180);
814
752
  }
@@ -816,15 +754,13 @@ var Shape = /** @class */ (function () {
816
754
  case 'line':
817
755
  case 'arrow':
818
756
  parent.activeObj.activePoint.width = shapeSettings.length;
819
- if (!isBlazor()) {
820
- parent.activeObj.activePoint.endX = shapeSettings.endX;
821
- parent.activeObj.activePoint.endY = shapeSettings.endY;
822
- parent.activeObj.activePoint.width = parent.activeObj.activePoint.startX + parent.activeObj.activePoint.width;
823
- parent.activeObj.activePoint.height = parent.activeObj.activePoint.startY + parent.activeObj.activePoint.height;
824
- if (parent.activeObj.shape === 'arrow') {
825
- parent.activeObj.start = this.getArrowType(shapeSettings.arrowHead);
826
- parent.activeObj.end = this.getArrowType(shapeSettings.arrowTail);
827
- }
757
+ parent.activeObj.activePoint.endX = shapeSettings.endX;
758
+ parent.activeObj.activePoint.endY = shapeSettings.endY;
759
+ parent.activeObj.activePoint.width = parent.activeObj.activePoint.startX + parent.activeObj.activePoint.width;
760
+ parent.activeObj.activePoint.height = parent.activeObj.activePoint.startY + parent.activeObj.activePoint.height;
761
+ if (parent.activeObj.shape === 'arrow') {
762
+ parent.activeObj.start = this.getArrowType(shapeSettings.arrowHead);
763
+ parent.activeObj.end = this.getArrowType(shapeSettings.arrowTail);
828
764
  }
829
765
  break;
830
766
  case 'text':
@@ -835,6 +771,7 @@ var Shape = /** @class */ (function () {
835
771
  if (shapeSettings.degree) {
836
772
  parent.activeObj.rotatedAngle = shapeSettings.degree * (Math.PI / 180);
837
773
  }
774
+ this.updateFontRatio(parent.activeObj);
838
775
  break;
839
776
  case 'rectangle':
840
777
  case 'image':
@@ -848,6 +785,9 @@ var Shape = /** @class */ (function () {
848
785
  break;
849
786
  }
850
787
  if (parent.activeObj.shape === 'text' && parent.activeObj.textSettings) {
788
+ parent.activeObj.textSettings.bold = false;
789
+ parent.activeObj.textSettings.italic = false;
790
+ parent.activeObj.textSettings.underline = false;
851
791
  for (var i = 0; i < shapeSettings.fontStyle.length; i++) {
852
792
  switch (shapeSettings.fontStyle[i]) {
853
793
  case 'bold':
@@ -1566,12 +1506,7 @@ var Shape = /** @class */ (function () {
1566
1506
  var parent = this.parent;
1567
1507
  var degree = this.getRotDegOfShape(parent.activeObj);
1568
1508
  this.transformTextArea();
1569
- if (isBlazor()) {
1570
- parent.updateToolbar(parent.element, 'destroyQuickAccessToolbar');
1571
- }
1572
- else {
1573
- parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
1574
- }
1509
+ parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
1575
1510
  var dupElem = parent.element.querySelector('#' + parent.element.id + '_duplicate');
1576
1511
  var removeElem = parent.element.querySelector('#' + parent.element.id + '_remove');
1577
1512
  var editTextElem = parent.element.querySelector('#' + parent.element.id + '_editText');
@@ -1884,12 +1819,7 @@ var Shape = /** @class */ (function () {
1884
1819
  if (parent.objColl[parent.objColl.length - 1]) {
1885
1820
  parent.selectShape(parent.objColl[parent.objColl.length - 1].currIndex);
1886
1821
  }
1887
- if (!isBlazor()) {
1888
- parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
1889
- }
1890
- else {
1891
- parent.updateToolbar(parent.element, 'quickAccessToolbar', parent.activeObj.shape);
1892
- }
1822
+ parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
1893
1823
  var obj_1 = { shapeSettingsObj: {} };
1894
1824
  parent.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: obj_1 } });
1895
1825
  var shapeSettings = obj_1['shapeSettingsObj'];
@@ -1935,16 +1865,11 @@ var Shape = /** @class */ (function () {
1935
1865
  parent.notify('selection', { prop: 'setTouchEndPoint', onPropertyChange: false,
1936
1866
  value: { x: e.touches[0].clientX, y: e.touches[0].clientY } });
1937
1867
  }
1938
- if (!isBlazor()) {
1939
- parent.notify('toolbar', { prop: 'setPreventZoomBtn', onPropertyChange: false, value: { isPrevent: true } });
1940
- parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'text',
1941
- isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
1942
- parent.notify('toolbar', { prop: 'setPreventZoomBtn', onPropertyChange: false, value: { isPrevent: false } });
1943
- parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
1944
- }
1945
- else {
1946
- parent.updateToolbar(parent.element, 'enableDisableToolbarBtn', 'textAreaClicked');
1947
- }
1868
+ parent.notify('toolbar', { prop: 'setPreventZoomBtn', onPropertyChange: false, value: { isPrevent: true } });
1869
+ parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'text',
1870
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
1871
+ parent.notify('toolbar', { prop: 'setPreventZoomBtn', onPropertyChange: false, value: { isPrevent: false } });
1872
+ parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
1948
1873
  if (!isNullOrUndefined(x) && !isNullOrUndefined(y)) {
1949
1874
  var bbox = parent.lowerCanvas.getBoundingClientRect();
1950
1875
  x -= bbox.left;
@@ -2134,11 +2059,9 @@ var Shape = /** @class */ (function () {
2134
2059
  var URL = window.URL;
2135
2060
  var url = URL.createObjectURL(e.target.files[0]);
2136
2061
  this.onLoadImgShape(null, null, null, null, url.toString(), true);
2137
- if (!isBlazor()) {
2138
- document.getElementById(this.parent.element.id + '_fileUpload').value = '';
2139
- }
2062
+ document.getElementById(this.parent.element.id + '_fileUpload').value = '';
2140
2063
  };
2141
- Shape.prototype.onLoadImgShape = function (x, y, width, height, url, isSelect, degree, isAspectRatio, opacity) {
2064
+ Shape.prototype.onLoadImgShape = function (x, y, width, height, url, isSelect, degree, isAspectRatio, opacity, isSelected) {
2142
2065
  // eslint-disable-next-line @typescript-eslint/no-this-alias
2143
2066
  var proxy = this;
2144
2067
  var parent = this.parent;
@@ -2156,11 +2079,10 @@ var Shape = /** @class */ (function () {
2156
2079
  this.initShapeProps();
2157
2080
  this.shapeImg.onload = function () {
2158
2081
  proxy.upperContext.drawImage(proxy.shapeImg, 0, 0, proxy.shapeImg.width, proxy.shapeImg.height);
2159
- proxy.updateImgCanvas(isSelect, x, y, width, height, degree, isAspectRatio, opacity);
2082
+ proxy.updateImgCanvas(isSelect, x, y, width, height, degree, isAspectRatio, opacity, isSelected);
2160
2083
  };
2161
2084
  };
2162
- Shape.prototype.updateImgCanvas = function (isSelect, x, y, width, height, degree, isAspectRatio, opacity) {
2163
- var _this = this;
2085
+ Shape.prototype.updateImgCanvas = function (isSelect, x, y, width, height, degree, isAspectRatio, opacity, isSelected) {
2164
2086
  var parent = this.parent;
2165
2087
  parent.activeObj.imageElement = this.shapeImg;
2166
2088
  parent.activeObj.imageCanvas = parent.createElement('canvas');
@@ -2209,24 +2131,12 @@ var Shape = /** @class */ (function () {
2209
2131
  var shapeSettings = obj['shapeSettingsObj'];
2210
2132
  var shapeChangingArgs = { cancel: false, action: 'insert', previousShapeSettings: shapeSettings,
2211
2133
  currentShapeSettings: shapeSettings };
2212
- if (isBlazor() && parent.events && parent.events.shapeChanging.hasDelegate === true) {
2213
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
2214
- parent.dotNetRef.invokeMethodAsync('ShapeEventAsync', 'OnShape', shapeChangingArgs, null).then(function (shapeChangingArgs) {
2215
- _this.drawShapeImageEvent(shapeChangingArgs, isSelect);
2216
- if (parent.isPublicMethod) {
2217
- parent.notify('undo-redo', { prop: 'updateUndoRedo', onPropertyChange: false });
2218
- }
2219
- parent.isPublicMethod = false;
2220
- });
2221
- }
2222
- else {
2223
- parent.trigger('shapeChanging', shapeChangingArgs);
2224
- this.drawShapeImageEvent(shapeChangingArgs, isSelect);
2225
- if (parent.isPublicMethod) {
2226
- parent.notify('undo-redo', { prop: 'updateUndoRedo', onPropertyChange: false });
2227
- }
2228
- parent.isPublicMethod = false;
2134
+ parent.trigger('shapeChanging', shapeChangingArgs);
2135
+ this.drawShapeImageEvent(shapeChangingArgs, isSelect);
2136
+ if (parent.isPublicMethod && !isSelected) {
2137
+ parent.notify('undo-redo', { prop: 'updateUndoRedo', onPropertyChange: false });
2229
2138
  }
2139
+ parent.isPublicMethod = false;
2230
2140
  };
2231
2141
  Shape.prototype.updateObj = function (dimObj, x, y) {
2232
2142
  var parent = this.parent;
@@ -2533,7 +2443,7 @@ var Shape = /** @class */ (function () {
2533
2443
  }
2534
2444
  var shapeChangedArgs = { action: 'font-style', currentShapeSettings: extend({}, shapeSettings, {}, true) };
2535
2445
  shapeChangedArgs.currentShapeSettings.fontStyle = [item];
2536
- parent.triggerShapeChanged(shapeChangedArgs);
2446
+ parent.trigger('shapeChange', shapeChangedArgs);
2537
2447
  };
2538
2448
  Shape.prototype.updateFontStyle = function (item, objColl, fontWeight, fontStyle) {
2539
2449
  var parent = this.parent;
@@ -2760,12 +2670,7 @@ var Shape = /** @class */ (function () {
2760
2670
  parent.notify('crop', { prop: 'cropCircle', onPropertyChange: false,
2761
2671
  value: { context: this.lowerContext, isSave: null, isFlip: null } });
2762
2672
  }
2763
- if (!isBlazor()) {
2764
- parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
2765
- }
2766
- else {
2767
- parent.updateToolbar(parent.element, 'destroyQuickAccessToolbar');
2768
- }
2673
+ parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
2769
2674
  if (isNullOrUndefined(isMouseDown)) {
2770
2675
  parent.notify('undo-redo', { prop: 'updateCurrUrc', value: { type: 'ok' } });
2771
2676
  parent.notify('draw', { prop: 'setPrevActObj', onPropertyChange: false, value: { prevActObj: null } });
@@ -2931,13 +2836,6 @@ var Shape = /** @class */ (function () {
2931
2836
  shapeDetails.height = obj.activePoint.height;
2932
2837
  shapeDetails.opacity = obj.opacity;
2933
2838
  break;
2934
- case 'image':
2935
- shapeDetails.imageData = obj.imageCanvas.toDataURL();
2936
- shapeDetails.degree = obj.rotatedAngle * (180 / Math.PI);
2937
- shapeDetails.width = obj.activePoint.width;
2938
- shapeDetails.height = obj.activePoint.height;
2939
- shapeDetails.opacity = obj.opacity;
2940
- break;
2941
2839
  }
2942
2840
  return shapeDetails;
2943
2841
  };
@@ -2955,7 +2853,12 @@ var Shape = /** @class */ (function () {
2955
2853
  var parent = this.parent;
2956
2854
  var shapeDetails;
2957
2855
  if (!parent.disabled && parent.isImageLoaded) {
2958
- this.applyActObj();
2856
+ if (parent.textArea.style.display !== 'none') {
2857
+ parent.okBtn();
2858
+ }
2859
+ else {
2860
+ this.applyActObj(true);
2861
+ }
2959
2862
  if (id.split('_')[0] === 'shape') {
2960
2863
  var obj_4;
2961
2864
  for (var i = 0, len = parent.objColl.length; i < len; i++) {
@@ -2976,7 +2879,12 @@ var Shape = /** @class */ (function () {
2976
2879
  var parent = this.parent;
2977
2880
  var shapeDetailsColl = [];
2978
2881
  if (!parent.disabled && parent.isImageLoaded) {
2979
- this.applyActObj();
2882
+ if (parent.textArea.style.display !== 'none') {
2883
+ parent.okBtn();
2884
+ }
2885
+ else {
2886
+ this.applyActObj(true);
2887
+ }
2980
2888
  for (var i = 0, len = parent.objColl.length; i < len; i++) {
2981
2889
  var shapeDetails = this.getObjDetails(parent.objColl[i]);
2982
2890
  shapeDetailsColl.push(shapeDetails);
@@ -3126,31 +3034,20 @@ var Shape = /** @class */ (function () {
3126
3034
  this.lowerContext.filter = object['canvasFilter'];
3127
3035
  parent.notify('selection', { prop: 'redrawShape', onPropertyChange: false,
3128
3036
  value: { obj: parent.activeObj } });
3129
- if (!isBlazor()) {
3130
- if (parent.activeObj.shape === 'text') {
3131
- parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'text',
3132
- isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
3133
- }
3134
- else if (parent.activeObj.shape === 'pen') {
3135
- parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'pen',
3136
- isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
3137
- }
3138
- else {
3139
- parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'shapes',
3140
- isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
3141
- }
3142
- parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
3143
- parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
3037
+ if (parent.activeObj.shape === 'text') {
3038
+ parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'text',
3039
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
3040
+ }
3041
+ else if (parent.activeObj.shape === 'pen') {
3042
+ parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'pen',
3043
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
3144
3044
  }
3145
3045
  else {
3146
- parent.updateToolbar(parent.element, parent.activeObj.shape);
3147
- if (parent.activeObj.shape === 'path') {
3148
- parent.updateToolbar(parent.element, 'path', 'pathQuickAccessToolbar');
3149
- }
3150
- else {
3151
- parent.updateToolbar(parent.element, 'quickAccessToolbar', parent.activeObj.shape);
3152
- }
3046
+ parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'shapes',
3047
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
3153
3048
  }
3049
+ parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
3050
+ parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
3154
3051
  }
3155
3052
  }
3156
3053
  else if (id.split('_')[0] === 'pen') {
@@ -3164,14 +3061,8 @@ var Shape = /** @class */ (function () {
3164
3061
  if (obj_6['isIndex']) {
3165
3062
  isSelected = true;
3166
3063
  parent.notify('freehand-draw', { prop: 'selectFhd', value: { id: id } });
3167
- if (isBlazor()) {
3168
- parent.updateToolbar(parent.element, 'pen');
3169
- parent.updateToolbar(parent.element, 'quickAccessToolbar', 'pen');
3170
- }
3171
- else {
3172
- parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: true } });
3173
- parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
3174
- }
3064
+ parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: true } });
3065
+ parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
3175
3066
  }
3176
3067
  else {
3177
3068
  isSelected = false;
@@ -3183,29 +3074,29 @@ var Shape = /** @class */ (function () {
3183
3074
  Shape.prototype.deleteShape = function (id) {
3184
3075
  var parent = this.parent;
3185
3076
  if (!parent.disabled && parent.isImageLoaded) {
3186
- this.applyActObj();
3187
- if (id.split('_')[0] === 'shape') {
3188
- for (var i = 0, len = parent.objColl.length; i < len; i++) {
3189
- if (parent.objColl[i].currIndex === id) {
3190
- parent.objColl.splice(i, 1);
3191
- break;
3077
+ if (parent.activeObj.currIndex && parent.activeObj.currIndex === id) {
3078
+ parent.notify('selection', { prop: 'deleteItem', onPropertyChange: false });
3079
+ }
3080
+ else {
3081
+ this.applyActObj();
3082
+ if (id.split('_')[0] === 'shape') {
3083
+ for (var i = 0, len = parent.objColl.length; i < len; i++) {
3084
+ if (parent.objColl[i].currIndex === id) {
3085
+ parent.objColl.splice(i, 1);
3086
+ break;
3087
+ }
3192
3088
  }
3193
3089
  }
3194
- }
3195
- else if (id.split('_')[0] === 'pen') {
3196
- parent.notify('freehand-draw', { prop: 'handle-freehand-draw', value: { id: id } });
3090
+ else if (id.split('_')[0] === 'pen') {
3091
+ parent.notify('freehand-draw', { prop: 'handle-freehand-draw', value: { id: id } });
3092
+ }
3197
3093
  }
3198
3094
  var object = { canvasFilter: null };
3199
3095
  parent.notify('toolbar', { prop: 'getCanvasFilter', onPropertyChange: false, value: { obj: object } });
3200
3096
  this.lowerContext.filter = object['canvasFilter'];
3201
3097
  this.lowerContext.clearRect(0, 0, parent.lowerCanvas.width, parent.lowerCanvas.height);
3202
3098
  parent.notify('draw', { prop: 'redrawImgWithObj', onPropertyChange: false });
3203
- if (!isBlazor()) {
3204
- parent.notify('toolbar', { prop: 'refresh-main-toolbar', onPropertyChange: false });
3205
- }
3206
- else {
3207
- parent.updateToolbar(parent.element, 'imageLoaded');
3208
- }
3099
+ parent.notify('toolbar', { prop: 'refresh-main-toolbar', onPropertyChange: false });
3209
3100
  }
3210
3101
  };
3211
3102
  Shape.prototype.getMaxText = function (isTextBox, text, obj) {