@wizishop/img-manager-webelement 15.0.11 → 15.2.1

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,82 @@
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
+ getShopImgList(params) {
39
+ return this.http.get(`${this.CONFIG.image_manager_route}/images`, this.getOptionsHeaders(params));
40
+ }
41
+ getShopTotalImgList(params) {
42
+ return this.http.get(`${this.CONFIG.image_manager_route}/images`, this.getOptionsHeaders(params));
43
+ }
44
+ getShopImg(idFile) {
45
+ return this.http.get(`${this.CONFIG.image_manager_route}/images/${idFile}`, this.getOptionsHeaders());
46
+ }
47
+ uploadFile(formData) {
48
+ return this.http.post(`${this.CONFIG.image_manager_route}/images/template`, formData, this.getOptionsHeaders());
49
+ }
50
+ uploadFileByUrl(url, fileName) {
51
+ return this.http.post(`${this.CONFIG.image_manager_route}/images/template`, { url, fileName }, this.getOptionsHeaders());
52
+ }
53
+ replaceImg(imageBase64, id_file) {
54
+ const body = {
55
+ imageBase64,
56
+ type: "RAW"
57
+ };
58
+ return this.http.put(`${this.CONFIG.image_manager_route}/images/${id_file}/replace`, body, this.getOptionsHeaders());
59
+ }
60
+ changeImgName(fileName, id_file) {
61
+ return this.http.put(`${this.CONFIG.image_manager_route}/images/${id_file}?file_name=${fileName}`, null, this.getOptionsHeaders());
62
+ }
63
+ removeImg(id_file) {
64
+ return this.http.delete(`${this.CONFIG.image_manager_route}/images/${id_file}`, this.getOptionsHeaders());
65
+ }
66
+ removeMultipleImg(id_array) {
67
+ return this.http.post(`${this.CONFIG.image_manager_route}/images-multiple-delete`, { id_array }, this.getOptionsHeaders());
68
+ }
69
+ setShopCategory(shopId) {
70
+ return this.http.get(`${environment.wizi_api}/shops/${shopId}`, this.getOptionsHeaders()).pipe(tap((shop => {
71
+ if (shop && shop['category']) {
72
+ this.CONFIG.shop_category = shop['category'];
73
+ }
74
+ })));
75
+ }
76
+ }
77
+ WebelementImageManagerApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WebelementImageManagerApiService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
78
+ WebelementImageManagerApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WebelementImageManagerApiService });
79
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WebelementImageManagerApiService, decorators: [{
80
+ type: Injectable
81
+ }], ctorParameters: function () { return [{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gICAgICB9XG4gICAgICAgICAgICAgIH0pKVxuICAgICAgICApO1xuICAgIH1cblxufSJdfQ==
@@ -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,102 @@ 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
+ getShopImgList(params) {
493
+ return this.http.get(`${this.CONFIG.image_manager_route}/images`, this.getOptionsHeaders(params));
494
+ }
495
+ getShopTotalImgList(params) {
496
+ return this.http.get(`${this.CONFIG.image_manager_route}/images`, this.getOptionsHeaders(params));
497
+ }
498
+ getShopImg(idFile) {
499
+ return this.http.get(`${this.CONFIG.image_manager_route}/images/${idFile}`, this.getOptionsHeaders());
500
+ }
501
+ uploadFile(formData) {
502
+ return this.http.post(`${this.CONFIG.image_manager_route}/images/template`, formData, this.getOptionsHeaders());
503
+ }
504
+ uploadFileByUrl(url, fileName) {
505
+ return this.http.post(`${this.CONFIG.image_manager_route}/images/template`, { url, fileName }, this.getOptionsHeaders());
506
+ }
507
+ replaceImg(imageBase64, id_file) {
508
+ const body = {
509
+ imageBase64,
510
+ type: "RAW"
511
+ };
512
+ return this.http.put(`${this.CONFIG.image_manager_route}/images/${id_file}/replace`, body, this.getOptionsHeaders());
513
+ }
514
+ changeImgName(fileName, id_file) {
515
+ return this.http.put(`${this.CONFIG.image_manager_route}/images/${id_file}?file_name=${fileName}`, null, this.getOptionsHeaders());
516
+ }
517
+ removeImg(id_file) {
518
+ return this.http.delete(`${this.CONFIG.image_manager_route}/images/${id_file}`, this.getOptionsHeaders());
519
+ }
520
+ removeMultipleImg(id_array) {
521
+ return this.http.post(`${this.CONFIG.image_manager_route}/images-multiple-delete`, { id_array }, this.getOptionsHeaders());
522
+ }
523
+ setShopCategory(shopId) {
524
+ return this.http.get(`${environment.wizi_api}/shops/${shopId}`, this.getOptionsHeaders()).pipe(tap((shop => {
525
+ if (shop && shop['category']) {
526
+ this.CONFIG.shop_category = shop['category'];
527
+ }
528
+ })));
529
+ }
530
+ }
531
+ WebelementImageManagerApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WebelementImageManagerApiService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
532
+ WebelementImageManagerApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WebelementImageManagerApiService });
533
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WebelementImageManagerApiService, decorators: [{
534
+ type: Injectable
535
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
536
+
461
537
  class ImgManagerWebElementComponent {
462
- constructor(translateService, imgSelectionService, canvaService, ficheProductService, authCredentialsService, http, eventService, imgManagerService) {
538
+ constructor(translateService, canvaService, ficheProductService, authCredentialsService, eventService, imgManagerService, imgSelectionService, webelementImageManagerApiService) {
463
539
  this.translateService = translateService;
464
- this.imgSelectionService = imgSelectionService;
465
540
  this.canvaService = canvaService;
466
541
  this.ficheProductService = ficheProductService;
467
542
  this.authCredentialsService = authCredentialsService;
468
- this.http = http;
469
543
  this.eventService = eventService;
470
544
  this.imgManagerService = imgManagerService;
545
+ this.imgSelectionService = imgSelectionService;
546
+ this.webelementImageManagerApiService = webelementImageManagerApiService;
471
547
  // img manger config
472
548
  this.openImgManager = false;
473
549
  this.loading = true;
474
- // fiche roduct config
550
+ // fiche product config
475
551
  this.isPhotosTab = !!environment.isPhotosTab;
476
552
  this.subscriptions = [];
477
553
  }
478
554
  ngOnInit() {
479
555
  this.loading = true;
480
- this.pageficheProductConfig = this.imgManagerService.getImgManagerDisplayConfig("fiche-product");
556
+ this.pageFicheProductConfig = this.imgManagerService.getImgManagerDisplayConfig("fiche-product");
481
557
  this.pageEventConfig = this.imgManagerService.getImgManagerDisplayConfig("wizi-block");
482
558
  this.setCurrentLanguage();
483
559
  // Search on which page is display the img manger
@@ -501,13 +577,11 @@ class ImgManagerWebElementComponent {
501
577
  return;
502
578
  }
503
579
  // Run on local Server
504
- this.setAppVars(null, environment.local.shopId, null, environment.local.token);
505
- this.setImgManagerExtraConfig();
506
- this.imgManagerDisplayConfig = this.pageficheProductConfig;
580
+ this.setAppVars(environment.local.shopId, environment.local.token);
581
+ this.imgManagerDisplayConfig = this.pageFicheProductConfig;
507
582
  return;
508
583
  }
509
- this.setAppVars(authCredentials.user_id, authCredentials.shop_id, authCredentials.account_id, authCredentials.token);
510
- this.setImgManagerExtraConfig();
584
+ this.setAppVars(authCredentials.shop_id, authCredentials.token);
511
585
  }
512
586
  setFicheProductPage() {
513
587
  this.ficheProductService.setApiConfig(this.id_shop, this.token_shop);
@@ -519,7 +593,7 @@ class ImgManagerWebElementComponent {
519
593
  setPageWithEvents() {
520
594
  this.subscribePageAskForImg();
521
595
  // Send img selected
522
- const subImgSelection = this.imgSelectionService.getImgSelectionChange().subscribe(imgSelectionList => {
596
+ const subImgSelection = this.imgSelectionService.imgSelection$.subscribe(imgSelectionList => {
523
597
  if (imgSelectionList && imgSelectionList.length) {
524
598
  this.eventService.sendImgSelectedToPage(imgSelectionList[0]);
525
599
  }
@@ -550,11 +624,11 @@ class ImgManagerWebElementComponent {
550
624
  }
551
625
  setDisplayedPageConfig() {
552
626
  const isFicheProductPage = /\/products\/(\d+\/edit|create)/.test(window.location.pathname);
553
- this.imgManagerDisplayConfig = isFicheProductPage ? this.pageficheProductConfig : this.pageEventConfig;
627
+ this.imgManagerDisplayConfig = isFicheProductPage ? this.pageFicheProductConfig : this.pageEventConfig;
554
628
  }
555
629
  handleFicheProductTab() {
556
630
  const tabsSub = this.ficheProductService.handleTabs().subscribe(isPhotosTab => {
557
- this.imgManagerDisplayConfig = isPhotosTab ? this.pageficheProductConfig : this.pageEventConfig;
631
+ this.imgManagerDisplayConfig = isPhotosTab ? this.pageFicheProductConfig : this.pageEventConfig;
558
632
  this.isPhotosTab = isPhotosTab;
559
633
  });
560
634
  this.subscriptions.push(tabsSub);
@@ -568,74 +642,48 @@ class ImgManagerWebElementComponent {
568
642
  getCredentials() {
569
643
  return from(this.authCredentialsService.get());
570
644
  }
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;
645
+ setAppVars(shopId, token) {
646
+ this.webelementImageManagerApiService.shopToken = token;
647
+ this.webelementImageManagerApiService.shopId = shopId;
648
+ if (shopId) {
649
+ this.webelementImageManagerApiService.setShopCategory(shopId).subscribe();
650
+ }
612
651
  }
613
652
  ngOnDestroy() {
614
653
  this.subscriptions.forEach(sub => sub.unsubscribe());
615
654
  }
616
655
  }
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" }] });
656
+ 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 });
657
+ ImgManagerWebElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ImgManagerWebElementComponent, selector: "img-manager-webelement", providers: [
658
+ ImgSelectionService
659
+ ], 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
660
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerWebElementComponent, decorators: [{
620
661
  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 }]; } });
662
+ args: [{ selector: 'img-manager-webelement', providers: [
663
+ ImgSelectionService
664
+ ], 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>" }]
665
+ }], 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
666
 
624
667
  class ImgManagerWebElementModule {
625
668
  }
626
669
  ImgManagerWebElementModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerWebElementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
627
670
  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] });
671
+ HttpClientModule, i2.WzImgManagerModule, TranslateModule], exports: [ImgManagerWebElementComponent] });
631
672
  ImgManagerWebElementModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerWebElementModule, providers: [
673
+ {
674
+ provide: WebelementImageManagerApiService,
675
+ useClass: WebelementImageManagerApiService,
676
+ },
632
677
  StorageService,
633
678
  FicheProductService,
634
679
  EventService,
635
680
  AuthCredentialsService
636
681
  ], imports: [CommonModule,
637
682
  HttpClientModule,
638
- WzImgManagerModule,
683
+ WzImgManagerModule.withConfig({
684
+ provide: ApiService,
685
+ useExisting: WebelementImageManagerApiService,
686
+ }),
639
687
  TranslateModule] });
640
688
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerWebElementModule, decorators: [{
641
689
  type: NgModule,
@@ -644,11 +692,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
644
692
  imports: [
645
693
  CommonModule,
646
694
  HttpClientModule,
647
- WzImgManagerModule,
695
+ WzImgManagerModule.withConfig({
696
+ provide: ApiService,
697
+ useExisting: WebelementImageManagerApiService,
698
+ }),
648
699
  TranslateModule,
649
700
  ],
650
701
  exports: [ImgManagerWebElementComponent],
651
702
  providers: [
703
+ {
704
+ provide: WebelementImageManagerApiService,
705
+ useClass: WebelementImageManagerApiService,
706
+ },
652
707
  StorageService,
653
708
  FicheProductService,
654
709
  EventService,
@@ -667,4 +722,3 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
667
722
 
668
723
  export { ImgManagerWebElementComponent, ImgManagerWebElementModule };
669
724
  //# sourceMappingURL=wizishop-img-manager-webelement.mjs.map
670
- //# sourceMappingURL=wizishop-img-manager-webelement.mjs.map