@uploadcare/file-uploader 1.29.0-alpha.1 → 1.30.0-alpha.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 (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 +334 -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 +336 -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 +336 -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 +320 -675
  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 +336 -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 +336 -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 +336 -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
-
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
1357
 
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;
@@ -1564,54 +1507,25 @@ declare global {
1564
1507
  /**
1565
1508
  * Config keys that can't be passed as attribute (because they are object or function)
1566
1509
  */
1567
- 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", "smartButtonSettings"];
1511
+ /** Mapping of attribute names to state */
1512
+ declare const attrStateMapping: Record<string, string>;
1568
1513
  declare class Config extends LitBlock {
1569
1514
  attributesMeta: Partial<ConfigPlainType> & {
1570
1515
  'ctx-name': string;
1571
1516
  };
1572
1517
  init$: LitBlock["init$"] & ConfigType;
1573
1518
  private _computationControllers;
1574
- private _pluginChangeUnsubscribe?;
1575
- private _mutationObserver?;
1576
- /**
1577
- * Mapping of attribute names to custom config keys for plugin-registered configs.
1578
- * Updated dynamically when plugins are registered or changed.
1579
- * Similar to builtinAttrKeyMapping but for custom configs.
1580
- */
1581
- private _customAttrKeyMapping;
1582
- /** Set of all custom config names registered by plugins */
1583
- private _customConfigKeys;
1584
- /**
1585
- * Map of custom config subscriptions (config name -> unsubscribe function)
1586
- * Used to track and clean up subscriptions when plugins change
1587
- */
1588
- private _customConfigSubscriptions;
1589
- /**
1590
- * Check if a key is a custom config (registered by plugins)
1591
- */
1592
- private _isCustomConfig;
1593
- /**
1594
- * Get the custom config definition for a key
1595
- */
1596
- private _getCustomConfigDefinition;
1597
- /**
1598
- * Get attribute names for a config key (kebab-case and lowercase)
1599
- */
1600
- private _getAttributeNames;
1601
1519
  private _flushValueToAttribute;
1602
1520
  private _flushValueToState;
1603
1521
  private _setValue;
1604
1522
  private _getValue;
1605
1523
  private _assertSameValueDifferentReference;
1606
- private _processCustomConfigs;
1607
- private _setupCustomConfigs;
1608
- private _setupMutationObserver;
1609
1524
  initCallback(): void;
1610
- attributeChangedCallback(name: string, oldVal: string, newVal: string): void;
1611
- disconnectedCallback(): void;
1525
+ attributeChangedCallback(name: keyof typeof attrStateMapping, oldVal: string, newVal: string): void;
1612
1526
  static get observedAttributes(): string[];
1613
1527
  }
1614
- interface Config extends ConfigType, CustomConfig {
1528
+ interface Config extends ConfigType {
1615
1529
  }
1616
1530
  declare global {
1617
1531
  interface HTMLElementTagNameMap {
@@ -1695,12 +1609,12 @@ declare class FileItem extends FileItemConfig {
1695
1609
  private _isFailed;
1696
1610
  private _isUploading;
1697
1611
  private _isFocused;
1612
+ private _isEditable;
1698
1613
  private _showFileNames;
1699
1614
  private _ariaLabelStatusFile;
1700
- private _pluginFileActions;
1701
1615
  private _renderedOnce;
1702
1616
  private _observer?;
1703
- private _unsubscribePlugins?;
1617
+ private _handleEdit;
1704
1618
  private _handleRemove;
1705
1619
  private _handleUploadClick;
1706
1620
  private _calculateState;
@@ -1712,8 +1626,6 @@ declare class FileItem extends FileItemConfig {
1712
1626
  private _handleEntryId;
1713
1627
  private _updateShowFileNames;
1714
1628
  protected willUpdate(changedProperties: PropertyValues<this>): void;
1715
- private _updatePluginFileActions;
1716
- private _handlePluginFileAction;
1717
1629
  initCallback(): void;
1718
1630
  connectedCallback(): void;
1719
1631
  disconnectedCallback(): void;
@@ -1810,6 +1722,67 @@ declare global {
1810
1722
  }
1811
1723
  }
1812
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
+ protected render(): unknown;
1749
+ }
1750
+ declare global {
1751
+ interface HTMLElementTagNameMap {
1752
+ 'uc-dropdown': Dropdown;
1753
+ }
1754
+ }
1755
+
1756
+ type SmartButtonMode = 'auto' | 'allwrap' | 'nowrap';
1757
+ type AdvancedSmartBtnConfig = {
1758
+ sourceList: string;
1759
+ mode: SmartButtonMode;
1760
+ };
1761
+ declare class SmartBtn extends LitUploaderBlock {
1762
+ static styleAttrs: string[];
1763
+ couldBeCtxOwner: boolean;
1764
+ dropzone: boolean;
1765
+ private _sourceList;
1766
+ private _status;
1767
+ private _buttonTextKey;
1768
+ private _entry;
1769
+ private _lastDigest;
1770
+ private _visible;
1771
+ private get isIdle();
1772
+ private get buttonText();
1773
+ private _throttledHandleCollectionUpdate;
1774
+ private _updateButtonBasedOnCollectionState;
1775
+ initCallback(): void;
1776
+ private readonly _handleClickAbort;
1777
+ private readonly _handleClick;
1778
+ render(): lit_html.TemplateResult<1>;
1779
+ }
1780
+ declare global {
1781
+ interface HTMLElementTagNameMap {
1782
+ 'uc-smart-btn': SmartBtn;
1783
+ }
1784
+ }
1785
+
1813
1786
  type MetadataCallback = (fileEntry: OutputFileEntry) => Promise<Metadata> | Metadata;
1814
1787
  type LocaleDefinitionOverride = Record<string, Partial<LocaleDefinition>>;
1815
1788
  type SecureDeliveryProxyUrlResolver = (previewUrl: string, urlParts: {
@@ -2022,10 +1995,6 @@ type ConfigType = {
2022
1995
  * Expiry threshold for secure uploads.
2023
1996
  */
2024
1997
  secureUploadsExpireThreshold: number;
2025
- /**
2026
- * Array of plugins to register with the uploader instance.
2027
- */
2028
- plugins: UploaderPlugin[];
2029
1998
  /**
2030
1999
  * Metadata for the file.
2031
2000
  */
@@ -2111,6 +2080,7 @@ type ConfigType = {
2111
2080
  * Define the clipboard paste scope.
2112
2081
  */
2113
2082
  pasteScope: PasteScope;
2083
+ smartButtonSettings: AdvancedSmartBtnConfig | null;
2114
2084
  };
2115
2085
  type ConfigComplexType = Pick<ConfigType, (typeof complexConfigKeys)[number]>;
2116
2086
  type ConfigPlainType = Omit<ConfigType, keyof ConfigComplexType>;
@@ -2286,237 +2256,10 @@ type OutputCollectionState<TStatus extends OutputCollectionStatus = OutputCollec
2286
2256
  allEntries: OutputFileEntry[];
2287
2257
  });
2288
2258
 
2289
- type PluginIconRegistration = {
2290
- name: string;
2291
- svg: string;
2292
- };
2293
- type PluginI18nRegistration = Record<string, Record<string, string>>;
2294
- type PluginSourceRegistration = {
2295
- id: string;
2296
- label: string;
2297
- icon?: string;
2298
- /**
2299
- * @internal
2300
- *
2301
- * Optional expansion function. When present, SourceList calls this to determine
2302
- * which source IDs should actually be rendered in place of this source.
2303
- * Useful for sources that map to multiple device-specific variants (e.g. camera
2304
- * expanding to separate photo/video buttons on mobile).
2305
- * Return `[id]` (the source's own id) to render it as-is.
2306
- */
2307
- expand?: () => string[];
2308
- onSelect: () => Promise<void> | void;
2309
- };
2310
- type PluginRenderDispose = () => void;
2311
- type PluginRender = (el: HTMLElement, activityParams: Record<string, unknown>) => PluginRenderDispose | undefined;
2312
- type PluginActivityRegistration = {
2313
- id: string;
2314
- render: PluginRender;
2315
- };
2316
- type PluginFileActionRegistration = {
2317
- /** Unique action identifier. */
2318
- id: string;
2319
- /** Icon name to display in the action button. */
2320
- icon: string;
2321
- /** Label shown next to the icon in the action button. Accepts a plain string or an i18n key registered via `registerI18n`. */
2322
- label: string;
2323
- /** Return `true` to show the action button for the given file entry. */
2324
- shouldRender: (fileEntry: OutputFileEntry) => boolean;
2325
- onClick: (fileEntry: OutputFileEntry) => void | Promise<void>;
2326
- };
2327
- type PluginFileHookResult = {
2328
- /** The (optionally transformed) file */
2329
- file: File | Blob;
2330
- };
2331
- type PluginFileHookContext = PluginFileHookResult & {
2332
- /**
2333
- * An AbortSignal that fires when the operation is cancelled (e.g. upload aborted or file removed).
2334
- * Hooks should respect this signal to avoid doing unnecessary work.
2335
- */
2336
- signal: AbortSignal;
2337
- };
2338
- type PluginFileHookRegistration = {
2339
- /**
2340
- * When the hook is called:
2341
- * - `'beforeUpload'`: called right before the file is uploaded.
2342
- * - `'onAdd'`: called after the file is added to the upload list.
2343
- *
2344
- * Return the (optionally transformed) file. After the hook runs, `mimeType`,
2345
- * `isImage`, `fileSize`, and `fileName` are all re-derived from the returned file.
2346
- */
2347
- type: 'beforeUpload' | 'onAdd';
2348
- handler: (context: PluginFileHookContext) => PluginFileHookResult | Promise<PluginFileHookResult>;
2349
- /**
2350
- * Maximum time in milliseconds to wait for the hook to complete before skipping it.
2351
- * @default 30000
2352
- */
2353
- timeout?: number;
2354
- };
2355
- type PluginRegistryApi = {
2356
- registerSource: (source: PluginSourceRegistration) => void;
2357
- registerActivity: (activity: PluginActivityRegistration) => void;
2358
- registerFileAction: (fileAction: PluginFileActionRegistration) => void;
2359
- registerFileHook: (hook: PluginFileHookRegistration) => void;
2360
- registerIcon: (icon: PluginIconRegistration) => void;
2361
- registerI18n: (i18n: PluginI18nRegistration) => void;
2362
- registerConfig: <T = unknown>(definition: CustomConfigDefinition<T>) => void;
2363
- };
2364
- /**
2365
- * API for managing plugin config subscriptions
2366
- */
2367
- type PluginConfigApi = {
2368
- get: <TKey extends keyof (ConfigType & CustomConfig)>(configName: TKey) => (ConfigType & CustomConfig)[TKey];
2369
- subscribe: <TKey extends keyof (ConfigType & CustomConfig)>(configName: TKey, callback: (value: (ConfigType & CustomConfig)[TKey]) => void) => () => void;
2370
- };
2371
- /**
2372
- * API for managing plugin activity interactions
2373
- */
2374
- type PluginActivityApi = {
2375
- /**
2376
- * Get the current activity parameters.
2377
- *
2378
- * @returns The current activity parameters object
2379
- *
2380
- * @example
2381
- * ```typescript
2382
- * const params = pluginApi.activity.getParams();
2383
- * console.log('Current params:', params);
2384
- * ```
2385
- */
2386
- getParams: () => Record<string, unknown>;
2387
- /**
2388
- * Subscribe to changes in activity parameters.
2389
- * The callback will be called immediately with the current params,
2390
- * and then whenever the params change.
2391
- *
2392
- * Subscriptions are automatically cleaned up when the plugin is disposed.
2393
- *
2394
- * @param callback - Function to call with the new params
2395
- * @returns Unsubscribe function
2396
- *
2397
- * @example
2398
- * ```typescript
2399
- * pluginApi.activity.subscribeToParams((params) => {
2400
- * console.log('Activity params changed:', params);
2401
- * });
2402
- * // Cleanup happens automatically on plugin disposal
2403
- * ```
2404
- */
2405
- subscribeToParams: (callback: (params: Record<string, unknown>) => void) => () => void;
2406
- };
2407
- type PluginFileEntryUpdate = {
2408
- file?: File | Blob;
2409
- cdnUrl?: string | null;
2410
- cdnUrlModifiers?: string | null;
2411
- mimeType?: string | null;
2412
- };
2413
- type PluginFilesApi = {
2414
- /**
2415
- * Update mutable properties of a file entry by its internalId.
2416
- * `fileSize` is recalculated automatically when `file` is provided.
2417
- */
2418
- update: (internalId: string, changes: PluginFileEntryUpdate) => void;
2419
- };
2420
- type PluginApi = {
2421
- registry: PluginRegistryApi;
2422
- config: PluginConfigApi;
2423
- activity: PluginActivityApi;
2424
- files: PluginFilesApi;
2425
- };
2426
- type PluginUploaderApi = UploaderPublicApi;
2427
- type PluginSetupResult = (() => void) | void | Promise<(() => void) | void>;
2428
- type PluginSetupParams = {
2429
- pluginApi: PluginApi;
2430
- uploaderApi: PluginUploaderApi;
2431
- };
2432
- type UploaderPlugin = {
2433
- id: string;
2434
- setup: (params: PluginSetupParams) => PluginSetupResult;
2435
- };
2436
- type Owned<T> = T & {
2437
- pluginId: string;
2438
- };
2439
- type PluginRegistrySnapshot = {
2440
- sources: Owned<PluginSourceRegistration>[];
2441
- activities: Owned<PluginActivityRegistration>[];
2442
- fileActions: Owned<PluginFileActionRegistration>[];
2443
- fileHooks: Owned<PluginFileHookRegistration>[];
2444
- icons: Owned<PluginIconRegistration>[];
2445
- i18n: Owned<PluginI18nRegistration>[];
2446
- };
2447
-
2448
- type EventMap = {
2449
- [T in keyof EventPayload]: CustomEvent<EventPayload[T]>;
2450
- };
2451
-
2452
- interface UploadEntryData extends Record<string, unknown> {
2453
- file: File | null;
2454
- externalUrl: string | null;
2455
- fileName: string | null;
2456
- fileSize: number | null;
2457
- lastModified: number;
2458
- uploadProgress: number;
2459
- uuid: string | null;
2460
- isImage: boolean;
2461
- mimeType: string | null;
2462
- ctxName: string | null;
2463
- cdnUrl: string | null;
2464
- cdnUrlModifiers: string | null;
2465
- fileInfo: UploadcareFile | null;
2466
- isUploading: boolean;
2467
- abortController: AbortController | null;
2468
- thumbUrl: string | null;
2469
- silent: boolean;
2470
- source: string | null;
2471
- fullPath: string | null;
2472
- metadata: Metadata | null;
2473
- errors: OutputErrorFile[];
2474
- uploadError: Error | null;
2475
- isRemoved: boolean;
2476
- isQueuedForUploading: boolean;
2477
- isValidationPending: boolean;
2478
- isQueuedForValidation: boolean;
2479
- }
2480
- type UploadEntryTypedData = TypedData<UploadEntryData>;
2481
- type UploadEntryKeys = keyof UploadEntryData;
2482
-
2483
- declare class PluginRegistry {
2484
- private _sources;
2485
- private _activities;
2486
- private _fileActions;
2487
- private _fileHooks;
2488
- private _icons;
2489
- private _i18n;
2490
- readonly config: CustomConfigRegistry;
2491
- private _own;
2492
- addSource(pluginId: string, item: PluginSourceRegistration): void;
2493
- addActivity(pluginId: string, item: PluginActivityRegistration): void;
2494
- addFileAction(pluginId: string, item: PluginFileActionRegistration): void;
2495
- addFileHook(pluginId: string, item: PluginFileHookRegistration): void;
2496
- addIcon(pluginId: string, item: PluginIconRegistration): void;
2497
- addI18n(pluginId: string, item: PluginI18nRegistration): void;
2498
- addConfig<T>(pluginId: string, definition: CustomConfigDefinition<T>): void;
2499
- purge(pluginId: string): void;
2500
- snapshot(): PluginRegistrySnapshot;
2501
- }
2502
-
2503
- declare class PluginManager extends SharedInstance {
2504
- private _plugins;
2505
- private _subscribers;
2506
- private _pluginsUpdate;
2507
- private _lazyPluginLoader;
2508
- readonly registry: PluginRegistry;
2509
- get configRegistry(): CustomConfigRegistry;
2510
- constructor(sharedInstancesBag: SharedInstancesBag);
2511
- pluginsReady(): Promise<void>;
2512
- onPluginsChange(callback: Unsubscriber): Unsubscriber;
2513
- private _syncPlugins;
2514
- private _registerPlugin;
2515
- private _unregisterPlugin;
2516
- snapshot(): PluginRegistrySnapshot;
2517
- runOnAddHooks(entry: UploadEntryTypedData): Promise<void>;
2259
+ declare class SecureUploadsManager extends SharedInstance {
2260
+ private _secureToken;
2261
+ getSecureToken(): Promise<SecureUploadsSignatureAndExpire | null>;
2518
2262
  destroy(): void;
2519
- private _notifySubscribers;
2520
2263
  }
2521
2264
 
2522
2265
  type CommonEventType = InternalEventKey | EventKey;
@@ -2557,87 +2300,14 @@ declare class TelemetryManager extends SharedInstance {
2557
2300
  private get _location();
2558
2301
  }
2559
2302
 
2560
- interface ISharedInstance {
2561
- destroy?(): void;
2562
- }
2563
- declare class SharedInstance {
2564
- protected _ctx: PubSub<SharedState>;
2565
- protected _sharedInstancesBag: SharedInstancesBag;
2566
- private _subscriptions;
2567
- private _cfgProxy;
2568
- protected _debugPrint: (...args: unknown[]) => void;
2569
- constructor(sharedInstancesBag: SharedInstancesBag);
2570
- protected addSub(unsub: () => void): void;
2571
- protected get _cfg(): Readonly<ConfigType>;
2572
- destroy(): void;
2573
- }
2574
- declare const instanceKeyMap: {
2575
- modalManager: "*modalManager";
2576
- pluginManager: "*pluginManager";
2577
- telemetryManager: "*telemetryManager";
2578
- localeManager: "*localeManager";
2579
- a11y: "*a11y";
2580
- clipboard: "*clipboard";
2581
- blocksRegistry: "*blocksRegistry";
2582
- eventEmitter: "*eventEmitter";
2583
- uploadCollection: "*uploadCollection";
2584
- secureUploadsManager: "*secureUploadsManager";
2585
- api: "*publicApi";
2586
- validationManager: "*validationManager";
2587
- };
2588
- type InstanceTypeMap = {
2589
- [key in keyof typeof instanceKeyMap]: SharedState[(typeof instanceKeyMap)[key]];
2590
- };
2591
- type InstanceName = keyof typeof instanceKeyMap;
2592
- type SharedInstancesState = Pick<SharedState, (typeof instanceKeyMap)[keyof typeof instanceKeyMap]>;
2593
- type SharedInstancesBag = ReturnType<typeof createSharedInstancesBag>;
2594
- declare const createSharedInstancesBag: (getCtx: () => PubSub<SharedState>) => {
2595
- readonly ctx: PubSub<SharedState>;
2596
- readonly modalManager: ModalManager | null;
2597
- readonly pluginManager: PluginManager;
2598
- readonly telemetryManager: TelemetryManager;
2599
- readonly localeManager: LocaleManager;
2600
- readonly a11y: A11y;
2601
- readonly blocksRegistry: Set<LitBlock>;
2602
- readonly eventEmitter: EventEmitter;
2603
- readonly uploadCollection: TypedCollection<UploadEntryData>;
2604
- readonly secureUploadsManager: SecureUploadsManager;
2605
- readonly api: UploaderPublicApi;
2606
- readonly validationManager: ValidationManager;
2607
- when<TName extends InstanceName>(name: TName, callback: (instance: NonNullable<InstanceTypeMap[TName]>) => void): () => void;
2608
- wait<TName extends InstanceName>(name: TName): Promise<NonNullable<InstanceTypeMap[TName]>>;
2609
- };
2610
-
2611
- type PasteScope = 'local' | 'global' | false;
2612
- declare class ClipboardLayer extends SharedInstance {
2613
- private scopes;
2614
- private listener;
2615
- constructor(sharedInstancesBag: SharedInstancesBag);
2616
- private openUploadList;
2617
- private _listener;
2618
- private handlePaste;
2619
- registerBlock(scope: Node): () => void;
2620
- destroy(): void;
2621
- }
2622
-
2623
- type ConfigGetter = <K extends keyof ConfigType>(key: K) => ConfigType[K];
2624
- type LazyPluginEntry = {
2625
- configDeps: readonly (keyof ConfigType)[];
2626
- isEnabled: (get: ConfigGetter) => boolean;
2627
- load: () => UploaderPlugin | undefined | Promise<UploaderPlugin | undefined>;
2628
- };
2629
-
2630
2303
  type SharedConfigState = {
2631
2304
  [K in keyof ConfigType as `*cfg/${K}`]: ConfigType[K];
2632
2305
  };
2633
- type SharedCustomConfigState = {
2634
- [K in keyof CustomConfig as `*cfg/${K}`]: CustomConfig[K];
2635
- };
2636
2306
  type BlocksRegistry = Set<LitBlock>;
2637
2307
  type ActivityBlockCtxState = {
2638
- '*currentActivity': RegisteredActivityType | null;
2308
+ '*currentActivity': string | null;
2639
2309
  '*currentActivityParams': Record<string, unknown>;
2640
- '*history': (RegisteredActivityType | null)[];
2310
+ '*history': (string | null)[];
2641
2311
  '*historyBack': (() => void) | null;
2642
2312
  '*closeModal': () => void;
2643
2313
  };
@@ -2654,7 +2324,6 @@ type UploaderBlockCtxState = ActivityBlockCtxState & {
2654
2324
  };
2655
2325
  type SolutionBlockCtxState = UploaderBlockCtxState & {
2656
2326
  '*solution': string | null;
2657
- '*lazyPlugins': LazyPluginEntry[] | null;
2658
2327
  };
2659
2328
  type CloudImageEditorState = {
2660
2329
  '*originalUrl': string | null;
@@ -2705,9 +2374,7 @@ type EditorToolbarState = {
2705
2374
  '*currentOperation': string | null;
2706
2375
  '*operationTooltip': string | null;
2707
2376
  };
2708
- type SharedContextInstances = Map<string, ISharedInstance>;
2709
2377
  type DynamicBlockState = {
2710
- '*sharedContextInstances': SharedContextInstances;
2711
2378
  '*blocksRegistry': BlocksRegistry;
2712
2379
  '*eventEmitter': EventEmitter;
2713
2380
  '*localeManager': LocaleManager;
@@ -2715,7 +2382,6 @@ type DynamicBlockState = {
2715
2382
  '*a11y': A11y;
2716
2383
  '*modalManager': ModalManager | null;
2717
2384
  '*clipboard': ClipboardLayer;
2718
- '*pluginManager': PluginManager;
2719
2385
  };
2720
2386
  type DynamicUploaderBlockState = {
2721
2387
  '*uploadCollection': TypedCollection<UploadEntryData>;
@@ -2726,7 +2392,66 @@ type DynamicUploaderBlockState = {
2726
2392
  type LocaleState = {
2727
2393
  [K in keyof LocaleDefinition as `*l10n/${K}`]: string;
2728
2394
  };
2729
- type SharedState = SolutionBlockCtxState & SharedConfigState & SharedCustomConfigState & CloudImageEditorState & EditorImageCropperState & EditorToolbarState & DynamicBlockState & DynamicUploaderBlockState & LocaleState;
2395
+ type SharedState = SolutionBlockCtxState & SharedConfigState & CloudImageEditorState & EditorImageCropperState & EditorToolbarState & DynamicBlockState & DynamicUploaderBlockState & LocaleState;
2396
+
2397
+ interface ISharedInstance {
2398
+ destroy?(): void;
2399
+ }
2400
+ declare class SharedInstance {
2401
+ protected _ctx: PubSub<SharedState>;
2402
+ protected _sharedInstancesBag: SharedInstancesBag;
2403
+ private _subscriptions;
2404
+ private _cfgProxy;
2405
+ protected _debugPrint: (...args: unknown[]) => void;
2406
+ constructor(sharedInstancesBag: SharedInstancesBag);
2407
+ protected addSub(unsub: () => void): void;
2408
+ protected get _cfg(): Readonly<ConfigType>;
2409
+ destroy(): void;
2410
+ }
2411
+ type SharedInstancesState = Pick<SharedState, '*blocksRegistry' | '*eventEmitter' | '*localeManager' | '*telemetryManager' | '*a11y' | '*clipboard' | '*modalManager' | '*uploadCollection' | '*publicApi' | '*validationManager' | '*secureUploadsManager'>;
2412
+ type SharedInstancesBag = ReturnType<typeof createSharedInstancesBag>;
2413
+ declare const createSharedInstancesBag: (getCtx: () => PubSub<SharedState>) => {
2414
+ readonly ctx: PubSub<SharedState>;
2415
+ readonly modalManager: ModalManager | null;
2416
+ readonly telemetryManager: TelemetryManager;
2417
+ readonly localeManager: LocaleManager;
2418
+ readonly a11y: A11y;
2419
+ readonly blocksRegistry: Set<LitBlock>;
2420
+ readonly eventEmitter: EventEmitter;
2421
+ readonly uploadCollection: TypedCollection<UploadEntryData>;
2422
+ readonly secureUploadsManager: SecureUploadsManager;
2423
+ readonly api: UploaderPublicApi;
2424
+ readonly validationManager: ValidationManager;
2425
+ };
2426
+
2427
+ type FuncFileValidator = (outputEntry: OutputFileEntry, api: UploaderPublicApi, options?: {
2428
+ signal?: AbortSignal;
2429
+ }) => undefined | OutputErrorFile | Promise<undefined | OutputErrorFile>;
2430
+ type FileValidatorDescriptor = {
2431
+ runOn: 'add' | 'upload' | 'change';
2432
+ validator: FuncFileValidator;
2433
+ };
2434
+ type FileValidator = FileValidatorDescriptor | FuncFileValidator;
2435
+ type FuncCollectionValidator = (collection: ReturnType<typeof buildOutputCollectionState<OutputCollectionStatus>>, api: UploaderPublicApi) => undefined | OutputErrorCollection;
2436
+ declare class ValidationManager extends SharedInstance {
2437
+ private get _uploadCollection();
2438
+ private _commonFileValidators;
2439
+ private _commonCollectionValidators;
2440
+ private _queue;
2441
+ private _runQueueDebounced;
2442
+ private _isDestroyed;
2443
+ private _entryValidationState;
2444
+ constructor(sharedInstancesBag: SharedInstancesBag);
2445
+ runFileValidators(runOn: FileValidatorDescriptor['runOn'], entryIds?: Uid[]): void;
2446
+ runCollectionValidators(): void;
2447
+ cleanupValidationForEntry(entry: TypedData<UploadEntryData>): void;
2448
+ private _runFileValidatorsForEntry;
2449
+ private _addCustomTypeToValidationError;
2450
+ private _getEntryValidationState;
2451
+ private _getValidatorDescriptors;
2452
+ private _getValidatorDescriptorsForEntry;
2453
+ destroy(): void;
2454
+ }
2730
2455
 
2731
2456
  declare const LitBlockBase: typeof LitElement & Constructor<{
2732
2457
  willYield: boolean;
@@ -2738,7 +2463,9 @@ declare const LitBlockBase: typeof LitElement & Constructor<{
2738
2463
  };
2739
2464
  declare class LitBlock extends LitBlockBase {
2740
2465
  private _cfgProxy;
2466
+ protected _sharedContextInstances: Map<keyof SharedInstancesState, ISharedInstance>;
2741
2467
  static styleAttrs: string[];
2468
+ activityType: ActivityType;
2742
2469
  init$: {};
2743
2470
  constructor();
2744
2471
  l10n: (str: string, variables?: Record<string, string | number>) => string;
@@ -2746,7 +2473,6 @@ declare class LitBlock extends LitBlockBase {
2746
2473
  protected _sharedInstancesBag: {
2747
2474
  readonly ctx: PubSub<SharedState>;
2748
2475
  readonly modalManager: ModalManager | null;
2749
- readonly pluginManager: PluginManager;
2750
2476
  readonly telemetryManager: TelemetryManager;
2751
2477
  readonly localeManager: LocaleManager;
2752
2478
  readonly a11y: A11y;
@@ -2756,34 +2482,6 @@ declare class LitBlock extends LitBlockBase {
2756
2482
  readonly secureUploadsManager: SecureUploadsManager;
2757
2483
  readonly api: UploaderPublicApi;
2758
2484
  readonly validationManager: ValidationManager;
2759
- when<TName extends "modalManager" | "pluginManager" | "telemetryManager" | "localeManager" | "a11y" | "clipboard" | "blocksRegistry" | "eventEmitter" | "uploadCollection" | "secureUploadsManager" | "api" | "validationManager">(name: TName, callback: (instance: NonNullable<{
2760
- modalManager: ModalManager | null;
2761
- pluginManager: PluginManager;
2762
- telemetryManager: TelemetryManager;
2763
- localeManager: LocaleManager;
2764
- a11y: A11y;
2765
- clipboard: ClipboardLayer;
2766
- blocksRegistry: BlocksRegistry;
2767
- eventEmitter: EventEmitter;
2768
- uploadCollection: TypedCollection<UploadEntryData>;
2769
- secureUploadsManager: SecureUploadsManager;
2770
- api: UploaderPublicApi;
2771
- validationManager: ValidationManager;
2772
- }[TName]>) => void): () => void;
2773
- wait<TName extends "modalManager" | "pluginManager" | "telemetryManager" | "localeManager" | "a11y" | "clipboard" | "blocksRegistry" | "eventEmitter" | "uploadCollection" | "secureUploadsManager" | "api" | "validationManager">(name: TName): Promise<NonNullable<{
2774
- modalManager: ModalManager | null;
2775
- pluginManager: PluginManager;
2776
- telemetryManager: TelemetryManager;
2777
- localeManager: LocaleManager;
2778
- a11y: A11y;
2779
- clipboard: ClipboardLayer;
2780
- blocksRegistry: BlocksRegistry;
2781
- eventEmitter: EventEmitter;
2782
- uploadCollection: TypedCollection<UploadEntryData>;
2783
- secureUploadsManager: SecureUploadsManager;
2784
- api: UploaderPublicApi;
2785
- validationManager: ValidationManager;
2786
- }[TName]>>;
2787
2485
  };
2788
2486
  emit(type: Parameters<EventEmitter['emit']>[0], payload?: Parameters<EventEmitter['emit']>[1], options?: Parameters<EventEmitter['emit']>[2]): void;
2789
2487
  hasBlockInCtx(callback: (block: LitBlock) => boolean): boolean;
@@ -2802,7 +2500,11 @@ declare class LitBlock extends LitBlockBase {
2802
2500
  * Called when the last block is removed from the context. Note that inheritors must run their callback before that.
2803
2501
  */
2804
2502
  private destroyCtxCallback;
2805
- private _getSharedContextInstances;
2503
+ /**
2504
+ * Adds a shared context instance if it does not exist yet.
2505
+ * @param key The shared state key.
2506
+ * @param resolver The resolver function that creates the instance.
2507
+ */
2806
2508
  protected _addSharedContextInstance<TKey extends keyof SharedInstancesState>(key: TKey, resolver: (sharedInstancesBag: SharedInstancesBag) => NonNullable<SharedInstancesState[TKey]>): void;
2807
2509
  private _destroySharedContextInstances;
2808
2510
  protected _getSharedContextInstance<TKey extends keyof SharedState, TRequired extends boolean = true>(key: TKey, isRequired?: TRequired): TRequired extends true ? NonNullable<SharedState[TKey]> : SharedState[TKey];
@@ -2829,7 +2531,7 @@ declare class Modal extends LitBlock {
2829
2531
  private _handleDialogClose;
2830
2532
  private _handleDialogMouseDown;
2831
2533
  private _handleDialogMouseUp;
2832
- show(): Promise<void>;
2534
+ show(): void;
2833
2535
  hide(): void;
2834
2536
  private _handleModalOpen;
2835
2537
  private _handleModalClose;
@@ -2901,10 +2603,8 @@ declare const toKebabCase: <T extends string>(str: T) => KebabCase<T>;
2901
2603
 
2902
2604
  declare class LitSolutionBlock extends LitBlock {
2903
2605
  static styleAttrs: string[];
2904
- static lazyPlugins: LazyPluginEntry[] | null;
2905
2606
  init$: {
2906
2607
  '*solution': string | null;
2907
- '*lazyPlugins': LazyPluginEntry[] | null;
2908
2608
  '*commonProgress': number;
2909
2609
  '*uploadList': never[];
2910
2610
  '*uploadQueue': _uploadcare_upload_client.Queue;
@@ -3036,32 +2736,9 @@ declare global {
3036
2736
  }
3037
2737
  }
3038
2738
 
3039
- type SourceButtonConfig = {
3040
- id: string;
3041
- label: string;
3042
- icon?: string;
3043
- onClick: () => void | Promise<void>;
3044
- };
3045
- declare class SourceBtn extends LitUploaderBlock {
3046
- couldBeCtxOwner: boolean;
3047
- source?: SourceButtonConfig;
3048
- private _iconName;
3049
- private _srcTypeKey;
3050
- protected willUpdate(changedProperties: PropertyValues<this>): void;
3051
- private _applySource;
3052
- activate(): void;
3053
- render(): lit_html.TemplateResult<1>;
3054
- }
3055
- declare global {
3056
- interface HTMLElementTagNameMap {
3057
- 'uc-source-btn': SourceBtn;
3058
- }
3059
- }
3060
-
3061
- declare class SourceList extends LitUploaderBlock {
2739
+ declare class SourceList extends LitBlock {
3062
2740
  private _rawSourceList;
3063
- private _unsubscribePlugins?;
3064
- private _sources;
2741
+ private _cameraModes;
3065
2742
  /**
3066
2743
  * CSS-only attribute
3067
2744
  */
@@ -3069,10 +2746,8 @@ declare class SourceList extends LitUploaderBlock {
3069
2746
  initCallback(): void;
3070
2747
  protected updated(changedProperties: PropertyValues<this>): void;
3071
2748
  private _updateSources;
3072
- private _expandSource;
3073
- private _makePluginSourceConfig;
2749
+ private _sources;
3074
2750
  render(): lit_html.TemplateResult<1>;
3075
- disconnectedCallback(): void;
3076
2751
  }
3077
2752
  declare global {
3078
2753
  interface HTMLElementTagNameMap {
@@ -3127,8 +2802,6 @@ declare class UploadCtxProvider extends LitUploaderBlock {
3127
2802
  interface UploadCtxProvider extends LitUploaderBlock {
3128
2803
  addEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | AddEventListenerOptions): void;
3129
2804
  removeEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | EventListenerOptions): void;
3130
- addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;
3131
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions): void;
3132
2805
  }
3133
2806
  declare global {
3134
2807
  interface HTMLElementTagNameMap {
@@ -3136,71 +2809,45 @@ declare global {
3136
2809
  }
3137
2810
  }
3138
2811
 
3139
- declare class SimpleBtn extends LitUploaderBlock {
3140
- static styleAttrs: string[];
2812
+ declare class UrlSource extends LitUploaderBlock {
3141
2813
  couldBeCtxOwner: boolean;
3142
- dropzone: boolean;
3143
- private _buttonTextKey;
3144
- private readonly _handleClick;
2814
+ activityType: ActivityType;
2815
+ private _formState;
3145
2816
  initCallback(): void;
2817
+ private _inputRef;
2818
+ private _handleInput;
2819
+ private _handleUpload;
3146
2820
  render(): lit_html.TemplateResult<1>;
3147
2821
  }
3148
2822
  declare global {
3149
2823
  interface HTMLElementTagNameMap {
3150
- 'uc-simple-btn': SimpleBtn;
2824
+ 'uc-url-source': UrlSource;
3151
2825
  }
3152
2826
  }
3153
2827
 
3154
- declare class PluginActivityHost extends LitActivityBlock {
3155
- registration: Owned<PluginActivityRegistration>;
3156
- private _dispose?;
3157
- private _containerRef;
3158
- initCallback(): void;
3159
- protected willUpdate(changedProperties: PropertyValues<this>): void;
3160
- private _ensureRegistered;
3161
- private _renderActivity;
3162
- private _disposeActivity;
3163
- disconnectedCallback(): void;
3164
- render(): lit_html.TemplateResult<1>;
3165
- }
3166
- declare class PluginActivityRenderer extends LitBlock {
3167
- mode: 'modal' | 'inline';
3168
- private _activities;
3169
- private _unsubscribePlugins?;
2828
+ declare class SimpleBtn extends LitUploaderBlock {
2829
+ static styleAttrs: string[];
2830
+ couldBeCtxOwner: boolean;
2831
+ dropzone: boolean;
2832
+ private _buttonTextKey;
2833
+ private readonly _handleClick;
3170
2834
  initCallback(): void;
3171
- private _syncActivities;
3172
- disconnectedCallback(): void;
3173
- render(): lit_html.TemplateResult<1>;
3174
- }
3175
- declare global {
3176
- interface HTMLElementTagNameMap {
3177
- 'uc-plugin-activity-host': PluginActivityHost;
3178
- 'uc-plugin-activity-renderer': PluginActivityRenderer;
3179
- }
3180
- }
3181
-
3182
- declare class UrlSource extends LitUploaderBlock {
3183
- private _formState;
3184
- private _inputRef;
3185
- private _handleInput;
3186
- private _handleUpload;
3187
- firstUpdated(): void;
3188
2835
  render(): lit_html.TemplateResult<1>;
3189
2836
  }
3190
2837
  declare global {
3191
2838
  interface HTMLElementTagNameMap {
3192
- 'uc-url-source': UrlSource;
2839
+ 'uc-simple-btn': SimpleBtn;
3193
2840
  }
3194
2841
  }
3195
2842
 
3196
2843
  declare class FileUploaderRegular extends LitSolutionBlock {
3197
- static lazyPlugins: LazyPluginEntry[];
3198
2844
  attributesMeta: {
3199
2845
  headless?: boolean;
3200
2846
  'ctx-name': string;
3201
2847
  };
3202
2848
  static styleAttrs: string[];
3203
2849
  headless: boolean;
2850
+ smart: boolean;
3204
2851
  constructor();
3205
2852
  initCallback(): void;
3206
2853
  render(): lit_html.TemplateResult<1>;
@@ -3212,7 +2859,6 @@ declare global {
3212
2859
  }
3213
2860
 
3214
2861
  declare class FileUploaderInline extends LitSolutionBlock {
3215
- static lazyPlugins: LazyPluginEntry[];
3216
2862
  attributesMeta: {
3217
2863
  'ctx-name': string;
3218
2864
  };
@@ -3233,7 +2879,6 @@ declare global {
3233
2879
  }
3234
2880
 
3235
2881
  declare class FileUploaderMinimal extends LitSolutionBlock {
3236
- static lazyPlugins: LazyPluginEntry[];
3237
2882
  attributesMeta: {
3238
2883
  'ctx-name': string;
3239
2884
  };
@@ -3260,4 +2905,4 @@ declare global {
3260
2905
  declare const PACKAGE_NAME = "blocks";
3261
2906
  declare const PACKAGE_VERSION: string;
3262
2907
 
3263
- 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 };
2908
+ 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 };