@uploadcare/file-uploader 1.32.0-alpha.1 → 1.32.0

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.
Files changed (66) hide show
  1. package/dist/abstract/loadFileUploaderFrom.js +2 -2
  2. package/dist/env.js +3 -3
  3. package/dist/index.css +2 -2
  4. package/dist/index.d.ts +29 -18
  5. package/dist/index.js +4 -4
  6. package/dist/index.layered.css +2 -2
  7. package/dist/index.ssr.js +1 -1
  8. package/dist/locales/file-uploader/ar.js +2 -2
  9. package/dist/locales/file-uploader/az.js +2 -2
  10. package/dist/locales/file-uploader/ca.js +2 -2
  11. package/dist/locales/file-uploader/cs.js +2 -2
  12. package/dist/locales/file-uploader/da.js +2 -2
  13. package/dist/locales/file-uploader/de.js +2 -2
  14. package/dist/locales/file-uploader/el.js +2 -2
  15. package/dist/locales/file-uploader/en.js +2 -2
  16. package/dist/locales/file-uploader/es.js +2 -2
  17. package/dist/locales/file-uploader/et.js +2 -2
  18. package/dist/locales/file-uploader/fi.js +2 -2
  19. package/dist/locales/file-uploader/fr.js +2 -2
  20. package/dist/locales/file-uploader/he.js +2 -2
  21. package/dist/locales/file-uploader/hy.js +2 -2
  22. package/dist/locales/file-uploader/is.js +2 -2
  23. package/dist/locales/file-uploader/it.js +2 -2
  24. package/dist/locales/file-uploader/ja.js +2 -2
  25. package/dist/locales/file-uploader/ka.js +2 -2
  26. package/dist/locales/file-uploader/kk.js +2 -2
  27. package/dist/locales/file-uploader/ko.js +2 -2
  28. package/dist/locales/file-uploader/lv.js +2 -2
  29. package/dist/locales/file-uploader/nb.js +2 -2
  30. package/dist/locales/file-uploader/nl.js +2 -2
  31. package/dist/locales/file-uploader/pl.js +2 -2
  32. package/dist/locales/file-uploader/pt.js +2 -2
  33. package/dist/locales/file-uploader/ro.js +2 -2
  34. package/dist/locales/file-uploader/ru.js +2 -2
  35. package/dist/locales/file-uploader/sk.js +2 -2
  36. package/dist/locales/file-uploader/sr.js +2 -2
  37. package/dist/locales/file-uploader/sv.js +2 -2
  38. package/dist/locales/file-uploader/tr.js +2 -2
  39. package/dist/locales/file-uploader/uk.js +2 -2
  40. package/dist/locales/file-uploader/vi.js +2 -2
  41. package/dist/locales/file-uploader/zh-TW.js +2 -2
  42. package/dist/locales/file-uploader/zh.js +2 -2
  43. package/package.json +5 -5
  44. package/web/file-uploader.iife.min.d.ts +29 -18
  45. package/web/file-uploader.iife.min.js +4 -4
  46. package/web/file-uploader.min.d.ts +29 -18
  47. package/web/file-uploader.min.js +4 -4
  48. package/web/uc-basic.layered.min.css +2 -2
  49. package/web/uc-basic.min.css +2 -2
  50. package/web/uc-cloud-image-editor.layered.min.css +2 -2
  51. package/web/uc-cloud-image-editor.min.css +2 -2
  52. package/web/uc-cloud-image-editor.min.d.ts +27 -16
  53. package/web/uc-cloud-image-editor.min.js +4 -4
  54. package/web/uc-file-uploader-inline.layered.min.css +2 -2
  55. package/web/uc-file-uploader-inline.min.css +2 -2
  56. package/web/uc-file-uploader-inline.min.d.ts +29 -18
  57. package/web/uc-file-uploader-inline.min.js +4 -4
  58. package/web/uc-file-uploader-minimal.layered.min.css +2 -2
  59. package/web/uc-file-uploader-minimal.min.css +2 -2
  60. package/web/uc-file-uploader-minimal.min.d.ts +29 -18
  61. package/web/uc-file-uploader-minimal.min.js +4 -4
  62. package/web/uc-file-uploader-regular.layered.min.css +2 -2
  63. package/web/uc-file-uploader-regular.min.css +2 -2
  64. package/web/uc-file-uploader-regular.min.d.ts +29 -18
  65. package/web/uc-file-uploader-regular.min.js +4 -4
  66. package/web/uc-img.min.js +3 -3
@@ -2,8 +2,8 @@ import { LitElement, PropertyValues, TemplateResult, nothing } from 'lit';
2
2
  import * as lit_html from 'lit-html';
3
3
  import * as lit_html_directives_ref_js from 'lit-html/directives/ref.js';
4
4
  import * as _uploadcare_upload_client from '@uploadcare/upload-client';
5
- import { UploadcareFile, FileFromOptions, Metadata, UploadError, NetworkError, UploadcareGroup, Queue } from '@uploadcare/upload-client';
6
- export { Metadata, NetworkError, UploadError, UploadcareError, UploadcareFile, UploadcareGroup } from '@uploadcare/upload-client';
5
+ import { UploadcareFile, FileFromOptions, Metadata, Tags, UploadError, NetworkError, UploadcareGroup, Queue } from '@uploadcare/upload-client';
6
+ export { Metadata, NetworkError, Tags, UploadError, UploadcareError, UploadcareFile, UploadcareGroup } from '@uploadcare/upload-client';
7
7
  import { Ref } from 'lit/directives/ref.js';
8
8
  import { TelemetryRequest } from '@uploadcare/quality-insights';
9
9
 
@@ -1363,6 +1363,20 @@ declare class UploaderPublicApi extends SharedInstance {
1363
1363
  fullPath?: string;
1364
1364
  }) => OutputFileEntry<"idle">;
1365
1365
  addFileFromUploadcareFile: (file: UploadcareFile, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"success">;
1366
+ /**
1367
+ * Replace an existing entry with an already-uploaded Uploadcare file, keeping
1368
+ * its position in the list. The original entry is removed and a fresh one is
1369
+ * added in its place, so the replacement goes through the full add pipeline
1370
+ * (validators, events) like any newly added file.
1371
+ *
1372
+ * The original entry's `source`, `metadata`, `fullPath` and `silent` are
1373
+ * preserved by default; `silent`, `fileName` and `source` can be overridden
1374
+ * via `options`.
1375
+ *
1376
+ * Returns the new entry. Note: it has a NEW `internalId` — use the returned
1377
+ * entry to reference the replacement going forward.
1378
+ */
1379
+ replaceFile: (internalId: string, file: UploadcareFile, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"success">;
1366
1380
  removeFileByInternalId: (internalId: string) => void;
1367
1381
  removeAllFiles(): void;
1368
1382
  uploadAll: () => void;
@@ -1451,6 +1465,7 @@ declare class LitUploaderBlock extends LitActivityBlock {
1451
1465
  private _flushCommonUploadProgress;
1452
1466
  private _setInitialCrop;
1453
1467
  protected getMetadataFor(entryId: string): Promise<_uploadcare_upload_client.Metadata | undefined>;
1468
+ protected getTagsFor(entryId: string): Promise<_uploadcare_upload_client.Tags | undefined>;
1454
1469
  protected getUploadClientOptions(): Promise<FileFromOptions>;
1455
1470
  getOutputData(): OutputFileEntry[];
1456
1471
  }
@@ -1593,7 +1608,7 @@ declare global {
1593
1608
  /**
1594
1609
  * Config keys that can't be passed as attribute (because they are object or function)
1595
1610
  */
1596
- declare const complexConfigKeys: readonly ["metadata", "plugins", "localeDefinitionOverride", "secureUploadsSignatureResolver", "secureDeliveryProxyUrlResolver", "iconHrefResolver", "fileValidators", "collectionValidators", "mediaRecorderOptions"];
1611
+ declare const complexConfigKeys: readonly ["metadata", "tags", "plugins", "localeDefinitionOverride", "secureUploadsSignatureResolver", "secureDeliveryProxyUrlResolver", "iconHrefResolver", "fileValidators", "collectionValidators", "mediaRecorderOptions"];
1597
1612
  declare class Config extends LitBlock {
1598
1613
  attributesMeta: Partial<ConfigPlainType> & {
1599
1614
  'ctx-name': string;
@@ -1978,6 +1993,7 @@ declare global {
1978
1993
  }
1979
1994
 
1980
1995
  type MetadataCallback = (fileEntry: OutputFileEntry) => Promise<Metadata> | Metadata;
1996
+ type TagsCallback = (fileEntry: OutputFileEntry) => Promise<Tags> | Tags;
1981
1997
  type LocaleDefinitionOverride = Record<string, Partial<LocaleDefinition & CustomLocaleDefinition>>;
1982
1998
  type SecureDeliveryProxyUrlResolver = (previewUrl: string, urlParts: {
1983
1999
  uuid: string;
@@ -2197,6 +2213,10 @@ type ConfigType = {
2197
2213
  * Metadata for the file.
2198
2214
  */
2199
2215
  metadata: Metadata | MetadataCallback | null;
2216
+ /**
2217
+ * Tags for the file.
2218
+ */
2219
+ tags: Tags | TagsCallback | null;
2200
2220
  /**
2201
2221
  * Override locale definitions.
2202
2222
  */
@@ -2346,6 +2366,7 @@ type OutputFileEntry<TStatus extends OutputFileStatus = OutputFileStatus> = {
2346
2366
  isImage: boolean;
2347
2367
  mimeType: string;
2348
2368
  metadata: Metadata | null;
2369
+ tags: Tags | null;
2349
2370
  file: File | Blob | null;
2350
2371
  externalUrl: string | null;
2351
2372
  uploadProgress: number;
@@ -2583,22 +2604,11 @@ type PluginFilesApi = {
2583
2604
  /**
2584
2605
  * Update mutable properties of a file entry by its internalId.
2585
2606
  * `fileSize` is recalculated automatically when `file` is provided.
2586
- */
2587
- update: (internalId: string, changes: PluginFileEntryUpdate) => void;
2588
- /**
2589
- * Replace an existing entry with an already-uploaded Uploadcare file, keeping
2590
- * its position in the list. The original entry is removed and a fresh one is
2591
- * added in its place, so the replacement goes through the full add pipeline
2592
- * (validators, events) like any newly added file.
2593
2607
  *
2594
- * The original entry's `source`, `metadata`, `fullPath` and `silent` are
2595
- * preserved by default; `silent`, `fileName` and `source` can be overridden
2596
- * via `options`.
2597
- *
2598
- * Returns the new entry. Note: it has a NEW `internalId` — use the returned
2599
- * entry to reference the replacement going forward.
2608
+ * Other file operations (add / remove / `replaceFile`) live on the public
2609
+ * uploader API, which plugins receive as `uploaderApi` in `setup`.
2600
2610
  */
2601
- replace: (internalId: string, file: UploadcareFile, options?: ApiAddFileCommonOptions) => OutputFileEntry<'success'>;
2611
+ update: (internalId: string, changes: PluginFileEntryUpdate) => void;
2602
2612
  };
2603
2613
  type PluginApi = {
2604
2614
  registry: PluginRegistryApi;
@@ -2653,6 +2663,7 @@ interface UploadEntryData extends Record<string, unknown> {
2653
2663
  source: string | null;
2654
2664
  fullPath: string | null;
2655
2665
  metadata: Metadata | null;
2666
+ tags: Tags | null;
2656
2667
  errors: OutputErrorFile[];
2657
2668
  uploadError: Error | null;
2658
2669
  isRemoved: boolean;
@@ -3448,4 +3459,4 @@ declare global {
3448
3459
  declare const PACKAGE_NAME = "blocks";
3449
3460
  declare const PACKAGE_VERSION: string;
3450
3461
 
3451
- export { LitActivityBlock as ActivityBlock, ActivityHeader, type ActivityType, type ApiAddFileCommonOptions, BaseComponent, LitBlock as Block, BtnUi, CameraSource, CloudImageEditor, CloudImageEditorActivity, CloudImageEditorBlock, type CollectionValidators, Config, type ConfigAttributesType, type ConfigComplexType, type ConfigPlainType, type ConfigType, Copyright, CropFrame, type CustomActivities, type CustomConfig, type CustomConfigDefinition, type CustomLocaleDefinition, PubSub as Data, DropArea, DropDown, DynamicBtn, EditorAspectRatioButtonControl, EditorCropButtonControl, EditorFilterControl, EditorFreeformButtonControl, EditorImageCropper, EditorImageFader, EditorOperationControl, EditorScroller, EditorSlider, EditorToolbar, type EventMap, type EventPayload, EventType, ExternalSource, ExternalUploadSource, FileActionButton, FileItem, FileUploaderInline, FileUploaderMinimal, FileUploaderRegular, type FileValidator, type FileValidatorDescriptor, type FileValidators, FormInput, type FuncCollectionValidator, type FuncFileValidator, type GroupFlag, Icon, type IconHrefResolver, Img, type KebabCase$1 as KebabCase, type KebabCaseKeys, LineLoaderUi, type LocaleDefinitionOverride, type LowerCase, type LowerCaseKeys, type MetadataCallback, Modal, ModalEvents, type ModalId, NoWrapModeDynamicBtn, type OutputCollectionErrorType, type OutputCollectionState, type OutputCollectionStatus, type OutputCustomErrorType, type OutputError, type OutputErrorCollection, type OutputErrorFile, type OutputErrorTypePayload, type OutputFileEntry, type OutputFileErrorPayload, type OutputFileErrorType, type OutputFileStatus, type Owned, PACKAGE_NAME, PACKAGE_VERSION, type PluginActivityApi, PluginActivityHost, type PluginActivityRegistration, PluginActivityRenderer, type PluginApi, type PluginConfigApi, type PluginFileActionRegistration, type PluginFileEntryUpdate, type PluginFileHookContext, type PluginFileHookRegistration, type PluginFileHookResult, type PluginFilesApi, type PluginIconRegistration, type PluginL10nRegistration, type PluginRegistryApi, type PluginRegistrySnapshot, type PluginRender, type PluginRenderDispose, type PluginSetupParams, type PluginSetupResult, type PluginSourceRegistration, type PluginUploaderApi, PresenceToggle, PrimaryAction, ProgressBar, ProgressBarCommon, type SecureDeliveryProxyUrlResolver, type SecureUploadsSignatureAndExpire, type SecureUploadsSignatureResolver, Select, SimpleBtn, SliderUi, LitSolutionBlock as SolutionBlock, SourceBtn, SourceList, type SourceTypes, Spinner, StartFrom, Thumb, UID, UploadCtxProvider, UploadList, UploadSource, LitUploaderBlock as UploaderBlock, type UploaderPlugin, UploaderPublicApi, UrlSource, defineComponents, defineLocale, loadFileUploaderFrom, toKebabCase };
3462
+ export { LitActivityBlock as ActivityBlock, ActivityHeader, type ActivityType, type ApiAddFileCommonOptions, BaseComponent, LitBlock as Block, BtnUi, CameraSource, CloudImageEditor, CloudImageEditorActivity, CloudImageEditorBlock, type CollectionValidators, Config, type ConfigAttributesType, type ConfigComplexType, type ConfigPlainType, type ConfigType, Copyright, CropFrame, type CustomActivities, type CustomConfig, type CustomConfigDefinition, type CustomLocaleDefinition, PubSub as Data, DropArea, DropDown, DynamicBtn, EditorAspectRatioButtonControl, EditorCropButtonControl, EditorFilterControl, EditorFreeformButtonControl, EditorImageCropper, EditorImageFader, EditorOperationControl, EditorScroller, EditorSlider, EditorToolbar, type EventMap, type EventPayload, EventType, ExternalSource, ExternalUploadSource, FileActionButton, FileItem, FileUploaderInline, FileUploaderMinimal, FileUploaderRegular, type FileValidator, type FileValidatorDescriptor, type FileValidators, FormInput, type FuncCollectionValidator, type FuncFileValidator, type GroupFlag, Icon, type IconHrefResolver, Img, type KebabCase$1 as KebabCase, type KebabCaseKeys, LineLoaderUi, type LocaleDefinitionOverride, type LowerCase, type LowerCaseKeys, type MetadataCallback, Modal, ModalEvents, type ModalId, NoWrapModeDynamicBtn, type OutputCollectionErrorType, type OutputCollectionState, type OutputCollectionStatus, type OutputCustomErrorType, type OutputError, type OutputErrorCollection, type OutputErrorFile, type OutputErrorTypePayload, type OutputFileEntry, type OutputFileErrorPayload, type OutputFileErrorType, type OutputFileStatus, type Owned, PACKAGE_NAME, PACKAGE_VERSION, type PluginActivityApi, PluginActivityHost, type PluginActivityRegistration, PluginActivityRenderer, type PluginApi, type PluginConfigApi, type PluginFileActionRegistration, type PluginFileEntryUpdate, type PluginFileHookContext, type PluginFileHookRegistration, type PluginFileHookResult, type PluginFilesApi, type PluginIconRegistration, type PluginL10nRegistration, type PluginRegistryApi, type PluginRegistrySnapshot, type PluginRender, type PluginRenderDispose, type PluginSetupParams, type PluginSetupResult, type PluginSourceRegistration, type PluginUploaderApi, PresenceToggle, PrimaryAction, ProgressBar, ProgressBarCommon, type SecureDeliveryProxyUrlResolver, type SecureUploadsSignatureAndExpire, type SecureUploadsSignatureResolver, Select, SimpleBtn, SliderUi, LitSolutionBlock as SolutionBlock, SourceBtn, SourceList, type SourceTypes, Spinner, StartFrom, type TagsCallback, Thumb, UID, UploadCtxProvider, UploadList, UploadSource, LitUploaderBlock as UploaderBlock, type UploaderPlugin, UploaderPublicApi, UrlSource, defineComponents, defineLocale, loadFileUploaderFrom, toKebabCase };