@wizishop/img-manager-webelement 15.0.11 → 15.2.5

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.
@@ -0,0 +1,85 @@
1
+ import { HttpHeaders } from "@angular/common/http";
2
+ import { Injectable } from "@angular/core";
3
+ import { tap } from "rxjs";
4
+ import { environment } from '../environments/environment';
5
+ import * as i0 from "@angular/core";
6
+ import * as i1 from "@angular/common/http";
7
+ export class WebelementImageManagerApiService {
8
+ constructor(http) {
9
+ this.http = http;
10
+ this.shopId = null;
11
+ this.CONFIG = {
12
+ image_manager_route: environment.wizi_api + "/image-manager/shops/" + this.shopId,
13
+ canva_token: 'wdByHayF5v57nj2ZSLvu055O',
14
+ canva_url: 'https://sdk.canva.com/designbutton/v2/api.js',
15
+ pexels_token: '563492ad6f91700001000001e39215727d8b42c1b08498a9ce1e6b94',
16
+ pexels_route: 'https://api.pexels.com/v1',
17
+ shop_category: 'other',
18
+ assets_route: environment.assets_route,
19
+ };
20
+ this.IMG_SIZE = {
21
+ url_raw_image: `${environment.CDN_URL}${this.shopId}/RAW-`,
22
+ url_100_image: `${environment.CDN_URL}${this.shopId}/m100-`,
23
+ url_200_image: `${environment.CDN_URL}${this.shopId}/cs200-`,
24
+ url_400_image: `${environment.CDN_URL}${this.shopId}/cs400-`,
25
+ url_800_image: `${environment.CDN_URL}${this.shopId}/cs800-`
26
+ };
27
+ }
28
+ getOptionsHeaders(params) {
29
+ const header = { headers: new HttpHeaders({
30
+ Authorization: 'Bearer ' + this.shopToken
31
+ })
32
+ };
33
+ if (params) {
34
+ header['params'] = params;
35
+ }
36
+ return header;
37
+ }
38
+ getShopCategory() {
39
+ return 'other';
40
+ }
41
+ getShopImgList(params) {
42
+ return this.http.get(`${this.CONFIG.image_manager_route}/images`, this.getOptionsHeaders(params));
43
+ }
44
+ getShopTotalImgList(params) {
45
+ return this.http.get(`${this.CONFIG.image_manager_route}/total/images`, this.getOptionsHeaders(params));
46
+ }
47
+ getShopImg(idFile) {
48
+ return this.http.get(`${this.CONFIG.image_manager_route}/images/${idFile}`, this.getOptionsHeaders());
49
+ }
50
+ uploadFile(formData) {
51
+ return this.http.post(`${this.CONFIG.image_manager_route}/images/template`, formData, this.getOptionsHeaders());
52
+ }
53
+ uploadFileByUrl(url, fileName) {
54
+ return this.http.post(`${this.CONFIG.image_manager_route}/images/template`, { url, fileName }, this.getOptionsHeaders());
55
+ }
56
+ replaceImg(imageBase64, id_file) {
57
+ const body = {
58
+ imageBase64,
59
+ type: "RAW"
60
+ };
61
+ return this.http.put(`${this.CONFIG.image_manager_route}/images/${id_file}/replace`, body, this.getOptionsHeaders());
62
+ }
63
+ changeImgName(fileName, id_file) {
64
+ return this.http.put(`${this.CONFIG.image_manager_route}/images/${id_file}?file_name=${fileName}`, null, this.getOptionsHeaders());
65
+ }
66
+ removeImg(id_file) {
67
+ return this.http.delete(`${this.CONFIG.image_manager_route}/images/${id_file}`, this.getOptionsHeaders());
68
+ }
69
+ removeMultipleImg(id_array) {
70
+ return this.http.post(`${this.CONFIG.image_manager_route}/images-multiple-delete`, { id_array }, this.getOptionsHeaders());
71
+ }
72
+ setShopCategory(shopId) {
73
+ return this.http.get(`${environment.wizi_api}/shops/${shopId}`, this.getOptionsHeaders()).pipe(tap((shop => {
74
+ if (shop && shop['category']) {
75
+ this.CONFIG.shop_category = shop['category'];
76
+ }
77
+ })));
78
+ }
79
+ }
80
+ WebelementImageManagerApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WebelementImageManagerApiService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
81
+ WebelementImageManagerApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WebelementImageManagerApiService });
82
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WebelementImageManagerApiService, decorators: [{
83
+ type: Injectable
84
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
85
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2ViZWxlbWVudC1pbWFnZS1tYW5hZ2VyLWFwaS5jb25maWcuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9pbWctbWFuYWdlci13ZWJlbGVtZW50L3NyYy9saWIvc2VydmljZXMvd2ViZWxlbWVudC1pbWFnZS1tYW5hZ2VyLWFwaS5jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFjLFdBQVcsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQy9ELE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFFM0MsT0FBTyxFQUFjLEdBQUcsRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUN2QyxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sNkJBQTZCLENBQUM7OztBQUkxRCxNQUFNLE9BQU8sZ0NBQWdDO0lBdUJ6QyxZQUFvQixJQUFnQjtRQUFoQixTQUFJLEdBQUosSUFBSSxDQUFZO1FBckJwQyxXQUFNLEdBQVcsSUFBSSxDQUFDO1FBR3RCLFdBQU0sR0FBRztZQUNMLG1CQUFtQixFQUFFLFdBQVcsQ0FBQyxRQUFRLEdBQUcsdUJBQXVCLEdBQUcsSUFBSSxDQUFDLE1BQU07WUFDakYsV0FBVyxFQUFFLDBCQUEwQjtZQUN2QyxTQUFTLEVBQUUsOENBQThDO1lBQ3pELFlBQVksRUFBRSwwREFBMEQ7WUFDeEUsWUFBWSxFQUFFLDJCQUEyQjtZQUN6QyxhQUFhLEVBQUUsT0FBTztZQUN0QixZQUFZLEVBQUUsV0FBVyxDQUFDLFlBQVk7U0FDekMsQ0FBQTtRQUVELGFBQVEsR0FBRztZQUNQLGF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aX0vc2hvcHMvJHtzaG9wSWR9YCwgdGhpcy5nZXRPcHRpb25zSGVhZGVycygpKS5waXBlKFxuICAgICAgICAgICAgdGFwKChzaG9wID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoc2hvcCAmJiBzaG9wWydjYXRlZ29yeSddKSB7XG4gICAgICAgICAgICAgICAgICB0aGlzLkNPTkZJRy5zaG9wX2NhdGVnb3J5ID0gc2hvcFsnY2F0ZWdvcnknXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0pKVxuICAgICAgICApO1xuICAgIH1cblxufSJdfQ==
@@ -1,12 +1,12 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, Component, NgModule } from '@angular/core';
3
+ import { fromEvent, Observable, forkJoin, Subject, tap, from } from 'rxjs';
3
4
  import * as i2 from '@wizishop/img-manager';
4
- import { ImgApiDto, ImgCDNConfigDTO, ImgManagerConfigDto, WzImgManagerModule } from '@wizishop/img-manager';
5
- import { fromEvent, Observable, forkJoin, Subject, from } from 'rxjs';
6
- import * as i1 from '@angular/common/http';
7
- import { HttpHeaders, HttpClientModule } from '@angular/common/http';
5
+ import { ImgSelectionService, WzImgManagerModule, ApiService } from '@wizishop/img-manager';
8
6
  import * as i1$1 from '@ngx-translate/core';
9
7
  import { TranslateModule } from '@ngx-translate/core';
8
+ import * as i1 from '@angular/common/http';
9
+ import { HttpHeaders, HttpClientModule } from '@angular/common/http';
10
10
  import { take } from 'rxjs/operators';
11
11
  import * as i7 from '@angular/common';
12
12
  import { CommonModule } from '@angular/common';
@@ -210,13 +210,13 @@ class FicheProductService {
210
210
  }
211
211
  initProductImgSelection() {
212
212
  // Display the loader in img list selection
213
- this.imgSelectionService.emitImgListLoading(true);
213
+ this.imgSelectionService.imgSelectedListLoading$.next(true);
214
214
  // retrieve img selection
215
215
  const retrieveImgSelectionSub = this.retrieveImgSelection().subscribe(data => {
216
216
  // No imgage selected
217
217
  if (!data || !data["photos"] || !data["photos"]["infos"] || !data["photos"]["infos"]["files"] || !data["photos"]["infos"]["files"].length) {
218
218
  this.loadProductImgSelection = false;
219
- this.imgSelectionService.emitImgListLoading(false);
219
+ this.imgSelectionService.imgSelectedListLoading$.next(false);
220
220
  return;
221
221
  }
222
222
  const idImgSelectionList = data["photos"]["infos"]["files"];
@@ -230,7 +230,7 @@ class FicheProductService {
230
230
  }, error => {
231
231
  // Hide the loader in img list selection
232
232
  this.loadProductImgSelection = false;
233
- this.imgSelectionService.emitImgListLoading(false);
233
+ this.imgSelectionService.imgSelectedListLoading$.next(false);
234
234
  });
235
235
  this.subscriptions.push(allImgSub);
236
236
  });
@@ -257,7 +257,7 @@ class FicheProductService {
257
257
  }
258
258
  updateImgSelectionOnChange() {
259
259
  // listen to the img manager change
260
- const imgSelectionSub = this.imgSelectionService.getImgSelectionChange().subscribe(imgSelectionList => {
260
+ const imgSelectionSub = this.imgSelectionService.imgSelection$.subscribe(imgSelectionList => {
261
261
  if (!imgSelectionList) {
262
262
  return;
263
263
  }
@@ -342,7 +342,7 @@ class FicheProductService {
342
342
  applyCurrentImgSelection() {
343
343
  this.imgSelectionService.setImgSelection(this.currentProductImgSelection);
344
344
  // Hide the loader in img list selection
345
- this.imgSelectionService.emitImgListLoading(false);
345
+ this.imgSelectionService.imgSelectedListLoading$.next(false);
346
346
  }
347
347
  getOptionsHeaders() {
348
348
  const header = { headers: new HttpHeaders({
@@ -458,26 +458,105 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
458
458
  }], ctorParameters: function () { return [{ type: StorageService }]; } });
459
459
  ;
460
460
 
461
+ class WebelementImageManagerApiService {
462
+ constructor(http) {
463
+ this.http = http;
464
+ this.shopId = null;
465
+ this.CONFIG = {
466
+ image_manager_route: environment.wizi_api + "/image-manager/shops/" + this.shopId,
467
+ canva_token: 'wdByHayF5v57nj2ZSLvu055O',
468
+ canva_url: 'https://sdk.canva.com/designbutton/v2/api.js',
469
+ pexels_token: '563492ad6f91700001000001e39215727d8b42c1b08498a9ce1e6b94',
470
+ pexels_route: 'https://api.pexels.com/v1',
471
+ shop_category: 'other',
472
+ assets_route: environment.assets_route,
473
+ };
474
+ this.IMG_SIZE = {
475
+ url_raw_image: `${environment.CDN_URL}${this.shopId}/RAW-`,
476
+ url_100_image: `${environment.CDN_URL}${this.shopId}/m100-`,
477
+ url_200_image: `${environment.CDN_URL}${this.shopId}/cs200-`,
478
+ url_400_image: `${environment.CDN_URL}${this.shopId}/cs400-`,
479
+ url_800_image: `${environment.CDN_URL}${this.shopId}/cs800-`
480
+ };
481
+ }
482
+ getOptionsHeaders(params) {
483
+ const header = { headers: new HttpHeaders({
484
+ Authorization: 'Bearer ' + this.shopToken
485
+ })
486
+ };
487
+ if (params) {
488
+ header['params'] = params;
489
+ }
490
+ return header;
491
+ }
492
+ getShopCategory() {
493
+ return 'other';
494
+ }
495
+ getShopImgList(params) {
496
+ return this.http.get(`${this.CONFIG.image_manager_route}/images`, this.getOptionsHeaders(params));
497
+ }
498
+ getShopTotalImgList(params) {
499
+ return this.http.get(`${this.CONFIG.image_manager_route}/total/images`, this.getOptionsHeaders(params));
500
+ }
501
+ getShopImg(idFile) {
502
+ return this.http.get(`${this.CONFIG.image_manager_route}/images/${idFile}`, this.getOptionsHeaders());
503
+ }
504
+ uploadFile(formData) {
505
+ return this.http.post(`${this.CONFIG.image_manager_route}/images/template`, formData, this.getOptionsHeaders());
506
+ }
507
+ uploadFileByUrl(url, fileName) {
508
+ return this.http.post(`${this.CONFIG.image_manager_route}/images/template`, { url, fileName }, this.getOptionsHeaders());
509
+ }
510
+ replaceImg(imageBase64, id_file) {
511
+ const body = {
512
+ imageBase64,
513
+ type: "RAW"
514
+ };
515
+ return this.http.put(`${this.CONFIG.image_manager_route}/images/${id_file}/replace`, body, this.getOptionsHeaders());
516
+ }
517
+ changeImgName(fileName, id_file) {
518
+ return this.http.put(`${this.CONFIG.image_manager_route}/images/${id_file}?file_name=${fileName}`, null, this.getOptionsHeaders());
519
+ }
520
+ removeImg(id_file) {
521
+ return this.http.delete(`${this.CONFIG.image_manager_route}/images/${id_file}`, this.getOptionsHeaders());
522
+ }
523
+ removeMultipleImg(id_array) {
524
+ return this.http.post(`${this.CONFIG.image_manager_route}/images-multiple-delete`, { id_array }, this.getOptionsHeaders());
525
+ }
526
+ setShopCategory(shopId) {
527
+ return this.http.get(`${environment.wizi_api}/shops/${shopId}`, this.getOptionsHeaders()).pipe(tap((shop => {
528
+ if (shop && shop['category']) {
529
+ this.CONFIG.shop_category = shop['category'];
530
+ }
531
+ })));
532
+ }
533
+ }
534
+ WebelementImageManagerApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WebelementImageManagerApiService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
535
+ WebelementImageManagerApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WebelementImageManagerApiService });
536
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WebelementImageManagerApiService, decorators: [{
537
+ type: Injectable
538
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
539
+
461
540
  class ImgManagerWebElementComponent {
462
- constructor(translateService, imgSelectionService, canvaService, ficheProductService, authCredentialsService, http, eventService, imgManagerService) {
541
+ constructor(translateService, canvaService, ficheProductService, authCredentialsService, eventService, imgManagerService, imgSelectionService, webelementImageManagerApiService) {
463
542
  this.translateService = translateService;
464
- this.imgSelectionService = imgSelectionService;
465
543
  this.canvaService = canvaService;
466
544
  this.ficheProductService = ficheProductService;
467
545
  this.authCredentialsService = authCredentialsService;
468
- this.http = http;
469
546
  this.eventService = eventService;
470
547
  this.imgManagerService = imgManagerService;
548
+ this.imgSelectionService = imgSelectionService;
549
+ this.webelementImageManagerApiService = webelementImageManagerApiService;
471
550
  // img manger config
472
551
  this.openImgManager = false;
473
552
  this.loading = true;
474
- // fiche roduct config
553
+ // fiche product config
475
554
  this.isPhotosTab = !!environment.isPhotosTab;
476
555
  this.subscriptions = [];
477
556
  }
478
557
  ngOnInit() {
479
558
  this.loading = true;
480
- this.pageficheProductConfig = this.imgManagerService.getImgManagerDisplayConfig("fiche-product");
559
+ this.pageFicheProductConfig = this.imgManagerService.getImgManagerDisplayConfig("fiche-product");
481
560
  this.pageEventConfig = this.imgManagerService.getImgManagerDisplayConfig("wizi-block");
482
561
  this.setCurrentLanguage();
483
562
  // Search on which page is display the img manger
@@ -501,13 +580,11 @@ class ImgManagerWebElementComponent {
501
580
  return;
502
581
  }
503
582
  // Run on local Server
504
- this.setAppVars(null, environment.local.shopId, null, environment.local.token);
505
- this.setImgManagerExtraConfig();
506
- this.imgManagerDisplayConfig = this.pageficheProductConfig;
583
+ this.setAppVars(environment.local.shopId, environment.local.token);
584
+ this.imgManagerDisplayConfig = this.pageFicheProductConfig;
507
585
  return;
508
586
  }
509
- this.setAppVars(authCredentials.user_id, authCredentials.shop_id, authCredentials.account_id, authCredentials.token);
510
- this.setImgManagerExtraConfig();
587
+ this.setAppVars(authCredentials.shop_id, authCredentials.token);
511
588
  }
512
589
  setFicheProductPage() {
513
590
  this.ficheProductService.setApiConfig(this.id_shop, this.token_shop);
@@ -519,7 +596,7 @@ class ImgManagerWebElementComponent {
519
596
  setPageWithEvents() {
520
597
  this.subscribePageAskForImg();
521
598
  // Send img selected
522
- const subImgSelection = this.imgSelectionService.getImgSelectionChange().subscribe(imgSelectionList => {
599
+ const subImgSelection = this.imgSelectionService.imgSelection$.subscribe(imgSelectionList => {
523
600
  if (imgSelectionList && imgSelectionList.length) {
524
601
  this.eventService.sendImgSelectedToPage(imgSelectionList[0]);
525
602
  }
@@ -550,11 +627,11 @@ class ImgManagerWebElementComponent {
550
627
  }
551
628
  setDisplayedPageConfig() {
552
629
  const isFicheProductPage = /\/products\/(\d+\/edit|create)/.test(window.location.pathname);
553
- this.imgManagerDisplayConfig = isFicheProductPage ? this.pageficheProductConfig : this.pageEventConfig;
630
+ this.imgManagerDisplayConfig = isFicheProductPage ? this.pageFicheProductConfig : this.pageEventConfig;
554
631
  }
555
632
  handleFicheProductTab() {
556
633
  const tabsSub = this.ficheProductService.handleTabs().subscribe(isPhotosTab => {
557
- this.imgManagerDisplayConfig = isPhotosTab ? this.pageficheProductConfig : this.pageEventConfig;
634
+ this.imgManagerDisplayConfig = isPhotosTab ? this.pageFicheProductConfig : this.pageEventConfig;
558
635
  this.isPhotosTab = isPhotosTab;
559
636
  });
560
637
  this.subscriptions.push(tabsSub);
@@ -568,74 +645,48 @@ class ImgManagerWebElementComponent {
568
645
  getCredentials() {
569
646
  return from(this.authCredentialsService.get());
570
647
  }
571
- setAppVars(userId, shopId, accountId, token) {
572
- this.userId = userId;
573
- this.id_shop = shopId;
574
- this.accountId = accountId;
575
- this.token_shop = token;
576
- }
577
- setImgManagerExtraConfig() {
578
- const apiDto = new ImgApiDto();
579
- apiDto.shop_token = this.token_shop;
580
- apiDto.image_manager_route = environment.wizi_api + "/image-manager/shops/" + this.id_shop;
581
- apiDto.canva_token = 'wdByHayF5v57nj2ZSLvu055O';
582
- apiDto.canva_url = 'https://sdk.canva.com/designbutton/v2/api.js';
583
- apiDto.pexels_token = '563492ad6f91700001000001e39215727d8b42c1b08498a9ce1e6b94';
584
- apiDto.pexels_route = 'https://api.pexels.com/v1';
585
- apiDto.shop_category = 'other'; // The shop categorie is retrieve later with the getShopCategory methode
586
- apiDto.assets_route = environment.assets_route;
587
- const imgCDNConfigDTO = new ImgCDNConfigDTO();
588
- imgCDNConfigDTO.url_raw_image = `${environment.CDN_URL}${this.id_shop}/RAW-`;
589
- imgCDNConfigDTO.url_100_image = `${environment.CDN_URL}${this.id_shop}/m100-`;
590
- imgCDNConfigDTO.url_200_image = `${environment.CDN_URL}${this.id_shop}/cs200-`;
591
- imgCDNConfigDTO.url_400_image = `${environment.CDN_URL}${this.id_shop}/cs400-`;
592
- imgCDNConfigDTO.url_800_image = `${environment.CDN_URL}${this.id_shop}/cs800-`;
593
- this.imgExternalConfig = new ImgManagerConfigDto();
594
- this.imgExternalConfig.api = apiDto;
595
- this.imgExternalConfig.imgCDNConfig = imgCDNConfigDTO;
596
- const subShopCategory = this.getShopCategory().subscribe(shop => {
597
- if (shop && shop['category']) {
598
- this.imgExternalConfig.api.shop_category = shop['category'];
599
- }
600
- });
601
- this.subscriptions.push(subShopCategory);
602
- }
603
- getShopCategory() {
604
- return this.http.get(`${environment.wizi_api}/shops/${this.id_shop}`, this.getOptionsHeadersWithBearer());
605
- }
606
- getOptionsHeadersWithBearer() {
607
- const header = { headers: new HttpHeaders({
608
- Authorization: 'Bearer ' + this.token_shop
609
- })
610
- };
611
- return header;
648
+ setAppVars(shopId, token) {
649
+ this.webelementImageManagerApiService.shopToken = token;
650
+ this.webelementImageManagerApiService.shopId = shopId;
651
+ if (shopId) {
652
+ this.webelementImageManagerApiService.setShopCategory(shopId).subscribe();
653
+ }
612
654
  }
613
655
  ngOnDestroy() {
614
656
  this.subscriptions.forEach(sub => sub.unsubscribe());
615
657
  }
616
658
  }
617
- ImgManagerWebElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerWebElementComponent, deps: [{ token: i1$1.TranslateService }, { token: i2.ImgSelectionService }, { token: i2.CanvaService }, { token: FicheProductService }, { token: AuthCredentialsService }, { token: i1.HttpClient }, { token: EventService }, { token: i2.ImgManagerService }], target: i0.ɵɵFactoryTarget.Component });
618
- ImgManagerWebElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ImgManagerWebElementComponent, selector: "img-manager-webelement", ngImport: i0, template: "<div class=\"info-bulle\">\n <p class=\"info-bulle-content\" [innerHTML]=\"'ImgManager.webElement.infoBulle' | translate\"></p>\n\n <ng-container *ngIf=\"imgManagerDisplayConfig.pageficheProduct && isPhotosTab\">\n <h3 class=\"wizicss-sous-titre\">{{'ImgManager.webElement.photosTitle' | translate }}</h3>\n </ng-container>\n\n <ng-container *ngIf=\"!loading && id_shop && imgManagerDisplayConfig\">\n\n <p class=\"img-manager-open\" *ngIf=\"imgManagerDisplayConfig.displayBtn && isPhotosTab\">\n <a (click)=\"open()\">{{'ImgManager.webElement.OpenBtn' | translate }}</a>\n </p>\n\n <div class=\"imgManagerBox\">\n <wz-img-manager\n #wzImgManager\n [stateDisplayed]=\"imgManagerDisplayConfig.stateDisplayed\"\n [multipleImgMode]=\"imgManagerDisplayConfig.multipleImgMode\"\n [showImgManagerModule]=\"imgManagerDisplayConfig.showImgManagerModule && openImgManager\"\n [showSelection]=\"imgManagerDisplayConfig.showSelection\"\n [externalConfig]=\"imgExternalConfig\"\n (imgManagerClosed)=\"onImgManagerClosed()\">\n </wz-img-manager>\n </div>\n </ng-container>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.WzImgManagerComponent, selector: "wz-img-manager", inputs: ["stateDisplayed", "showSelection", "externalConfig", "forceToOpenCanva", "multipleImgMode", "showImgManagerModule"], outputs: ["imgManagerClosed"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
659
+ ImgManagerWebElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerWebElementComponent, deps: [{ token: i1$1.TranslateService }, { token: i2.CanvaService }, { token: FicheProductService }, { token: AuthCredentialsService }, { token: EventService }, { token: i2.ImgManagerService }, { token: i2.ImgSelectionService }, { token: WebelementImageManagerApiService }], target: i0.ɵɵFactoryTarget.Component });
660
+ ImgManagerWebElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ImgManagerWebElementComponent, selector: "img-manager-webelement", providers: [
661
+ ImgSelectionService
662
+ ], ngImport: i0, template: "<div class=\"info-bulle\">\n <p class=\"info-bulle-content\" [innerHTML]=\"'ImgManager.webElement.infoBulle' | translate\"></p>\n\n <ng-container *ngIf=\"imgManagerDisplayConfig.pageficheProduct && isPhotosTab\">\n <h3 class=\"wizicss-sous-titre\">{{'ImgManager.webElement.photosTitle' | translate }}</h3>\n </ng-container>\n\n <ng-container *ngIf=\"!loading && id_shop && imgManagerDisplayConfig\">\n\n <p class=\"img-manager-open\" *ngIf=\"imgManagerDisplayConfig.displayBtn && isPhotosTab\">\n <a (click)=\"open()\">{{'ImgManager.webElement.OpenBtn' | translate }}</a>\n </p>\n\n <div class=\"imgManagerBox\">\n <wz-img-manager\n #wzImgManager\n [stateDisplayed]=\"imgManagerDisplayConfig.stateDisplayed\"\n [multipleImgMode]=\"imgManagerDisplayConfig.multipleImgMode\"\n [showImgManagerModule]=\"imgManagerDisplayConfig.showImgManagerModule && openImgManager\"\n [showSelection]=\"imgManagerDisplayConfig.showSelection\"\n (imgManagerClosed)=\"onImgManagerClosed()\">\n </wz-img-manager>\n </div>\n </ng-container>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.WzImgManagerComponent, selector: "wz-img-manager", inputs: ["stateDisplayed", "showSelection", "forceToOpenCanva", "multipleImgMode", "showImgManagerModule"], outputs: ["imgManagerClosed", "imgSelectionChange"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
619
663
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerWebElementComponent, decorators: [{
620
664
  type: Component,
621
- args: [{ selector: 'img-manager-webelement', template: "<div class=\"info-bulle\">\n <p class=\"info-bulle-content\" [innerHTML]=\"'ImgManager.webElement.infoBulle' | translate\"></p>\n\n <ng-container *ngIf=\"imgManagerDisplayConfig.pageficheProduct && isPhotosTab\">\n <h3 class=\"wizicss-sous-titre\">{{'ImgManager.webElement.photosTitle' | translate }}</h3>\n </ng-container>\n\n <ng-container *ngIf=\"!loading && id_shop && imgManagerDisplayConfig\">\n\n <p class=\"img-manager-open\" *ngIf=\"imgManagerDisplayConfig.displayBtn && isPhotosTab\">\n <a (click)=\"open()\">{{'ImgManager.webElement.OpenBtn' | translate }}</a>\n </p>\n\n <div class=\"imgManagerBox\">\n <wz-img-manager\n #wzImgManager\n [stateDisplayed]=\"imgManagerDisplayConfig.stateDisplayed\"\n [multipleImgMode]=\"imgManagerDisplayConfig.multipleImgMode\"\n [showImgManagerModule]=\"imgManagerDisplayConfig.showImgManagerModule && openImgManager\"\n [showSelection]=\"imgManagerDisplayConfig.showSelection\"\n [externalConfig]=\"imgExternalConfig\"\n (imgManagerClosed)=\"onImgManagerClosed()\">\n </wz-img-manager>\n </div>\n </ng-container>\n</div>" }]
622
- }], ctorParameters: function () { return [{ type: i1$1.TranslateService }, { type: i2.ImgSelectionService }, { type: i2.CanvaService }, { type: FicheProductService }, { type: AuthCredentialsService }, { type: i1.HttpClient }, { type: EventService }, { type: i2.ImgManagerService }]; } });
665
+ args: [{ selector: 'img-manager-webelement', providers: [
666
+ ImgSelectionService
667
+ ], template: "<div class=\"info-bulle\">\n <p class=\"info-bulle-content\" [innerHTML]=\"'ImgManager.webElement.infoBulle' | translate\"></p>\n\n <ng-container *ngIf=\"imgManagerDisplayConfig.pageficheProduct && isPhotosTab\">\n <h3 class=\"wizicss-sous-titre\">{{'ImgManager.webElement.photosTitle' | translate }}</h3>\n </ng-container>\n\n <ng-container *ngIf=\"!loading && id_shop && imgManagerDisplayConfig\">\n\n <p class=\"img-manager-open\" *ngIf=\"imgManagerDisplayConfig.displayBtn && isPhotosTab\">\n <a (click)=\"open()\">{{'ImgManager.webElement.OpenBtn' | translate }}</a>\n </p>\n\n <div class=\"imgManagerBox\">\n <wz-img-manager\n #wzImgManager\n [stateDisplayed]=\"imgManagerDisplayConfig.stateDisplayed\"\n [multipleImgMode]=\"imgManagerDisplayConfig.multipleImgMode\"\n [showImgManagerModule]=\"imgManagerDisplayConfig.showImgManagerModule && openImgManager\"\n [showSelection]=\"imgManagerDisplayConfig.showSelection\"\n (imgManagerClosed)=\"onImgManagerClosed()\">\n </wz-img-manager>\n </div>\n </ng-container>\n</div>" }]
668
+ }], ctorParameters: function () { return [{ type: i1$1.TranslateService }, { type: i2.CanvaService }, { type: FicheProductService }, { type: AuthCredentialsService }, { type: EventService }, { type: i2.ImgManagerService }, { type: i2.ImgSelectionService }, { type: WebelementImageManagerApiService }]; } });
623
669
 
624
670
  class ImgManagerWebElementModule {
625
671
  }
626
672
  ImgManagerWebElementModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerWebElementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
627
673
  ImgManagerWebElementModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerWebElementModule, declarations: [ImgManagerWebElementComponent], imports: [CommonModule,
628
- HttpClientModule,
629
- WzImgManagerModule,
630
- TranslateModule], exports: [ImgManagerWebElementComponent] });
674
+ HttpClientModule, i2.WzImgManagerModule, TranslateModule], exports: [ImgManagerWebElementComponent] });
631
675
  ImgManagerWebElementModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerWebElementModule, providers: [
676
+ {
677
+ provide: WebelementImageManagerApiService,
678
+ useClass: WebelementImageManagerApiService,
679
+ },
632
680
  StorageService,
633
681
  FicheProductService,
634
682
  EventService,
635
683
  AuthCredentialsService
636
684
  ], imports: [CommonModule,
637
685
  HttpClientModule,
638
- WzImgManagerModule,
686
+ WzImgManagerModule.withConfig({
687
+ provide: ApiService,
688
+ useExisting: WebelementImageManagerApiService,
689
+ }),
639
690
  TranslateModule] });
640
691
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerWebElementModule, decorators: [{
641
692
  type: NgModule,
@@ -644,11 +695,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
644
695
  imports: [
645
696
  CommonModule,
646
697
  HttpClientModule,
647
- WzImgManagerModule,
698
+ WzImgManagerModule.withConfig({
699
+ provide: ApiService,
700
+ useExisting: WebelementImageManagerApiService,
701
+ }),
648
702
  TranslateModule,
649
703
  ],
650
704
  exports: [ImgManagerWebElementComponent],
651
705
  providers: [
706
+ {
707
+ provide: WebelementImageManagerApiService,
708
+ useClass: WebelementImageManagerApiService,
709
+ },
652
710
  StorageService,
653
711
  FicheProductService,
654
712
  EventService,
@@ -667,4 +725,3 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
667
725
 
668
726
  export { ImgManagerWebElementComponent, ImgManagerWebElementModule };
669
727
  //# sourceMappingURL=wizishop-img-manager-webelement.mjs.map
670
- //# sourceMappingURL=wizishop-img-manager-webelement.mjs.map