@syncfusion/ej2-image-editor 24.2.3 → 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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 24.2.3
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.46",
3
+ "_id": "@syncfusion/ej2-image-editor@24.2.3",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-9/5hBBSb3R+8NFqnUbJWiPyEKPjsvYL4JjtWl3Bf8qZqL7S87Do5qyBGdVB1/wayxOCVaBm8VZXeSf6acDwe6w==",
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.46.tgz",
27
- "_shasum": "b5346abb18e906d54d931cf017b6efed5449024c",
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": {
@@ -34,8 +34,8 @@
34
34
  "dependencies": {
35
35
  "@syncfusion/ej2-base": "~24.2.3",
36
36
  "@syncfusion/ej2-buttons": "~24.2.3",
37
- "@syncfusion/ej2-inputs": "~24.2.3",
38
- "@syncfusion/ej2-navigations": "~24.2.3",
37
+ "@syncfusion/ej2-inputs": "~24.2.4",
38
+ "@syncfusion/ej2-navigations": "~24.2.4",
39
39
  "@syncfusion/ej2-popups": "~24.2.3",
40
40
  "@syncfusion/ej2-splitbuttons": "~24.2.3"
41
41
  },
@@ -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.2.3",
70
+ "version": "24.2.4",
71
71
  "sideEffects": false,
72
72
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
73
73
  }
@@ -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
  }
@@ -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
  };
@@ -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();
@@ -405,6 +406,7 @@ var UndoRedo = /** @class */ (function () {
405
406
  UndoRedo.prototype.redo = function () {
406
407
  var parent = this.parent;
407
408
  this.cancelCropSelection();
409
+ parent.notify('draw', { prop: 'resetFrameZoom', onPropertyChange: false, value: { isOk: false } });
408
410
  if (!parent.disabled && parent.isImageLoaded) {
409
411
  if (this.undoRedoStep < this.appliedUndoRedoColl.length) {
410
412
  this.refreshToolbarActions();
@@ -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
  };