@syncfusion/ej2-image-editor 24.1.46 → 24.2.4

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 (68) hide show
  1. package/CHANGELOG.md +12 -0
  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 +189 -39
  5. package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
  6. package/dist/es6/ej2-image-editor.es5.js +189 -39
  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 +11 -11
  12. package/src/image-editor/action/draw.js +3 -0
  13. package/src/image-editor/action/selection.d.ts +1 -0
  14. package/src/image-editor/action/selection.js +11 -2
  15. package/src/image-editor/action/shape.js +6 -6
  16. package/src/image-editor/action/undo-redo.d.ts +1 -0
  17. package/src/image-editor/action/undo-redo.js +43 -6
  18. package/src/image-editor/renderer/toolbar.d.ts +4 -0
  19. package/src/image-editor/renderer/toolbar.js +126 -25
  20. package/styles/bootstrap-dark.css +12 -0
  21. package/styles/bootstrap.css +12 -0
  22. package/styles/bootstrap4.css +12 -0
  23. package/styles/bootstrap5-dark.css +12 -0
  24. package/styles/bootstrap5.css +12 -0
  25. package/styles/fabric-dark.css +12 -0
  26. package/styles/fabric.css +12 -0
  27. package/styles/fluent-dark.css +12 -0
  28. package/styles/fluent.css +12 -0
  29. package/styles/highcontrast-light.css +12 -0
  30. package/styles/highcontrast.css +12 -0
  31. package/styles/image-editor/_bootstrap-dark-definition.scss +1 -0
  32. package/styles/image-editor/_bootstrap-definition.scss +1 -0
  33. package/styles/image-editor/_bootstrap4-definition.scss +1 -0
  34. package/styles/image-editor/_bootstrap5-definition.scss +1 -0
  35. package/styles/image-editor/_fabric-dark-definition.scss +1 -0
  36. package/styles/image-editor/_fabric-definition.scss +1 -0
  37. package/styles/image-editor/_fluent-definition.scss +1 -0
  38. package/styles/image-editor/_fusionnew-definition.scss +1 -0
  39. package/styles/image-editor/_highcontrast-definition.scss +1 -0
  40. package/styles/image-editor/_highcontrast-light-definition.scss +1 -0
  41. package/styles/image-editor/_layout.scss +32 -2
  42. package/styles/image-editor/_material-dark-definition.scss +1 -0
  43. package/styles/image-editor/_material-definition.scss +1 -0
  44. package/styles/image-editor/_material3-definition.scss +3 -2
  45. package/styles/image-editor/_tailwind-definition.scss +1 -0
  46. package/styles/image-editor/bootstrap-dark.css +12 -0
  47. package/styles/image-editor/bootstrap.css +12 -0
  48. package/styles/image-editor/bootstrap4.css +12 -0
  49. package/styles/image-editor/bootstrap5-dark.css +12 -0
  50. package/styles/image-editor/bootstrap5.css +12 -0
  51. package/styles/image-editor/fabric-dark.css +12 -0
  52. package/styles/image-editor/fabric.css +12 -0
  53. package/styles/image-editor/fluent-dark.css +12 -0
  54. package/styles/image-editor/fluent.css +12 -0
  55. package/styles/image-editor/highcontrast-light.css +12 -0
  56. package/styles/image-editor/highcontrast.css +12 -0
  57. package/styles/image-editor/material-dark.css +12 -0
  58. package/styles/image-editor/material.css +12 -0
  59. package/styles/image-editor/material3-dark.css +25 -4
  60. package/styles/image-editor/material3.css +25 -4
  61. package/styles/image-editor/tailwind-dark.css +15 -2
  62. package/styles/image-editor/tailwind.css +15 -2
  63. package/styles/material-dark.css +12 -0
  64. package/styles/material.css +12 -0
  65. package/styles/material3-dark.css +25 -4
  66. package/styles/material3.css +25 -4
  67. package/styles/tailwind-dark.css +15 -2
  68. package/styles/tailwind.css +15 -2
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 24.1.46
3
+ * version : 24.2.4
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@24.1.45",
3
+ "_id": "@syncfusion/ej2-image-editor@24.2.3",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-L6K4uBYzGVCFUOgvEBYTgJFZXd2YDqvFlb+hy0geiD7n9JJ2i0FRE2XOzIT0MLBYc6RTuprudJGQgyu0kaKViw==",
5
+ "_integrity": "sha512-x7X5T7QWtkwuBvlw/q4onn7aeCQicWEgLU1fPCIGcP0vYnhVMjHPBmY9kPgQK8N/pjElzq5eUC+p3p/Jz1BM4A==",
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.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-24.1.45.tgz",
27
- "_shasum": "4e8eb2b7fb3f41116f67093c42aedf64ad3e2ad4",
26
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-24.2.3.tgz",
27
+ "_shasum": "6e263c7f3a9becf2f533dddbaf18e4d26cd2dac0",
28
28
  "_spec": "@syncfusion/ej2-image-editor@*",
29
29
  "_where": "/jenkins/workspace/elease-automation_release_24.1.1/packages/included",
30
30
  "author": {
@@ -32,12 +32,12 @@
32
32
  },
33
33
  "bundleDependencies": false,
34
34
  "dependencies": {
35
- "@syncfusion/ej2-base": "~24.1.46",
36
- "@syncfusion/ej2-buttons": "~24.1.46",
37
- "@syncfusion/ej2-inputs": "~24.1.45",
38
- "@syncfusion/ej2-navigations": "~24.1.46",
39
- "@syncfusion/ej2-popups": "~24.1.46",
40
- "@syncfusion/ej2-splitbuttons": "~24.1.46"
35
+ "@syncfusion/ej2-base": "~24.2.3",
36
+ "@syncfusion/ej2-buttons": "~24.2.3",
37
+ "@syncfusion/ej2-inputs": "~24.2.4",
38
+ "@syncfusion/ej2-navigations": "~24.2.4",
39
+ "@syncfusion/ej2-popups": "~24.2.3",
40
+ "@syncfusion/ej2-splitbuttons": "~24.2.3"
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": "24.1.46",
70
+ "version": "24.2.4",
71
71
  "sideEffects": false,
72
72
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
73
73
  }
@@ -3877,6 +3877,9 @@ var Draw = /** @class */ (function () {
3877
3877
  if (lastDotIndex !== -1) {
3878
3878
  return url.slice(lastDotIndex + 1).toLowerCase();
3879
3879
  }
3880
+ else if (url.indexOf('base64') !== -1) {
3881
+ return url.slice(url.indexOf('/') + 1, url.indexOf(';')).toLowerCase();
3882
+ }
3880
3883
  return null;
3881
3884
  };
3882
3885
  Draw.prototype.fileSelect = function (inputElement, args) {
@@ -43,6 +43,7 @@ export declare class Selection {
43
43
  private isImageClarity;
44
44
  private isPinching;
45
45
  private isSliding;
46
+ private mouseDown;
46
47
  constructor(parent: ImageEditor);
47
48
  destroy(): void;
48
49
  private addEventListener;
@@ -34,6 +34,7 @@ var Selection = /** @class */ (function () {
34
34
  this.isImageClarity = true;
35
35
  this.isPinching = false;
36
36
  this.isSliding = false;
37
+ this.mouseDown = '';
37
38
  this.parent = parent;
38
39
  this.addEventListener();
39
40
  }
@@ -322,6 +323,7 @@ var Selection = /** @class */ (function () {
322
323
  this.currentDrawingShape = '';
323
324
  this.initialPrevObj = {};
324
325
  this.resizedElement = '';
326
+ this.mouseDown = '';
325
327
  };
326
328
  Selection.prototype.performTabAction = function () {
327
329
  var parent = this.parent;
@@ -2740,6 +2742,8 @@ var Selection = /** @class */ (function () {
2740
2742
  Selection.prototype.mouseDownEventHandler = function (e) {
2741
2743
  var _this = this;
2742
2744
  var parent = this.parent;
2745
+ this.mouseDown = e.currentTarget === parent.lowerCanvas || e.currentTarget === parent.upperCanvas ?
2746
+ 'canvas' : '';
2743
2747
  if (e.type === 'touchstart') {
2744
2748
  this.isTouch = true;
2745
2749
  }
@@ -3177,6 +3181,10 @@ var Selection = /** @class */ (function () {
3177
3181
  && !parent.element.querySelector('#' + id + '_headWrapper').parentElement.classList.contains('e-hide')))) {
3178
3182
  return;
3179
3183
  }
3184
+ else if (e.currentTarget === document && this.mouseDown === '') {
3185
+ e.stopImmediatePropagation();
3186
+ return;
3187
+ }
3180
3188
  if (e.type === 'touchstart') {
3181
3189
  this.isTouch = false;
3182
3190
  }
@@ -3298,13 +3306,13 @@ var Selection = /** @class */ (function () {
3298
3306
  if (this.currentDrawingShape === 'text') {
3299
3307
  var prevCropObj_1 = extend({}, parent.cropObj, {}, true);
3300
3308
  parent.notify('undo-redo', { prop: 'updateUndoRedoColl', onPropertyChange: false,
3301
- value: { operation: 'shapeTransform', previousObj: this.initialPrevObj, previousObjColl: this.initialPrevObj.objColl,
3309
+ value: { operation: 'shapeInsert', previousObj: this.initialPrevObj, previousObjColl: this.initialPrevObj.objColl,
3302
3310
  previousPointColl: this.initialPrevObj.pointColl, previousSelPointColl: this.initialPrevObj.selPointColl,
3303
3311
  previousCropObj: prevCropObj_1, previousText: null,
3304
3312
  currentText: null, previousFilter: null, isCircleCrop: null } });
3305
3313
  }
3306
3314
  else {
3307
- parent.notify('undo-redo', { prop: 'updateUrObj', onPropertyChange: false, value: { objColl: this.initialPrevObj.objColl } });
3315
+ parent.notify('undo-redo', { prop: 'updateUrObj', onPropertyChange: false, value: { objColl: this.initialPrevObj.objColl, operation: 'shapeInsert' } });
3308
3316
  }
3309
3317
  this.isShapeInserted = true;
3310
3318
  this.currentDrawingShape = '';
@@ -3436,6 +3444,7 @@ var Selection = /** @class */ (function () {
3436
3444
  parent.currObjType.shape = '';
3437
3445
  }
3438
3446
  this.dragElement = '';
3447
+ this.mouseDown = '';
3439
3448
  parent.currObjType.isInitialLine = parent.currObjType.isDragging = false;
3440
3449
  this.selMouseUpEvent();
3441
3450
  };
@@ -451,7 +451,7 @@ var Shape = /** @class */ (function () {
451
451
  parent.notify('selection', { prop: 'isShapeInserted', onPropertyChange: false, value: { bool: true } });
452
452
  parent.notify('undo-redo', { prop: 'updateUrObj', onPropertyChange: false, value: { objColl: objColl_1 } });
453
453
  if (parent.isPublicMethod) {
454
- parent.notify('undo-redo', { prop: 'updateUndoRedo', onPropertyChange: false });
454
+ parent.notify('undo-redo', { prop: 'updateUndoRedo', value: { operation: 'shapeInsert' }, onPropertyChange: false });
455
455
  }
456
456
  parent.isPublicMethod = false;
457
457
  });
@@ -477,7 +477,7 @@ var Shape = /** @class */ (function () {
477
477
  isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
478
478
  parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
479
479
  if (parent.isPublicMethod) {
480
- parent.notify('undo-redo', { prop: 'updateUndoRedo', onPropertyChange: false });
480
+ parent.notify('undo-redo', { prop: 'updateUndoRedo', value: { operation: 'shapeInsert' }, onPropertyChange: false });
481
481
  }
482
482
  parent.isPublicMethod = false;
483
483
  }
@@ -575,7 +575,7 @@ var Shape = /** @class */ (function () {
575
575
  parent.dotNetRef.invokeMethodAsync('ShapeEventAsync', 'OnShape', shapeChangingArgs, null).then(function (shapeChangingArgs) {
576
576
  _this.drawShapeTextEvent(shapeChangingArgs);
577
577
  if (parent.isPublicMethod) {
578
- parent.notify('undo-redo', { prop: 'updateUndoRedo', onPropertyChange: false });
578
+ parent.notify('undo-redo', { prop: 'updateUndoRedo', value: { operation: 'shapeInsert' }, onPropertyChange: false });
579
579
  }
580
580
  parent.isPublicMethod = false;
581
581
  });
@@ -584,7 +584,7 @@ var Shape = /** @class */ (function () {
584
584
  parent.trigger('shapeChanging', shapeChangingArgs);
585
585
  this.drawShapeTextEvent(shapeChangingArgs);
586
586
  if (parent.isPublicMethod) {
587
- parent.notify('undo-redo', { prop: 'updateUndoRedo', onPropertyChange: false });
587
+ parent.notify('undo-redo', { prop: 'updateUndoRedo', value: { operation: 'shapeInsert' }, onPropertyChange: false });
588
588
  }
589
589
  parent.isPublicMethod = false;
590
590
  }
@@ -597,7 +597,7 @@ var Shape = /** @class */ (function () {
597
597
  parent.objColl.push(parent.activeObj);
598
598
  var prevCropObj = extend({}, parent.cropObj, {}, true);
599
599
  parent.notify('undo-redo', { prop: 'updateUndoRedoColl', onPropertyChange: false,
600
- value: { operation: 'shapeTransform', previousObj: this.prevObj, previousObjColl: this.prevObj.objColl,
600
+ value: { operation: 'shapeInsert', previousObj: this.prevObj, previousObjColl: this.prevObj.objColl,
601
601
  previousPointColl: this.prevObj.pointColl, previousSelPointColl: this.prevObj.selPointColl, previousCropObj: prevCropObj,
602
602
  previousText: null, currentText: null, previousFilter: null, isCircleCrop: null } });
603
603
  parent.notify('selection', { prop: 'redrawShape', onPropertyChange: false,
@@ -628,7 +628,7 @@ var Shape = /** @class */ (function () {
628
628
  parent.objColl.push(parent.activeObj);
629
629
  var prevCropObj = extend({}, parent.cropObj, {}, true);
630
630
  parent.notify('undo-redo', { prop: 'updateUndoRedoColl', onPropertyChange: false,
631
- value: { operation: 'shapeTransform', previousObj: this.prevObj, previousObjColl: this.prevObj.objColl,
631
+ value: { operation: 'shapeInsert', previousObj: this.prevObj, previousObjColl: this.prevObj.objColl,
632
632
  previousPointColl: this.prevObj.pointColl, previousSelPointColl: this.prevObj.selPointColl,
633
633
  previousCropObj: prevCropObj, previousText: null, currentText: null, previousFilter: null, isCircleCrop: null } });
634
634
  parent.notify('selection', { prop: 'redrawShape', onPropertyChange: false,
@@ -38,6 +38,7 @@ export declare class UndoRedo {
38
38
  private updateTextBox;
39
39
  private undoDefault;
40
40
  private endUndoRedo;
41
+ private getImageAction;
41
42
  private updateUrc;
42
43
  private updateUrObj;
43
44
  private updateUndoRedo;
@@ -57,10 +57,10 @@ var UndoRedo = /** @class */ (function () {
57
57
  this.redo();
58
58
  break;
59
59
  case 'updateUrObj':
60
- this.updateUrObj(args.value['objColl']);
60
+ this.updateUrObj(args.value['objColl'], args.value['operation']);
61
61
  break;
62
62
  case 'updateUndoRedo':
63
- this.updateUndoRedo();
63
+ this.updateUndoRedo(args.value ? args.value['operation'] : null);
64
64
  break;
65
65
  case 'getAppliedUndoRedoColl':
66
66
  args.value['obj']['appliedUndoRedoColl'] = this.appliedUndoRedoColl;
@@ -267,6 +267,7 @@ var UndoRedo = /** @class */ (function () {
267
267
  UndoRedo.prototype.undo = function () {
268
268
  var parent = this.parent;
269
269
  this.cancelCropSelection();
270
+ parent.notify('draw', { prop: 'resetFrameZoom', onPropertyChange: false, value: { isOk: false } });
270
271
  if (!parent.disabled && parent.isImageLoaded) {
271
272
  if (this.undoRedoStep > 0) {
272
273
  this.refreshToolbarActions();
@@ -327,6 +328,7 @@ var UndoRedo = /** @class */ (function () {
327
328
  case 'invert':
328
329
  case 'sharpen':
329
330
  case 'imageRotate':
331
+ case 'shapeInsert':
330
332
  this.shapeTransform(obj.previousObjColl);
331
333
  break;
332
334
  case 'freehanddraw':
@@ -404,6 +406,7 @@ var UndoRedo = /** @class */ (function () {
404
406
  UndoRedo.prototype.redo = function () {
405
407
  var parent = this.parent;
406
408
  this.cancelCropSelection();
409
+ parent.notify('draw', { prop: 'resetFrameZoom', onPropertyChange: false, value: { isOk: false } });
407
410
  if (!parent.disabled && parent.isImageLoaded) {
408
411
  if (this.undoRedoStep < this.appliedUndoRedoColl.length) {
409
412
  this.refreshToolbarActions();
@@ -460,6 +463,7 @@ var UndoRedo = /** @class */ (function () {
460
463
  case 'invert':
461
464
  case 'sharpen':
462
465
  case 'imageRotate':
466
+ case 'shapeInsert':
463
467
  this.shapeTransform(obj.currentObjColl);
464
468
  break;
465
469
  case 'freehanddraw':
@@ -797,6 +801,37 @@ var UndoRedo = /** @class */ (function () {
797
801
  }
798
802
  parent.notify('filter', { prop: 'setAdjustmentValue', onPropertyChange: false, value: { adjustmentValue: this.lowerContext.filter } });
799
803
  parent.currObjType.isCustomCrop = false;
804
+ if (isBlazor() && parent.events && parent.events.historyChanged.hasDelegate === true) {
805
+ var imageAction = this.getImageAction(operation);
806
+ var args = { length: this.undoRedoColl.length, index: this.undoRedoStep, actionTrigger: isUndo ? 'Undo' : 'Redo', imageAction: imageAction };
807
+ parent.dotNetRef.invokeMethodAsync('OnHistoryChangedAsync', args);
808
+ }
809
+ };
810
+ UndoRedo.prototype.getImageAction = function (operation) {
811
+ if (['brightness', 'contrast', 'saturation', 'opacity', 'blur', 'hue'].indexOf(operation) !== -1) {
812
+ return 'FinetuneApplied';
813
+ }
814
+ else if (['chrome', 'cold', 'warm', 'grayscale', 'blackandwhite', 'sepia', 'invert'].indexOf(operation) !== -1) {
815
+ return 'FilterApplied';
816
+ }
817
+ else if (operation === 'frame') {
818
+ return 'FrameApplied';
819
+ }
820
+ else if (operation === 'resize') {
821
+ return 'ImageResized';
822
+ }
823
+ else if (['deleteFreehandDrawing', 'deleteObj'].indexOf(operation) !== -1) {
824
+ return 'ShapeDeleted';
825
+ }
826
+ else if (operation === 'crop') {
827
+ return 'Cropped';
828
+ }
829
+ else if (['shapeInsert', 'freehanddraw', 'freehand-draw'].indexOf(operation) !== -1) {
830
+ return 'ShapeInserted';
831
+ }
832
+ else {
833
+ return 'ShapeCustomized';
834
+ }
800
835
  };
801
836
  UndoRedo.prototype.updateUrc = function (operation, previousObj, previousObjColl, previousPointColl, previousSelPointColl, previousCropObj, previousText, currentText, previousFilter, isCircleCrop) {
802
837
  var parent = this.parent;
@@ -864,7 +899,7 @@ var UndoRedo = /** @class */ (function () {
864
899
  }
865
900
  }
866
901
  };
867
- UndoRedo.prototype.updateUrObj = function (objColl) {
902
+ UndoRedo.prototype.updateUrObj = function (objColl, operation) {
868
903
  var parent = this.parent;
869
904
  if (parent.allowUndoRedo) {
870
905
  if (parent.currObjType.isUndoAction) {
@@ -885,7 +920,8 @@ var UndoRedo = /** @class */ (function () {
885
920
  parent.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false,
886
921
  value: { obj: selPointCollObj } });
887
922
  obj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
888
- this.undoRedoColl.push({ operation: 'shapeTransform', previousObj: obj, currentObj: obj,
923
+ var oper = operation ? operation : 'shapeTransform';
924
+ this.undoRedoColl.push({ operation: oper, previousObj: obj, currentObj: obj,
889
925
  previousObjColl: objColl, currentObjColl: obj.objColl,
890
926
  previousPointColl: obj.pointColl, currentPointColl: obj.pointColl,
891
927
  previousSelPointColl: obj.selPointColl, currentSelPointColl: obj.selPointColl,
@@ -894,7 +930,7 @@ var UndoRedo = /** @class */ (function () {
894
930
  value: { obj: parent.objColl[parent.objColl.length - 1] } });
895
931
  }
896
932
  };
897
- UndoRedo.prototype.updateUndoRedo = function () {
933
+ UndoRedo.prototype.updateUndoRedo = function (operation) {
898
934
  var parent = this.parent;
899
935
  var prevCropObj = extend({}, parent.cropObj, {}, true);
900
936
  var object = { currObj: {} };
@@ -911,7 +947,8 @@ var UndoRedo = /** @class */ (function () {
911
947
  parent.notify('shape', { prop: 'updImgRatioForActObj', onPropertyChange: false });
912
948
  }
913
949
  parent.objColl.push(parent.activeObj);
914
- this.updateUrc('shapeTransform', prevObj, prevObj.objColl, prevObj.pointColl, prevObj.selPointColl, prevCropObj);
950
+ var oper = operation ? operation : 'shapeTransform';
951
+ this.updateUrc(oper, prevObj, prevObj.objColl, prevObj.pointColl, prevObj.selPointColl, prevCropObj);
915
952
  parent.objColl.pop();
916
953
  parent.notify('shape', { prop: 'applyActObj', onPropertyChange: false, value: { isMouseDown: null } });
917
954
  parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
@@ -136,5 +136,9 @@ export declare class ToolbarModule {
136
136
  private refreshMainToolbar;
137
137
  private destroySubComponents;
138
138
  private setInitialShapeSettings;
139
+ private isToolbarString;
140
+ private excludeItems;
141
+ private isSameIndex;
142
+ private getIndex;
139
143
  getModuleName(): string;
140
144
  }
@@ -1665,7 +1665,13 @@ var ToolbarModule = /** @class */ (function () {
1665
1665
  var args = { toolbarType: parent.activeObj.shape ? parent.activeObj.shape : 'shapes',
1666
1666
  toolbarItems: this.defToolbarItems };
1667
1667
  parent.trigger('toolbarUpdating', args);
1668
- this.defToolbarItems = args.toolbarItems;
1668
+ if (this.isToolbarString(args.toolbarItems)) {
1669
+ items = args.toolbarItems;
1670
+ this.excludeItems(args.toolbarItems);
1671
+ }
1672
+ else {
1673
+ this.defToolbarItems = args.toolbarItems;
1674
+ }
1669
1675
  var toolbar = new Toolbar({
1670
1676
  width: '100%',
1671
1677
  items: this.defToolbarItems,
@@ -1675,8 +1681,12 @@ var ToolbarModule = /** @class */ (function () {
1675
1681
  _this.createShapeColor(items);
1676
1682
  _this.createShapeBtn(items);
1677
1683
  if (parent.activeObj.shape === 'arrow') {
1678
- _this.createStartBtn();
1679
- _this.createEndBtn();
1684
+ if (items.some(function (item) { return item.toLowerCase().indexOf('start') > -1; })) {
1685
+ _this.createStartBtn();
1686
+ }
1687
+ if (items.some(function (item) { return item.toLowerCase().indexOf('end') > -1; })) {
1688
+ _this.createEndBtn();
1689
+ }
1680
1690
  }
1681
1691
  _this.wireZoomBtnEvents();
1682
1692
  if (!Browser.isDevice) {
@@ -1840,24 +1850,24 @@ var ToolbarModule = /** @class */ (function () {
1840
1850
  ToolbarModule.prototype.createShapeBtn = function (items) {
1841
1851
  var parent = this.parent;
1842
1852
  var id = parent.element.id;
1843
- var strokeWidthItems = [
1844
- { id: '1', text: this.l10n.getConstant('XSmall') },
1845
- { id: '2', text: this.l10n.getConstant('Small') },
1846
- { id: '3', text: this.l10n.getConstant('Medium') },
1847
- { id: '4', text: this.l10n.getConstant('Large') },
1848
- { id: '5', text: this.l10n.getConstant('XLarge') }
1849
- ];
1850
- if (parent.activeObj.shape && (parent.activeObj.shape === 'rectangle' || parent.activeObj.shape === 'ellipse')) {
1851
- strokeWidthItems = [
1852
- { id: '1', text: this.l10n.getConstant('NoOutline') },
1853
- { id: '2', text: this.l10n.getConstant('XSmall') },
1854
- { id: '3', text: this.l10n.getConstant('Small') },
1855
- { id: '4', text: this.l10n.getConstant('Medium') },
1856
- { id: '5', text: this.l10n.getConstant('Large') },
1857
- { id: '6', text: this.l10n.getConstant('XLarge') }
1858
- ];
1859
- }
1860
1853
  if (items.indexOf('strokeWidth') > -1) {
1854
+ var strokeWidthItems = [
1855
+ { id: '1', text: this.l10n.getConstant('XSmall') },
1856
+ { id: '2', text: this.l10n.getConstant('Small') },
1857
+ { id: '3', text: this.l10n.getConstant('Medium') },
1858
+ { id: '4', text: this.l10n.getConstant('Large') },
1859
+ { id: '5', text: this.l10n.getConstant('XLarge') }
1860
+ ];
1861
+ if (parent.activeObj.shape && (parent.activeObj.shape === 'rectangle' || parent.activeObj.shape === 'ellipse')) {
1862
+ strokeWidthItems = [
1863
+ { id: '1', text: this.l10n.getConstant('NoOutline') },
1864
+ { id: '2', text: this.l10n.getConstant('XSmall') },
1865
+ { id: '3', text: this.l10n.getConstant('Small') },
1866
+ { id: '4', text: this.l10n.getConstant('Medium') },
1867
+ { id: '5', text: this.l10n.getConstant('Large') },
1868
+ { id: '6', text: this.l10n.getConstant('XLarge') }
1869
+ ];
1870
+ }
1861
1871
  var strokeWidthBtn = document.getElementById(id + '_borderWidthBtn');
1862
1872
  var spanElem_1 = document.createElement('span');
1863
1873
  spanElem_1.innerHTML = this.l10n.getConstant('XSmall');
@@ -2074,7 +2084,13 @@ var ToolbarModule = /** @class */ (function () {
2074
2084
  }
2075
2085
  var args = { toolbarType: 'text', toolbarItems: this.defToolbarItems };
2076
2086
  parent.trigger('toolbarUpdating', args);
2077
- this.defToolbarItems = args.toolbarItems;
2087
+ if (this.isToolbarString(args.toolbarItems)) {
2088
+ items = args.toolbarItems;
2089
+ this.excludeItems(args.toolbarItems);
2090
+ }
2091
+ else {
2092
+ this.defToolbarItems = args.toolbarItems;
2093
+ }
2078
2094
  var toolbar = new Toolbar({
2079
2095
  width: '100%',
2080
2096
  items: this.defToolbarItems,
@@ -2560,7 +2576,8 @@ var ToolbarModule = /** @class */ (function () {
2560
2576
  template: '<button id="' + id + '_penColorBtn"></button>' });
2561
2577
  }
2562
2578
  if (items.indexOf('strokeWidth') > -1) {
2563
- toolbarItems.push({ prefixIcon: 'e-icons e-copy', cssClass: 'top-icon e-size',
2579
+ toolbarItems.push({ prefixIcon: 'e-icons e-copy', id: id + '_pen_strokewidth',
2580
+ cssClass: 'top-icon e-size',
2564
2581
  tooltipText: this.l10n.getConstant('StrokeWidth'),
2565
2582
  align: 'Center', type: 'Input', template: '<button id="' + id + '_penStrokeWidth"></button>' });
2566
2583
  }
@@ -2597,7 +2614,13 @@ var ToolbarModule = /** @class */ (function () {
2597
2614
  }
2598
2615
  var args = { toolbarType: 'pen', toolbarItems: this.defToolbarItems };
2599
2616
  parent.trigger('toolbarUpdating', args);
2600
- this.defToolbarItems = args.toolbarItems;
2617
+ if (this.isToolbarString(args.toolbarItems)) {
2618
+ items = args.toolbarItems;
2619
+ this.excludeItems(args.toolbarItems);
2620
+ }
2621
+ else {
2622
+ this.defToolbarItems = args.toolbarItems;
2623
+ }
2601
2624
  var toolbar = new Toolbar({
2602
2625
  width: '100%',
2603
2626
  items: this.defToolbarItems,
@@ -3739,6 +3762,8 @@ var ToolbarModule = /** @class */ (function () {
3739
3762
  var ctx = void 0;
3740
3763
  parent.notify('draw', { prop: 'getNewPath', value: { obj: pathObject } });
3741
3764
  var type = args.item.id.replace(id + '_', '').toLowerCase();
3765
+ var left = void 0;
3766
+ var right = void 0;
3742
3767
  switch (type) {
3743
3768
  case 'duplicate':
3744
3769
  if (!parent.element.querySelector('#' + id + '_duplicate').classList.contains('e-disabled')) {
@@ -3788,8 +3813,10 @@ var ToolbarModule = /** @class */ (function () {
3788
3813
  break;
3789
3814
  case 'rotleft':
3790
3815
  case 'rotright':
3791
- if (!parent.element.querySelector('#' + id + '_rotLeft').classList.contains('e-disabled') ||
3792
- !parent.element.querySelector('#' + id + '_rotRight').classList.contains('e-disabled')) {
3816
+ left = parent.element.querySelector('#' + id + '_rotLeft');
3817
+ right = parent.element.querySelector('#' + id + '_rotRight');
3818
+ if ((left && !left.classList.contains('e-disabled')) ||
3819
+ (right && !right.classList.contains('e-disabled'))) {
3793
3820
  parent.rotateImage(args.item.id.replace(id + '_', '').toLowerCase());
3794
3821
  }
3795
3822
  break;
@@ -4919,6 +4946,80 @@ var ToolbarModule = /** @class */ (function () {
4919
4946
  parent.activeObj.textFlip = parent.transform.currFlipState;
4920
4947
  parent.activeObj.flipObjColl = [];
4921
4948
  };
4949
+ ToolbarModule.prototype.isToolbarString = function (items) {
4950
+ var isString = false;
4951
+ for (var i = 0; i < items.length; i++) {
4952
+ if (typeof (items[i]) === 'string') {
4953
+ isString = true;
4954
+ break;
4955
+ }
4956
+ }
4957
+ return isString;
4958
+ };
4959
+ ToolbarModule.prototype.excludeItems = function (items) {
4960
+ var indexArr = [];
4961
+ for (var i = 0; i < items.length; i++) {
4962
+ var index = this.getIndex(items[i]);
4963
+ if (index !== -1) {
4964
+ indexArr.push(index);
4965
+ }
4966
+ }
4967
+ var negativeIndexArr = [];
4968
+ for (var i = 0; i < this.defToolbarItems.length; i++) {
4969
+ if (this.defToolbarItems[i].align === 'Center' && !this.isSameIndex(indexArr, i) &&
4970
+ this.defToolbarItems[i].id !== this.parent.element.id + '_' + 'annotation') {
4971
+ negativeIndexArr.push(i);
4972
+ }
4973
+ }
4974
+ for (var i = negativeIndexArr.length - 1; i >= 0; i--) {
4975
+ this.defToolbarItems.splice(negativeIndexArr[i], 1);
4976
+ }
4977
+ };
4978
+ ToolbarModule.prototype.isSameIndex = function (indexArr, index) {
4979
+ for (var i = 0; i < indexArr.length; i++) {
4980
+ if (indexArr[i] === index) {
4981
+ return true;
4982
+ }
4983
+ }
4984
+ return false;
4985
+ };
4986
+ ToolbarModule.prototype.getIndex = function (item) {
4987
+ var index = -1;
4988
+ var isFontColor = false;
4989
+ if (item === 'rotateLeft') {
4990
+ item = 'rotLeft';
4991
+ }
4992
+ if (item === 'rotateRight') {
4993
+ item = 'rotRight';
4994
+ }
4995
+ if (item === 'horizontalFlip') {
4996
+ item = 'hflip';
4997
+ }
4998
+ if (item === 'verticalFlip') {
4999
+ item = 'vflip';
5000
+ }
5001
+ if (item === 'arrowStart') {
5002
+ item = 'start';
5003
+ }
5004
+ if (item === 'arrowEnd') {
5005
+ item = 'end';
5006
+ }
5007
+ if (item === 'fontColor') {
5008
+ item = 'strokeColor';
5009
+ isFontColor = true;
5010
+ }
5011
+ for (var i = 0; i < this.defToolbarItems.length; i++) {
5012
+ var id = this.defToolbarItems[i].id;
5013
+ if (id && id.toLowerCase().indexOf(item.toLowerCase()) !== -1) {
5014
+ index = i;
5015
+ break;
5016
+ }
5017
+ }
5018
+ if (isFontColor) {
5019
+ item = 'fontColor';
5020
+ }
5021
+ return index;
5022
+ };
4922
5023
  ToolbarModule.prototype.getModuleName = function () {
4923
5024
  return 'toolbar-module';
4924
5025
  };
@@ -559,6 +559,18 @@
559
559
  margin-left: calc(50% - 80px) !important; /* stylelint-disable-line declaration-no-important */
560
560
  }
561
561
 
562
+ .e-device .e-transparency-slider-wrap {
563
+ top: calc(50% - 15px) !important; /* stylelint-disable-line declaration-no-important */
564
+ }
565
+
566
+ .e-device .e-ie-finetune-slider-wrap {
567
+ top: calc(50% - 15px) !important; /* stylelint-disable-line declaration-no-important */
568
+ }
569
+
570
+ .e-device .e-ie-slider-wrap {
571
+ top: calc(50% - 14px) !important; /* stylelint-disable-line declaration-no-important */
572
+ }
573
+
562
574
  .e-image-editor {
563
575
  background: #959595;
564
576
  }
@@ -559,6 +559,18 @@
559
559
  margin-left: calc(50% - 80px) !important; /* stylelint-disable-line declaration-no-important */
560
560
  }
561
561
 
562
+ .e-device .e-transparency-slider-wrap {
563
+ top: calc(50% - 15px) !important; /* stylelint-disable-line declaration-no-important */
564
+ }
565
+
566
+ .e-device .e-ie-finetune-slider-wrap {
567
+ top: calc(50% - 15px) !important; /* stylelint-disable-line declaration-no-important */
568
+ }
569
+
570
+ .e-device .e-ie-slider-wrap {
571
+ top: calc(50% - 14px) !important; /* stylelint-disable-line declaration-no-important */
572
+ }
573
+
562
574
  .e-image-editor {
563
575
  background: #e6e6e6;
564
576
  }
@@ -557,6 +557,18 @@
557
557
  margin-left: calc(50% - 80px) !important; /* stylelint-disable-line declaration-no-important */
558
558
  }
559
559
 
560
+ .e-device .e-transparency-slider-wrap {
561
+ top: calc(50% - 15px) !important; /* stylelint-disable-line declaration-no-important */
562
+ }
563
+
564
+ .e-device .e-ie-finetune-slider-wrap {
565
+ top: calc(50% - 15px) !important; /* stylelint-disable-line declaration-no-important */
566
+ }
567
+
568
+ .e-device .e-ie-slider-wrap {
569
+ top: calc(50% - 14px) !important; /* stylelint-disable-line declaration-no-important */
570
+ }
571
+
560
572
  .e-image-editor {
561
573
  background: #e9ecef;
562
574
  }
@@ -575,6 +575,18 @@
575
575
  margin-left: calc(50% - 80px) !important; /* stylelint-disable-line declaration-no-important */
576
576
  }
577
577
 
578
+ .e-device .e-transparency-slider-wrap {
579
+ top: calc(50% - 15px) !important; /* stylelint-disable-line declaration-no-important */
580
+ }
581
+
582
+ .e-device .e-ie-finetune-slider-wrap {
583
+ top: calc(50% - 15px) !important; /* stylelint-disable-line declaration-no-important */
584
+ }
585
+
586
+ .e-device .e-ie-slider-wrap {
587
+ top: calc(50% - 14px) !important; /* stylelint-disable-line declaration-no-important */
588
+ }
589
+
578
590
  .e-image-editor {
579
591
  background: #444c54;
580
592
  }
@@ -575,6 +575,18 @@
575
575
  margin-left: calc(50% - 80px) !important; /* stylelint-disable-line declaration-no-important */
576
576
  }
577
577
 
578
+ .e-device .e-transparency-slider-wrap {
579
+ top: calc(50% - 15px) !important; /* stylelint-disable-line declaration-no-important */
580
+ }
581
+
582
+ .e-device .e-ie-finetune-slider-wrap {
583
+ top: calc(50% - 15px) !important; /* stylelint-disable-line declaration-no-important */
584
+ }
585
+
586
+ .e-device .e-ie-slider-wrap {
587
+ top: calc(50% - 14px) !important; /* stylelint-disable-line declaration-no-important */
588
+ }
589
+
578
590
  .e-image-editor {
579
591
  background: #dee2e6;
580
592
  }