@wizishop/img-manager 0.2.49 → 0.2.53

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.
@@ -375,7 +375,7 @@ var UserSettingsService = /** @class */ (function () {
375
375
  };
376
376
  UserSettingsService.prototype.getUserDisplayPreference = function () {
377
377
  var value = localStorage.getItem(this.userdisplayPreference);
378
- return value == 'true' ? true : false;
378
+ return value == 'true';
379
379
  };
380
380
  UserSettingsService.ɵprov = ɵɵdefineInjectable({ factory: function UserSettingsService_Factory() { return new UserSettingsService(); }, token: UserSettingsService, providedIn: "root" });
381
381
  UserSettingsService = __decorate([
@@ -615,7 +615,6 @@ var WzImgManagerComponent = /** @class */ (function () {
615
615
  }
616
616
  };
617
617
  WzImgManagerComponent.prototype.setCurrentTab = function (event) {
618
- console.log(event);
619
618
  if (event === 'img-edition') {
620
619
  this.hideTab = true;
621
620
  return;
@@ -1865,12 +1864,11 @@ var ImgEditorComponent = /** @class */ (function () {
1865
1864
  }());
1866
1865
 
1867
1866
  var CanvaBtnComponent = /** @class */ (function () {
1868
- function CanvaBtnComponent(canvaService, imgManager, wzImgEventService, translateService, imgSelectionService, alertService, renderer) {
1867
+ function CanvaBtnComponent(canvaService, imgManager, wzImgEventService, translateService, alertService, renderer) {
1869
1868
  this.canvaService = canvaService;
1870
1869
  this.imgManager = imgManager;
1871
1870
  this.wzImgEventService = wzImgEventService;
1872
1871
  this.translateService = translateService;
1873
- this.imgSelectionService = imgSelectionService;
1874
1872
  this.alertService = alertService;
1875
1873
  this.renderer = renderer;
1876
1874
  this.showImgUploaded = new EventEmitter();
@@ -1907,12 +1905,10 @@ var CanvaBtnComponent = /** @class */ (function () {
1907
1905
  if (mediaDTO) {
1908
1906
  _this.expectedWidth = parseInt(mediaDTO.image_width, 10);
1909
1907
  _this.expectedHeight = parseInt(mediaDTO.image_height, 10);
1910
- _this.imgExpectedByWiziblock = true;
1911
1908
  }
1912
1909
  else {
1913
1910
  _this.expectedWidth = undefined;
1914
1911
  _this.expectedHeight = undefined;
1915
- _this.imgExpectedByWiziblock = false;
1916
1912
  }
1917
1913
  });
1918
1914
  this.subs.push(subExpectedImgSizesChange);
@@ -1958,11 +1954,6 @@ var CanvaBtnComponent = /** @class */ (function () {
1958
1954
  var subUploadImg = this.imgManager.uploadFileByUrl(exportUrl, designTitle).subscribe(function (img) {
1959
1955
  _this.imgLoading = false;
1960
1956
  _this.removeOverflowBody();
1961
- // Close the img manager and display the img create in the wiziblock
1962
- if (_this.imgExpectedByWiziblock) {
1963
- _this.imgSelectionService.addImgSelected(img);
1964
- return;
1965
- }
1966
1957
  _this.wzImgEventService.emitImgAdded(img.id_file);
1967
1958
  _this.alertService.openAlert(_this.successUploadPhoto);
1968
1959
  }, function (error) {
@@ -1991,7 +1982,6 @@ var CanvaBtnComponent = /** @class */ (function () {
1991
1982
  { type: ImgManagerService },
1992
1983
  { type: ImgEventService },
1993
1984
  { type: TranslateService },
1994
- { type: ImgSelectionService },
1995
1985
  { type: AlertService },
1996
1986
  { type: Renderer2 }
1997
1987
  ]; };
@@ -2012,7 +2002,6 @@ var CanvaBtnComponent = /** @class */ (function () {
2012
2002
  ImgManagerService,
2013
2003
  ImgEventService,
2014
2004
  TranslateService,
2015
- ImgSelectionService,
2016
2005
  AlertService,
2017
2006
  Renderer2])
2018
2007
  ], CanvaBtnComponent);
@@ -2070,7 +2059,7 @@ var ImgSelectionComponent = /** @class */ (function () {
2070
2059
  ImgSelectionComponent = __decorate([
2071
2060
  Component({
2072
2061
  selector: 'img-selection',
2073
- template: "<div\n class=\"trash\"\n [ngClass]=\"{'trash--visible': dragStart}\"\n cdkDropList\n #unSelectList=\"cdkDropList\"\n (cdkDropListDropped)=\"removeImgFromSelection($event)\">\n\n <i class=\"far fa-trash\"></i>\n <p>{{'ImgManager.ImgSelection.unselect' | translate}}</p>\n</div>\n\n<div\n class=\"img-selection\"\n [ngClass]=\"{'img-selection--visible' : imgSelectedList && imgSelectedList.length}\">\n\n <div\n cdkDropList\n #selectionList=\"cdkDropList\"\n cdkDropListOrientation=\"horizontal\"\n class=\"list_img_selection\"\n (cdkDropListDropped)=\"drop($event)\"\n [cdkDropListConnectedTo]=\"[unSelectList]\"\n >\n\n <div\n class=\"img_box\"\n *ngFor=\"let picture of imgSelectedList; let index = index\"\n cdkDrag\n (cdkDragStarted)=\"dragStart = true;\"\n (cdkDragEnded)=\"dragStart = false;\"\n >\n\n <img\n class=\"drag__img\"\n [src]=\"picture.file_name | imgSrc : '100'\"\n [title]=\"picture.display_name\"\n />\n\n </div>\n </div>\n</div>\n\n<!-- Loader -->\n<ng-container *ngIf=\"isLoading && !(imgSelectedList && imgSelectedList.length)\">\n <wz-loader></wz-loader>\n</ng-container>"
2062
+ template: "<div\n class=\"trash\"\n [ngClass]=\"{'trash--visible': dragStart}\"\n cdkDropList\n #unSelectList=\"cdkDropList\"\n (cdkDropListDropped)=\"removeImgFromSelection($event)\">\n\n <i class=\"far fa-trash\"></i>\n <p>{{'ImgManager.ImgSelection.unselect' | translate}}</p>\n</div>\n\n<div\n class=\"img-selection\"\n [ngClass]=\"{'img-selection--visible' : imgSelectedList && imgSelectedList.length}\">\n\n <div\n cdkDropList\n #selectionList=\"cdkDropList\"\n cdkDropListOrientation=\"horizontal\"\n class=\"list_img_selection\"\n (cdkDropListDropped)=\"drop($event)\"\n [cdkDropListConnectedTo]=\"[unSelectList]\"\n >\n\n <div\n class=\"img_box\"\n *ngFor=\"let picture of imgSelectedList; let index = index\"\n cdkDrag\n (cdkDragStarted)=\"dragStart = true;\"\n (cdkDragEnded)=\"dragStart = false;\"\n >\n\n <img\n *ngIf=\"index < 1\"\n class=\"drag__img\"\n [src]=\"picture.file_name | imgSrc : '400'\"\n [title]=\"picture.display_name\"\n />\n\n <img\n *ngIf=\"index > 0\"\n class=\"drag__img\"\n [src]=\"picture.file_name | imgSrc : '200'\"\n [title]=\"picture.display_name\"\n />\n\n </div>\n </div>\n</div>\n\n<!-- Loader -->\n<ng-container *ngIf=\"isLoading && !(imgSelectedList && imgSelectedList.length)\">\n <wz-loader></wz-loader>\n</ng-container>\n"
2074
2063
  }),
2075
2064
  __metadata("design:paramtypes", [ImgSelectionService])
2076
2065
  ], ImgSelectionComponent);
@@ -3055,7 +3044,7 @@ var ImagesViewComponent = /** @class */ (function () {
3055
3044
  ImagesViewComponent = __decorate([
3056
3045
  Component({
3057
3046
  selector: 'images-view',
3058
- 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 class=\"images-view__container__boxAction__confirmSup__text\">{{ (nbImgToDelSelected > 1 ? 'ImgManager.ImgLib.confirmSupQuestion' : 'ImgManager.ImgLib.confirmSupQuestions') | 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 <p class=\"control\">\n <button\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 </button>\n </p>\n\n <p class=\"control\">\n <button 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 </button>\n </p>\n </div>\n </div>\n </div>\n</div>\n\n\n <!-- Images section -->\n<ng-scrollbar\n #scrollable\n [visibility]=\"'native'\"\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 [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</ng-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",
3047
+ 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 <p class=\"control\">\n <button\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 </button>\n </p>\n\n <p class=\"control\">\n <button 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 </button>\n </p>\n </div>\n </div>\n </div>\n</div>\n\n\n <!-- Images section -->\n<ng-scrollbar\n #scrollable\n [visibility]=\"'native'\"\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 [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</ng-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",
3059
3048
  animations: [
3060
3049
  easeInOut,
3061
3050
  insertRemove