@praxisui/files-upload 1.0.0-beta.5 → 1.0.0-beta.52

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/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, OnDestroy, NgZone, OnInit, AfterViewInit, EventEmitter, ViewContainerRef, ChangeDetectorRef, DestroyRef, Provider } from '@angular/core';
3
3
  import { FormControl, ValidatorFn, FormGroup, FormBuilder } from '@angular/forms';
4
- import { ConfigStorage, ComponentDocMeta } from '@praxisui/core';
4
+ import { AsyncConfigStorage, ComponentDocMeta, AiCapabilityCategory, AiValueKind, AiCapability, AiCapabilityCatalog } from '@praxisui/core';
5
5
  import { SettingsPanelService, SettingsValueProvider } from '@praxisui/settings-panel';
6
6
  import { HttpClient, HttpEvent, HttpHeaders } from '@angular/common/http';
7
7
  import { Observable, BehaviorSubject } from 'rxjs';
@@ -351,6 +351,18 @@ declare class DragProximityService implements OnDestroy {
351
351
  static ɵprov: i0.ɵɵInjectableDeclaration<DragProximityService>;
352
352
  }
353
353
 
354
+ type UploadStartEvent = {
355
+ files: File[];
356
+ mode: 'single' | 'bulk';
357
+ strategy: 'direct' | 'presign' | 'auto';
358
+ uploadId?: string;
359
+ baseUrl?: string;
360
+ };
361
+ type UploadProgressEvent = {
362
+ progress: number;
363
+ loaded: number;
364
+ total?: number;
365
+ };
354
366
  declare class PraxisFilesUpload implements OnInit, AfterViewInit, OnDestroy {
355
367
  private settingsPanel;
356
368
  private dragProx;
@@ -358,21 +370,32 @@ declare class PraxisFilesUpload implements OnInit, AfterViewInit, OnDestroy {
358
370
  private overlay;
359
371
  private viewContainerRef;
360
372
  private cdr;
373
+ private configStorage;
361
374
  private api?;
362
375
  private presign?;
363
376
  private errors?;
364
377
  private translate?;
365
- private configStorage?;
366
378
  config: FilesUploadConfig | null;
367
- componentId: string;
379
+ private _filesUploadId;
380
+ private _uploadId;
381
+ set filesUploadId(value: string | null | undefined);
382
+ get filesUploadId(): string;
383
+ set uploadId(value: string | null | undefined);
384
+ get uploadId(): string;
385
+ componentInstanceId?: string;
368
386
  baseUrl?: string;
369
387
  displayMode: 'full' | 'compact';
388
+ context: Record<string, unknown> | null;
389
+ editModeEnabled: boolean;
370
390
  uploadSuccess: EventEmitter<{
371
391
  file: FileMetadata;
372
392
  }>;
373
393
  bulkComplete: EventEmitter<BulkUploadResponse>;
374
394
  error: EventEmitter<ErrorResponse>;
375
395
  rateLimited: EventEmitter<RateLimitInfo>;
396
+ uploadStart: EventEmitter<UploadStartEvent>;
397
+ uploadProgress: EventEmitter<UploadProgressEvent>;
398
+ uploadError: EventEmitter<ErrorResponse>;
376
399
  retry: EventEmitter<BulkUploadFileResult>;
377
400
  download: EventEmitter<BulkUploadFileResult>;
378
401
  copyLink: EventEmitter<BulkUploadFileResult>;
@@ -386,7 +409,7 @@ declare class PraxisFilesUpload implements OnInit, AfterViewInit, OnDestroy {
386
409
  private selectedOverlayTmpl?;
387
410
  conflictPolicies: Array<'ERROR' | 'SKIP' | 'OVERWRITE' | 'MAKE_UNIQUE' | 'RENAME'>;
388
411
  conflictPolicy: FormControl<string | null>;
389
- uploadProgress: number;
412
+ uploadProgressValue: number;
390
413
  allowMultiple: boolean;
391
414
  rateLimit: RateLimitInfo | null;
392
415
  quotaExceeded: boolean;
@@ -420,7 +443,10 @@ declare class PraxisFilesUpload implements OnInit, AfterViewInit, OnDestroy {
420
443
  private windowDragEndListener;
421
444
  private selectedOverlayRef?;
422
445
  showAllResults: boolean;
423
- constructor(settingsPanel: SettingsPanelService, dragProx: DragProximityService, defaultTexts: FilesUploadTexts, overlay: Overlay, viewContainerRef: ViewContainerRef, cdr: ChangeDetectorRef, api?: FilesApiClient | undefined, presign?: PresignedUploaderService | undefined, errors?: ErrorMapperService | undefined, translate?: TranslateLike | undefined, configStorage?: ConfigStorage | undefined);
446
+ constructor(settingsPanel: SettingsPanelService, dragProx: DragProximityService, defaultTexts: FilesUploadTexts, overlay: Overlay, viewContainerRef: ViewContainerRef, cdr: ChangeDetectorRef, configStorage: AsyncConfigStorage, api?: FilesApiClient | undefined, presign?: PresignedUploaderService | undefined, errors?: ErrorMapperService | undefined, translate?: TranslateLike | undefined);
447
+ private readonly componentKeys;
448
+ private readonly route;
449
+ private warnedMissingId;
424
450
  get showProgress(): boolean;
425
451
  get isUploading(): boolean;
426
452
  get hasUploadedFiles(): boolean;
@@ -452,8 +478,9 @@ declare class PraxisFilesUpload implements OnInit, AfterViewInit, OnDestroy {
452
478
  t(key: string, fallback: string): string;
453
479
  openSettings(): void;
454
480
  private applyConfig;
455
- private loadLocalConfig;
456
- private saveLocalConfig;
481
+ private storageKey;
482
+ private componentKeyId;
483
+ private warnMissingId;
457
484
  onDragOver(evt: DragEvent): void;
458
485
  onDragLeave(_evt: DragEvent): void;
459
486
  onDrop(evt: DragEvent): void;
@@ -477,8 +504,10 @@ declare class PraxisFilesUpload implements OnInit, AfterViewInit, OnDestroy {
477
504
  onDetailsToggle(ev: Event, item: BulkUploadFileResult): void;
478
505
  private validateFiles;
479
506
  get policiesSummary(): string;
480
- static ɵfac: i0.ɵɵFactoryDeclaration<PraxisFilesUpload, [null, null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
481
- static ɵcmp: i0.ɵɵComponentDeclaration<PraxisFilesUpload, "praxis-files-upload", never, { "config": { "alias": "config"; "required": false; }; "componentId": { "alias": "componentId"; "required": false; }; "baseUrl": { "alias": "baseUrl"; "required": false; }; "displayMode": { "alias": "displayMode"; "required": false; }; }, { "uploadSuccess": "uploadSuccess"; "bulkComplete": "bulkComplete"; "error": "error"; "rateLimited": "rateLimited"; "retry": "retry"; "download": "download"; "copyLink": "copyLink"; "detailsOpened": "detailsOpened"; "detailsClosed": "detailsClosed"; "pendingFilesChange": "pendingFilesChange"; "proximityChange": "proximityChange"; }, never, ["*"], true, never>;
507
+ private resolveTemplateString;
508
+ private resolveContextPath;
509
+ static ɵfac: i0.ɵɵFactoryDeclaration<PraxisFilesUpload, [null, null, null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
510
+ static ɵcmp: i0.ɵɵComponentDeclaration<PraxisFilesUpload, "praxis-files-upload", never, { "config": { "alias": "config"; "required": false; }; "filesUploadId": { "alias": "filesUploadId"; "required": false; }; "uploadId": { "alias": "uploadId"; "required": false; }; "componentInstanceId": { "alias": "componentInstanceId"; "required": false; }; "baseUrl": { "alias": "baseUrl"; "required": false; }; "displayMode": { "alias": "displayMode"; "required": false; }; "context": { "alias": "context"; "required": false; }; "editModeEnabled": { "alias": "editModeEnabled"; "required": false; }; }, { "uploadSuccess": "uploadSuccess"; "bulkComplete": "bulkComplete"; "error": "error"; "rateLimited": "rateLimited"; "uploadStart": "uploadStart"; "uploadProgress": "uploadProgress"; "uploadError": "uploadError"; "retry": "retry"; "download": "download"; "copyLink": "copyLink"; "detailsOpened": "detailsOpened"; "detailsClosed": "detailsClosed"; "pendingFilesChange": "pendingFilesChange"; "proximityChange": "proximityChange"; }, never, ["*"], true, never>;
482
511
  }
483
512
 
484
513
  declare class PdxFilesUploadFieldComponent extends SimpleBaseInputComponent {
@@ -620,10 +649,36 @@ declare const FILES_UPLOAD_PT_BR: {
620
649
  'praxis.filesUpload.errors.UNKNOWN_ERROR': string;
621
650
  };
622
651
 
623
- /** Metadata for PraxisFilesUpload component */
624
652
  declare const PRAXIS_FILES_UPLOAD_COMPONENT_METADATA: ComponentDocMeta;
625
- /** Provider para auto-registrar metadados do componente Files Upload. */
626
653
  declare function providePraxisFilesUploadMetadata(): Provider;
627
654
 
628
- export { BulkUploadResultStatus, ErrorCode, ErrorMapperService, FILES_UPLOAD_ERROR_MESSAGES, FILES_UPLOAD_PT_BR, FILES_UPLOAD_TEXTS, FilesApiClient, PRAXIS_FILES_UPLOAD_COMPONENT_METADATA, PdxFilesUploadFieldComponent, PraxisFilesUpload, PraxisFilesUploadConfigEditor, PresignedUploaderService, ScanStatus, TRANSLATE_LIKE, acceptValidator, maxBulkSizeValidator, maxFileSizeValidator, maxFilesPerBulkValidator, providePraxisFilesUploadMetadata };
629
- export type { BulkConfig, BulkUploadFile, BulkUploadFileResult, BulkUploadOptions, BulkUploadResponse, EffectiveUploadConfig, ErrorResponse, FileMetadata, FileUploadOptions, FilesUploadConfig, FilesUploadTexts, MappedError, Metadata, PresignResponse, QuotasConfig, RateLimitConfig, RateLimitInfo, ServerMessages, TranslateLike, UploadOptions, UploadResponse };
655
+ /**
656
+ * Capabilities catalog for FilesUploadConfig.
657
+ * Paths follow FilesUploadConfig shape (patch merged at config root).
658
+ */
659
+
660
+ declare module '@praxisui/core' {
661
+ interface AiCapabilityCategoryMap {
662
+ strategy: true;
663
+ ui: true;
664
+ limits: true;
665
+ options: true;
666
+ bulk: true;
667
+ quotas: true;
668
+ rateLimit: true;
669
+ headers: true;
670
+ messages: true;
671
+ }
672
+ }
673
+ type CapabilityCategory = AiCapabilityCategory;
674
+ type ValueKind = AiValueKind;
675
+ interface Capability extends AiCapability {
676
+ category: CapabilityCategory;
677
+ }
678
+ interface CapabilityCatalog extends AiCapabilityCatalog {
679
+ capabilities: Capability[];
680
+ }
681
+ declare const FILES_UPLOAD_AI_CAPABILITIES: CapabilityCatalog;
682
+
683
+ export { BulkUploadResultStatus, ErrorCode, ErrorMapperService, FILES_UPLOAD_AI_CAPABILITIES, FILES_UPLOAD_ERROR_MESSAGES, FILES_UPLOAD_PT_BR, FILES_UPLOAD_TEXTS, FilesApiClient, PRAXIS_FILES_UPLOAD_COMPONENT_METADATA, PdxFilesUploadFieldComponent, PraxisFilesUpload, PraxisFilesUploadConfigEditor, PresignedUploaderService, ScanStatus, TRANSLATE_LIKE, acceptValidator, maxBulkSizeValidator, maxFileSizeValidator, maxFilesPerBulkValidator, providePraxisFilesUploadMetadata };
684
+ export type { BulkConfig, BulkUploadFile, BulkUploadFileResult, BulkUploadOptions, BulkUploadResponse, Capability, CapabilityCatalog, CapabilityCategory, EffectiveUploadConfig, ErrorResponse, FileMetadata, FileUploadOptions, FilesUploadConfig, FilesUploadTexts, MappedError, Metadata, PresignResponse, QuotasConfig, RateLimitConfig, RateLimitInfo, ServerMessages, TranslateLike, UploadOptions, UploadProgressEvent, UploadResponse, UploadStartEvent, ValueKind };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@praxisui/files-upload",
3
- "version": "1.0.0-beta.5",
3
+ "version": "1.0.0-beta.52",
4
4
  "description": "File upload components and services for Praxis UI with presigned and direct strategies, quotas and rate-limit handling.",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^20.0.0",
7
7
  "@angular/core": "^20.0.0",
8
8
  "@angular/material": "^20.0.0",
9
9
  "@ngx-translate/core": "^17.0.0",
10
- "@praxisui/settings-panel": "^1.0.0-beta.5"
10
+ "@praxisui/settings-panel": "^1.0.0-beta.52"
11
11
  },
12
12
  "dependencies": {
13
13
  "tslib": "^2.3.0"
@@ -18,11 +18,11 @@
18
18
  },
19
19
  "repository": {
20
20
  "type": "git",
21
- "url": "https://github.com/codexrodrigues/praxis"
21
+ "url": "https://github.com/codexrodrigues/praxis-ui-angular"
22
22
  },
23
- "homepage": "https://github.com/codexrodrigues/praxis#readme",
23
+ "homepage": "https://github.com/codexrodrigues/praxis-ui-angular#readme",
24
24
  "bugs": {
25
- "url": "https://github.com/codexrodrigues/praxis/issues"
25
+ "url": "https://github.com/codexrodrigues/praxis-ui-angular/issues"
26
26
  },
27
27
  "keywords": [
28
28
  "angular",