@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 { __decorate, __metadata, __param } 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';
|
|
@@ -374,9 +374,110 @@ UserSettingsService = __decorate([
|
|
|
374
374
|
__metadata("design:paramtypes", [])
|
|
375
375
|
], UserSettingsService);
|
|
376
376
|
|
|
377
|
+
let AlertService = class AlertService {
|
|
378
|
+
constructor(nwbAlertService, translateService) {
|
|
379
|
+
this.nwbAlertService = nwbAlertService;
|
|
380
|
+
this.translateService = translateService;
|
|
381
|
+
this.actionMsg = 'ImgManager.alert.action';
|
|
382
|
+
this.alertConfig = {
|
|
383
|
+
message: '',
|
|
384
|
+
duration: 5000
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
openAlert(msgKey) {
|
|
388
|
+
this.closePreviousAlert();
|
|
389
|
+
this.translateService.get(msgKey).subscribe(trans => {
|
|
390
|
+
this.alertConfig.message = trans;
|
|
391
|
+
this.setAlertColor(msgKey);
|
|
392
|
+
this.alertRefComponent = this.nwbAlertService.open(this.alertConfig);
|
|
393
|
+
this.alertRefComponent.afterClosed().subscribe();
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
openAlertWithBackendRespons(msgKey, msgBackend) {
|
|
397
|
+
this.translateService.get(msgKey).subscribe(trans => {
|
|
398
|
+
this.alertConfig.message = trans;
|
|
399
|
+
this.alertConfig.message += '<br/>' + JSON.parse(msgBackend).message;
|
|
400
|
+
this.closePreviousAlert();
|
|
401
|
+
this.alertRefComponent = this.nwbAlertService.open(this.alertConfig);
|
|
402
|
+
this.alertRefComponent.afterClosed().subscribe();
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
closePreviousAlert() {
|
|
406
|
+
if (this.alertRefComponent) {
|
|
407
|
+
this.alertRefComponent.dismiss();
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
setAlertColor(msgKey) {
|
|
411
|
+
const isErrorMsg = /error/i.test(msgKey);
|
|
412
|
+
this.alertConfig.color = isErrorMsg ? 'is-danger' : 'is-success';
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
AlertService.ctorParameters = () => [
|
|
416
|
+
{ type: NwbAlertService },
|
|
417
|
+
{ type: TranslateService }
|
|
418
|
+
];
|
|
419
|
+
AlertService.ɵprov = ɵɵdefineInjectable({ factory: function AlertService_Factory() { return new AlertService(ɵɵinject(NwbAlertService), ɵɵinject(TranslateService)); }, token: AlertService, providedIn: "root" });
|
|
420
|
+
AlertService = __decorate([
|
|
421
|
+
Injectable({
|
|
422
|
+
providedIn: 'root'
|
|
423
|
+
}),
|
|
424
|
+
__metadata("design:paramtypes", [NwbAlertService,
|
|
425
|
+
TranslateService])
|
|
426
|
+
], AlertService);
|
|
427
|
+
|
|
428
|
+
let ImgEventService = class ImgEventService {
|
|
429
|
+
constructor() {
|
|
430
|
+
this.imgToEditEvent = new Subject();
|
|
431
|
+
this.imgRemoved = new Subject();
|
|
432
|
+
this.imgAdded = new Subject();
|
|
433
|
+
this.listDisplayedChange = new Subject();
|
|
434
|
+
}
|
|
435
|
+
emitImgRemoved(id_file) {
|
|
436
|
+
this.imgRemoved.next(id_file);
|
|
437
|
+
}
|
|
438
|
+
getImgRemovedEventListner() {
|
|
439
|
+
return this.imgRemoved.asObservable();
|
|
440
|
+
}
|
|
441
|
+
emitImgToEdit(imgToEdit) {
|
|
442
|
+
this.imgToEditEvent.next(imgToEdit);
|
|
443
|
+
}
|
|
444
|
+
getImgToEditEventListner() {
|
|
445
|
+
return this.imgToEditEvent.asObservable();
|
|
446
|
+
}
|
|
447
|
+
emitImgAdded(id_file) {
|
|
448
|
+
this.imgAdded.next(id_file);
|
|
449
|
+
}
|
|
450
|
+
getImgAddedEventListner() {
|
|
451
|
+
return this.imgAdded.asObservable();
|
|
452
|
+
}
|
|
453
|
+
emitlistDisplayedChange(value) {
|
|
454
|
+
this.listDisplayedChange.next(value);
|
|
455
|
+
}
|
|
456
|
+
getlistDisplayedChange() {
|
|
457
|
+
return this.listDisplayedChange.asObservable();
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
ImgEventService.ɵprov = ɵɵdefineInjectable({ factory: function ImgEventService_Factory() { return new ImgEventService(); }, token: ImgEventService, providedIn: "root" });
|
|
461
|
+
ImgEventService = __decorate([
|
|
462
|
+
Injectable({
|
|
463
|
+
providedIn: 'root'
|
|
464
|
+
}),
|
|
465
|
+
__metadata("design:paramtypes", [])
|
|
466
|
+
], ImgEventService);
|
|
467
|
+
|
|
377
468
|
let CanvaService = class CanvaService {
|
|
378
|
-
constructor(externalConfigService) {
|
|
469
|
+
constructor(externalConfigService, imgManager, wzImgEventService, alertService, translateService) {
|
|
379
470
|
this.externalConfigService = externalConfigService;
|
|
471
|
+
this.imgManager = imgManager;
|
|
472
|
+
this.wzImgEventService = wzImgEventService;
|
|
473
|
+
this.alertService = alertService;
|
|
474
|
+
this.translateService = translateService;
|
|
475
|
+
this.imgLoading = false;
|
|
476
|
+
this.uploadingImg = 'ImgManager.CanvaBtn.uploadingImg';
|
|
477
|
+
this.successUploadPhoto = 'ImgManager.CanvaBtn.successImport';
|
|
478
|
+
this.errorUploadCanvaImg = 'ImgManager.CanvaBtn.errorUploadCanvaImg';
|
|
479
|
+
this.errorRenameCanvaImg = 'ImgManager.CanvaBtn.errorRenameCanvaImg';
|
|
480
|
+
this.forceToOpenCanva = false;
|
|
380
481
|
this.bindExpectedImgSizeEvent = new BehaviorSubject(null);
|
|
381
482
|
this.bindExpectedSizeDone = this.bindExpectedImgSizeEvent.asObservable();
|
|
382
483
|
}
|
|
@@ -392,6 +493,9 @@ let CanvaService = class CanvaService {
|
|
|
392
493
|
}
|
|
393
494
|
expectedImgSizesChange(mediaDTO) {
|
|
394
495
|
this.bindExpectedImgSizeEvent.next(mediaDTO);
|
|
496
|
+
if (this.forceToOpenCanva) {
|
|
497
|
+
this.openCanva(parseInt(mediaDTO.image_width), parseInt(mediaDTO.image_height));
|
|
498
|
+
}
|
|
395
499
|
}
|
|
396
500
|
getCanvaApi() {
|
|
397
501
|
if (!this.canvaApiURL || !this.canvaApiKey) {
|
|
@@ -443,57 +547,78 @@ let CanvaService = class CanvaService {
|
|
|
443
547
|
};
|
|
444
548
|
document.getElementsByTagName('head')[0].appendChild(node);
|
|
445
549
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
__metadata("design:paramtypes", [ImgManagerConfigService])
|
|
456
|
-
], CanvaService);
|
|
457
|
-
|
|
458
|
-
let ImgEventService = class ImgEventService {
|
|
459
|
-
constructor() {
|
|
460
|
-
this.imgToEditEvent = new Subject();
|
|
461
|
-
this.imgRemoved = new Subject();
|
|
462
|
-
this.imgAdded = new Subject();
|
|
463
|
-
this.listDisplayedChange = new Subject();
|
|
464
|
-
}
|
|
465
|
-
emitImgRemoved(id_file) {
|
|
466
|
-
this.imgRemoved.next(id_file);
|
|
467
|
-
}
|
|
468
|
-
getImgRemovedEventListner() {
|
|
469
|
-
return this.imgRemoved.asObservable();
|
|
470
|
-
}
|
|
471
|
-
emitImgToEdit(imgToEdit) {
|
|
472
|
-
this.imgToEditEvent.next(imgToEdit);
|
|
473
|
-
}
|
|
474
|
-
getImgToEditEventListner() {
|
|
475
|
-
return this.imgToEditEvent.asObservable();
|
|
550
|
+
openCanva(width, height) {
|
|
551
|
+
if (this.imgLoading) {
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
this.getCanvaApi().pipe(take(1)).subscribe((api) => {
|
|
555
|
+
this.canvaApi = api;
|
|
556
|
+
this.addOverflowBody();
|
|
557
|
+
this.createDesign(width, height);
|
|
558
|
+
});
|
|
476
559
|
}
|
|
477
|
-
|
|
478
|
-
|
|
560
|
+
addOverflowBody() {
|
|
561
|
+
document.body.classList.add('ovh-canva');
|
|
479
562
|
}
|
|
480
|
-
|
|
481
|
-
|
|
563
|
+
removeOverflowBody() {
|
|
564
|
+
document.body.classList.remove('ovh-canva');
|
|
482
565
|
}
|
|
483
|
-
|
|
484
|
-
|
|
566
|
+
createDesign(width, height) {
|
|
567
|
+
const createDesign = {
|
|
568
|
+
type: 'EtsyShopIcon',
|
|
569
|
+
dimensions: {
|
|
570
|
+
units: 'px',
|
|
571
|
+
width: width ? width : undefined,
|
|
572
|
+
height: height ? height : undefined,
|
|
573
|
+
},
|
|
574
|
+
publishLabel: this.translateService.instant('ImgManager.CanvaBtn.publish'),
|
|
575
|
+
};
|
|
576
|
+
this.canvaApi.createDesign({
|
|
577
|
+
design: createDesign,
|
|
578
|
+
onDesignPublish: ({ exportUrl, designTitle }) => this.designPublished(exportUrl, designTitle),
|
|
579
|
+
onDesignClose: () => {
|
|
580
|
+
this.removeOverflowBody();
|
|
581
|
+
}
|
|
582
|
+
});
|
|
485
583
|
}
|
|
486
|
-
|
|
487
|
-
|
|
584
|
+
designPublished(exportUrl, designTitle) {
|
|
585
|
+
this.alertService.openAlert(this.uploadingImg);
|
|
586
|
+
this.imgLoading = true;
|
|
587
|
+
this.imgManager.uploadFileByUrl(exportUrl, designTitle).pipe(take(1)).subscribe((img) => {
|
|
588
|
+
this.imgLoading = false;
|
|
589
|
+
this.removeOverflowBody();
|
|
590
|
+
this.wzImgEventService.emitImgAdded(img.id_file);
|
|
591
|
+
this.alertService.openAlert(this.successUploadPhoto);
|
|
592
|
+
}, error => {
|
|
593
|
+
this.imgLoading = false;
|
|
594
|
+
this.removeOverflowBody();
|
|
595
|
+
if (error.error.code === 406 && error.error.message) {
|
|
596
|
+
this.alertService.openAlertWithBackendRespons(this.errorUploadCanvaImg, error.error.message);
|
|
597
|
+
}
|
|
598
|
+
else {
|
|
599
|
+
this.alertService.openAlert(this.errorUploadCanvaImg);
|
|
600
|
+
}
|
|
601
|
+
});
|
|
488
602
|
}
|
|
489
603
|
};
|
|
490
|
-
|
|
491
|
-
|
|
604
|
+
CanvaService.ctorParameters = () => [
|
|
605
|
+
{ type: ImgManagerConfigService },
|
|
606
|
+
{ type: ImgManagerService },
|
|
607
|
+
{ type: ImgEventService },
|
|
608
|
+
{ type: AlertService },
|
|
609
|
+
{ type: TranslateService }
|
|
610
|
+
];
|
|
611
|
+
CanvaService.ɵprov = ɵɵdefineInjectable({ factory: function CanvaService_Factory() { return new CanvaService(ɵɵinject(ImgManagerConfigService), ɵɵinject(ImgManagerService), ɵɵinject(ImgEventService), ɵɵinject(AlertService), ɵɵinject(TranslateService)); }, token: CanvaService, providedIn: "root" });
|
|
612
|
+
CanvaService = __decorate([
|
|
492
613
|
Injectable({
|
|
493
614
|
providedIn: 'root'
|
|
494
615
|
}),
|
|
495
|
-
__metadata("design:paramtypes", [
|
|
496
|
-
|
|
616
|
+
__metadata("design:paramtypes", [ImgManagerConfigService,
|
|
617
|
+
ImgManagerService,
|
|
618
|
+
ImgEventService,
|
|
619
|
+
AlertService,
|
|
620
|
+
TranslateService])
|
|
621
|
+
], CanvaService);
|
|
497
622
|
|
|
498
623
|
let DomService = class DomService {
|
|
499
624
|
constructor() {
|
|
@@ -542,6 +667,15 @@ let WzImgManagerComponent = class WzImgManagerComponent {
|
|
|
542
667
|
this.listDisplayed = false;
|
|
543
668
|
this.hideTab = false;
|
|
544
669
|
}
|
|
670
|
+
// If forceToOpenCanva is true : Canva will open with the canvaService.expectedImgSizesChange
|
|
671
|
+
// If forceToOpenCanva is a WiziBlockMediaDto, Canva open immediatly
|
|
672
|
+
set forceToOpenCanva(forceToOpenCanva) {
|
|
673
|
+
this.canvaService.forceToOpenCanva = !!forceToOpenCanva;
|
|
674
|
+
if (typeof forceToOpenCanva === 'boolean') {
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
677
|
+
this.canvaService.expectedImgSizesChange(forceToOpenCanva);
|
|
678
|
+
}
|
|
545
679
|
set multipleImgMode(activate) {
|
|
546
680
|
this._multipleImgMode = activate;
|
|
547
681
|
this.imgSelectionService.setMultipleImgMode(this._multipleImgMode);
|
|
@@ -680,6 +814,11 @@ __decorate([
|
|
|
680
814
|
Input(),
|
|
681
815
|
__metadata("design:type", ImgManagerConfigDto)
|
|
682
816
|
], WzImgManagerComponent.prototype, "externalConfig", void 0);
|
|
817
|
+
__decorate([
|
|
818
|
+
Input(),
|
|
819
|
+
__metadata("design:type", Object),
|
|
820
|
+
__metadata("design:paramtypes", [Object])
|
|
821
|
+
], WzImgManagerComponent.prototype, "forceToOpenCanva", null);
|
|
683
822
|
__decorate([
|
|
684
823
|
Output(),
|
|
685
824
|
__metadata("design:type", Object)
|
|
@@ -724,57 +863,6 @@ const easeInOut = // the fade-in/fade-out animation.
|
|
|
724
863
|
]),
|
|
725
864
|
]);
|
|
726
865
|
|
|
727
|
-
let AlertService = class AlertService {
|
|
728
|
-
constructor(nwbAlertService, translateService) {
|
|
729
|
-
this.nwbAlertService = nwbAlertService;
|
|
730
|
-
this.translateService = translateService;
|
|
731
|
-
this.actionMsg = 'ImgManager.alert.action';
|
|
732
|
-
this.alertConfig = {
|
|
733
|
-
message: '',
|
|
734
|
-
duration: 5000
|
|
735
|
-
};
|
|
736
|
-
}
|
|
737
|
-
openAlert(msgKey) {
|
|
738
|
-
this.closePreviousAlert();
|
|
739
|
-
this.translateService.get(msgKey).subscribe(trans => {
|
|
740
|
-
this.alertConfig.message = trans;
|
|
741
|
-
this.setAlertColor(msgKey);
|
|
742
|
-
this.alertRefComponent = this.nwbAlertService.open(this.alertConfig);
|
|
743
|
-
this.alertRefComponent.afterClosed().subscribe();
|
|
744
|
-
});
|
|
745
|
-
}
|
|
746
|
-
openAlertWithBackendRespons(msgKey, msgBackend) {
|
|
747
|
-
this.translateService.get(msgKey).subscribe(trans => {
|
|
748
|
-
this.alertConfig.message = trans;
|
|
749
|
-
this.alertConfig.message += '<br/>' + JSON.parse(msgBackend).message;
|
|
750
|
-
this.closePreviousAlert();
|
|
751
|
-
this.alertRefComponent = this.nwbAlertService.open(this.alertConfig);
|
|
752
|
-
this.alertRefComponent.afterClosed().subscribe();
|
|
753
|
-
});
|
|
754
|
-
}
|
|
755
|
-
closePreviousAlert() {
|
|
756
|
-
if (this.alertRefComponent) {
|
|
757
|
-
this.alertRefComponent.dismiss();
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
setAlertColor(msgKey) {
|
|
761
|
-
const isErrorMsg = /error/i.test(msgKey);
|
|
762
|
-
this.alertConfig.color = isErrorMsg ? 'is-danger' : 'is-success';
|
|
763
|
-
}
|
|
764
|
-
};
|
|
765
|
-
AlertService.ctorParameters = () => [
|
|
766
|
-
{ type: NwbAlertService },
|
|
767
|
-
{ type: TranslateService }
|
|
768
|
-
];
|
|
769
|
-
AlertService.ɵprov = ɵɵdefineInjectable({ factory: function AlertService_Factory() { return new AlertService(ɵɵinject(NwbAlertService), ɵɵinject(TranslateService)); }, token: AlertService, providedIn: "root" });
|
|
770
|
-
AlertService = __decorate([
|
|
771
|
-
Injectable({
|
|
772
|
-
providedIn: 'root'
|
|
773
|
-
}),
|
|
774
|
-
__metadata("design:paramtypes", [NwbAlertService,
|
|
775
|
-
TranslateService])
|
|
776
|
-
], AlertService);
|
|
777
|
-
|
|
778
866
|
let ImgUploadComponent = class ImgUploadComponent {
|
|
779
867
|
constructor(imgManager, alertService, externalConfigService) {
|
|
780
868
|
this.imgManager = imgManager;
|
|
@@ -786,6 +874,7 @@ let ImgUploadComponent = class ImgUploadComponent {
|
|
|
786
874
|
this.loadingText = 'ImgManager.ImgUpload.loading';
|
|
787
875
|
this.errorUploadingImg = 'ImgManager.ImgUpload.errorUploadingImg';
|
|
788
876
|
this.errorNotImg = 'ImgManager.ImgUpload.errorNotImg';
|
|
877
|
+
this.MAX_IMAGE_SIZE = 10000000; // In bytes
|
|
789
878
|
}
|
|
790
879
|
ngOnInit() {
|
|
791
880
|
this.assetsIcon = this.getAssets();
|
|
@@ -807,20 +896,32 @@ let ImgUploadComponent = class ImgUploadComponent {
|
|
|
807
896
|
this.isLoading = true;
|
|
808
897
|
const imgToUploadList = [];
|
|
809
898
|
for (const file of files) {
|
|
810
|
-
|
|
811
|
-
formData.append('image', file, file.name);
|
|
899
|
+
console.log('file', file.size);
|
|
812
900
|
if (!this.isFileImage(file.type)) {
|
|
813
901
|
this.alertService.openAlert(this.errorNotImg);
|
|
814
902
|
this.isLoading = false;
|
|
815
903
|
continue;
|
|
816
904
|
}
|
|
905
|
+
if (!this.isSizeValid(file.size)) {
|
|
906
|
+
this.alertService.openAlert(`L'image : ${file.name} est trop grande (${this.getImageSizeInKo(file.size)}ko). Taille maximum acceptée: ${this.getImageSizeInKo(this.MAX_IMAGE_SIZE)}ko`);
|
|
907
|
+
this.isLoading = false;
|
|
908
|
+
continue;
|
|
909
|
+
}
|
|
910
|
+
const formData = new FormData();
|
|
911
|
+
formData.append('image', file, file.name);
|
|
817
912
|
imgToUploadList.push(this.imgManager.uploadFile(formData));
|
|
818
913
|
}
|
|
819
914
|
forkJoin(imgToUploadList).subscribe((img) => {
|
|
820
915
|
this.onImgUpload(img),
|
|
821
916
|
this.isLoading = false;
|
|
822
917
|
}, error => {
|
|
823
|
-
|
|
918
|
+
var _a, _b;
|
|
919
|
+
if (((_b = (_a = error) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.message) && error.statusText !== 'Bad Request') {
|
|
920
|
+
this.alertService.openAlertWithBackendRespons(this.errorUploadingImg, error.error.message);
|
|
921
|
+
}
|
|
922
|
+
else {
|
|
923
|
+
this.alertService.openAlert(this.errorUploadingImg);
|
|
924
|
+
}
|
|
824
925
|
this.isLoading = false;
|
|
825
926
|
});
|
|
826
927
|
}
|
|
@@ -835,6 +936,12 @@ let ImgUploadComponent = class ImgUploadComponent {
|
|
|
835
936
|
isFileImage(fileType) {
|
|
836
937
|
return fileType.split('/')[0] === 'image';
|
|
837
938
|
}
|
|
939
|
+
isSizeValid(imageBytesSize) {
|
|
940
|
+
return imageBytesSize < this.MAX_IMAGE_SIZE;
|
|
941
|
+
}
|
|
942
|
+
getImageSizeInKo(size) {
|
|
943
|
+
return Math.round(size / 1024);
|
|
944
|
+
}
|
|
838
945
|
/**
|
|
839
946
|
* Remove the style of the drag and drop box
|
|
840
947
|
* After an img is droped, the box is still grey
|
|
@@ -1009,7 +1116,7 @@ __decorate([
|
|
|
1009
1116
|
UploadListComponent = __decorate([
|
|
1010
1117
|
Component({
|
|
1011
1118
|
selector: 'upload-list',
|
|
1012
|
-
template: "<div class=\"upload-list\" [ngClass]=\"{'smallDisplay': stateDisplayed === 'small'}\" [@easeInOut]=\"'in'\">\n\n <
|
|
1119
|
+
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",
|
|
1013
1120
|
animations: [
|
|
1014
1121
|
easeInOut
|
|
1015
1122
|
]
|
|
@@ -1339,6 +1446,7 @@ let PexelLibComponent = class PexelLibComponent {
|
|
|
1339
1446
|
this.search();
|
|
1340
1447
|
}
|
|
1341
1448
|
search() {
|
|
1449
|
+
console.log('search');
|
|
1342
1450
|
if (this.isLoading) {
|
|
1343
1451
|
return;
|
|
1344
1452
|
}
|
|
@@ -1351,6 +1459,8 @@ let PexelLibComponent = class PexelLibComponent {
|
|
|
1351
1459
|
}
|
|
1352
1460
|
this.isLoading = true;
|
|
1353
1461
|
const searchSub = this.wzImgLibService.searchOnPexels(this.searchValue, this.perPage, this.currentPage).subscribe((data) => {
|
|
1462
|
+
console.log('search ended here');
|
|
1463
|
+
console.log(data);
|
|
1354
1464
|
this.wzImgLibDto = data;
|
|
1355
1465
|
this.nbResult = this.wzImgLibDto.total_results;
|
|
1356
1466
|
if (this.nbResult) {
|
|
@@ -1465,7 +1575,7 @@ __decorate([
|
|
|
1465
1575
|
PexelLibComponent = __decorate([
|
|
1466
1576
|
Component({
|
|
1467
1577
|
selector: 'pexels-lib',
|
|
1468
|
-
template: "<div class=\"pexels-lib\" #outerElement [@easeInOut]=\"'in'\">\n <
|
|
1578
|
+
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",
|
|
1469
1579
|
animations: [
|
|
1470
1580
|
easeInOut,
|
|
1471
1581
|
listAnnimation
|
|
@@ -1815,7 +1925,7 @@ __decorate([
|
|
|
1815
1925
|
ImgEditorComponent = __decorate([
|
|
1816
1926
|
Component({
|
|
1817
1927
|
selector: 'img-editor',
|
|
1818
|
-
template: "<div class=\"img-editor\" [@easeInOut]=\"'in'\">\n\n <
|
|
1928
|
+
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",
|
|
1819
1929
|
animations: [
|
|
1820
1930
|
easeInOut
|
|
1821
1931
|
]
|
|
@@ -1824,13 +1934,8 @@ ImgEditorComponent = __decorate([
|
|
|
1824
1934
|
], ImgEditorComponent);
|
|
1825
1935
|
|
|
1826
1936
|
let CanvaBtnComponent = class CanvaBtnComponent {
|
|
1827
|
-
constructor(canvaService
|
|
1937
|
+
constructor(canvaService) {
|
|
1828
1938
|
this.canvaService = canvaService;
|
|
1829
|
-
this.imgManager = imgManager;
|
|
1830
|
-
this.wzImgEventService = wzImgEventService;
|
|
1831
|
-
this.translateService = translateService;
|
|
1832
|
-
this.alertService = alertService;
|
|
1833
|
-
this.renderer = renderer;
|
|
1834
1939
|
this.showImgUploaded = new EventEmitter();
|
|
1835
1940
|
this.imgLoading = false;
|
|
1836
1941
|
this.availableFormat = {
|
|
@@ -1849,10 +1954,6 @@ let CanvaBtnComponent = class CanvaBtnComponent {
|
|
|
1849
1954
|
};
|
|
1850
1955
|
this.openDropDownMenu = false;
|
|
1851
1956
|
this.subs = [];
|
|
1852
|
-
this.uploadingImg = 'ImgManager.CanvaBtn.uploadingImg';
|
|
1853
|
-
this.successUploadPhoto = 'ImgManager.CanvaBtn.successImport';
|
|
1854
|
-
this.errorUploadCanvaImg = 'ImgManager.CanvaBtn.errorUploadCanvaImg';
|
|
1855
|
-
this.errorRenameCanvaImg = 'ImgManager.CanvaBtn.errorRenameCanvaImg';
|
|
1856
1957
|
}
|
|
1857
1958
|
ngOnInit() {
|
|
1858
1959
|
this.canvaLogoRouteAssets = this.canvaService.getCanvaLogo();
|
|
@@ -1873,71 +1974,14 @@ let CanvaBtnComponent = class CanvaBtnComponent {
|
|
|
1873
1974
|
this.subs.push(subExpectedImgSizesChange);
|
|
1874
1975
|
}
|
|
1875
1976
|
onOpenCanva(width, height) {
|
|
1876
|
-
|
|
1877
|
-
return;
|
|
1878
|
-
}
|
|
1879
|
-
const subCanvaApi = this.canvaService.getCanvaApi().subscribe((api) => {
|
|
1880
|
-
this.canvaApi = api;
|
|
1881
|
-
this.addOverflowBody();
|
|
1882
|
-
this.createDesign(width, height);
|
|
1883
|
-
});
|
|
1884
|
-
this.subs.push(subCanvaApi);
|
|
1885
|
-
}
|
|
1886
|
-
createDesign(width, height) {
|
|
1887
|
-
const createDesign = {
|
|
1888
|
-
type: 'EtsyShopIcon',
|
|
1889
|
-
dimensions: {
|
|
1890
|
-
units: 'px',
|
|
1891
|
-
width: width ? width : undefined,
|
|
1892
|
-
height: height ? height : undefined,
|
|
1893
|
-
},
|
|
1894
|
-
publishLabel: this.translateService.instant('ImgManager.CanvaBtn.publish'),
|
|
1895
|
-
};
|
|
1896
|
-
this.canvaApi.createDesign({
|
|
1897
|
-
design: createDesign,
|
|
1898
|
-
onDesignPublish: ({ exportUrl, designTitle }) => this.designPublished(exportUrl, designTitle),
|
|
1899
|
-
onDesignClose: () => {
|
|
1900
|
-
this.removeOverflowBody();
|
|
1901
|
-
}
|
|
1902
|
-
});
|
|
1903
|
-
}
|
|
1904
|
-
designPublished(exportUrl, designTitle) {
|
|
1905
|
-
this.alertService.openAlert(this.uploadingImg);
|
|
1906
|
-
this.imgLoading = true;
|
|
1907
|
-
const subUploadImg = this.imgManager.uploadFileByUrl(exportUrl, designTitle).subscribe((img) => {
|
|
1908
|
-
this.imgLoading = false;
|
|
1909
|
-
this.removeOverflowBody();
|
|
1910
|
-
this.wzImgEventService.emitImgAdded(img.id_file);
|
|
1911
|
-
this.alertService.openAlert(this.successUploadPhoto);
|
|
1912
|
-
}, error => {
|
|
1913
|
-
this.imgLoading = false;
|
|
1914
|
-
this.removeOverflowBody();
|
|
1915
|
-
if (error.error.code === 406 && error.error.message) {
|
|
1916
|
-
this.alertService.openAlertWithBackendRespons(this.errorUploadCanvaImg, error.error.message);
|
|
1917
|
-
}
|
|
1918
|
-
else {
|
|
1919
|
-
this.alertService.openAlert(this.errorUploadCanvaImg);
|
|
1920
|
-
}
|
|
1921
|
-
});
|
|
1922
|
-
this.subs.push(subUploadImg);
|
|
1923
|
-
}
|
|
1924
|
-
addOverflowBody() {
|
|
1925
|
-
this.renderer.addClass(document.body, 'ovh-canva');
|
|
1926
|
-
}
|
|
1927
|
-
removeOverflowBody() {
|
|
1928
|
-
this.renderer.removeClass(document.body, 'ovh-canva');
|
|
1977
|
+
this.canvaService.openCanva(width, height);
|
|
1929
1978
|
}
|
|
1930
1979
|
ngOnDestroy() {
|
|
1931
1980
|
this.subs.forEach(sub => sub.unsubscribe());
|
|
1932
1981
|
}
|
|
1933
1982
|
};
|
|
1934
1983
|
CanvaBtnComponent.ctorParameters = () => [
|
|
1935
|
-
{ type: CanvaService }
|
|
1936
|
-
{ type: ImgManagerService },
|
|
1937
|
-
{ type: ImgEventService },
|
|
1938
|
-
{ type: TranslateService },
|
|
1939
|
-
{ type: AlertService },
|
|
1940
|
-
{ type: Renderer2 }
|
|
1984
|
+
{ type: CanvaService }
|
|
1941
1985
|
];
|
|
1942
1986
|
__decorate([
|
|
1943
1987
|
Input(),
|
|
@@ -1950,14 +1994,9 @@ __decorate([
|
|
|
1950
1994
|
CanvaBtnComponent = __decorate([
|
|
1951
1995
|
Component({
|
|
1952
1996
|
selector: 'canva-btn',
|
|
1953
|
-
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 <
|
|
1997
|
+
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"
|
|
1954
1998
|
}),
|
|
1955
|
-
__metadata("design:paramtypes", [CanvaService
|
|
1956
|
-
ImgManagerService,
|
|
1957
|
-
ImgEventService,
|
|
1958
|
-
TranslateService,
|
|
1959
|
-
AlertService,
|
|
1960
|
-
Renderer2])
|
|
1999
|
+
__metadata("design:paramtypes", [CanvaService])
|
|
1961
2000
|
], CanvaBtnComponent);
|
|
1962
2001
|
|
|
1963
2002
|
let ImgSelectionComponent = class ImgSelectionComponent {
|
|
@@ -2971,7 +3010,7 @@ __decorate([
|
|
|
2971
3010
|
ImagesViewComponent = __decorate([
|
|
2972
3011
|
Component({
|
|
2973
3012
|
selector: 'images-view',
|
|
2974
|
-
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<
|
|
3013
|
+
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",
|
|
2975
3014
|
animations: [
|
|
2976
3015
|
easeInOut,
|
|
2977
3016
|
insertRemove
|
|
@@ -4474,5 +4513,5 @@ class ImgCDNConfigDTO {
|
|
|
4474
4513
|
* Generated bundle index. Do not edit.
|
|
4475
4514
|
*/
|
|
4476
4515
|
|
|
4477
|
-
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,
|
|
4516
|
+
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 };
|
|
4478
4517
|
//# sourceMappingURL=wizishop-img-manager.js.map
|