@syncfusion/ej2-image-editor 24.2.8 → 25.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -45
- 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 +958 -1922
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +993 -1974
- 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 +12 -12
- package/src/image-editor/action/crop.js +9 -45
- package/src/image-editor/action/draw.js +52 -207
- package/src/image-editor/action/export.js +6 -35
- package/src/image-editor/action/freehand-draw.js +26 -80
- package/src/image-editor/action/selection.js +122 -326
- package/src/image-editor/action/shape.js +133 -242
- package/src/image-editor/action/transform.d.ts +0 -1
- package/src/image-editor/action/transform.js +80 -291
- package/src/image-editor/action/undo-redo.d.ts +0 -1
- package/src/image-editor/action/undo-redo.js +32 -127
- package/src/image-editor/base/image-editor-model.d.ts +1 -1
- package/src/image-editor/base/image-editor.d.ts +51 -42
- package/src/image-editor/base/image-editor.js +316 -425
- package/src/image-editor/renderer/toolbar.d.ts +1 -0
- package/src/image-editor/renderer/toolbar.js +228 -207
- package/styles/bootstrap-dark.css +0 -12
- package/styles/bootstrap.css +0 -12
- package/styles/bootstrap4.css +0 -12
- package/styles/bootstrap5-dark.css +0 -12
- package/styles/bootstrap5.css +0 -12
- package/styles/fabric-dark.css +0 -12
- package/styles/fabric.css +0 -12
- package/styles/fluent-dark.css +0 -12
- package/styles/fluent.css +0 -12
- package/styles/highcontrast-light.css +0 -12
- package/styles/highcontrast.css +0 -12
- package/styles/image-editor/_bds-definition.scss +21 -0
- package/styles/image-editor/_bootstrap-dark-definition.scss +0 -1
- package/styles/image-editor/_bootstrap-definition.scss +0 -1
- package/styles/image-editor/_bootstrap4-definition.scss +0 -1
- package/styles/image-editor/_bootstrap5-definition.scss +0 -1
- package/styles/image-editor/_fabric-dark-definition.scss +0 -1
- package/styles/image-editor/_fabric-definition.scss +0 -1
- package/styles/image-editor/_fluent-definition.scss +0 -1
- package/styles/image-editor/_fusionnew-definition.scss +0 -1
- package/styles/image-editor/_highcontrast-definition.scss +0 -1
- package/styles/image-editor/_highcontrast-light-definition.scss +0 -1
- package/styles/image-editor/_layout.scss +5 -32
- package/styles/image-editor/_material-dark-definition.scss +0 -1
- package/styles/image-editor/_material-definition.scss +0 -1
- package/styles/image-editor/_material3-definition.scss +2 -3
- package/styles/image-editor/_tailwind-definition.scss +0 -1
- package/styles/image-editor/bootstrap-dark.css +0 -12
- package/styles/image-editor/bootstrap.css +0 -12
- package/styles/image-editor/bootstrap4.css +0 -12
- package/styles/image-editor/bootstrap5-dark.css +0 -12
- package/styles/image-editor/bootstrap5.css +0 -12
- package/styles/image-editor/fabric-dark.css +0 -12
- package/styles/image-editor/fabric.css +0 -12
- package/styles/image-editor/fluent-dark.css +0 -12
- package/styles/image-editor/fluent.css +0 -12
- package/styles/image-editor/highcontrast-light.css +0 -12
- package/styles/image-editor/highcontrast.css +0 -12
- package/styles/image-editor/icons/_bds.scss +411 -0
- package/styles/image-editor/material-dark.css +0 -12
- package/styles/image-editor/material.css +0 -12
- package/styles/image-editor/material3-dark.css +5 -25
- package/styles/image-editor/material3.css +5 -25
- package/styles/image-editor/tailwind-dark.css +2 -14
- package/styles/image-editor/tailwind.css +2 -14
- package/styles/material-dark.css +0 -12
- package/styles/material.css +0 -12
- package/styles/material3-dark.css +5 -25
- package/styles/material3.css +5 -25
- package/styles/tailwind-dark.css +2 -14
- package/styles/tailwind.css +2 -14
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version :
|
|
3
|
+
* version : 25.1.37
|
|
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@25.1.35",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-5qgANXLk/5NEFF8XAN6BInARWPl05THFM9omABEmDd1S+LGIftOn17KlJVHymHA0wQM0sR3ySb1FGgunvOyfNA==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-image-editor",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -23,21 +23,21 @@
|
|
|
23
23
|
"/@syncfusion/ej2-react-image-editor",
|
|
24
24
|
"/@syncfusion/ej2-vue-image-editor"
|
|
25
25
|
],
|
|
26
|
-
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-25.1.35.tgz",
|
|
27
|
+
"_shasum": "6f29e792a5be807112e90420e9d09ae40534ea77",
|
|
28
28
|
"_spec": "@syncfusion/ej2-image-editor@*",
|
|
29
|
-
"_where": "/jenkins/workspace/elease-
|
|
29
|
+
"_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
|
|
30
30
|
"author": {
|
|
31
31
|
"name": "Syncfusion Inc."
|
|
32
32
|
},
|
|
33
33
|
"bundleDependencies": false,
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@syncfusion/ej2-base": "~
|
|
36
|
-
"@syncfusion/ej2-buttons": "~
|
|
37
|
-
"@syncfusion/ej2-inputs": "~
|
|
38
|
-
"@syncfusion/ej2-navigations": "~
|
|
39
|
-
"@syncfusion/ej2-popups": "~
|
|
40
|
-
"@syncfusion/ej2-splitbuttons": "~
|
|
35
|
+
"@syncfusion/ej2-base": "~25.1.35",
|
|
36
|
+
"@syncfusion/ej2-buttons": "~25.1.35",
|
|
37
|
+
"@syncfusion/ej2-inputs": "~25.1.37",
|
|
38
|
+
"@syncfusion/ej2-navigations": "~25.1.37",
|
|
39
|
+
"@syncfusion/ej2-popups": "~25.1.35",
|
|
40
|
+
"@syncfusion/ej2-splitbuttons": "~25.1.37"
|
|
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": "
|
|
70
|
+
"version": "25.1.37",
|
|
71
71
|
"sideEffects": false,
|
|
72
72
|
"homepage": "https://www.syncfusion.com/javascript-ui-controls"
|
|
73
73
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Browser, extend,
|
|
1
|
+
import { Browser, extend, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
2
2
|
var Crop = /** @class */ (function () {
|
|
3
3
|
function Crop(parent) {
|
|
4
4
|
this.croppedDegree = 0; // Specifies the degree when crop is performed
|
|
@@ -845,35 +845,19 @@ var Crop = /** @class */ (function () {
|
|
|
845
845
|
}
|
|
846
846
|
};
|
|
847
847
|
Crop.prototype.crop = function (obj) {
|
|
848
|
-
var _this = this;
|
|
849
848
|
var parent = this.parent;
|
|
850
849
|
var _a = parent.activeObj.activePoint, startX = _a.startX, startY = _a.startY, endX = _a.endX, endY = _a.endY;
|
|
851
850
|
if (!parent.disabled && parent.isImageLoaded) {
|
|
852
|
-
var
|
|
853
|
-
if (parent.currObjType.isUndoAction && !
|
|
851
|
+
var object = { isCropToolbar: parent.isCropToolbar };
|
|
852
|
+
if (parent.currObjType.isUndoAction && !object['isCropToolbar']) {
|
|
854
853
|
parent.notify('undo-redo', { prop: 'refreshUrc', value: { bool: null } });
|
|
855
854
|
}
|
|
856
855
|
var transitionArgs = { cancel: false, startPoint: { x: startX, y: startY },
|
|
857
856
|
endPoint: { x: endX, y: endY }, preventScaling: false };
|
|
858
|
-
if (!
|
|
859
|
-
|
|
860
|
-
if (parent.currentToolbar === 'resize-toolbar') {
|
|
861
|
-
parent.dotNetRef.invokeMethodAsync('CropEventAsync', 'OnCrop', transitionArgs, null);
|
|
862
|
-
this.cropEvent(transitionArgs, obj, object_1);
|
|
863
|
-
}
|
|
864
|
-
else {
|
|
865
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
866
|
-
parent.dotNetRef.invokeMethodAsync('CropEventAsync', 'OnCrop', transitionArgs, null).then(function (args) {
|
|
867
|
-
_this.cropEvent(args, obj, object_1);
|
|
868
|
-
});
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
else {
|
|
872
|
-
if (!object_1['isCropToolbar']) {
|
|
873
|
-
parent.trigger('cropping', transitionArgs);
|
|
874
|
-
}
|
|
875
|
-
this.cropEvent(transitionArgs, obj, object_1);
|
|
857
|
+
if (!object['isCropToolbar']) {
|
|
858
|
+
parent.trigger('cropping', transitionArgs);
|
|
876
859
|
}
|
|
860
|
+
this.cropEvent(transitionArgs, obj, object);
|
|
877
861
|
}
|
|
878
862
|
};
|
|
879
863
|
Crop.prototype.cropEvent = function (transitionArgs, obj, object) {
|
|
@@ -908,25 +892,14 @@ var Crop = /** @class */ (function () {
|
|
|
908
892
|
var aspectIcon = parent.element.querySelector('#' + parent.element.id + '_aspectratio');
|
|
909
893
|
var nonAspectIcon = parent.element.querySelector('#' + parent.element.id + '_nonaspectratio');
|
|
910
894
|
parent.notify('draw', { prop: 'render-image', value: { isMouseWheel: false } });
|
|
911
|
-
if (!
|
|
895
|
+
if (!object['isCropToolbar'] && (isNullOrUndefined(aspectIcon) && isNullOrUndefined(nonAspectIcon))) {
|
|
912
896
|
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
|
|
913
897
|
isApplyBtn: false, isCropping: false, isZooming: null, cType: null } });
|
|
914
898
|
}
|
|
915
|
-
else if (!object['isCropToolbar']) {
|
|
916
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
917
|
-
if (parent.currentToolbar !== 'resize-toolbar') {
|
|
918
|
-
parent.updateToolbar(parent.element, 'imageLoaded');
|
|
919
|
-
}
|
|
920
|
-
}
|
|
921
899
|
this.resizeWrapper();
|
|
922
900
|
if (Browser.isDevice) {
|
|
923
901
|
this.updateUndoRedoColl(prevObj, prevCropObj, object);
|
|
924
902
|
}
|
|
925
|
-
transitionArgs = { startPoint: transitionArgs.startPoint, endPoint: transitionArgs.endPoint };
|
|
926
|
-
if (!object['isCropToolbar'] && isBlazor() && parent.events && parent.events.cropped.hasDelegate === true) {
|
|
927
|
-
parent.dotNetRef.invokeMethodAsync('CropEventAsync', 'Cropped', null, transitionArgs);
|
|
928
|
-
}
|
|
929
|
-
else { }
|
|
930
903
|
}
|
|
931
904
|
}
|
|
932
905
|
};
|
|
@@ -945,25 +918,16 @@ var Crop = /** @class */ (function () {
|
|
|
945
918
|
};
|
|
946
919
|
Crop.prototype.resizeWrapper = function () {
|
|
947
920
|
var parent = this.parent;
|
|
948
|
-
if (Browser.isDevice
|
|
921
|
+
if (Browser.isDevice) {
|
|
949
922
|
var elem = parent.element;
|
|
950
923
|
var ctxToolbar = elem.querySelector('#' + elem.id + '_contextualToolbarArea');
|
|
951
|
-
if (ctxToolbar.style.position === '' && !this.isTransformCrop) {
|
|
924
|
+
if (ctxToolbar && ctxToolbar.style.position === '' && !this.isTransformCrop) {
|
|
952
925
|
ctxToolbar.style.position = 'absolute';
|
|
953
926
|
parent.isStraightening = false;
|
|
954
927
|
parent.update();
|
|
955
928
|
parent.notify('filter', { prop: 'setAdjustmentValue', value: { adjustmentValue: parent.canvasFilter } });
|
|
956
929
|
}
|
|
957
930
|
}
|
|
958
|
-
else if (Browser.isDevice && isBlazor() && !this.isTransformCrop) {
|
|
959
|
-
parent.isStraightening = false;
|
|
960
|
-
parent.update();
|
|
961
|
-
var canvasWrapper = parent.element.querySelector('#' + parent.element.id + '_canvasWrapper');
|
|
962
|
-
if (canvasWrapper) {
|
|
963
|
-
canvasWrapper.style.height = (parseInt(canvasWrapper.style.height) + 2) + 'px';
|
|
964
|
-
}
|
|
965
|
-
parent.notify('filter', { prop: 'setAdjustmentValue', value: { adjustmentValue: parent.canvasFilter } });
|
|
966
|
-
}
|
|
967
931
|
};
|
|
968
932
|
Crop.prototype.calcRatio = function (obj, dimension) {
|
|
969
933
|
var parent = this.parent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extend, isNullOrUndefined, Browser,
|
|
1
|
+
import { extend, isNullOrUndefined, Browser, getComponent } from '@syncfusion/ej2-base';
|
|
2
2
|
import { Dialog, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';
|
|
3
3
|
var Draw = /** @class */ (function () {
|
|
4
4
|
function Draw(parent) {
|
|
@@ -2419,36 +2419,21 @@ var Draw = /** @class */ (function () {
|
|
|
2419
2419
|
proxy.parent.lowerCanvas.style.display = 'block';
|
|
2420
2420
|
}
|
|
2421
2421
|
parent.isUndoRedo = _this.isErrorImage = false;
|
|
2422
|
-
if (
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
parent.notify('toolbar', { prop: 'create-bottom-toolbar', onPropertyChange: false });
|
|
2430
|
-
}
|
|
2431
|
-
else {
|
|
2432
|
-
parent.notify('toolbar', { prop: 'destroy-top-toolbar', onPropertyChange: false });
|
|
2433
|
-
var eventargs = { isApplyBtn: false, isDevice: false, isOkBtn: null };
|
|
2434
|
-
parent.notify('toolbar', { prop: 'init-main-toolbar', onPropertyChange: false, value: eventargs });
|
|
2435
|
-
}
|
|
2422
|
+
if (Browser.isDevice) {
|
|
2423
|
+
parent.notify('toolbar', { prop: 'destroy-top-toolbar', onPropertyChange: false });
|
|
2424
|
+
parent.notify('toolbar', { prop: 'destroy-bottom-toolbar', onPropertyChange: false });
|
|
2425
|
+
var eventargs = { isApplyBtn: false, isDevice: Browser.isDevice, isOkBtn: null,
|
|
2426
|
+
isResize: null, isFrame: null, isMainToolbar: true };
|
|
2427
|
+
parent.notify('toolbar', { prop: 'init-main-toolbar', onPropertyChange: false, value: eventargs });
|
|
2428
|
+
parent.notify('toolbar', { prop: 'create-bottom-toolbar', onPropertyChange: false });
|
|
2436
2429
|
}
|
|
2437
2430
|
else {
|
|
2438
|
-
parent.
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
parent.element.querySelector('.e-canvas-wrapper').style.height = (parent.element.offsetHeight
|
|
2442
|
-
- parent.toolbarHeight * 2) - 1 + 'px';
|
|
2443
|
-
}
|
|
2431
|
+
parent.notify('toolbar', { prop: 'destroy-top-toolbar', onPropertyChange: false });
|
|
2432
|
+
var eventargs = { isApplyBtn: false, isDevice: false, isOkBtn: null };
|
|
2433
|
+
parent.notify('toolbar', { prop: 'init-main-toolbar', onPropertyChange: false, value: eventargs });
|
|
2444
2434
|
}
|
|
2445
2435
|
if (parent.isImageLoaded && parent.element.style.opacity !== '0.5') {
|
|
2446
|
-
|
|
2447
|
-
parent.dotNetRef.invokeMethodAsync('FileOpenEventAsync', 'FileOpened', fileOpened);
|
|
2448
|
-
}
|
|
2449
|
-
else {
|
|
2450
|
-
parent.trigger('fileOpened', fileOpened);
|
|
2451
|
-
}
|
|
2436
|
+
parent.trigger('fileOpened', fileOpened);
|
|
2452
2437
|
}
|
|
2453
2438
|
};
|
|
2454
2439
|
parent.baseImg.onerror = function () {
|
|
@@ -2460,12 +2445,7 @@ var Draw = /** @class */ (function () {
|
|
|
2460
2445
|
Draw.prototype.errorLoading = function () {
|
|
2461
2446
|
var parent = this.parent;
|
|
2462
2447
|
var fileOpened = { fileName: null, fileType: null, isValidImage: false };
|
|
2463
|
-
|
|
2464
|
-
parent.dotNetRef.invokeMethodAsync('FileOpenEventAsync', 'FileOpened', fileOpened);
|
|
2465
|
-
}
|
|
2466
|
-
else {
|
|
2467
|
-
parent.trigger('fileOpened', fileOpened);
|
|
2468
|
-
}
|
|
2448
|
+
parent.trigger('fileOpened', fileOpened);
|
|
2469
2449
|
};
|
|
2470
2450
|
Draw.prototype.updateBaseImgCanvas = function () {
|
|
2471
2451
|
var parent = this.parent;
|
|
@@ -2550,12 +2530,7 @@ var Draw = /** @class */ (function () {
|
|
|
2550
2530
|
this.resetFrameZoom(false);
|
|
2551
2531
|
if (obj['bool']) {
|
|
2552
2532
|
parent.notify('freehand-draw', { prop: 'cancelFhd', onPropertyChange: false });
|
|
2553
|
-
|
|
2554
|
-
parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
|
|
2555
|
-
}
|
|
2556
|
-
else {
|
|
2557
|
-
parent.updateToolbar(parent.element, 'destroyQuickAccessToolbar');
|
|
2558
|
-
}
|
|
2533
|
+
parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
|
|
2559
2534
|
parent.notify('undo-redo', { prop: 'updateCurrUrc', value: { type: 'cancel' } });
|
|
2560
2535
|
}
|
|
2561
2536
|
else if (parent.textArea.style.display === 'block' || parent.textArea.style.display === 'inline-block') {
|
|
@@ -2575,18 +2550,11 @@ var Draw = /** @class */ (function () {
|
|
|
2575
2550
|
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
2576
2551
|
}
|
|
2577
2552
|
parent.notify('shape', { prop: 'applyActObj', onPropertyChange: false, value: { isMouseDown: true } });
|
|
2578
|
-
|
|
2579
|
-
parent.notify('toolbar', { prop: 'refresh-main-toolbar', onPropertyChange: false });
|
|
2580
|
-
}
|
|
2581
|
-
else {
|
|
2582
|
-
parent.updateToolbar(parent.element, 'imageLoaded');
|
|
2583
|
-
}
|
|
2553
|
+
parent.notify('toolbar', { prop: 'refresh-main-toolbar', onPropertyChange: false });
|
|
2584
2554
|
parent.notify('selection', { prop: 'setTempActObj', onPropertyChange: false, value: { obj: parent.activeObj } });
|
|
2585
2555
|
}
|
|
2586
|
-
else if ((
|
|
2587
|
-
document.querySelector('#' + parent.element.id + '_sliderWrapper')) ||
|
|
2588
|
-
(isBlazor() && !parent.element.querySelector('.e-ie-contextual-slider').classList.contains('e-hidden')) ||
|
|
2589
|
-
parent.currObjType.isFiltered) {
|
|
2556
|
+
else if (((!Browser.isDevice || (Browser.isDevice && !straightenObj['bool'])) &&
|
|
2557
|
+
document.querySelector('#' + parent.element.id + '_sliderWrapper')) || parent.currObjType.isFiltered) {
|
|
2590
2558
|
this.lowerContext.filter = this.tempAdjValue;
|
|
2591
2559
|
parent.canvasFilter = this.tempAdjValue;
|
|
2592
2560
|
parent.notify('filter', { prop: 'setAdjustmentValue', onPropertyChange: false, value: { adjustmentValue: this.tempAdjValue } });
|
|
@@ -2614,18 +2582,10 @@ var Draw = /** @class */ (function () {
|
|
|
2614
2582
|
value: { context: this.lowerContext, isSave: null, isFlip: null } });
|
|
2615
2583
|
}
|
|
2616
2584
|
var eventargs = { type: 'main', isApplyBtn: null, isCropping: null, isZooming: null };
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
|
|
2622
|
-
}
|
|
2623
|
-
}
|
|
2624
|
-
else {
|
|
2625
|
-
parent.updateToolbar(parent.element, 'imageLoaded');
|
|
2626
|
-
if (parent.activeObj.shape && parent.activeObj.shape === 'image') {
|
|
2627
|
-
parent.updateToolbar(parent.element, 'destroyQuickAccessToolbar');
|
|
2628
|
-
}
|
|
2585
|
+
parent.element.querySelector('.e-contextual-toolbar-wrapper').classList.add('e-hide');
|
|
2586
|
+
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: eventargs });
|
|
2587
|
+
if (parent.activeObj.shape && parent.activeObj.shape === 'image') {
|
|
2588
|
+
parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
|
|
2629
2589
|
}
|
|
2630
2590
|
parent.notify('undo-redo', { prop: 'updateCurrUrc', value: { type: 'cancel' } });
|
|
2631
2591
|
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
@@ -2634,12 +2594,7 @@ var Draw = /** @class */ (function () {
|
|
|
2634
2594
|
else {
|
|
2635
2595
|
if (isContextualToolbar && (!Browser.isDevice || (Browser.isDevice && !straightenObj['bool']))) {
|
|
2636
2596
|
var eventargs = { type: 'main', isApplyBtn: null, isCropping: null, isZooming: null };
|
|
2637
|
-
|
|
2638
|
-
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: eventargs });
|
|
2639
|
-
}
|
|
2640
|
-
else {
|
|
2641
|
-
parent.updateToolbar(parent.element, 'imageLoaded');
|
|
2642
|
-
}
|
|
2597
|
+
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: eventargs });
|
|
2643
2598
|
}
|
|
2644
2599
|
else {
|
|
2645
2600
|
this.cancelItems();
|
|
@@ -2655,10 +2610,8 @@ var Draw = /** @class */ (function () {
|
|
|
2655
2610
|
}
|
|
2656
2611
|
this.isShapeTextInserted = false;
|
|
2657
2612
|
this.isNewPath = false;
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
parent.notify('toolbar', { prop: 'setCurrentToolbar', value: { type: 'main' } });
|
|
2661
|
-
}
|
|
2613
|
+
parent.notify('toolbar', { prop: 'refresh-dropdown-btn', value: { isDisabled: false } });
|
|
2614
|
+
parent.notify('toolbar', { prop: 'setCurrentToolbar', value: { type: 'main' } });
|
|
2662
2615
|
};
|
|
2663
2616
|
Draw.prototype.cancelItems = function () {
|
|
2664
2617
|
var parent = this.parent;
|
|
@@ -2734,6 +2687,7 @@ var Draw = /** @class */ (function () {
|
|
|
2734
2687
|
var temp = parent.isCropTab;
|
|
2735
2688
|
parent.isCropTab = false;
|
|
2736
2689
|
this.updateCropSelObj();
|
|
2690
|
+
parent.cancelCropSelection = null;
|
|
2737
2691
|
parent.isCropTab = temp;
|
|
2738
2692
|
}
|
|
2739
2693
|
}
|
|
@@ -2761,12 +2715,7 @@ var Draw = /** @class */ (function () {
|
|
|
2761
2715
|
parent.currObjType.isCustomCrop = false;
|
|
2762
2716
|
this.tempStrokeSettings = { strokeColor: '#fff', fillColor: '', strokeWidth: null };
|
|
2763
2717
|
var eventargs = { type: 'main', isApplyBtn: null, isCropping: false, isZooming: null };
|
|
2764
|
-
|
|
2765
|
-
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: eventargs });
|
|
2766
|
-
}
|
|
2767
|
-
else {
|
|
2768
|
-
parent.updateToolbar(parent.element, 'imageLoaded');
|
|
2769
|
-
}
|
|
2718
|
+
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: eventargs });
|
|
2770
2719
|
};
|
|
2771
2720
|
Draw.prototype.cancelPen = function () {
|
|
2772
2721
|
var parent = this.parent;
|
|
@@ -2827,12 +2776,7 @@ var Draw = /** @class */ (function () {
|
|
|
2827
2776
|
parent.clearSelection();
|
|
2828
2777
|
}
|
|
2829
2778
|
}
|
|
2830
|
-
|
|
2831
|
-
parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
|
|
2832
|
-
}
|
|
2833
|
-
else {
|
|
2834
|
-
parent.updateToolbar(parent.element, 'destroyQuickAccessToolbar');
|
|
2835
|
-
}
|
|
2779
|
+
parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
|
|
2836
2780
|
this.tempTextSettings = { text: 'Enter Text', fontFamily: parent.fontFamily.default, fontSize: null, fontRatio: null, bold: false,
|
|
2837
2781
|
italic: false, underline: false };
|
|
2838
2782
|
};
|
|
@@ -2876,12 +2820,7 @@ var Draw = /** @class */ (function () {
|
|
|
2876
2820
|
}
|
|
2877
2821
|
}
|
|
2878
2822
|
parent.currObjType.isDragging = false;
|
|
2879
|
-
|
|
2880
|
-
parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
|
|
2881
|
-
}
|
|
2882
|
-
else {
|
|
2883
|
-
parent.updateToolbar(parent.element, 'destroyQuickAccessToolbar');
|
|
2884
|
-
}
|
|
2823
|
+
parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
|
|
2885
2824
|
};
|
|
2886
2825
|
Draw.prototype.cancelSelection = function () {
|
|
2887
2826
|
var parent = this.parent;
|
|
@@ -3070,7 +3009,6 @@ var Draw = /** @class */ (function () {
|
|
|
3070
3009
|
}
|
|
3071
3010
|
};
|
|
3072
3011
|
Draw.prototype.updateSelectionInsert = function (points) {
|
|
3073
|
-
var _this = this;
|
|
3074
3012
|
var parent = this.parent;
|
|
3075
3013
|
var actPoint = parent.activeObj.activePoint;
|
|
3076
3014
|
var obj = { shapeSettingsObj: {} };
|
|
@@ -3079,41 +3017,20 @@ var Draw = /** @class */ (function () {
|
|
|
3079
3017
|
startY: obj['shapeSettingsObj']['startY'], width: obj['shapeSettingsObj']['width'], height: obj['shapeSettingsObj']['height'] };
|
|
3080
3018
|
var selectionChangingArgs = { action: 'insert', previousSelectionSettings: selectionSettings,
|
|
3081
3019
|
currentSelectionSettings: selectionSettings };
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
if (selectionChangingArgs.currentSelectionSettings.type === 'Custom') {
|
|
3088
|
-
_this.drawObject('duplicate', parent.activeObj, null, null, true);
|
|
3089
|
-
}
|
|
3090
|
-
else {
|
|
3091
|
-
if (actPoint.startX !== 0 || actPoint.startY !== 0 ||
|
|
3092
|
-
actPoint.width !== 0 || actPoint.height !== 0) {
|
|
3093
|
-
points = { startX: actPoint.startX, startY: actPoint.startY,
|
|
3094
|
-
endX: actPoint.endX, endY: actPoint.endY,
|
|
3095
|
-
width: actPoint.width, height: actPoint.height };
|
|
3096
|
-
}
|
|
3097
|
-
_this.drawObject('duplicate', null, true, points);
|
|
3098
|
-
}
|
|
3099
|
-
});
|
|
3020
|
+
parent.trigger('selectionChanging', selectionChangingArgs);
|
|
3021
|
+
parent.notify('shape', { prop: 'updSelChangeEventArgs', onPropertyChange: false,
|
|
3022
|
+
value: { selectionSettings: selectionChangingArgs.currentSelectionSettings } });
|
|
3023
|
+
if (selectionChangingArgs.currentSelectionSettings.type === 'Custom') {
|
|
3024
|
+
this.drawObject('duplicate', parent.activeObj, null, null, true);
|
|
3100
3025
|
}
|
|
3101
3026
|
else {
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
}
|
|
3108
|
-
else {
|
|
3109
|
-
if (actPoint.startX !== 0 || actPoint.startY !== 0 ||
|
|
3110
|
-
actPoint.width !== 0 || actPoint.height !== 0) {
|
|
3111
|
-
points = { startX: actPoint.startX, startY: actPoint.startY,
|
|
3112
|
-
endX: actPoint.endX, endY: actPoint.endY,
|
|
3113
|
-
width: actPoint.width, height: actPoint.height };
|
|
3114
|
-
}
|
|
3115
|
-
this.drawObject('duplicate', null, true, points);
|
|
3027
|
+
if (actPoint.startX !== 0 || actPoint.startY !== 0 ||
|
|
3028
|
+
actPoint.width !== 0 || actPoint.height !== 0) {
|
|
3029
|
+
points = { startX: actPoint.startX, startY: actPoint.startY,
|
|
3030
|
+
endX: actPoint.endX, endY: actPoint.endY,
|
|
3031
|
+
width: actPoint.width, height: actPoint.height };
|
|
3116
3032
|
}
|
|
3033
|
+
this.drawObject('duplicate', null, true, points);
|
|
3117
3034
|
}
|
|
3118
3035
|
};
|
|
3119
3036
|
Draw.prototype.drawCustomSelection = function (cropShape, startX, startY, width, height) {
|
|
@@ -3692,19 +3609,12 @@ var Draw = /** @class */ (function () {
|
|
|
3692
3609
|
});
|
|
3693
3610
|
this.imgCanvasPoints = points;
|
|
3694
3611
|
var count = 0;
|
|
3695
|
-
if (
|
|
3696
|
-
(isBlazor() && parent.transform.straighten === 5 && !this.preventStraightening)) {
|
|
3612
|
+
if (parent.transform.straighten === 3 && !this.preventStraightening) {
|
|
3697
3613
|
this.preventStraightening = true;
|
|
3698
3614
|
var temp = parent.prevStraightenedDegree;
|
|
3699
3615
|
parent.prevStraightenedDegree = parent.transform.straighten;
|
|
3700
3616
|
parent.setStraighten(0);
|
|
3701
|
-
|
|
3702
|
-
parent.setStraighten(5);
|
|
3703
|
-
}
|
|
3704
|
-
else {
|
|
3705
|
-
parent.setStraighten(3);
|
|
3706
|
-
}
|
|
3707
|
-
;
|
|
3617
|
+
parent.setStraighten(3);
|
|
3708
3618
|
parent.prevStraightenedDegree = temp;
|
|
3709
3619
|
this.preventStraightening = false;
|
|
3710
3620
|
}
|
|
@@ -3741,19 +3651,12 @@ var Draw = /** @class */ (function () {
|
|
|
3741
3651
|
toolbar.style.display = 'none';
|
|
3742
3652
|
}
|
|
3743
3653
|
var obj = { defToolbarItems: null };
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
parent.notify('toolbar', { prop: 'setToolbarHeight', value: { height: height } });
|
|
3751
|
-
}
|
|
3752
|
-
}
|
|
3753
|
-
else {
|
|
3754
|
-
if (parent.element.querySelector('#' + id + '_toolbarArea')) {
|
|
3755
|
-
parent.toolbarHeight = parent.element.querySelector('#' + id + '_toolbarArea').clientHeight;
|
|
3756
|
-
}
|
|
3654
|
+
parent.notify('toolbar', { prop: 'getDefToolbarItems', value: { obj: obj } });
|
|
3655
|
+
if (obj['defToolbarItems'].length === 0 &&
|
|
3656
|
+
(isNullOrUndefined(document.getElementById(id + '_toolbar'))) &&
|
|
3657
|
+
parent.element.querySelector('#' + id + '_toolbarArea')) {
|
|
3658
|
+
var height = parent.element.querySelector('#' + id + '_toolbarArea').clientHeight;
|
|
3659
|
+
parent.notify('toolbar', { prop: 'setToolbarHeight', value: { height: height } });
|
|
3757
3660
|
}
|
|
3758
3661
|
parent.reset();
|
|
3759
3662
|
parent.update();
|
|
@@ -3819,9 +3722,7 @@ var Draw = /** @class */ (function () {
|
|
|
3819
3722
|
this.reset();
|
|
3820
3723
|
this.openNewImage();
|
|
3821
3724
|
}
|
|
3822
|
-
|
|
3823
|
-
getComponent(document.getElementById(parent.element.id + '_dialog'), 'dialog').destroy();
|
|
3824
|
-
}
|
|
3725
|
+
getComponent(document.getElementById(parent.element.id + '_dialog'), 'dialog').destroy();
|
|
3825
3726
|
this.isImageEdited = false;
|
|
3826
3727
|
};
|
|
3827
3728
|
Draw.prototype.showDialogPopup = function () {
|
|
@@ -3930,12 +3831,7 @@ var Draw = /** @class */ (function () {
|
|
|
3930
3831
|
this.openURL = url;
|
|
3931
3832
|
if (parent.isImageLoaded && !parent.isChangesSaved && (this.isImageEdited || parent.pointColl.length > 0 || parent.objColl.length > 0)) {
|
|
3932
3833
|
this.isFileChanged = true;
|
|
3933
|
-
|
|
3934
|
-
this.showDialogPopup();
|
|
3935
|
-
}
|
|
3936
|
-
else {
|
|
3937
|
-
parent.dotNetRef.invokeMethodAsync('UpdateDialog', true);
|
|
3938
|
-
}
|
|
3834
|
+
this.showDialogPopup();
|
|
3939
3835
|
}
|
|
3940
3836
|
else {
|
|
3941
3837
|
this.checkToolbarTemplate(inputElement, url);
|
|
@@ -4508,7 +4404,6 @@ var Draw = /** @class */ (function () {
|
|
|
4508
4404
|
}
|
|
4509
4405
|
};
|
|
4510
4406
|
Draw.prototype.triggerFrameChange = function (prevFrameSettings) {
|
|
4511
|
-
var _this = this;
|
|
4512
4407
|
var parent = this.parent;
|
|
4513
4408
|
var currFrameSettings = { type: parent.toPascalCase(parent.frameObj.type),
|
|
4514
4409
|
color: parent.frameObj.color, gradientColor: parent.frameObj.gradientColor, size: parent.frameObj.size,
|
|
@@ -4516,59 +4411,9 @@ var Draw = /** @class */ (function () {
|
|
|
4516
4411
|
frameLineStyle: parent.toPascalCase(parent.frameObj.border), lineCount: parent.frameObj.amount };
|
|
4517
4412
|
var frameChange = { cancel: false, previousFrameSetting: prevFrameSettings,
|
|
4518
4413
|
currentFrameSetting: currFrameSettings };
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
parent.dotNetRef.invokeMethodAsync('OnFrameChangingAsync', 'FrameChanging', frameChange, null).then(function (args) {
|
|
4523
|
-
if (!args.cancel) {
|
|
4524
|
-
_this.setFrameObj(args.currentFrameSetting);
|
|
4525
|
-
var obj = { currObj: {} };
|
|
4526
|
-
parent.notify('filter', { prop: 'getCurrentObj', onPropertyChange: false, value: { object: obj } });
|
|
4527
|
-
parent.notify('undo-redo', { prop: 'updateUndoRedoColl', onPropertyChange: false, value: {
|
|
4528
|
-
operation: 'frame', previousObj: obj['currObj'], previousObjColl: obj['currObj']['objColl'],
|
|
4529
|
-
previousPointColl: obj['currObj']['pointColl'], previousSelPointColl: obj['currObj']['selPointColl'],
|
|
4530
|
-
previousCropObj: extend({}, parent.cropObj, {}, true), previousText: null, currentText: null,
|
|
4531
|
-
previousFilter: null, isCircleCrop: null
|
|
4532
|
-
} });
|
|
4533
|
-
var fillColorDiv = parent.element.querySelector('.e-ie-toolbar-e-frame-color');
|
|
4534
|
-
if (fillColorDiv) {
|
|
4535
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
4536
|
-
parent.element.querySelector('.e-ie-toolbar-e-frame-color' + parent.DDBPREVIEW).style.background = parent.frameObj.color;
|
|
4537
|
-
}
|
|
4538
|
-
var graColorDiv = parent.element.querySelector('.e-ie-toolbar-e-frame-gradient');
|
|
4539
|
-
if (graColorDiv) {
|
|
4540
|
-
var noColorDiv = document.querySelector('.e-dropdown-popup.e-frame-gradient-dd-btn');
|
|
4541
|
-
if (noColorDiv) {
|
|
4542
|
-
noColorDiv.querySelector('.e-nocolor-item').classList.remove('e-selected');
|
|
4543
|
-
}
|
|
4544
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
4545
|
-
parent.element.querySelector('.e-ie-toolbar-e-frame-gradient' + parent.DDBPREVIEW).classList.remove('e-nocolor-item');
|
|
4546
|
-
if (parent.frameObj.gradientColor === '') {
|
|
4547
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
4548
|
-
parent.element.querySelector('.e-ie-toolbar-e-frame-gradient' + parent.DDBPREVIEW).classList.add('e-nocolor-item');
|
|
4549
|
-
}
|
|
4550
|
-
else {
|
|
4551
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
4552
|
-
parent.element.querySelector('.e-ie-toolbar-e-frame-gradient' + parent.DDBPREVIEW).style.background = parent.frameObj.gradientColor;
|
|
4553
|
-
}
|
|
4554
|
-
}
|
|
4555
|
-
parent.notify('draw', { prop: 'render-image', value: { isMouseWheel: null } });
|
|
4556
|
-
parent.curFrameObjEvent = { currentFrameSetting: args.currentFrameSetting };
|
|
4557
|
-
parent.isFrameBtnClick = true;
|
|
4558
|
-
}
|
|
4559
|
-
});
|
|
4560
|
-
}
|
|
4561
|
-
else {
|
|
4562
|
-
if (!frameChange.cancel) {
|
|
4563
|
-
this.setFrameObj(frameChange.currentFrameSetting);
|
|
4564
|
-
}
|
|
4565
|
-
}
|
|
4566
|
-
}
|
|
4567
|
-
else {
|
|
4568
|
-
parent.trigger('frameChange', frameChange);
|
|
4569
|
-
if (!frameChange.cancel) {
|
|
4570
|
-
this.setFrameObj(frameChange.currentFrameSetting);
|
|
4571
|
-
}
|
|
4414
|
+
parent.trigger('frameChange', frameChange);
|
|
4415
|
+
if (!frameChange.cancel) {
|
|
4416
|
+
this.setFrameObj(frameChange.currentFrameSetting);
|
|
4572
4417
|
}
|
|
4573
4418
|
return frameChange;
|
|
4574
4419
|
};
|