@dataclouder/ngx-cloud-storage 0.0.25 → 0.0.27

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.
@@ -11,7 +11,7 @@ import * as i4 from 'primeng/dialog';
11
11
  import { DialogModule } from 'primeng/dialog';
12
12
  import * as i5 from 'primeng/tooltip';
13
13
  import { TooltipModule } from 'primeng/tooltip';
14
- import * as i1$1 from 'primeng/button';
14
+ import * as i2 from 'primeng/button';
15
15
  import { ButtonModule } from 'primeng/button';
16
16
  import * as i6 from 'primeng/message';
17
17
  import { MessageModule } from 'primeng/message';
@@ -19,6 +19,7 @@ import * as i7 from 'primeng/select';
19
19
  import { SelectModule } from 'primeng/select';
20
20
  import * as i8 from 'primeng/inputtext';
21
21
  import { InputTextModule } from 'primeng/inputtext';
22
+ import { MoodStateOptions } from '@dataclouder/ngx-core';
22
23
  import * as i3 from 'primeng/api';
23
24
  import { AsyncPipe, CommonModule } from '@angular/common';
24
25
 
@@ -198,12 +199,12 @@ class MultiImagesStorageService {
198
199
  };
199
200
  return meta;
200
201
  }
201
- async uploadGenericFile(file, storagePath) {
202
+ async uploadGenericFile(file, storagePath, metadata) {
202
203
  try {
203
204
  // Ensure storagePath is a directory path, and append file.name
204
- const fullFilePath = `${storagePath.replace(/\/$/, '')}/${file.name}`;
205
+ const fullFilePath = `${storagePath.replace(/\/$/, '')}/${Date.now()}-${file.name}`;
205
206
  const refStorage = this.storage.ref(fullFilePath);
206
- const task = await refStorage.put(file);
207
+ const task = await refStorage.put(file, { customMetadata: metadata });
207
208
  const url = await lastValueFrom(refStorage.getDownloadURL());
208
209
  const fileData = {
209
210
  url,
@@ -314,6 +315,7 @@ class CropperComponentModal {
314
315
  this.onImageCropped = output();
315
316
  this.onFileSelected = output();
316
317
  this.aspectRatioOptions = AspectRatioOptions;
318
+ this.MoodStateOptions = MoodStateOptions;
317
319
  this.fileMetadata = null;
318
320
  this.displayDialog = false;
319
321
  this.aspectRatioValue = 1;
@@ -322,6 +324,7 @@ class CropperComponentModal {
322
324
  this.storagePath = '';
323
325
  this.resizeToWidth = 450;
324
326
  this.ratioSelected = null;
327
+ this.emotionSelected = null;
325
328
  // Generate random ID for file input
326
329
  this.fileInputId = `file-upload-${Math.random().toString(36).substring(2, 11)}`;
327
330
  }
@@ -405,7 +408,7 @@ class CropperComponentModal {
405
408
  this.multiImagesStorageService.deleteImage(path);
406
409
  }
407
410
  console.log('imgStorage', imgStorage);
408
- this.imageUploaded.emit(imgStorage);
411
+ this.imageUploaded.emit({ ...imgStorage, metadata: this.emotionSelected });
409
412
  this.displayDialog = false;
410
413
  this.changeDetectorRef.detectChanges();
411
414
  }
@@ -415,12 +418,17 @@ class CropperComponentModal {
415
418
  this.aspectRatioValue = event.valueRatio;
416
419
  this.changeDetectorRef.detectChanges();
417
420
  }
421
+ addEmotion(event) {
422
+ // Will only log for now
423
+ console.log('addEmotion', event);
424
+ this.emotionSelected = event;
425
+ }
418
426
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: CropperComponentModal, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
419
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.4", type: CropperComponentModal, isStandalone: true, selector: "dc-cropper-modal", inputs: { imgStorageSettings: { classPropertyName: "imgStorageSettings", publicName: "imgStorageSettings", isSignal: true, isRequired: false, transformFunction: null }, buttonLabel: { classPropertyName: "buttonLabel", publicName: "buttonLabel", isSignal: true, isRequired: false, transformFunction: null }, currentStorage: { classPropertyName: "currentStorage", publicName: "currentStorage", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { imageUploaded: "imageUploaded", onImageCropped: "onImageCropped", onFileSelected: "onFileSelected" }, viewQueries: [{ propertyName: "imageCropper", first: true, predicate: ImageCropperComponent, descendants: true }], ngImport: i0, template: "<div class=\"upload-section\">\n <input type=\"file\" [id]=\"fileInputId\" class=\"file-input\" (change)=\"fileChangeEvent($event)\" />\n <label pButton [for]=\"fileInputId\" [pTooltip]=\"storagePath\" class=\"upload-button\">\n {{ buttonLabel() }}\n </label>\n</div>\n@if(displayDialog) {\n<!-- Cropper Dialog -->\n\n<p-dialog header=\"Recortar imagen\" [(visible)]=\"displayDialog\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\" styleClass=\"cropper-dialog\">\n <!-- Image Settings Section -->\n <div class=\"settings-section\">\n @if(!imgStorageSettings().path) {\n <p-message severity=\"warn\">Developer Note: make sure you have a path to save the image pass object imgStorageSettings</p-message>\n } @if(currentStorage?.url) {\n\n <p-message severity=\"warn\" variant=\"outlined\">\n <div>\n <span class=\"setting-label\">Image will be replaced:</span>\n <img width=\"100\" height=\"Auto\" [src]=\"currentStorage?.url\" />\n </div>\n </p-message>\n\n }\n\n <p-message>\n <b>Estas opciones estan preconfiguradas y no se pueden cambiar</b>\n\n <ul>\n <li> <b>Path to save:</b> {{ storagePath }}< </li>\n <li>\n <b>Resoluciones:</b>\n <span>{{ imgStorageSettings()?.cropSettings?.resolutions }}</span>\n </li>\n </ul>\n </p-message>\n\n <div class=\"setting-item\">\n <span class=\"setting-label\">Aspecto:</span>\n <p class=\"setting-value\">{{ imgStorageSettings()?.cropSettings?.aspectRatio }}</p>\n </div>\n\n <p-select\n [options]=\"aspectRatioOptions\"\n [ngModel]=\"ratioSelected\"\n (ngModelChange)=\"changeRatio($event)\"\n optionLabel=\"description\"\n placeholder=\"Select a ratio\" />\n\n <!-- File Metadata Section -->\n @if (fileMetadata) {\n <div class=\"metadata-section\">\n <span class=\"metadata-item\">tipo: {{ fileMetadata.type }}</span>\n <span class=\"metadata-item\">tama\u00F1o: {{ fileMetadata.size }}</span>\n </div>\n }\n\n <!-- Rename Input -->\n <input\n pInputText\n [disabled]=\"imgStorageSettings()?.fileName\"\n [(ngModel)]=\"renameFile\"\n type=\"text\"\n placeholder=\"Rename File\"\n (ngModelChange)=\"reloadPath()\"\n class=\"rename-input\" />\n </div>\n\n <!-- Image Cropper -->\n\n <div class=\"cropper-container-father\">\n <image-cropper\n [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [aspectRatio]=\"aspectRatioValue\"\n format=\"webp\"\n [resizeToWidth]=\"resizeToWidth\"\n (imageCropped)=\"onInnerImageCropped($event)\"\n (loadImageFailed)=\"loadImageFailed()\"\n (cropperReady)=\"cropperReady()\"\n [autoCrop]=\"false\">\n </image-cropper>\n </div>\n <!-- Dialog Footer -->\n <ng-template pTemplate=\"footer\">\n <div class=\"dialog-footer\">\n <button pButton class=\"p-button-primary\" (click)=\"simpleCropAndUpload()\"> Recortar y Subir </button>\n </div>\n </ng-template>\n</p-dialog>\n}\n", styles: [":host{display:block}:host ::ng-deep .ngx-ic-overlay{width:100%!important}.upload-section{margin-bottom:1rem}.upload-section .file-input{display:none}.upload-section .upload-button{cursor:pointer}::ng-deep .cropper-dialog{max-width:90vw;width:800px}::ng-deep .cropper-dialog .p-dialog-content{padding:1.5rem}.settings-section{margin-bottom:1.5rem}.settings-section .settings-header{color:var(--text-color-secondary);margin-bottom:1rem}.settings-section .settings-grid{display:grid;gap:1rem;margin-bottom:1.5rem}.settings-section .settings-grid .setting-item .setting-label{font-weight:600;color:var(--text-color);display:block;margin-bottom:.5rem}.settings-section .settings-grid .setting-item .setting-value{color:var(--text-color-secondary);margin:0}.metadata-section{display:flex;gap:1.5rem;margin-bottom:1rem}.metadata-section .metadata-item{color:var(--text-color-secondary)}.rename-section{margin-bottom:5px}.rename-section .rename-input{width:100%;padding:.5rem;border:1px solid var(--surface-border);border-radius:4px}.rename-section .rename-input:disabled{background-color:var(--surface-200);cursor:not-allowed}.cropper-container-father{display:flex;justify-content:center;align-items:center;height:65vh}.dialog-footer{display:flex;justify-content:flex-end;gap:1rem}.btn-crop{cursor:pointer;outline:0;display:inline-block;font-weight:400;line-height:1.5;text-align:center;background-color:transparent;border:1px solid transparent;padding:6px 12px;font-size:1rem;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;color:#0d6efd;border-color:#0d6efd}.btn-crop :hover{color:#fff;background-color:#0d6efd;border-color:#0d6efd}.file-input{display:none}.btn-upload{cursor:pointer;outline:0;display:inline-block;font-weight:400;line-height:1.5;text-align:center;background-color:transparent;border:1px solid #0d6efd;padding:6px 12px;font-size:1rem;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;color:#0d6efd}.btn-upload:hover{color:#fff;background-color:#0d6efd}.modal{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:1000}.modal.show-modal{display:flex;align-items:center;justify-content:center}.modal .modal-content{background-color:#fff;border-radius:8px;width:90%;max-width:800px;max-height:90vh;overflow-y:auto;position:relative}.modal .modal-header{padding:1rem;border-bottom:1px solid #dee2e6;display:flex;justify-content:space-between;align-items:center}.modal .modal-header h3{margin:0}.modal .modal-header .close-button{background:none;border:none;font-size:1.5rem;cursor:pointer;padding:0;color:#6c757d}.modal .modal-header .close-button:hover{color:#343a40}.modal .modal-body{padding:1rem;height:100vh;display:flex;flex-direction:column}.modal .modal-footer{padding:1rem;border-top:1px solid #dee2e6;display:flex;justify-content:flex-end}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ImageCropperComponent, selector: "image-cropper", inputs: ["imageChangedEvent", "imageURL", "imageBase64", "imageFile", "imageAltText", "options", "cropperFrameAriaLabel", "output", "format", "autoCrop", "cropper", "transform", "maintainAspectRatio", "aspectRatio", "resetCropOnAspectRatioChange", "resizeToWidth", "resizeToHeight", "cropperMinWidth", "cropperMinHeight", "cropperMaxHeight", "cropperMaxWidth", "cropperStaticWidth", "cropperStaticHeight", "canvasRotation", "initialStepSize", "roundCropper", "onlyScaleDown", "imageQuality", "backgroundColor", "containWithinAspectRatio", "hideResizeSquares", "allowMoveImage", "checkImageType", "alignImage", "disabled", "hidden"], outputs: ["imageCropped", "startCropImage", "imageLoaded", "cropperReady", "loadImageFailed", "transformChange", "cropperChange"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i1$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i4.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i5.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: MessageModule }, { kind: "component", type: i6.Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant"], outputs: ["onClose"] }, { kind: "ngmodule", type: SelectModule }, { kind: "component", type: i7.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "size", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "fluid", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i8.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }] }); }
427
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.4", type: CropperComponentModal, isStandalone: true, selector: "dc-cropper-modal", inputs: { imgStorageSettings: { classPropertyName: "imgStorageSettings", publicName: "imgStorageSettings", isSignal: true, isRequired: false, transformFunction: null }, buttonLabel: { classPropertyName: "buttonLabel", publicName: "buttonLabel", isSignal: true, isRequired: false, transformFunction: null }, currentStorage: { classPropertyName: "currentStorage", publicName: "currentStorage", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { imageUploaded: "imageUploaded", onImageCropped: "onImageCropped", onFileSelected: "onFileSelected" }, viewQueries: [{ propertyName: "imageCropper", first: true, predicate: ImageCropperComponent, descendants: true }], ngImport: i0, template: "<div class=\"upload-section\">\n <input type=\"file\" [id]=\"fileInputId\" class=\"file-input\" (change)=\"fileChangeEvent($event)\" />\n <label pButton [for]=\"fileInputId\" [pTooltip]=\"storagePath\" class=\"upload-button\">\n {{ buttonLabel() }}\n </label>\n</div>\n@if(displayDialog) {\n<!-- Cropper Dialog -->\n\n<p-dialog header=\"Recortar imagen\" [(visible)]=\"displayDialog\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\" styleClass=\"cropper-dialog\">\n <!-- Image Settings Section -->\n <div class=\"settings-section\">\n @if(!imgStorageSettings().path) {\n <p-message severity=\"warn\">Developer Note: make sure you have a path to save the image pass object imgStorageSettings</p-message>\n } @if(currentStorage?.url) {\n\n <p-message severity=\"warn\" variant=\"outlined\">\n <div>\n <span class=\"setting-label\">Image will be replaced:</span>\n <img width=\"100\" height=\"Auto\" [src]=\"currentStorage?.url\" />\n </div>\n </p-message>\n\n }\n\n <p-message>\n <b>Estas opciones estan preconfiguradas y no se pueden cambiar</b>\n\n <ul>\n <li> <b>Path to save:</b> {{ storagePath }}< </li>\n <li>\n <b>Resoluciones:</b>\n <span>{{ imgStorageSettings()?.cropSettings?.resolutions }}</span>\n </li>\n </ul>\n </p-message>\n\n <div class=\"setting-item\">\n <span class=\"setting-label\">Aspecto:</span>\n <p class=\"setting-value\">{{ imgStorageSettings()?.cropSettings?.aspectRatio }}</p>\n </div>\n\n <p-select\n [options]=\"aspectRatioOptions\"\n [ngModel]=\"ratioSelected\"\n (ngModelChange)=\"changeRatio($event)\"\n optionLabel=\"description\"\n placeholder=\"Select a ratio\" />\n\n <!-- File Metadata Section -->\n @if (fileMetadata) {\n <div class=\"metadata-section\">\n <span class=\"metadata-item\">tipo: {{ fileMetadata.type }}</span>\n <span class=\"metadata-item\">tama\u00F1o: {{ fileMetadata.size }}</span>\n </div>\n }\n\n <!-- Rename Input -->\n <input\n pInputText\n [disabled]=\"imgStorageSettings()?.fileName\"\n [(ngModel)]=\"renameFile\"\n type=\"text\"\n placeholder=\"Rename File\"\n (ngModelChange)=\"reloadPath()\"\n class=\"rename-input\" />\n\n <h5>Datos adicionales</h5>\n\n <p-select\n [options]=\"MoodStateOptions\"\n [(ngModel)]=\"emotionSelected\"\n (ngModelChange)=\"addEmotion($event)\"\n optionLabel=\"label\"\n optionValue=\"value\"\n placeholder=\"Select an emotion\" />\n </div>\n\n <!-- Image Cropper -->\n\n <div class=\"cropper-container-father\">\n <image-cropper\n [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [aspectRatio]=\"aspectRatioValue\"\n format=\"webp\"\n [resizeToWidth]=\"resizeToWidth\"\n (imageCropped)=\"onInnerImageCropped($event)\"\n (loadImageFailed)=\"loadImageFailed()\"\n (cropperReady)=\"cropperReady()\"\n [autoCrop]=\"false\">\n </image-cropper>\n </div>\n <!-- Dialog Footer -->\n <ng-template pTemplate=\"footer\">\n <div class=\"dialog-footer\">\n <button pButton class=\"p-button-primary\" (click)=\"simpleCropAndUpload()\"> Recortar y Subir </button>\n </div>\n </ng-template>\n</p-dialog>\n}\n", styles: [":host{display:block}:host ::ng-deep .ngx-ic-overlay{width:100%!important}.upload-section{margin-bottom:1rem}.upload-section .file-input{display:none}.upload-section .upload-button{cursor:pointer}::ng-deep .cropper-dialog{max-width:90vw;width:800px}::ng-deep .cropper-dialog .p-dialog-content{padding:1.5rem}.settings-section{margin-bottom:1.5rem}.settings-section .settings-header{color:var(--text-color-secondary);margin-bottom:1rem}.settings-section .settings-grid{display:grid;gap:1rem;margin-bottom:1.5rem}.settings-section .settings-grid .setting-item .setting-label{font-weight:600;color:var(--text-color);display:block;margin-bottom:.5rem}.settings-section .settings-grid .setting-item .setting-value{color:var(--text-color-secondary);margin:0}.metadata-section{display:flex;gap:1.5rem;margin-bottom:1rem}.metadata-section .metadata-item{color:var(--text-color-secondary)}.rename-section{margin-bottom:5px}.rename-section .rename-input{width:100%;padding:.5rem;border:1px solid var(--surface-border);border-radius:4px}.rename-section .rename-input:disabled{background-color:var(--surface-200);cursor:not-allowed}.cropper-container-father{display:flex;justify-content:center;align-items:center;height:65vh}.dialog-footer{display:flex;justify-content:flex-end;gap:1rem}.btn-crop{cursor:pointer;outline:0;display:inline-block;font-weight:400;line-height:1.5;text-align:center;background-color:transparent;border:1px solid transparent;padding:6px 12px;font-size:1rem;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;color:#0d6efd;border-color:#0d6efd}.btn-crop :hover{color:#fff;background-color:#0d6efd;border-color:#0d6efd}.file-input{display:none}.btn-upload{cursor:pointer;outline:0;display:inline-block;font-weight:400;line-height:1.5;text-align:center;background-color:transparent;border:1px solid #0d6efd;padding:6px 12px;font-size:1rem;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;color:#0d6efd}.btn-upload:hover{color:#fff;background-color:#0d6efd}.modal{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:1000}.modal.show-modal{display:flex;align-items:center;justify-content:center}.modal .modal-content{background-color:#fff;border-radius:8px;width:90%;max-width:800px;max-height:90vh;overflow-y:auto;position:relative}.modal .modal-header{padding:1rem;border-bottom:1px solid #dee2e6;display:flex;justify-content:space-between;align-items:center}.modal .modal-header h3{margin:0}.modal .modal-header .close-button{background:none;border:none;font-size:1.5rem;cursor:pointer;padding:0;color:#6c757d}.modal .modal-header .close-button:hover{color:#343a40}.modal .modal-body{padding:1rem;height:100vh;display:flex;flex-direction:column}.modal .modal-footer{padding:1rem;border-top:1px solid #dee2e6;display:flex;justify-content:flex-end}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ImageCropperComponent, selector: "image-cropper", inputs: ["imageChangedEvent", "imageURL", "imageBase64", "imageFile", "imageAltText", "options", "cropperFrameAriaLabel", "output", "format", "autoCrop", "cropper", "transform", "maintainAspectRatio", "aspectRatio", "resetCropOnAspectRatioChange", "resizeToWidth", "resizeToHeight", "cropperMinWidth", "cropperMinHeight", "cropperMaxHeight", "cropperMaxWidth", "cropperStaticWidth", "cropperStaticHeight", "canvasRotation", "initialStepSize", "roundCropper", "onlyScaleDown", "imageQuality", "backgroundColor", "containWithinAspectRatio", "hideResizeSquares", "allowMoveImage", "checkImageType", "alignImage", "disabled", "hidden"], outputs: ["imageCropped", "startCropImage", "imageLoaded", "cropperReady", "loadImageFailed", "transformChange", "cropperChange"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i2.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i4.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i5.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: MessageModule }, { kind: "component", type: i6.Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant"], outputs: ["onClose"] }, { kind: "ngmodule", type: SelectModule }, { kind: "component", type: i7.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "size", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "fluid", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i8.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }] }); }
420
428
  }
421
429
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: CropperComponentModal, decorators: [{
422
430
  type: Component,
423
- args: [{ selector: 'dc-cropper-modal', standalone: true, imports: [FormsModule, ImageCropperComponent, ButtonModule, DialogModule, TooltipModule, MessageModule, SelectModule, InputTextModule], template: "<div class=\"upload-section\">\n <input type=\"file\" [id]=\"fileInputId\" class=\"file-input\" (change)=\"fileChangeEvent($event)\" />\n <label pButton [for]=\"fileInputId\" [pTooltip]=\"storagePath\" class=\"upload-button\">\n {{ buttonLabel() }}\n </label>\n</div>\n@if(displayDialog) {\n<!-- Cropper Dialog -->\n\n<p-dialog header=\"Recortar imagen\" [(visible)]=\"displayDialog\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\" styleClass=\"cropper-dialog\">\n <!-- Image Settings Section -->\n <div class=\"settings-section\">\n @if(!imgStorageSettings().path) {\n <p-message severity=\"warn\">Developer Note: make sure you have a path to save the image pass object imgStorageSettings</p-message>\n } @if(currentStorage?.url) {\n\n <p-message severity=\"warn\" variant=\"outlined\">\n <div>\n <span class=\"setting-label\">Image will be replaced:</span>\n <img width=\"100\" height=\"Auto\" [src]=\"currentStorage?.url\" />\n </div>\n </p-message>\n\n }\n\n <p-message>\n <b>Estas opciones estan preconfiguradas y no se pueden cambiar</b>\n\n <ul>\n <li> <b>Path to save:</b> {{ storagePath }}< </li>\n <li>\n <b>Resoluciones:</b>\n <span>{{ imgStorageSettings()?.cropSettings?.resolutions }}</span>\n </li>\n </ul>\n </p-message>\n\n <div class=\"setting-item\">\n <span class=\"setting-label\">Aspecto:</span>\n <p class=\"setting-value\">{{ imgStorageSettings()?.cropSettings?.aspectRatio }}</p>\n </div>\n\n <p-select\n [options]=\"aspectRatioOptions\"\n [ngModel]=\"ratioSelected\"\n (ngModelChange)=\"changeRatio($event)\"\n optionLabel=\"description\"\n placeholder=\"Select a ratio\" />\n\n <!-- File Metadata Section -->\n @if (fileMetadata) {\n <div class=\"metadata-section\">\n <span class=\"metadata-item\">tipo: {{ fileMetadata.type }}</span>\n <span class=\"metadata-item\">tama\u00F1o: {{ fileMetadata.size }}</span>\n </div>\n }\n\n <!-- Rename Input -->\n <input\n pInputText\n [disabled]=\"imgStorageSettings()?.fileName\"\n [(ngModel)]=\"renameFile\"\n type=\"text\"\n placeholder=\"Rename File\"\n (ngModelChange)=\"reloadPath()\"\n class=\"rename-input\" />\n </div>\n\n <!-- Image Cropper -->\n\n <div class=\"cropper-container-father\">\n <image-cropper\n [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [aspectRatio]=\"aspectRatioValue\"\n format=\"webp\"\n [resizeToWidth]=\"resizeToWidth\"\n (imageCropped)=\"onInnerImageCropped($event)\"\n (loadImageFailed)=\"loadImageFailed()\"\n (cropperReady)=\"cropperReady()\"\n [autoCrop]=\"false\">\n </image-cropper>\n </div>\n <!-- Dialog Footer -->\n <ng-template pTemplate=\"footer\">\n <div class=\"dialog-footer\">\n <button pButton class=\"p-button-primary\" (click)=\"simpleCropAndUpload()\"> Recortar y Subir </button>\n </div>\n </ng-template>\n</p-dialog>\n}\n", styles: [":host{display:block}:host ::ng-deep .ngx-ic-overlay{width:100%!important}.upload-section{margin-bottom:1rem}.upload-section .file-input{display:none}.upload-section .upload-button{cursor:pointer}::ng-deep .cropper-dialog{max-width:90vw;width:800px}::ng-deep .cropper-dialog .p-dialog-content{padding:1.5rem}.settings-section{margin-bottom:1.5rem}.settings-section .settings-header{color:var(--text-color-secondary);margin-bottom:1rem}.settings-section .settings-grid{display:grid;gap:1rem;margin-bottom:1.5rem}.settings-section .settings-grid .setting-item .setting-label{font-weight:600;color:var(--text-color);display:block;margin-bottom:.5rem}.settings-section .settings-grid .setting-item .setting-value{color:var(--text-color-secondary);margin:0}.metadata-section{display:flex;gap:1.5rem;margin-bottom:1rem}.metadata-section .metadata-item{color:var(--text-color-secondary)}.rename-section{margin-bottom:5px}.rename-section .rename-input{width:100%;padding:.5rem;border:1px solid var(--surface-border);border-radius:4px}.rename-section .rename-input:disabled{background-color:var(--surface-200);cursor:not-allowed}.cropper-container-father{display:flex;justify-content:center;align-items:center;height:65vh}.dialog-footer{display:flex;justify-content:flex-end;gap:1rem}.btn-crop{cursor:pointer;outline:0;display:inline-block;font-weight:400;line-height:1.5;text-align:center;background-color:transparent;border:1px solid transparent;padding:6px 12px;font-size:1rem;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;color:#0d6efd;border-color:#0d6efd}.btn-crop :hover{color:#fff;background-color:#0d6efd;border-color:#0d6efd}.file-input{display:none}.btn-upload{cursor:pointer;outline:0;display:inline-block;font-weight:400;line-height:1.5;text-align:center;background-color:transparent;border:1px solid #0d6efd;padding:6px 12px;font-size:1rem;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;color:#0d6efd}.btn-upload:hover{color:#fff;background-color:#0d6efd}.modal{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:1000}.modal.show-modal{display:flex;align-items:center;justify-content:center}.modal .modal-content{background-color:#fff;border-radius:8px;width:90%;max-width:800px;max-height:90vh;overflow-y:auto;position:relative}.modal .modal-header{padding:1rem;border-bottom:1px solid #dee2e6;display:flex;justify-content:space-between;align-items:center}.modal .modal-header h3{margin:0}.modal .modal-header .close-button{background:none;border:none;font-size:1.5rem;cursor:pointer;padding:0;color:#6c757d}.modal .modal-header .close-button:hover{color:#343a40}.modal .modal-body{padding:1rem;height:100vh;display:flex;flex-direction:column}.modal .modal-footer{padding:1rem;border-top:1px solid #dee2e6;display:flex;justify-content:flex-end}\n"] }]
431
+ args: [{ selector: 'dc-cropper-modal', standalone: true, imports: [FormsModule, ImageCropperComponent, ButtonModule, DialogModule, TooltipModule, MessageModule, SelectModule, InputTextModule], template: "<div class=\"upload-section\">\n <input type=\"file\" [id]=\"fileInputId\" class=\"file-input\" (change)=\"fileChangeEvent($event)\" />\n <label pButton [for]=\"fileInputId\" [pTooltip]=\"storagePath\" class=\"upload-button\">\n {{ buttonLabel() }}\n </label>\n</div>\n@if(displayDialog) {\n<!-- Cropper Dialog -->\n\n<p-dialog header=\"Recortar imagen\" [(visible)]=\"displayDialog\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\" styleClass=\"cropper-dialog\">\n <!-- Image Settings Section -->\n <div class=\"settings-section\">\n @if(!imgStorageSettings().path) {\n <p-message severity=\"warn\">Developer Note: make sure you have a path to save the image pass object imgStorageSettings</p-message>\n } @if(currentStorage?.url) {\n\n <p-message severity=\"warn\" variant=\"outlined\">\n <div>\n <span class=\"setting-label\">Image will be replaced:</span>\n <img width=\"100\" height=\"Auto\" [src]=\"currentStorage?.url\" />\n </div>\n </p-message>\n\n }\n\n <p-message>\n <b>Estas opciones estan preconfiguradas y no se pueden cambiar</b>\n\n <ul>\n <li> <b>Path to save:</b> {{ storagePath }}< </li>\n <li>\n <b>Resoluciones:</b>\n <span>{{ imgStorageSettings()?.cropSettings?.resolutions }}</span>\n </li>\n </ul>\n </p-message>\n\n <div class=\"setting-item\">\n <span class=\"setting-label\">Aspecto:</span>\n <p class=\"setting-value\">{{ imgStorageSettings()?.cropSettings?.aspectRatio }}</p>\n </div>\n\n <p-select\n [options]=\"aspectRatioOptions\"\n [ngModel]=\"ratioSelected\"\n (ngModelChange)=\"changeRatio($event)\"\n optionLabel=\"description\"\n placeholder=\"Select a ratio\" />\n\n <!-- File Metadata Section -->\n @if (fileMetadata) {\n <div class=\"metadata-section\">\n <span class=\"metadata-item\">tipo: {{ fileMetadata.type }}</span>\n <span class=\"metadata-item\">tama\u00F1o: {{ fileMetadata.size }}</span>\n </div>\n }\n\n <!-- Rename Input -->\n <input\n pInputText\n [disabled]=\"imgStorageSettings()?.fileName\"\n [(ngModel)]=\"renameFile\"\n type=\"text\"\n placeholder=\"Rename File\"\n (ngModelChange)=\"reloadPath()\"\n class=\"rename-input\" />\n\n <h5>Datos adicionales</h5>\n\n <p-select\n [options]=\"MoodStateOptions\"\n [(ngModel)]=\"emotionSelected\"\n (ngModelChange)=\"addEmotion($event)\"\n optionLabel=\"label\"\n optionValue=\"value\"\n placeholder=\"Select an emotion\" />\n </div>\n\n <!-- Image Cropper -->\n\n <div class=\"cropper-container-father\">\n <image-cropper\n [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [aspectRatio]=\"aspectRatioValue\"\n format=\"webp\"\n [resizeToWidth]=\"resizeToWidth\"\n (imageCropped)=\"onInnerImageCropped($event)\"\n (loadImageFailed)=\"loadImageFailed()\"\n (cropperReady)=\"cropperReady()\"\n [autoCrop]=\"false\">\n </image-cropper>\n </div>\n <!-- Dialog Footer -->\n <ng-template pTemplate=\"footer\">\n <div class=\"dialog-footer\">\n <button pButton class=\"p-button-primary\" (click)=\"simpleCropAndUpload()\"> Recortar y Subir </button>\n </div>\n </ng-template>\n</p-dialog>\n}\n", styles: [":host{display:block}:host ::ng-deep .ngx-ic-overlay{width:100%!important}.upload-section{margin-bottom:1rem}.upload-section .file-input{display:none}.upload-section .upload-button{cursor:pointer}::ng-deep .cropper-dialog{max-width:90vw;width:800px}::ng-deep .cropper-dialog .p-dialog-content{padding:1.5rem}.settings-section{margin-bottom:1.5rem}.settings-section .settings-header{color:var(--text-color-secondary);margin-bottom:1rem}.settings-section .settings-grid{display:grid;gap:1rem;margin-bottom:1.5rem}.settings-section .settings-grid .setting-item .setting-label{font-weight:600;color:var(--text-color);display:block;margin-bottom:.5rem}.settings-section .settings-grid .setting-item .setting-value{color:var(--text-color-secondary);margin:0}.metadata-section{display:flex;gap:1.5rem;margin-bottom:1rem}.metadata-section .metadata-item{color:var(--text-color-secondary)}.rename-section{margin-bottom:5px}.rename-section .rename-input{width:100%;padding:.5rem;border:1px solid var(--surface-border);border-radius:4px}.rename-section .rename-input:disabled{background-color:var(--surface-200);cursor:not-allowed}.cropper-container-father{display:flex;justify-content:center;align-items:center;height:65vh}.dialog-footer{display:flex;justify-content:flex-end;gap:1rem}.btn-crop{cursor:pointer;outline:0;display:inline-block;font-weight:400;line-height:1.5;text-align:center;background-color:transparent;border:1px solid transparent;padding:6px 12px;font-size:1rem;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;color:#0d6efd;border-color:#0d6efd}.btn-crop :hover{color:#fff;background-color:#0d6efd;border-color:#0d6efd}.file-input{display:none}.btn-upload{cursor:pointer;outline:0;display:inline-block;font-weight:400;line-height:1.5;text-align:center;background-color:transparent;border:1px solid #0d6efd;padding:6px 12px;font-size:1rem;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;color:#0d6efd}.btn-upload:hover{color:#fff;background-color:#0d6efd}.modal{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:1000}.modal.show-modal{display:flex;align-items:center;justify-content:center}.modal .modal-content{background-color:#fff;border-radius:8px;width:90%;max-width:800px;max-height:90vh;overflow-y:auto;position:relative}.modal .modal-header{padding:1rem;border-bottom:1px solid #dee2e6;display:flex;justify-content:space-between;align-items:center}.modal .modal-header h3{margin:0}.modal .modal-header .close-button{background:none;border:none;font-size:1.5rem;cursor:pointer;padding:0;color:#6c757d}.modal .modal-header .close-button:hover{color:#343a40}.modal .modal-body{padding:1rem;height:100vh;display:flex;flex-direction:column}.modal .modal-footer{padding:1rem;border-top:1px solid #dee2e6;display:flex;justify-content:flex-end}\n"] }]
424
432
  }], ctorParameters: () => [], propDecorators: { currentStorage: [{
425
433
  type: Input
426
434
  }], imageCropper: [{
@@ -516,26 +524,49 @@ class SimpleUploaderComponent {
516
524
  this.buttonLabel = input('Upload File');
517
525
  this.accept = input('*/*');
518
526
  this.disabled = input(false);
527
+ this.metadata = input({});
519
528
  this.fileUploaded = output();
520
529
  this.uploadError = output();
521
530
  this.isLoading = signal(false);
531
+ this.displayDialog = signal(false);
532
+ this.fileSelected = signal(null);
533
+ this.moodSelected = signal(null);
534
+ this.metadataInput = {};
535
+ this.MoodStateOptions = MoodStateOptions;
522
536
  this.fileInputId = `file-upload-${Math.random().toString(36).substring(2, 11)}`;
523
537
  }
538
+ objectKeys(obj) {
539
+ return Object.keys(obj);
540
+ }
541
+ openDialog() {
542
+ this.metadataInput = { ...this.metadata() };
543
+ this.displayDialog.set(true);
544
+ }
524
545
  triggerFileInputClick(fileInput) {
525
546
  fileInput.click();
526
547
  }
527
- async onFileSelected(event) {
548
+ onFileSelected(event) {
528
549
  const fileInput = event.target;
529
550
  const file = fileInput.files?.[0];
551
+ if (file) {
552
+ this.fileSelected.set(file);
553
+ }
554
+ }
555
+ async uploadFile() {
556
+ const file = this.fileSelected();
530
557
  if (file) {
531
558
  this.isLoading.set(true);
559
+ const metadata = {
560
+ // ...this.metadataInput,
561
+ moodState: this.moodSelected(),
562
+ };
532
563
  try {
533
- const result = await this.multiImagesStorageService.uploadGenericFile(file, this.storagePath());
564
+ const result = await this.multiImagesStorageService.uploadGenericFile(file, this.storagePath(), metadata);
565
+ result.metadata = metadata;
534
566
  if (result) {
535
567
  this.fileUploaded.emit(result);
536
568
  }
537
569
  else {
538
- // This case might occur if the service's uploadGenericFile returns null without throwing an error
539
570
  this.uploadError.emit({ error: 'Upload failed and no specific error was provided by the service.' });
540
571
  }
541
572
  }
@@ -545,17 +576,18 @@ class SimpleUploaderComponent {
545
576
  }
546
577
  finally {
547
578
  this.isLoading.set(false);
548
- // Reset file input to allow uploading the same file again if needed
549
- fileInput.value = '';
579
+ this.displayDialog.set(false);
580
+ this.fileSelected.set(null);
581
+ this.moodSelected.set(null);
550
582
  }
551
583
  }
552
584
  }
553
585
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: SimpleUploaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
554
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.4", type: SimpleUploaderComponent, isStandalone: true, selector: "dc-simple-uploader", inputs: { storagePath: { classPropertyName: "storagePath", publicName: "storagePath", isSignal: true, isRequired: true, transformFunction: null }, buttonLabel: { classPropertyName: "buttonLabel", publicName: "buttonLabel", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fileUploaded: "fileUploaded", uploadError: "uploadError" }, ngImport: i0, template: "<input #fileInput type=\"file\" [id]=\"fileInputId\" (change)=\"onFileSelected($event)\" [accept]=\"accept()\" style=\"display: none\" />\n<p-button\n size=\"large\"\n [label]=\"buttonLabel()\"\n (click)=\"triggerFileInputClick(fileInput)\"\n [loading]=\"isLoading()\"\n [disabled]=\"disabled() || isLoading()\"\n pTooltip=\"Un v\u00EDdeo que muestre la imagen principal animada\"></p-button>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i1$1.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i5.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }] }); }
586
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.4", type: SimpleUploaderComponent, isStandalone: true, selector: "dc-simple-uploader", inputs: { storagePath: { classPropertyName: "storagePath", publicName: "storagePath", isSignal: true, isRequired: true, transformFunction: null }, buttonLabel: { classPropertyName: "buttonLabel", publicName: "buttonLabel", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, metadata: { classPropertyName: "metadata", publicName: "metadata", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fileUploaded: "fileUploaded", uploadError: "uploadError" }, ngImport: i0, template: "<p-button\n size=\"large\"\n [label]=\"buttonLabel()\"\n (click)=\"openDialog()\"\n [loading]=\"isLoading()\"\n [disabled]=\"disabled() || isLoading()\"\n pTooltip=\"Upload a file with metadata\"></p-button>\n\n@if(displayDialog()){\n<p-dialog\n header=\"Upload File\"\n [(visible)]=\"displayDialog\"\n [modal]=\"true\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n [contentStyle]=\"{ width: '50vw', height: '50vh' }\">\n <div class=\"upload-dialog\">\n @if(!fileSelected()){\n <div class=\"file-input-container\">\n <input #fileInput type=\"file\" [id]=\"fileInputId\" (change)=\"onFileSelected($event)\" [accept]=\"accept()\" style=\"display: none\" />\n <p-button label=\"Select File\" (click)=\"triggerFileInputClick(fileInput)\"></p-button>\n </div>\n } @else {\n <div class=\"file-details\">\n <p>File: {{ fileSelected()?.name }}</p>\n <p>Size: {{ fileSelected()?.size }} bytes</p>\n </div>\n\n <div class=\"metadata-container\">\n <h5>Metadata</h5>\n <div class=\"p-fluid\">\n @for (key of objectKeys(metadata()); track key) {\n <div class=\"p-field\">\n <label [for]=\"key\">{{ key }}</label>\n <input pInputText [id]=\"key\" [(ngModel)]=\"metadataInput[key]\" />\n </div>\n }\n\n <div class=\"p-field\">\n <label for=\"emotion\">Emotion</label>\n <p-select [options]=\"MoodStateOptions\" [(ngModel)]=\"moodSelected\" optionLabel=\"label\" optionValue=\"value\" placeholder=\"Select an emotion\"></p-select>\n </div>\n </div>\n </div>\n }\n </div>\n\n <ng-template pTemplate=\"footer\">\n <div class=\"dialog-footer\">\n <p-button label=\"Cancel\" styleClass=\"p-button-secondary\" (click)=\"displayDialog.set(false)\"></p-button>\n <p-button label=\"Upload\" (click)=\"uploadFile()\" [disabled]=\"!fileSelected() || isLoading()\"></p-button>\n </div>\n </ng-template>\n</p-dialog>\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i5.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i4.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i8.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "ngmodule", type: SelectModule }, { kind: "component", type: i7.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "size", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "fluid", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }] }); }
555
587
  }
556
588
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: SimpleUploaderComponent, decorators: [{
557
589
  type: Component,
558
- args: [{ selector: 'dc-simple-uploader', standalone: true, imports: [CommonModule, FormsModule, ButtonModule, TooltipModule], template: "<input #fileInput type=\"file\" [id]=\"fileInputId\" (change)=\"onFileSelected($event)\" [accept]=\"accept()\" style=\"display: none\" />\n<p-button\n size=\"large\"\n [label]=\"buttonLabel()\"\n (click)=\"triggerFileInputClick(fileInput)\"\n [loading]=\"isLoading()\"\n [disabled]=\"disabled() || isLoading()\"\n pTooltip=\"Un v\u00EDdeo que muestre la imagen principal animada\"></p-button>\n" }]
590
+ args: [{ selector: 'dc-simple-uploader', standalone: true, imports: [CommonModule, FormsModule, ButtonModule, TooltipModule, DialogModule, InputTextModule, SelectModule], template: "<p-button\n size=\"large\"\n [label]=\"buttonLabel()\"\n (click)=\"openDialog()\"\n [loading]=\"isLoading()\"\n [disabled]=\"disabled() || isLoading()\"\n pTooltip=\"Upload a file with metadata\"></p-button>\n\n@if(displayDialog()){\n<p-dialog\n header=\"Upload File\"\n [(visible)]=\"displayDialog\"\n [modal]=\"true\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n [contentStyle]=\"{ width: '50vw', height: '50vh' }\">\n <div class=\"upload-dialog\">\n @if(!fileSelected()){\n <div class=\"file-input-container\">\n <input #fileInput type=\"file\" [id]=\"fileInputId\" (change)=\"onFileSelected($event)\" [accept]=\"accept()\" style=\"display: none\" />\n <p-button label=\"Select File\" (click)=\"triggerFileInputClick(fileInput)\"></p-button>\n </div>\n } @else {\n <div class=\"file-details\">\n <p>File: {{ fileSelected()?.name }}</p>\n <p>Size: {{ fileSelected()?.size }} bytes</p>\n </div>\n\n <div class=\"metadata-container\">\n <h5>Metadata</h5>\n <div class=\"p-fluid\">\n @for (key of objectKeys(metadata()); track key) {\n <div class=\"p-field\">\n <label [for]=\"key\">{{ key }}</label>\n <input pInputText [id]=\"key\" [(ngModel)]=\"metadataInput[key]\" />\n </div>\n }\n\n <div class=\"p-field\">\n <label for=\"emotion\">Emotion</label>\n <p-select [options]=\"MoodStateOptions\" [(ngModel)]=\"moodSelected\" optionLabel=\"label\" optionValue=\"value\" placeholder=\"Select an emotion\"></p-select>\n </div>\n </div>\n </div>\n }\n </div>\n\n <ng-template pTemplate=\"footer\">\n <div class=\"dialog-footer\">\n <p-button label=\"Cancel\" styleClass=\"p-button-secondary\" (click)=\"displayDialog.set(false)\"></p-button>\n <p-button label=\"Upload\" (click)=\"uploadFile()\" [disabled]=\"!fileSelected() || isLoading()\"></p-button>\n </div>\n </ng-template>\n</p-dialog>\n}\n" }]
559
591
  }], ctorParameters: () => [] });
560
592
 
561
593
  class DCFilesCacheService {
@@ -702,7 +734,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
702
734
  }]
703
735
  }] });
704
736
 
705
- class CsaAssetsLoaderComponent {
737
+ class AssetsLoaderComponent {
706
738
  constructor() {
707
739
  this.assets = input.required();
708
740
  this.storagePath = input.required();
@@ -753,6 +785,15 @@ class CsaAssetsLoaderComponent {
753
785
  }
754
786
  const updatedField = { motion: { url: event.url } };
755
787
  const newAssets = { ...this.assets(), ...updatedField };
788
+ // Emit only the update field
789
+ this.assetUpdate.emit({ assets: updatedField });
790
+ // Assets Changes emit the new object
791
+ this.assetsChange.emit(newAssets);
792
+ }
793
+ onMotionAdded(event) {
794
+ const currentAssets = this.assets() ?? { motions: [] };
795
+ const updatedField = { motions: [...(currentAssets.motions || []), event] };
796
+ const newAssets = { ...currentAssets, ...updatedField };
756
797
  this.assetUpdate.emit({ assets: updatedField });
757
798
  this.assetsChange.emit(newAssets);
758
799
  }
@@ -768,12 +809,54 @@ class CsaAssetsLoaderComponent {
768
809
  this.assetUpdate.emit({ assets: updatedField });
769
810
  this.assetsChange.emit(newAssets);
770
811
  }
771
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: CsaAssetsLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
772
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.4", type: CsaAssetsLoaderComponent, isStandalone: true, selector: "assets-loader", inputs: { assets: { classPropertyName: "assets", publicName: "assets", isSignal: true, isRequired: true, transformFunction: null }, storagePath: { classPropertyName: "storagePath", publicName: "storagePath", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { assetsChange: "assetsChange", assetUpdate: "assetUpdate", onFileSelected: "onFileSelected" }, ngImport: i0, template: "<div class=\"assets-container\">\n <div class=\"assets-card\">\n <p-message severity=\"info\">\n <div class=\"upload-buttons\">\n <dc-simple-uploader\n [buttonLabel]=\"'Agregar movimiento'\"\n (fileUploaded)=\"onMotionUploaded($event)\"\n [storagePath]=\"storagePath() + '/movimientos/file'\"\n [accept]=\"'video/*'\"></dc-simple-uploader>\n\n <dc-cropper-modal\n #cropperBanner\n id=\"cropperBanner\"\n [buttonLabel]=\"assets()?.banner?.url ? 'Cambiar el banner' : 'Cargar un banner'\"\n [imgStorageSettings]=\"bannerImgSettings()\"\n [currentStorage]=\"assets()?.banner\"\n (imageUploaded)=\"onImageUploaded($event, 'banner')\"></dc-cropper-modal>\n\n <dc-cropper-modal\n id=\"cropperStickers\"\n #cropperStickers\n [buttonLabel]=\"'agregar sticker'\"\n [imgStorageSettings]=\"stickerStorageSettings()\"\n (imageUploaded)=\"onImageUploaded($event, 'sticker')\"></dc-cropper-modal>\n\n <div>\n <dc-cropper-modal\n id=\"cropperCardImage\"\n #cropperCardImage\n [buttonLabel]=\"assets()?.image?.url ? 'Cambiar imagen' : 'Cargar una imagen'\"\n [imgStorageSettings]=\"imageStorageSettings()\"\n [currentStorage]=\"assets()?.image\"\n (imageUploaded)=\"onImageUploaded($event, 'image')\"\n (onFileSelected)=\"onFileSelected.emit($event)\"></dc-cropper-modal>\n </div>\n </div>\n </p-message>\n <!-- Banner -->\n\n <div class=\"preview-container\">\n <img [src]=\"assets()?.banner?.url || 'assets/defaults/images/default_banner.webp'\" class=\"main-banner-image-card\" />\n <img [src]=\"assets()?.image?.url || 'assets/defaults/images/default_2_3.webp'\" class=\"main-image-card\" />\n <video class=\"main-motion-card\" [src]=\"assets()?.motion?.url\" autoplay loop muted playsinline></video>\n </div>\n\n <div class=\"stickers-container\">\n @for (sticker of assets()?.stickers; track sticker.url) {\n <div class=\"sticker-wrapper\">\n <img width=\"100\" [src]=\"sticker.url\" alt=\"\" />\n <p-button (click)=\"removeSticker(sticker)\" class=\"remove-sticker\" icon=\"pi pi-times\" [rounded]=\"true\" [text]=\"true\" severity=\"danger\" />\n </div>\n }\n </div>\n </div>\n</div>\n", styles: [".main-image-card{max-width:220px;display:block;border-radius:8px;position:absolute;bottom:-100px;right:20px;transform:none;z-index:1;box-shadow:0 4px 8px #0003}@media (max-width: 1300px){.main-image-card{max-width:170px}}@media (max-width: 768px){.main-image-card{max-width:130px}}.main-motion-card{max-width:220px;display:block;border-radius:8px;position:absolute;bottom:-100px;left:20px;transform:none;z-index:1;box-shadow:0 4px 8px #0003}@media (max-width: 1300px){.main-motion-card{max-width:170px}}@media (max-width: 768px){.main-motion-card{max-width:130px}}.main-banner-image-card{display:block;width:100%;max-height:400px;object-fit:cover;border-radius:8px}.remove-sticker{position:absolute;top:5px;right:5px}.assets-container{position:relative;min-height:60px}.assets-card{border:1px dashed rgba(12,19,142,.1215686275);padding:4px;border-radius:15px}.upload-buttons{display:flex;gap:10px}.preview-container{position:relative;margin-bottom:100px}.stickers-container{display:flex;flex-wrap:wrap;gap:10px}.sticker-wrapper{position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: CropperComponentModal, selector: "dc-cropper-modal", inputs: ["imgStorageSettings", "buttonLabel", "currentStorage"], outputs: ["imageUploaded", "onImageCropped", "onFileSelected"] }, { kind: "component", type: SimpleUploaderComponent, selector: "dc-simple-uploader", inputs: ["storagePath", "buttonLabel", "accept", "disabled"], outputs: ["fileUploaded", "uploadError"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i1$1.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: MessageModule }, { kind: "component", type: i6.Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant"], outputs: ["onClose"] }] }); }
812
+ removeMotion(motion) {
813
+ const path = extractPath(motion);
814
+ if (path) {
815
+ this.storageService.deleteImage(path);
816
+ }
817
+ const currentMotions = this.assets()?.motions ?? [];
818
+ const updatedMotions = currentMotions.filter((m) => m.url !== motion.url);
819
+ const updatedField = { motions: updatedMotions };
820
+ const newAssets = { ...this.assets(), ...updatedField };
821
+ this.assetUpdate.emit({ assets: updatedField });
822
+ this.assetsChange.emit(newAssets);
823
+ }
824
+ removeMainMotion() {
825
+ const motionToRemove = this.assets()?.motion;
826
+ if (motionToRemove?.url) {
827
+ const path = extractPath(motionToRemove);
828
+ if (path) {
829
+ this.storageService.deleteImage(path);
830
+ }
831
+ const updatedField = { motion: null };
832
+ const newAssets = { ...this.assets(), motion: null };
833
+ this.assetUpdate.emit({ assets: updatedField });
834
+ this.assetsChange.emit(newAssets);
835
+ }
836
+ }
837
+ onVideoEnded(video) {
838
+ video.pause();
839
+ this.reverseInterval = setInterval(() => {
840
+ if (video.currentTime <= 0) {
841
+ clearInterval(this.reverseInterval);
842
+ video.play();
843
+ }
844
+ else {
845
+ video.currentTime -= 0.03;
846
+ }
847
+ }, 30);
848
+ }
849
+ ngOnDestroy() {
850
+ if (this.reverseInterval) {
851
+ clearInterval(this.reverseInterval);
852
+ }
853
+ }
854
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: AssetsLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
855
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.4", type: AssetsLoaderComponent, isStandalone: true, selector: "assets-loader", inputs: { assets: { classPropertyName: "assets", publicName: "assets", isSignal: true, isRequired: true, transformFunction: null }, storagePath: { classPropertyName: "storagePath", publicName: "storagePath", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { assetsChange: "assetsChange", assetUpdate: "assetUpdate", onFileSelected: "onFileSelected" }, ngImport: i0, template: "<div class=\"assets-container\">\n <div class=\"assets-card\">\n <p-message severity=\"info\">\n <div class=\"upload-buttons\">\n <div>\n <dc-cropper-modal\n id=\"cropperCardImage\"\n #cropperCardImage\n [buttonLabel]=\"assets()?.image?.url ? 'Cambiar imagen' : 'Cargar una imagen'\"\n [imgStorageSettings]=\"imageStorageSettings()\"\n [currentStorage]=\"assets()?.image\"\n (imageUploaded)=\"onImageUploaded($event, 'image')\"\n (onFileSelected)=\"onFileSelected.emit($event)\"></dc-cropper-modal>\n </div>\n\n <dc-simple-uploader\n [buttonLabel]=\"assets()?.motion?.url ? 'Cambiar video principal' : 'Agregar video principal'\"\n (fileUploaded)=\"onMotionUploaded($event)\"\n [storagePath]=\"storagePath() + '/motions/file'\"\n [accept]=\"'video/*'\"></dc-simple-uploader>\n\n <dc-simple-uploader\n [buttonLabel]=\"'Agregar Movimientos'\"\n (fileUploaded)=\"onMotionAdded($event)\"\n [storagePath]=\"storagePath() + '/motions/file'\"\n [accept]=\"'video/*'\"></dc-simple-uploader>\n\n <dc-cropper-modal\n #cropperBanner\n id=\"cropperBanner\"\n [buttonLabel]=\"assets()?.banner?.url ? 'Cambiar el banner' : 'Cargar un banner'\"\n [imgStorageSettings]=\"bannerImgSettings()\"\n [currentStorage]=\"assets()?.banner\"\n (imageUploaded)=\"onImageUploaded($event, 'banner')\"></dc-cropper-modal>\n\n <dc-cropper-modal\n id=\"cropperStickers\"\n #cropperStickers\n [buttonLabel]=\"'Agregar sticker'\"\n [imgStorageSettings]=\"stickerStorageSettings()\"\n (imageUploaded)=\"onImageUploaded($event, 'sticker')\"></dc-cropper-modal>\n </div>\n </p-message>\n <!-- Banner -->\n\n <div class=\"preview-container\">\n <img [src]=\"assets()?.banner?.url || 'assets/defaults/images/default_banner.webp'\" class=\"main-banner-image-card\" />\n <div class=\"main-image-card\">\n <img [src]=\"assets()?.image?.url || 'assets/defaults/images/default_2_3.webp'\" />\n </div>\n\n <div class=\"motion-container\">\n <video #videoPlayer class=\"main-motion-card\" [src]=\"assets()?.motion?.url\" (ended)=\"onVideoEnded(videoPlayer)\" autoplay muted playsinline></video>\n @if(assets()?.motion?.url){\n <p-button class=\"remove-main-motion-button\" (click)=\"removeMainMotion()\" [rounded]=\"true\" [text]=\"true\" icon=\"pi pi-trash\" severity=\"danger\"></p-button>\n }\n </div>\n </div>\n\n <div class=\"stickers-container\">\n @for (sticker of assets()?.stickers; track sticker.url) {\n <div class=\"sticker-wrapper\">\n <img width=\"100\" [src]=\"sticker.url\" alt=\"\" />\n <p-button (click)=\"removeSticker(sticker)\" class=\"remove-sticker\" icon=\"pi pi-times\" [rounded]=\"true\" [text]=\"true\" severity=\"danger\" />\n </div>\n }\n </div>\n\n <div class=\"motions-container\">\n @for (motion of assets()?.motions; track motion.url) {\n <div class=\"motion-wrapper\">\n <video width=\"150\" [src]=\"motion.url\" controls playsinline preload=\"none\"></video>\n <p-button (click)=\"removeMotion(motion)\" class=\"remove-motion-button\" icon=\"pi pi-trash\" [rounded]=\"true\" [text]=\"true\" severity=\"danger\"></p-button>\n </div>\n }\n </div>\n </div>\n</div>\n", styles: [".main-image-card{max-width:220px;display:block;border-radius:8px;position:absolute;bottom:-100px;left:20px;transform:none;z-index:1;box-shadow:0 4px 8px #0003;overflow:hidden}@media (max-width: 1300px){.main-image-card{max-width:170px}}@media (max-width: 768px){.main-image-card{max-width:130px}}.main-motion-card{max-width:100%;display:block;border-radius:8px}.main-banner-image-card{display:block;width:100%;max-height:400px;object-fit:cover;border-radius:8px}.remove-sticker{position:absolute;top:5px;right:5px}.assets-container{position:relative;min-height:60px}.assets-card{border:1px dashed rgba(12,19,142,.1215686275);padding:4px;border-radius:15px}.upload-buttons{display:flex;gap:10px}.preview-container{position:relative;margin-bottom:100px}.stickers-container{display:flex;flex-wrap:wrap;gap:10px}.sticker-wrapper{position:relative}.motion-container{position:absolute;bottom:-100px;right:20px;z-index:1;box-shadow:0 4px 8px #0003;max-width:220px;border-radius:8px;overflow:hidden}@media (max-width: 1300px){.motion-container{max-width:170px}}@media (max-width: 768px){.motion-container{max-width:130px}}.remove-main-motion-button{position:absolute;top:10px;right:10px;z-index:2}.motions-container{display:flex;flex-wrap:wrap;gap:10px;margin-top:20px}.motion-wrapper{position:relative;width:150px;border-radius:8px;overflow:hidden;box-shadow:0 2px 4px #0000001a}.motion-wrapper video{min-height:220px;display:block;background-color:#f0f0f0}.remove-motion-button{position:absolute;top:5px;right:5px;z-index:2}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: CropperComponentModal, selector: "dc-cropper-modal", inputs: ["imgStorageSettings", "buttonLabel", "currentStorage"], outputs: ["imageUploaded", "onImageCropped", "onFileSelected"] }, { kind: "component", type: SimpleUploaderComponent, selector: "dc-simple-uploader", inputs: ["storagePath", "buttonLabel", "accept", "disabled", "metadata"], outputs: ["fileUploaded", "uploadError"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: MessageModule }, { kind: "component", type: i6.Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant"], outputs: ["onClose"] }] }); }
773
856
  }
774
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: CsaAssetsLoaderComponent, decorators: [{
857
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: AssetsLoaderComponent, decorators: [{
775
858
  type: Component,
776
- args: [{ selector: 'assets-loader', standalone: true, imports: [CommonModule, CropperComponentModal, SimpleUploaderComponent, ButtonModule, MessageModule], template: "<div class=\"assets-container\">\n <div class=\"assets-card\">\n <p-message severity=\"info\">\n <div class=\"upload-buttons\">\n <dc-simple-uploader\n [buttonLabel]=\"'Agregar movimiento'\"\n (fileUploaded)=\"onMotionUploaded($event)\"\n [storagePath]=\"storagePath() + '/movimientos/file'\"\n [accept]=\"'video/*'\"></dc-simple-uploader>\n\n <dc-cropper-modal\n #cropperBanner\n id=\"cropperBanner\"\n [buttonLabel]=\"assets()?.banner?.url ? 'Cambiar el banner' : 'Cargar un banner'\"\n [imgStorageSettings]=\"bannerImgSettings()\"\n [currentStorage]=\"assets()?.banner\"\n (imageUploaded)=\"onImageUploaded($event, 'banner')\"></dc-cropper-modal>\n\n <dc-cropper-modal\n id=\"cropperStickers\"\n #cropperStickers\n [buttonLabel]=\"'agregar sticker'\"\n [imgStorageSettings]=\"stickerStorageSettings()\"\n (imageUploaded)=\"onImageUploaded($event, 'sticker')\"></dc-cropper-modal>\n\n <div>\n <dc-cropper-modal\n id=\"cropperCardImage\"\n #cropperCardImage\n [buttonLabel]=\"assets()?.image?.url ? 'Cambiar imagen' : 'Cargar una imagen'\"\n [imgStorageSettings]=\"imageStorageSettings()\"\n [currentStorage]=\"assets()?.image\"\n (imageUploaded)=\"onImageUploaded($event, 'image')\"\n (onFileSelected)=\"onFileSelected.emit($event)\"></dc-cropper-modal>\n </div>\n </div>\n </p-message>\n <!-- Banner -->\n\n <div class=\"preview-container\">\n <img [src]=\"assets()?.banner?.url || 'assets/defaults/images/default_banner.webp'\" class=\"main-banner-image-card\" />\n <img [src]=\"assets()?.image?.url || 'assets/defaults/images/default_2_3.webp'\" class=\"main-image-card\" />\n <video class=\"main-motion-card\" [src]=\"assets()?.motion?.url\" autoplay loop muted playsinline></video>\n </div>\n\n <div class=\"stickers-container\">\n @for (sticker of assets()?.stickers; track sticker.url) {\n <div class=\"sticker-wrapper\">\n <img width=\"100\" [src]=\"sticker.url\" alt=\"\" />\n <p-button (click)=\"removeSticker(sticker)\" class=\"remove-sticker\" icon=\"pi pi-times\" [rounded]=\"true\" [text]=\"true\" severity=\"danger\" />\n </div>\n }\n </div>\n </div>\n</div>\n", styles: [".main-image-card{max-width:220px;display:block;border-radius:8px;position:absolute;bottom:-100px;right:20px;transform:none;z-index:1;box-shadow:0 4px 8px #0003}@media (max-width: 1300px){.main-image-card{max-width:170px}}@media (max-width: 768px){.main-image-card{max-width:130px}}.main-motion-card{max-width:220px;display:block;border-radius:8px;position:absolute;bottom:-100px;left:20px;transform:none;z-index:1;box-shadow:0 4px 8px #0003}@media (max-width: 1300px){.main-motion-card{max-width:170px}}@media (max-width: 768px){.main-motion-card{max-width:130px}}.main-banner-image-card{display:block;width:100%;max-height:400px;object-fit:cover;border-radius:8px}.remove-sticker{position:absolute;top:5px;right:5px}.assets-container{position:relative;min-height:60px}.assets-card{border:1px dashed rgba(12,19,142,.1215686275);padding:4px;border-radius:15px}.upload-buttons{display:flex;gap:10px}.preview-container{position:relative;margin-bottom:100px}.stickers-container{display:flex;flex-wrap:wrap;gap:10px}.sticker-wrapper{position:relative}\n"] }]
859
+ args: [{ selector: 'assets-loader', standalone: true, imports: [CommonModule, CropperComponentModal, SimpleUploaderComponent, ButtonModule, MessageModule], template: "<div class=\"assets-container\">\n <div class=\"assets-card\">\n <p-message severity=\"info\">\n <div class=\"upload-buttons\">\n <div>\n <dc-cropper-modal\n id=\"cropperCardImage\"\n #cropperCardImage\n [buttonLabel]=\"assets()?.image?.url ? 'Cambiar imagen' : 'Cargar una imagen'\"\n [imgStorageSettings]=\"imageStorageSettings()\"\n [currentStorage]=\"assets()?.image\"\n (imageUploaded)=\"onImageUploaded($event, 'image')\"\n (onFileSelected)=\"onFileSelected.emit($event)\"></dc-cropper-modal>\n </div>\n\n <dc-simple-uploader\n [buttonLabel]=\"assets()?.motion?.url ? 'Cambiar video principal' : 'Agregar video principal'\"\n (fileUploaded)=\"onMotionUploaded($event)\"\n [storagePath]=\"storagePath() + '/motions/file'\"\n [accept]=\"'video/*'\"></dc-simple-uploader>\n\n <dc-simple-uploader\n [buttonLabel]=\"'Agregar Movimientos'\"\n (fileUploaded)=\"onMotionAdded($event)\"\n [storagePath]=\"storagePath() + '/motions/file'\"\n [accept]=\"'video/*'\"></dc-simple-uploader>\n\n <dc-cropper-modal\n #cropperBanner\n id=\"cropperBanner\"\n [buttonLabel]=\"assets()?.banner?.url ? 'Cambiar el banner' : 'Cargar un banner'\"\n [imgStorageSettings]=\"bannerImgSettings()\"\n [currentStorage]=\"assets()?.banner\"\n (imageUploaded)=\"onImageUploaded($event, 'banner')\"></dc-cropper-modal>\n\n <dc-cropper-modal\n id=\"cropperStickers\"\n #cropperStickers\n [buttonLabel]=\"'Agregar sticker'\"\n [imgStorageSettings]=\"stickerStorageSettings()\"\n (imageUploaded)=\"onImageUploaded($event, 'sticker')\"></dc-cropper-modal>\n </div>\n </p-message>\n <!-- Banner -->\n\n <div class=\"preview-container\">\n <img [src]=\"assets()?.banner?.url || 'assets/defaults/images/default_banner.webp'\" class=\"main-banner-image-card\" />\n <div class=\"main-image-card\">\n <img [src]=\"assets()?.image?.url || 'assets/defaults/images/default_2_3.webp'\" />\n </div>\n\n <div class=\"motion-container\">\n <video #videoPlayer class=\"main-motion-card\" [src]=\"assets()?.motion?.url\" (ended)=\"onVideoEnded(videoPlayer)\" autoplay muted playsinline></video>\n @if(assets()?.motion?.url){\n <p-button class=\"remove-main-motion-button\" (click)=\"removeMainMotion()\" [rounded]=\"true\" [text]=\"true\" icon=\"pi pi-trash\" severity=\"danger\"></p-button>\n }\n </div>\n </div>\n\n <div class=\"stickers-container\">\n @for (sticker of assets()?.stickers; track sticker.url) {\n <div class=\"sticker-wrapper\">\n <img width=\"100\" [src]=\"sticker.url\" alt=\"\" />\n <p-button (click)=\"removeSticker(sticker)\" class=\"remove-sticker\" icon=\"pi pi-times\" [rounded]=\"true\" [text]=\"true\" severity=\"danger\" />\n </div>\n }\n </div>\n\n <div class=\"motions-container\">\n @for (motion of assets()?.motions; track motion.url) {\n <div class=\"motion-wrapper\">\n <video width=\"150\" [src]=\"motion.url\" controls playsinline preload=\"none\"></video>\n <p-button (click)=\"removeMotion(motion)\" class=\"remove-motion-button\" icon=\"pi pi-trash\" [rounded]=\"true\" [text]=\"true\" severity=\"danger\"></p-button>\n </div>\n }\n </div>\n </div>\n</div>\n", styles: [".main-image-card{max-width:220px;display:block;border-radius:8px;position:absolute;bottom:-100px;left:20px;transform:none;z-index:1;box-shadow:0 4px 8px #0003;overflow:hidden}@media (max-width: 1300px){.main-image-card{max-width:170px}}@media (max-width: 768px){.main-image-card{max-width:130px}}.main-motion-card{max-width:100%;display:block;border-radius:8px}.main-banner-image-card{display:block;width:100%;max-height:400px;object-fit:cover;border-radius:8px}.remove-sticker{position:absolute;top:5px;right:5px}.assets-container{position:relative;min-height:60px}.assets-card{border:1px dashed rgba(12,19,142,.1215686275);padding:4px;border-radius:15px}.upload-buttons{display:flex;gap:10px}.preview-container{position:relative;margin-bottom:100px}.stickers-container{display:flex;flex-wrap:wrap;gap:10px}.sticker-wrapper{position:relative}.motion-container{position:absolute;bottom:-100px;right:20px;z-index:1;box-shadow:0 4px 8px #0003;max-width:220px;border-radius:8px;overflow:hidden}@media (max-width: 1300px){.motion-container{max-width:170px}}@media (max-width: 768px){.motion-container{max-width:130px}}.remove-main-motion-button{position:absolute;top:10px;right:10px;z-index:2}.motions-container{display:flex;flex-wrap:wrap;gap:10px;margin-top:20px}.motion-wrapper{position:relative;width:150px;border-radius:8px;overflow:hidden;box-shadow:0 2px 4px #0000001a}.motion-wrapper video{min-height:220px;display:block;background-color:#f0f0f0}.remove-motion-button{position:absolute;top:5px;right:5px;z-index:2}\n"] }]
777
860
  }] });
778
861
 
779
862
  /*
@@ -784,5 +867,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
784
867
  * Generated bundle index. Do not edit.
785
868
  */
786
869
 
787
- export { AspectRatio, AspectRatio2, AspectRatioOptions, AspectType, CropperComponent, CropperComponentModal, CsaAssetsLoaderComponent, DCFilesCacheService, DEFAULT_SETTINGS, ImageStoragePreviewComponent, MultiImagesStorageService, MultiObjectStorageService, ResolutionType, SimpleUploaderComponent, extractBucket, extractPath };
870
+ export { AspectRatio, AspectRatio2, AspectRatioOptions, AspectType, AssetsLoaderComponent, CropperComponent, CropperComponentModal, DCFilesCacheService, DEFAULT_SETTINGS, ImageStoragePreviewComponent, MultiImagesStorageService, MultiObjectStorageService, ResolutionType, SimpleUploaderComponent, extractBucket, extractPath };
788
871
  //# sourceMappingURL=dataclouder-ngx-cloud-storage.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dataclouder-ngx-cloud-storage.mjs","sources":["../../../../projects/dataclouder/ngx-cloud-storage/src/lib/classes/storage.models.ts","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/services/multi-images-storage.service.ts","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/components/cropper/cropper.component.ts","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/components/cropper/cropper.component.html","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/components/cropper-modal/cropper-modal.component.ts","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/components/cropper-modal/cropper-modal.component.html","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/components/image-storage-preview/image-storage-preview.ts","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/components/image-storage-preview/image-storage-preview.html","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/components/simple-uploader/simple-uploader.component.ts","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/components/simple-uploader/simple-uploader.component.html","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/services/dc-files-cache.service.ts","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/services/multi-object-storage.service.ts","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/components/assets-loader/csa-assets-loader.component.ts","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/components/assets-loader/csa-assets-loader.component.html","../../../../projects/dataclouder/ngx-cloud-storage/src/public-api.ts","../../../../projects/dataclouder/ngx-cloud-storage/src/dataclouder-ngx-cloud-storage.ts"],"sourcesContent":["export interface CloudStorageData {\n url: string;\n}\n\nexport interface FileStorageData extends CloudStorageData {\n name?: string; // File name in storage, e.g., 'report.pdf'\n type?: string; // MIME type, e.g., 'application/pdf'\n size?: number; // File size in bytes\n metadata?: any;\n}\n\nexport interface ImgStorageData extends FileStorageData {\n resolution?: string;\n resolutions?: { [key: string]: string };\n}\n\nexport interface ImgGeneratedStorageData extends ImgStorageData {\n model?: string;\n prompt?: string;\n}\n\n// Use as input for uploadImage\nexport interface StorageImageSettings {\n path?: string;\n fileName?: string;\n cropSettings?: ImageCropSettings;\n}\n\nexport interface ImageCropSettings {\n resizeToWidth?: number;\n resolutions: Array<number>; // 400, 800, 1200, 1600\n aspectRatio: AspectType;\n}\n\nexport interface CropImageSettings {\n // Resolutions should be here.\n path: string;\n fileName?: string;\n resizeToWidth?: number;\n}\n\nexport interface ImageMultipleCrops {\n file: File;\n defaultImageBlob?: Blob;\n imagesBlobs: { [resolution: number]: Blob };\n settings: { renameFile: string; width?: number };\n}\n\nexport const AspectRatioOptions: AspectRatioOption[] = [\n { value: '1:1', label: 'square', description: 'Square (1:1)', valueRatio: 1 / 1 },\n { value: '1:2', label: 'vertical_1_2', description: 'Vertical (1:2)', valueRatio: 1 / 2 },\n { value: '2:3', label: 'vertical_2_3', description: 'Vertical (2:3)', valueRatio: 2 / 3 },\n { value: '3:4', label: 'vertical_3_4', description: 'Vertical (3:4)', valueRatio: 3 / 4 },\n { value: '4:5', label: 'vertical_4_5', description: 'Vertical (4:5)', valueRatio: 4 / 5 },\n { value: '9:16', label: 'vertical_9_16', description: 'Vertical (9:16)', valueRatio: 9 / 16 },\n { value: '2:1', label: 'horizontal_2_1', description: 'Horizontal (2:1)', valueRatio: 2 / 1 },\n { value: '3:2', label: 'horizontal_3_2', description: 'Horizontal (3:2)', valueRatio: 3 / 2 },\n { value: '4:3', label: 'horizontal_4_3', description: 'Horizontal (4:3)', valueRatio: 4 / 3 },\n { value: '5:4', label: 'horizontal_5_4', description: 'Horizontal (5:4)', valueRatio: 5 / 4 },\n { value: '16:9', label: 'horizontal_16_9', description: 'Horizontal (16:9)', valueRatio: 16 / 9 },\n];\n\nexport interface AspectRatioOption {\n label: string;\n description: string;\n value: string;\n valueRatio: number;\n}\n\nexport enum AspectType {\n Square = 'square',\n Rectangle = 'rectangle',\n Banner = 'banner',\n RectangleLarge = 'rectangleLarge',\n Vertical_9_16 = 'vertical_9_16',\n Vertical_3_5 = 'vertical_3_5',\n Vertical_2_3 = 'vertical_2_3',\n}\n\n// Creo que seria bueno refactorizar para solo enviar aspect ratio asi\nexport enum AspectRatio2 {\n // Vertical\n '9:16' = 16 / 9,\n '3:5' = 3 / 5,\n '5:8' = 5 / 8,\n '2:3' = 2 / 3,\n '1:1' = 1 / 1,\n}\n\nexport enum ResolutionType {\n Small = 200,\n Medium = 400,\n MediumLarge = 800,\n Large = 1200,\n VeryLarge = 1600,\n}\n\nexport const AspectRatio = {\n [AspectType.Square]: 1 / 1,\n [AspectType.Rectangle]: 16 / 9,\n [AspectType.Vertical_9_16]: 9 / 16,\n [AspectType.RectangleLarge]: 16 / 8,\n [AspectType.Banner]: 16 / 7,\n [AspectType.Vertical_3_5]: 3 / 5,\n [AspectType.Vertical_2_3]: 2 / 3,\n};\n\nexport const DEFAULT_SETTINGS: StorageImageSettings = {\n path: '/default-collection/id/please-change-this-subcollection',\n fileName: 'image',\n cropSettings: {\n aspectRatio: AspectType.Square,\n resolutions: [ResolutionType.Small, ResolutionType.MediumLarge],\n resizeToWidth: 450,\n },\n};\n\nconst FIREBASE_STORAGE_URL_REGEX = /https:\\/\\/firebasestorage\\.googleapis\\.com\\/v0\\/b\\/([^/]+)\\/o\\/([^?]+)/;\n\n/**\n * Extracts the bucket name from a Firebase Storage URL.\n * The URL is expected to follow the pattern:\n * 'https://firebasestorage.googleapis.com/v0/b/&lt;bucket&gt;/&lt;path&gt;?&lt;query_params&gt;'\n *\n * @param data The CloudStorageData object containing the 'url' property.\n * @returns The bucket name (e.g., 'appingles-pro.appspot.com') or undefined if not found or URL is invalid.\n */\nexport function extractBucket(data: CloudStorageData): string | undefined {\n if (!data.url) {\n return undefined;\n }\n const match = data.url.match(FIREBASE_STORAGE_URL_REGEX);\n // match[0] is the full matched string\n // match[1] is the first capturing group (bucket)\n // match[2] is the second capturing group (path)\n return match?.[1];\n}\n\n/**\n * Extracts the file path from a Firebase Storage URL.\n * The URL is expected to follow the pattern:\n * 'https://firebasestorage.googleapis.com/v0/b/&lt;bucket&gt;/&lt;path&gt;?&lt;query_params&gt;'\n * The extracted path is the part after the bucket and before any query parameters.\n *\n * @param data The CloudStorageData object containing the 'url' property.\n * @returns The file path (e.g., 'scenarios/666506c3b9b5443f4bfab5e0/images/hairdresser.webp')\n * or undefined if not found or URL is invalid.\n * Note: This function does not perform URL decoding on the path. If URL-decoded paths\n * (e.g., converting %2F to /) are needed, `decodeURIComponent` should be applied to the result.\n */\nexport function extractPath(data: CloudStorageData): string | undefined {\n if (data && data?.url) {\n const match = data.url.match(FIREBASE_STORAGE_URL_REGEX);\n // match[0] is the full matched string\n // match[1] is the first capturing group (bucket)\n // match[2] is the second capturing group (path after 'o/')\n if (match && match[2]) {\n try {\n // Decode URI components, e.g., %2F to /\n return decodeURIComponent(match[2]);\n } catch (e) {\n // Log error if decoding fails.\n // Returning the raw path component as a fallback.\n // Consider if undefined or throwing an error would be more appropriate for your use case.\n console.error(`Failed to decode URI component for path: '${match[2]}'`, e);\n return match[2]; // Fallback to raw path component\n }\n }\n return undefined; // URL did not match expected pattern or path component missing\n } else {\n return undefined;\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { AngularFireStorage, AngularFireUploadTask } from '@angular/fire/compat/storage';\nimport { getDownloadURL, getStorage, deleteObject, listAll } from '@angular/fire/storage';\n\nimport { ref } from 'firebase/storage';\nimport { lastValueFrom } from 'rxjs';\nimport { ImageMultipleCrops, ImgStorageData, FileStorageData } from '../classes/storage.models';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MultiImagesStorageService {\n private storage = inject(AngularFireStorage);\n\n public async uploadImage(image: Blob, path: string): Promise<ImgStorageData> {\n try {\n const refStorage = this.storage.ref(path);\n const task = await refStorage.put(image);\n const { bucket, name: metadataName, contentType, size } = task.metadata;\n const url = await lastValueFrom(refStorage.getDownloadURL());\n const imageStorage: ImgStorageData = {\n url,\n name: metadataName,\n type: contentType,\n size,\n };\n return imageStorage;\n } catch (error) {\n console.error('uploading image error: ', error);\n return null;\n }\n }\n\n public async delete_directory(imagePath: string): Promise<void> {\n // WARNING!! user very carefully could delete whatever folder\n const storage = getStorage();\n const directoryRef = ref(storage, imagePath);\n\n listAll(directoryRef)\n .then((res) => {\n res.items.forEach((itemRef) => {\n console.log(itemRef);\n deleteObject(itemRef);\n });\n })\n .catch((error) => {\n console.error('error al eliminar imagenes de cloud storage', error);\n });\n }\n\n public async deleteImage(imagePath: string): Promise<void> {\n const storageRef = this.storage.ref(imagePath);\n storageRef.delete().subscribe((res) => {\n console.log('image deleted', res);\n });\n }\n\n private async uploadAndGetUrl(task: AngularFireUploadTask, resolution: string): Promise<ImgStorageData> {\n const snap = await task;\n const { fullPath, bucket, name, contentType, size } = snap.metadata;\n const storage = getStorage();\n const storageRef = ref(storage, fullPath);\n const url = await getDownloadURL(storageRef);\n const meta: ImgStorageData = {\n url,\n name,\n resolution,\n type: contentType,\n size,\n resolutions: {}, // Default empty resolutions\n };\n\n return meta;\n }\n\n public async uploadGenericFile(file: File, storagePath: string): Promise<FileStorageData | null> {\n try {\n // Ensure storagePath is a directory path, and append file.name\n const fullFilePath = `${storagePath.replace(/\\/$/, '')}/${file.name}`;\n const refStorage = this.storage.ref(fullFilePath);\n const task = await refStorage.put(file);\n const url = await lastValueFrom(refStorage.getDownloadURL());\n\n const fileData: FileStorageData = {\n url,\n name: file.name,\n type: file.type,\n size: file.size,\n metadata: task.metadata,\n };\n return fileData;\n } catch (error) {\n console.error(`Error uploading file ${file.name} to ${storagePath}:`, error);\n return null;\n }\n }\n}\n","import { Component, OnInit, ViewChild, inject, output, input } from '@angular/core';\nimport { ImageCroppedEvent, ImageCropperComponent, LoadedImage, base64ToFile } from 'ngx-image-cropper';\nimport { Observable } from 'rxjs';\nimport { AspectRatio, AspectType, ImageMultipleCrops, CropImageSettings, ResolutionType } from '../../classes/storage.models';\n\nimport { FormsModule } from '@angular/forms';\nimport { MultiImagesStorageService } from '../../services/multi-images-storage.service';\n\n@Component({\n selector: 'app-cropper',\n templateUrl: './cropper.component.html',\n styleUrls: ['./cropper.component.scss'],\n standalone: true,\n imports: [FormsModule, ImageCropperComponent],\n})\nexport class CropperComponent implements OnInit {\n private multiImagesStorageService = inject(MultiImagesStorageService);\n\n // overrides name, path and resizeToWidth\n readonly imageSettings = input<CropImageSettings>({} as any);\n readonly ratioType = input<AspectType | string>(AspectType.Square);\n readonly resolutions = input<Array<number>>([ResolutionType.MediumLarge]);\n // Outputs\n readonly imageUploaded = output<any>();\n readonly onImageCropped = output<ImageMultipleCrops>();\n readonly onFileSelected = output<any>();\n\n @ViewChild(ImageCropperComponent) imageCropper!: ImageCropperComponent;\n\n public fileMetadata: File | null = null;\n public imageChangedEvent!: Event;\n\n public aspectRatio: number = 1;\n\n public croppedImage: any = '';\n\n public isLoading = false;\n public isUploaded = false;\n public renameFile: any = '';\n public storagePath: string = '';\n public showModal = false;\n\n ngOnInit(): void {\n this.aspectRatio = AspectRatio[this.ratioType()];\n const imageSettings = this.imageSettings();\n if (imageSettings.path) {\n this.storagePath = `${imageSettings.path}/${imageSettings.fileName}.webp`;\n }\n }\n\n public reloadPath(): void {\n this.storagePath = `${this.imageSettings().path}/${this.renameFile}.webp`;\n }\n\n async fileChangeEvent(event: any) {\n this.imageChangedEvent = event;\n const file = event?.target?.files[0];\n if (file) {\n this.fileMetadata = file;\n this.onFileSelected.emit(file);\n this.showModal = true; // Show modal when file is selected\n this.renameFile = this.fileMetadata?.name?.split('.')[0];\n console.log(this.renameFile);\n\n if (!this.imageSettings().fileName) {\n this.reloadPath();\n }\n }\n }\n\n onInnerImageCropped(event: ImageCroppedEvent) {\n this.croppedImage = event.base64;\n }\n\n imageLoaded(image: LoadedImage) {\n // show cropper\n }\n\n loadImageFailed() {\n console.error('fallo al cargar la imagen');\n }\n\n public downloadURL!: Observable<string>;\n\n public async simpleCropAndUpload() {\n const imageCropped: any = await this.imageCropper.crop();\n const imgStorage = await this.multiImagesStorageService.uploadImage(imageCropped?.blob, this.storagePath);\n this.imageUploaded.emit(imgStorage);\n this.closeModal();\n }\n\n closeModal(): void {\n this.showModal = false;\n }\n}\n","<div> path: {{ storagePath }} </div>\n\n<div class=\"options\">\n @if (!isUploaded) {\n <div>\n <input type=\"file\" id=\"file-upload\" class=\"file-input\" (change)=\"fileChangeEvent($event)\" />\n <label for=\"file-upload\" class=\"btn-upload\">Seleccionar archivo</label>\n @if (!fileMetadata) {\n <em>Carga una imagen para comenzar</em>\n }\n </div>\n }\n\n @if (fileMetadata) {\n <span>\n <span style=\"margin: 1px 20px\"> tipo: {{ fileMetadata.type }} </span>\n <span style=\"margin: 1px 20px\"> tamaño {{ fileMetadata.size }} </span>\n <br />\n <input\n [disabled]=\"imageSettings()?.fileName\"\n style=\"margin: 1px 20px; width: 400px\"\n [(ngModel)]=\"renameFile\"\n type=\"text\"\n placeholder=\"Rename File\"\n (ngModelChange)=\"reloadPath()\" />\n <button class=\"btn-crop\" (click)=\"closeModal()\"> Recortar y Subir </button>\n </span>\n }\n</div>\n\n@if (fileMetadata && !isUploaded) {\n <div class=\"modal\" [class.show-modal]=\"showModal\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h3>Recortar imagen</h3>\n <button class=\"close-button\" (click)=\"closeModal()\">×</button>\n </div>\n <div class=\"modal-body\">\n <h1>Hlloa</h1>\n <image-cropper\n [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [aspectRatio]=\"aspectRatio\"\n format=\"webp\"\n [resizeToWidth]=\"450\"\n (imageCropped)=\"onInnerImageCropped($event)\"\n (loadImageFailed)=\"loadImageFailed()\"\n (imageLoaded)=\"imageLoaded($event)\"\n [autoCrop]=\"false\"></image-cropper>\n <div class=\"modal-footer\">\n <button class=\"btn-crop\" (click)=\"simpleCropAndUpload()\">Recortar y Subir</button>\n </div>\n </div>\n </div>\n </div>\n}\n\n@if (croppedImage && !isUploaded) {\n <button [disabled]=\"isLoading\" nbButton status=\"info\"> upload </button>\n}\n","import { Component, Input, OnInit, ViewChild, ChangeDetectorRef, inject, output, input } from '@angular/core';\n\nimport { FormsModule } from '@angular/forms';\n\nimport { DialogModule } from 'primeng/dialog';\n\nimport { ImageCroppedEvent, ImageCropperComponent, LoadedImage } from 'ngx-image-cropper';\nimport { Observable } from 'rxjs';\n\nimport { MultiImagesStorageService } from '../../services/multi-images-storage.service';\nimport {\n AspectRatio,\n AspectType,\n ImageMultipleCrops,\n StorageImageSettings,\n ImgStorageData,\n AspectRatioOptions,\n AspectRatioOption,\n DEFAULT_SETTINGS,\n extractPath,\n} from '../../classes/storage.models';\nimport { TooltipModule } from 'primeng/tooltip';\n\nimport { ButtonModule } from 'primeng/button';\nimport { MessageModule } from 'primeng/message';\nimport { SelectModule } from 'primeng/select';\nimport { InputTextModule } from 'primeng/inputtext';\n\n@Component({\n selector: 'dc-cropper-modal',\n templateUrl: './cropper-modal.component.html',\n styleUrls: ['./cropper-modal.component.scss'],\n standalone: true,\n imports: [FormsModule, ImageCropperComponent, ButtonModule, DialogModule, TooltipModule, MessageModule, SelectModule, InputTextModule],\n})\nexport class CropperComponentModal implements OnInit {\n private multiImagesStorageService = inject(MultiImagesStorageService);\n private changeDetectorRef = inject(ChangeDetectorRef);\n\n // overrides name, path and resizeToWidth\n\n readonly imgStorageSettings = input<StorageImageSettings>(DEFAULT_SETTINGS);\n readonly buttonLabel = input<string>('Seleccionar archivo');\n @Input() currentStorage: ImgStorageData = {} as any;\n\n readonly imageUploaded = output<ImgStorageData>();\n readonly onImageCropped = output<ImageMultipleCrops>();\n readonly onFileSelected = output<any>();\n\n @ViewChild(ImageCropperComponent) imageCropper!: ImageCropperComponent;\n\n public aspectRatioOptions = AspectRatioOptions;\n public fileMetadata: File | null = null;\n public imageChangedEvent!: Event;\n public displayDialog = false;\n public aspectRatioValue: number = 1;\n public croppedImage: any = '';\n public renameFile: any = '';\n public storagePath: string = '';\n public downloadURL!: Observable<string>;\n public resizeToWidth: number = 450;\n public ratioSelected: any = null;\n\n // Add a unique identifier for the file input\n public fileInputId: string;\n\n constructor() {\n // Generate random ID for file input\n this.fileInputId = `file-upload-${Math.random().toString(36).substring(2, 11)}`;\n }\n\n ngOnInit(): void {\n if (!this.imgStorageSettings().path) {\n console.warn('⚠️ Remember to set imgStorageSettings, path and fileName are required , path example: /collection/id/subcollection ');\n }\n\n this.reloadPath();\n }\n\n public reloadPath(): void {\n const randomCharacters = Math.random().toString(36).substring(2, 15);\n const fileName = this.imgStorageSettings().fileName || 'img';\n this.storagePath = `${this.imgStorageSettings().path}/${fileName}-${randomCharacters}.webp`;\n }\n\n private setSettingsForComponent(): void {\n const imgStorageSettings = this.imgStorageSettings();\n console.log('setSettingsForComponent', imgStorageSettings);\n // TODO: remove all the imageSettings and keep only imgStorageSettings\n\n this.aspectRatioValue = imgStorageSettings?.cropSettings?.aspectRatio\n ? AspectRatio[imgStorageSettings?.cropSettings?.aspectRatio]\n : AspectRatio[AspectType.Square];\n\n if (imgStorageSettings?.path) {\n this.storagePath = `${imgStorageSettings.path}/${imgStorageSettings.fileName}.webp`;\n } else if (imgStorageSettings.path) {\n this.storagePath = `${imgStorageSettings.path}/${imgStorageSettings.fileName}.webp`;\n }\n if (imgStorageSettings?.cropSettings?.resizeToWidth) {\n this.resizeToWidth = imgStorageSettings.cropSettings.resizeToWidth;\n } else if (imgStorageSettings.cropSettings.resizeToWidth) {\n this.resizeToWidth = imgStorageSettings.cropSettings.resizeToWidth;\n }\n if (imgStorageSettings?.fileName) {\n this.renameFile = imgStorageSettings.fileName;\n } else if (imgStorageSettings.fileName) {\n this.renameFile = imgStorageSettings.fileName;\n }\n }\n\n async fileChangeEvent(event: any) {\n this.setSettingsForComponent();\n\n console.log(this.fileInputId);\n\n this.imageChangedEvent = event;\n const file = event?.target?.files[0];\n if (file) {\n this.fileMetadata = file;\n this.onFileSelected.emit(file);\n this.renameFile = this.fileMetadata?.name\n ?.split('.')[0]\n .replace(/[^a-zA-Z0-9]/g, '')\n .slice(0, 80);\n\n console.log(this.renameFile);\n\n if (!this.imgStorageSettings().fileName) {\n this.reloadPath();\n }\n this.displayDialog = true;\n this.changeDetectorRef.detectChanges();\n }\n }\n\n onInnerImageCropped(event: ImageCroppedEvent) {\n this.croppedImage = event.base64;\n }\n\n imageLoaded(image: LoadedImage) {\n this.changeDetectorRef.detectChanges();\n }\n\n cropperReady() {\n this.changeDetectorRef.detectChanges();\n }\n\n loadImageFailed() {\n console.error('fallo al cargar la imagen');\n }\n\n public async simpleCropAndUpload() {\n console.log(this.fileInputId);\n\n console.log('simpleCropAndUpload');\n const imageCropped: any = await this.imageCropper.crop();\n const imgStorage = await this.multiImagesStorageService.uploadImage(imageCropped?.blob, this.storagePath);\n\n const path = extractPath(this.currentStorage);\n\n if (path) {\n console.warn('deleting current Image', path);\n\n this.multiImagesStorageService.deleteImage(path);\n }\n console.log('imgStorage', imgStorage);\n this.imageUploaded.emit(imgStorage);\n this.displayDialog = false;\n this.changeDetectorRef.detectChanges();\n }\n\n public changeRatio(event: AspectRatioOption) {\n console.log('changeRatio', event);\n // this.imgStorageSettings.cropSettings.aspectRatio = event.valueRatio;\n this.aspectRatioValue = event.valueRatio;\n this.changeDetectorRef.detectChanges();\n }\n}\n","<div class=\"upload-section\">\n <input type=\"file\" [id]=\"fileInputId\" class=\"file-input\" (change)=\"fileChangeEvent($event)\" />\n <label pButton [for]=\"fileInputId\" [pTooltip]=\"storagePath\" class=\"upload-button\">\n {{ buttonLabel() }}\n </label>\n</div>\n@if(displayDialog) {\n<!-- Cropper Dialog -->\n\n<p-dialog header=\"Recortar imagen\" [(visible)]=\"displayDialog\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\" styleClass=\"cropper-dialog\">\n <!-- Image Settings Section -->\n <div class=\"settings-section\">\n @if(!imgStorageSettings().path) {\n <p-message severity=\"warn\">Developer Note: make sure you have a path to save the image pass object imgStorageSettings</p-message>\n } @if(currentStorage?.url) {\n\n <p-message severity=\"warn\" variant=\"outlined\">\n <div>\n <span class=\"setting-label\">Image will be replaced:</span>\n <img width=\"100\" height=\"Auto\" [src]=\"currentStorage?.url\" />\n </div>\n </p-message>\n\n }\n\n <p-message>\n <b>Estas opciones estan preconfiguradas y no se pueden cambiar</b>\n\n <ul>\n <li> <b>Path to save:</b> {{ storagePath }}< </li>\n <li>\n <b>Resoluciones:</b>\n <span>{{ imgStorageSettings()?.cropSettings?.resolutions }}</span>\n </li>\n </ul>\n </p-message>\n\n <div class=\"setting-item\">\n <span class=\"setting-label\">Aspecto:</span>\n <p class=\"setting-value\">{{ imgStorageSettings()?.cropSettings?.aspectRatio }}</p>\n </div>\n\n <p-select\n [options]=\"aspectRatioOptions\"\n [ngModel]=\"ratioSelected\"\n (ngModelChange)=\"changeRatio($event)\"\n optionLabel=\"description\"\n placeholder=\"Select a ratio\" />\n\n <!-- File Metadata Section -->\n @if (fileMetadata) {\n <div class=\"metadata-section\">\n <span class=\"metadata-item\">tipo: {{ fileMetadata.type }}</span>\n <span class=\"metadata-item\">tamaño: {{ fileMetadata.size }}</span>\n </div>\n }\n\n <!-- Rename Input -->\n <input\n pInputText\n [disabled]=\"imgStorageSettings()?.fileName\"\n [(ngModel)]=\"renameFile\"\n type=\"text\"\n placeholder=\"Rename File\"\n (ngModelChange)=\"reloadPath()\"\n class=\"rename-input\" />\n </div>\n\n <!-- Image Cropper -->\n\n <div class=\"cropper-container-father\">\n <image-cropper\n [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [aspectRatio]=\"aspectRatioValue\"\n format=\"webp\"\n [resizeToWidth]=\"resizeToWidth\"\n (imageCropped)=\"onInnerImageCropped($event)\"\n (loadImageFailed)=\"loadImageFailed()\"\n (cropperReady)=\"cropperReady()\"\n [autoCrop]=\"false\">\n </image-cropper>\n </div>\n <!-- Dialog Footer -->\n <ng-template pTemplate=\"footer\">\n <div class=\"dialog-footer\">\n <button pButton class=\"p-button-primary\" (click)=\"simpleCropAndUpload()\"> Recortar y Subir </button>\n </div>\n </ng-template>\n</p-dialog>\n}\n","import { Component, OnInit, OnDestroy, inject, output } from '@angular/core';\nimport { AngularFireStorage } from '@angular/fire/compat/storage';\nimport { getStorage, ref, listAll, getDownloadURL } from 'firebase/storage';\nimport { BehaviorSubject, Subscription } from 'rxjs';\nimport { AspectType, ImgStorageData, ResolutionType, StorageImageSettings } from '../../classes/storage.models';\nimport { AsyncPipe } from '@angular/common';\nimport { CropperComponentModal } from '../cropper-modal/cropper-modal.component';\n\n@Component({\n selector: 'dc-image-storage-preview',\n templateUrl: './image-storage-preview.html',\n styleUrls: ['./image-storage-preview.css'],\n standalone: true,\n imports: [AsyncPipe, CropperComponentModal],\n})\nexport class ImageStoragePreviewComponent implements OnInit, OnDestroy {\n private storage = inject(AngularFireStorage);\n\n readonly imageSelected = output<ImgStorageData>();\n public images$ = new BehaviorSubject<ImgStorageData[]>([]);\n public loading$ = new BehaviorSubject<boolean>(false);\n public error$ = new BehaviorSubject<string | null>(null);\n\n public readonly storagePath = '/images/resources';\n private subscriptions: Subscription[] = [];\n\n /** Inserted by Angular inject() migration for backwards compatibility */\n constructor(...args: unknown[]);\n\n constructor() {}\n\n ngOnInit(): void {\n this.loadImagesFromStorage();\n }\n\n public imgStorageSettings: StorageImageSettings = {\n path: this.storagePath,\n cropSettings: {\n aspectRatio: AspectType.Square,\n resolutions: [ResolutionType.Small],\n },\n };\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((sub) => sub.unsubscribe());\n }\n\n /**\n * Loads images from Firebase Storage at the specified path\n */\n private async loadImagesFromStorage(): Promise<void> {\n try {\n this.loading$.next(true);\n this.error$.next(null);\n\n const storage = getStorage();\n const storageRef = ref(storage, this.storagePath);\n\n const result = await listAll(storageRef);\n\n if (result.items.length === 0) {\n this.images$.next([]);\n this.loading$.next(false);\n return;\n }\n\n const imagePromises = result.items.map(async (itemRef) => {\n try {\n const url = await getDownloadURL(itemRef);\n const image: ImgStorageData = {\n url,\n // fullPath: itemRef.fullPath,\n name: itemRef.name,\n };\n return image;\n } catch (error) {\n console.error(`Error getting download URL for ${itemRef.fullPath}:`, error);\n return null;\n }\n });\n\n const images = (await Promise.all(imagePromises)).filter((img) => img !== null) as ImgStorageData[];\n this.images$.next(images);\n } catch (error) {\n console.error('Error loading images from storage:', error);\n this.error$.next('Failed to load images from storage. Please try again later.');\n } finally {\n this.loading$.next(false);\n }\n }\n\n /**\n * Refreshes the image list\n */\n public refreshImages(): void {\n this.loadImagesFromStorage();\n }\n\n public selectImage(image: ImgStorageData): void {\n this.imageSelected.emit(image);\n }\n}\n","<div class=\"image-storage-preview-container\">\n <div class=\"header\">\n <h2>Storage Images</h2>\n <button class=\"refresh-btn\" (click)=\"refreshImages()\" [disabled]=\"loading$ | async\">\n @if (!(loading$ | async)) {\n <span>Refresh</span>\n }\n @if (loading$ | async) {\n <span>Loading...</span>\n }\n </button>\n </div>\n\n @if (loading$ | async) {\n <div class=\"loading-container\">\n <div class=\"spinner\"></div>\n <p>Loading images...</p>\n </div>\n }\n\n @if (error$ | async) {\n <div class=\"error-container\">\n <p class=\"error-message\">{{ error$ | async }}</p>\n <button (click)=\"refreshImages()\">Try Again</button>\n </div>\n }\n\n @if (!(loading$ | async) && !(error$ | async)) {\n <div class=\"images-grid\">\n @if ((images$ | async)?.length) {\n @for (image of images$ | async; track image) {\n <div class=\"image-card\">\n <div class=\"image-container\">\n <img [src]=\"image.url\" [alt]=\"image.name || 'Storage image'\" loading=\"lazy\" />\n </div>\n <div class=\"image-info\">\n <p class=\"image-name\" [title]=\"image.name\">{{ image.name }}</p>\n <div class=\"image-actions\">\n <a [href]=\"image.url\" target=\"_blank\" class=\"action-btn\">View</a>\n <button (click)=\"selectImage(image)\" class=\"action-btn\">Select</button>\n </div>\n </div>\n </div>\n }\n } @else {\n <div class=\"no-images\">\n <p>No images found in the storage path: {{ storagePath }}</p>\n </div>\n }\n <dc-cropper-modal [imgStorageSettings]=\"imgStorageSettings\"></dc-cropper-modal>\n </div>\n }\n</div>\n","import { Component, inject, input, output, signal } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { ButtonModule } from 'primeng/button';\nimport { MultiImagesStorageService } from '../../services/multi-images-storage.service';\nimport { FileStorageData } from '../../classes/storage.models';\nimport { TooltipModule } from 'primeng/tooltip';\n\n@Component({\n selector: 'dc-simple-uploader',\n templateUrl: './simple-uploader.component.html',\n styleUrls: ['./simple-uploader.component.scss'],\n standalone: true,\n imports: [CommonModule, FormsModule, ButtonModule, TooltipModule],\n})\nexport class SimpleUploaderComponent {\n private multiImagesStorageService = inject(MultiImagesStorageService);\n\n storagePath = input.required<string>();\n buttonLabel = input<string>('Upload File');\n accept = input<string>('*/*');\n disabled = input<boolean>(false);\n\n fileUploaded = output<FileStorageData>();\n uploadError = output<any>();\n\n isLoading = signal(false);\n fileInputId: string;\n\n constructor() {\n this.fileInputId = `file-upload-${Math.random().toString(36).substring(2, 11)}`;\n }\n\n triggerFileInputClick(fileInput: HTMLInputElement): void {\n fileInput.click();\n }\n\n async onFileSelected(event: Event): Promise<void> {\n const fileInput = event.target as HTMLInputElement;\n const file = fileInput.files?.[0];\n\n if (file) {\n this.isLoading.set(true);\n try {\n const result = await this.multiImagesStorageService.uploadGenericFile(file, this.storagePath());\n if (result) {\n this.fileUploaded.emit(result);\n } else {\n // This case might occur if the service's uploadGenericFile returns null without throwing an error\n this.uploadError.emit({ error: 'Upload failed and no specific error was provided by the service.' });\n }\n } catch (error) {\n console.error('Error during file upload in SimpleUploaderComponent:', error);\n this.uploadError.emit(error);\n } finally {\n this.isLoading.set(false);\n // Reset file input to allow uploading the same file again if needed\n fileInput.value = '';\n }\n }\n }\n}\n","<input #fileInput type=\"file\" [id]=\"fileInputId\" (change)=\"onFileSelected($event)\" [accept]=\"accept()\" style=\"display: none\" />\n<p-button\n size=\"large\"\n [label]=\"buttonLabel()\"\n (click)=\"triggerFileInputClick(fileInput)\"\n [loading]=\"isLoading()\"\n [disabled]=\"disabled() || isLoading()\"\n pTooltip=\"Un vídeo que muestre la imagen principal animada\"></p-button>\n","import { Injectable, inject } from '@angular/core';\nimport { getDownloadURL, ref, Storage } from '@angular/fire/storage';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DCFilesCacheService {\n private storage = inject(Storage);\n\n /** Inserted by Angular inject() migration for backwards compatibility */\n constructor(...args: unknown[]);\n\n constructor() {}\n\n public files: { [key: string]: string } = {};\n\n public async getURLSrcFile(path: string): Promise<string> {\n if (path in this.files) {\n return this.files[path];\n } else {\n const url = await getDownloadURL(ref(this.storage, path));\n const localUrl = await this.donwloadFileAndGetLocalURL(url);\n this.files[path] = localUrl;\n return localUrl;\n }\n }\n\n public getBlob(url: string): Promise<Blob> {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.responseType = 'blob';\n xhr.overrideMimeType('audio/mp3');\n\n xhr.onload = (event) => {\n var blob = xhr.response;\n resolve(blob);\n };\n xhr.onerror = (event) => {\n reject(event);\n };\n\n xhr.open('GET', url);\n xhr.send();\n });\n }\n\n public async donwloadFileAndGetLocalURL(url: string) {\n const blob = await this.getBlob(url);\n\n return URL.createObjectURL(blob);\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { AngularFireStorage, AngularFireUploadTask } from '@angular/fire/compat/storage';\nimport { getDownloadURL, getStorage, deleteObject, listAll, StorageReference } from '@angular/fire/storage';\nimport { ref } from 'firebase/storage';\nimport { lastValueFrom } from 'rxjs';\n\n/**\n * Represents the metadata of an object stored in Firebase Storage.\n */\nexport interface ObjectStorageData {\n /** The download URL of the stored object. */\n url: string;\n /** The full path of the object in the storage bucket (e.g., 'folder/subfolder/file.txt'). */\n path: string;\n /** The name of the Firebase Storage bucket where the object is stored. */\n bucket: string;\n /** The name of the object file (e.g., 'file.txt'). */\n name?: string;\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MultiObjectStorageService {\n private storage = inject(AngularFireStorage);\n\n /**\n * Uploads a Blob or File object to a specified path in Firebase Storage.\n * @param objectToUpload The Blob or File to upload.\n * @param path The desired storage path (e.g., 'documents/report.pdf').\n * @returns A promise that resolves with the storage metadata of the uploaded object.\n * @throws Throws an error if the upload fails.\n */\n public async uploadObject(objectToUpload: Blob | File, path: string): Promise<ObjectStorageData> {\n try {\n const refStorage = this.storage.ref(path);\n const task = await refStorage.put(objectToUpload);\n const { fullPath, bucket, name } = task.metadata;\n const url = await lastValueFrom(refStorage.getDownloadURL());\n const storageData: ObjectStorageData = { url, path: fullPath, bucket, name };\n return storageData;\n } catch (error) {\n console.error(`Error uploading object to path \"${path}\": `, error);\n // Re-throw the error to allow calling code to handle it\n throw error;\n }\n }\n\n /**\n * Deletes all objects within a specified directory path in Firebase Storage.\n * WARNING: Use with extreme caution as this will permanently delete all files in the directory.\n * @param directoryPath The path to the directory to delete (e.g., 'users/userId/files/').\n * @returns A promise that resolves when the deletion attempt is complete.\n */\n public async deleteDirectory(directoryPath: string): Promise<void> {\n const storage = getStorage();\n const directoryRef = ref(storage, directoryPath);\n\n try {\n const res = await listAll(directoryRef);\n const deletePromises: Promise<void>[] = [];\n res.items.forEach((itemRef: StorageReference) => {\n console.log(`Deleting object: ${itemRef.fullPath}`);\n deletePromises.push(deleteObject(itemRef));\n });\n // You might want to handle potential errors during individual deletions if needed\n await Promise.all(deletePromises);\n console.log(`Successfully deleted objects in directory: ${directoryPath}`);\n } catch (error) {\n console.error(`Error deleting objects in directory \"${directoryPath}\":`, error);\n // Optionally re-throw or handle the error appropriately\n throw error;\n }\n }\n\n /**\n * Deletes a single object from Firebase Storage based on its full path.\n * @param objectPath The full path of the object to delete (e.g., 'images/profile.jpg').\n * @returns A promise that resolves when the deletion is complete.\n */\n public async deleteObjectByPath(objectPath: string): Promise<void> {\n const storageRef = this.storage.ref(objectPath);\n try {\n await lastValueFrom(storageRef.delete());\n console.log(`Object deleted successfully: ${objectPath}`);\n } catch (error) {\n console.error(`Error deleting object at path \"${objectPath}\":`, error);\n // Optionally re-throw or handle the error appropriately\n throw error;\n }\n }\n\n /**\n * Private helper to get metadata after an upload task completes.\n * @param task The AngularFireUploadTask.\n * @returns A promise resolving with the object's storage metadata.\n */\n private async uploadAndGetObjectMetadata(task: AngularFireUploadTask): Promise<ObjectStorageData> {\n const snap = await task;\n const { fullPath, bucket, name } = snap.metadata;\n const storage = getStorage();\n const storageRef = ref(storage, fullPath);\n const url = await getDownloadURL(storageRef);\n const meta: ObjectStorageData = {\n url,\n path: fullPath, // Use fullPath for the 'path' property\n bucket,\n name,\n };\n return meta;\n }\n}\n","import { Component, input, output, computed, inject } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { IAssetable } from '../../models/assetable.model';\nimport { AspectType, ResolutionType, StorageImageSettings, CloudStorageData, extractPath } from '../../classes/storage.models';\nimport { CropperComponentModal } from '../cropper-modal/cropper-modal.component';\nimport { MultiImagesStorageService } from '../../services/multi-images-storage.service';\nimport { SimpleUploaderComponent } from '../simple-uploader/simple-uploader.component';\nimport { ButtonModule } from 'primeng/button';\nimport { MessageModule } from 'primeng/message';\n\n@Component({\n selector: 'assets-loader',\n templateUrl: './csa-assets-loader.component.html',\n styleUrls: ['./csa-assets-loader.component.scss'],\n standalone: true,\n imports: [CommonModule, CropperComponentModal, SimpleUploaderComponent, ButtonModule, MessageModule],\n})\nexport class CsaAssetsLoaderComponent {\n assets = input.required<IAssetable>();\n storagePath = input.required<string>();\n assetsChange = output<IAssetable>();\n assetUpdate = output<{ assets: Partial<IAssetable> }>();\n onFileSelected = output<File>();\n\n private storageService = inject(MultiImagesStorageService);\n\n public bannerImgSettings = computed<StorageImageSettings>(() => ({\n path: this.storagePath(),\n fileName: undefined,\n cropSettings: { aspectRatio: AspectType.Rectangle, resolutions: [ResolutionType.MediumLarge], resizeToWidth: 700 },\n }));\n\n public imageStorageSettings = computed<StorageImageSettings>(() => ({\n path: this.storagePath(),\n fileName: undefined,\n cropSettings: { aspectRatio: AspectType.Vertical_2_3, resolutions: [ResolutionType.MediumLarge], resizeToWidth: 500 },\n }));\n\n public stickerStorageSettings = computed<StorageImageSettings>(() => ({\n path: `${this.storagePath()}/stickers`,\n fileName: undefined,\n cropSettings: { aspectRatio: AspectType.Square, resolutions: [ResolutionType.MediumLarge], resizeToWidth: 400 },\n }));\n\n public onImageUploaded(event: CloudStorageData, type: 'image' | 'banner' | 'sticker' = 'image') {\n const currentAssets = this.assets() ?? { image: null, banner: null, stickers: [] };\n let updatedField: Partial<IAssetable>;\n\n switch (type) {\n case 'image':\n updatedField = { image: event };\n break;\n case 'banner':\n updatedField = { banner: event };\n break;\n case 'sticker':\n updatedField = { stickers: [...(currentAssets.stickers || []), event] };\n break;\n }\n\n const newAssets = { ...currentAssets, ...updatedField };\n this.assetUpdate.emit({ assets: updatedField });\n this.assetsChange.emit(newAssets);\n }\n\n public onMotionUploaded(event: CloudStorageData) {\n if (!event.url) return;\n\n const currentMotionUrl = this.assets()?.motion?.url;\n if (currentMotionUrl) {\n this.storageService.deleteImage(currentMotionUrl);\n }\n\n const updatedField = { motion: { url: event.url } };\n const newAssets = { ...this.assets(), ...updatedField };\n\n this.assetUpdate.emit({ assets: updatedField });\n this.assetsChange.emit(newAssets);\n }\n\n public removeSticker(sticker: CloudStorageData) {\n const path = extractPath(sticker);\n if (path) {\n this.storageService.deleteImage(path);\n }\n\n const currentStickers = this.assets()?.stickers ?? [];\n const updatedStickers = currentStickers.filter((s) => s.url !== sticker.url);\n const updatedField = { stickers: updatedStickers };\n const newAssets = { ...this.assets(), ...updatedField };\n\n this.assetUpdate.emit({ assets: updatedField });\n this.assetsChange.emit(newAssets);\n }\n}\n","<div class=\"assets-container\">\n <div class=\"assets-card\">\n <p-message severity=\"info\">\n <div class=\"upload-buttons\">\n <dc-simple-uploader\n [buttonLabel]=\"'Agregar movimiento'\"\n (fileUploaded)=\"onMotionUploaded($event)\"\n [storagePath]=\"storagePath() + '/movimientos/file'\"\n [accept]=\"'video/*'\"></dc-simple-uploader>\n\n <dc-cropper-modal\n #cropperBanner\n id=\"cropperBanner\"\n [buttonLabel]=\"assets()?.banner?.url ? 'Cambiar el banner' : 'Cargar un banner'\"\n [imgStorageSettings]=\"bannerImgSettings()\"\n [currentStorage]=\"assets()?.banner\"\n (imageUploaded)=\"onImageUploaded($event, 'banner')\"></dc-cropper-modal>\n\n <dc-cropper-modal\n id=\"cropperStickers\"\n #cropperStickers\n [buttonLabel]=\"'agregar sticker'\"\n [imgStorageSettings]=\"stickerStorageSettings()\"\n (imageUploaded)=\"onImageUploaded($event, 'sticker')\"></dc-cropper-modal>\n\n <div>\n <dc-cropper-modal\n id=\"cropperCardImage\"\n #cropperCardImage\n [buttonLabel]=\"assets()?.image?.url ? 'Cambiar imagen' : 'Cargar una imagen'\"\n [imgStorageSettings]=\"imageStorageSettings()\"\n [currentStorage]=\"assets()?.image\"\n (imageUploaded)=\"onImageUploaded($event, 'image')\"\n (onFileSelected)=\"onFileSelected.emit($event)\"></dc-cropper-modal>\n </div>\n </div>\n </p-message>\n <!-- Banner -->\n\n <div class=\"preview-container\">\n <img [src]=\"assets()?.banner?.url || 'assets/defaults/images/default_banner.webp'\" class=\"main-banner-image-card\" />\n <img [src]=\"assets()?.image?.url || 'assets/defaults/images/default_2_3.webp'\" class=\"main-image-card\" />\n <video class=\"main-motion-card\" [src]=\"assets()?.motion?.url\" autoplay loop muted playsinline></video>\n </div>\n\n <div class=\"stickers-container\">\n @for (sticker of assets()?.stickers; track sticker.url) {\n <div class=\"sticker-wrapper\">\n <img width=\"100\" [src]=\"sticker.url\" alt=\"\" />\n <p-button (click)=\"removeSticker(sticker)\" class=\"remove-sticker\" icon=\"pi pi-times\" [rounded]=\"true\" [text]=\"true\" severity=\"danger\" />\n </div>\n }\n </div>\n </div>\n</div>\n","/*\n * Public API Surface of storage-uploader\n */\n\nexport * from './lib/components/cropper/cropper.component';\nexport * from './lib/components/cropper-modal/cropper-modal.component';\nexport * from './lib/components/image-storage-preview/image-storage-preview';\nexport * from './lib/components/simple-uploader/simple-uploader.component';\nexport * from './lib/classes/storage.models';\n\n// Services\nexport * from './lib/services/multi-images-storage.service';\nexport * from './lib/services/dc-files-cache.service';\nexport * from './lib/services/multi-object-storage.service';\n\n// Components\nexport * from './lib/components/assets-loader/csa-assets-loader.component';\nexport * from './lib/models/assetable.model';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i2","getStorage","listAll","getDownloadURL","i1","ref"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAgDa,MAAA,kBAAkB,GAAwB;AACrD,IAAA,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE;AACjF,IAAA,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE;AACzF,IAAA,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE;AACzF,IAAA,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE;AACzF,IAAA,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE;AACzF,IAAA,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,iBAAiB,EAAE,UAAU,EAAE,CAAC,GAAG,EAAE,EAAE;AAC7F,IAAA,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE;AAC7F,IAAA,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,gBA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A,EAAA,CAAA,CAAA;;2FAExF,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAPpC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAGb,UAAA,EAAA,IAAI,EACP,OAAA,EAAA,CAAC,YAAY,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,YAAY,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,i3EAAA,EAAA,MAAA,EAAA,CAAA,0hCAAA,CAAA,EAAA;;;AEftG;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"dataclouder-ngx-cloud-storage.mjs","sources":["../../../../projects/dataclouder/ngx-cloud-storage/src/lib/classes/storage.models.ts","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/services/multi-images-storage.service.ts","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/components/cropper/cropper.component.ts","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/components/cropper/cropper.component.html","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/components/cropper-modal/cropper-modal.component.ts","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/components/cropper-modal/cropper-modal.component.html","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/components/image-storage-preview/image-storage-preview.ts","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/components/image-storage-preview/image-storage-preview.html","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/components/simple-uploader/simple-uploader.component.ts","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/components/simple-uploader/simple-uploader.component.html","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/services/dc-files-cache.service.ts","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/services/multi-object-storage.service.ts","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/components/assets-loader/assets-loader.ts","../../../../projects/dataclouder/ngx-cloud-storage/src/lib/components/assets-loader/assets-loader.html","../../../../projects/dataclouder/ngx-cloud-storage/src/public-api.ts","../../../../projects/dataclouder/ngx-cloud-storage/src/dataclouder-ngx-cloud-storage.ts"],"sourcesContent":["export interface CloudStorageData {\n url: string;\n}\n\nexport interface FileStorageData extends CloudStorageData {\n name?: string; // File name in storage, e.g., 'report.pdf'\n type?: string; // MIME type, e.g., 'application/pdf'\n size?: number; // File size in bytes\n metadata?: any;\n}\n\nexport interface ImgStorageData extends FileStorageData {\n resolution?: string;\n resolutions?: { [key: string]: string };\n}\n\nexport interface ImgGeneratedStorageData extends ImgStorageData {\n model?: string;\n prompt?: string;\n}\n\n// Use as input for uploadImage\nexport interface StorageImageSettings {\n path?: string;\n fileName?: string;\n cropSettings?: ImageCropSettings;\n}\n\nexport interface ImageCropSettings {\n resizeToWidth?: number;\n resolutions: Array<number>; // 400, 800, 1200, 1600\n aspectRatio: AspectType;\n}\n\nexport interface CropImageSettings {\n // Resolutions should be here.\n path: string;\n fileName?: string;\n resizeToWidth?: number;\n}\n\nexport interface ImageMultipleCrops {\n file: File;\n defaultImageBlob?: Blob;\n imagesBlobs: { [resolution: number]: Blob };\n settings: { renameFile: string; width?: number };\n}\n\nexport const AspectRatioOptions: AspectRatioOption[] = [\n { value: '1:1', label: 'square', description: 'Square (1:1)', valueRatio: 1 / 1 },\n { value: '1:2', label: 'vertical_1_2', description: 'Vertical (1:2)', valueRatio: 1 / 2 },\n { value: '2:3', label: 'vertical_2_3', description: 'Vertical (2:3)', valueRatio: 2 / 3 },\n { value: '3:4', label: 'vertical_3_4', description: 'Vertical (3:4)', valueRatio: 3 / 4 },\n { value: '4:5', label: 'vertical_4_5', description: 'Vertical (4:5)', valueRatio: 4 / 5 },\n { value: '9:16', label: 'vertical_9_16', description: 'Vertical (9:16)', valueRatio: 9 / 16 },\n { value: '2:1', label: 'horizontal_2_1', description: 'Horizontal (2:1)', valueRatio: 2 / 1 },\n { value: '3:2', label: 'horizontal_3_2', description: 'Horizontal (3:2)', valueRatio: 3 / 2 },\n { value: '4:3', label: 'horizontal_4_3', description: 'Horizontal (4:3)', valueRatio: 4 / 3 },\n { value: '5:4', label: 'horizontal_5_4', description: 'Horizontal (5:4)', valueRatio: 5 / 4 },\n { value: '16:9', label: 'horizontal_16_9', description: 'Horizontal (16:9)', valueRatio: 16 / 9 },\n];\n\nexport interface AspectRatioOption {\n label: string;\n description: string;\n value: string;\n valueRatio: number;\n}\n\nexport enum AspectType {\n Square = 'square',\n Rectangle = 'rectangle',\n Banner = 'banner',\n RectangleLarge = 'rectangleLarge',\n Vertical_9_16 = 'vertical_9_16',\n Vertical_3_5 = 'vertical_3_5',\n Vertical_2_3 = 'vertical_2_3',\n}\n\n// Creo que seria bueno refactorizar para solo enviar aspect ratio asi\nexport enum AspectRatio2 {\n // Vertical\n '9:16' = 16 / 9,\n '3:5' = 3 / 5,\n '5:8' = 5 / 8,\n '2:3' = 2 / 3,\n '1:1' = 1 / 1,\n}\n\nexport enum ResolutionType {\n Small = 200,\n Medium = 400,\n MediumLarge = 800,\n Large = 1200,\n VeryLarge = 1600,\n}\n\nexport const AspectRatio = {\n [AspectType.Square]: 1 / 1,\n [AspectType.Rectangle]: 16 / 9,\n [AspectType.Vertical_9_16]: 9 / 16,\n [AspectType.RectangleLarge]: 16 / 8,\n [AspectType.Banner]: 16 / 7,\n [AspectType.Vertical_3_5]: 3 / 5,\n [AspectType.Vertical_2_3]: 2 / 3,\n};\n\nexport const DEFAULT_SETTINGS: StorageImageSettings = {\n path: '/default-collection/id/please-change-this-subcollection',\n fileName: 'image',\n cropSettings: {\n aspectRatio: AspectType.Square,\n resolutions: [ResolutionType.Small, ResolutionType.MediumLarge],\n resizeToWidth: 450,\n },\n};\n\nconst FIREBASE_STORAGE_URL_REGEX = /https:\\/\\/firebasestorage\\.googleapis\\.com\\/v0\\/b\\/([^/]+)\\/o\\/([^?]+)/;\n\n/**\n * Extracts the bucket name from a Firebase Storage URL.\n * The URL is expected to follow the pattern:\n * 'https://firebasestorage.googleapis.com/v0/b/&lt;bucket&gt;/&lt;path&gt;?&lt;query_params&gt;'\n *\n * @param data The CloudStorageData object containing the 'url' property.\n * @returns The bucket name (e.g., 'appingles-pro.appspot.com') or undefined if not found or URL is invalid.\n */\nexport function extractBucket(data: CloudStorageData): string | undefined {\n if (!data.url) {\n return undefined;\n }\n const match = data.url.match(FIREBASE_STORAGE_URL_REGEX);\n // match[0] is the full matched string\n // match[1] is the first capturing group (bucket)\n // match[2] is the second capturing group (path)\n return match?.[1];\n}\n\n/**\n * Extracts the file path from a Firebase Storage URL.\n * The URL is expected to follow the pattern:\n * 'https://firebasestorage.googleapis.com/v0/b/&lt;bucket&gt;/&lt;path&gt;?&lt;query_params&gt;'\n * The extracted path is the part after the bucket and before any query parameters.\n *\n * @param data The CloudStorageData object containing the 'url' property.\n * @returns The file path (e.g., 'scenarios/666506c3b9b5443f4bfab5e0/images/hairdresser.webp')\n * or undefined if not found or URL is invalid.\n * Note: This function does not perform URL decoding on the path. If URL-decoded paths\n * (e.g., converting %2F to /) are needed, `decodeURIComponent` should be applied to the result.\n */\nexport function extractPath(data: CloudStorageData): string | undefined {\n if (data && data?.url) {\n const match = data.url.match(FIREBASE_STORAGE_URL_REGEX);\n // match[0] is the full matched string\n // match[1] is the first capturing group (bucket)\n // match[2] is the second capturing group (path after 'o/')\n if (match && match[2]) {\n try {\n // Decode URI components, e.g., %2F to /\n return decodeURIComponent(match[2]);\n } catch (e) {\n // Log error if decoding fails.\n // Returning the raw path component as a fallback.\n // Consider if undefined or throwing an error would be more appropriate for your use case.\n console.error(`Failed to decode URI component for path: '${match[2]}'`, e);\n return match[2]; // Fallback to raw path component\n }\n }\n return undefined; // URL did not match expected pattern or path component missing\n } else {\n return undefined;\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { AngularFireStorage, AngularFireUploadTask } from '@angular/fire/compat/storage';\nimport { getDownloadURL, getStorage, deleteObject, listAll } from '@angular/fire/storage';\n\nimport { ref } from 'firebase/storage';\nimport { lastValueFrom } from 'rxjs';\nimport { ImageMultipleCrops, ImgStorageData, FileStorageData } from '../classes/storage.models';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MultiImagesStorageService {\n private storage = inject(AngularFireStorage);\n\n public async uploadImage(image: Blob, path: string): Promise<ImgStorageData> {\n try {\n const refStorage = this.storage.ref(path);\n const task = await refStorage.put(image);\n const { bucket, name: metadataName, contentType, size } = task.metadata;\n const url = await lastValueFrom(refStorage.getDownloadURL());\n const imageStorage: ImgStorageData = {\n url,\n name: metadataName,\n type: contentType,\n size,\n };\n return imageStorage;\n } catch (error) {\n console.error('uploading image error: ', error);\n return null;\n }\n }\n\n public async delete_directory(imagePath: string): Promise<void> {\n // WARNING!! user very carefully could delete whatever folder\n const storage = getStorage();\n const directoryRef = ref(storage, imagePath);\n\n listAll(directoryRef)\n .then((res) => {\n res.items.forEach((itemRef) => {\n console.log(itemRef);\n deleteObject(itemRef);\n });\n })\n .catch((error) => {\n console.error('error al eliminar imagenes de cloud storage', error);\n });\n }\n\n public async deleteImage(imagePath: string): Promise<void> {\n const storageRef = this.storage.ref(imagePath);\n storageRef.delete().subscribe((res) => {\n console.log('image deleted', res);\n });\n }\n\n private async uploadAndGetUrl(task: AngularFireUploadTask, resolution: string): Promise<ImgStorageData> {\n const snap = await task;\n const { fullPath, bucket, name, contentType, size } = snap.metadata;\n const storage = getStorage();\n const storageRef = ref(storage, fullPath);\n const url = await getDownloadURL(storageRef);\n const meta: ImgStorageData = {\n url,\n name,\n resolution,\n type: contentType,\n size,\n resolutions: {}, // Default empty resolutions\n };\n\n return meta;\n }\n\n public async uploadGenericFile(file: File, storagePath: string, metadata?: any): Promise<FileStorageData | null> {\n try {\n // Ensure storagePath is a directory path, and append file.name\n const fullFilePath = `${storagePath.replace(/\\/$/, '')}/${Date.now()}-${file.name}`;\n const refStorage = this.storage.ref(fullFilePath);\n const task = await refStorage.put(file, { customMetadata: metadata });\n const url = await lastValueFrom(refStorage.getDownloadURL());\n\n const fileData: FileStorageData = {\n url,\n name: file.name,\n type: file.type,\n size: file.size,\n metadata: task.metadata,\n };\n return fileData;\n } catch (error) {\n console.error(`Error uploading file ${file.name} to ${storagePath}:`, error);\n return null;\n }\n }\n}\n","import { Component, OnInit, ViewChild, inject, output, input } from '@angular/core';\nimport { ImageCroppedEvent, ImageCropperComponent, LoadedImage, base64ToFile } from 'ngx-image-cropper';\nimport { Observable } from 'rxjs';\nimport { AspectRatio, AspectType, ImageMultipleCrops, CropImageSettings, ResolutionType } from '../../classes/storage.models';\n\nimport { FormsModule } from '@angular/forms';\nimport { MultiImagesStorageService } from '../../services/multi-images-storage.service';\n\n@Component({\n selector: 'app-cropper',\n templateUrl: './cropper.component.html',\n styleUrls: ['./cropper.component.scss'],\n standalone: true,\n imports: [FormsModule, ImageCropperComponent],\n})\nexport class CropperComponent implements OnInit {\n private multiImagesStorageService = inject(MultiImagesStorageService);\n\n // overrides name, path and resizeToWidth\n readonly imageSettings = input<CropImageSettings>({} as any);\n readonly ratioType = input<AspectType | string>(AspectType.Square);\n readonly resolutions = input<Array<number>>([ResolutionType.MediumLarge]);\n // Outputs\n readonly imageUploaded = output<any>();\n readonly onImageCropped = output<ImageMultipleCrops>();\n readonly onFileSelected = output<any>();\n\n @ViewChild(ImageCropperComponent) imageCropper!: ImageCropperComponent;\n\n public fileMetadata: File | null = null;\n public imageChangedEvent!: Event;\n\n public aspectRatio: number = 1;\n\n public croppedImage: any = '';\n\n public isLoading = false;\n public isUploaded = false;\n public renameFile: any = '';\n public storagePath: string = '';\n public showModal = false;\n\n ngOnInit(): void {\n this.aspectRatio = AspectRatio[this.ratioType()];\n const imageSettings = this.imageSettings();\n if (imageSettings.path) {\n this.storagePath = `${imageSettings.path}/${imageSettings.fileName}.webp`;\n }\n }\n\n public reloadPath(): void {\n this.storagePath = `${this.imageSettings().path}/${this.renameFile}.webp`;\n }\n\n async fileChangeEvent(event: any) {\n this.imageChangedEvent = event;\n const file = event?.target?.files[0];\n if (file) {\n this.fileMetadata = file;\n this.onFileSelected.emit(file);\n this.showModal = true; // Show modal when file is selected\n this.renameFile = this.fileMetadata?.name?.split('.')[0];\n console.log(this.renameFile);\n\n if (!this.imageSettings().fileName) {\n this.reloadPath();\n }\n }\n }\n\n onInnerImageCropped(event: ImageCroppedEvent) {\n this.croppedImage = event.base64;\n }\n\n imageLoaded(image: LoadedImage) {\n // show cropper\n }\n\n loadImageFailed() {\n console.error('fallo al cargar la imagen');\n }\n\n public downloadURL!: Observable<string>;\n\n public async simpleCropAndUpload() {\n const imageCropped: any = await this.imageCropper.crop();\n const imgStorage = await this.multiImagesStorageService.uploadImage(imageCropped?.blob, this.storagePath);\n this.imageUploaded.emit(imgStorage);\n this.closeModal();\n }\n\n closeModal(): void {\n this.showModal = false;\n }\n}\n","<div> path: {{ storagePath }} </div>\n\n<div class=\"options\">\n @if (!isUploaded) {\n <div>\n <input type=\"file\" id=\"file-upload\" class=\"file-input\" (change)=\"fileChangeEvent($event)\" />\n <label for=\"file-upload\" class=\"btn-upload\">Seleccionar archivo</label>\n @if (!fileMetadata) {\n <em>Carga una imagen para comenzar</em>\n }\n </div>\n }\n\n @if (fileMetadata) {\n <span>\n <span style=\"margin: 1px 20px\"> tipo: {{ fileMetadata.type }} </span>\n <span style=\"margin: 1px 20px\"> tamaño {{ fileMetadata.size }} </span>\n <br />\n <input\n [disabled]=\"imageSettings()?.fileName\"\n style=\"margin: 1px 20px; width: 400px\"\n [(ngModel)]=\"renameFile\"\n type=\"text\"\n placeholder=\"Rename File\"\n (ngModelChange)=\"reloadPath()\" />\n <button class=\"btn-crop\" (click)=\"closeModal()\"> Recortar y Subir </button>\n </span>\n }\n</div>\n\n@if (fileMetadata && !isUploaded) {\n <div class=\"modal\" [class.show-modal]=\"showModal\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h3>Recortar imagen</h3>\n <button class=\"close-button\" (click)=\"closeModal()\">×</button>\n </div>\n <div class=\"modal-body\">\n <h1>Hlloa</h1>\n <image-cropper\n [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [aspectRatio]=\"aspectRatio\"\n format=\"webp\"\n [resizeToWidth]=\"450\"\n (imageCropped)=\"onInnerImageCropped($event)\"\n (loadImageFailed)=\"loadImageFailed()\"\n (imageLoaded)=\"imageLoaded($event)\"\n [autoCrop]=\"false\"></image-cropper>\n <div class=\"modal-footer\">\n <button class=\"btn-crop\" (click)=\"simpleCropAndUpload()\">Recortar y Subir</button>\n </div>\n </div>\n </div>\n </div>\n}\n\n@if (croppedImage && !isUploaded) {\n <button [disabled]=\"isLoading\" nbButton status=\"info\"> upload </button>\n}\n","import { Component, Input, OnInit, ViewChild, ChangeDetectorRef, inject, output, input } from '@angular/core';\n\nimport { FormsModule } from '@angular/forms';\n\nimport { DialogModule } from 'primeng/dialog';\n\nimport { ImageCroppedEvent, ImageCropperComponent, LoadedImage } from 'ngx-image-cropper';\nimport { Observable } from 'rxjs';\n\nimport { MultiImagesStorageService } from '../../services/multi-images-storage.service';\nimport {\n AspectRatio,\n AspectType,\n ImageMultipleCrops,\n StorageImageSettings,\n ImgStorageData,\n AspectRatioOptions,\n AspectRatioOption,\n DEFAULT_SETTINGS,\n extractPath,\n} from '../../classes/storage.models';\nimport { TooltipModule } from 'primeng/tooltip';\n\nimport { ButtonModule } from 'primeng/button';\nimport { MessageModule } from 'primeng/message';\nimport { SelectModule } from 'primeng/select';\nimport { InputTextModule } from 'primeng/inputtext';\nimport { MoodStateOptions } from '@dataclouder/ngx-core';\n\n@Component({\n selector: 'dc-cropper-modal',\n templateUrl: './cropper-modal.component.html',\n styleUrls: ['./cropper-modal.component.scss'],\n standalone: true,\n imports: [FormsModule, ImageCropperComponent, ButtonModule, DialogModule, TooltipModule, MessageModule, SelectModule, InputTextModule],\n})\nexport class CropperComponentModal implements OnInit {\n private multiImagesStorageService = inject(MultiImagesStorageService);\n private changeDetectorRef = inject(ChangeDetectorRef);\n\n // overrides name, path and resizeToWidth\n\n readonly imgStorageSettings = input<StorageImageSettings>(DEFAULT_SETTINGS);\n readonly buttonLabel = input<string>('Seleccionar archivo');\n @Input() currentStorage: ImgStorageData = {} as any;\n\n readonly imageUploaded = output<ImgStorageData>();\n readonly onImageCropped = output<ImageMultipleCrops>();\n readonly onFileSelected = output<any>();\n\n @ViewChild(ImageCropperComponent) imageCropper!: ImageCropperComponent;\n\n public aspectRatioOptions = AspectRatioOptions;\n public MoodStateOptions = MoodStateOptions;\n public fileMetadata: File | null = null;\n public imageChangedEvent!: Event;\n public displayDialog = false;\n public aspectRatioValue: number = 1;\n public croppedImage: any = '';\n public renameFile: any = '';\n public storagePath: string = '';\n public downloadURL!: Observable<string>;\n public resizeToWidth: number = 450;\n public ratioSelected: any = null;\n public emotionSelected: string | null = null;\n\n // Add a unique identifier for the file input\n public fileInputId: string;\n\n constructor() {\n // Generate random ID for file input\n this.fileInputId = `file-upload-${Math.random().toString(36).substring(2, 11)}`;\n }\n\n ngOnInit(): void {\n if (!this.imgStorageSettings().path) {\n console.warn('⚠️ Remember to set imgStorageSettings, path and fileName are required , path example: /collection/id/subcollection ');\n }\n\n this.reloadPath();\n }\n\n public reloadPath(): void {\n const randomCharacters = Math.random().toString(36).substring(2, 15);\n const fileName = this.imgStorageSettings().fileName || 'img';\n this.storagePath = `${this.imgStorageSettings().path}/${fileName}-${randomCharacters}.webp`;\n }\n\n private setSettingsForComponent(): void {\n const imgStorageSettings = this.imgStorageSettings();\n console.log('setSettingsForComponent', imgStorageSettings);\n // TODO: remove all the imageSettings and keep only imgStorageSettings\n\n this.aspectRatioValue = imgStorageSettings?.cropSettings?.aspectRatio\n ? AspectRatio[imgStorageSettings?.cropSettings?.aspectRatio]\n : AspectRatio[AspectType.Square];\n\n if (imgStorageSettings?.path) {\n this.storagePath = `${imgStorageSettings.path}/${imgStorageSettings.fileName}.webp`;\n } else if (imgStorageSettings.path) {\n this.storagePath = `${imgStorageSettings.path}/${imgStorageSettings.fileName}.webp`;\n }\n if (imgStorageSettings?.cropSettings?.resizeToWidth) {\n this.resizeToWidth = imgStorageSettings.cropSettings.resizeToWidth;\n } else if (imgStorageSettings.cropSettings.resizeToWidth) {\n this.resizeToWidth = imgStorageSettings.cropSettings.resizeToWidth;\n }\n if (imgStorageSettings?.fileName) {\n this.renameFile = imgStorageSettings.fileName;\n } else if (imgStorageSettings.fileName) {\n this.renameFile = imgStorageSettings.fileName;\n }\n }\n\n async fileChangeEvent(event: any) {\n this.setSettingsForComponent();\n\n console.log(this.fileInputId);\n\n this.imageChangedEvent = event;\n const file = event?.target?.files[0];\n if (file) {\n this.fileMetadata = file;\n this.onFileSelected.emit(file);\n this.renameFile = this.fileMetadata?.name\n ?.split('.')[0]\n .replace(/[^a-zA-Z0-9]/g, '')\n .slice(0, 80);\n\n console.log(this.renameFile);\n\n if (!this.imgStorageSettings().fileName) {\n this.reloadPath();\n }\n this.displayDialog = true;\n this.changeDetectorRef.detectChanges();\n }\n }\n\n onInnerImageCropped(event: ImageCroppedEvent) {\n this.croppedImage = event.base64;\n }\n\n imageLoaded(image: LoadedImage) {\n this.changeDetectorRef.detectChanges();\n }\n\n cropperReady() {\n this.changeDetectorRef.detectChanges();\n }\n\n loadImageFailed() {\n console.error('fallo al cargar la imagen');\n }\n\n public async simpleCropAndUpload() {\n console.log(this.fileInputId);\n\n console.log('simpleCropAndUpload');\n const imageCropped: any = await this.imageCropper.crop();\n const imgStorage = await this.multiImagesStorageService.uploadImage(imageCropped?.blob, this.storagePath);\n\n const path = extractPath(this.currentStorage);\n\n if (path) {\n console.warn('deleting current Image', path);\n\n this.multiImagesStorageService.deleteImage(path);\n }\n console.log('imgStorage', imgStorage);\n this.imageUploaded.emit({ ...imgStorage, metadata: this.emotionSelected });\n this.displayDialog = false;\n this.changeDetectorRef.detectChanges();\n }\n\n public changeRatio(event: AspectRatioOption) {\n console.log('changeRatio', event);\n // this.imgStorageSettings.cropSettings.aspectRatio = event.valueRatio;\n this.aspectRatioValue = event.valueRatio;\n this.changeDetectorRef.detectChanges();\n }\n\n public addEmotion(event: string) {\n // Will only log for now\n console.log('addEmotion', event);\n this.emotionSelected = event;\n }\n}\n","<div class=\"upload-section\">\n <input type=\"file\" [id]=\"fileInputId\" class=\"file-input\" (change)=\"fileChangeEvent($event)\" />\n <label pButton [for]=\"fileInputId\" [pTooltip]=\"storagePath\" class=\"upload-button\">\n {{ buttonLabel() }}\n </label>\n</div>\n@if(displayDialog) {\n<!-- Cropper Dialog -->\n\n<p-dialog header=\"Recortar imagen\" [(visible)]=\"displayDialog\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\" styleClass=\"cropper-dialog\">\n <!-- Image Settings Section -->\n <div class=\"settings-section\">\n @if(!imgStorageSettings().path) {\n <p-message severity=\"warn\">Developer Note: make sure you have a path to save the image pass object imgStorageSettings</p-message>\n } @if(currentStorage?.url) {\n\n <p-message severity=\"warn\" variant=\"outlined\">\n <div>\n <span class=\"setting-label\">Image will be replaced:</span>\n <img width=\"100\" height=\"Auto\" [src]=\"currentStorage?.url\" />\n </div>\n </p-message>\n\n }\n\n <p-message>\n <b>Estas opciones estan preconfiguradas y no se pueden cambiar</b>\n\n <ul>\n <li> <b>Path to save:</b> {{ storagePath }}< </li>\n <li>\n <b>Resoluciones:</b>\n <span>{{ imgStorageSettings()?.cropSettings?.resolutions }}</span>\n </li>\n </ul>\n </p-message>\n\n <div class=\"setting-item\">\n <span class=\"setting-label\">Aspecto:</span>\n <p class=\"setting-value\">{{ imgStorageSettings()?.cropSettings?.aspectRatio }}</p>\n </div>\n\n <p-select\n [options]=\"aspectRatioOptions\"\n [ngModel]=\"ratioSelected\"\n (ngModelChange)=\"changeRatio($event)\"\n optionLabel=\"description\"\n placeholder=\"Select a ratio\" />\n\n <!-- File Metadata Section -->\n @if (fileMetadata) {\n <div class=\"metadata-section\">\n <span class=\"metadata-item\">tipo: {{ fileMetadata.type }}</span>\n <span class=\"metadata-item\">tamaño: {{ fileMetadata.size }}</span>\n </div>\n }\n\n <!-- Rename Input -->\n <input\n pInputText\n [disabled]=\"imgStorageSettings()?.fileName\"\n [(ngModel)]=\"renameFile\"\n type=\"text\"\n placeholder=\"Rename File\"\n (ngModelChange)=\"reloadPath()\"\n class=\"rename-input\" />\n\n <h5>Datos adicionales</h5>\n\n <p-select\n [options]=\"MoodStateOptions\"\n [(ngModel)]=\"emotionSelected\"\n (ngModelChange)=\"addEmotion($event)\"\n optionLabel=\"label\"\n optionValue=\"value\"\n placeholder=\"Select an emotion\" />\n </div>\n\n <!-- Image Cropper -->\n\n <div class=\"cropper-container-father\">\n <image-cropper\n [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [aspectRatio]=\"aspectRatioValue\"\n format=\"webp\"\n [resizeToWidth]=\"resizeToWidth\"\n (imageCropped)=\"onInnerImageCropped($event)\"\n (loadImageFailed)=\"loadImageFailed()\"\n (cropperReady)=\"cropperReady()\"\n [autoCrop]=\"false\">\n </image-cropper>\n </div>\n <!-- Dialog Footer -->\n <ng-template pTemplate=\"footer\">\n <div class=\"dialog-footer\">\n <button pButton class=\"p-button-primary\" (click)=\"simpleCropAndUpload()\"> Recortar y Subir </button>\n </div>\n </ng-template>\n</p-dialog>\n}\n","import { Component, OnInit, OnDestroy, inject, output } from '@angular/core';\nimport { AngularFireStorage } from '@angular/fire/compat/storage';\nimport { getStorage, ref, listAll, getDownloadURL } from 'firebase/storage';\nimport { BehaviorSubject, Subscription } from 'rxjs';\nimport { AspectType, ImgStorageData, ResolutionType, StorageImageSettings } from '../../classes/storage.models';\nimport { AsyncPipe } from '@angular/common';\nimport { CropperComponentModal } from '../cropper-modal/cropper-modal.component';\n\n@Component({\n selector: 'dc-image-storage-preview',\n templateUrl: './image-storage-preview.html',\n styleUrls: ['./image-storage-preview.css'],\n standalone: true,\n imports: [AsyncPipe, CropperComponentModal],\n})\nexport class ImageStoragePreviewComponent implements OnInit, OnDestroy {\n private storage = inject(AngularFireStorage);\n\n readonly imageSelected = output<ImgStorageData>();\n public images$ = new BehaviorSubject<ImgStorageData[]>([]);\n public loading$ = new BehaviorSubject<boolean>(false);\n public error$ = new BehaviorSubject<string | null>(null);\n\n public readonly storagePath = '/images/resources';\n private subscriptions: Subscription[] = [];\n\n /** Inserted by Angular inject() migration for backwards compatibility */\n constructor(...args: unknown[]);\n\n constructor() {}\n\n ngOnInit(): void {\n this.loadImagesFromStorage();\n }\n\n public imgStorageSettings: StorageImageSettings = {\n path: this.storagePath,\n cropSettings: {\n aspectRatio: AspectType.Square,\n resolutions: [ResolutionType.Small],\n },\n };\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((sub) => sub.unsubscribe());\n }\n\n /**\n * Loads images from Firebase Storage at the specified path\n */\n private async loadImagesFromStorage(): Promise<void> {\n try {\n this.loading$.next(true);\n this.error$.next(null);\n\n const storage = getStorage();\n const storageRef = ref(storage, this.storagePath);\n\n const result = await listAll(storageRef);\n\n if (result.items.length === 0) {\n this.images$.next([]);\n this.loading$.next(false);\n return;\n }\n\n const imagePromises = result.items.map(async (itemRef) => {\n try {\n const url = await getDownloadURL(itemRef);\n const image: ImgStorageData = {\n url,\n // fullPath: itemRef.fullPath,\n name: itemRef.name,\n };\n return image;\n } catch (error) {\n console.error(`Error getting download URL for ${itemRef.fullPath}:`, error);\n return null;\n }\n });\n\n const images = (await Promise.all(imagePromises)).filter((img) => img !== null) as ImgStorageData[];\n this.images$.next(images);\n } catch (error) {\n console.error('Error loading images from storage:', error);\n this.error$.next('Failed to load images from storage. Please try again later.');\n } finally {\n this.loading$.next(false);\n }\n }\n\n /**\n * Refreshes the image list\n */\n public refreshImages(): void {\n this.loadImagesFromStorage();\n }\n\n public selectImage(image: ImgStorageData): void {\n this.imageSelected.emit(image);\n }\n}\n","<div class=\"image-storage-preview-container\">\n <div class=\"header\">\n <h2>Storage Images</h2>\n <button class=\"refresh-btn\" (click)=\"refreshImages()\" [disabled]=\"loading$ | async\">\n @if (!(loading$ | async)) {\n <span>Refresh</span>\n }\n @if (loading$ | async) {\n <span>Loading...</span>\n }\n </button>\n </div>\n\n @if (loading$ | async) {\n <div class=\"loading-container\">\n <div class=\"spinner\"></div>\n <p>Loading images...</p>\n </div>\n }\n\n @if (error$ | async) {\n <div class=\"error-container\">\n <p class=\"error-message\">{{ error$ | async }}</p>\n <button (click)=\"refreshImages()\">Try Again</button>\n </div>\n }\n\n @if (!(loading$ | async) && !(error$ | async)) {\n <div class=\"images-grid\">\n @if ((images$ | async)?.length) {\n @for (image of images$ | async; track image) {\n <div class=\"image-card\">\n <div class=\"image-container\">\n <img [src]=\"image.url\" [alt]=\"image.name || 'Storage image'\" loading=\"lazy\" />\n </div>\n <div class=\"image-info\">\n <p class=\"image-name\" [title]=\"image.name\">{{ image.name }}</p>\n <div class=\"image-actions\">\n <a [href]=\"image.url\" target=\"_blank\" class=\"action-btn\">View</a>\n <button (click)=\"selectImage(image)\" class=\"action-btn\">Select</button>\n </div>\n </div>\n </div>\n }\n } @else {\n <div class=\"no-images\">\n <p>No images found in the storage path: {{ storagePath }}</p>\n </div>\n }\n <dc-cropper-modal [imgStorageSettings]=\"imgStorageSettings\"></dc-cropper-modal>\n </div>\n }\n</div>\n","import { Component, inject, input, output, signal } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { ButtonModule } from 'primeng/button';\nimport { MultiImagesStorageService } from '../../services/multi-images-storage.service';\nimport { FileStorageData } from '../../classes/storage.models';\nimport { TooltipModule } from 'primeng/tooltip';\nimport { DialogModule } from 'primeng/dialog';\nimport { InputTextModule } from 'primeng/inputtext';\nimport { SelectModule } from 'primeng/select';\nimport { MoodStateOptions } from '@dataclouder/ngx-core';\n\n@Component({\n selector: 'dc-simple-uploader',\n templateUrl: './simple-uploader.component.html',\n styleUrls: ['./simple-uploader.component.scss'],\n standalone: true,\n imports: [CommonModule, FormsModule, ButtonModule, TooltipModule, DialogModule, InputTextModule, SelectModule],\n})\nexport class SimpleUploaderComponent {\n private multiImagesStorageService = inject(MultiImagesStorageService);\n\n storagePath = input.required<string>();\n buttonLabel = input<string>('Upload File');\n accept = input<string>('*/*');\n disabled = input<boolean>(false);\n metadata = input<any>({});\n\n fileUploaded = output<FileStorageData>();\n uploadError = output<any>();\n\n isLoading = signal(false);\n displayDialog = signal(false);\n fileSelected = signal<File | null>(null);\n moodSelected = signal<string | null>(null);\n fileInputId: string;\n metadataInput: any = {};\n public MoodStateOptions = MoodStateOptions;\n\n constructor() {\n this.fileInputId = `file-upload-${Math.random().toString(36).substring(2, 11)}`;\n }\n\n objectKeys(obj: any): string[] {\n return Object.keys(obj);\n }\n\n openDialog(): void {\n this.metadataInput = { ...this.metadata() };\n this.displayDialog.set(true);\n }\n\n triggerFileInputClick(fileInput: HTMLInputElement): void {\n fileInput.click();\n }\n\n onFileSelected(event: Event): void {\n const fileInput = event.target as HTMLInputElement;\n const file = fileInput.files?.[0];\n if (file) {\n this.fileSelected.set(file);\n }\n }\n\n async uploadFile(): Promise<void> {\n const file = this.fileSelected();\n if (file) {\n this.isLoading.set(true);\n const metadata = {\n // ...this.metadataInput,\n moodState: this.moodSelected(),\n };\n try {\n const result = await this.multiImagesStorageService.uploadGenericFile(file, this.storagePath(), metadata);\n result.metadata = metadata;\n if (result) {\n this.fileUploaded.emit(result);\n } else {\n this.uploadError.emit({ error: 'Upload failed and no specific error was provided by the service.' });\n }\n } catch (error) {\n console.error('Error during file upload in SimpleUploaderComponent:', error);\n this.uploadError.emit(error);\n } finally {\n this.isLoading.set(false);\n this.displayDialog.set(false);\n this.fileSelected.set(null);\n this.moodSelected.set(null);\n }\n }\n }\n}\n","<p-button\n size=\"large\"\n [label]=\"buttonLabel()\"\n (click)=\"openDialog()\"\n [loading]=\"isLoading()\"\n [disabled]=\"disabled() || isLoading()\"\n pTooltip=\"Upload a file with metadata\"></p-button>\n\n@if(displayDialog()){\n<p-dialog\n header=\"Upload File\"\n [(visible)]=\"displayDialog\"\n [modal]=\"true\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n [contentStyle]=\"{ width: '50vw', height: '50vh' }\">\n <div class=\"upload-dialog\">\n @if(!fileSelected()){\n <div class=\"file-input-container\">\n <input #fileInput type=\"file\" [id]=\"fileInputId\" (change)=\"onFileSelected($event)\" [accept]=\"accept()\" style=\"display: none\" />\n <p-button label=\"Select File\" (click)=\"triggerFileInputClick(fileInput)\"></p-button>\n </div>\n } @else {\n <div class=\"file-details\">\n <p>File: {{ fileSelected()?.name }}</p>\n <p>Size: {{ fileSelected()?.size }} bytes</p>\n </div>\n\n <div class=\"metadata-container\">\n <h5>Metadata</h5>\n <div class=\"p-fluid\">\n @for (key of objectKeys(metadata()); track key) {\n <div class=\"p-field\">\n <label [for]=\"key\">{{ key }}</label>\n <input pInputText [id]=\"key\" [(ngModel)]=\"metadataInput[key]\" />\n </div>\n }\n\n <div class=\"p-field\">\n <label for=\"emotion\">Emotion</label>\n <p-select [options]=\"MoodStateOptions\" [(ngModel)]=\"moodSelected\" optionLabel=\"label\" optionValue=\"value\" placeholder=\"Select an emotion\"></p-select>\n </div>\n </div>\n </div>\n }\n </div>\n\n <ng-template pTemplate=\"footer\">\n <div class=\"dialog-footer\">\n <p-button label=\"Cancel\" styleClass=\"p-button-secondary\" (click)=\"displayDialog.set(false)\"></p-button>\n <p-button label=\"Upload\" (click)=\"uploadFile()\" [disabled]=\"!fileSelected() || isLoading()\"></p-button>\n </div>\n </ng-template>\n</p-dialog>\n}\n","import { Injectable, inject } from '@angular/core';\nimport { getDownloadURL, ref, Storage } from '@angular/fire/storage';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DCFilesCacheService {\n private storage = inject(Storage);\n\n /** Inserted by Angular inject() migration for backwards compatibility */\n constructor(...args: unknown[]);\n\n constructor() {}\n\n public files: { [key: string]: string } = {};\n\n public async getURLSrcFile(path: string): Promise<string> {\n if (path in this.files) {\n return this.files[path];\n } else {\n const url = await getDownloadURL(ref(this.storage, path));\n const localUrl = await this.donwloadFileAndGetLocalURL(url);\n this.files[path] = localUrl;\n return localUrl;\n }\n }\n\n public getBlob(url: string): Promise<Blob> {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.responseType = 'blob';\n xhr.overrideMimeType('audio/mp3');\n\n xhr.onload = (event) => {\n var blob = xhr.response;\n resolve(blob);\n };\n xhr.onerror = (event) => {\n reject(event);\n };\n\n xhr.open('GET', url);\n xhr.send();\n });\n }\n\n public async donwloadFileAndGetLocalURL(url: string) {\n const blob = await this.getBlob(url);\n\n return URL.createObjectURL(blob);\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { AngularFireStorage, AngularFireUploadTask } from '@angular/fire/compat/storage';\nimport { getDownloadURL, getStorage, deleteObject, listAll, StorageReference } from '@angular/fire/storage';\nimport { ref } from 'firebase/storage';\nimport { lastValueFrom } from 'rxjs';\n\n/**\n * Represents the metadata of an object stored in Firebase Storage.\n */\nexport interface ObjectStorageData {\n /** The download URL of the stored object. */\n url: string;\n /** The full path of the object in the storage bucket (e.g., 'folder/subfolder/file.txt'). */\n path: string;\n /** The name of the Firebase Storage bucket where the object is stored. */\n bucket: string;\n /** The name of the object file (e.g., 'file.txt'). */\n name?: string;\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MultiObjectStorageService {\n private storage = inject(AngularFireStorage);\n\n /**\n * Uploads a Blob or File object to a specified path in Firebase Storage.\n * @param objectToUpload The Blob or File to upload.\n * @param path The desired storage path (e.g., 'documents/report.pdf').\n * @returns A promise that resolves with the storage metadata of the uploaded object.\n * @throws Throws an error if the upload fails.\n */\n public async uploadObject(objectToUpload: Blob | File, path: string): Promise<ObjectStorageData> {\n try {\n const refStorage = this.storage.ref(path);\n const task = await refStorage.put(objectToUpload);\n const { fullPath, bucket, name } = task.metadata;\n const url = await lastValueFrom(refStorage.getDownloadURL());\n const storageData: ObjectStorageData = { url, path: fullPath, bucket, name };\n return storageData;\n } catch (error) {\n console.error(`Error uploading object to path \"${path}\": `, error);\n // Re-throw the error to allow calling code to handle it\n throw error;\n }\n }\n\n /**\n * Deletes all objects within a specified directory path in Firebase Storage.\n * WARNING: Use with extreme caution as this will permanently delete all files in the directory.\n * @param directoryPath The path to the directory to delete (e.g., 'users/userId/files/').\n * @returns A promise that resolves when the deletion attempt is complete.\n */\n public async deleteDirectory(directoryPath: string): Promise<void> {\n const storage = getStorage();\n const directoryRef = ref(storage, directoryPath);\n\n try {\n const res = await listAll(directoryRef);\n const deletePromises: Promise<void>[] = [];\n res.items.forEach((itemRef: StorageReference) => {\n console.log(`Deleting object: ${itemRef.fullPath}`);\n deletePromises.push(deleteObject(itemRef));\n });\n // You might want to handle potential errors during individual deletions if needed\n await Promise.all(deletePromises);\n console.log(`Successfully deleted objects in directory: ${directoryPath}`);\n } catch (error) {\n console.error(`Error deleting objects in directory \"${directoryPath}\":`, error);\n // Optionally re-throw or handle the error appropriately\n throw error;\n }\n }\n\n /**\n * Deletes a single object from Firebase Storage based on its full path.\n * @param objectPath The full path of the object to delete (e.g., 'images/profile.jpg').\n * @returns A promise that resolves when the deletion is complete.\n */\n public async deleteObjectByPath(objectPath: string): Promise<void> {\n const storageRef = this.storage.ref(objectPath);\n try {\n await lastValueFrom(storageRef.delete());\n console.log(`Object deleted successfully: ${objectPath}`);\n } catch (error) {\n console.error(`Error deleting object at path \"${objectPath}\":`, error);\n // Optionally re-throw or handle the error appropriately\n throw error;\n }\n }\n\n /**\n * Private helper to get metadata after an upload task completes.\n * @param task The AngularFireUploadTask.\n * @returns A promise resolving with the object's storage metadata.\n */\n private async uploadAndGetObjectMetadata(task: AngularFireUploadTask): Promise<ObjectStorageData> {\n const snap = await task;\n const { fullPath, bucket, name } = snap.metadata;\n const storage = getStorage();\n const storageRef = ref(storage, fullPath);\n const url = await getDownloadURL(storageRef);\n const meta: ObjectStorageData = {\n url,\n path: fullPath, // Use fullPath for the 'path' property\n bucket,\n name,\n };\n return meta;\n }\n}\n","import { Component, input, output, computed, inject, OnDestroy } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { IAssetable } from '../../models/assetable.model';\nimport { AspectType, ResolutionType, StorageImageSettings, CloudStorageData, extractPath } from '../../classes/storage.models';\nimport { CropperComponentModal } from '../cropper-modal/cropper-modal.component';\nimport { MultiImagesStorageService } from '../../services/multi-images-storage.service';\nimport { SimpleUploaderComponent } from '../simple-uploader/simple-uploader.component';\nimport { ButtonModule } from 'primeng/button';\nimport { MessageModule } from 'primeng/message';\n\n@Component({\n selector: 'assets-loader',\n templateUrl: './assets-loader.html',\n styleUrls: ['./assets-loader.scss'],\n standalone: true,\n imports: [CommonModule, CropperComponentModal, SimpleUploaderComponent, ButtonModule, MessageModule],\n})\nexport class AssetsLoaderComponent implements OnDestroy {\n assets = input.required<IAssetable>();\n storagePath = input.required<string>();\n assetsChange = output<IAssetable>();\n assetUpdate = output<{ assets: Partial<IAssetable> }>();\n onFileSelected = output<File>();\n\n private storageService = inject(MultiImagesStorageService);\n private reverseInterval: any;\n\n public bannerImgSettings = computed<StorageImageSettings>(() => ({\n path: this.storagePath(),\n fileName: undefined,\n cropSettings: { aspectRatio: AspectType.Rectangle, resolutions: [ResolutionType.MediumLarge], resizeToWidth: 700 },\n }));\n\n public imageStorageSettings = computed<StorageImageSettings>(() => ({\n path: this.storagePath(),\n fileName: undefined,\n cropSettings: { aspectRatio: AspectType.Vertical_2_3, resolutions: [ResolutionType.MediumLarge], resizeToWidth: 500 },\n }));\n\n public stickerStorageSettings = computed<StorageImageSettings>(() => ({\n path: `${this.storagePath()}/stickers`,\n fileName: undefined,\n cropSettings: { aspectRatio: AspectType.Square, resolutions: [ResolutionType.MediumLarge], resizeToWidth: 400 },\n }));\n\n public onImageUploaded(event: CloudStorageData, type: 'image' | 'banner' | 'sticker' = 'image') {\n const currentAssets = this.assets() ?? { image: null, banner: null, stickers: [] };\n let updatedField: Partial<IAssetable>;\n\n switch (type) {\n case 'image':\n updatedField = { image: event };\n break;\n case 'banner':\n updatedField = { banner: event };\n break;\n case 'sticker':\n updatedField = { stickers: [...(currentAssets.stickers || []), event] };\n break;\n }\n\n const newAssets = { ...currentAssets, ...updatedField };\n this.assetUpdate.emit({ assets: updatedField });\n this.assetsChange.emit(newAssets);\n }\n\n public onMotionUploaded(event: CloudStorageData) {\n if (!event.url) return;\n\n const currentMotionUrl = this.assets()?.motion?.url;\n if (currentMotionUrl) {\n this.storageService.deleteImage(currentMotionUrl);\n }\n\n const updatedField = { motion: { url: event.url } };\n const newAssets = { ...this.assets(), ...updatedField };\n\n // Emit only the update field\n this.assetUpdate.emit({ assets: updatedField });\n // Assets Changes emit the new object\n this.assetsChange.emit(newAssets);\n }\n\n public onMotionAdded(event: CloudStorageData) {\n const currentAssets = this.assets() ?? { motions: [] };\n const updatedField = { motions: [...(currentAssets.motions || []), event] };\n const newAssets = { ...currentAssets, ...updatedField };\n this.assetUpdate.emit({ assets: updatedField });\n this.assetsChange.emit(newAssets);\n }\n\n public removeSticker(sticker: CloudStorageData) {\n const path = extractPath(sticker);\n if (path) {\n this.storageService.deleteImage(path);\n }\n\n const currentStickers = this.assets()?.stickers ?? [];\n const updatedStickers = currentStickers.filter((s) => s.url !== sticker.url);\n const updatedField = { stickers: updatedStickers };\n const newAssets = { ...this.assets(), ...updatedField };\n\n this.assetUpdate.emit({ assets: updatedField });\n this.assetsChange.emit(newAssets);\n }\n\n public removeMotion(motion: CloudStorageData) {\n const path = extractPath(motion);\n if (path) {\n this.storageService.deleteImage(path);\n }\n\n const currentMotions = this.assets()?.motions ?? [];\n const updatedMotions = currentMotions.filter((m) => m.url !== motion.url);\n const updatedField = { motions: updatedMotions };\n const newAssets = { ...this.assets(), ...updatedField };\n\n this.assetUpdate.emit({ assets: updatedField });\n this.assetsChange.emit(newAssets);\n }\n\n public removeMainMotion() {\n const motionToRemove = this.assets()?.motion;\n if (motionToRemove?.url) {\n const path = extractPath(motionToRemove);\n if (path) {\n this.storageService.deleteImage(path);\n }\n\n const updatedField = { motion: null };\n const newAssets = { ...this.assets(), motion: null };\n\n this.assetUpdate.emit({ assets: updatedField });\n this.assetsChange.emit(newAssets);\n }\n }\n\n public onVideoEnded(video: HTMLVideoElement) {\n video.pause();\n this.reverseInterval = setInterval(() => {\n if (video.currentTime <= 0) {\n clearInterval(this.reverseInterval);\n video.play();\n } else {\n video.currentTime -= 0.03;\n }\n }, 30);\n }\n\n ngOnDestroy() {\n if (this.reverseInterval) {\n clearInterval(this.reverseInterval);\n }\n }\n}\n","<div class=\"assets-container\">\n <div class=\"assets-card\">\n <p-message severity=\"info\">\n <div class=\"upload-buttons\">\n <div>\n <dc-cropper-modal\n id=\"cropperCardImage\"\n #cropperCardImage\n [buttonLabel]=\"assets()?.image?.url ? 'Cambiar imagen' : 'Cargar una imagen'\"\n [imgStorageSettings]=\"imageStorageSettings()\"\n [currentStorage]=\"assets()?.image\"\n (imageUploaded)=\"onImageUploaded($event, 'image')\"\n (onFileSelected)=\"onFileSelected.emit($event)\"></dc-cropper-modal>\n </div>\n\n <dc-simple-uploader\n [buttonLabel]=\"assets()?.motion?.url ? 'Cambiar video principal' : 'Agregar video principal'\"\n (fileUploaded)=\"onMotionUploaded($event)\"\n [storagePath]=\"storagePath() + '/motions/file'\"\n [accept]=\"'video/*'\"></dc-simple-uploader>\n\n <dc-simple-uploader\n [buttonLabel]=\"'Agregar Movimientos'\"\n (fileUploaded)=\"onMotionAdded($event)\"\n [storagePath]=\"storagePath() + '/motions/file'\"\n [accept]=\"'video/*'\"></dc-simple-uploader>\n\n <dc-cropper-modal\n #cropperBanner\n id=\"cropperBanner\"\n [buttonLabel]=\"assets()?.banner?.url ? 'Cambiar el banner' : 'Cargar un banner'\"\n [imgStorageSettings]=\"bannerImgSettings()\"\n [currentStorage]=\"assets()?.banner\"\n (imageUploaded)=\"onImageUploaded($event, 'banner')\"></dc-cropper-modal>\n\n <dc-cropper-modal\n id=\"cropperStickers\"\n #cropperStickers\n [buttonLabel]=\"'Agregar sticker'\"\n [imgStorageSettings]=\"stickerStorageSettings()\"\n (imageUploaded)=\"onImageUploaded($event, 'sticker')\"></dc-cropper-modal>\n </div>\n </p-message>\n <!-- Banner -->\n\n <div class=\"preview-container\">\n <img [src]=\"assets()?.banner?.url || 'assets/defaults/images/default_banner.webp'\" class=\"main-banner-image-card\" />\n <div class=\"main-image-card\">\n <img [src]=\"assets()?.image?.url || 'assets/defaults/images/default_2_3.webp'\" />\n </div>\n\n <div class=\"motion-container\">\n <video #videoPlayer class=\"main-motion-card\" [src]=\"assets()?.motion?.url\" (ended)=\"onVideoEnded(videoPlayer)\" autoplay muted playsinline></video>\n @if(assets()?.motion?.url){\n <p-button class=\"remove-main-motion-button\" (click)=\"removeMainMotion()\" [rounded]=\"true\" [text]=\"true\" icon=\"pi pi-trash\" severity=\"danger\"></p-button>\n }\n </div>\n </div>\n\n <div class=\"stickers-container\">\n @for (sticker of assets()?.stickers; track sticker.url) {\n <div class=\"sticker-wrapper\">\n <img width=\"100\" [src]=\"sticker.url\" alt=\"\" />\n <p-button (click)=\"removeSticker(sticker)\" class=\"remove-sticker\" icon=\"pi pi-times\" [rounded]=\"true\" [text]=\"true\" severity=\"danger\" />\n </div>\n }\n </div>\n\n <div class=\"motions-container\">\n @for (motion of assets()?.motions; track motion.url) {\n <div class=\"motion-wrapper\">\n <video width=\"150\" [src]=\"motion.url\" controls playsinline preload=\"none\"></video>\n <p-button (click)=\"removeMotion(motion)\" class=\"remove-motion-button\" icon=\"pi pi-trash\" [rounded]=\"true\" [text]=\"true\" severity=\"danger\"></p-button>\n </div>\n }\n </div>\n </div>\n</div>\n","/*\n * Public API Surface of storage-uploader\n */\n\nexport * from './lib/components/cropper/cropper.component';\nexport * from './lib/components/cropper-modal/cropper-modal.component';\nexport * from './lib/components/image-storage-preview/image-storage-preview';\nexport * from './lib/components/simple-uploader/simple-uploader.component';\nexport * from './lib/classes/storage.models';\n\n// Services\nexport * from './lib/services/multi-images-storage.service';\nexport * from './lib/services/dc-files-cache.service';\nexport * from './lib/services/multi-object-storage.service';\n\n// Components\nexport * from './lib/components/assets-loader/assets-loader';\nexport * from './lib/models/assetable.model';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["getStorage","listAll","getDownloadURL","i4","i5","ref","i1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AAA,MAAA,EAAA,uBAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAExF,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAPjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAGb,UAAA,EAAA,IAAI,EACP,OAAA,EAAA,CAAC,YAAY,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,YAAY,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,i8GAAA,EAAA,MAAA,EAAA,CAAA,k/CAAA,CAAA,EAAA;;;AEftG;;AAEG;;ACFH;;AAEG;;;;"}
@@ -1,7 +1,8 @@
1
+ import { OnDestroy } from '@angular/core';
1
2
  import { IAssetable } from '../../models/assetable.model';
2
3
  import { StorageImageSettings, CloudStorageData } from '../../classes/storage.models';
3
4
  import * as i0 from "@angular/core";
4
- export declare class CsaAssetsLoaderComponent {
5
+ export declare class AssetsLoaderComponent implements OnDestroy {
5
6
  assets: import("@angular/core").InputSignal<IAssetable>;
6
7
  storagePath: import("@angular/core").InputSignal<string>;
7
8
  assetsChange: import("@angular/core").OutputEmitterRef<IAssetable>;
@@ -10,12 +11,18 @@ export declare class CsaAssetsLoaderComponent {
10
11
  }>;
11
12
  onFileSelected: import("@angular/core").OutputEmitterRef<File>;
12
13
  private storageService;
14
+ private reverseInterval;
13
15
  bannerImgSettings: import("@angular/core").Signal<StorageImageSettings>;
14
16
  imageStorageSettings: import("@angular/core").Signal<StorageImageSettings>;
15
17
  stickerStorageSettings: import("@angular/core").Signal<StorageImageSettings>;
16
18
  onImageUploaded(event: CloudStorageData, type?: 'image' | 'banner' | 'sticker'): void;
17
19
  onMotionUploaded(event: CloudStorageData): void;
20
+ onMotionAdded(event: CloudStorageData): void;
18
21
  removeSticker(sticker: CloudStorageData): void;
19
- static ɵfac: i0.ɵɵFactoryDeclaration<CsaAssetsLoaderComponent, never>;
20
- static ɵcmp: i0.ɵɵComponentDeclaration<CsaAssetsLoaderComponent, "assets-loader", never, { "assets": { "alias": "assets"; "required": true; "isSignal": true; }; "storagePath": { "alias": "storagePath"; "required": true; "isSignal": true; }; }, { "assetsChange": "assetsChange"; "assetUpdate": "assetUpdate"; "onFileSelected": "onFileSelected"; }, never, never, true, never>;
22
+ removeMotion(motion: CloudStorageData): void;
23
+ removeMainMotion(): void;
24
+ onVideoEnded(video: HTMLVideoElement): void;
25
+ ngOnDestroy(): void;
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<AssetsLoaderComponent, never>;
27
+ static ɵcmp: i0.ɵɵComponentDeclaration<AssetsLoaderComponent, "assets-loader", never, { "assets": { "alias": "assets"; "required": true; "isSignal": true; }; "storagePath": { "alias": "storagePath"; "required": true; "isSignal": true; }; }, { "assetsChange": "assetsChange"; "assetUpdate": "assetUpdate"; "onFileSelected": "onFileSelected"; }, never, never, true, never>;
21
28
  }
@@ -14,6 +14,11 @@ export declare class CropperComponentModal implements OnInit {
14
14
  readonly onFileSelected: import("@angular/core").OutputEmitterRef<any>;
15
15
  imageCropper: ImageCropperComponent;
16
16
  aspectRatioOptions: AspectRatioOption[];
17
+ MoodStateOptions: {
18
+ value: string;
19
+ label: string;
20
+ emoji: string;
21
+ }[];
17
22
  fileMetadata: File | null;
18
23
  imageChangedEvent: Event;
19
24
  displayDialog: boolean;
@@ -24,6 +29,7 @@ export declare class CropperComponentModal implements OnInit {
24
29
  downloadURL: Observable<string>;
25
30
  resizeToWidth: number;
26
31
  ratioSelected: any;
32
+ emotionSelected: string | null;
27
33
  fileInputId: string;
28
34
  constructor();
29
35
  ngOnInit(): void;
@@ -36,6 +42,7 @@ export declare class CropperComponentModal implements OnInit {
36
42
  loadImageFailed(): void;
37
43
  simpleCropAndUpload(): Promise<void>;
38
44
  changeRatio(event: AspectRatioOption): void;
45
+ addEmotion(event: string): void;
39
46
  static ɵfac: i0.ɵɵFactoryDeclaration<CropperComponentModal, never>;
40
47
  static ɵcmp: i0.ɵɵComponentDeclaration<CropperComponentModal, "dc-cropper-modal", never, { "imgStorageSettings": { "alias": "imgStorageSettings"; "required": false; "isSignal": true; }; "buttonLabel": { "alias": "buttonLabel"; "required": false; "isSignal": true; }; "currentStorage": { "alias": "currentStorage"; "required": false; }; }, { "imageUploaded": "imageUploaded"; "onImageCropped": "onImageCropped"; "onFileSelected": "onFileSelected"; }, never, never, true, never>;
41
48
  }
@@ -6,13 +6,26 @@ export declare class SimpleUploaderComponent {
6
6
  buttonLabel: import("@angular/core").InputSignal<string>;
7
7
  accept: import("@angular/core").InputSignal<string>;
8
8
  disabled: import("@angular/core").InputSignal<boolean>;
9
+ metadata: import("@angular/core").InputSignal<any>;
9
10
  fileUploaded: import("@angular/core").OutputEmitterRef<FileStorageData>;
10
11
  uploadError: import("@angular/core").OutputEmitterRef<any>;
11
12
  isLoading: import("@angular/core").WritableSignal<boolean>;
13
+ displayDialog: import("@angular/core").WritableSignal<boolean>;
14
+ fileSelected: import("@angular/core").WritableSignal<File>;
15
+ moodSelected: import("@angular/core").WritableSignal<string>;
12
16
  fileInputId: string;
17
+ metadataInput: any;
18
+ MoodStateOptions: {
19
+ value: string;
20
+ label: string;
21
+ emoji: string;
22
+ }[];
13
23
  constructor();
24
+ objectKeys(obj: any): string[];
25
+ openDialog(): void;
14
26
  triggerFileInputClick(fileInput: HTMLInputElement): void;
15
- onFileSelected(event: Event): Promise<void>;
27
+ onFileSelected(event: Event): void;
28
+ uploadFile(): Promise<void>;
16
29
  static ɵfac: i0.ɵɵFactoryDeclaration<SimpleUploaderComponent, never>;
17
- static ɵcmp: i0.ɵɵComponentDeclaration<SimpleUploaderComponent, "dc-simple-uploader", never, { "storagePath": { "alias": "storagePath"; "required": true; "isSignal": true; }; "buttonLabel": { "alias": "buttonLabel"; "required": false; "isSignal": true; }; "accept": { "alias": "accept"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "fileUploaded": "fileUploaded"; "uploadError": "uploadError"; }, never, never, true, never>;
30
+ static ɵcmp: i0.ɵɵComponentDeclaration<SimpleUploaderComponent, "dc-simple-uploader", never, { "storagePath": { "alias": "storagePath"; "required": true; "isSignal": true; }; "buttonLabel": { "alias": "buttonLabel"; "required": false; "isSignal": true; }; "accept": { "alias": "accept"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "metadata": { "alias": "metadata"; "required": false; "isSignal": true; }; }, { "fileUploaded": "fileUploaded"; "uploadError": "uploadError"; }, never, never, true, never>;
18
31
  }
@@ -1,7 +1,8 @@
1
- import { CloudStorageData } from '../classes/storage.models';
1
+ import { CloudStorageData, FileStorageData } from '../classes/storage.models';
2
2
  export interface IAssetable {
3
3
  image?: CloudStorageData;
4
4
  banner?: CloudStorageData;
5
- motion?: CloudStorageData;
6
- stickers?: CloudStorageData[];
5
+ motion?: FileStorageData;
6
+ stickers?: FileStorageData[];
7
+ motions?: FileStorageData[];
7
8
  }
@@ -6,7 +6,7 @@ export declare class MultiImagesStorageService {
6
6
  delete_directory(imagePath: string): Promise<void>;
7
7
  deleteImage(imagePath: string): Promise<void>;
8
8
  private uploadAndGetUrl;
9
- uploadGenericFile(file: File, storagePath: string): Promise<FileStorageData | null>;
9
+ uploadGenericFile(file: File, storagePath: string, metadata?: any): Promise<FileStorageData | null>;
10
10
  static ɵfac: i0.ɵɵFactoryDeclaration<MultiImagesStorageService, never>;
11
11
  static ɵprov: i0.ɵɵInjectableDeclaration<MultiImagesStorageService>;
12
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataclouder/ngx-cloud-storage",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "description": "Angular component library for handling cloud storage uploads with image cropping capabilities",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/public-api.d.ts CHANGED
@@ -6,5 +6,5 @@ export * from './lib/classes/storage.models';
6
6
  export * from './lib/services/multi-images-storage.service';
7
7
  export * from './lib/services/dc-files-cache.service';
8
8
  export * from './lib/services/multi-object-storage.service';
9
- export * from './lib/components/assets-loader/csa-assets-loader.component';
9
+ export * from './lib/components/assets-loader/assets-loader';
10
10
  export * from './lib/models/assetable.model';