@dataclouder/ngx-cloud-storage 0.0.26 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/dataclouder-ngx-cloud-storage.mjs +348 -92
- package/fesm2022/dataclouder-ngx-cloud-storage.mjs.map +1 -1
- package/index.d.ts +376 -3
- package/package.json +1 -1
- package/lib/classes/storage.models.d.ts +0 -107
- package/lib/components/assets-loader/csa-assets-loader.component.d.ts +0 -21
- package/lib/components/cropper/cropper.component.d.ts +0 -35
- package/lib/components/cropper-modal/cropper-modal.component.d.ts +0 -41
- package/lib/components/image-storage-preview/image-storage-preview.d.ts +0 -29
- package/lib/components/simple-uploader/simple-uploader.component.d.ts +0 -18
- package/lib/models/assetable.model.d.ts +0 -7
- package/lib/services/dc-files-cache.service.d.ts +0 -14
- package/lib/services/multi-images-storage.service.d.ts +0 -12
- package/lib/services/multi-object-storage.service.d.ts +0 -46
- package/public-api.d.ts +0 -10
package/index.d.ts
CHANGED
|
@@ -1,5 +1,378 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { OnInit, OnDestroy, PipeTransform } from '@angular/core';
|
|
3
|
+
import { ImageCropperComponent, ImageCroppedEvent, LoadedImage } from 'ngx-image-cropper';
|
|
4
|
+
import { Observable, BehaviorSubject } from 'rxjs';
|
|
5
|
+
import * as _dataclouder_ngx_core from '@dataclouder/ngx-core';
|
|
6
|
+
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
7
|
+
|
|
8
|
+
interface BasicStorage {
|
|
9
|
+
url: string;
|
|
10
|
+
}
|
|
11
|
+
interface CloudStorage extends BasicStorage {
|
|
12
|
+
path?: string;
|
|
13
|
+
bucket?: string;
|
|
14
|
+
provider?: string;
|
|
15
|
+
}
|
|
16
|
+
interface AudioStorage extends CloudStorage {
|
|
17
|
+
voice?: string;
|
|
18
|
+
transcription?: any;
|
|
19
|
+
}
|
|
20
|
+
interface FileStorageData extends BasicStorage {
|
|
21
|
+
name?: string;
|
|
22
|
+
type?: string;
|
|
23
|
+
size?: number;
|
|
24
|
+
metadata?: any;
|
|
25
|
+
}
|
|
26
|
+
interface ImgStorageData extends FileStorageData {
|
|
27
|
+
resolution?: string;
|
|
28
|
+
resolutions?: {
|
|
29
|
+
[key: string]: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
interface ImgGeneratedStorageData extends ImgStorageData {
|
|
33
|
+
model?: string;
|
|
34
|
+
prompt?: string;
|
|
35
|
+
}
|
|
36
|
+
interface StorageImageSettings {
|
|
37
|
+
path?: string;
|
|
38
|
+
fileName?: string;
|
|
39
|
+
cropSettings?: ImageCropSettings;
|
|
40
|
+
}
|
|
41
|
+
interface ImageCropSettings {
|
|
42
|
+
resizeToWidth?: number;
|
|
43
|
+
resolutions: Array<number>;
|
|
44
|
+
aspectRatio: AspectType;
|
|
45
|
+
}
|
|
46
|
+
interface CropImageSettings {
|
|
47
|
+
path: string;
|
|
48
|
+
fileName?: string;
|
|
49
|
+
resizeToWidth?: number;
|
|
50
|
+
}
|
|
51
|
+
interface ImageMultipleCrops {
|
|
52
|
+
file: File;
|
|
53
|
+
defaultImageBlob?: Blob;
|
|
54
|
+
imagesBlobs: {
|
|
55
|
+
[resolution: number]: Blob;
|
|
56
|
+
};
|
|
57
|
+
settings: {
|
|
58
|
+
renameFile: string;
|
|
59
|
+
width?: number;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
declare const AspectRatioOptions: AspectRatioOption[];
|
|
63
|
+
interface AspectRatioOption {
|
|
64
|
+
label: string;
|
|
65
|
+
description: string;
|
|
66
|
+
value: string;
|
|
67
|
+
valueRatio: number;
|
|
68
|
+
icon: string;
|
|
69
|
+
resolution?: any;
|
|
70
|
+
}
|
|
71
|
+
declare enum AspectType {
|
|
72
|
+
Square = "square",
|
|
73
|
+
Rectangle = "rectangle",
|
|
74
|
+
Banner = "banner",
|
|
75
|
+
RectangleLarge = "rectangleLarge",
|
|
76
|
+
Vertical_9_16 = "vertical_9_16",
|
|
77
|
+
Vertical_3_5 = "vertical_3_5",
|
|
78
|
+
Vertical_2_3 = "vertical_2_3"
|
|
79
|
+
}
|
|
80
|
+
declare enum AspectRatio2 {
|
|
81
|
+
'9:16' = 1.7777777777777777,
|
|
82
|
+
'3:5' = 0.6,
|
|
83
|
+
'5:8' = 0.625,
|
|
84
|
+
'2:3' = 0.6666666666666666,
|
|
85
|
+
'1:1' = 1
|
|
86
|
+
}
|
|
87
|
+
declare enum ResolutionType {
|
|
88
|
+
Small = 200,
|
|
89
|
+
Medium = 400,
|
|
90
|
+
MediumLarge = 800,
|
|
91
|
+
Large = 1200,
|
|
92
|
+
VeryLarge = 1600
|
|
93
|
+
}
|
|
94
|
+
declare const AspectRatio: {
|
|
95
|
+
square: number;
|
|
96
|
+
rectangle: number;
|
|
97
|
+
vertical_9_16: number;
|
|
98
|
+
rectangleLarge: number;
|
|
99
|
+
banner: number;
|
|
100
|
+
vertical_3_5: number;
|
|
101
|
+
vertical_2_3: number;
|
|
102
|
+
};
|
|
103
|
+
declare const DEFAULT_SETTINGS: StorageImageSettings;
|
|
1
104
|
/**
|
|
2
|
-
*
|
|
105
|
+
* Extracts the bucket name from a Firebase Storage URL.
|
|
106
|
+
* The URL is expected to follow the pattern:
|
|
107
|
+
* 'https://firebasestorage.googleapis.com/v0/b/<bucket>/<path>?<query_params>'
|
|
108
|
+
*
|
|
109
|
+
* @param data The BasicStorage object containing the 'url' property.
|
|
110
|
+
* @returns The bucket name (e.g., 'appingles-pro.appspot.com') or undefined if not found or URL is invalid.
|
|
3
111
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
112
|
+
declare function extractBucket(data: BasicStorage): string | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* Extracts the file path from a Firebase Storage URL.
|
|
115
|
+
* The URL is expected to follow the pattern:
|
|
116
|
+
* 'https://firebasestorage.googleapis.com/v0/b/<bucket>/<path>?<query_params>'
|
|
117
|
+
* The extracted path is the part after the bucket and before any query parameters.
|
|
118
|
+
*
|
|
119
|
+
* @param data The BasicStorage object containing the 'url' property.
|
|
120
|
+
* @returns The file path (e.g., 'scenarios/666506c3b9b5443f4bfab5e0/images/hairdresser.webp')
|
|
121
|
+
* or undefined if not found or URL is invalid.
|
|
122
|
+
* Note: This function does not perform URL decoding on the path. If URL-decoded paths
|
|
123
|
+
* (e.g., converting %2F to /) are needed, `decodeURIComponent` should be applied to the result.
|
|
124
|
+
*/
|
|
125
|
+
declare function extractPath(data: BasicStorage): string | undefined;
|
|
126
|
+
|
|
127
|
+
declare class CropperComponent implements OnInit {
|
|
128
|
+
private multiImagesStorageService;
|
|
129
|
+
readonly imageSettings: _angular_core.InputSignal<CropImageSettings>;
|
|
130
|
+
readonly ratioType: _angular_core.InputSignal<string>;
|
|
131
|
+
readonly resolutions: _angular_core.InputSignal<number[]>;
|
|
132
|
+
readonly imageUploaded: _angular_core.OutputEmitterRef<any>;
|
|
133
|
+
readonly onImageCropped: _angular_core.OutputEmitterRef<ImageMultipleCrops>;
|
|
134
|
+
readonly onFileSelected: _angular_core.OutputEmitterRef<any>;
|
|
135
|
+
imageCropper: ImageCropperComponent;
|
|
136
|
+
fileMetadata: File | null;
|
|
137
|
+
imageChangedEvent: Event;
|
|
138
|
+
aspectRatio: number;
|
|
139
|
+
croppedImage: any;
|
|
140
|
+
isLoading: boolean;
|
|
141
|
+
isUploaded: boolean;
|
|
142
|
+
renameFile: any;
|
|
143
|
+
storagePath: string;
|
|
144
|
+
showModal: boolean;
|
|
145
|
+
ngOnInit(): void;
|
|
146
|
+
reloadPath(): void;
|
|
147
|
+
fileChangeEvent(event: any): Promise<void>;
|
|
148
|
+
onInnerImageCropped(event: ImageCroppedEvent): void;
|
|
149
|
+
imageLoaded(image: LoadedImage): void;
|
|
150
|
+
loadImageFailed(): void;
|
|
151
|
+
downloadURL: Observable<string>;
|
|
152
|
+
simpleCropAndUpload(): Promise<void>;
|
|
153
|
+
closeModal(): void;
|
|
154
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CropperComponent, never>;
|
|
155
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CropperComponent, "app-cropper", never, { "imageSettings": { "alias": "imageSettings"; "required": false; "isSignal": true; }; "ratioType": { "alias": "ratioType"; "required": false; "isSignal": true; }; "resolutions": { "alias": "resolutions"; "required": false; "isSignal": true; }; }, { "imageUploaded": "imageUploaded"; "onImageCropped": "onImageCropped"; "onFileSelected": "onFileSelected"; }, never, never, true, never>;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
declare class CropperComponentModal implements OnInit {
|
|
159
|
+
private multiImagesStorageService;
|
|
160
|
+
private changeDetectorRef;
|
|
161
|
+
readonly imgStorageSettings: _angular_core.InputSignal<StorageImageSettings>;
|
|
162
|
+
readonly buttonLabel: _angular_core.InputSignal<string>;
|
|
163
|
+
currentStorage: ImgStorageData;
|
|
164
|
+
readonly imageUploaded: _angular_core.OutputEmitterRef<ImgStorageData>;
|
|
165
|
+
readonly onImageCropped: _angular_core.OutputEmitterRef<ImageMultipleCrops>;
|
|
166
|
+
readonly onFileSelected: _angular_core.OutputEmitterRef<any>;
|
|
167
|
+
imageCropper: ImageCropperComponent;
|
|
168
|
+
aspectRatioOptions: AspectRatioOption[];
|
|
169
|
+
MoodStateOptions: {
|
|
170
|
+
value: _dataclouder_ngx_core.MoodState;
|
|
171
|
+
label: string;
|
|
172
|
+
emoji: string;
|
|
173
|
+
}[];
|
|
174
|
+
fileMetadata: File | null;
|
|
175
|
+
imageChangedEvent: Event;
|
|
176
|
+
displayDialog: boolean;
|
|
177
|
+
aspectRatioValue: number;
|
|
178
|
+
croppedImage: any;
|
|
179
|
+
renameFile: any;
|
|
180
|
+
storagePath: string;
|
|
181
|
+
downloadURL: Observable<string>;
|
|
182
|
+
resizeToWidth: number;
|
|
183
|
+
ratioSelected: any;
|
|
184
|
+
emotionSelected: string | null;
|
|
185
|
+
fileInputId: string;
|
|
186
|
+
constructor();
|
|
187
|
+
ngOnInit(): void;
|
|
188
|
+
reloadPath(): void;
|
|
189
|
+
private setSettingsForComponent;
|
|
190
|
+
fileChangeEvent(event: any): Promise<void>;
|
|
191
|
+
onInnerImageCropped(event: ImageCroppedEvent): void;
|
|
192
|
+
imageLoaded(image: LoadedImage): void;
|
|
193
|
+
cropperReady(): void;
|
|
194
|
+
loadImageFailed(): void;
|
|
195
|
+
simpleCropAndUpload(): Promise<void>;
|
|
196
|
+
changeRatio(event: AspectRatioOption): void;
|
|
197
|
+
addEmotion(event: string): void;
|
|
198
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CropperComponentModal, never>;
|
|
199
|
+
static ɵcmp: _angular_core.ɵɵ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>;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
declare class ImageStoragePreviewComponent implements OnInit, OnDestroy {
|
|
203
|
+
private storage;
|
|
204
|
+
readonly imageSelected: _angular_core.OutputEmitterRef<ImgStorageData>;
|
|
205
|
+
images$: BehaviorSubject<ImgStorageData[]>;
|
|
206
|
+
loading$: BehaviorSubject<boolean>;
|
|
207
|
+
error$: BehaviorSubject<string>;
|
|
208
|
+
readonly storagePath = "/images/resources";
|
|
209
|
+
private subscriptions;
|
|
210
|
+
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
211
|
+
constructor(...args: unknown[]);
|
|
212
|
+
ngOnInit(): void;
|
|
213
|
+
imgStorageSettings: StorageImageSettings;
|
|
214
|
+
ngOnDestroy(): void;
|
|
215
|
+
/**
|
|
216
|
+
* Loads images from Firebase Storage at the specified path
|
|
217
|
+
*/
|
|
218
|
+
private loadImagesFromStorage;
|
|
219
|
+
/**
|
|
220
|
+
* Refreshes the image list
|
|
221
|
+
*/
|
|
222
|
+
refreshImages(): void;
|
|
223
|
+
selectImage(image: ImgStorageData): void;
|
|
224
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ImageStoragePreviewComponent, never>;
|
|
225
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ImageStoragePreviewComponent, "dc-image-storage-preview", never, {}, { "imageSelected": "imageSelected"; }, never, never, true, never>;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
declare class SimpleUploaderComponent {
|
|
229
|
+
private multiImagesStorageService;
|
|
230
|
+
storagePath: _angular_core.InputSignal<string>;
|
|
231
|
+
buttonLabel: _angular_core.InputSignal<string>;
|
|
232
|
+
accept: _angular_core.InputSignal<string>;
|
|
233
|
+
disabled: _angular_core.InputSignal<boolean>;
|
|
234
|
+
metadata: _angular_core.InputSignal<any>;
|
|
235
|
+
fileUploaded: _angular_core.OutputEmitterRef<FileStorageData>;
|
|
236
|
+
uploadError: _angular_core.OutputEmitterRef<any>;
|
|
237
|
+
isLoading: _angular_core.WritableSignal<boolean>;
|
|
238
|
+
displayDialog: _angular_core.WritableSignal<boolean>;
|
|
239
|
+
fileSelected: _angular_core.WritableSignal<File>;
|
|
240
|
+
moodSelected: _angular_core.WritableSignal<string>;
|
|
241
|
+
eventSelected: _angular_core.WritableSignal<string>;
|
|
242
|
+
fileInputId: string;
|
|
243
|
+
metadataInput: any;
|
|
244
|
+
MoodStateOptions: {
|
|
245
|
+
value: _dataclouder_ngx_core.MoodState;
|
|
246
|
+
label: string;
|
|
247
|
+
emoji: string;
|
|
248
|
+
}[];
|
|
249
|
+
CharacterEventActions: {
|
|
250
|
+
value: string;
|
|
251
|
+
label: string;
|
|
252
|
+
}[];
|
|
253
|
+
constructor();
|
|
254
|
+
objectKeys(obj: any): string[];
|
|
255
|
+
openDialog(): void;
|
|
256
|
+
triggerFileInputClick(fileInput: HTMLInputElement): void;
|
|
257
|
+
onFileSelected(event: Event): void;
|
|
258
|
+
uploadFile(): Promise<void>;
|
|
259
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SimpleUploaderComponent, never>;
|
|
260
|
+
static ɵcmp: _angular_core.ɵɵ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>;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
declare class SafeHtmlPipe implements PipeTransform {
|
|
264
|
+
private sanitizer;
|
|
265
|
+
constructor(sanitizer: DomSanitizer);
|
|
266
|
+
transform(value: string): SafeHtml;
|
|
267
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SafeHtmlPipe, never>;
|
|
268
|
+
static ɵpipe: _angular_core.ɵɵPipeDeclaration<SafeHtmlPipe, "safeHtml", true>;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
declare class MultiImagesStorageService {
|
|
272
|
+
private storage;
|
|
273
|
+
uploadImage(image: Blob, path: string): Promise<ImgStorageData>;
|
|
274
|
+
delete_directory(imagePath: string): Promise<void>;
|
|
275
|
+
deleteImage(imagePath: string): Promise<void>;
|
|
276
|
+
uploadGenericFile(file: File, storagePath: string, metadata?: any): Promise<FileStorageData | null>;
|
|
277
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MultiImagesStorageService, never>;
|
|
278
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<MultiImagesStorageService>;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
declare class DCFilesCacheService {
|
|
282
|
+
private storage;
|
|
283
|
+
files: {
|
|
284
|
+
[key: string]: string;
|
|
285
|
+
};
|
|
286
|
+
getURLSrcFile(path: string): Promise<string>;
|
|
287
|
+
getBlob(url: string): Promise<Blob>;
|
|
288
|
+
donwloadFileAndGetLocalURL(url: string): Promise<string>;
|
|
289
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DCFilesCacheService, never>;
|
|
290
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<DCFilesCacheService>;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Represents the metadata of an object stored in Firebase Storage.
|
|
295
|
+
*/
|
|
296
|
+
interface ObjectStorageData {
|
|
297
|
+
/** The download URL of the stored object. */
|
|
298
|
+
url: string;
|
|
299
|
+
/** The full path of the object in the storage bucket (e.g., 'folder/subfolder/file.txt'). */
|
|
300
|
+
path: string;
|
|
301
|
+
/** The name of the Firebase Storage bucket where the object is stored. */
|
|
302
|
+
bucket: string;
|
|
303
|
+
/** The name of the object file (e.g., 'file.txt'). */
|
|
304
|
+
name?: string;
|
|
305
|
+
}
|
|
306
|
+
declare class MultiObjectStorageService {
|
|
307
|
+
private storage;
|
|
308
|
+
/**
|
|
309
|
+
* Uploads a Blob or File object to a specified path in Firebase Storage.
|
|
310
|
+
* @param objectToUpload The Blob or File to upload.
|
|
311
|
+
* @param path The desired storage path (e.g., 'documents/report.pdf').
|
|
312
|
+
* @returns A promise that resolves with the storage metadata of the uploaded object.
|
|
313
|
+
* @throws Throws an error if the upload fails.
|
|
314
|
+
*/
|
|
315
|
+
uploadObject(objectToUpload: Blob | File, path: string): Promise<ObjectStorageData>;
|
|
316
|
+
/**
|
|
317
|
+
* Deletes all objects within a specified directory path in Firebase Storage.
|
|
318
|
+
* WARNING: Use with extreme caution as this will permanently delete all files in the directory.
|
|
319
|
+
* @param directoryPath The path to the directory to delete (e.g., 'users/userId/files/').
|
|
320
|
+
* @returns A promise that resolves when the deletion attempt is complete.
|
|
321
|
+
*/
|
|
322
|
+
deleteDirectory(directoryPath: string): Promise<void>;
|
|
323
|
+
/**
|
|
324
|
+
* Deletes a single object from Firebase Storage based on its full path.
|
|
325
|
+
* @param objectPath The full path of the object to delete (e.g., 'images/profile.jpg').
|
|
326
|
+
* @returns A promise that resolves when the deletion is complete.
|
|
327
|
+
*/
|
|
328
|
+
deleteObjectByPath(objectPath: string): Promise<void>;
|
|
329
|
+
/**
|
|
330
|
+
* Private helper to get metadata after an upload task completes.
|
|
331
|
+
* @param task The AngularFireUploadTask.
|
|
332
|
+
* @returns A promise resolving with the object's storage metadata.
|
|
333
|
+
*/
|
|
334
|
+
private uploadAndGetObjectMetadata;
|
|
335
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MultiObjectStorageService, never>;
|
|
336
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<MultiObjectStorageService>;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
interface IAssetable {
|
|
340
|
+
image?: BasicStorage;
|
|
341
|
+
banner?: BasicStorage;
|
|
342
|
+
motion?: FileStorageData;
|
|
343
|
+
stickers?: FileStorageData[];
|
|
344
|
+
motions?: FileStorageData[];
|
|
345
|
+
voiceSample?: VoiceSample;
|
|
346
|
+
}
|
|
347
|
+
interface VoiceSample {
|
|
348
|
+
audio: BasicStorage;
|
|
349
|
+
text: string;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
declare class AssetsLoaderComponent implements OnDestroy {
|
|
353
|
+
assets: _angular_core.InputSignal<IAssetable>;
|
|
354
|
+
storagePath: _angular_core.InputSignal<string>;
|
|
355
|
+
assetsChange: _angular_core.OutputEmitterRef<IAssetable>;
|
|
356
|
+
assetUpdate: _angular_core.OutputEmitterRef<{
|
|
357
|
+
assets: Partial<IAssetable>;
|
|
358
|
+
}>;
|
|
359
|
+
onFileSelected: _angular_core.OutputEmitterRef<File>;
|
|
360
|
+
private storageService;
|
|
361
|
+
private reverseInterval;
|
|
362
|
+
bannerImgSettings: _angular_core.Signal<StorageImageSettings>;
|
|
363
|
+
imageStorageSettings: _angular_core.Signal<StorageImageSettings>;
|
|
364
|
+
stickerStorageSettings: _angular_core.Signal<StorageImageSettings>;
|
|
365
|
+
onImageUploaded(event: BasicStorage, type?: 'image' | 'banner' | 'sticker'): void;
|
|
366
|
+
onMotionUploaded(event: BasicStorage): void;
|
|
367
|
+
onMotionAdded(event: BasicStorage): void;
|
|
368
|
+
removeSticker(sticker: BasicStorage): void;
|
|
369
|
+
removeMotion(motion: BasicStorage): void;
|
|
370
|
+
removeMainMotion(): void;
|
|
371
|
+
onVideoEnded(video: HTMLVideoElement): void;
|
|
372
|
+
ngOnDestroy(): void;
|
|
373
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AssetsLoaderComponent, never>;
|
|
374
|
+
static ɵcmp: _angular_core.ɵɵ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>;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
export { AspectRatio, AspectRatio2, AspectRatioOptions, AspectType, AssetsLoaderComponent, CropperComponent, CropperComponentModal, DCFilesCacheService, DEFAULT_SETTINGS, ImageStoragePreviewComponent, MultiImagesStorageService, MultiObjectStorageService, ResolutionType, SafeHtmlPipe, SimpleUploaderComponent, extractBucket, extractPath };
|
|
378
|
+
export type { AspectRatioOption, AudioStorage, BasicStorage, CloudStorage, CropImageSettings, FileStorageData, IAssetable, ImageCropSettings, ImageMultipleCrops, ImgGeneratedStorageData, ImgStorageData, ObjectStorageData, StorageImageSettings, VoiceSample };
|
package/package.json
CHANGED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
export interface CloudStorageData {
|
|
2
|
-
url: string;
|
|
3
|
-
}
|
|
4
|
-
export interface FileStorageData extends CloudStorageData {
|
|
5
|
-
name?: string;
|
|
6
|
-
type?: string;
|
|
7
|
-
size?: number;
|
|
8
|
-
metadata?: any;
|
|
9
|
-
}
|
|
10
|
-
export interface ImgStorageData extends FileStorageData {
|
|
11
|
-
resolution?: string;
|
|
12
|
-
resolutions?: {
|
|
13
|
-
[key: string]: string;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export interface ImgGeneratedStorageData extends ImgStorageData {
|
|
17
|
-
model?: string;
|
|
18
|
-
prompt?: string;
|
|
19
|
-
}
|
|
20
|
-
export interface StorageImageSettings {
|
|
21
|
-
path?: string;
|
|
22
|
-
fileName?: string;
|
|
23
|
-
cropSettings?: ImageCropSettings;
|
|
24
|
-
}
|
|
25
|
-
export interface ImageCropSettings {
|
|
26
|
-
resizeToWidth?: number;
|
|
27
|
-
resolutions: Array<number>;
|
|
28
|
-
aspectRatio: AspectType;
|
|
29
|
-
}
|
|
30
|
-
export interface CropImageSettings {
|
|
31
|
-
path: string;
|
|
32
|
-
fileName?: string;
|
|
33
|
-
resizeToWidth?: number;
|
|
34
|
-
}
|
|
35
|
-
export interface ImageMultipleCrops {
|
|
36
|
-
file: File;
|
|
37
|
-
defaultImageBlob?: Blob;
|
|
38
|
-
imagesBlobs: {
|
|
39
|
-
[resolution: number]: Blob;
|
|
40
|
-
};
|
|
41
|
-
settings: {
|
|
42
|
-
renameFile: string;
|
|
43
|
-
width?: number;
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
export declare const AspectRatioOptions: AspectRatioOption[];
|
|
47
|
-
export interface AspectRatioOption {
|
|
48
|
-
label: string;
|
|
49
|
-
description: string;
|
|
50
|
-
value: string;
|
|
51
|
-
valueRatio: number;
|
|
52
|
-
}
|
|
53
|
-
export declare enum AspectType {
|
|
54
|
-
Square = "square",
|
|
55
|
-
Rectangle = "rectangle",
|
|
56
|
-
Banner = "banner",
|
|
57
|
-
RectangleLarge = "rectangleLarge",
|
|
58
|
-
Vertical_9_16 = "vertical_9_16",
|
|
59
|
-
Vertical_3_5 = "vertical_3_5",
|
|
60
|
-
Vertical_2_3 = "vertical_2_3"
|
|
61
|
-
}
|
|
62
|
-
export declare enum AspectRatio2 {
|
|
63
|
-
'9:16' = 1.7777777777777777,
|
|
64
|
-
'3:5' = 0.6,
|
|
65
|
-
'5:8' = 0.625,
|
|
66
|
-
'2:3' = 0.6666666666666666,
|
|
67
|
-
'1:1' = 1
|
|
68
|
-
}
|
|
69
|
-
export declare enum ResolutionType {
|
|
70
|
-
Small = 200,
|
|
71
|
-
Medium = 400,
|
|
72
|
-
MediumLarge = 800,
|
|
73
|
-
Large = 1200,
|
|
74
|
-
VeryLarge = 1600
|
|
75
|
-
}
|
|
76
|
-
export declare const AspectRatio: {
|
|
77
|
-
square: number;
|
|
78
|
-
rectangle: number;
|
|
79
|
-
vertical_9_16: number;
|
|
80
|
-
rectangleLarge: number;
|
|
81
|
-
banner: number;
|
|
82
|
-
vertical_3_5: number;
|
|
83
|
-
vertical_2_3: number;
|
|
84
|
-
};
|
|
85
|
-
export declare const DEFAULT_SETTINGS: StorageImageSettings;
|
|
86
|
-
/**
|
|
87
|
-
* Extracts the bucket name from a Firebase Storage URL.
|
|
88
|
-
* The URL is expected to follow the pattern:
|
|
89
|
-
* 'https://firebasestorage.googleapis.com/v0/b/<bucket>/<path>?<query_params>'
|
|
90
|
-
*
|
|
91
|
-
* @param data The CloudStorageData object containing the 'url' property.
|
|
92
|
-
* @returns The bucket name (e.g., 'appingles-pro.appspot.com') or undefined if not found or URL is invalid.
|
|
93
|
-
*/
|
|
94
|
-
export declare function extractBucket(data: CloudStorageData): string | undefined;
|
|
95
|
-
/**
|
|
96
|
-
* Extracts the file path from a Firebase Storage URL.
|
|
97
|
-
* The URL is expected to follow the pattern:
|
|
98
|
-
* 'https://firebasestorage.googleapis.com/v0/b/<bucket>/<path>?<query_params>'
|
|
99
|
-
* The extracted path is the part after the bucket and before any query parameters.
|
|
100
|
-
*
|
|
101
|
-
* @param data The CloudStorageData object containing the 'url' property.
|
|
102
|
-
* @returns The file path (e.g., 'scenarios/666506c3b9b5443f4bfab5e0/images/hairdresser.webp')
|
|
103
|
-
* or undefined if not found or URL is invalid.
|
|
104
|
-
* Note: This function does not perform URL decoding on the path. If URL-decoded paths
|
|
105
|
-
* (e.g., converting %2F to /) are needed, `decodeURIComponent` should be applied to the result.
|
|
106
|
-
*/
|
|
107
|
-
export declare function extractPath(data: CloudStorageData): string | undefined;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { IAssetable } from '../../models/assetable.model';
|
|
2
|
-
import { StorageImageSettings, CloudStorageData } from '../../classes/storage.models';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class CsaAssetsLoaderComponent {
|
|
5
|
-
assets: import("@angular/core").InputSignal<IAssetable>;
|
|
6
|
-
storagePath: import("@angular/core").InputSignal<string>;
|
|
7
|
-
assetsChange: import("@angular/core").OutputEmitterRef<IAssetable>;
|
|
8
|
-
assetUpdate: import("@angular/core").OutputEmitterRef<{
|
|
9
|
-
assets: Partial<IAssetable>;
|
|
10
|
-
}>;
|
|
11
|
-
onFileSelected: import("@angular/core").OutputEmitterRef<File>;
|
|
12
|
-
private storageService;
|
|
13
|
-
bannerImgSettings: import("@angular/core").Signal<StorageImageSettings>;
|
|
14
|
-
imageStorageSettings: import("@angular/core").Signal<StorageImageSettings>;
|
|
15
|
-
stickerStorageSettings: import("@angular/core").Signal<StorageImageSettings>;
|
|
16
|
-
onImageUploaded(event: CloudStorageData, type?: 'image' | 'banner' | 'sticker'): void;
|
|
17
|
-
onMotionUploaded(event: CloudStorageData): void;
|
|
18
|
-
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>;
|
|
21
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
2
|
-
import { ImageCroppedEvent, ImageCropperComponent, LoadedImage } from 'ngx-image-cropper';
|
|
3
|
-
import { Observable } from 'rxjs';
|
|
4
|
-
import { ImageMultipleCrops, CropImageSettings } from '../../classes/storage.models';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class CropperComponent implements OnInit {
|
|
7
|
-
private multiImagesStorageService;
|
|
8
|
-
readonly imageSettings: import("@angular/core").InputSignal<CropImageSettings>;
|
|
9
|
-
readonly ratioType: import("@angular/core").InputSignal<string>;
|
|
10
|
-
readonly resolutions: import("@angular/core").InputSignal<number[]>;
|
|
11
|
-
readonly imageUploaded: import("@angular/core").OutputEmitterRef<any>;
|
|
12
|
-
readonly onImageCropped: import("@angular/core").OutputEmitterRef<ImageMultipleCrops>;
|
|
13
|
-
readonly onFileSelected: import("@angular/core").OutputEmitterRef<any>;
|
|
14
|
-
imageCropper: ImageCropperComponent;
|
|
15
|
-
fileMetadata: File | null;
|
|
16
|
-
imageChangedEvent: Event;
|
|
17
|
-
aspectRatio: number;
|
|
18
|
-
croppedImage: any;
|
|
19
|
-
isLoading: boolean;
|
|
20
|
-
isUploaded: boolean;
|
|
21
|
-
renameFile: any;
|
|
22
|
-
storagePath: string;
|
|
23
|
-
showModal: boolean;
|
|
24
|
-
ngOnInit(): void;
|
|
25
|
-
reloadPath(): void;
|
|
26
|
-
fileChangeEvent(event: any): Promise<void>;
|
|
27
|
-
onInnerImageCropped(event: ImageCroppedEvent): void;
|
|
28
|
-
imageLoaded(image: LoadedImage): void;
|
|
29
|
-
loadImageFailed(): void;
|
|
30
|
-
downloadURL: Observable<string>;
|
|
31
|
-
simpleCropAndUpload(): Promise<void>;
|
|
32
|
-
closeModal(): void;
|
|
33
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CropperComponent, never>;
|
|
34
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CropperComponent, "app-cropper", never, { "imageSettings": { "alias": "imageSettings"; "required": false; "isSignal": true; }; "ratioType": { "alias": "ratioType"; "required": false; "isSignal": true; }; "resolutions": { "alias": "resolutions"; "required": false; "isSignal": true; }; }, { "imageUploaded": "imageUploaded"; "onImageCropped": "onImageCropped"; "onFileSelected": "onFileSelected"; }, never, never, true, never>;
|
|
35
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
2
|
-
import { ImageCroppedEvent, ImageCropperComponent, LoadedImage } from 'ngx-image-cropper';
|
|
3
|
-
import { Observable } from 'rxjs';
|
|
4
|
-
import { ImageMultipleCrops, StorageImageSettings, ImgStorageData, AspectRatioOption } from '../../classes/storage.models';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class CropperComponentModal implements OnInit {
|
|
7
|
-
private multiImagesStorageService;
|
|
8
|
-
private changeDetectorRef;
|
|
9
|
-
readonly imgStorageSettings: import("@angular/core").InputSignal<StorageImageSettings>;
|
|
10
|
-
readonly buttonLabel: import("@angular/core").InputSignal<string>;
|
|
11
|
-
currentStorage: ImgStorageData;
|
|
12
|
-
readonly imageUploaded: import("@angular/core").OutputEmitterRef<ImgStorageData>;
|
|
13
|
-
readonly onImageCropped: import("@angular/core").OutputEmitterRef<ImageMultipleCrops>;
|
|
14
|
-
readonly onFileSelected: import("@angular/core").OutputEmitterRef<any>;
|
|
15
|
-
imageCropper: ImageCropperComponent;
|
|
16
|
-
aspectRatioOptions: AspectRatioOption[];
|
|
17
|
-
fileMetadata: File | null;
|
|
18
|
-
imageChangedEvent: Event;
|
|
19
|
-
displayDialog: boolean;
|
|
20
|
-
aspectRatioValue: number;
|
|
21
|
-
croppedImage: any;
|
|
22
|
-
renameFile: any;
|
|
23
|
-
storagePath: string;
|
|
24
|
-
downloadURL: Observable<string>;
|
|
25
|
-
resizeToWidth: number;
|
|
26
|
-
ratioSelected: any;
|
|
27
|
-
fileInputId: string;
|
|
28
|
-
constructor();
|
|
29
|
-
ngOnInit(): void;
|
|
30
|
-
reloadPath(): void;
|
|
31
|
-
private setSettingsForComponent;
|
|
32
|
-
fileChangeEvent(event: any): Promise<void>;
|
|
33
|
-
onInnerImageCropped(event: ImageCroppedEvent): void;
|
|
34
|
-
imageLoaded(image: LoadedImage): void;
|
|
35
|
-
cropperReady(): void;
|
|
36
|
-
loadImageFailed(): void;
|
|
37
|
-
simpleCropAndUpload(): Promise<void>;
|
|
38
|
-
changeRatio(event: AspectRatioOption): void;
|
|
39
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CropperComponentModal, never>;
|
|
40
|
-
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
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { OnInit, OnDestroy } from '@angular/core';
|
|
2
|
-
import { BehaviorSubject } from 'rxjs';
|
|
3
|
-
import { ImgStorageData, StorageImageSettings } from '../../classes/storage.models';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class ImageStoragePreviewComponent implements OnInit, OnDestroy {
|
|
6
|
-
private storage;
|
|
7
|
-
readonly imageSelected: import("@angular/core").OutputEmitterRef<ImgStorageData>;
|
|
8
|
-
images$: BehaviorSubject<ImgStorageData[]>;
|
|
9
|
-
loading$: BehaviorSubject<boolean>;
|
|
10
|
-
error$: BehaviorSubject<string>;
|
|
11
|
-
readonly storagePath = "/images/resources";
|
|
12
|
-
private subscriptions;
|
|
13
|
-
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
14
|
-
constructor(...args: unknown[]);
|
|
15
|
-
ngOnInit(): void;
|
|
16
|
-
imgStorageSettings: StorageImageSettings;
|
|
17
|
-
ngOnDestroy(): void;
|
|
18
|
-
/**
|
|
19
|
-
* Loads images from Firebase Storage at the specified path
|
|
20
|
-
*/
|
|
21
|
-
private loadImagesFromStorage;
|
|
22
|
-
/**
|
|
23
|
-
* Refreshes the image list
|
|
24
|
-
*/
|
|
25
|
-
refreshImages(): void;
|
|
26
|
-
selectImage(image: ImgStorageData): void;
|
|
27
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ImageStoragePreviewComponent, never>;
|
|
28
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ImageStoragePreviewComponent, "dc-image-storage-preview", never, {}, { "imageSelected": "imageSelected"; }, never, never, true, never>;
|
|
29
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { FileStorageData } from '../../classes/storage.models';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class SimpleUploaderComponent {
|
|
4
|
-
private multiImagesStorageService;
|
|
5
|
-
storagePath: import("@angular/core").InputSignal<string>;
|
|
6
|
-
buttonLabel: import("@angular/core").InputSignal<string>;
|
|
7
|
-
accept: import("@angular/core").InputSignal<string>;
|
|
8
|
-
disabled: import("@angular/core").InputSignal<boolean>;
|
|
9
|
-
fileUploaded: import("@angular/core").OutputEmitterRef<FileStorageData>;
|
|
10
|
-
uploadError: import("@angular/core").OutputEmitterRef<any>;
|
|
11
|
-
isLoading: import("@angular/core").WritableSignal<boolean>;
|
|
12
|
-
fileInputId: string;
|
|
13
|
-
constructor();
|
|
14
|
-
triggerFileInputClick(fileInput: HTMLInputElement): void;
|
|
15
|
-
onFileSelected(event: Event): Promise<void>;
|
|
16
|
-
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>;
|
|
18
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class DCFilesCacheService {
|
|
3
|
-
private storage;
|
|
4
|
-
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
5
|
-
constructor(...args: unknown[]);
|
|
6
|
-
files: {
|
|
7
|
-
[key: string]: string;
|
|
8
|
-
};
|
|
9
|
-
getURLSrcFile(path: string): Promise<string>;
|
|
10
|
-
getBlob(url: string): Promise<Blob>;
|
|
11
|
-
donwloadFileAndGetLocalURL(url: string): Promise<string>;
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DCFilesCacheService, never>;
|
|
13
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DCFilesCacheService>;
|
|
14
|
-
}
|