@syncfusion/ej2-image-editor 24.1.41 → 24.1.43

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.1.41
3
+ * version : 24.1.43
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@23.1.39",
3
+ "_id": "@syncfusion/ej2-image-editor@24.1.41",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-A4Of61l7lLJjbGwlAwN3KLeki8L3Bu7t1IK1qvQgfqxYobdIx3YFRnZFw3U1X+kGgCd2HGLfYkhdutrDIUt2GQ==",
5
+ "_integrity": "sha512-MS+zJMwrlarZxJ7zqkpd8RYmmZ1SWlmDSXcAqKN67/TQ0jRmkdWgfdoSQwCbD//aS9ggC+CtUa5v5kkTKONHVQ==",
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-release/@syncfusion/ej2-image-editor/-/ej2-image-editor-23.1.39.tgz",
27
- "_shasum": "d5a6acb85f2cb3d10a88ae4581e14b440fb04e06",
26
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-24.1.41.tgz",
27
+ "_shasum": "bfa6dc433fa0e25027f2b3e3c3ea78e138439793",
28
28
  "_spec": "@syncfusion/ej2-image-editor@*",
29
29
  "_where": "/jenkins/workspace/elease-automation_release_24.1.1/packages/included",
30
30
  "author": {
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "bundleDependencies": false,
34
34
  "dependencies": {
35
- "@syncfusion/ej2-base": "~24.1.41",
35
+ "@syncfusion/ej2-base": "~24.1.42",
36
36
  "@syncfusion/ej2-buttons": "~24.1.41",
37
37
  "@syncfusion/ej2-inputs": "~24.1.41",
38
38
  "@syncfusion/ej2-navigations": "~24.1.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.1.41",
70
+ "version": "24.1.43",
71
71
  "sideEffects": false,
72
72
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
73
73
  }
@@ -533,7 +533,7 @@ var Draw = /** @class */ (function () {
533
533
  var width;
534
534
  var height;
535
535
  var canvasWidth = parent.lowerCanvas.clientWidth;
536
- var canvasHeight = parent.lowerCanvas.clientHeight;
536
+ var canvasHeight = parent.lowerCanvas.clientHeight + 1;
537
537
  var _a = parent.img, destLeft = _a.destLeft, destTop = _a.destTop, destWidth = _a.destWidth, destHeight = _a.destHeight;
538
538
  if (parent.transform.zoomFactor > 0 && this.currSelPoint) {
539
539
  var activeObj = extend({}, parent.activeObj, {}, true);
@@ -2409,6 +2409,7 @@ var Draw = /** @class */ (function () {
2409
2409
  hideSpinner(parent.element);
2410
2410
  parent.element.style.opacity = '1';
2411
2411
  proxy.updateBaseImgCanvas();
2412
+ var fileOpened = { fileName: _this.fileName, fileType: _this.fileType, isValidImage: true };
2412
2413
  proxy.updateCanvas();
2413
2414
  if (parent.currObjType.isUndoZoom) {
2414
2415
  parent.currObjType.isUndoZoom = false;
@@ -2438,6 +2439,14 @@ var Draw = /** @class */ (function () {
2438
2439
  - parent.toolbarHeight * 2) - 1 + 'px';
2439
2440
  }
2440
2441
  }
2442
+ if (parent.isImageLoaded && parent.element.style.opacity !== '0.5') {
2443
+ if (isBlazor() && parent.events && parent.events.fileOpened.hasDelegate === true) {
2444
+ parent.dotNetRef.invokeMethodAsync('FileOpenEventAsync', 'FileOpened', fileOpened);
2445
+ }
2446
+ else {
2447
+ parent.trigger('fileOpened', fileOpened);
2448
+ }
2449
+ }
2441
2450
  };
2442
2451
  parent.baseImg.onerror = function () {
2443
2452
  hideSpinner(parent.element);
@@ -2463,7 +2472,6 @@ var Draw = /** @class */ (function () {
2463
2472
  };
2464
2473
  Draw.prototype.updateCanvas = function () {
2465
2474
  var parent = this.parent;
2466
- var fileOpened = { fileName: this.fileName, fileType: this.fileType, isValidImage: true };
2467
2475
  parent.img.srcWidth = parent.baseImgCanvas.width;
2468
2476
  parent.img.srcHeight = parent.baseImgCanvas.height;
2469
2477
  var obj = { width: 0, height: 0 };
@@ -2499,14 +2507,6 @@ var Draw = /** @class */ (function () {
2499
2507
  if (parent.disabled) {
2500
2508
  parent.element.setAttribute('class', 'e-disabled');
2501
2509
  }
2502
- if (parent.isImageLoaded && parent.element.style.opacity !== '0.5') {
2503
- if (isBlazor() && parent.events && parent.events.fileOpened.hasDelegate === true) {
2504
- parent.dotNetRef.invokeMethodAsync('FileOpenEventAsync', 'FileOpened', fileOpened);
2505
- }
2506
- else {
2507
- parent.trigger('fileOpened', fileOpened);
2508
- }
2509
- }
2510
2510
  if (parent.zoomSettings.zoomFactor !== 1 || parent.zoomSettings.zoomPoint) {
2511
2511
  parent.zoom(parent.zoomSettings.zoomFactor, parent.zoomSettings.zoomPoint);
2512
2512
  }
@@ -1878,12 +1878,14 @@ var Shape = /** @class */ (function () {
1878
1878
  return;
1879
1879
  }
1880
1880
  else if (e.type === 'dblclick') {
1881
+ var activeObj = extend({}, parent.activeObj, {}, true);
1881
1882
  var objColl = extend([], parent.objColl, [], true);
1882
1883
  var obj = { bool: null };
1883
1884
  parent.notify('selection', { prop: 'findTargetObj', onPropertyChange: false,
1884
1885
  value: { x: e.clientX, y: e.clientY, isCrop: false, obj: obj } });
1885
1886
  parent.objColl = objColl;
1886
1887
  if (!obj['bool'] || parent.activeObj.shape !== 'text') {
1888
+ parent.activeObj = extend({}, activeObj, {}, true);
1887
1889
  return;
1888
1890
  }
1889
1891
  }
@@ -2408,12 +2408,16 @@ var Transform = /** @class */ (function () {
2408
2408
  };
2409
2409
  Transform.prototype.straightenImage = function (degree) {
2410
2410
  var parent = this.parent;
2411
+ if (parent.toolbar && parent.toolbar.length === 0) {
2412
+ parent.notify('draw', { prop: 'select', onPropertyChange: false,
2413
+ value: { type: 'custom', startX: null, startY: null, width: null, height: null } });
2414
+ }
2411
2415
  if (isBlazor()) {
2412
2416
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
2413
2417
  parent.performCropClick();
2414
2418
  }
2415
2419
  else {
2416
- parent.notify('toolbar', { prop: 'performCropTransformClick' });
2420
+ parent.notify('toolbar', { prop: 'performCropTransformClick', value: { shape: null } });
2417
2421
  }
2418
2422
  parent.setStraighten(degree, true);
2419
2423
  if ((isBlazor() && parent.events && parent.events.straightening.hasDelegate === false) || !isBlazor()) {
@@ -1145,6 +1145,7 @@ var ImageEditor = /** @class */ (function (_super) {
1145
1145
  *
1146
1146
  */
1147
1147
  ImageEditor.prototype.select = function (type, startX, startY, width, height) {
1148
+ this.notify('toolbar', { prop: 'performCropTransformClick', value: { shape: 'crop-' + type } });
1148
1149
  this.notify('draw', { prop: 'select', onPropertyChange: false,
1149
1150
  value: { type: type, startX: startX, startY: startY, width: width, height: height } });
1150
1151
  this.notify('draw', { prop: 'select', onPropertyChange: false,
@@ -3335,7 +3336,8 @@ var ImageEditor = /** @class */ (function (_super) {
3335
3336
  this.initializeThemeColl();
3336
3337
  };
3337
3338
  ImageEditor.prototype.initializeZoomSettings = function () {
3338
- if (isNullOrUndefined(this.zoomSettings.zoomTrigger)) {
3339
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
3340
+ if (isNullOrUndefined(this.zoomSettings.zoomTrigger) || this.zoomSettings.zoomTrigger === 0) {
3339
3341
  this.zoomSettings.zoomTrigger = (ZoomTrigger.MouseWheel | ZoomTrigger.Pinch | ZoomTrigger.Toolbar | ZoomTrigger.Commands);
3340
3342
  }
3341
3343
  if (isNullOrUndefined(this.selectionSettings.strokeColor)) {
@@ -326,7 +326,7 @@ var ToolbarModule = /** @class */ (function () {
326
326
  this.frameToolbarClick();
327
327
  break;
328
328
  case 'performCropTransformClick':
329
- this.performCropTransformClick();
329
+ this.performCropTransformClick(args.value['shape']);
330
330
  break;
331
331
  case 'duplicateShape':
332
332
  this.duplicateShape(args.value['isPreventUndoRedo'], true);
@@ -520,6 +520,9 @@ var ToolbarModule = /** @class */ (function () {
520
520
  else {
521
521
  this.defToolbarItems = leftItem.concat(mainItem, rightItem, zoomItem);
522
522
  }
523
+ var args = { toolbarType: 'main', toolbarItems: this.defToolbarItems };
524
+ parent.trigger('toolbarUpdating', args);
525
+ this.defToolbarItems = args.toolbarItems;
523
526
  var toolbarObj = new Toolbar({
524
527
  width: '100%',
525
528
  items: this.defToolbarItems,
@@ -554,6 +557,9 @@ var ToolbarModule = /** @class */ (function () {
554
557
  var id = parent.element.id;
555
558
  if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.length > 0)) {
556
559
  var items = this.getMainToolbarItem();
560
+ var args = { toolbarType: 'bottom-toolbar', toolbarItems: items };
561
+ parent.trigger('toolbarUpdating', args);
562
+ items = args.toolbarItems;
557
563
  var toolbarObj = new Toolbar({ items: items, width: '100%',
558
564
  created: function () {
559
565
  _this.renderAnnotationBtn();
@@ -978,6 +984,9 @@ var ToolbarModule = /** @class */ (function () {
978
984
  else {
979
985
  this.defToolbarItems = leftItem.concat(zoomItem, mainItem, rightItem);
980
986
  }
987
+ var args = { toolbarType: 'resize', toolbarItems: this.defToolbarItems };
988
+ parent.trigger('toolbarUpdating', args);
989
+ this.defToolbarItems = args.toolbarItems;
981
990
  var toolbar = new Toolbar({
982
991
  width: '100%',
983
992
  items: this.defToolbarItems,
@@ -1279,7 +1288,7 @@ var ToolbarModule = /** @class */ (function () {
1279
1288
  }
1280
1289
  }
1281
1290
  };
1282
- ToolbarModule.prototype.renderCropBtn = function () {
1291
+ ToolbarModule.prototype.renderCropBtn = function (shapeString) {
1283
1292
  var _this = this;
1284
1293
  var parent = this.parent;
1285
1294
  var items = [];
@@ -1316,7 +1325,11 @@ var ToolbarModule = /** @class */ (function () {
1316
1325
  }
1317
1326
  var iconCss;
1318
1327
  var shape;
1319
- if (parent.activeObj.shape) {
1328
+ if (shapeString) {
1329
+ iconCss = this.getCurrentShapeIcon(shapeString);
1330
+ shape = shapeString;
1331
+ }
1332
+ else if (parent.activeObj.shape) {
1320
1333
  iconCss = this.getCurrentShapeIcon(parent.activeObj.shape);
1321
1334
  shape = parent.activeObj.shape;
1322
1335
  }
@@ -1526,7 +1539,7 @@ var ToolbarModule = /** @class */ (function () {
1526
1539
  }
1527
1540
  return toolbarItems;
1528
1541
  };
1529
- ToolbarModule.prototype.initCropTransformToolbar = function () {
1542
+ ToolbarModule.prototype.initCropTransformToolbar = function (shape) {
1530
1543
  var _this = this;
1531
1544
  var parent = this.parent;
1532
1545
  var id = parent.element.id;
@@ -1540,12 +1553,15 @@ var ToolbarModule = /** @class */ (function () {
1540
1553
  else {
1541
1554
  this.defToolbarItems = leftItem.concat(zoomItem, mainItem, rightItem);
1542
1555
  }
1556
+ var args = { toolbarType: 'crop-transform', toolbarItems: this.defToolbarItems };
1557
+ parent.trigger('toolbarUpdating', args);
1558
+ this.defToolbarItems = args.toolbarItems;
1543
1559
  var toolbar = new Toolbar({
1544
1560
  width: '100%',
1545
1561
  items: this.defToolbarItems,
1546
1562
  clicked: this.defToolbarClicked.bind(this),
1547
1563
  created: function () {
1548
- _this.renderCropBtn();
1564
+ _this.renderCropBtn(shape);
1549
1565
  _this.renderStraightenSlider();
1550
1566
  _this.wireZoomBtnEvents();
1551
1567
  if (!Browser.isDevice) {
@@ -1587,8 +1603,6 @@ var ToolbarModule = /** @class */ (function () {
1587
1603
  && slider && slider.parentElement.scrollHeight > this.toolbarHeight) {
1588
1604
  this.toolbarHeight = parent.toolbarHeight = slider.parentElement.scrollHeight;
1589
1605
  }
1590
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
1591
- toolbar.refreshOverflow();
1592
1606
  this.enableDisableTbrBtn();
1593
1607
  parent.notify('transform', { prop: 'disableZoomOutBtn', value: { isZoomOut: true } });
1594
1608
  };
@@ -1648,6 +1662,10 @@ var ToolbarModule = /** @class */ (function () {
1648
1662
  else {
1649
1663
  this.defToolbarItems = leftItem.concat(zoomItem, mainItem, rightItem);
1650
1664
  }
1665
+ var args = { toolbarType: parent.activeObj.shape ? parent.activeObj.shape : 'shapes',
1666
+ toolbarItems: this.defToolbarItems };
1667
+ parent.trigger('toolbarUpdating', args);
1668
+ this.defToolbarItems = args.toolbarItems;
1651
1669
  var toolbar = new Toolbar({
1652
1670
  width: '100%',
1653
1671
  items: this.defToolbarItems,
@@ -2054,6 +2072,9 @@ var ToolbarModule = /** @class */ (function () {
2054
2072
  else {
2055
2073
  this.defToolbarItems = leftItem.concat(zoomItem, mainItem, rightItem);
2056
2074
  }
2075
+ var args = { toolbarType: 'text', toolbarItems: this.defToolbarItems };
2076
+ parent.trigger('toolbarUpdating', args);
2077
+ this.defToolbarItems = args.toolbarItems;
2057
2078
  var toolbar = new Toolbar({
2058
2079
  width: '100%',
2059
2080
  items: this.defToolbarItems,
@@ -2178,8 +2199,10 @@ var ToolbarModule = /** @class */ (function () {
2178
2199
  else {
2179
2200
  fontFamily = parent.activeObj.textSettings.fontFamily;
2180
2201
  }
2181
- args.element.querySelector('[id *= ' + '"' + fontFamily.toLowerCase()
2182
- + '"' + ']').classList.add('e-selected-btn');
2202
+ var elem = args.element.querySelector('[id *= ' + '"' + fontFamily.toLowerCase() + '"' + ']');
2203
+ if (elem) {
2204
+ elem.classList.add('e-selected-btn');
2205
+ }
2183
2206
  },
2184
2207
  select: function (args) {
2185
2208
  spanElem_2.textContent = args.item.text;
@@ -2217,14 +2240,13 @@ var ToolbarModule = /** @class */ (function () {
2217
2240
  fontSizeBtn_1.appendTo('#' + id + '_fontSizeBtn');
2218
2241
  }
2219
2242
  };
2220
- ToolbarModule.prototype.refreshToolbar = function (type, isApplyBtn, isCropping, isZooming, cType) {
2243
+ ToolbarModule.prototype.refreshToolbar = function (type, isApplyBtn, isCropping, isZooming, cType, shape) {
2221
2244
  var parent = this.parent;
2222
2245
  var id = parent.element.id;
2223
2246
  if (!parent.isImageLoaded || parent.isCropToolbar) {
2224
2247
  return;
2225
2248
  }
2226
- var item = type === 'shapes' && parent.activeObj.shape ? parent.activeObj.shape : type;
2227
- var args = { toolbarType: item };
2249
+ var args = {};
2228
2250
  var aspectIcon;
2229
2251
  var nonAspectIcon;
2230
2252
  if (type !== 'filter' && type !== 'color') {
@@ -2290,7 +2312,6 @@ var ToolbarModule = /** @class */ (function () {
2290
2312
  else {
2291
2313
  args.toolbarItems = ['fillColor', 'strokeColor', 'strokeWidth', 'duplicate', 'remove'];
2292
2314
  }
2293
- parent.trigger('toolbarUpdating', args);
2294
2315
  this.initShapesToolbarItem(args.toolbarItems);
2295
2316
  break;
2296
2317
  case 'text':
@@ -2298,7 +2319,6 @@ var ToolbarModule = /** @class */ (function () {
2298
2319
  this.initMainToolbar(false, true, true);
2299
2320
  }
2300
2321
  args.toolbarItems = ['fontFamily', 'fontSize', 'fontColor', 'bold', 'italic', 'duplicate', 'remove', 'text'];
2301
- parent.trigger('toolbarUpdating', args);
2302
2322
  this.initTextToolbarItem(args.toolbarItems);
2303
2323
  break;
2304
2324
  case 'pen':
@@ -2306,7 +2326,6 @@ var ToolbarModule = /** @class */ (function () {
2306
2326
  this.initMainToolbar(false, true, true);
2307
2327
  }
2308
2328
  args.toolbarItems = ['strokeColor', 'strokeWidth', 'remove', 'transparency'];
2309
- parent.trigger('toolbarUpdating', args);
2310
2329
  this.initPenToolbarItem(args.toolbarItems);
2311
2330
  break;
2312
2331
  case 'adjustment':
@@ -2348,7 +2367,7 @@ var ToolbarModule = /** @class */ (function () {
2348
2367
  this.initMainToolbar(false, true, true);
2349
2368
  }
2350
2369
  parent.updateCropTransformItems();
2351
- this.initCropTransformToolbar();
2370
+ this.initCropTransformToolbar(shape);
2352
2371
  if (Browser.isDevice) {
2353
2372
  this.updateContextualToolbar('color', 'straighten', true);
2354
2373
  }
@@ -2375,7 +2394,7 @@ var ToolbarModule = /** @class */ (function () {
2375
2394
  this.currToolbar = type;
2376
2395
  this.refreshDropDownBtn(isCropping);
2377
2396
  };
2378
- ToolbarModule.prototype.performCropTransformClick = function () {
2397
+ ToolbarModule.prototype.performCropTransformClick = function (shape) {
2379
2398
  var parent = this.parent;
2380
2399
  parent.notify('draw', { prop: 'setTempStraightenZoomDeg' });
2381
2400
  parent.tempStraighten = parent.transform.straighten;
@@ -2383,7 +2402,7 @@ var ToolbarModule = /** @class */ (function () {
2383
2402
  parent.okBtn();
2384
2403
  }
2385
2404
  parent.isStraightening = true;
2386
- this.refreshToolbar('croptransform');
2405
+ this.refreshToolbar('croptransform', null, null, null, null, shape);
2387
2406
  parent.notify('draw', { prop: 'setDestForStraighten' });
2388
2407
  parent.notify('draw', { prop: 'setTempDestForStraighten' });
2389
2408
  };
@@ -2576,6 +2595,9 @@ var ToolbarModule = /** @class */ (function () {
2576
2595
  else {
2577
2596
  this.defToolbarItems = leftItem.concat(zoomItem, mainItem, rightItem);
2578
2597
  }
2598
+ var args = { toolbarType: 'pen', toolbarItems: this.defToolbarItems };
2599
+ parent.trigger('toolbarUpdating', args);
2600
+ this.defToolbarItems = args.toolbarItems;
2579
2601
  var toolbar = new Toolbar({
2580
2602
  width: '100%',
2581
2603
  items: this.defToolbarItems,
@@ -2744,6 +2766,9 @@ var ToolbarModule = /** @class */ (function () {
2744
2766
  else {
2745
2767
  this.defToolbarItems = leftItem.concat(zoomItem, mainItem, rightItem);
2746
2768
  }
2769
+ var args = { toolbarType: 'finetune', toolbarItems: this.defToolbarItems };
2770
+ parent.trigger('toolbarUpdating', args);
2771
+ this.defToolbarItems = args.toolbarItems;
2747
2772
  var toolbar = new Toolbar({
2748
2773
  width: '100%',
2749
2774
  items: this.defToolbarItems,
@@ -2795,6 +2820,9 @@ var ToolbarModule = /** @class */ (function () {
2795
2820
  styles: 'position: absolute'
2796
2821
  }));
2797
2822
  var mainItem = this.getFrameToolbarItem();
2823
+ var args = { toolbarType: 'frame', toolbarItems: mainItem };
2824
+ parent.trigger('toolbarUpdating', args);
2825
+ mainItem = args.toolbarItems;
2798
2826
  var toolbar = new Toolbar({
2799
2827
  width: '100%',
2800
2828
  items: mainItem,
@@ -3420,6 +3448,9 @@ var ToolbarModule = /** @class */ (function () {
3420
3448
  var parent = this.parent;
3421
3449
  var id = parent.element.id;
3422
3450
  var mainItem = this.getFilterToolbarItem();
3451
+ var args = { toolbarType: 'filter', toolbarItems: mainItem };
3452
+ parent.trigger('toolbarUpdating', args);
3453
+ mainItem = args.toolbarItems;
3423
3454
  if (document.querySelector('#' + id + '_contextualToolbar').classList.contains('e-control')) {
3424
3455
  getComponent(document.getElementById(id + '_contextualToolbar'), 'toolbar').destroy();
3425
3456
  }