@uploadcare/file-uploader 1.29.0-alpha.2 → 1.30.0-alpha.1

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 (107) hide show
  1. package/README.md +0 -2
  2. package/dist/abstract/loadFileUploaderFrom.js +2 -2
  3. package/dist/env.js +3 -3
  4. package/dist/index.css +3 -3
  5. package/dist/index.d.ts +337 -691
  6. package/dist/index.js +5 -5
  7. package/dist/index.layered.css +3 -3
  8. package/dist/index.ssr.js +82 -115
  9. package/dist/locales/file-uploader/ar.d.ts +2 -0
  10. package/dist/locales/file-uploader/ar.js +3 -3
  11. package/dist/locales/file-uploader/az.d.ts +2 -0
  12. package/dist/locales/file-uploader/az.js +3 -3
  13. package/dist/locales/file-uploader/ca.d.ts +2 -0
  14. package/dist/locales/file-uploader/ca.js +3 -3
  15. package/dist/locales/file-uploader/cs.d.ts +2 -0
  16. package/dist/locales/file-uploader/cs.js +3 -3
  17. package/dist/locales/file-uploader/da.d.ts +2 -0
  18. package/dist/locales/file-uploader/da.js +3 -3
  19. package/dist/locales/file-uploader/de.d.ts +2 -0
  20. package/dist/locales/file-uploader/de.js +3 -3
  21. package/dist/locales/file-uploader/el.d.ts +2 -0
  22. package/dist/locales/file-uploader/el.js +3 -3
  23. package/dist/locales/file-uploader/en.d.ts +2 -0
  24. package/dist/locales/file-uploader/en.js +3 -3
  25. package/dist/locales/file-uploader/es.d.ts +2 -0
  26. package/dist/locales/file-uploader/es.js +3 -3
  27. package/dist/locales/file-uploader/et.d.ts +2 -0
  28. package/dist/locales/file-uploader/et.js +3 -3
  29. package/dist/locales/file-uploader/fi.d.ts +2 -0
  30. package/dist/locales/file-uploader/fi.js +3 -3
  31. package/dist/locales/file-uploader/fr.d.ts +2 -0
  32. package/dist/locales/file-uploader/fr.js +3 -3
  33. package/dist/locales/file-uploader/he.d.ts +2 -0
  34. package/dist/locales/file-uploader/he.js +3 -3
  35. package/dist/locales/file-uploader/hy.d.ts +2 -0
  36. package/dist/locales/file-uploader/hy.js +3 -3
  37. package/dist/locales/file-uploader/is.d.ts +2 -0
  38. package/dist/locales/file-uploader/is.js +3 -3
  39. package/dist/locales/file-uploader/it.d.ts +2 -0
  40. package/dist/locales/file-uploader/it.js +3 -3
  41. package/dist/locales/file-uploader/ja.d.ts +2 -0
  42. package/dist/locales/file-uploader/ja.js +3 -3
  43. package/dist/locales/file-uploader/ka.d.ts +2 -0
  44. package/dist/locales/file-uploader/ka.js +3 -3
  45. package/dist/locales/file-uploader/kk.d.ts +2 -0
  46. package/dist/locales/file-uploader/kk.js +3 -3
  47. package/dist/locales/file-uploader/ko.d.ts +2 -0
  48. package/dist/locales/file-uploader/ko.js +3 -3
  49. package/dist/locales/file-uploader/lv.d.ts +2 -0
  50. package/dist/locales/file-uploader/lv.js +3 -3
  51. package/dist/locales/file-uploader/nb.d.ts +2 -0
  52. package/dist/locales/file-uploader/nb.js +3 -3
  53. package/dist/locales/file-uploader/nl.d.ts +2 -0
  54. package/dist/locales/file-uploader/nl.js +3 -3
  55. package/dist/locales/file-uploader/pl.d.ts +2 -0
  56. package/dist/locales/file-uploader/pl.js +3 -3
  57. package/dist/locales/file-uploader/pt.d.ts +2 -0
  58. package/dist/locales/file-uploader/pt.js +3 -3
  59. package/dist/locales/file-uploader/ro.d.ts +2 -0
  60. package/dist/locales/file-uploader/ro.js +3 -3
  61. package/dist/locales/file-uploader/ru.d.ts +2 -0
  62. package/dist/locales/file-uploader/ru.js +3 -3
  63. package/dist/locales/file-uploader/sk.d.ts +2 -0
  64. package/dist/locales/file-uploader/sk.js +3 -3
  65. package/dist/locales/file-uploader/sr.d.ts +2 -0
  66. package/dist/locales/file-uploader/sr.js +3 -3
  67. package/dist/locales/file-uploader/sv.d.ts +2 -0
  68. package/dist/locales/file-uploader/sv.js +3 -3
  69. package/dist/locales/file-uploader/tr.d.ts +2 -0
  70. package/dist/locales/file-uploader/tr.js +3 -3
  71. package/dist/locales/file-uploader/uk.d.ts +2 -0
  72. package/dist/locales/file-uploader/uk.js +3 -3
  73. package/dist/locales/file-uploader/vi.d.ts +2 -0
  74. package/dist/locales/file-uploader/vi.js +3 -3
  75. package/dist/locales/file-uploader/zh-TW.d.ts +2 -0
  76. package/dist/locales/file-uploader/zh-TW.js +3 -3
  77. package/dist/locales/file-uploader/zh.d.ts +2 -0
  78. package/dist/locales/file-uploader/zh.js +3 -3
  79. package/package.json +29 -29
  80. package/web/file-uploader.iife.min.d.ts +339 -691
  81. package/web/file-uploader.iife.min.js +4 -4
  82. package/web/file-uploader.iife.min.js.LEGAL.txt +1 -1
  83. package/web/file-uploader.min.d.ts +339 -691
  84. package/web/file-uploader.min.js +4 -4
  85. package/web/file-uploader.min.js.LEGAL.txt +1 -1
  86. package/web/uc-basic.layered.min.css +3 -3
  87. package/web/uc-basic.min.css +3 -3
  88. package/web/uc-cloud-image-editor.layered.min.css +3 -3
  89. package/web/uc-cloud-image-editor.min.css +3 -3
  90. package/web/uc-cloud-image-editor.min.d.ts +291 -643
  91. package/web/uc-cloud-image-editor.min.js +4 -4
  92. package/web/uc-file-uploader-inline.layered.min.css +3 -3
  93. package/web/uc-file-uploader-inline.min.css +3 -3
  94. package/web/uc-file-uploader-inline.min.d.ts +339 -691
  95. package/web/uc-file-uploader-inline.min.js +4 -4
  96. package/web/uc-file-uploader-inline.min.js.LEGAL.txt +1 -1
  97. package/web/uc-file-uploader-minimal.layered.min.css +3 -3
  98. package/web/uc-file-uploader-minimal.min.css +3 -3
  99. package/web/uc-file-uploader-minimal.min.d.ts +339 -691
  100. package/web/uc-file-uploader-minimal.min.js +4 -4
  101. package/web/uc-file-uploader-minimal.min.js.LEGAL.txt +1 -1
  102. package/web/uc-file-uploader-regular.layered.min.css +3 -3
  103. package/web/uc-file-uploader-regular.min.css +3 -3
  104. package/web/uc-file-uploader-regular.min.d.ts +339 -691
  105. package/web/uc-file-uploader-regular.min.js +4 -4
  106. package/web/uc-file-uploader-regular.min.js.LEGAL.txt +1 -1
  107. package/web/uc-img.min.js +3 -3
@@ -2,7 +2,7 @@ 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 { FileFromOptions, Metadata, UploadcareFile, UploadError, NetworkError, UploadcareGroup, Queue } from '@uploadcare/upload-client';
5
+ import { UploadcareFile, Metadata, FileFromOptions, UploadError, NetworkError, UploadcareGroup, Queue } from '@uploadcare/upload-client';
6
6
  export { Metadata, NetworkError, 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';
@@ -135,6 +135,7 @@ declare const _default: {
135
135
  'src-type-camera': string;
136
136
  'src-type-mobile-video-camera': string;
137
137
  'src-type-mobile-photo-camera': string;
138
+ 'src-type-draw': string;
138
139
  'src-type-facebook': string;
139
140
  'src-type-dropbox': string;
140
141
  'src-type-gdrive': string;
@@ -149,6 +150,7 @@ declare const _default: {
149
150
  'src-type-other': string;
150
151
  'caption-from-url': string;
151
152
  'caption-camera': string;
153
+ 'caption-draw': string;
152
154
  'caption-edit-file': string;
153
155
  'file-no-name': string;
154
156
  'toggle-fullscreen': string;
@@ -230,72 +232,8 @@ declare class A11y implements ISharedInstance {
230
232
  declare class LocaleManager extends SharedInstance {
231
233
  private _localeName;
232
234
  constructor(sharedInstancesBag: SharedInstancesBag);
233
- private _applyOverrides;
234
- private _applyPluginLocales;
235
235
  }
236
236
 
237
- /**
238
- * Custom configuration options registration system for plugins
239
- */
240
- type CustomConfigDefinition<T = unknown> = {
241
- /**
242
- * Config option name (will be used as property and optionally as attribute)
243
- */
244
- name: string;
245
- /**
246
- * Default value for the config option
247
- */
248
- defaultValue: T;
249
- /**
250
- * Whether this config can be set via HTML attribute
251
- * @default true
252
- */
253
- attribute?: boolean;
254
- /**
255
- * Convert attribute string to config value
256
- * Only used if attribute is true
257
- */
258
- fromAttribute?: (value: string | null) => T;
259
- /**
260
- * Convert config value to attribute string
261
- * Only used if attribute is true
262
- */
263
- toAttribute?: (value: T) => string | null;
264
- /**
265
- * Normalize/validate the config value
266
- */
267
- normalize?: (value: unknown) => T;
268
- };
269
- /**
270
- * Registry for custom config options defined by plugins
271
- * This is managed by the PluginManager as a shared instance property
272
- */
273
- declare class CustomConfigRegistry {
274
- private _definitions;
275
- register<T = unknown>(pluginId: string, definition: CustomConfigDefinition<T>): void;
276
- unregister(name: string): void;
277
- unregisterByPlugin(pluginId: string): void;
278
- get(name: string): CustomConfigDefinition<any> | undefined;
279
- getAll(): Map<string, CustomConfigDefinition<any>>;
280
- }
281
- /**
282
- * Interface for TypeScript module augmentation
283
- * Plugins should extend this interface to add their custom config types
284
- *
285
- * @example
286
- * ```typescript
287
- * declare module '@uploadcare/file-uploader' {
288
- * interface CustomConfig {
289
- * 'my-custom-option': string;
290
- * }
291
- * }
292
- * ```
293
- */
294
- interface CustomConfig {
295
- }
296
-
297
- declare function buildOutputCollectionState<TCollectionStatus extends OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'>(bag: SharedInstancesBag): OutputCollectionState<TCollectionStatus, TGroupFlag>;
298
-
299
237
  declare class TypedData<T extends Record<string, unknown>> {
300
238
  private _ctxId;
301
239
  private _data;
@@ -308,41 +246,6 @@ declare class TypedData<T extends Record<string, unknown>> {
308
246
  destroy(): void;
309
247
  }
310
248
 
311
- type FuncFileValidator = (outputEntry: OutputFileEntry, api: UploaderPublicApi, options?: {
312
- signal?: AbortSignal;
313
- }) => undefined | OutputErrorFile | Promise<undefined | OutputErrorFile>;
314
- type FileValidatorDescriptor = {
315
- runOn: 'add' | 'upload' | 'change';
316
- validator: FuncFileValidator;
317
- };
318
- type FileValidator = FileValidatorDescriptor | FuncFileValidator;
319
- type FuncCollectionValidator = (collection: ReturnType<typeof buildOutputCollectionState<OutputCollectionStatus>>, api: UploaderPublicApi) => undefined | OutputErrorCollection;
320
- declare class ValidationManager extends SharedInstance {
321
- private get _uploadCollection();
322
- private _commonFileValidators;
323
- private _commonCollectionValidators;
324
- private _queue;
325
- private _runQueueDebounced;
326
- private _isDestroyed;
327
- private _entryValidationState;
328
- constructor(sharedInstancesBag: SharedInstancesBag);
329
- runFileValidators(runOn: FileValidatorDescriptor['runOn'], entryIds?: Uid[]): void;
330
- runCollectionValidators(): void;
331
- cleanupValidationForEntry(entry: TypedData<UploadEntryData>): void;
332
- private _runFileValidatorsForEntry;
333
- private _addCustomTypeToValidationError;
334
- private _getEntryValidationState;
335
- private _getValidatorDescriptors;
336
- private _getValidatorDescriptorsForEntry;
337
- destroy(): void;
338
- }
339
-
340
- declare class SecureUploadsManager extends SharedInstance {
341
- private _secureToken;
342
- getSecureToken(): Promise<SecureUploadsSignatureAndExpire | null>;
343
- destroy(): void;
344
- }
345
-
346
249
  type ChangeMap<T extends Record<string, unknown>> = Record<keyof T, Set<Uid>>;
347
250
  type TypedCollectionPropertyObserver<T extends Record<string, unknown>> = (changeMap: ChangeMap<T>) => void;
348
251
  type TypedCollectionObserverHandler<T extends Record<string, unknown>> = (list: Uid[], added: Set<TypedData<T>>, removed: Set<TypedData<T>>) => void;
@@ -394,6 +297,155 @@ declare const CameraSourceTypes: Readonly<{
394
297
  }>;
395
298
  type ModeCameraType = (typeof CameraSourceTypes)[keyof typeof CameraSourceTypes];
396
299
 
300
+ declare function buildOutputCollectionState<TCollectionStatus extends OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'>(bag: SharedInstancesBag): OutputCollectionState<TCollectionStatus, TGroupFlag>;
301
+
302
+ interface UploadEntryData extends Record<string, unknown> {
303
+ file: File | null;
304
+ externalUrl: string | null;
305
+ fileName: string | null;
306
+ fileSize: number | null;
307
+ lastModified: number;
308
+ uploadProgress: number;
309
+ uuid: string | null;
310
+ isImage: boolean;
311
+ mimeType: string | null;
312
+ ctxName: string | null;
313
+ cdnUrl: string | null;
314
+ cdnUrlModifiers: string | null;
315
+ fileInfo: UploadcareFile | null;
316
+ isUploading: boolean;
317
+ abortController: AbortController | null;
318
+ thumbUrl: string | null;
319
+ silent: boolean;
320
+ source: string | null;
321
+ fullPath: string | null;
322
+ metadata: Metadata | null;
323
+ errors: OutputErrorFile[];
324
+ uploadError: Error | null;
325
+ isRemoved: boolean;
326
+ isQueuedForUploading: boolean;
327
+ isValidationPending: boolean;
328
+ isQueuedForValidation: boolean;
329
+ }
330
+ type UploadEntryTypedData = TypedData<UploadEntryData>;
331
+ type UploadEntryKeys = keyof UploadEntryData;
332
+
333
+ type ApiAddFileCommonOptions = {
334
+ silent?: boolean;
335
+ fileName?: string;
336
+ source?: string;
337
+ };
338
+ declare class UploaderPublicApi extends SharedInstance {
339
+ private _l10n;
340
+ get _uploadCollection(): TypedCollection<UploadEntryData>;
341
+ get cfg(): Readonly<ConfigType>;
342
+ get l10n(): (str: string, variables?: Record<string, string | number>) => string;
343
+ /**
344
+ * TODO: Probably we should not allow user to override `source` property
345
+ */
346
+ addFileFromUrl: (url: string, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"idle">;
347
+ addFileFromUuid: (uuid: string, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"idle">;
348
+ addFileFromCdnUrl: (cdnUrl: string, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"idle">;
349
+ addFileFromObject: (file: File, { silent, fileName, source, fullPath, }?: ApiAddFileCommonOptions & {
350
+ fullPath?: string;
351
+ }) => OutputFileEntry<"idle">;
352
+ removeFileByInternalId: (internalId: string) => void;
353
+ removeAllFiles(): void;
354
+ uploadAll: () => void;
355
+ openSystemDialog: (options?: {
356
+ captureCamera?: boolean;
357
+ modeCamera?: ModeCameraType;
358
+ }) => void;
359
+ getOutputItem<TStatus extends OutputFileStatus>(entryId: string): OutputFileEntry<TStatus>;
360
+ getOutputCollectionState<TStatus extends OutputCollectionStatus>(): ReturnType<typeof buildOutputCollectionState<TStatus>>;
361
+ initFlow: (force?: boolean) => void;
362
+ doneFlow: () => void;
363
+ setCurrentActivity: <T extends RegisteredActivityType>(activityType: T, ...params: T extends keyof ActivityParamsMap ? [ActivityParamsMap[T]] : T extends RegisteredActivityType ? [undefined?] : [never]) => void;
364
+ getCurrentActivity: () => ActivityType;
365
+ setModalState: (opened: boolean) => void;
366
+ private get _sourceList();
367
+ }
368
+
369
+ declare const ExternalUploadSource: Readonly<{
370
+ readonly FACEBOOK: "facebook";
371
+ readonly DROPBOX: "dropbox";
372
+ readonly GDRIVE: "gdrive";
373
+ readonly GPHOTOS: "gphotos";
374
+ readonly FLICKR: "flickr";
375
+ readonly VK: "vk";
376
+ readonly EVERNOTE: "evernote";
377
+ readonly BOX: "box";
378
+ readonly ONEDRIVE: "onedrive";
379
+ readonly HUDDLE: "huddle";
380
+ }>;
381
+ declare const UploadSource: Readonly<{
382
+ readonly FACEBOOK: "facebook";
383
+ readonly DROPBOX: "dropbox";
384
+ readonly GDRIVE: "gdrive";
385
+ readonly GPHOTOS: "gphotos";
386
+ readonly FLICKR: "flickr";
387
+ readonly VK: "vk";
388
+ readonly EVERNOTE: "evernote";
389
+ readonly BOX: "box";
390
+ readonly ONEDRIVE: "onedrive";
391
+ readonly HUDDLE: "huddle";
392
+ readonly MOBILE_VIDEO_CAMERA: "mobile-video-camera";
393
+ readonly MOBILE_PHOTO_CAMERA: "mobile-photo-camera";
394
+ readonly LOCAL: "local";
395
+ readonly DROP_AREA: "drop-area";
396
+ readonly CAMERA: "camera";
397
+ readonly EXTERNAL: "external";
398
+ readonly API: "js-api";
399
+ readonly URL: "url";
400
+ readonly DRAW: "draw";
401
+ }>;
402
+ type SourceTypes = (typeof UploadSource)[keyof typeof UploadSource];
403
+
404
+ declare class LitUploaderBlock extends LitActivityBlock {
405
+ static extSrcList: Readonly<typeof ExternalUploadSource>;
406
+ static sourceTypes: Readonly<typeof UploadSource>;
407
+ protected couldBeCtxOwner: boolean;
408
+ private _isCtxOwner;
409
+ private _unobserveCollection?;
410
+ private _unobserveCollectionProperties?;
411
+ init$: {
412
+ '*commonProgress': number;
413
+ '*uploadList': never[];
414
+ '*uploadQueue': _uploadcare_upload_client.Queue;
415
+ '*collectionErrors': OutputErrorCollection[];
416
+ '*collectionState': OutputCollectionState | null;
417
+ '*groupInfo': _uploadcare_upload_client.UploadcareGroup | null;
418
+ '*uploadTrigger': Set<string>;
419
+ '*currentActivity': null;
420
+ '*currentActivityParams': {};
421
+ '*history': never[];
422
+ '*historyBack': null;
423
+ '*closeModal': () => void;
424
+ };
425
+ private get _hasCtxOwner();
426
+ initCallback(): void;
427
+ getAPI(): UploaderPublicApi;
428
+ get validationManager(): ValidationManager;
429
+ get api(): UploaderPublicApi;
430
+ get uploadCollection(): TypedCollection<UploadEntryData>;
431
+ get secureUploadsManager(): SecureUploadsManager;
432
+ disconnectedCallback(): void;
433
+ connectedCallback(): void;
434
+ private _initCtxOwner;
435
+ private _observeUploadCollection;
436
+ private _unobserveUploadCollection;
437
+ private _createGroup;
438
+ private _flushOutputItems;
439
+ private _handleCollectionUpdate;
440
+ private _handleCollectionPropertiesUpdate;
441
+ private _flushCommonUploadProgress;
442
+ private _openCloudImageEditor;
443
+ private _setInitialCrop;
444
+ protected getMetadataFor(entryId: string): Promise<_uploadcare_upload_client.Metadata | undefined>;
445
+ protected getUploadClientOptions(): Promise<FileFromOptions>;
446
+ getOutputData(): OutputFileEntry[];
447
+ }
448
+
397
449
  /**
398
450
  * Mapping of loading resources per operation
399
451
  */
@@ -508,14 +560,11 @@ declare global {
508
560
  declare class Icon extends LitBlock {
509
561
  name: string;
510
562
  private _resolvedHref;
511
- private _pluginSvg;
512
563
  private _iconHrefResolver;
513
- private _unsubscribePlugins?;
514
564
  initCallback(): void;
515
565
  protected willUpdate(changedProperties: PropertyValues<this>): void;
516
566
  private _updateResolvedHref;
517
567
  render(): lit_html.TemplateResult<1>;
518
- disconnectedCallback(): void;
519
568
  }
520
569
  declare global {
521
570
  interface HTMLElementTagNameMap {
@@ -1046,7 +1095,6 @@ declare class CloudImageEditorBlock extends LitBlock {
1046
1095
  private _hasNetworkProblems;
1047
1096
  private _isInitialized;
1048
1097
  private _pendingInitUpdate;
1049
- private _pendingSizeWait;
1050
1098
  private readonly _debouncedShowLoader;
1051
1099
  private readonly _imgRef;
1052
1100
  private readonly _cropperRef;
@@ -1096,11 +1144,12 @@ type ActivityParams$1 = {
1096
1144
  internalId: string;
1097
1145
  };
1098
1146
  declare class CloudImageEditorActivity extends LitUploaderBlock {
1147
+ couldBeCtxOwner: boolean;
1148
+ activityType: "cloud-image-edit";
1099
1149
  private _entry?;
1100
1150
  private _editorConfig;
1101
1151
  get activityParams(): ActivityParams$1;
1102
1152
  initCallback(): void;
1103
- disconnectedCallback(): void;
1104
1153
  private _handleApply;
1105
1154
  private _handleCancel;
1106
1155
  handleChange(event: CustomEvent<ChangeResult>): void;
@@ -1137,6 +1186,7 @@ type ActivityParams = {
1137
1186
  };
1138
1187
  declare class ExternalSource extends LitUploaderBlock {
1139
1188
  couldBeCtxOwner: boolean;
1189
+ activityType: "external";
1140
1190
  private _messageBridge?;
1141
1191
  private _iframeRef;
1142
1192
  private _latestSelectionSummary;
@@ -1180,26 +1230,22 @@ declare global {
1180
1230
  declare const ACTIVITY_TYPES: Readonly<{
1181
1231
  START_FROM: "start-from";
1182
1232
  CAMERA: "camera";
1233
+ DRAW: "draw";
1183
1234
  UPLOAD_LIST: "upload-list";
1184
1235
  URL: "url";
1185
1236
  CLOUD_IMG_EDIT: "cloud-image-edit";
1186
1237
  EXTERNAL: "external";
1187
1238
  }>;
1188
- type RegisteredActivityType = (typeof ACTIVITY_TYPES)[keyof typeof ACTIVITY_TYPES] | keyof CustomActivities;
1189
- type ActivityType = RegisteredActivityType | null;
1239
+ type RegisteredActivityType = (typeof ACTIVITY_TYPES)[keyof typeof ACTIVITY_TYPES];
1240
+ type ActivityType = RegisteredActivityType | (string & {}) | null;
1190
1241
 
1191
1242
  declare const ACTIVE_PROP = "___ACTIVITY_IS_ACTIVE___";
1192
- interface CustomActivities {
1193
- }
1194
1243
  type ActivityParamsMap = {
1195
1244
  'cloud-image-edit': ActivityParams$1;
1196
1245
  external: ActivityParams;
1197
- } & {
1198
- [Key in keyof CustomActivities]: CustomActivities[Key]['params'];
1199
1246
  };
1200
1247
  declare class LitActivityBlock extends LitBlock {
1201
1248
  protected historyTracked: boolean;
1202
- activityType: ActivityType;
1203
1249
  private [ACTIVE_PROP]?;
1204
1250
  init$: {
1205
1251
  '*currentActivity': null;
@@ -1213,11 +1259,12 @@ declare class LitActivityBlock extends LitBlock {
1213
1259
  private _activate;
1214
1260
  initCallback(): void;
1215
1261
  private _historyFlush;
1216
- protected _isActivityRegistered(): boolean;
1262
+ private _isActivityRegistered;
1217
1263
  private static _activityCallbacks;
1218
1264
  static activities: Readonly<{
1219
1265
  START_FROM: 'start-from';
1220
1266
  CAMERA: 'camera';
1267
+ DRAW: 'draw';
1221
1268
  UPLOAD_LIST: 'upload-list';
1222
1269
  URL: 'url';
1223
1270
  CLOUD_IMG_EDIT: 'cloud-image-edit';
@@ -1233,8 +1280,8 @@ declare class LitActivityBlock extends LitBlock {
1233
1280
  private _unregisterActivity;
1234
1281
  disconnectedCallback(): void;
1235
1282
  get activityParams(): ActivityParamsMap[keyof ActivityParamsMap];
1236
- get initActivity(): RegisteredActivityType | null;
1237
- get doneActivity(): RegisteredActivityType | null;
1283
+ get initActivity(): string | null;
1284
+ get doneActivity(): string | null;
1238
1285
  historyBack(): void;
1239
1286
  }
1240
1287
 
@@ -1296,9 +1343,7 @@ type EventPayload = {
1296
1343
  declare class EventEmitter extends SharedInstance {
1297
1344
  private _timeoutStore;
1298
1345
  private _targets;
1299
- private _listeners;
1300
1346
  bindTarget(target: LitBlock): () => void;
1301
- on<T extends EventKey>(type: T, handler: (payload: EventPayload[T]) => void): () => void;
1302
1347
  private _dispatch;
1303
1348
  emit<T extends EventKey, TDebounce extends boolean | number | undefined = undefined>(type: T, payload?: TDebounce extends false | undefined ? EventPayload[T] : () => EventPayload[T], options?: {
1304
1349
  debounce?: TDebounce;
@@ -1306,123 +1351,20 @@ declare class EventEmitter extends SharedInstance {
1306
1351
  destroy(): void;
1307
1352
  }
1308
1353
 
1309
- type ApiAddFileCommonOptions = {
1310
- silent?: boolean;
1311
- fileName?: string;
1312
- source?: string;
1354
+ type EventMap = {
1355
+ [T in keyof EventPayload]: CustomEvent<EventPayload[T]>;
1313
1356
  };
1314
- declare class UploaderPublicApi extends SharedInstance {
1315
- private _l10n;
1316
- get _uploadCollection(): TypedCollection<UploadEntryData>;
1317
- get cfg(): Readonly<ConfigType>;
1318
- get l10n(): (str: string, variables?: Record<string, string | number>) => string;
1319
- /**
1320
- * TODO: Probably we should not allow user to override `source` property
1321
- */
1322
- addFileFromUrl: (url: string, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"idle">;
1323
- addFileFromUuid: (uuid: string, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"idle">;
1324
- addFileFromCdnUrl: (cdnUrl: string, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"idle">;
1325
- addFileFromObject: (file: File, { silent, fileName, source, fullPath, }?: ApiAddFileCommonOptions & {
1326
- fullPath?: string;
1327
- }) => OutputFileEntry<"idle">;
1328
- removeFileByInternalId: (internalId: string) => void;
1329
- removeAllFiles(): void;
1330
- uploadAll: () => void;
1331
- openSystemDialog: (options?: {
1332
- captureCamera?: boolean;
1333
- modeCamera?: ModeCameraType;
1334
- }) => void;
1335
- getOutputItem<TStatus extends OutputFileStatus>(entryId: string): OutputFileEntry<TStatus>;
1336
- getOutputCollectionState<TStatus extends OutputCollectionStatus>(): ReturnType<typeof buildOutputCollectionState<TStatus>>;
1337
- initFlow: (force?: boolean) => void;
1338
- doneFlow: () => void;
1339
- private _pluginsReady;
1340
- setCurrentActivity: <T extends ActivityType>(activityType: T, ...params: T extends keyof ActivityParamsMap ? [ActivityParamsMap[T]] extends [never] ? [] : [ActivityParamsMap[T]] : []) => void;
1341
- on: <T extends EventKey>(type: T, handler: (payload: EventPayload[T]) => void) => (() => void);
1342
- getCurrentActivity: () => ActivityType;
1343
- historyBack: () => void;
1344
- setModalState: (opened: boolean) => void;
1345
- private get _sourceList();
1346
- }
1347
1357
 
1348
- declare const ExternalUploadSource: Readonly<{
1349
- readonly FACEBOOK: "facebook";
1350
- readonly DROPBOX: "dropbox";
1351
- readonly DROPBOX_CHOOSER: "dropboxchooser";
1352
- readonly GDRIVE: "gdrive";
1353
- readonly GPHOTOS: "gphotos";
1354
- readonly FLICKR: "flickr";
1355
- readonly VK: "vk";
1356
- readonly EVERNOTE: "evernote";
1357
- readonly BOX: "box";
1358
- readonly ONEDRIVE: "onedrive";
1359
- readonly HUDDLE: "huddle";
1360
- }>;
1361
- declare const UploadSource: Readonly<{
1362
- readonly FACEBOOK: "facebook";
1363
- readonly DROPBOX: "dropbox";
1364
- readonly DROPBOX_CHOOSER: "dropboxchooser";
1365
- readonly GDRIVE: "gdrive";
1366
- readonly GPHOTOS: "gphotos";
1367
- readonly FLICKR: "flickr";
1368
- readonly VK: "vk";
1369
- readonly EVERNOTE: "evernote";
1370
- readonly BOX: "box";
1371
- readonly ONEDRIVE: "onedrive";
1372
- readonly HUDDLE: "huddle";
1373
- readonly MOBILE_VIDEO_CAMERA: "mobile-video-camera";
1374
- readonly MOBILE_PHOTO_CAMERA: "mobile-photo-camera";
1375
- readonly LOCAL: "local";
1376
- readonly DROP_AREA: "drop-area";
1377
- readonly CAMERA: "camera";
1378
- readonly EXTERNAL: "external";
1379
- readonly API: "js-api";
1380
- readonly URL: "url";
1381
- }>;
1382
- type SourceTypes = (typeof UploadSource)[keyof typeof UploadSource];
1383
-
1384
- declare class LitUploaderBlock extends LitActivityBlock {
1385
- static extSrcList: Readonly<typeof ExternalUploadSource>;
1386
- static sourceTypes: Readonly<typeof UploadSource>;
1387
- protected couldBeCtxOwner: boolean;
1388
- private _isCtxOwner;
1389
- private _unobserveCollection?;
1390
- private _unobserveCollectionProperties?;
1391
- init$: {
1392
- '*commonProgress': number;
1393
- '*uploadList': never[];
1394
- '*uploadQueue': _uploadcare_upload_client.Queue;
1395
- '*collectionErrors': OutputErrorCollection[];
1396
- '*collectionState': OutputCollectionState | null;
1397
- '*groupInfo': _uploadcare_upload_client.UploadcareGroup | null;
1398
- '*uploadTrigger': Set<string>;
1399
- '*currentActivity': null;
1400
- '*currentActivityParams': {};
1401
- '*history': never[];
1402
- '*historyBack': null;
1403
- '*closeModal': () => void;
1404
- };
1405
- private get _hasCtxOwner();
1406
- initCallback(): void;
1407
- getAPI(): UploaderPublicApi;
1408
- get validationManager(): ValidationManager;
1409
- get api(): UploaderPublicApi;
1410
- get uploadCollection(): TypedCollection<UploadEntryData>;
1411
- get secureUploadsManager(): SecureUploadsManager;
1412
- disconnectedCallback(): void;
1413
- connectedCallback(): void;
1414
- private _initCtxOwner;
1415
- private _observeUploadCollection;
1416
- private _unobserveUploadCollection;
1417
- private _createGroup;
1418
- private _flushOutputItems;
1419
- private _handleCollectionUpdate;
1420
- private _handleCollectionPropertiesUpdate;
1421
- private _flushCommonUploadProgress;
1422
- private _setInitialCrop;
1423
- protected getMetadataFor(entryId: string): Promise<_uploadcare_upload_client.Metadata | undefined>;
1424
- protected getUploadClientOptions(): Promise<FileFromOptions>;
1425
- getOutputData(): OutputFileEntry[];
1358
+ type PasteScope = 'local' | 'global' | false;
1359
+ declare class ClipboardLayer extends SharedInstance {
1360
+ private scopes;
1361
+ private listener;
1362
+ constructor(sharedInstancesBag: SharedInstancesBag);
1363
+ private openUploadList;
1364
+ private _listener;
1365
+ private handlePaste;
1366
+ registerBlock(scope: Node): () => void;
1367
+ destroy(): void;
1426
1368
  }
1427
1369
 
1428
1370
  type SelectOption = {
@@ -1445,6 +1387,7 @@ declare global {
1445
1387
  type CameraMode = 'photo' | 'video';
1446
1388
  declare class CameraSource extends LitUploaderBlock {
1447
1389
  couldBeCtxOwner: boolean;
1390
+ activityType: "camera";
1448
1391
  private _unsubPermissions;
1449
1392
  private _capturing;
1450
1393
  private _chunks;
@@ -1466,6 +1409,7 @@ declare class CameraSource extends LitUploaderBlock {
1466
1409
  private _timerRef;
1467
1410
  private _lineRef;
1468
1411
  private _videoRef;
1412
+ private _switcherRef;
1469
1413
  private _startTime;
1470
1414
  private _elapsedTime;
1471
1415
  private _videoTransformCss;
@@ -1563,54 +1507,25 @@ declare global {
1563
1507
  /**
1564
1508
  * Config keys that can't be passed as attribute (because they are object or function)
1565
1509
  */
1566
- declare const complexConfigKeys: readonly ["metadata", "plugins", "localeDefinitionOverride", "secureUploadsSignatureResolver", "secureDeliveryProxyUrlResolver", "iconHrefResolver", "fileValidators", "collectionValidators", "mediaRecorderOptions"];
1510
+ declare const complexConfigKeys: readonly ["metadata", "localeDefinitionOverride", "secureUploadsSignatureResolver", "secureDeliveryProxyUrlResolver", "iconHrefResolver", "fileValidators", "collectionValidators", "mediaRecorderOptions", "smartBtn"];
1511
+ /** Mapping of attribute names to state */
1512
+ declare const attrStateMapping: Record<string, string>;
1567
1513
  declare class Config extends LitBlock {
1568
1514
  attributesMeta: Partial<ConfigPlainType> & {
1569
1515
  'ctx-name': string;
1570
1516
  };
1571
1517
  init$: LitBlock["init$"] & ConfigType;
1572
1518
  private _computationControllers;
1573
- private _pluginChangeUnsubscribe?;
1574
- private _mutationObserver?;
1575
- /**
1576
- * Mapping of attribute names to custom config keys for plugin-registered configs.
1577
- * Updated dynamically when plugins are registered or changed.
1578
- * Similar to builtinAttrKeyMapping but for custom configs.
1579
- */
1580
- private _customAttrKeyMapping;
1581
- /** Set of all custom config names registered by plugins */
1582
- private _customConfigKeys;
1583
- /**
1584
- * Map of custom config subscriptions (config name -> unsubscribe function)
1585
- * Used to track and clean up subscriptions when plugins change
1586
- */
1587
- private _customConfigSubscriptions;
1588
- /**
1589
- * Check if a key is a custom config (registered by plugins)
1590
- */
1591
- private _isCustomConfig;
1592
- /**
1593
- * Get the custom config definition for a key
1594
- */
1595
- private _getCustomConfigDefinition;
1596
- /**
1597
- * Get attribute names for a config key (kebab-case and lowercase)
1598
- */
1599
- private _getAttributeNames;
1600
1519
  private _flushValueToAttribute;
1601
1520
  private _flushValueToState;
1602
1521
  private _setValue;
1603
1522
  private _getValue;
1604
1523
  private _assertSameValueDifferentReference;
1605
- private _processCustomConfigs;
1606
- private _setupCustomConfigs;
1607
- private _setupMutationObserver;
1608
1524
  initCallback(): void;
1609
- attributeChangedCallback(name: string, oldVal: string, newVal: string): void;
1610
- disconnectedCallback(): void;
1525
+ attributeChangedCallback(name: keyof typeof attrStateMapping, oldVal: string, newVal: string): void;
1611
1526
  static get observedAttributes(): string[];
1612
1527
  }
1613
- interface Config extends ConfigType, CustomConfig {
1528
+ interface Config extends ConfigType {
1614
1529
  }
1615
1530
  declare global {
1616
1531
  interface HTMLElementTagNameMap {
@@ -1694,12 +1609,12 @@ declare class FileItem extends FileItemConfig {
1694
1609
  private _isFailed;
1695
1610
  private _isUploading;
1696
1611
  private _isFocused;
1612
+ private _isEditable;
1697
1613
  private _showFileNames;
1698
1614
  private _ariaLabelStatusFile;
1699
- private _pluginFileActions;
1700
1615
  private _renderedOnce;
1701
1616
  private _observer?;
1702
- private _unsubscribePlugins?;
1617
+ private _handleEdit;
1703
1618
  private _handleRemove;
1704
1619
  private _handleUploadClick;
1705
1620
  private _calculateState;
@@ -1711,8 +1626,6 @@ declare class FileItem extends FileItemConfig {
1711
1626
  private _handleEntryId;
1712
1627
  private _updateShowFileNames;
1713
1628
  protected willUpdate(changedProperties: PropertyValues<this>): void;
1714
- private _updatePluginFileActions;
1715
- private _handlePluginFileAction;
1716
1629
  initCallback(): void;
1717
1630
  connectedCallback(): void;
1718
1631
  disconnectedCallback(): void;
@@ -1809,6 +1722,69 @@ declare global {
1809
1722
  }
1810
1723
  }
1811
1724
 
1725
+ declare class SourceBtn extends LitUploaderBlock {
1726
+ couldBeCtxOwner: boolean;
1727
+ private _registeredTypes;
1728
+ type?: string;
1729
+ onlyIcon: boolean;
1730
+ private _iconName;
1731
+ private _srcTypeKey;
1732
+ private _initTypes;
1733
+ initCallback(): void;
1734
+ private _registerType;
1735
+ activate(): void;
1736
+ private _applyType;
1737
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
1738
+ render(): lit_html.TemplateResult<1>;
1739
+ }
1740
+ declare global {
1741
+ interface HTMLElementTagNameMap {
1742
+ 'uc-source-btn': SourceBtn;
1743
+ }
1744
+ }
1745
+
1746
+ declare class Dropdown extends LitBlock {
1747
+ private _id;
1748
+ private readonly _handleContentClick;
1749
+ protected render(): unknown;
1750
+ }
1751
+ declare global {
1752
+ interface HTMLElementTagNameMap {
1753
+ 'uc-dropdown': Dropdown;
1754
+ }
1755
+ }
1756
+
1757
+ type SmartButtonMode = 'auto' | 'allwrap' | 'nowrap';
1758
+ type AdvancedSmartBtnConfig = {
1759
+ sourceList: string;
1760
+ mode: SmartButtonMode;
1761
+ };
1762
+ declare class SmartBtn extends LitUploaderBlock {
1763
+ static styleAttrs: string[];
1764
+ couldBeCtxOwner: boolean;
1765
+ dropzone: boolean;
1766
+ private _sourceList;
1767
+ private _status;
1768
+ private _multiple;
1769
+ private _entry;
1770
+ private _lastDigest;
1771
+ private _showDropdown;
1772
+ private get isIdle();
1773
+ private get buttonText();
1774
+ private _throttledHandleCollectionUpdate;
1775
+ private _updateButtonBasedOnCollectionState;
1776
+ private _removeEntries;
1777
+ initCallback(): void;
1778
+ private readonly _handleClickAbort;
1779
+ private readonly _handleClick;
1780
+ render(): lit_html.TemplateResult<1>;
1781
+ }
1782
+ declare global {
1783
+ interface HTMLElementTagNameMap {
1784
+ 'uc-smart-btn': SmartBtn;
1785
+ }
1786
+ }
1787
+
1812
1788
  type MetadataCallback = (fileEntry: OutputFileEntry) => Promise<Metadata> | Metadata;
1813
1789
  type LocaleDefinitionOverride = Record<string, Partial<LocaleDefinition>>;
1814
1790
  type SecureDeliveryProxyUrlResolver = (previewUrl: string, urlParts: {
@@ -2021,10 +1997,6 @@ type ConfigType = {
2021
1997
  * Expiry threshold for secure uploads.
2022
1998
  */
2023
1999
  secureUploadsExpireThreshold: number;
2024
- /**
2025
- * Array of plugins to register with the uploader instance.
2026
- */
2027
- plugins: UploaderPlugin[];
2028
2000
  /**
2029
2001
  * Metadata for the file.
2030
2002
  */
@@ -2110,6 +2082,7 @@ type ConfigType = {
2110
2082
  * Define the clipboard paste scope.
2111
2083
  */
2112
2084
  pasteScope: PasteScope;
2085
+ smartBtn: AdvancedSmartBtnConfig | null;
2113
2086
  };
2114
2087
  type ConfigComplexType = Pick<ConfigType, (typeof complexConfigKeys)[number]>;
2115
2088
  type ConfigPlainType = Omit<ConfigType, keyof ConfigComplexType>;
@@ -2285,237 +2258,10 @@ type OutputCollectionState<TStatus extends OutputCollectionStatus = OutputCollec
2285
2258
  allEntries: OutputFileEntry[];
2286
2259
  });
2287
2260
 
2288
- type PluginIconRegistration = {
2289
- name: string;
2290
- svg: string;
2291
- };
2292
- type PluginI18nRegistration = Record<string, Record<string, string>>;
2293
- type PluginSourceRegistration = {
2294
- id: string;
2295
- label: string;
2296
- icon?: string;
2297
- /**
2298
- * @internal
2299
- *
2300
- * Optional expansion function. When present, SourceList calls this to determine
2301
- * which source IDs should actually be rendered in place of this source.
2302
- * Useful for sources that map to multiple device-specific variants (e.g. camera
2303
- * expanding to separate photo/video buttons on mobile).
2304
- * Return `[id]` (the source's own id) to render it as-is.
2305
- */
2306
- expand?: () => string[];
2307
- onSelect: () => Promise<void> | void;
2308
- };
2309
- type PluginRenderDispose = () => void;
2310
- type PluginRender = (el: HTMLElement, activityParams: Record<string, unknown>) => PluginRenderDispose | undefined;
2311
- type PluginActivityRegistration = {
2312
- id: string;
2313
- render: PluginRender;
2314
- };
2315
- type PluginFileActionRegistration = {
2316
- /** Unique action identifier. */
2317
- id: string;
2318
- /** Icon name to display in the action button. */
2319
- icon: string;
2320
- /** Label shown next to the icon in the action button. Accepts a plain string or an i18n key registered via `registerI18n`. */
2321
- label: string;
2322
- /** Return `true` to show the action button for the given file entry. */
2323
- shouldRender: (fileEntry: OutputFileEntry) => boolean;
2324
- onClick: (fileEntry: OutputFileEntry) => void | Promise<void>;
2325
- };
2326
- type PluginFileHookResult = {
2327
- /** The (optionally transformed) file */
2328
- file: File | Blob;
2329
- };
2330
- type PluginFileHookContext = PluginFileHookResult & {
2331
- /**
2332
- * An AbortSignal that fires when the operation is cancelled (e.g. upload aborted or file removed).
2333
- * Hooks should respect this signal to avoid doing unnecessary work.
2334
- */
2335
- signal: AbortSignal;
2336
- };
2337
- type PluginFileHookRegistration = {
2338
- /**
2339
- * When the hook is called:
2340
- * - `'beforeUpload'`: called right before the file is uploaded.
2341
- * - `'onAdd'`: called after the file is added to the upload list.
2342
- *
2343
- * Return the (optionally transformed) file. After the hook runs, `mimeType`,
2344
- * `isImage`, `fileSize`, and `fileName` are all re-derived from the returned file.
2345
- */
2346
- type: 'beforeUpload' | 'onAdd';
2347
- handler: (context: PluginFileHookContext) => PluginFileHookResult | Promise<PluginFileHookResult>;
2348
- /**
2349
- * Maximum time in milliseconds to wait for the hook to complete before skipping it.
2350
- * @default 30000
2351
- */
2352
- timeout?: number;
2353
- };
2354
- type PluginRegistryApi = {
2355
- registerSource: (source: PluginSourceRegistration) => void;
2356
- registerActivity: (activity: PluginActivityRegistration) => void;
2357
- registerFileAction: (fileAction: PluginFileActionRegistration) => void;
2358
- registerFileHook: (hook: PluginFileHookRegistration) => void;
2359
- registerIcon: (icon: PluginIconRegistration) => void;
2360
- registerI18n: (i18n: PluginI18nRegistration) => void;
2361
- registerConfig: <T = unknown>(definition: CustomConfigDefinition<T>) => void;
2362
- };
2363
- /**
2364
- * API for managing plugin config subscriptions
2365
- */
2366
- type PluginConfigApi = {
2367
- get: <TKey extends keyof (ConfigType & CustomConfig)>(configName: TKey) => (ConfigType & CustomConfig)[TKey];
2368
- subscribe: <TKey extends keyof (ConfigType & CustomConfig)>(configName: TKey, callback: (value: (ConfigType & CustomConfig)[TKey]) => void) => () => void;
2369
- };
2370
- /**
2371
- * API for managing plugin activity interactions
2372
- */
2373
- type PluginActivityApi = {
2374
- /**
2375
- * Get the current activity parameters.
2376
- *
2377
- * @returns The current activity parameters object
2378
- *
2379
- * @example
2380
- * ```typescript
2381
- * const params = pluginApi.activity.getParams();
2382
- * console.log('Current params:', params);
2383
- * ```
2384
- */
2385
- getParams: () => Record<string, unknown>;
2386
- /**
2387
- * Subscribe to changes in activity parameters.
2388
- * The callback will be called immediately with the current params,
2389
- * and then whenever the params change.
2390
- *
2391
- * Subscriptions are automatically cleaned up when the plugin is disposed.
2392
- *
2393
- * @param callback - Function to call with the new params
2394
- * @returns Unsubscribe function
2395
- *
2396
- * @example
2397
- * ```typescript
2398
- * pluginApi.activity.subscribeToParams((params) => {
2399
- * console.log('Activity params changed:', params);
2400
- * });
2401
- * // Cleanup happens automatically on plugin disposal
2402
- * ```
2403
- */
2404
- subscribeToParams: (callback: (params: Record<string, unknown>) => void) => () => void;
2405
- };
2406
- type PluginFileEntryUpdate = {
2407
- file?: File | Blob;
2408
- cdnUrl?: string | null;
2409
- cdnUrlModifiers?: string | null;
2410
- mimeType?: string | null;
2411
- };
2412
- type PluginFilesApi = {
2413
- /**
2414
- * Update mutable properties of a file entry by its internalId.
2415
- * `fileSize` is recalculated automatically when `file` is provided.
2416
- */
2417
- update: (internalId: string, changes: PluginFileEntryUpdate) => void;
2418
- };
2419
- type PluginApi = {
2420
- registry: PluginRegistryApi;
2421
- config: PluginConfigApi;
2422
- activity: PluginActivityApi;
2423
- files: PluginFilesApi;
2424
- };
2425
- type PluginUploaderApi = UploaderPublicApi;
2426
- type PluginSetupResult = (() => void) | void | Promise<(() => void) | void>;
2427
- type PluginSetupParams = {
2428
- pluginApi: PluginApi;
2429
- uploaderApi: PluginUploaderApi;
2430
- };
2431
- type UploaderPlugin = {
2432
- id: string;
2433
- setup: (params: PluginSetupParams) => PluginSetupResult;
2434
- };
2435
- type Owned<T> = T & {
2436
- pluginId: string;
2437
- };
2438
- type PluginRegistrySnapshot = {
2439
- sources: Owned<PluginSourceRegistration>[];
2440
- activities: Owned<PluginActivityRegistration>[];
2441
- fileActions: Owned<PluginFileActionRegistration>[];
2442
- fileHooks: Owned<PluginFileHookRegistration>[];
2443
- icons: Owned<PluginIconRegistration>[];
2444
- i18n: Owned<PluginI18nRegistration>[];
2445
- };
2446
-
2447
- type EventMap = {
2448
- [T in keyof EventPayload]: CustomEvent<EventPayload[T]>;
2449
- };
2450
-
2451
- interface UploadEntryData extends Record<string, unknown> {
2452
- file: File | null;
2453
- externalUrl: string | null;
2454
- fileName: string | null;
2455
- fileSize: number | null;
2456
- lastModified: number;
2457
- uploadProgress: number;
2458
- uuid: string | null;
2459
- isImage: boolean;
2460
- mimeType: string | null;
2461
- ctxName: string | null;
2462
- cdnUrl: string | null;
2463
- cdnUrlModifiers: string | null;
2464
- fileInfo: UploadcareFile | null;
2465
- isUploading: boolean;
2466
- abortController: AbortController | null;
2467
- thumbUrl: string | null;
2468
- silent: boolean;
2469
- source: string | null;
2470
- fullPath: string | null;
2471
- metadata: Metadata | null;
2472
- errors: OutputErrorFile[];
2473
- uploadError: Error | null;
2474
- isRemoved: boolean;
2475
- isQueuedForUploading: boolean;
2476
- isValidationPending: boolean;
2477
- isQueuedForValidation: boolean;
2478
- }
2479
- type UploadEntryTypedData = TypedData<UploadEntryData>;
2480
- type UploadEntryKeys = keyof UploadEntryData;
2481
-
2482
- declare class PluginRegistry {
2483
- private _sources;
2484
- private _activities;
2485
- private _fileActions;
2486
- private _fileHooks;
2487
- private _icons;
2488
- private _i18n;
2489
- readonly config: CustomConfigRegistry;
2490
- private _own;
2491
- addSource(pluginId: string, item: PluginSourceRegistration): void;
2492
- addActivity(pluginId: string, item: PluginActivityRegistration): void;
2493
- addFileAction(pluginId: string, item: PluginFileActionRegistration): void;
2494
- addFileHook(pluginId: string, item: PluginFileHookRegistration): void;
2495
- addIcon(pluginId: string, item: PluginIconRegistration): void;
2496
- addI18n(pluginId: string, item: PluginI18nRegistration): void;
2497
- addConfig<T>(pluginId: string, definition: CustomConfigDefinition<T>): void;
2498
- purge(pluginId: string): void;
2499
- snapshot(): PluginRegistrySnapshot;
2500
- }
2501
-
2502
- declare class PluginManager extends SharedInstance {
2503
- private _plugins;
2504
- private _subscribers;
2505
- private _pluginsUpdate;
2506
- private _lazyPluginLoader;
2507
- readonly registry: PluginRegistry;
2508
- get configRegistry(): CustomConfigRegistry;
2509
- constructor(sharedInstancesBag: SharedInstancesBag);
2510
- pluginsReady(): Promise<void>;
2511
- onPluginsChange(callback: Unsubscriber): Unsubscriber;
2512
- private _syncPlugins;
2513
- private _registerPlugin;
2514
- private _unregisterPlugin;
2515
- snapshot(): PluginRegistrySnapshot;
2516
- runOnAddHooks(entry: UploadEntryTypedData): Promise<void>;
2261
+ declare class SecureUploadsManager extends SharedInstance {
2262
+ private _secureToken;
2263
+ getSecureToken(): Promise<SecureUploadsSignatureAndExpire | null>;
2517
2264
  destroy(): void;
2518
- private _notifySubscribers;
2519
2265
  }
2520
2266
 
2521
2267
  type CommonEventType = InternalEventKey | EventKey;
@@ -2556,87 +2302,14 @@ declare class TelemetryManager extends SharedInstance {
2556
2302
  private get _location();
2557
2303
  }
2558
2304
 
2559
- interface ISharedInstance {
2560
- destroy?(): void;
2561
- }
2562
- declare class SharedInstance {
2563
- protected _ctx: PubSub<SharedState>;
2564
- protected _sharedInstancesBag: SharedInstancesBag;
2565
- private _subscriptions;
2566
- private _cfgProxy;
2567
- protected _debugPrint: (...args: unknown[]) => void;
2568
- constructor(sharedInstancesBag: SharedInstancesBag);
2569
- protected addSub(unsub: () => void): void;
2570
- protected get _cfg(): Readonly<ConfigType>;
2571
- destroy(): void;
2572
- }
2573
- declare const instanceKeyMap: {
2574
- modalManager: "*modalManager";
2575
- pluginManager: "*pluginManager";
2576
- telemetryManager: "*telemetryManager";
2577
- localeManager: "*localeManager";
2578
- a11y: "*a11y";
2579
- clipboard: "*clipboard";
2580
- blocksRegistry: "*blocksRegistry";
2581
- eventEmitter: "*eventEmitter";
2582
- uploadCollection: "*uploadCollection";
2583
- secureUploadsManager: "*secureUploadsManager";
2584
- api: "*publicApi";
2585
- validationManager: "*validationManager";
2586
- };
2587
- type InstanceTypeMap = {
2588
- [key in keyof typeof instanceKeyMap]: SharedState[(typeof instanceKeyMap)[key]];
2589
- };
2590
- type InstanceName = keyof typeof instanceKeyMap;
2591
- type SharedInstancesState = Pick<SharedState, (typeof instanceKeyMap)[keyof typeof instanceKeyMap]>;
2592
- type SharedInstancesBag = ReturnType<typeof createSharedInstancesBag>;
2593
- declare const createSharedInstancesBag: (getCtx: () => PubSub<SharedState>) => {
2594
- readonly ctx: PubSub<SharedState>;
2595
- readonly modalManager: ModalManager | null;
2596
- readonly pluginManager: PluginManager;
2597
- readonly telemetryManager: TelemetryManager;
2598
- readonly localeManager: LocaleManager;
2599
- readonly a11y: A11y;
2600
- readonly blocksRegistry: Set<LitBlock>;
2601
- readonly eventEmitter: EventEmitter;
2602
- readonly uploadCollection: TypedCollection<UploadEntryData>;
2603
- readonly secureUploadsManager: SecureUploadsManager;
2604
- readonly api: UploaderPublicApi;
2605
- readonly validationManager: ValidationManager;
2606
- when<TName extends InstanceName>(name: TName, callback: (instance: NonNullable<InstanceTypeMap[TName]>) => void): () => void;
2607
- wait<TName extends InstanceName>(name: TName): Promise<NonNullable<InstanceTypeMap[TName]>>;
2608
- };
2609
-
2610
- type PasteScope = 'local' | 'global' | false;
2611
- declare class ClipboardLayer extends SharedInstance {
2612
- private scopes;
2613
- private listener;
2614
- constructor(sharedInstancesBag: SharedInstancesBag);
2615
- private openUploadList;
2616
- private _listener;
2617
- private handlePaste;
2618
- registerBlock(scope: Node): () => void;
2619
- destroy(): void;
2620
- }
2621
-
2622
- type ConfigGetter = <K extends keyof ConfigType>(key: K) => ConfigType[K];
2623
- type LazyPluginEntry = {
2624
- configDeps: readonly (keyof ConfigType)[];
2625
- isEnabled: (get: ConfigGetter) => boolean;
2626
- load: () => UploaderPlugin | undefined | Promise<UploaderPlugin | undefined>;
2627
- };
2628
-
2629
2305
  type SharedConfigState = {
2630
2306
  [K in keyof ConfigType as `*cfg/${K}`]: ConfigType[K];
2631
2307
  };
2632
- type SharedCustomConfigState = {
2633
- [K in keyof CustomConfig as `*cfg/${K}`]: CustomConfig[K];
2634
- };
2635
2308
  type BlocksRegistry = Set<LitBlock>;
2636
2309
  type ActivityBlockCtxState = {
2637
- '*currentActivity': RegisteredActivityType | null;
2310
+ '*currentActivity': string | null;
2638
2311
  '*currentActivityParams': Record<string, unknown>;
2639
- '*history': (RegisteredActivityType | null)[];
2312
+ '*history': (string | null)[];
2640
2313
  '*historyBack': (() => void) | null;
2641
2314
  '*closeModal': () => void;
2642
2315
  };
@@ -2653,7 +2326,6 @@ type UploaderBlockCtxState = ActivityBlockCtxState & {
2653
2326
  };
2654
2327
  type SolutionBlockCtxState = UploaderBlockCtxState & {
2655
2328
  '*solution': string | null;
2656
- '*lazyPlugins': LazyPluginEntry[] | null;
2657
2329
  };
2658
2330
  type CloudImageEditorState = {
2659
2331
  '*originalUrl': string | null;
@@ -2704,9 +2376,7 @@ type EditorToolbarState = {
2704
2376
  '*currentOperation': string | null;
2705
2377
  '*operationTooltip': string | null;
2706
2378
  };
2707
- type SharedContextInstances = Map<string, ISharedInstance>;
2708
2379
  type DynamicBlockState = {
2709
- '*sharedContextInstances': SharedContextInstances;
2710
2380
  '*blocksRegistry': BlocksRegistry;
2711
2381
  '*eventEmitter': EventEmitter;
2712
2382
  '*localeManager': LocaleManager;
@@ -2714,7 +2384,6 @@ type DynamicBlockState = {
2714
2384
  '*a11y': A11y;
2715
2385
  '*modalManager': ModalManager | null;
2716
2386
  '*clipboard': ClipboardLayer;
2717
- '*pluginManager': PluginManager;
2718
2387
  };
2719
2388
  type DynamicUploaderBlockState = {
2720
2389
  '*uploadCollection': TypedCollection<UploadEntryData>;
@@ -2725,7 +2394,66 @@ type DynamicUploaderBlockState = {
2725
2394
  type LocaleState = {
2726
2395
  [K in keyof LocaleDefinition as `*l10n/${K}`]: string;
2727
2396
  };
2728
- type SharedState = SolutionBlockCtxState & SharedConfigState & SharedCustomConfigState & CloudImageEditorState & EditorImageCropperState & EditorToolbarState & DynamicBlockState & DynamicUploaderBlockState & LocaleState;
2397
+ type SharedState = SolutionBlockCtxState & SharedConfigState & CloudImageEditorState & EditorImageCropperState & EditorToolbarState & DynamicBlockState & DynamicUploaderBlockState & LocaleState;
2398
+
2399
+ interface ISharedInstance {
2400
+ destroy?(): void;
2401
+ }
2402
+ declare class SharedInstance {
2403
+ protected _ctx: PubSub<SharedState>;
2404
+ protected _sharedInstancesBag: SharedInstancesBag;
2405
+ private _subscriptions;
2406
+ private _cfgProxy;
2407
+ protected _debugPrint: (...args: unknown[]) => void;
2408
+ constructor(sharedInstancesBag: SharedInstancesBag);
2409
+ protected addSub(unsub: () => void): void;
2410
+ protected get _cfg(): Readonly<ConfigType>;
2411
+ destroy(): void;
2412
+ }
2413
+ type SharedInstancesState = Pick<SharedState, '*blocksRegistry' | '*eventEmitter' | '*localeManager' | '*telemetryManager' | '*a11y' | '*clipboard' | '*modalManager' | '*uploadCollection' | '*publicApi' | '*validationManager' | '*secureUploadsManager'>;
2414
+ type SharedInstancesBag = ReturnType<typeof createSharedInstancesBag>;
2415
+ declare const createSharedInstancesBag: (getCtx: () => PubSub<SharedState>) => {
2416
+ readonly ctx: PubSub<SharedState>;
2417
+ readonly modalManager: ModalManager | null;
2418
+ readonly telemetryManager: TelemetryManager;
2419
+ readonly localeManager: LocaleManager;
2420
+ readonly a11y: A11y;
2421
+ readonly blocksRegistry: Set<LitBlock>;
2422
+ readonly eventEmitter: EventEmitter;
2423
+ readonly uploadCollection: TypedCollection<UploadEntryData>;
2424
+ readonly secureUploadsManager: SecureUploadsManager;
2425
+ readonly api: UploaderPublicApi;
2426
+ readonly validationManager: ValidationManager;
2427
+ };
2428
+
2429
+ type FuncFileValidator = (outputEntry: OutputFileEntry, api: UploaderPublicApi, options?: {
2430
+ signal?: AbortSignal;
2431
+ }) => undefined | OutputErrorFile | Promise<undefined | OutputErrorFile>;
2432
+ type FileValidatorDescriptor = {
2433
+ runOn: 'add' | 'upload' | 'change';
2434
+ validator: FuncFileValidator;
2435
+ };
2436
+ type FileValidator = FileValidatorDescriptor | FuncFileValidator;
2437
+ type FuncCollectionValidator = (collection: ReturnType<typeof buildOutputCollectionState<OutputCollectionStatus>>, api: UploaderPublicApi) => undefined | OutputErrorCollection;
2438
+ declare class ValidationManager extends SharedInstance {
2439
+ private get _uploadCollection();
2440
+ private _commonFileValidators;
2441
+ private _commonCollectionValidators;
2442
+ private _queue;
2443
+ private _runQueueDebounced;
2444
+ private _isDestroyed;
2445
+ private _entryValidationState;
2446
+ constructor(sharedInstancesBag: SharedInstancesBag);
2447
+ runFileValidators(runOn: FileValidatorDescriptor['runOn'], entryIds?: Uid[]): void;
2448
+ runCollectionValidators(): void;
2449
+ cleanupValidationForEntry(entry: TypedData<UploadEntryData>): void;
2450
+ private _runFileValidatorsForEntry;
2451
+ private _addCustomTypeToValidationError;
2452
+ private _getEntryValidationState;
2453
+ private _getValidatorDescriptors;
2454
+ private _getValidatorDescriptorsForEntry;
2455
+ destroy(): void;
2456
+ }
2729
2457
 
2730
2458
  declare const LitBlockBase: typeof LitElement & Constructor<{
2731
2459
  willYield: boolean;
@@ -2737,7 +2465,9 @@ declare const LitBlockBase: typeof LitElement & Constructor<{
2737
2465
  };
2738
2466
  declare class LitBlock extends LitBlockBase {
2739
2467
  private _cfgProxy;
2468
+ protected _sharedContextInstances: Map<keyof SharedInstancesState, ISharedInstance>;
2740
2469
  static styleAttrs: string[];
2470
+ activityType: ActivityType;
2741
2471
  init$: {};
2742
2472
  constructor();
2743
2473
  l10n: (str: string, variables?: Record<string, string | number>) => string;
@@ -2745,7 +2475,6 @@ declare class LitBlock extends LitBlockBase {
2745
2475
  protected _sharedInstancesBag: {
2746
2476
  readonly ctx: PubSub<SharedState>;
2747
2477
  readonly modalManager: ModalManager | null;
2748
- readonly pluginManager: PluginManager;
2749
2478
  readonly telemetryManager: TelemetryManager;
2750
2479
  readonly localeManager: LocaleManager;
2751
2480
  readonly a11y: A11y;
@@ -2755,34 +2484,6 @@ declare class LitBlock extends LitBlockBase {
2755
2484
  readonly secureUploadsManager: SecureUploadsManager;
2756
2485
  readonly api: UploaderPublicApi;
2757
2486
  readonly validationManager: ValidationManager;
2758
- when<TName extends "modalManager" | "pluginManager" | "telemetryManager" | "localeManager" | "a11y" | "clipboard" | "blocksRegistry" | "eventEmitter" | "uploadCollection" | "secureUploadsManager" | "api" | "validationManager">(name: TName, callback: (instance: NonNullable<{
2759
- modalManager: ModalManager | null;
2760
- pluginManager: PluginManager;
2761
- telemetryManager: TelemetryManager;
2762
- localeManager: LocaleManager;
2763
- a11y: A11y;
2764
- clipboard: ClipboardLayer;
2765
- blocksRegistry: BlocksRegistry;
2766
- eventEmitter: EventEmitter;
2767
- uploadCollection: TypedCollection<UploadEntryData>;
2768
- secureUploadsManager: SecureUploadsManager;
2769
- api: UploaderPublicApi;
2770
- validationManager: ValidationManager;
2771
- }[TName]>) => void): () => void;
2772
- wait<TName extends "modalManager" | "pluginManager" | "telemetryManager" | "localeManager" | "a11y" | "clipboard" | "blocksRegistry" | "eventEmitter" | "uploadCollection" | "secureUploadsManager" | "api" | "validationManager">(name: TName): Promise<NonNullable<{
2773
- modalManager: ModalManager | null;
2774
- pluginManager: PluginManager;
2775
- telemetryManager: TelemetryManager;
2776
- localeManager: LocaleManager;
2777
- a11y: A11y;
2778
- clipboard: ClipboardLayer;
2779
- blocksRegistry: BlocksRegistry;
2780
- eventEmitter: EventEmitter;
2781
- uploadCollection: TypedCollection<UploadEntryData>;
2782
- secureUploadsManager: SecureUploadsManager;
2783
- api: UploaderPublicApi;
2784
- validationManager: ValidationManager;
2785
- }[TName]>>;
2786
2487
  };
2787
2488
  emit(type: Parameters<EventEmitter['emit']>[0], payload?: Parameters<EventEmitter['emit']>[1], options?: Parameters<EventEmitter['emit']>[2]): void;
2788
2489
  hasBlockInCtx(callback: (block: LitBlock) => boolean): boolean;
@@ -2801,7 +2502,11 @@ declare class LitBlock extends LitBlockBase {
2801
2502
  * Called when the last block is removed from the context. Note that inheritors must run their callback before that.
2802
2503
  */
2803
2504
  private destroyCtxCallback;
2804
- private _getSharedContextInstances;
2505
+ /**
2506
+ * Adds a shared context instance if it does not exist yet.
2507
+ * @param key The shared state key.
2508
+ * @param resolver The resolver function that creates the instance.
2509
+ */
2805
2510
  protected _addSharedContextInstance<TKey extends keyof SharedInstancesState>(key: TKey, resolver: (sharedInstancesBag: SharedInstancesBag) => NonNullable<SharedInstancesState[TKey]>): void;
2806
2511
  private _destroySharedContextInstances;
2807
2512
  protected _getSharedContextInstance<TKey extends keyof SharedState, TRequired extends boolean = true>(key: TKey, isRequired?: TRequired): TRequired extends true ? NonNullable<SharedState[TKey]> : SharedState[TKey];
@@ -2828,7 +2533,7 @@ declare class Modal extends LitBlock {
2828
2533
  private _handleDialogClose;
2829
2534
  private _handleDialogMouseDown;
2830
2535
  private _handleDialogMouseUp;
2831
- show(): Promise<void>;
2536
+ show(): void;
2832
2537
  hide(): void;
2833
2538
  private _handleModalOpen;
2834
2539
  private _handleModalClose;
@@ -2900,10 +2605,8 @@ declare const toKebabCase: <T extends string>(str: T) => KebabCase<T>;
2900
2605
 
2901
2606
  declare class LitSolutionBlock extends LitBlock {
2902
2607
  static styleAttrs: string[];
2903
- static lazyPlugins: LazyPluginEntry[] | null;
2904
2608
  init$: {
2905
2609
  '*solution': string | null;
2906
- '*lazyPlugins': LazyPluginEntry[] | null;
2907
2610
  '*commonProgress': number;
2908
2611
  '*uploadList': never[];
2909
2612
  '*uploadQueue': _uploadcare_upload_client.Queue;
@@ -3035,32 +2738,9 @@ declare global {
3035
2738
  }
3036
2739
  }
3037
2740
 
3038
- type SourceButtonConfig = {
3039
- id: string;
3040
- label: string;
3041
- icon?: string;
3042
- onClick: () => void | Promise<void>;
3043
- };
3044
- declare class SourceBtn extends LitUploaderBlock {
3045
- couldBeCtxOwner: boolean;
3046
- source?: SourceButtonConfig;
3047
- private _iconName;
3048
- private _srcTypeKey;
3049
- protected willUpdate(changedProperties: PropertyValues<this>): void;
3050
- private _applySource;
3051
- activate(): void;
3052
- render(): lit_html.TemplateResult<1>;
3053
- }
3054
- declare global {
3055
- interface HTMLElementTagNameMap {
3056
- 'uc-source-btn': SourceBtn;
3057
- }
3058
- }
3059
-
3060
- declare class SourceList extends LitUploaderBlock {
2741
+ declare class SourceList extends LitBlock {
3061
2742
  private _rawSourceList;
3062
- private _unsubscribePlugins?;
3063
- private _sources;
2743
+ private _cameraModes;
3064
2744
  /**
3065
2745
  * CSS-only attribute
3066
2746
  */
@@ -3068,10 +2748,8 @@ declare class SourceList extends LitUploaderBlock {
3068
2748
  initCallback(): void;
3069
2749
  protected updated(changedProperties: PropertyValues<this>): void;
3070
2750
  private _updateSources;
3071
- private _expandSource;
3072
- private _makePluginSourceConfig;
2751
+ private _sources;
3073
2752
  render(): lit_html.TemplateResult<1>;
3074
- disconnectedCallback(): void;
3075
2753
  }
3076
2754
  declare global {
3077
2755
  interface HTMLElementTagNameMap {
@@ -3126,8 +2804,6 @@ declare class UploadCtxProvider extends LitUploaderBlock {
3126
2804
  interface UploadCtxProvider extends LitUploaderBlock {
3127
2805
  addEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | AddEventListenerOptions): void;
3128
2806
  removeEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | EventListenerOptions): void;
3129
- addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;
3130
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions): void;
3131
2807
  }
3132
2808
  declare global {
3133
2809
  interface HTMLElementTagNameMap {
@@ -3135,71 +2811,45 @@ declare global {
3135
2811
  }
3136
2812
  }
3137
2813
 
3138
- declare class SimpleBtn extends LitUploaderBlock {
3139
- static styleAttrs: string[];
2814
+ declare class UrlSource extends LitUploaderBlock {
3140
2815
  couldBeCtxOwner: boolean;
3141
- dropzone: boolean;
3142
- private _buttonTextKey;
3143
- private readonly _handleClick;
2816
+ activityType: ActivityType;
2817
+ private _formState;
3144
2818
  initCallback(): void;
2819
+ private _inputRef;
2820
+ private _handleInput;
2821
+ private _handleUpload;
3145
2822
  render(): lit_html.TemplateResult<1>;
3146
2823
  }
3147
2824
  declare global {
3148
2825
  interface HTMLElementTagNameMap {
3149
- 'uc-simple-btn': SimpleBtn;
2826
+ 'uc-url-source': UrlSource;
3150
2827
  }
3151
2828
  }
3152
2829
 
3153
- declare class PluginActivityHost extends LitActivityBlock {
3154
- registration: Owned<PluginActivityRegistration>;
3155
- private _dispose?;
3156
- private _containerRef;
3157
- initCallback(): void;
3158
- protected willUpdate(changedProperties: PropertyValues<this>): void;
3159
- private _ensureRegistered;
3160
- private _renderActivity;
3161
- private _disposeActivity;
3162
- disconnectedCallback(): void;
3163
- render(): lit_html.TemplateResult<1>;
3164
- }
3165
- declare class PluginActivityRenderer extends LitBlock {
3166
- mode: 'modal' | 'inline';
3167
- private _activities;
3168
- private _unsubscribePlugins?;
2830
+ declare class SimpleBtn extends LitUploaderBlock {
2831
+ static styleAttrs: string[];
2832
+ couldBeCtxOwner: boolean;
2833
+ dropzone: boolean;
2834
+ private _buttonTextKey;
2835
+ private readonly _handleClick;
3169
2836
  initCallback(): void;
3170
- private _syncActivities;
3171
- disconnectedCallback(): void;
3172
- render(): lit_html.TemplateResult<1>;
3173
- }
3174
- declare global {
3175
- interface HTMLElementTagNameMap {
3176
- 'uc-plugin-activity-host': PluginActivityHost;
3177
- 'uc-plugin-activity-renderer': PluginActivityRenderer;
3178
- }
3179
- }
3180
-
3181
- declare class UrlSource extends LitUploaderBlock {
3182
- private _formState;
3183
- private _inputRef;
3184
- private _handleInput;
3185
- private _handleUpload;
3186
- firstUpdated(): void;
3187
2837
  render(): lit_html.TemplateResult<1>;
3188
2838
  }
3189
2839
  declare global {
3190
2840
  interface HTMLElementTagNameMap {
3191
- 'uc-url-source': UrlSource;
2841
+ 'uc-simple-btn': SimpleBtn;
3192
2842
  }
3193
2843
  }
3194
2844
 
3195
2845
  declare class FileUploaderRegular extends LitSolutionBlock {
3196
- static lazyPlugins: LazyPluginEntry[];
3197
2846
  attributesMeta: {
3198
2847
  headless?: boolean;
3199
2848
  'ctx-name': string;
3200
2849
  };
3201
2850
  static styleAttrs: string[];
3202
2851
  headless: boolean;
2852
+ smart: boolean;
3203
2853
  constructor();
3204
2854
  initCallback(): void;
3205
2855
  render(): lit_html.TemplateResult<1>;
@@ -3211,7 +2861,6 @@ declare global {
3211
2861
  }
3212
2862
 
3213
2863
  declare class FileUploaderInline extends LitSolutionBlock {
3214
- static lazyPlugins: LazyPluginEntry[];
3215
2864
  attributesMeta: {
3216
2865
  'ctx-name': string;
3217
2866
  };
@@ -3232,7 +2881,6 @@ declare global {
3232
2881
  }
3233
2882
 
3234
2883
  declare class FileUploaderMinimal extends LitSolutionBlock {
3235
- static lazyPlugins: LazyPluginEntry[];
3236
2884
  attributesMeta: {
3237
2885
  'ctx-name': string;
3238
2886
  };
@@ -3259,4 +2907,4 @@ declare global {
3259
2907
  declare const PACKAGE_NAME = "blocks";
3260
2908
  declare const PACKAGE_VERSION: string;
3261
2909
 
3262
- 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, PubSub as Data, DropArea, EditorAspectRatioButtonControl, EditorCropButtonControl, EditorFilterControl, EditorFreeformButtonControl, EditorImageCropper, EditorImageFader, EditorOperationControl, EditorScroller, EditorSlider, EditorToolbar, type EventMap, type EventPayload, EventType, ExternalSource, ExternalUploadSource, 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, 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 PluginI18nRegistration, type PluginIconRegistration, type PluginRegistryApi, type PluginRegistrySnapshot, type PluginRender, type PluginRenderDispose, type PluginSetupParams, type PluginSetupResult, type PluginSourceRegistration, type PluginUploaderApi, PresenceToggle, 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 };
2910
+ export { LitActivityBlock as ActivityBlock, ActivityHeader, type ApiAddFileCommonOptions, BaseComponent, LitBlock as Block, BtnUi, CameraSource, CloudImageEditor, CloudImageEditorActivity, CloudImageEditorBlock, type CollectionValidators, Config, type ConfigAttributesType, type ConfigComplexType, type ConfigPlainType, type ConfigType, Copyright, CropFrame, PubSub as Data, DropArea, Dropdown, EditorAspectRatioButtonControl, EditorCropButtonControl, EditorFilterControl, EditorFreeformButtonControl, EditorImageCropper, EditorImageFader, EditorOperationControl, EditorScroller, EditorSlider, EditorToolbar, type EventMap, type EventPayload, EventType, ExternalSource, ExternalUploadSource, 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, type OutputCollectionErrorType, type OutputCollectionState, type OutputCollectionStatus, type OutputCustomErrorType, type OutputError, type OutputErrorCollection, type OutputErrorFile, type OutputErrorTypePayload, type OutputFileEntry, type OutputFileErrorPayload, type OutputFileErrorType, type OutputFileStatus, PACKAGE_NAME, PACKAGE_VERSION, PresenceToggle, ProgressBar, ProgressBarCommon, type SecureDeliveryProxyUrlResolver, type SecureUploadsSignatureAndExpire, type SecureUploadsSignatureResolver, Select, SimpleBtn, SliderUi, SmartBtn, LitSolutionBlock as SolutionBlock, SourceBtn, SourceList, type SourceTypes, Spinner, StartFrom, Thumb, UID, UploadCtxProvider, UploadList, UploadSource, LitUploaderBlock as UploaderBlock, UploaderPublicApi, UrlSource, defineComponents, defineLocale, loadFileUploaderFrom, toKebabCase };