@wizishop/img-manager 0.2.99 → 0.2.102
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/assets/i18n/fr.json +1 -1
- package/bundles/wizishop-img-manager.umd.js +238 -195
- package/bundles/wizishop-img-manager.umd.js.map +1 -1
- package/bundles/wizishop-img-manager.umd.min.js +2 -2
- package/bundles/wizishop-img-manager.umd.min.js.map +1 -1
- package/esm2015/lib/components/canva-btn/canva-btn.component.js +7 -82
- package/esm2015/lib/components/images-view/images-view.component.js +2 -2
- package/esm2015/lib/components/img-editor/img-editor.component.js +2 -2
- package/esm2015/lib/components/img-upload/img-upload.component.js +23 -4
- package/esm2015/lib/components/pexels-lib/pexels-lib.component.js +5 -2
- package/esm2015/lib/components/upload-list/upload-list.component.js +2 -2
- package/esm2015/lib/services/canva.service.js +88 -5
- package/esm2015/lib/wz-img-manager.component.js +15 -1
- package/esm2015/wizishop-img-manager.js +4 -4
- package/esm5/lib/components/canva-btn/canva-btn.component.js +7 -88
- package/esm5/lib/components/images-view/images-view.component.js +2 -2
- package/esm5/lib/components/img-editor/img-editor.component.js +2 -2
- package/esm5/lib/components/img-upload/img-upload.component.js +23 -4
- package/esm5/lib/components/pexels-lib/pexels-lib.component.js +5 -2
- package/esm5/lib/components/upload-list/upload-list.component.js +2 -2
- package/esm5/lib/services/canva.service.js +94 -5
- package/esm5/lib/wz-img-manager.component.js +19 -1
- package/esm5/wizishop-img-manager.js +4 -4
- package/fesm2015/wizishop-img-manager.js +221 -182
- package/fesm2015/wizishop-img-manager.js.map +1 -1
- package/fesm5/wizishop-img-manager.js +236 -193
- package/fesm5/wizishop-img-manager.js.map +1 -1
- package/lib/components/canva-btn/canva-btn.component.d.ts +2 -19
- package/lib/components/img-upload/img-upload.component.d.ts +3 -0
- package/lib/services/canva.service.d.ts +20 -1
- package/lib/wz-img-manager.component.d.ts +2 -0
- package/package.json +1 -1
- package/wizishop-img-manager-0.2.102.tgz +0 -0
- package/wizishop-img-manager.d.ts +3 -3
- package/wizishop-img-manager.metadata.json +1 -1
- package/wz-img-manager.scss +2563 -2559
- package/wizishop-img-manager-0.2.99.tgz +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __values, __decorate, __metadata, __extends, __assign, __read, __param, __spread } from 'tslib';
|
|
2
|
-
import { ɵɵdefineInjectable, Injectable, ɵɵinject, EventEmitter, Input, Output, HostListener, Component, ViewChild, ElementRef, HostBinding, Directive,
|
|
3
|
-
import { ReplaySubject, Observable,
|
|
2
|
+
import { ɵɵdefineInjectable, Injectable, ɵɵinject, EventEmitter, Input, Output, HostListener, Component, ViewChild, ElementRef, HostBinding, Directive, ViewEncapsulation, Pipe, ApplicationRef, Renderer2, Inject, ComponentFactoryResolver, Injector, NgModule } from '@angular/core';
|
|
3
|
+
import { ReplaySubject, Observable, Subject, BehaviorSubject, forkJoin } from 'rxjs';
|
|
4
4
|
import { HttpParams, HttpHeaders, HttpClient, HttpClientModule } from '@angular/common/http';
|
|
5
|
-
import { trigger, state, style, transition, animate, query, stagger } from '@angular/animations';
|
|
6
5
|
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
|
7
6
|
import { NwbAlertService, NwbFilterRoutingBuilder, NwbAllModule } from '@wizishop/ng-wizi-bulma';
|
|
8
|
-
import { debounceTime, map,
|
|
7
|
+
import { take, debounceTime, map, takeUntil, distinctUntilChanged, tap } from 'rxjs/operators';
|
|
8
|
+
import { trigger, state, style, transition, animate, query, stagger } from '@angular/animations';
|
|
9
9
|
import { Router } from '@angular/router';
|
|
10
10
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
11
11
|
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
@@ -402,9 +402,114 @@ var UserSettingsService = /** @class */ (function () {
|
|
|
402
402
|
return UserSettingsService;
|
|
403
403
|
}());
|
|
404
404
|
|
|
405
|
+
var AlertService = /** @class */ (function () {
|
|
406
|
+
function AlertService(nwbAlertService, translateService) {
|
|
407
|
+
this.nwbAlertService = nwbAlertService;
|
|
408
|
+
this.translateService = translateService;
|
|
409
|
+
this.actionMsg = 'ImgManager.alert.action';
|
|
410
|
+
this.alertConfig = {
|
|
411
|
+
message: '',
|
|
412
|
+
duration: 5000
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
AlertService.prototype.openAlert = function (msgKey) {
|
|
416
|
+
var _this = this;
|
|
417
|
+
this.closePreviousAlert();
|
|
418
|
+
this.translateService.get(msgKey).subscribe(function (trans) {
|
|
419
|
+
_this.alertConfig.message = trans;
|
|
420
|
+
_this.setAlertColor(msgKey);
|
|
421
|
+
_this.alertRefComponent = _this.nwbAlertService.open(_this.alertConfig);
|
|
422
|
+
_this.alertRefComponent.afterClosed().subscribe();
|
|
423
|
+
});
|
|
424
|
+
};
|
|
425
|
+
AlertService.prototype.openAlertWithBackendRespons = function (msgKey, msgBackend) {
|
|
426
|
+
var _this = this;
|
|
427
|
+
this.translateService.get(msgKey).subscribe(function (trans) {
|
|
428
|
+
_this.alertConfig.message = trans;
|
|
429
|
+
_this.alertConfig.message += '<br/>' + JSON.parse(msgBackend).message;
|
|
430
|
+
_this.closePreviousAlert();
|
|
431
|
+
_this.alertRefComponent = _this.nwbAlertService.open(_this.alertConfig);
|
|
432
|
+
_this.alertRefComponent.afterClosed().subscribe();
|
|
433
|
+
});
|
|
434
|
+
};
|
|
435
|
+
AlertService.prototype.closePreviousAlert = function () {
|
|
436
|
+
if (this.alertRefComponent) {
|
|
437
|
+
this.alertRefComponent.dismiss();
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
AlertService.prototype.setAlertColor = function (msgKey) {
|
|
441
|
+
var isErrorMsg = /error/i.test(msgKey);
|
|
442
|
+
this.alertConfig.color = isErrorMsg ? 'is-danger' : 'is-success';
|
|
443
|
+
};
|
|
444
|
+
AlertService.ctorParameters = function () { return [
|
|
445
|
+
{ type: NwbAlertService },
|
|
446
|
+
{ type: TranslateService }
|
|
447
|
+
]; };
|
|
448
|
+
AlertService.ɵprov = ɵɵdefineInjectable({ factory: function AlertService_Factory() { return new AlertService(ɵɵinject(NwbAlertService), ɵɵinject(TranslateService)); }, token: AlertService, providedIn: "root" });
|
|
449
|
+
AlertService = __decorate([
|
|
450
|
+
Injectable({
|
|
451
|
+
providedIn: 'root'
|
|
452
|
+
}),
|
|
453
|
+
__metadata("design:paramtypes", [NwbAlertService,
|
|
454
|
+
TranslateService])
|
|
455
|
+
], AlertService);
|
|
456
|
+
return AlertService;
|
|
457
|
+
}());
|
|
458
|
+
|
|
459
|
+
var ImgEventService = /** @class */ (function () {
|
|
460
|
+
function ImgEventService() {
|
|
461
|
+
this.imgToEditEvent = new Subject();
|
|
462
|
+
this.imgRemoved = new Subject();
|
|
463
|
+
this.imgAdded = new Subject();
|
|
464
|
+
this.listDisplayedChange = new Subject();
|
|
465
|
+
}
|
|
466
|
+
ImgEventService.prototype.emitImgRemoved = function (id_file) {
|
|
467
|
+
this.imgRemoved.next(id_file);
|
|
468
|
+
};
|
|
469
|
+
ImgEventService.prototype.getImgRemovedEventListner = function () {
|
|
470
|
+
return this.imgRemoved.asObservable();
|
|
471
|
+
};
|
|
472
|
+
ImgEventService.prototype.emitImgToEdit = function (imgToEdit) {
|
|
473
|
+
this.imgToEditEvent.next(imgToEdit);
|
|
474
|
+
};
|
|
475
|
+
ImgEventService.prototype.getImgToEditEventListner = function () {
|
|
476
|
+
return this.imgToEditEvent.asObservable();
|
|
477
|
+
};
|
|
478
|
+
ImgEventService.prototype.emitImgAdded = function (id_file) {
|
|
479
|
+
this.imgAdded.next(id_file);
|
|
480
|
+
};
|
|
481
|
+
ImgEventService.prototype.getImgAddedEventListner = function () {
|
|
482
|
+
return this.imgAdded.asObservable();
|
|
483
|
+
};
|
|
484
|
+
ImgEventService.prototype.emitlistDisplayedChange = function (value) {
|
|
485
|
+
this.listDisplayedChange.next(value);
|
|
486
|
+
};
|
|
487
|
+
ImgEventService.prototype.getlistDisplayedChange = function () {
|
|
488
|
+
return this.listDisplayedChange.asObservable();
|
|
489
|
+
};
|
|
490
|
+
ImgEventService.ɵprov = ɵɵdefineInjectable({ factory: function ImgEventService_Factory() { return new ImgEventService(); }, token: ImgEventService, providedIn: "root" });
|
|
491
|
+
ImgEventService = __decorate([
|
|
492
|
+
Injectable({
|
|
493
|
+
providedIn: 'root'
|
|
494
|
+
}),
|
|
495
|
+
__metadata("design:paramtypes", [])
|
|
496
|
+
], ImgEventService);
|
|
497
|
+
return ImgEventService;
|
|
498
|
+
}());
|
|
499
|
+
|
|
405
500
|
var CanvaService = /** @class */ (function () {
|
|
406
|
-
function CanvaService(externalConfigService) {
|
|
501
|
+
function CanvaService(externalConfigService, imgManager, wzImgEventService, alertService, translateService) {
|
|
407
502
|
this.externalConfigService = externalConfigService;
|
|
503
|
+
this.imgManager = imgManager;
|
|
504
|
+
this.wzImgEventService = wzImgEventService;
|
|
505
|
+
this.alertService = alertService;
|
|
506
|
+
this.translateService = translateService;
|
|
507
|
+
this.imgLoading = false;
|
|
508
|
+
this.uploadingImg = 'ImgManager.CanvaBtn.uploadingImg';
|
|
509
|
+
this.successUploadPhoto = 'ImgManager.CanvaBtn.successImport';
|
|
510
|
+
this.errorUploadCanvaImg = 'ImgManager.CanvaBtn.errorUploadCanvaImg';
|
|
511
|
+
this.errorRenameCanvaImg = 'ImgManager.CanvaBtn.errorRenameCanvaImg';
|
|
512
|
+
this.forceToOpenCanva = false;
|
|
408
513
|
this.bindExpectedImgSizeEvent = new BehaviorSubject(null);
|
|
409
514
|
this.bindExpectedSizeDone = this.bindExpectedImgSizeEvent.asObservable();
|
|
410
515
|
}
|
|
@@ -420,6 +525,9 @@ var CanvaService = /** @class */ (function () {
|
|
|
420
525
|
};
|
|
421
526
|
CanvaService.prototype.expectedImgSizesChange = function (mediaDTO) {
|
|
422
527
|
this.bindExpectedImgSizeEvent.next(mediaDTO);
|
|
528
|
+
if (this.forceToOpenCanva) {
|
|
529
|
+
this.openCanva(parseInt(mediaDTO.image_width), parseInt(mediaDTO.image_height));
|
|
530
|
+
}
|
|
423
531
|
};
|
|
424
532
|
CanvaService.prototype.getCanvaApi = function () {
|
|
425
533
|
var _this = this;
|
|
@@ -474,58 +582,84 @@ var CanvaService = /** @class */ (function () {
|
|
|
474
582
|
};
|
|
475
583
|
document.getElementsByTagName('head')[0].appendChild(node);
|
|
476
584
|
};
|
|
477
|
-
CanvaService.
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
return CanvaService;
|
|
488
|
-
}());
|
|
489
|
-
|
|
490
|
-
var ImgEventService = /** @class */ (function () {
|
|
491
|
-
function ImgEventService() {
|
|
492
|
-
this.imgToEditEvent = new Subject();
|
|
493
|
-
this.imgRemoved = new Subject();
|
|
494
|
-
this.imgAdded = new Subject();
|
|
495
|
-
this.listDisplayedChange = new Subject();
|
|
496
|
-
}
|
|
497
|
-
ImgEventService.prototype.emitImgRemoved = function (id_file) {
|
|
498
|
-
this.imgRemoved.next(id_file);
|
|
499
|
-
};
|
|
500
|
-
ImgEventService.prototype.getImgRemovedEventListner = function () {
|
|
501
|
-
return this.imgRemoved.asObservable();
|
|
502
|
-
};
|
|
503
|
-
ImgEventService.prototype.emitImgToEdit = function (imgToEdit) {
|
|
504
|
-
this.imgToEditEvent.next(imgToEdit);
|
|
505
|
-
};
|
|
506
|
-
ImgEventService.prototype.getImgToEditEventListner = function () {
|
|
507
|
-
return this.imgToEditEvent.asObservable();
|
|
585
|
+
CanvaService.prototype.openCanva = function (width, height) {
|
|
586
|
+
var _this = this;
|
|
587
|
+
if (this.imgLoading) {
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
this.getCanvaApi().pipe(take(1)).subscribe(function (api) {
|
|
591
|
+
_this.canvaApi = api;
|
|
592
|
+
_this.addOverflowBody();
|
|
593
|
+
_this.createDesign(width, height);
|
|
594
|
+
});
|
|
508
595
|
};
|
|
509
|
-
|
|
510
|
-
|
|
596
|
+
CanvaService.prototype.addOverflowBody = function () {
|
|
597
|
+
document.body.classList.add('ovh-canva');
|
|
511
598
|
};
|
|
512
|
-
|
|
513
|
-
|
|
599
|
+
CanvaService.prototype.removeOverflowBody = function () {
|
|
600
|
+
document.body.classList.remove('ovh-canva');
|
|
514
601
|
};
|
|
515
|
-
|
|
516
|
-
this
|
|
602
|
+
CanvaService.prototype.createDesign = function (width, height) {
|
|
603
|
+
var _this = this;
|
|
604
|
+
var createDesign = {
|
|
605
|
+
type: 'EtsyShopIcon',
|
|
606
|
+
dimensions: {
|
|
607
|
+
units: 'px',
|
|
608
|
+
width: width ? width : undefined,
|
|
609
|
+
height: height ? height : undefined,
|
|
610
|
+
},
|
|
611
|
+
publishLabel: this.translateService.instant('ImgManager.CanvaBtn.publish'),
|
|
612
|
+
};
|
|
613
|
+
this.canvaApi.createDesign({
|
|
614
|
+
design: createDesign,
|
|
615
|
+
onDesignPublish: function (_a) {
|
|
616
|
+
var exportUrl = _a.exportUrl, designTitle = _a.designTitle;
|
|
617
|
+
return _this.designPublished(exportUrl, designTitle);
|
|
618
|
+
},
|
|
619
|
+
onDesignClose: function () {
|
|
620
|
+
_this.removeOverflowBody();
|
|
621
|
+
}
|
|
622
|
+
});
|
|
517
623
|
};
|
|
518
|
-
|
|
519
|
-
|
|
624
|
+
CanvaService.prototype.designPublished = function (exportUrl, designTitle) {
|
|
625
|
+
var _this = this;
|
|
626
|
+
this.alertService.openAlert(this.uploadingImg);
|
|
627
|
+
this.imgLoading = true;
|
|
628
|
+
this.imgManager.uploadFileByUrl(exportUrl, designTitle).pipe(take(1)).subscribe(function (img) {
|
|
629
|
+
_this.imgLoading = false;
|
|
630
|
+
_this.removeOverflowBody();
|
|
631
|
+
_this.wzImgEventService.emitImgAdded(img.id_file);
|
|
632
|
+
_this.alertService.openAlert(_this.successUploadPhoto);
|
|
633
|
+
}, function (error) {
|
|
634
|
+
_this.imgLoading = false;
|
|
635
|
+
_this.removeOverflowBody();
|
|
636
|
+
if (error.error.code === 406 && error.error.message) {
|
|
637
|
+
_this.alertService.openAlertWithBackendRespons(_this.errorUploadCanvaImg, error.error.message);
|
|
638
|
+
}
|
|
639
|
+
else {
|
|
640
|
+
_this.alertService.openAlert(_this.errorUploadCanvaImg);
|
|
641
|
+
}
|
|
642
|
+
});
|
|
520
643
|
};
|
|
521
|
-
|
|
522
|
-
|
|
644
|
+
CanvaService.ctorParameters = function () { return [
|
|
645
|
+
{ type: ImgManagerConfigService },
|
|
646
|
+
{ type: ImgManagerService },
|
|
647
|
+
{ type: ImgEventService },
|
|
648
|
+
{ type: AlertService },
|
|
649
|
+
{ type: TranslateService }
|
|
650
|
+
]; };
|
|
651
|
+
CanvaService.ɵprov = ɵɵdefineInjectable({ factory: function CanvaService_Factory() { return new CanvaService(ɵɵinject(ImgManagerConfigService), ɵɵinject(ImgManagerService), ɵɵinject(ImgEventService), ɵɵinject(AlertService), ɵɵinject(TranslateService)); }, token: CanvaService, providedIn: "root" });
|
|
652
|
+
CanvaService = __decorate([
|
|
523
653
|
Injectable({
|
|
524
654
|
providedIn: 'root'
|
|
525
655
|
}),
|
|
526
|
-
__metadata("design:paramtypes", [
|
|
527
|
-
|
|
528
|
-
|
|
656
|
+
__metadata("design:paramtypes", [ImgManagerConfigService,
|
|
657
|
+
ImgManagerService,
|
|
658
|
+
ImgEventService,
|
|
659
|
+
AlertService,
|
|
660
|
+
TranslateService])
|
|
661
|
+
], CanvaService);
|
|
662
|
+
return CanvaService;
|
|
529
663
|
}());
|
|
530
664
|
|
|
531
665
|
var DomService = /** @class */ (function () {
|
|
@@ -578,6 +712,19 @@ var WzImgManagerComponent = /** @class */ (function () {
|
|
|
578
712
|
this.listDisplayed = false;
|
|
579
713
|
this.hideTab = false;
|
|
580
714
|
}
|
|
715
|
+
Object.defineProperty(WzImgManagerComponent.prototype, "forceToOpenCanva", {
|
|
716
|
+
// If forceToOpenCanva is true : Canva will open with the canvaService.expectedImgSizesChange
|
|
717
|
+
// If forceToOpenCanva is a WiziBlockMediaDto, Canva open immediatly
|
|
718
|
+
set: function (forceToOpenCanva) {
|
|
719
|
+
this.canvaService.forceToOpenCanva = !!forceToOpenCanva;
|
|
720
|
+
if (typeof forceToOpenCanva === 'boolean') {
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
this.canvaService.expectedImgSizesChange(forceToOpenCanva);
|
|
724
|
+
},
|
|
725
|
+
enumerable: true,
|
|
726
|
+
configurable: true
|
|
727
|
+
});
|
|
581
728
|
Object.defineProperty(WzImgManagerComponent.prototype, "multipleImgMode", {
|
|
582
729
|
get: function () {
|
|
583
730
|
return this._multipleImgMode;
|
|
@@ -726,6 +873,11 @@ var WzImgManagerComponent = /** @class */ (function () {
|
|
|
726
873
|
Input(),
|
|
727
874
|
__metadata("design:type", ImgManagerConfigDto)
|
|
728
875
|
], WzImgManagerComponent.prototype, "externalConfig", void 0);
|
|
876
|
+
__decorate([
|
|
877
|
+
Input(),
|
|
878
|
+
__metadata("design:type", Object),
|
|
879
|
+
__metadata("design:paramtypes", [Object])
|
|
880
|
+
], WzImgManagerComponent.prototype, "forceToOpenCanva", null);
|
|
729
881
|
__decorate([
|
|
730
882
|
Output(),
|
|
731
883
|
__metadata("design:type", Object)
|
|
@@ -772,60 +924,6 @@ var easeInOut = // the fade-in/fade-out animation.
|
|
|
772
924
|
]),
|
|
773
925
|
]);
|
|
774
926
|
|
|
775
|
-
var AlertService = /** @class */ (function () {
|
|
776
|
-
function AlertService(nwbAlertService, translateService) {
|
|
777
|
-
this.nwbAlertService = nwbAlertService;
|
|
778
|
-
this.translateService = translateService;
|
|
779
|
-
this.actionMsg = 'ImgManager.alert.action';
|
|
780
|
-
this.alertConfig = {
|
|
781
|
-
message: '',
|
|
782
|
-
duration: 5000
|
|
783
|
-
};
|
|
784
|
-
}
|
|
785
|
-
AlertService.prototype.openAlert = function (msgKey) {
|
|
786
|
-
var _this = this;
|
|
787
|
-
this.closePreviousAlert();
|
|
788
|
-
this.translateService.get(msgKey).subscribe(function (trans) {
|
|
789
|
-
_this.alertConfig.message = trans;
|
|
790
|
-
_this.setAlertColor(msgKey);
|
|
791
|
-
_this.alertRefComponent = _this.nwbAlertService.open(_this.alertConfig);
|
|
792
|
-
_this.alertRefComponent.afterClosed().subscribe();
|
|
793
|
-
});
|
|
794
|
-
};
|
|
795
|
-
AlertService.prototype.openAlertWithBackendRespons = function (msgKey, msgBackend) {
|
|
796
|
-
var _this = this;
|
|
797
|
-
this.translateService.get(msgKey).subscribe(function (trans) {
|
|
798
|
-
_this.alertConfig.message = trans;
|
|
799
|
-
_this.alertConfig.message += '<br/>' + JSON.parse(msgBackend).message;
|
|
800
|
-
_this.closePreviousAlert();
|
|
801
|
-
_this.alertRefComponent = _this.nwbAlertService.open(_this.alertConfig);
|
|
802
|
-
_this.alertRefComponent.afterClosed().subscribe();
|
|
803
|
-
});
|
|
804
|
-
};
|
|
805
|
-
AlertService.prototype.closePreviousAlert = function () {
|
|
806
|
-
if (this.alertRefComponent) {
|
|
807
|
-
this.alertRefComponent.dismiss();
|
|
808
|
-
}
|
|
809
|
-
};
|
|
810
|
-
AlertService.prototype.setAlertColor = function (msgKey) {
|
|
811
|
-
var isErrorMsg = /error/i.test(msgKey);
|
|
812
|
-
this.alertConfig.color = isErrorMsg ? 'is-danger' : 'is-success';
|
|
813
|
-
};
|
|
814
|
-
AlertService.ctorParameters = function () { return [
|
|
815
|
-
{ type: NwbAlertService },
|
|
816
|
-
{ type: TranslateService }
|
|
817
|
-
]; };
|
|
818
|
-
AlertService.ɵprov = ɵɵdefineInjectable({ factory: function AlertService_Factory() { return new AlertService(ɵɵinject(NwbAlertService), ɵɵinject(TranslateService)); }, token: AlertService, providedIn: "root" });
|
|
819
|
-
AlertService = __decorate([
|
|
820
|
-
Injectable({
|
|
821
|
-
providedIn: 'root'
|
|
822
|
-
}),
|
|
823
|
-
__metadata("design:paramtypes", [NwbAlertService,
|
|
824
|
-
TranslateService])
|
|
825
|
-
], AlertService);
|
|
826
|
-
return AlertService;
|
|
827
|
-
}());
|
|
828
|
-
|
|
829
927
|
var ImgUploadComponent = /** @class */ (function () {
|
|
830
928
|
function ImgUploadComponent(imgManager, alertService, externalConfigService) {
|
|
831
929
|
this.imgManager = imgManager;
|
|
@@ -837,6 +935,7 @@ var ImgUploadComponent = /** @class */ (function () {
|
|
|
837
935
|
this.loadingText = 'ImgManager.ImgUpload.loading';
|
|
838
936
|
this.errorUploadingImg = 'ImgManager.ImgUpload.errorUploadingImg';
|
|
839
937
|
this.errorNotImg = 'ImgManager.ImgUpload.errorNotImg';
|
|
938
|
+
this.MAX_IMAGE_SIZE = 10000000; // In bytes
|
|
840
939
|
}
|
|
841
940
|
ImgUploadComponent.prototype.ngOnInit = function () {
|
|
842
941
|
this.assetsIcon = this.getAssets();
|
|
@@ -862,13 +961,19 @@ var ImgUploadComponent = /** @class */ (function () {
|
|
|
862
961
|
try {
|
|
863
962
|
for (var files_1 = __values(files), files_1_1 = files_1.next(); !files_1_1.done; files_1_1 = files_1.next()) {
|
|
864
963
|
var file = files_1_1.value;
|
|
865
|
-
|
|
866
|
-
formData.append('image', file, file.name);
|
|
964
|
+
console.log('file', file.size);
|
|
867
965
|
if (!this.isFileImage(file.type)) {
|
|
868
966
|
this.alertService.openAlert(this.errorNotImg);
|
|
869
967
|
this.isLoading = false;
|
|
870
968
|
continue;
|
|
871
969
|
}
|
|
970
|
+
if (!this.isSizeValid(file.size)) {
|
|
971
|
+
this.alertService.openAlert("L'image : " + file.name + " est trop grande (" + this.getImageSizeInKo(file.size) + "ko). Taille maximum accept\u00E9e: " + this.getImageSizeInKo(this.MAX_IMAGE_SIZE) + "ko");
|
|
972
|
+
this.isLoading = false;
|
|
973
|
+
continue;
|
|
974
|
+
}
|
|
975
|
+
var formData = new FormData();
|
|
976
|
+
formData.append('image', file, file.name);
|
|
872
977
|
imgToUploadList.push(this.imgManager.uploadFile(formData));
|
|
873
978
|
}
|
|
874
979
|
}
|
|
@@ -883,7 +988,13 @@ var ImgUploadComponent = /** @class */ (function () {
|
|
|
883
988
|
_this.onImgUpload(img),
|
|
884
989
|
_this.isLoading = false;
|
|
885
990
|
}, function (error) {
|
|
886
|
-
|
|
991
|
+
var _a, _b;
|
|
992
|
+
if (((_b = (_a = error) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.message) && error.statusText !== 'Bad Request') {
|
|
993
|
+
_this.alertService.openAlertWithBackendRespons(_this.errorUploadingImg, error.error.message);
|
|
994
|
+
}
|
|
995
|
+
else {
|
|
996
|
+
_this.alertService.openAlert(_this.errorUploadingImg);
|
|
997
|
+
}
|
|
887
998
|
_this.isLoading = false;
|
|
888
999
|
});
|
|
889
1000
|
};
|
|
@@ -898,6 +1009,12 @@ var ImgUploadComponent = /** @class */ (function () {
|
|
|
898
1009
|
ImgUploadComponent.prototype.isFileImage = function (fileType) {
|
|
899
1010
|
return fileType.split('/')[0] === 'image';
|
|
900
1011
|
};
|
|
1012
|
+
ImgUploadComponent.prototype.isSizeValid = function (imageBytesSize) {
|
|
1013
|
+
return imageBytesSize < this.MAX_IMAGE_SIZE;
|
|
1014
|
+
};
|
|
1015
|
+
ImgUploadComponent.prototype.getImageSizeInKo = function (size) {
|
|
1016
|
+
return Math.round(size / 1024);
|
|
1017
|
+
};
|
|
901
1018
|
/**
|
|
902
1019
|
* Remove the style of the drag and drop box
|
|
903
1020
|
* After an img is droped, the box is still grey
|
|
@@ -1101,7 +1218,7 @@ var UploadListComponent = /** @class */ (function () {
|
|
|
1101
1218
|
UploadListComponent = __decorate([
|
|
1102
1219
|
Component({
|
|
1103
1220
|
selector: 'upload-list',
|
|
1104
|
-
template: "<div class=\"upload-list\" [ngClass]=\"{'smallDisplay': stateDisplayed === 'small'}\" [@easeInOut]=\"'in'\">\n\n <
|
|
1221
|
+
template: "<div class=\"upload-list\" [ngClass]=\"{'smallDisplay': stateDisplayed === 'small'}\" [@easeInOut]=\"'in'\">\n\n <perfect-scrollbar\n #scrollable\n class=\"upload-list__scroll\"\n [ngClass]=\"{\n 'upload-list__scroll--smallDisplay': stateDisplayed === 'small',\n 'upload-list__scroll--window': stateDisplayed === 'window'}\"\n >\n <div class=\"upload-list__box\">\n <div class=\"upload-list__box__container\">\n <div>\n <p class=\"mainColor\">\n {{ picturesList? picturesList.length : '' }}\n <ng-container *ngIf=\"picturesList && picturesList.length > 1\">{{ 'ImgManager.UploadList.imgSuccessImport' | translate }}</ng-container>\n <ng-container *ngIf=\"picturesList && picturesList.length === 1\">{{ 'ImgManager.UploadList.imgSuccessImportOne' | translate }}</ng-container>\n </p>\n <div class=\"dropdown is-hoverable\">\n <div class=\"dropdown-trigger\">\n <i\n aria-haspopup=\"true\" aria-controls=\"dropdown-menuInfoSeo\"\n class=\"fas fa-info-circle\">\n </i>\n </div>\n <div class=\"dropdown-menu dropDownShadow\" id=\"dropdown-menuInfoSeo\" role=\"menu\">\n <div class=\"dropdown-content\">\n <div class=\"dropdown-item\">\n <p>{{ 'ImgManager.UploadList.seo.rezise' | translate }}</p>\n <p><i class=\"fal fa-check\"></i> 100%</p>\n </div>\n <div class=\"dropdown-item\">\n <p>{{ 'ImgManager.UploadList.seo.webp' | translate }}</p>\n <p><i class=\"fal fa-check\"></i> 100%</p>\n </div>\n <div class=\"dropdown-item\">\n <p>{{ 'ImgManager.UploadList.seo.cdn' | translate }}</p>\n <p><i class=\"fal fa-check\"></i> 100%</p>\n </div>\n <div class=\"dropdown-item\">\n <p>{{ 'ImgManager.UploadList.seo.lazyloading' | translate }}</p>\n <p><i class=\"fal fa-check\"></i> 100%</p>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"upload-list__box__cards\">\n <div class=\"upload-list__box__cards__card\" *ngFor=\"let picture of picturesList; let index = index;\">\n <img-card\n [picture]=\"picture\"\n [stateDisplayed]=\"stateDisplayed\"\n (toggleImgSelected)=\"onToggleSelectImg(index)\"\n (switchDisplayWindow)=\"switchDisplayWindowCard()\"\n (pictureNameChange)=\"onRenamePicture($event)\"\n ></img-card>\n <div class=\"upload-list__box__cards__card__btnBox\">\n <button class=\"button success upload-list__box__cards__card__btnBox__btn\"><i class=\"fal fa-check\"></i></button>\n </div>\n </div>\n </div>\n </div>\n </perfect-scrollbar>\n</div>\n",
|
|
1105
1222
|
animations: [
|
|
1106
1223
|
easeInOut
|
|
1107
1224
|
]
|
|
@@ -1444,6 +1561,7 @@ var PexelLibComponent = /** @class */ (function () {
|
|
|
1444
1561
|
};
|
|
1445
1562
|
PexelLibComponent.prototype.search = function () {
|
|
1446
1563
|
var _this = this;
|
|
1564
|
+
console.log('search');
|
|
1447
1565
|
if (this.isLoading) {
|
|
1448
1566
|
return;
|
|
1449
1567
|
}
|
|
@@ -1456,6 +1574,8 @@ var PexelLibComponent = /** @class */ (function () {
|
|
|
1456
1574
|
}
|
|
1457
1575
|
this.isLoading = true;
|
|
1458
1576
|
var searchSub = this.wzImgLibService.searchOnPexels(this.searchValue, this.perPage, this.currentPage).subscribe(function (data) {
|
|
1577
|
+
console.log('search ended here');
|
|
1578
|
+
console.log(data);
|
|
1459
1579
|
_this.wzImgLibDto = data;
|
|
1460
1580
|
_this.nbResult = _this.wzImgLibDto.total_results;
|
|
1461
1581
|
if (_this.nbResult) {
|
|
@@ -1570,7 +1690,7 @@ var PexelLibComponent = /** @class */ (function () {
|
|
|
1570
1690
|
PexelLibComponent = __decorate([
|
|
1571
1691
|
Component({
|
|
1572
1692
|
selector: 'pexels-lib',
|
|
1573
|
-
template: "<div class=\"pexels-lib\" #outerElement [@easeInOut]=\"'in'\">\n <
|
|
1693
|
+
template: "<div class=\"pexels-lib\" #outerElement [@easeInOut]=\"'in'\">\n <perfect-scrollbar\n scrollYMarginOffset=\"300\"\n class=\"pexels-lib__scroll\"\n [ngClass]=\"{'pexels-lib__scroll--smallDisplay': stateDisplayed === 'small'}\"\n (psYReachEnd)=\"onBottomReached()\"\n >\n <div\n *ngIf=\"!disableSearch\"\n class=\"pexels-lib__search\"\n [ngClass]=\"{'pexels-lib__search--smallDisplay': stateDisplayed === 'small'}\"\n >\n <wz-input-search\n [(ngModel)]=\"searchValue\"\n [placeholder]=\"'ImgManager.SearchBar.placeholder' | translate\"\n (changeDebounced)=\"onSearchNameChanged()\"\n [smallPadding]=\"stateDisplayed === 'small'\">\n </wz-input-search>\n </div>\n\n <div *ngIf=\"!initComponent\" class=\"pexels-lib__wrapper\">\n <p *ngIf=\"nbResult\" class=\"pexels-lib__wrapper__result-nb\">{{ 'ImgManager.PexelLib.nbImgFound' | translate }} : {{ nbResult }}</p>\n\n <div class=\"pexels-lib__wrapper__result\">\n\n <div *ngFor=\"let photosColumn of photosColumns; let indexCol = index;\" class=\"pexels-lib__wrapper__result__column\" [@listAnimation]=\"photosColumn.photos.length\">\n <div *ngFor=\"let photo of photosColumn.photos; let indexPhoto = index;\" class=\"pexels-lib__wrapper__result__column__element\">\n\n <img [alt]=\"photo.src.medium\" [src]=\"photo.src.medium\"\n class=\"pexels-lib__wrapper__result__column__element__img\"/>\n\n <div class=\"pexels-lib__wrapper__result__column__element__wrapper\">\n <span class=\"pexels-lib__wrapper__result__column__element__wrapper__infos\">\n {{ photo.width }} x {{ photo.height}}\n </span>\n\n <div class=\"dropdown is-up\" [ngClass]=\"{'is-hoverable': !photo.uploading}\">\n <div class=\"dropdown-trigger\">\n <button\n class=\"button pexels-lib__wrapper__result__column__element__wrapper__button\"\n aria-haspopup=\"true\"\n aria-controls=\"dropdown-menu\">\n\n <div *ngIf=\"!photo.uploading\" (click)=\"uploadPhoto(photo, photo.src.large2x)\">\n <span>{{ 'ImgManager.PexelLib.import' | translate }}</span>\n <span class=\"icon is-small\">\n <i class=\"fas fa-angle-up\" aria-hidden=\"true\"></i>\n </span>\n <ng-container *ngIf=\"photo.uploaded\">\n <i class=\"fal fa-check\"></i>\n </ng-container>\n </div>\n\n <ng-container *ngIf=\"photo.uploading\">\n {{ 'ImgManager.PexelLib.importation' | translate }}\n <span btnLoadingAnim class=\"btnLoadingAnnimation\"></span>\n </ng-container>\n\n </button>\n </div>\n <div class=\"dropdown-menu pexels-lib__wrapper__result__column__element__wrapper__dropdown\" id=\"dropdown-menu\" role=\"menu\">\n <div class=\"dropdown-content\">\n <div class=\"dropdown-content__wrapper\">\n <div class=\"dropdown-item\" (click)=\"uploadPhoto(photo, photo.src.portrait)\">\n <p>{{ 'ImgManager.PexelLib.portrait' | translate }}</p>\n <i class=\"fal fa-check iPortrait\"></i>\n </div>\n <div class=\"dropdown-item\" (click)=\"uploadPhoto(photo, photo.src.landscape)\">\n <p>{{ 'ImgManager.PexelLib.landscape' | translate }}</p>\n <i class=\"fal fa-check iLandscape\"></i>\n </div>\n <div class=\"dropdown-item\" (click)=\"uploadPhoto(photo, photo.src.large2x)\">\n <p>{{ 'ImgManager.PexelLib.original' | translate }}</p>\n <i class=\"fal fa-check iOriginal\"></i>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </div>\n </div>\n </div>\n <ng-container *ngIf=\"isLoading\">\n <wz-loader></wz-loader>\n </ng-container>\n <div\n *ngIf=\"!isLoading && !nbResult\"\n class=\"pexels-lib__alert\"\n [@easeInOut]=\"'in'\">\n <wz-alert [warning]=\"true\">\n {{ 'ImgManager.PexelLib.noResult' | translate }}\n </wz-alert>\n </div>\n\n </perfect-scrollbar>\n</div>\n",
|
|
1574
1694
|
animations: [
|
|
1575
1695
|
easeInOut,
|
|
1576
1696
|
listAnnimation
|
|
@@ -1929,7 +2049,7 @@ var ImgEditorComponent = /** @class */ (function () {
|
|
|
1929
2049
|
ImgEditorComponent = __decorate([
|
|
1930
2050
|
Component({
|
|
1931
2051
|
selector: 'img-editor',
|
|
1932
|
-
template: "<div class=\"img-editor\" [@easeInOut]=\"'in'\">\n\n <
|
|
2052
|
+
template: "<div class=\"img-editor\" [@easeInOut]=\"'in'\">\n\n <perfect-scrollbar\n class=\"img-editor__scroll\"\n [ngClass]=\"{\n 'img-editor__scroll--full': stateDisplayed === 'full',\n 'img-editor__scroll--smallDisplay': stateDisplayed === 'small',\n 'img-editor__scroll--window': stateDisplayed === 'window'\n }\"\n >\n <div class=\"columns\">\n <!-- Left section -->\n <div class=\"column is-one-third img-editor__infoSection\">\n\n <info-section\n [imgToEdit]=\"imgToEdit\"\n [(isNameModified)]=\"isNameModified\"\n >\n </info-section>\n\n <!-- Button Action Section -->\n\n <div class=\"img-editor__infoSection__actions\">\n <div>\n <button\n class=\"button img-editor__infoSection__actions__cancel\"\n (click)=\"onCancel()\"\n [disabled]=\"isLoading || (!isImgModified && !isNameModified)\"\n >\n {{ 'ImgManager.ImgLib.cancel' | translate }}\n </button>\n <div\n class=\"button danger button img-editor__infoSection__actions__save\"\n [ngClass]=\"{'img-editor__infoSection__actions__save--disable': isLoading}\"\n (click)=\"onSave()\"\n >\n {{ 'ImgManager.ImgEditor.saveBtn' | translate }}\n <span btnLoadingAnim *ngIf=\"isLoading\" class=\"btnLoadingAnnimation\"></span>\n </div>\n\n </div>\n </div>\n </div>\n\n\n <!-- Right section -->\n <div class=\"column img-editor__container\">\n <cropper\n [imgToEdit]=\"imgToEdit\"\n [(isImgModified)]=\"isImgModified\"\n (currentCroppedImageChange)=\"onImgCropped($event)\"\n (editClosed)=\"onEditClosed($event)\">\n </cropper>\n </div>\n </div>\n </perfect-scrollbar>\n</div>\n",
|
|
1933
2053
|
animations: [
|
|
1934
2054
|
easeInOut
|
|
1935
2055
|
]
|
|
@@ -1940,13 +2060,8 @@ var ImgEditorComponent = /** @class */ (function () {
|
|
|
1940
2060
|
}());
|
|
1941
2061
|
|
|
1942
2062
|
var CanvaBtnComponent = /** @class */ (function () {
|
|
1943
|
-
function CanvaBtnComponent(canvaService
|
|
2063
|
+
function CanvaBtnComponent(canvaService) {
|
|
1944
2064
|
this.canvaService = canvaService;
|
|
1945
|
-
this.imgManager = imgManager;
|
|
1946
|
-
this.wzImgEventService = wzImgEventService;
|
|
1947
|
-
this.translateService = translateService;
|
|
1948
|
-
this.alertService = alertService;
|
|
1949
|
-
this.renderer = renderer;
|
|
1950
2065
|
this.showImgUploaded = new EventEmitter();
|
|
1951
2066
|
this.imgLoading = false;
|
|
1952
2067
|
this.availableFormat = {
|
|
@@ -1965,10 +2080,6 @@ var CanvaBtnComponent = /** @class */ (function () {
|
|
|
1965
2080
|
};
|
|
1966
2081
|
this.openDropDownMenu = false;
|
|
1967
2082
|
this.subs = [];
|
|
1968
|
-
this.uploadingImg = 'ImgManager.CanvaBtn.uploadingImg';
|
|
1969
|
-
this.successUploadPhoto = 'ImgManager.CanvaBtn.successImport';
|
|
1970
|
-
this.errorUploadCanvaImg = 'ImgManager.CanvaBtn.errorUploadCanvaImg';
|
|
1971
|
-
this.errorRenameCanvaImg = 'ImgManager.CanvaBtn.errorRenameCanvaImg';
|
|
1972
2083
|
}
|
|
1973
2084
|
CanvaBtnComponent.prototype.ngOnInit = function () {
|
|
1974
2085
|
this.canvaLogoRouteAssets = this.canvaService.getCanvaLogo();
|
|
@@ -1990,76 +2101,13 @@ var CanvaBtnComponent = /** @class */ (function () {
|
|
|
1990
2101
|
this.subs.push(subExpectedImgSizesChange);
|
|
1991
2102
|
};
|
|
1992
2103
|
CanvaBtnComponent.prototype.onOpenCanva = function (width, height) {
|
|
1993
|
-
|
|
1994
|
-
if (this.imgLoading) {
|
|
1995
|
-
return;
|
|
1996
|
-
}
|
|
1997
|
-
var subCanvaApi = this.canvaService.getCanvaApi().subscribe(function (api) {
|
|
1998
|
-
_this.canvaApi = api;
|
|
1999
|
-
_this.addOverflowBody();
|
|
2000
|
-
_this.createDesign(width, height);
|
|
2001
|
-
});
|
|
2002
|
-
this.subs.push(subCanvaApi);
|
|
2003
|
-
};
|
|
2004
|
-
CanvaBtnComponent.prototype.createDesign = function (width, height) {
|
|
2005
|
-
var _this = this;
|
|
2006
|
-
var createDesign = {
|
|
2007
|
-
type: 'EtsyShopIcon',
|
|
2008
|
-
dimensions: {
|
|
2009
|
-
units: 'px',
|
|
2010
|
-
width: width ? width : undefined,
|
|
2011
|
-
height: height ? height : undefined,
|
|
2012
|
-
},
|
|
2013
|
-
publishLabel: this.translateService.instant('ImgManager.CanvaBtn.publish'),
|
|
2014
|
-
};
|
|
2015
|
-
this.canvaApi.createDesign({
|
|
2016
|
-
design: createDesign,
|
|
2017
|
-
onDesignPublish: function (_a) {
|
|
2018
|
-
var exportUrl = _a.exportUrl, designTitle = _a.designTitle;
|
|
2019
|
-
return _this.designPublished(exportUrl, designTitle);
|
|
2020
|
-
},
|
|
2021
|
-
onDesignClose: function () {
|
|
2022
|
-
_this.removeOverflowBody();
|
|
2023
|
-
}
|
|
2024
|
-
});
|
|
2025
|
-
};
|
|
2026
|
-
CanvaBtnComponent.prototype.designPublished = function (exportUrl, designTitle) {
|
|
2027
|
-
var _this = this;
|
|
2028
|
-
this.alertService.openAlert(this.uploadingImg);
|
|
2029
|
-
this.imgLoading = true;
|
|
2030
|
-
var subUploadImg = this.imgManager.uploadFileByUrl(exportUrl, designTitle).subscribe(function (img) {
|
|
2031
|
-
_this.imgLoading = false;
|
|
2032
|
-
_this.removeOverflowBody();
|
|
2033
|
-
_this.wzImgEventService.emitImgAdded(img.id_file);
|
|
2034
|
-
_this.alertService.openAlert(_this.successUploadPhoto);
|
|
2035
|
-
}, function (error) {
|
|
2036
|
-
_this.imgLoading = false;
|
|
2037
|
-
_this.removeOverflowBody();
|
|
2038
|
-
if (error.error.code === 406 && error.error.message) {
|
|
2039
|
-
_this.alertService.openAlertWithBackendRespons(_this.errorUploadCanvaImg, error.error.message);
|
|
2040
|
-
}
|
|
2041
|
-
else {
|
|
2042
|
-
_this.alertService.openAlert(_this.errorUploadCanvaImg);
|
|
2043
|
-
}
|
|
2044
|
-
});
|
|
2045
|
-
this.subs.push(subUploadImg);
|
|
2046
|
-
};
|
|
2047
|
-
CanvaBtnComponent.prototype.addOverflowBody = function () {
|
|
2048
|
-
this.renderer.addClass(document.body, 'ovh-canva');
|
|
2049
|
-
};
|
|
2050
|
-
CanvaBtnComponent.prototype.removeOverflowBody = function () {
|
|
2051
|
-
this.renderer.removeClass(document.body, 'ovh-canva');
|
|
2104
|
+
this.canvaService.openCanva(width, height);
|
|
2052
2105
|
};
|
|
2053
2106
|
CanvaBtnComponent.prototype.ngOnDestroy = function () {
|
|
2054
2107
|
this.subs.forEach(function (sub) { return sub.unsubscribe(); });
|
|
2055
2108
|
};
|
|
2056
2109
|
CanvaBtnComponent.ctorParameters = function () { return [
|
|
2057
|
-
{ type: CanvaService }
|
|
2058
|
-
{ type: ImgManagerService },
|
|
2059
|
-
{ type: ImgEventService },
|
|
2060
|
-
{ type: TranslateService },
|
|
2061
|
-
{ type: AlertService },
|
|
2062
|
-
{ type: Renderer2 }
|
|
2110
|
+
{ type: CanvaService }
|
|
2063
2111
|
]; };
|
|
2064
2112
|
__decorate([
|
|
2065
2113
|
Input(),
|
|
@@ -2072,14 +2120,9 @@ var CanvaBtnComponent = /** @class */ (function () {
|
|
|
2072
2120
|
CanvaBtnComponent = __decorate([
|
|
2073
2121
|
Component({
|
|
2074
2122
|
selector: 'canva-btn',
|
|
2075
|
-
template: "<div class=\"canva dropdown is-right is-hoverable\"\n wzAutoHide (clickOutside)=\"openDropDownMenu = false;\"\n [ngClass]=\"{'is-up': stateDisplayed === 'small', 'noTooltip': stateDisplayed !== 'small'}\"\n >\n <div class=\"dropdown-trigger\">\n <div\n class=\"button canva-btn\"\n aria-controls=\"dropdown-menuCanva\"\n (click)=\"openDropDownMenu = true;\"\n >\n <span>{{'ImgManager.CanvaBtn.createImg' | translate}}</span>\n <img [src]=\"canvaLogoRouteAssets\" class=\"canva-btn__logo\">\n\n <span btnLoadingAnim class=\"btnLoadingAnnimation\" *ngIf=\"imgLoading\"></span>\n </div>\n </div>\n <div\n class=\"dropdown-menu dropDownShadow\"\n [ngClass]=\"{'displayDropDownMenu': openDropDownMenu }\"\n id=\"dropdown-menuCanva\"\n role=\"menu\">\n <
|
|
2123
|
+
template: "<div class=\"canva dropdown is-right is-hoverable\"\n wzAutoHide (clickOutside)=\"openDropDownMenu = false;\"\n [ngClass]=\"{'is-up': stateDisplayed === 'small', 'noTooltip': stateDisplayed !== 'small'}\"\n >\n <div class=\"dropdown-trigger\">\n <div\n class=\"button canva-btn\"\n aria-controls=\"dropdown-menuCanva\"\n (click)=\"openDropDownMenu = true;\"\n >\n <span>{{'ImgManager.CanvaBtn.createImg' | translate}}</span>\n <img [src]=\"canvaLogoRouteAssets\" class=\"canva-btn__logo\">\n\n <span btnLoadingAnim class=\"btnLoadingAnnimation\" *ngIf=\"imgLoading\"></span>\n </div>\n </div>\n <div\n class=\"dropdown-menu dropDownShadow\"\n [ngClass]=\"{'displayDropDownMenu': openDropDownMenu }\"\n id=\"dropdown-menuCanva\"\n role=\"menu\">\n <perfect-scrollbar\n class=\"smallScroll\"\n >\n <div class=\"dropdown-content\">\n <div class=\"dropdownTitle\">\n <p>{{'ImgManager.CanvaBtn.createImg.title' | translate}}</p>\n </div>\n\n <div class=\"infoItem\">\n <p>{{'ImgManager.CanvaBtn.info' | translate}}</p>\n </div>\n\n <ng-container >\n <div\n *ngIf=\"expectedWidth && expectedHeight\"\n class=\"dropdown-item-wrapper\"\n >\n <div class=\"dropdown-item expectedSizes\" (click)=\"onOpenCanva(expectedWidth, expectedHeight)\">\n <p>{{'ImgManager.CanvaBtn.recommanded' | translate}}</p><p>{{expectedWidth}}*{{expectedHeight}}</p>\n </div>\n </div>\n </ng-container>\n\n <div\n *ngFor=\"let format of availableFormat| keyvalue\"\n class=\"dropdown-item-wrapper\">\n <div\n (click)=\"onOpenCanva(format.value.width, format.value.height)\"\n class=\"dropdown-item\">\n <p>{{format.key | translate}}</p><p>{{format.value.width}}*{{format.value.height}}</p>\n </div>\n </div>\n </div>\n </perfect-scrollbar>\n </div>\n</div>\n"
|
|
2076
2124
|
}),
|
|
2077
|
-
__metadata("design:paramtypes", [CanvaService
|
|
2078
|
-
ImgManagerService,
|
|
2079
|
-
ImgEventService,
|
|
2080
|
-
TranslateService,
|
|
2081
|
-
AlertService,
|
|
2082
|
-
Renderer2])
|
|
2125
|
+
__metadata("design:paramtypes", [CanvaService])
|
|
2083
2126
|
], CanvaBtnComponent);
|
|
2084
2127
|
return CanvaBtnComponent;
|
|
2085
2128
|
}());
|
|
@@ -3155,7 +3198,7 @@ var ImagesViewComponent = /** @class */ (function () {
|
|
|
3155
3198
|
ImagesViewComponent = __decorate([
|
|
3156
3199
|
Component({
|
|
3157
3200
|
selector: 'images-view',
|
|
3158
|
-
template: "<div class=\"images-view\" [ngClass]=\"{'fullSize': fullSize, 'small': stateDisplayed === 'small'}\" [@easeInOut]=\"'in'\">\n <!-- Subheader : Img number and actions btn (sup img list, switch forma display) -->\n <div\n *ngIf=\"(stateDisplayed !== 'small' || tabDisplayed === 'img-upload')\"\n class=\"images-view__container\"\n [ngClass]=\"{'images-view__container--uploadTab': tabDisplayed === 'img-upload', 'images-view__container--window': stateDisplayed === 'window'}\"\n >\n\n <div *ngIf=\"tabDisplayed !== 'img-upload'\">\n <p class=\"mainColor\">{{ 'ImgManager.ImgLib.nbImg' | translate }} : {{length}}</p>\n </div>\n <div *ngIf=\"tabDisplayed === 'img-upload'\">\n <p class=\"mainColor\">{{ 'ImgManager.ImgLib.lastImgs' | translate }}</p>\n </div>\n\n <div class=\"field has-addons subHeaderActions\" *ngIf=\"tabDisplayed !== 'img-upload'\">\n\n <!-- For listforma : Display btn del multiple img & Confirm action -->\n <div class=\"images-view__container__boxAction\">\n\n\n <!-- S\u00E9lectionner -->\n <button\n class=\"button success images-view__container__boxAction__import\"\n @insertRemoveAnnim\n *ngIf=\"listDisplayed && nbImgToDelSelected && !confirmImgSup && !delListImgLoader && multipleImgMode\"\n (click)=\"selectImgChosen()\"\n >\n <i class=\"fal fa-check\"></i>\n {{ 'ImgManager.ImgLib.select' | translate }} ({{nbImgToDelSelected}})\n </button>\n\n <!-- Display btn del multiple img -->\n <button\n *ngIf=\"listDisplayed && nbImgToDelSelected && !confirmImgSup\"\n (click)=\"displayConfirmImgSup()\"\n class=\"button images-view__container__boxAction__delBtn danger\"\n @insertRemoveAnnim\n >\n <i class=\"fal fa-times\"></i>{{ 'ImgManager.ImgLib.delMlt' | translate }} ({{nbImgToDelSelected}})\n <span btnLoadingAnim *ngIf=\"delListImgLoader\" class=\"btnLoadingAnnimation\"></span>\n </button>\n\n <!-- Confirm action -->\n <div\n class=\"images-view__container__boxAction__confirmSup\"\n [ngClass]=\"{'images-view__container__boxAction__confirmSup--visible': confirmImgSup}\">\n <p *ngIf=\"nbImgToDelSelected > 1\" class=\"images-view__container__boxAction__confirmSup__text\">{{ 'ImgManager.ImgLib.confirmSupQuestions' | translate:{nbImage: nbImgToDelSelected} }}</p>\n <p *ngIf=\"nbImgToDelSelected === 1\" class=\"images-view__container__boxAction__confirmSup__text\">{{ 'ImgManager.ImgLib.confirmSupQuestion' | translate:{nbImage: nbImgToDelSelected} }}</p>\n <div>\n <button\n class=\"button images-view__container__boxAction__confirmSup__cancel\"\n (click)=\"cancelSup()\"\n >\n {{ 'ImgManager.ImgLib.cancel' | translate }}\n </button>\n <button\n (click)=\"removeListImg()\"\n class=\"button images-view__container__delBtn danger\"\n >\n {{ 'ImgManager.ImgLib.confirm' | translate }}\n </button>\n </div>\n </div>\n\n </div>\n\n\n <!-- Swith mosaic/list forma -->\n <div class=\"field has-addons images-view__container__buttonBox\">\n <div class=\"control\">\n <div\n class=\"button is-lighted images-view__container__buttonBox__btn\"\n [ngClass]=\"{'actifDisplayed': !listDisplayed}\"\n (click)=\"onSwitchFormatDisplayed(false)\"\n >\n <span class=\"icon is-small\">\n <i class=\"far fa-th\"></i>\n </span>\n </div>\n </div>\n\n <div class=\"control\">\n <div class=\"button is-lighted images-view__container__buttonBox__btn\"\n [ngClass]=\"{'actifDisplayed': listDisplayed}\"\n (click)=\"onSwitchFormatDisplayed(true)\"\n >\n <span class=\"icon is-small\">\n <i class=\"fas fa-bars\"></i>\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n\n <!-- Images section -->\n<
|
|
3201
|
+
template: "<div class=\"images-view\" [ngClass]=\"{'fullSize': fullSize, 'small': stateDisplayed === 'small'}\" [@easeInOut]=\"'in'\">\n <!-- Subheader : Img number and actions btn (sup img list, switch forma display) -->\n <div\n *ngIf=\"(stateDisplayed !== 'small' || tabDisplayed === 'img-upload')\"\n class=\"images-view__container\"\n [ngClass]=\"{'images-view__container--uploadTab': tabDisplayed === 'img-upload', 'images-view__container--window': stateDisplayed === 'window'}\"\n >\n\n <div *ngIf=\"tabDisplayed !== 'img-upload'\">\n <p class=\"mainColor\">{{ 'ImgManager.ImgLib.nbImg' | translate }} : {{length}}</p>\n </div>\n <div *ngIf=\"tabDisplayed === 'img-upload'\">\n <p class=\"mainColor\">{{ 'ImgManager.ImgLib.lastImgs' | translate }}</p>\n </div>\n\n <div class=\"field has-addons subHeaderActions\" *ngIf=\"tabDisplayed !== 'img-upload'\">\n\n <!-- For listforma : Display btn del multiple img & Confirm action -->\n <div class=\"images-view__container__boxAction\">\n\n\n <!-- S\u00E9lectionner -->\n <button\n class=\"button success images-view__container__boxAction__import\"\n @insertRemoveAnnim\n *ngIf=\"listDisplayed && nbImgToDelSelected && !confirmImgSup && !delListImgLoader && multipleImgMode\"\n (click)=\"selectImgChosen()\"\n >\n <i class=\"fal fa-check\"></i>\n {{ 'ImgManager.ImgLib.select' | translate }} ({{nbImgToDelSelected}})\n </button>\n\n <!-- Display btn del multiple img -->\n <button\n *ngIf=\"listDisplayed && nbImgToDelSelected && !confirmImgSup\"\n (click)=\"displayConfirmImgSup()\"\n class=\"button images-view__container__boxAction__delBtn danger\"\n @insertRemoveAnnim\n >\n <i class=\"fal fa-times\"></i>{{ 'ImgManager.ImgLib.delMlt' | translate }} ({{nbImgToDelSelected}})\n <span btnLoadingAnim *ngIf=\"delListImgLoader\" class=\"btnLoadingAnnimation\"></span>\n </button>\n\n <!-- Confirm action -->\n <div\n class=\"images-view__container__boxAction__confirmSup\"\n [ngClass]=\"{'images-view__container__boxAction__confirmSup--visible': confirmImgSup}\">\n <p *ngIf=\"nbImgToDelSelected > 1\" class=\"images-view__container__boxAction__confirmSup__text\">{{ 'ImgManager.ImgLib.confirmSupQuestions' | translate:{nbImage: nbImgToDelSelected} }}</p>\n <p *ngIf=\"nbImgToDelSelected === 1\" class=\"images-view__container__boxAction__confirmSup__text\">{{ 'ImgManager.ImgLib.confirmSupQuestion' | translate:{nbImage: nbImgToDelSelected} }}</p>\n <div>\n <button\n class=\"button images-view__container__boxAction__confirmSup__cancel\"\n (click)=\"cancelSup()\"\n >\n {{ 'ImgManager.ImgLib.cancel' | translate }}\n </button>\n <button\n (click)=\"removeListImg()\"\n class=\"button images-view__container__delBtn danger\"\n >\n {{ 'ImgManager.ImgLib.confirm' | translate }}\n </button>\n </div>\n </div>\n\n </div>\n\n\n <!-- Swith mosaic/list forma -->\n <div class=\"field has-addons images-view__container__buttonBox\">\n <div class=\"control\">\n <div\n class=\"button is-lighted images-view__container__buttonBox__btn\"\n [ngClass]=\"{'actifDisplayed': !listDisplayed}\"\n (click)=\"onSwitchFormatDisplayed(false)\"\n >\n <span class=\"icon is-small\">\n <i class=\"far fa-th\"></i>\n </span>\n </div>\n </div>\n\n <div class=\"control\">\n <div class=\"button is-lighted images-view__container__buttonBox__btn\"\n [ngClass]=\"{'actifDisplayed': listDisplayed}\"\n (click)=\"onSwitchFormatDisplayed(true)\"\n >\n <span class=\"icon is-small\">\n <i class=\"fas fa-bars\"></i>\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n\n <!-- Images section -->\n<perfect-scrollbar\n class=\"images-view__scroll\"\n [ngClass]=\"{\n 'images-view__scroll--hide--mosaic': displayPexelsResults && !listDisplayed,\n 'images-view__scroll--hide--mosaic--small': displayPexelsResults && !listDisplayed && stateDisplayed === 'small',\n 'images-view__scroll--hide--table': displayPexelsResults && listDisplayed,\n 'images-view__scroll--full': stateDisplayed === 'full',\n 'images-view__scroll--smallDisplay' : stateDisplayed === 'small' && tabDisplayed !== 'img-upload',\n 'images-view__scroll--smallUploadDisplay' : stateDisplayed === 'small' && tabDisplayed === 'img-upload',\n 'images-view__scroll--window': stateDisplayed === 'window'\n}\"\n>\n <div #imgLibContainer class=\"images-view__wrapper\">\n <div *ngIf=\"!listDisplayed || stateDisplayed === 'small'\" [@easeInOut]=\"'in'\">\n <mosaic-view\n [picturesList]=\"picturesList\"\n (picturesListChange)=\"onPicturesListChange()\"\n [tableFilters]=\"tableFilters\"\n (filtersChange)=\"onFiltersChange()\"\n [(disable)]=\"disable\"\n (pictureNameChange)=\"onRenamePicture($event)\"\n (switchDisplayWindow)=\"switchDisplayWindowMosaic()\"\n [nbFakeImg]=\"nbFakeImg\"\n [stateDisplayed]=\"stateDisplayed\"\n [tabDisplayed]=\"tabDisplayed\"\n [displayPexelsResults]=\"displayPexelsResults\"\n [isLoading]=\"isLoading\"\n [fullSize]=\"fullSize\"\n >\n </mosaic-view>\n </div>\n\n <div *ngIf=\"listDisplayed && stateDisplayed !== 'small'\" [@easeInOut]=\"'in'\">\n <table-view\n [picturesList]=\"picturesList\"\n (picturesListChange)=\"onPicturesListChange()\"\n [tableFilters]=\"tableFilters\"\n (filtersChange)=\"onFiltersChange()\"\n [(disable)]=\"disable\"\n (pictureNameChange)=\"onRenamePicture($event)\"\n [displayPexelsResults]=\"displayPexelsResults\"\n [stateDisplayed]=\"stateDisplayed\"\n [isLoading]=\"isLoading\"\n >\n </table-view>\n </div>\n\n </div>\n</perfect-scrollbar>\n\n<!-- Pexels Section - When no img found -->\n<div\n *ngIf=\"displayPexelsResults\"\n class=\"images-view--pexels\"\n [@easeInOut]=\"'in'\">\n <pexels-lib\n [searchValue]=\"tableFilters.searchValue\"\n (showImgUploaded)=\"onShowImgUploaded()\"\n [disableSearch]=\"true\"\n >\n </pexels-lib>\n</div>\n",
|
|
3159
3202
|
animations: [
|
|
3160
3203
|
easeInOut,
|
|
3161
3204
|
insertRemove
|
|
@@ -4744,5 +4787,5 @@ var ImgCDNConfigDTO = /** @class */ (function () {
|
|
|
4744
4787
|
* Generated bundle index. Do not edit.
|
|
4745
4788
|
*/
|
|
4746
4789
|
|
|
4747
|
-
export { CanvaButtonApi, CanvaService, ImgApiDto, ImgCDNConfigDTO, ImgManagerConfigDto, ImgManagerService, ImgSelectionService, RenamePictureService, WzImgManagerComponent, WzImgManagerModule, ImgManagerConfigService as ɵa, ImgCDNService as ɵb, TableComponent as ɵba, FiltersTableService as ɵbb, InputSearchComponent as ɵbc, PaginationComponent as ɵbd, CheckboxComponent as ɵbe, AlertComponent as ɵbf, PageSelectorComponent as ɵbg, SelectComponent as ɵbh, DragDropDirective as ɵbi, LoadingDirective as ɵbj, AutoHideDirective as ɵbk, CopyClipboardDirective as ɵbl, TableColumn as ɵbm, CheckBoxRow as ɵbn, TableColumnHeader as ɵbo, TableRow as ɵbp, AbstractDebounceDirective as ɵbq, DebounceKeyupDirective as ɵbr, ZindexToggleDirective as ɵbs, PagniationArrayTotalPages as ɵbt, PagniationIsLastPage as ɵbu, PagniationText as ɵbv, ImageSrcPipe as ɵbw, NumberToArray as ɵbx, LargeNumberOfPagePipe as ɵby, SelectFiltersPipe as ɵbz, UserSettingsService as ɵc, ImgEventService as ɵd,
|
|
4790
|
+
export { CanvaButtonApi, CanvaService, ImgApiDto, ImgCDNConfigDTO, ImgManagerConfigDto, ImgManagerService, ImgSelectionService, RenamePictureService, WzImgManagerComponent, WzImgManagerModule, ImgManagerConfigService as ɵa, ImgCDNService as ɵb, TableComponent as ɵba, FiltersTableService as ɵbb, InputSearchComponent as ɵbc, PaginationComponent as ɵbd, CheckboxComponent as ɵbe, AlertComponent as ɵbf, PageSelectorComponent as ɵbg, SelectComponent as ɵbh, DragDropDirective as ɵbi, LoadingDirective as ɵbj, AutoHideDirective as ɵbk, CopyClipboardDirective as ɵbl, TableColumn as ɵbm, CheckBoxRow as ɵbn, TableColumnHeader as ɵbo, TableRow as ɵbp, AbstractDebounceDirective as ɵbq, DebounceKeyupDirective as ɵbr, ZindexToggleDirective as ɵbs, PagniationArrayTotalPages as ɵbt, PagniationIsLastPage as ɵbu, PagniationText as ɵbv, ImageSrcPipe as ɵbw, NumberToArray as ɵbx, LargeNumberOfPagePipe as ɵby, SelectFiltersPipe as ɵbz, UserSettingsService as ɵc, ImgEventService as ɵd, AlertService as ɵe, DomService as ɵf, ImgTabsComponent as ɵg, ImgUploadComponent as ɵh, easeInOut as ɵi, PexelLibComponent as ɵj, listAnnimation as ɵk, PexelsService as ɵl, ImgCardComponent as ɵm, ImagesActionHandler as ɵn, UploadListComponent as ɵo, ImgEditorComponent as ɵp, EditorInfoSectionComponent as ɵq, CanvaBtnComponent as ɵr, ImgSelectionComponent as ɵs, LoaderComponent as ɵt, DropdownComponent as ɵu, CropperComponent as ɵv, insertRemove as ɵw, ImagesViewComponent as ɵx, MosaicViewComponent as ɵy, TableViewComponent as ɵz };
|
|
4748
4791
|
//# sourceMappingURL=wizishop-img-manager.js.map
|