@syncfusion/ej2-image-editor 24.1.41 → 24.1.44
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.
- package/CHANGELOG.md +16 -0
- package/README.md +1 -1
- package/dist/ej2-image-editor.umd.min.js +2 -2
- package/dist/ej2-image-editor.umd.min.js.map +1 -1
- package/dist/es6/ej2-image-editor.es2015.js +117 -54
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +114 -51
- package/dist/es6/ej2-image-editor.es5.js.map +1 -1
- package/dist/global/ej2-image-editor.min.js +2 -2
- package/dist/global/ej2-image-editor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +8 -8
- package/src/image-editor/action/draw.js +29 -26
- package/src/image-editor/action/selection.js +8 -0
- package/src/image-editor/action/shape.js +2 -0
- package/src/image-editor/action/transform.js +9 -5
- package/src/image-editor/action/undo-redo.js +11 -1
- package/src/image-editor/base/image-editor.js +3 -1
- package/src/image-editor/renderer/toolbar.js +52 -18
- package/styles/bootstrap-dark.css +9 -2
- package/styles/bootstrap.css +9 -2
- package/styles/bootstrap4.css +9 -2
- package/styles/bootstrap5-dark.css +9 -2
- package/styles/bootstrap5.css +9 -2
- package/styles/fabric-dark.css +9 -2
- package/styles/fabric.css +9 -2
- package/styles/fluent-dark.css +9 -2
- package/styles/fluent.css +9 -2
- package/styles/highcontrast-light.css +9 -2
- package/styles/highcontrast.css +9 -2
- package/styles/image-editor/_layout.scss +9 -6
- package/styles/image-editor/bootstrap-dark.css +9 -2
- package/styles/image-editor/bootstrap.css +9 -2
- package/styles/image-editor/bootstrap4.css +9 -2
- package/styles/image-editor/bootstrap5-dark.css +9 -2
- package/styles/image-editor/bootstrap5.css +9 -2
- package/styles/image-editor/fabric-dark.css +9 -2
- package/styles/image-editor/fabric.css +9 -2
- package/styles/image-editor/fluent-dark.css +9 -2
- package/styles/image-editor/fluent.css +9 -2
- package/styles/image-editor/highcontrast-light.css +9 -2
- package/styles/image-editor/highcontrast.css +9 -2
- package/styles/image-editor/material-dark.css +9 -2
- package/styles/image-editor/material.css +9 -2
- package/styles/image-editor/material3-dark.css +7 -2
- package/styles/image-editor/material3.css +7 -2
- package/styles/image-editor/tailwind-dark.css +9 -2
- package/styles/image-editor/tailwind.css +9 -2
- package/styles/material-dark.css +9 -2
- package/styles/material.css +9 -2
- package/styles/material3-dark.css +7 -2
- package/styles/material3.css +7 -2
- package/styles/tailwind-dark.css +9 -2
- package/styles/tailwind.css +9 -2
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 24.1.
|
|
3
|
+
* version : 24.1.44
|
|
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@
|
|
3
|
+
"_id": "@syncfusion/ej2-image-editor@24.1.43",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-LcI3ecnXwuM7mkbjNvkCjubyWqxgHSir+LYa2n0zChRWpLAsz5Mud5bPbJo38vJ4YdaZLO4aOgnU1IPbSunDZA==",
|
|
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-
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-24.1.43.tgz",
|
|
27
|
+
"_shasum": "3f51287e0339878931977e29514a28a0e013f637",
|
|
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.
|
|
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",
|
|
39
|
-
"@syncfusion/ej2-popups": "~24.1.
|
|
40
|
-
"@syncfusion/ej2-splitbuttons": "~24.1.
|
|
39
|
+
"@syncfusion/ej2-popups": "~24.1.44",
|
|
40
|
+
"@syncfusion/ej2-splitbuttons": "~24.1.44"
|
|
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.
|
|
70
|
+
"version": "24.1.44",
|
|
71
71
|
"sideEffects": false,
|
|
72
72
|
"homepage": "https://www.syncfusion.com/javascript-ui-controls"
|
|
73
73
|
}
|
|
@@ -82,7 +82,7 @@ var Draw = /** @class */ (function () {
|
|
|
82
82
|
this.updateCanvas();
|
|
83
83
|
break;
|
|
84
84
|
case 'performCancel':
|
|
85
|
-
this.performCancel(args.value['isContextualToolbar']);
|
|
85
|
+
this.performCancel(args.value['isContextualToolbar'], args.value['isUndoRedo']);
|
|
86
86
|
break;
|
|
87
87
|
case 'updateFlipPan':
|
|
88
88
|
this.updateFlipPan(args.value['tempSelectionObj']);
|
|
@@ -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);
|
|
@@ -574,13 +574,11 @@ var Draw = /** @class */ (function () {
|
|
|
574
574
|
if (destTop < 0) {
|
|
575
575
|
height += destTop;
|
|
576
576
|
}
|
|
577
|
-
if (
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
height -= (destTop + destHeight - parent.lowerCanvas.height);
|
|
583
|
-
}
|
|
577
|
+
if (destLeft + destWidth > parent.lowerCanvas.width) {
|
|
578
|
+
width -= (destLeft + destWidth - parent.lowerCanvas.width);
|
|
579
|
+
}
|
|
580
|
+
if (destTop + destHeight > parent.lowerCanvas.height) {
|
|
581
|
+
height -= (destTop + destHeight - parent.lowerCanvas.height);
|
|
584
582
|
}
|
|
585
583
|
}
|
|
586
584
|
switch (parent.currObjType.shape.toLowerCase()) {
|
|
@@ -2202,7 +2200,7 @@ var Draw = /** @class */ (function () {
|
|
|
2202
2200
|
parent.img.destHeight = maxDimension.width;
|
|
2203
2201
|
}
|
|
2204
2202
|
parent.img.destLeft = (parent.lowerCanvas.clientWidth - maxDimension.height) / 2;
|
|
2205
|
-
parent.img.destTop = (parent.lowerCanvas.clientHeight - maxDimension.width
|
|
2203
|
+
parent.img.destTop = (parent.lowerCanvas.clientHeight - maxDimension.width) / 2;
|
|
2206
2204
|
parent.img.destWidth = maxDimension.height;
|
|
2207
2205
|
parent.img.destHeight = maxDimension.width;
|
|
2208
2206
|
}
|
|
@@ -2218,7 +2216,12 @@ var Draw = /** @class */ (function () {
|
|
|
2218
2216
|
parent.img.destHeight = maxDimension.height;
|
|
2219
2217
|
}
|
|
2220
2218
|
parent.img.destLeft = (parent.lowerCanvas.clientWidth - maxDimension.width) / 2;
|
|
2221
|
-
|
|
2219
|
+
if (degree === 0) {
|
|
2220
|
+
parent.img.destTop = (parent.lowerCanvas.clientHeight - maxDimension.height + 1) / 2;
|
|
2221
|
+
}
|
|
2222
|
+
else {
|
|
2223
|
+
parent.img.destTop = (parent.lowerCanvas.clientHeight - maxDimension.height) / 2;
|
|
2224
|
+
}
|
|
2222
2225
|
parent.img.destWidth = maxDimension.width;
|
|
2223
2226
|
parent.img.destHeight = maxDimension.height;
|
|
2224
2227
|
}
|
|
@@ -2409,6 +2412,7 @@ var Draw = /** @class */ (function () {
|
|
|
2409
2412
|
hideSpinner(parent.element);
|
|
2410
2413
|
parent.element.style.opacity = '1';
|
|
2411
2414
|
proxy.updateBaseImgCanvas();
|
|
2415
|
+
var fileOpened = { fileName: _this.fileName, fileType: _this.fileType, isValidImage: true };
|
|
2412
2416
|
proxy.updateCanvas();
|
|
2413
2417
|
if (parent.currObjType.isUndoZoom) {
|
|
2414
2418
|
parent.currObjType.isUndoZoom = false;
|
|
@@ -2438,6 +2442,14 @@ var Draw = /** @class */ (function () {
|
|
|
2438
2442
|
- parent.toolbarHeight * 2) - 1 + 'px';
|
|
2439
2443
|
}
|
|
2440
2444
|
}
|
|
2445
|
+
if (parent.isImageLoaded && parent.element.style.opacity !== '0.5') {
|
|
2446
|
+
if (isBlazor() && parent.events && parent.events.fileOpened.hasDelegate === true) {
|
|
2447
|
+
parent.dotNetRef.invokeMethodAsync('FileOpenEventAsync', 'FileOpened', fileOpened);
|
|
2448
|
+
}
|
|
2449
|
+
else {
|
|
2450
|
+
parent.trigger('fileOpened', fileOpened);
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2441
2453
|
};
|
|
2442
2454
|
parent.baseImg.onerror = function () {
|
|
2443
2455
|
hideSpinner(parent.element);
|
|
@@ -2463,7 +2475,6 @@ var Draw = /** @class */ (function () {
|
|
|
2463
2475
|
};
|
|
2464
2476
|
Draw.prototype.updateCanvas = function () {
|
|
2465
2477
|
var parent = this.parent;
|
|
2466
|
-
var fileOpened = { fileName: this.fileName, fileType: this.fileType, isValidImage: true };
|
|
2467
2478
|
parent.img.srcWidth = parent.baseImgCanvas.width;
|
|
2468
2479
|
parent.img.srcHeight = parent.baseImgCanvas.height;
|
|
2469
2480
|
var obj = { width: 0, height: 0 };
|
|
@@ -2499,14 +2510,6 @@ var Draw = /** @class */ (function () {
|
|
|
2499
2510
|
if (parent.disabled) {
|
|
2500
2511
|
parent.element.setAttribute('class', 'e-disabled');
|
|
2501
2512
|
}
|
|
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
2513
|
if (parent.zoomSettings.zoomFactor !== 1 || parent.zoomSettings.zoomPoint) {
|
|
2511
2514
|
parent.zoom(parent.zoomSettings.zoomFactor, parent.zoomSettings.zoomPoint);
|
|
2512
2515
|
}
|
|
@@ -2533,14 +2536,14 @@ var Draw = /** @class */ (function () {
|
|
|
2533
2536
|
parent.cancelCropSelection = null;
|
|
2534
2537
|
}
|
|
2535
2538
|
};
|
|
2536
|
-
Draw.prototype.performCancel = function (isContextualToolbar) {
|
|
2539
|
+
Draw.prototype.performCancel = function (isContextualToolbar, isUndoRedo) {
|
|
2537
2540
|
var parent = this.parent;
|
|
2538
2541
|
var straightenObj = { bool: parent.isStraightening };
|
|
2539
2542
|
isContextualToolbar = isContextualToolbar ? isContextualToolbar : false;
|
|
2540
2543
|
var obj = { bool: false };
|
|
2541
2544
|
parent.allowDownScale = true;
|
|
2542
2545
|
parent.notify('selection', { prop: 'getFreehandDrawEditing', onPropertyChange: false, value: { obj: obj } });
|
|
2543
|
-
if (JSON.stringify(parent.frameObj) !== JSON.stringify(parent.tempFrameObj)) {
|
|
2546
|
+
if (isNullOrUndefined(isUndoRedo) && JSON.stringify(parent.frameObj) !== JSON.stringify(parent.tempFrameObj)) {
|
|
2544
2547
|
extend(parent.frameObj, parent.tempFrameObj);
|
|
2545
2548
|
this.renderImage(null, null, true);
|
|
2546
2549
|
}
|
|
@@ -3304,16 +3307,16 @@ var Draw = /** @class */ (function () {
|
|
|
3304
3307
|
Draw.prototype.setClientTransDim = function (isPreventDimension) {
|
|
3305
3308
|
var parent = this.parent;
|
|
3306
3309
|
if (parent.transform.degree % 90 === 0 && parent.transform.degree % 180 !== 0) {
|
|
3307
|
-
parent.img.destLeft = (parent.lowerCanvas.
|
|
3308
|
-
parent.img.destTop = (parent.lowerCanvas.
|
|
3310
|
+
parent.img.destLeft = (parent.lowerCanvas.clientWidth - parent.img.destHeight) / 2;
|
|
3311
|
+
parent.img.destTop = (parent.lowerCanvas.clientHeight - parent.img.destWidth + 1) / 2;
|
|
3309
3312
|
var temp = parent.img.destWidth;
|
|
3310
3313
|
parent.img.destWidth = parent.img.destHeight;
|
|
3311
3314
|
parent.img.destHeight = temp;
|
|
3312
3315
|
}
|
|
3313
3316
|
else {
|
|
3314
3317
|
if (isNullOrUndefined(isPreventDimension)) {
|
|
3315
|
-
parent.img.destLeft = (parent.lowerCanvas.
|
|
3316
|
-
parent.img.destTop = (parent.lowerCanvas.
|
|
3318
|
+
parent.img.destLeft = (parent.lowerCanvas.clientWidth - parent.img.destWidth) / 2;
|
|
3319
|
+
parent.img.destTop = (parent.lowerCanvas.clientHeight - parent.img.destHeight + 1) / 2;
|
|
3317
3320
|
}
|
|
3318
3321
|
}
|
|
3319
3322
|
};
|
|
@@ -4364,7 +4364,15 @@ var Selection = /** @class */ (function () {
|
|
|
4364
4364
|
this.getCurrentFlipState();
|
|
4365
4365
|
}
|
|
4366
4366
|
else {
|
|
4367
|
+
var totalPannedInternalPoint = extend({}, parent.panPoint.totalPannedInternalPoint, {}, true);
|
|
4368
|
+
var destPoints = { startX: parent.img.destLeft, startY: parent.img.destTop, width: parent.img.destWidth,
|
|
4369
|
+
height: parent.img.destHeight };
|
|
4367
4370
|
parent.notify('draw', { prop: 'callUpdateCurrTransState', onPropertyChange: false });
|
|
4371
|
+
parent.panPoint.totalPannedInternalPoint = totalPannedInternalPoint;
|
|
4372
|
+
parent.img.destLeft = destPoints.startX;
|
|
4373
|
+
parent.img.destTop = destPoints.startY;
|
|
4374
|
+
parent.img.destWidth = destPoints.width;
|
|
4375
|
+
parent.img.destHeight = destPoints.height;
|
|
4368
4376
|
parent.notify('freehand-draw', { prop: 'freehandRedraw', onPropertyChange: false,
|
|
4369
4377
|
value: { context: this.lowerContext, points: null } });
|
|
4370
4378
|
}
|
|
@@ -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
|
}
|
|
@@ -1189,11 +1189,11 @@ var Transform = /** @class */ (function () {
|
|
|
1189
1189
|
if (parent.img.destTop > 0) {
|
|
1190
1190
|
parent.img.destTop = 0;
|
|
1191
1191
|
}
|
|
1192
|
-
if (parent.img.destLeft + maxDimension.width < parent.lowerCanvas.
|
|
1193
|
-
parent.img.destLeft = parent.lowerCanvas.
|
|
1192
|
+
if (parent.img.destLeft + maxDimension.width < parent.lowerCanvas.clientWidth) {
|
|
1193
|
+
parent.img.destLeft = parent.lowerCanvas.clientWidth - parent.img.destWidth;
|
|
1194
1194
|
}
|
|
1195
|
-
if (parent.img.destTop + maxDimension.height < parent.lowerCanvas.
|
|
1196
|
-
parent.img.destTop = parent.lowerCanvas.
|
|
1195
|
+
if (parent.img.destTop + maxDimension.height < parent.lowerCanvas.clientHeight) {
|
|
1196
|
+
parent.img.destTop = parent.lowerCanvas.clientHeight - parent.img.destHeight;
|
|
1197
1197
|
}
|
|
1198
1198
|
}
|
|
1199
1199
|
return maxDimension;
|
|
@@ -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()) {
|
|
@@ -382,7 +382,7 @@ var UndoRedo = /** @class */ (function () {
|
|
|
382
382
|
this.tempCurrSelPoint = extend({}, parent.currSelectionPoint, {}, true);
|
|
383
383
|
parent.currSelectionPoint = null;
|
|
384
384
|
}
|
|
385
|
-
parent.notify('draw', { prop: 'performCancel', value: { isContextualToolbar: null } });
|
|
385
|
+
parent.notify('draw', { prop: 'performCancel', value: { isContextualToolbar: null, isUndoRedo: true } });
|
|
386
386
|
parent.currObjType.isActiveObj = false;
|
|
387
387
|
if (parent.transform.straighten !== 0) {
|
|
388
388
|
parent.notify('draw', { prop: 'setStraightenActObj', value: { activeObj: null } });
|
|
@@ -945,6 +945,16 @@ var UndoRedo = /** @class */ (function () {
|
|
|
945
945
|
this.parent.notify('draw', { prop: 'getArrowDimension', onPropertyChange: false, value: { obj: arrowObj } });
|
|
946
946
|
var tempArrowObj = extend({}, arrowObj['arrowDimension'], {}, true);
|
|
947
947
|
if (parent.transform.zoomFactor > 0 && (obj.length > 0 || point.length > 0)) {
|
|
948
|
+
if (obj.length > 0) {
|
|
949
|
+
for (var i = 0; i < obj.length; i++) {
|
|
950
|
+
if (obj[i].currIndex) {
|
|
951
|
+
continue;
|
|
952
|
+
}
|
|
953
|
+
else {
|
|
954
|
+
obj[i].currIndex = 'shape_' + (i + 1);
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
}
|
|
948
958
|
parent.objColl = obj;
|
|
949
959
|
parent.pointColl = point;
|
|
950
960
|
var isUndoRedo = parent.isUndoRedo;
|
|
@@ -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
|
-
|
|
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 (
|
|
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
|
-
|
|
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
|
|
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
|
}
|
|
@@ -3613,6 +3644,9 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3613
3644
|
qtArea.style.top = point.startY - (height + (height / 1.5)) + 'px';
|
|
3614
3645
|
}
|
|
3615
3646
|
}
|
|
3647
|
+
if (parseFloat(qtArea.style.top) < 0) {
|
|
3648
|
+
qtArea.style.top = '0px';
|
|
3649
|
+
}
|
|
3616
3650
|
}
|
|
3617
3651
|
};
|
|
3618
3652
|
ToolbarModule.prototype.refreshDropDownBtn = function (isDisabled) {
|
|
@@ -496,14 +496,17 @@
|
|
|
496
496
|
height: 54px !important; /* stylelint-disable-line declaration-no-important */
|
|
497
497
|
}
|
|
498
498
|
.e-ie-straighten-value-span,
|
|
499
|
-
.e-ie-straighten-span
|
|
500
|
-
|
|
499
|
+
.e-ie-straighten-span,
|
|
500
|
+
.e-ie-toolbar-straighten {
|
|
501
|
+
font-size: 14px !important; /* stylelint-disable-line declaration-no-important */
|
|
501
502
|
padding-left: 10px !important; /* stylelint-disable-line declaration-no-important */
|
|
502
503
|
padding-right: 10px !important; /* stylelint-disable-line declaration-no-important */
|
|
503
504
|
}
|
|
504
505
|
|
|
505
506
|
.e-straighten .e-control-wrapper.e-slider-container.e-horizontal {
|
|
506
507
|
height: auto;
|
|
508
|
+
margin-left: 8px;
|
|
509
|
+
padding-right: 2px;
|
|
507
510
|
}
|
|
508
511
|
|
|
509
512
|
.e-straighten .e-control-wrapper.e-slider-container.e-horizontal .e-slider {
|
|
@@ -519,6 +522,10 @@
|
|
|
519
522
|
top: calc(50% - 5px) !important; /* stylelint-disable-line declaration-no-important */
|
|
520
523
|
}
|
|
521
524
|
|
|
525
|
+
.e-ie-finetune-value-span {
|
|
526
|
+
top: 26% !important; /* stylelint-disable-line declaration-no-important */
|
|
527
|
+
}
|
|
528
|
+
|
|
522
529
|
.e-bigger .e-straighten .e-control-wrapper.e-slider-container .e-slider .e-handle {
|
|
523
530
|
top: calc(50% - 7px) !important; /* stylelint-disable-line declaration-no-important */
|
|
524
531
|
}
|
package/styles/bootstrap.css
CHANGED
|
@@ -496,14 +496,17 @@
|
|
|
496
496
|
height: 54px !important; /* stylelint-disable-line declaration-no-important */
|
|
497
497
|
}
|
|
498
498
|
.e-ie-straighten-value-span,
|
|
499
|
-
.e-ie-straighten-span
|
|
500
|
-
|
|
499
|
+
.e-ie-straighten-span,
|
|
500
|
+
.e-ie-toolbar-straighten {
|
|
501
|
+
font-size: 14px !important; /* stylelint-disable-line declaration-no-important */
|
|
501
502
|
padding-left: 10px !important; /* stylelint-disable-line declaration-no-important */
|
|
502
503
|
padding-right: 10px !important; /* stylelint-disable-line declaration-no-important */
|
|
503
504
|
}
|
|
504
505
|
|
|
505
506
|
.e-straighten .e-control-wrapper.e-slider-container.e-horizontal {
|
|
506
507
|
height: auto;
|
|
508
|
+
margin-left: 8px;
|
|
509
|
+
padding-right: 2px;
|
|
507
510
|
}
|
|
508
511
|
|
|
509
512
|
.e-straighten .e-control-wrapper.e-slider-container.e-horizontal .e-slider {
|
|
@@ -519,6 +522,10 @@
|
|
|
519
522
|
top: calc(50% - 5px) !important; /* stylelint-disable-line declaration-no-important */
|
|
520
523
|
}
|
|
521
524
|
|
|
525
|
+
.e-ie-finetune-value-span {
|
|
526
|
+
top: 26% !important; /* stylelint-disable-line declaration-no-important */
|
|
527
|
+
}
|
|
528
|
+
|
|
522
529
|
.e-bigger .e-straighten .e-control-wrapper.e-slider-container .e-slider .e-handle {
|
|
523
530
|
top: calc(50% - 7px) !important; /* stylelint-disable-line declaration-no-important */
|
|
524
531
|
}
|
package/styles/bootstrap4.css
CHANGED
|
@@ -494,14 +494,17 @@
|
|
|
494
494
|
height: 54px !important; /* stylelint-disable-line declaration-no-important */
|
|
495
495
|
}
|
|
496
496
|
.e-ie-straighten-value-span,
|
|
497
|
-
.e-ie-straighten-span
|
|
498
|
-
|
|
497
|
+
.e-ie-straighten-span,
|
|
498
|
+
.e-ie-toolbar-straighten {
|
|
499
|
+
font-size: 14px !important; /* stylelint-disable-line declaration-no-important */
|
|
499
500
|
padding-left: 10px !important; /* stylelint-disable-line declaration-no-important */
|
|
500
501
|
padding-right: 10px !important; /* stylelint-disable-line declaration-no-important */
|
|
501
502
|
}
|
|
502
503
|
|
|
503
504
|
.e-straighten .e-control-wrapper.e-slider-container.e-horizontal {
|
|
504
505
|
height: auto;
|
|
506
|
+
margin-left: 8px;
|
|
507
|
+
padding-right: 2px;
|
|
505
508
|
}
|
|
506
509
|
|
|
507
510
|
.e-straighten .e-control-wrapper.e-slider-container.e-horizontal .e-slider {
|
|
@@ -517,6 +520,10 @@
|
|
|
517
520
|
top: calc(50% - 6px) !important; /* stylelint-disable-line declaration-no-important */
|
|
518
521
|
}
|
|
519
522
|
|
|
523
|
+
.e-ie-finetune-value-span {
|
|
524
|
+
top: 26% !important; /* stylelint-disable-line declaration-no-important */
|
|
525
|
+
}
|
|
526
|
+
|
|
520
527
|
.e-bigger .e-straighten .e-control-wrapper.e-slider-container .e-slider .e-handle {
|
|
521
528
|
top: calc(50% - 7px) !important; /* stylelint-disable-line declaration-no-important */
|
|
522
529
|
}
|