@uploadcare/file-uploader 1.25.0 → 1.26.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 (75) hide show
  1. package/dist/abstract/loadFileUploaderFrom.js +4 -75
  2. package/dist/env.js +4 -33
  3. package/dist/index.css +5 -2660
  4. package/dist/index.d.ts +2326 -1670
  5. package/dist/index.js +6 -12012
  6. package/dist/index.layered.css +4 -2716
  7. package/dist/index.ssr.js +532 -768
  8. package/dist/locales/file-uploader/ar.js +4 -165
  9. package/dist/locales/file-uploader/az.js +4 -157
  10. package/dist/locales/file-uploader/ca.js +4 -159
  11. package/dist/locales/file-uploader/cs.js +4 -161
  12. package/dist/locales/file-uploader/da.js +4 -157
  13. package/dist/locales/file-uploader/de.js +4 -157
  14. package/dist/locales/file-uploader/el.js +4 -157
  15. package/dist/locales/file-uploader/en.js +4 -157
  16. package/dist/locales/file-uploader/es.js +4 -159
  17. package/dist/locales/file-uploader/et.js +4 -157
  18. package/dist/locales/file-uploader/fi.js +4 -157
  19. package/dist/locales/file-uploader/fr.js +4 -159
  20. package/dist/locales/file-uploader/he.js +4 -159
  21. package/dist/locales/file-uploader/hy.js +4 -157
  22. package/dist/locales/file-uploader/is.js +4 -157
  23. package/dist/locales/file-uploader/it.js +4 -159
  24. package/dist/locales/file-uploader/ja.js +4 -157
  25. package/dist/locales/file-uploader/ka.js +4 -157
  26. package/dist/locales/file-uploader/kk.js +4 -157
  27. package/dist/locales/file-uploader/ko.js +4 -157
  28. package/dist/locales/file-uploader/lv.js +4 -159
  29. package/dist/locales/file-uploader/nb.js +4 -157
  30. package/dist/locales/file-uploader/nl.js +4 -157
  31. package/dist/locales/file-uploader/pl.js +4 -161
  32. package/dist/locales/file-uploader/pt.js +4 -159
  33. package/dist/locales/file-uploader/ro.js +4 -159
  34. package/dist/locales/file-uploader/ru.js +4 -161
  35. package/dist/locales/file-uploader/sk.js +4 -161
  36. package/dist/locales/file-uploader/sr.js +4 -159
  37. package/dist/locales/file-uploader/sv.js +4 -157
  38. package/dist/locales/file-uploader/tr.js +4 -157
  39. package/dist/locales/file-uploader/uk.js +4 -161
  40. package/dist/locales/file-uploader/vi.js +4 -157
  41. package/dist/locales/file-uploader/zh-TW.js +4 -157
  42. package/dist/locales/file-uploader/zh.js +4 -157
  43. package/package.json +44 -32
  44. package/types/jsx.d.ts +75 -48
  45. package/web/file-uploader.iife.min.d.ts +2619 -1833
  46. package/web/file-uploader.iife.min.js +6 -27
  47. package/web/file-uploader.iife.min.js.LEGAL.txt +71 -0
  48. package/web/file-uploader.min.d.ts +2619 -1833
  49. package/web/file-uploader.min.js +5 -26
  50. package/web/file-uploader.min.js.LEGAL.txt +71 -0
  51. package/web/uc-basic.layered.min.css +4 -23
  52. package/web/uc-basic.min.css +4 -23
  53. package/web/uc-cloud-image-editor.layered.min.css +4 -23
  54. package/web/uc-cloud-image-editor.min.css +4 -23
  55. package/web/uc-cloud-image-editor.min.d.ts +1835 -580
  56. package/web/uc-cloud-image-editor.min.js +5 -26
  57. package/web/uc-cloud-image-editor.min.js.LEGAL.txt +70 -0
  58. package/web/uc-file-uploader-inline.layered.min.css +4 -23
  59. package/web/uc-file-uploader-inline.min.css +4 -23
  60. package/web/uc-file-uploader-inline.min.d.ts +2619 -1833
  61. package/web/uc-file-uploader-inline.min.js +5 -26
  62. package/web/uc-file-uploader-inline.min.js.LEGAL.txt +71 -0
  63. package/web/uc-file-uploader-minimal.layered.min.css +4 -23
  64. package/web/uc-file-uploader-minimal.min.css +4 -23
  65. package/web/uc-file-uploader-minimal.min.d.ts +2619 -1833
  66. package/web/uc-file-uploader-minimal.min.js +5 -26
  67. package/web/uc-file-uploader-minimal.min.js.LEGAL.txt +71 -0
  68. package/web/uc-file-uploader-regular.layered.min.css +4 -23
  69. package/web/uc-file-uploader-regular.min.css +4 -23
  70. package/web/uc-file-uploader-regular.min.d.ts +2619 -1833
  71. package/web/uc-file-uploader-regular.min.js +5 -26
  72. package/web/uc-file-uploader-regular.min.js.LEGAL.txt +71 -0
  73. package/web/uc-img.min.d.ts +60 -100
  74. package/web/uc-img.min.js +5 -25
  75. package/web/uc-img.min.js.LEGAL.txt +24 -0
@@ -1,1294 +1,1259 @@
1
- import { BaseComponent } from '@symbiotejs/symbiote';
2
- export { BaseComponent, Data, UID } from '@symbiotejs/symbiote';
1
+ import { LitElement, PropertyValues, TemplateResult, nothing } from 'lit';
2
+ import * as lit_html from 'lit-html';
3
+ import * as lit_html_directives_ref_js from 'lit-html/directives/ref.js';
3
4
  import * as _uploadcare_upload_client from '@uploadcare/upload-client';
4
- import { UploadcareFile, Metadata, UploadError, NetworkError, UploadcareGroup, FileFromOptions } from '@uploadcare/upload-client';
5
+ import { UploadcareFile, Metadata, FileFromOptions, UploadError, NetworkError, UploadcareGroup, Queue } from '@uploadcare/upload-client';
5
6
  export { Metadata, NetworkError, UploadError, UploadcareError, UploadcareFile, UploadcareGroup } from '@uploadcare/upload-client';
7
+ import { Ref } from 'lit/directives/ref.js';
6
8
  import { TelemetryRequest } from '@uploadcare/quality-insights';
7
9
 
8
- declare class A11y {
10
+ type Unsubscriber = () => void;
11
+ declare class PubSub<T extends Record<string, unknown>> {
12
+ private static _contexts;
13
+ private _store;
14
+ private _ctxId;
15
+ private constructor();
16
+ get id(): string;
17
+ pub<K extends keyof T>(key: K, value: T[K]): void;
18
+ sub<K extends keyof T>(key: K, callback: (value: T[K]) => void, init?: boolean): Unsubscriber;
19
+ read<K extends keyof T>(key: K): T[K];
20
+ add<K extends keyof T>(key: K, value: T[K], rewrite?: boolean): void;
21
+ has(key: keyof T): boolean;
22
+ get store(): T;
23
+ static registerCtx<T extends Record<string, unknown>>(initialValue: T, ctxId: string): PubSub<T>;
24
+ static deleteCtx(ctxId: string): void;
25
+ static getCtx<T extends Record<string, unknown> = Record<string, unknown>>(ctxId: string): PubSub<T> | null;
26
+ static hasCtx(ctxId: string): boolean;
27
+ }
28
+
29
+ type Constructor<T = unknown> = new (...args: any[]) => T;
30
+
31
+ type SymbioteStateBag<T extends Record<string, unknown>> = T;
32
+ /**
33
+ * Interface for components using SymbioteMixin
34
+ */
35
+ declare class SymbioteComponent<TState extends Record<string, unknown> = Record<string, unknown>> {
36
+ $: SymbioteStateBag<TState>;
37
+ sub<TKey extends keyof TState>(key: TKey, callback: (value: TState[TKey]) => void, init?: boolean): () => void;
38
+ pub<TKey extends keyof TState>(key: TKey, value: TState[TKey]): void;
39
+ set$<T extends {
40
+ [K in keyof T]: K extends keyof TState ? TState[K] : never;
41
+ }>(obj: T): void;
42
+ has<TKey extends keyof TState>(key: TKey): boolean;
43
+ add<TKey extends keyof TState>(key: TKey, val: TState[TKey], rewrite?: boolean): void;
44
+ add$<T extends {
45
+ [K in keyof T]: K extends keyof TState ? TState[K] : never;
46
+ }>(obj: T, rewrite?: boolean): void;
47
+ initCallback(): void;
48
+ sharedCtx: PubSub<TState>;
49
+ ctxName: string;
50
+ ctxOwner: boolean;
51
+ }
52
+
53
+ declare const BaseComponent_base: typeof LitElement & Constructor<{
54
+ willYield: boolean;
55
+ yield(slot: string, defaultContent?: unknown): unknown;
56
+ }> & Constructor<{
57
+ getCssData(propName: string, silentCheck?: boolean): string | number | boolean | null | undefined;
58
+ }> & Constructor<SymbioteComponent<Record<string, unknown>>> & Constructor<LitElement> & {
59
+ reg(tagName: string): void;
60
+ };
61
+ declare class BaseComponent extends BaseComponent_base {
62
+ }
63
+
64
+ type Uid = string & {
65
+ __uid: true;
66
+ };
67
+
68
+ declare class UID {
69
+ static generateFastUid(): Uid;
70
+ static generateRandomUUID(): string;
71
+ }
72
+
73
+ declare function defineComponents(blockExports: Record<string, any>): void;
74
+
75
+ declare const UC_WINDOW_KEY = "UC";
76
+ type IndexModule = Record<string, any>;
77
+ declare global {
78
+ interface Window {
79
+ [UC_WINDOW_KEY]?: IndexModule;
80
+ }
81
+ }
82
+ /**
83
+ * @param url File Uploader pack url
84
+ * @param [register] Register connected package, if it not registered yet
85
+ */
86
+ declare function loadFileUploaderFrom(url: string, register?: boolean): Promise<IndexModule | null>;
87
+
88
+ declare const _default: {
89
+ 'locale-id': string;
90
+ 'social-source-lang': string;
91
+ 'upload-file': string;
92
+ 'upload-files': string;
93
+ 'choose-file': string;
94
+ 'choose-files': string;
95
+ 'drop-files-here': string;
96
+ 'select-file-source': string;
97
+ selected: string;
98
+ upload: string;
99
+ 'add-more': string;
100
+ cancel: string;
101
+ 'start-from-cancel': string;
102
+ clear: string;
103
+ 'camera-shot': string;
104
+ 'upload-url': string;
105
+ 'upload-url-placeholder': string;
106
+ 'edit-image': string;
107
+ 'edit-detail': string;
108
+ back: string;
109
+ done: string;
110
+ ok: string;
111
+ 'remove-from-list': string;
112
+ no: string;
113
+ yes: string;
114
+ 'confirm-your-action': string;
115
+ 'are-you-sure': string;
116
+ 'selected-count': string;
117
+ 'select-all': string;
118
+ 'deselect-all': string;
119
+ 'upload-error': string;
120
+ 'validation-error': string;
121
+ 'no-files': string;
122
+ browse: string;
123
+ 'not-uploaded-yet': string;
124
+ file__one: string;
125
+ file__other: string;
126
+ error__one: string;
127
+ error__other: string;
128
+ 'header-uploading': string;
129
+ 'header-failed': string;
130
+ 'header-succeed': string;
131
+ 'header-total': string;
132
+ 'src-type-local': string;
133
+ 'src-type-from-url': string;
134
+ 'src-type-camera': string;
135
+ 'src-type-mobile-video-camera': string;
136
+ 'src-type-mobile-photo-camera': string;
137
+ 'src-type-draw': string;
138
+ 'src-type-facebook': string;
139
+ 'src-type-dropbox': string;
140
+ 'src-type-gdrive': string;
141
+ 'src-type-ngdrive': string;
142
+ 'src-type-gphotos': string;
143
+ 'src-type-flickr': string;
144
+ 'src-type-vk': string;
145
+ 'src-type-evernote': string;
146
+ 'src-type-box': string;
147
+ 'src-type-onedrive': string;
148
+ 'src-type-huddle': string;
149
+ 'src-type-other': string;
150
+ 'caption-from-url': string;
151
+ 'caption-camera': string;
152
+ 'caption-draw': string;
153
+ 'caption-edit-file': string;
154
+ 'file-no-name': string;
155
+ 'toggle-fullscreen': string;
156
+ 'toggle-guides': string;
157
+ rotate: string;
158
+ 'flip-vertical': string;
159
+ 'flip-horizontal': string;
160
+ apply: string;
161
+ brightness: string;
162
+ contrast: string;
163
+ saturation: string;
164
+ exposure: string;
165
+ gamma: string;
166
+ vibrance: string;
167
+ warmth: string;
168
+ enhance: string;
169
+ original: string;
170
+ resize: string;
171
+ crop: string;
172
+ 'select-color': string;
173
+ text: string;
174
+ draw: string;
175
+ 'cancel-edit': string;
176
+ 'tab-view': string;
177
+ 'tab-details': string;
178
+ 'file-name': string;
179
+ 'file-size': string;
180
+ 'cdn-url': string;
181
+ 'file-size-unknown': string;
182
+ 'camera-permissions-denied': string;
183
+ 'camera-permissions-prompt': string;
184
+ 'camera-permissions-request': string;
185
+ 'files-count-limit-error-title': string;
186
+ 'files-count-limit-error-too-few': string;
187
+ 'files-count-limit-error-too-many': string;
188
+ 'files-max-size-limit-error': string;
189
+ 'has-validation-errors': string;
190
+ 'images-only-accepted': string;
191
+ 'file-type-not-allowed': string;
192
+ 'some-files-were-not-uploaded': string;
193
+ 'file-item-edit-button': string;
194
+ 'file-item-remove-button': string;
195
+ 'a11y-editor-tab-filters': string;
196
+ 'a11y-editor-tab-tuning': string;
197
+ 'a11y-editor-tab-crop': string;
198
+ 'a11y-activity-header-button-close': string;
199
+ flip: string;
200
+ mirror: string;
201
+ 'a11y-cloud-editor-apply-filter': string;
202
+ 'a11y-cloud-editor-apply-crop': string;
203
+ 'a11y-cloud-editor-apply-tuning': string;
204
+ 'a11y-cloud-editor-apply-aspect-ratio': string;
205
+ finished: string;
206
+ failed: string;
207
+ uploading: string;
208
+ idle: string;
209
+ 'a11y-file-item-status': string;
210
+ 'waiting-for': string;
211
+ 'queued-uploading': string;
212
+ 'queued-validation': string;
213
+ validation: string;
214
+ 'crop-to-shape': string;
215
+ custom: string;
216
+ 'freeform-crop': string;
217
+ };
218
+
219
+ type LocaleDefinition = typeof _default;
220
+ type LocaleDefinitionResolver = () => Promise<LocaleDefinition>;
221
+ declare const defineLocale: (localeName: string, definitionOrResolver: LocaleDefinition | LocaleDefinitionResolver) => void;
222
+
223
+ declare class A11y implements ISharedInstance {
9
224
  private _destroyKeyUX;
10
225
  private readonly _scopedWindow;
11
226
  constructor();
12
- registerBlock(scope: Block): void;
227
+ registerBlock(scope: LitBlock): void;
13
228
  destroy(): void;
14
229
  }
15
230
 
16
- type LocaleChangeCallback = () => void;
17
- declare class LocaleManager {
18
- private _blockInstance;
231
+ declare class LocaleManager extends SharedInstance {
19
232
  private _localeName;
20
- private _callbacks;
21
- private _boundBlocks;
22
- constructor(blockInstance: Block);
23
- onLocaleChange(callback: LocaleChangeCallback): () => void;
24
- bindL10n(block: Block, key: string, resolver: LocaleChangeCallback): void;
25
- destroyL10nBindings(block: Block): void;
233
+ constructor(sharedInstancesBag: SharedInstancesBag);
234
+ }
235
+
236
+ declare class TypedData<T extends Record<string, unknown>> {
237
+ private _ctxId;
238
+ private _data;
239
+ constructor(initialValue: T);
240
+ get uid(): Uid;
241
+ setValue<K extends keyof T>(prop: K, value: T[K]): void;
242
+ setMultipleValues(updObj: Partial<T>): void;
243
+ getValue<K extends keyof T>(prop: K): T[K];
244
+ subscribe<K extends keyof T>(prop: K, handler: (newVal: T[K]) => void): Unsubscriber;
26
245
  destroy(): void;
27
246
  }
28
247
 
29
- declare class Modal extends Block {
30
- static styleAttrs: string[];
31
- static StateConsumerScope: string;
32
- private _mouseDownTarget;
33
- handleModalOpen: ModalCb;
34
- handleModalClose: ModalCb;
35
- handleModalCloseAll: ModalCb;
36
- constructor();
37
- _handleBackdropClick: () => void;
38
- _closeDialog: () => void;
39
- _handleDialogClose: () => void;
40
- _handleDialogMouseDown: (e: MouseEvent) => void;
41
- _handleDialogMouseUp: (e: MouseEvent) => void;
42
- show(): void;
43
- hide(): void;
44
- private _handleModalOpen;
45
- private _handleModalClose;
46
- private _handleModalCloseAll;
47
- initCallback(): void;
48
- destroyCallback(): void;
248
+ type ChangeMap<T extends Record<string, unknown>> = Record<keyof T, Set<Uid>>;
249
+ type TypedCollectionPropertyObserver<T extends Record<string, unknown>> = (changeMap: ChangeMap<T>) => void;
250
+ type TypedCollectionObserverHandler<T extends Record<string, unknown>> = (list: Uid[], added: Set<TypedData<T>>, removed: Set<TypedData<T>>) => void;
251
+ type TypedCollectionOptions<T extends Record<string, unknown>> = {
252
+ initialValue: T;
253
+ watchList?: (keyof T)[];
254
+ handler?: TypedCollectionObserverHandler<T>;
255
+ };
256
+ declare class TypedCollection<T extends Record<string, unknown>> {
257
+ private static readonly _destroyDelayMs;
258
+ private _ctxId;
259
+ private _data;
260
+ private _watchList;
261
+ private _subsMap;
262
+ private _propertyObservers;
263
+ private _collectionObservers;
264
+ private _items;
265
+ private _removed;
266
+ private _added;
267
+ private _markedToDestroy;
268
+ private _observeTimeout?;
269
+ private _notifyTimeout?;
270
+ private _destroyTimeout?;
271
+ private _notifyObservers;
272
+ private _initialValue;
273
+ constructor(options: TypedCollectionOptions<T>);
274
+ private _notify;
275
+ private _scheduleDestroyMarkedItems;
276
+ observeCollection(handler: TypedCollectionObserverHandler<T>): () => void;
277
+ unobserveCollection(handler: TypedCollectionObserverHandler<T>): void;
278
+ add(init: Partial<T>): Uid;
279
+ hasItem(id: Uid): boolean;
280
+ read(id: Uid): TypedData<T> | null;
281
+ readProp<K extends keyof T>(id: Uid, propName: K): T[K];
282
+ publishProp<K extends keyof T>(id: Uid, propName: K, value: T[K]): void;
283
+ remove(id: Uid): void;
284
+ clearAll(): void;
285
+ observeProperties(handler: TypedCollectionPropertyObserver<T>): () => void;
286
+ unobserveProperties(handler: TypedCollectionPropertyObserver<T>): void;
287
+ findItems(checkFn: (item: TypedData<T>) => boolean): Uid[];
288
+ items(): Uid[];
289
+ get size(): number;
290
+ destroy(): void;
49
291
  }
50
292
 
51
- declare const ModalEvents: Readonly<{
52
- readonly ADD: "modal:add";
53
- readonly DELETE: "modal:delete";
54
- readonly OPEN: "modal:open";
55
- readonly CLOSE: "modal:close";
56
- readonly CLOSE_ALL: "modal:closeAll";
57
- readonly DESTROY: "modal:destroy";
293
+ declare const CameraSourceTypes: Readonly<{
294
+ PHOTO: "photo";
295
+ VIDEO: "video";
58
296
  }>;
59
- type ModalId = ActivityType;
60
- type ModalCb = (data: {
61
- id: ModalId;
62
- modal: Modal;
63
- }) => void;
64
- type ModalEventType = (typeof ModalEvents)[keyof typeof ModalEvents];
65
- declare class ModalManager {
66
- private _modals;
67
- private _activeModals;
68
- private _subscribers;
69
- private _block;
70
- constructor(block: Block);
71
- private _debugPrint;
72
- /**
73
- * Register a modal with the manager
74
- * @param id Unique identifier for the modal
75
- * @param modal Modal component instance
76
- */
77
- registerModal(id: ModalId, modal: Modal): void;
78
- /** Remove a modal by ID. */
79
- deleteModal(id: ModalId): boolean;
80
- /** Open a modal by its ID. */
81
- open(id: ModalId): boolean;
82
- /** Close a specific modal by ID. */
83
- close(id: ModalId): boolean;
84
- /** Toggle a modal - open if closed, close if open. */
85
- toggle(id: ModalId): boolean;
86
- /** True if there are any active modals. */
87
- get hasActiveModals(): boolean;
88
- /** Close the most recently opened modal and return to the previous one. */
89
- back(): boolean;
90
- /** Close all open modals. */
91
- closeAll(): number;
92
- /**
93
- * Subscribe to modal events
94
- * @returns Unsubscribe function
95
- */
96
- subscribe(event: ModalEventType, callback: ModalCb): () => void;
97
- /** Unsubscribe from modal events */
98
- unsubscribe(event: ModalEventType, callback: ModalCb | undefined): void;
99
- /** Notify all subscribers of a modal event. */
100
- private _notify;
101
- /** Destroy the modal manager, clean up resources */
102
- destroy(): void;
297
+ type ModeCameraType = (typeof CameraSourceTypes)[keyof typeof CameraSourceTypes];
298
+
299
+ declare function buildOutputCollectionState<TCollectionStatus extends OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'>(bag: SharedInstancesBag): OutputCollectionState<TCollectionStatus, TGroupFlag>;
300
+
301
+ interface UploadEntryData extends Record<string, unknown> {
302
+ file: File | null;
303
+ externalUrl: string | null;
304
+ fileName: string | null;
305
+ fileSize: number | null;
306
+ lastModified: number;
307
+ uploadProgress: number;
308
+ uuid: string | null;
309
+ isImage: boolean;
310
+ mimeType: string | null;
311
+ ctxName: string | null;
312
+ cdnUrl: string | null;
313
+ cdnUrlModifiers: string | null;
314
+ fileInfo: UploadcareFile | null;
315
+ isUploading: boolean;
316
+ abortController: AbortController | null;
317
+ thumbUrl: string | null;
318
+ silent: boolean;
319
+ source: string | null;
320
+ fullPath: string | null;
321
+ metadata: Metadata | null;
322
+ errors: OutputErrorFile[];
323
+ uploadError: Error | null;
324
+ isRemoved: boolean;
325
+ isQueuedForUploading: boolean;
326
+ isValidationPending: boolean;
327
+ isQueuedForValidation: boolean;
103
328
  }
329
+ type UploadEntryTypedData = TypedData<UploadEntryData>;
330
+ type UploadEntryKeys = keyof UploadEntryData;
104
331
 
105
- type CommonEventType = InternalEventKey | EventKey;
106
- type TelemetryState = TelemetryRequest & {
107
- eventTimestamp: number;
108
- location: string;
109
- };
110
- type TelemetryEventBody = Partial<Pick<TelemetryState, 'payload' | 'config'>> & {
111
- modalId?: string;
112
- eventType?: CommonEventType;
332
+ type ApiAddFileCommonOptions = {
333
+ silent?: boolean;
334
+ fileName?: string;
335
+ source?: string;
113
336
  };
114
- declare class TelemetryManager {
115
- private readonly _sessionId;
116
- private readonly _telemetryInstance;
117
- private readonly _block;
118
- private _config;
119
- private _initialized;
120
- private _lastPayload;
121
- private readonly _queue;
122
- constructor(block: Block);
123
- private _init;
124
- private _setConfig;
125
- private _formattingPayload;
126
- private _excludedEvents;
127
- sendEvent(body: TelemetryEventBody): void;
128
- sendEventError(error: unknown, context?: string): void;
129
- /**
130
- * Method to send telemetry event for Cloud Image Editor.
131
- */
132
- sendEventCloudImageEditor(e: MouseEvent, tabId: string, options?: Record<string, unknown>): void;
337
+ declare class UploaderPublicApi extends SharedInstance {
338
+ private _l10n;
339
+ get _uploadCollection(): TypedCollection<UploadEntryData>;
340
+ get cfg(): Readonly<ConfigType>;
341
+ get l10n(): (str: string, variables?: Record<string, string | number>) => string;
133
342
  /**
134
- * Deeply compares two objects and returns true if they are equal, false otherwise.
343
+ * TODO: Probably we should not allow user to override `source` property
135
344
  */
136
- private _checkObj;
137
- private get _timestamp();
138
- private get _solution();
139
- private get _activity();
140
- private get _location();
345
+ addFileFromUrl: (url: string, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"idle">;
346
+ addFileFromUuid: (uuid: string, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"idle">;
347
+ addFileFromCdnUrl: (cdnUrl: string, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"idle">;
348
+ addFileFromObject: (file: File, { silent, fileName, source, fullPath, }?: ApiAddFileCommonOptions & {
349
+ fullPath?: string;
350
+ }) => OutputFileEntry<"idle">;
351
+ removeFileByInternalId: (internalId: string) => void;
352
+ removeAllFiles(): void;
353
+ uploadAll: () => void;
354
+ openSystemDialog: (options?: {
355
+ captureCamera?: boolean;
356
+ modeCamera?: ModeCameraType;
357
+ }) => void;
358
+ getOutputItem<TStatus extends OutputFileStatus>(entryId: string): OutputFileEntry<TStatus>;
359
+ getOutputCollectionState<TStatus extends OutputCollectionStatus>(): ReturnType<typeof buildOutputCollectionState<TStatus>>;
360
+ initFlow: (force?: boolean) => void;
361
+ doneFlow: () => void;
362
+ setCurrentActivity: <T extends RegisteredActivityType>(activityType: T, ...params: T extends keyof ActivityParamsMap ? [ActivityParamsMap[T]] : T extends RegisteredActivityType ? [undefined?] : [never]) => void;
363
+ getCurrentActivity: () => ActivityType;
364
+ setModalState: (opened: boolean) => void;
365
+ private get _sourceList();
141
366
  }
142
367
 
143
- declare class Block extends BaseComponent<any> {
144
- private __cfgProxy?;
145
- protected l10nProcessorSubs: Map<string, Set<{
146
- remove: () => void;
147
- }>>;
148
- static StateConsumerScope: string | null;
149
- static styleAttrs: string[];
150
- protected requireCtxName: boolean;
151
- activityType: ActivityType;
152
- init$: {};
153
- l10n(str: string, variables?: Record<string, string | number>): string;
154
- private pluralize;
155
- protected bindL10n(key: string, resolver: () => void): void;
156
- constructor();
157
- emit(type: Parameters<EventEmitter['emit']>[0], payload?: Parameters<EventEmitter['emit']>[1], options?: Parameters<EventEmitter['emit']>[2]): void;
158
- hasBlockInCtx(callback: (block: Block) => boolean): boolean;
159
- setOrAddState(prop: string, newVal: any): void;
160
- connectedCallback(): void;
161
- disconnectedCallback(): void;
162
- initCallback(): void;
163
- get testId(): string;
164
- get modalManager(): ModalManager | undefined;
165
- get telemetryManager(): TelemetryManager | {
166
- sendEvent: () => void;
167
- sendEventCloudImageEditor: () => void;
168
- sendEventError: () => void;
368
+ declare const ExternalUploadSource: Readonly<{
369
+ readonly FACEBOOK: "facebook";
370
+ readonly DROPBOX: "dropbox";
371
+ readonly GDRIVE: "gdrive";
372
+ readonly GPHOTOS: "gphotos";
373
+ readonly FLICKR: "flickr";
374
+ readonly VK: "vk";
375
+ readonly EVERNOTE: "evernote";
376
+ readonly BOX: "box";
377
+ readonly ONEDRIVE: "onedrive";
378
+ readonly HUDDLE: "huddle";
379
+ }>;
380
+ declare const UploadSource: Readonly<{
381
+ readonly FACEBOOK: "facebook";
382
+ readonly DROPBOX: "dropbox";
383
+ readonly GDRIVE: "gdrive";
384
+ readonly GPHOTOS: "gphotos";
385
+ readonly FLICKR: "flickr";
386
+ readonly VK: "vk";
387
+ readonly EVERNOTE: "evernote";
388
+ readonly BOX: "box";
389
+ readonly ONEDRIVE: "onedrive";
390
+ readonly HUDDLE: "huddle";
391
+ readonly MOBILE_VIDEO_CAMERA: "mobile-video-camera";
392
+ readonly MOBILE_PHOTO_CAMERA: "mobile-photo-camera";
393
+ readonly LOCAL: "local";
394
+ readonly DROP_AREA: "drop-area";
395
+ readonly CAMERA: "camera";
396
+ readonly EXTERNAL: "external";
397
+ readonly API: "js-api";
398
+ readonly URL: "url";
399
+ readonly DRAW: "draw";
400
+ }>;
401
+ type SourceTypes = (typeof UploadSource)[keyof typeof UploadSource];
402
+
403
+ declare class LitUploaderBlock extends LitActivityBlock {
404
+ static extSrcList: Readonly<typeof ExternalUploadSource>;
405
+ static sourceTypes: Readonly<typeof UploadSource>;
406
+ protected couldBeCtxOwner: boolean;
407
+ private _isCtxOwner;
408
+ private _unobserveCollection?;
409
+ private _unobserveCollectionProperties?;
410
+ init$: {
411
+ '*commonProgress': number;
412
+ '*uploadList': never[];
413
+ '*uploadQueue': _uploadcare_upload_client.Queue;
414
+ '*collectionErrors': OutputErrorCollection[];
415
+ '*collectionState': OutputCollectionState | null;
416
+ '*groupInfo': _uploadcare_upload_client.UploadcareGroup | null;
417
+ '*uploadTrigger': Set<string>;
418
+ '*currentActivity': null;
419
+ '*currentActivityParams': {};
420
+ '*history': never[];
421
+ '*historyBack': null;
422
+ '*closeModal': () => void;
169
423
  };
170
- protected get localeManager(): LocaleManager | null;
171
- protected get a11y(): A11y | null;
172
- protected get blocksRegistry(): Set<Block>;
173
- destroyCallback(): void;
174
- /**
175
- * Called when the last block is removed from the context. Note that inheritors must run their callback before that.
176
- */
177
- protected destroyCtxCallback(): void;
178
- protected proxyUrl(url: string): Promise<string>;
179
- get cfg(): ConfigType;
180
- subConfigValue<T extends keyof ConfigType>(key: T, callback: (value: ConfigType[T]) => void): void;
181
- debugPrint(...args: unknown[]): void;
182
- static reg(name?: string): void;
424
+ private get _hasCtxOwner();
425
+ initCallback(): void;
426
+ getAPI(): UploaderPublicApi;
427
+ get validationManager(): ValidationManager;
428
+ get api(): UploaderPublicApi;
429
+ get uploadCollection(): TypedCollection<UploadEntryData>;
430
+ get secureUploadsManager(): SecureUploadsManager;
431
+ disconnectedCallback(): void;
432
+ connectedCallback(): void;
433
+ private _initCtxOwner;
434
+ private _observeUploadCollection;
435
+ private _unobserveUploadCollection;
436
+ private _createGroup;
437
+ private _flushOutputItems;
438
+ private _handleCollectionUpdate;
439
+ private _handleCollectionPropertiesUpdate;
440
+ private _flushCommonUploadProgress;
441
+ private _openCloudImageEditor;
442
+ private _setInitialCrop;
443
+ protected getMetadataFor(entryId: string): Promise<_uploadcare_upload_client.Metadata | undefined>;
444
+ protected getUploadClientOptions(): Promise<FileFromOptions>;
445
+ getOutputData(): OutputFileEntry[];
183
446
  }
184
447
 
185
- declare const InternalEventType: Readonly<{
186
- readonly INIT_SOLUTION: "init-solution";
187
- readonly CHANGE_CONFIG: "change-config";
188
- readonly ACTION_EVENT: "action-event";
189
- readonly ERROR_EVENT: "error-event";
190
- }>;
191
- declare const EventType: Readonly<{
192
- readonly FILE_ADDED: "file-added";
193
- readonly FILE_REMOVED: "file-removed";
194
- readonly FILE_UPLOAD_START: "file-upload-start";
195
- readonly FILE_UPLOAD_PROGRESS: "file-upload-progress";
196
- readonly FILE_UPLOAD_SUCCESS: "file-upload-success";
197
- readonly FILE_UPLOAD_FAILED: "file-upload-failed";
198
- readonly FILE_URL_CHANGED: "file-url-changed";
199
- readonly MODAL_OPEN: "modal-open";
200
- readonly MODAL_CLOSE: "modal-close";
201
- readonly DONE_CLICK: "done-click";
202
- readonly UPLOAD_CLICK: "upload-click";
203
- readonly ACTIVITY_CHANGE: "activity-change";
204
- readonly COMMON_UPLOAD_START: "common-upload-start";
205
- readonly COMMON_UPLOAD_PROGRESS: "common-upload-progress";
206
- readonly COMMON_UPLOAD_SUCCESS: "common-upload-success";
207
- readonly COMMON_UPLOAD_FAILED: "common-upload-failed";
208
- readonly CHANGE: "change";
209
- readonly GROUP_CREATED: "group-created";
210
- }>;
211
- type EventKey = (typeof EventType)[keyof typeof EventType];
212
- type InternalEventKey = (typeof InternalEventType)[keyof typeof InternalEventType];
213
- type EventPayload = {
214
- [EventType.FILE_ADDED]: OutputFileEntry<'idle'>;
215
- [EventType.FILE_REMOVED]: OutputFileEntry<'removed'>;
216
- [EventType.FILE_UPLOAD_START]: OutputFileEntry<'uploading'>;
217
- [EventType.FILE_UPLOAD_PROGRESS]: OutputFileEntry<'uploading'>;
218
- [EventType.FILE_UPLOAD_SUCCESS]: OutputFileEntry<'success'>;
219
- [EventType.FILE_UPLOAD_FAILED]: OutputFileEntry<'failed'>;
220
- [EventType.FILE_URL_CHANGED]: OutputFileEntry<'success'>;
221
- [EventType.MODAL_OPEN]: {
222
- modalId: ModalId;
223
- };
224
- [EventType.MODAL_CLOSE]: {
225
- modalId: ModalId;
226
- hasActiveModals: boolean;
448
+ /**
449
+ * Mapping of loading resources per operation
450
+ */
451
+ type LoadingOperations = Map<string, Map<string, boolean>>;
452
+ /**
453
+ * Image size
454
+ */
455
+ interface ImageSize {
456
+ width: number;
457
+ height: number;
458
+ }
459
+ interface Transformations {
460
+ enhance?: number;
461
+ brightness?: number;
462
+ exposure?: number;
463
+ gamma?: number;
464
+ contrast?: number;
465
+ saturation?: number;
466
+ vibrance?: number;
467
+ warmth?: number;
468
+ rotate?: number;
469
+ mirror?: boolean;
470
+ flip?: boolean;
471
+ filter?: {
472
+ name: string;
473
+ amount: number;
227
474
  };
228
- [EventType.ACTIVITY_CHANGE]: {
229
- activity: ActivityType;
475
+ crop?: {
476
+ dimensions: [number, number];
477
+ coords: [number, number];
230
478
  };
231
- [EventType.UPLOAD_CLICK]: void;
232
- [EventType.DONE_CLICK]: OutputCollectionState;
233
- [EventType.COMMON_UPLOAD_START]: OutputCollectionState<'uploading'>;
234
- [EventType.COMMON_UPLOAD_PROGRESS]: OutputCollectionState<'uploading'>;
235
- [EventType.COMMON_UPLOAD_SUCCESS]: OutputCollectionState<'success'>;
236
- [EventType.COMMON_UPLOAD_FAILED]: OutputCollectionState<'failed'>;
237
- [EventType.CHANGE]: OutputCollectionState;
238
- [EventType.GROUP_CREATED]: OutputCollectionState<'success', 'has-group'>;
239
- };
240
- declare class EventEmitter {
241
- private _timeoutStore;
242
- private _targets;
243
- private _debugPrint;
244
- constructor(debugPrint: (...args: unknown[]) => void);
245
- bindTarget(target: Block): void;
246
- unbindTarget(target: Block): void;
247
- private _dispatch;
248
- emit<T extends EventKey, TDebounce extends boolean | number | undefined = undefined>(type: T, payload?: TDebounce extends false | undefined ? EventPayload[T] : () => EventPayload[T], options?: {
249
- debounce?: TDebounce;
250
- }): void;
251
479
  }
252
-
253
- type EventMap = {
254
- [T in keyof EventPayload]: CustomEvent<EventPayload[T]>;
480
+ interface ApplyResult {
481
+ originalUrl: string;
482
+ cdnUrlModifiers: string;
483
+ cdnUrl: string;
484
+ transformations: Transformations;
485
+ }
486
+ type ChangeResult = ApplyResult;
487
+ interface CropAspectRatio {
488
+ type: 'aspect-ratio';
489
+ width: number;
490
+ height: number;
491
+ id: string;
492
+ hasFreeform?: boolean;
493
+ }
494
+ type CropPresetList = CropAspectRatio[];
495
+
496
+ declare function initState(fnCtx: CloudImageEditorBlock): {
497
+ '*originalUrl': null;
498
+ '*loadingOperations': LoadingOperations;
499
+ '*faderEl': null;
500
+ '*cropperEl': null;
501
+ '*imgEl': null;
502
+ '*imgContainerEl': null;
503
+ '*networkProblems': boolean;
504
+ '*imageSize': null;
505
+ '*editorTransformations': {};
506
+ '*cropPresetList': never[];
507
+ '*currentAspectRatio': null;
508
+ '*tabList': readonly ["crop", "tuning", "filters"];
509
+ '*tabId': "crop";
510
+ '*on.retryNetwork': () => void;
511
+ '*on.apply': (transformations: Transformations) => void;
512
+ '*on.cancel': () => void;
255
513
  };
256
514
 
257
- type LocaleDefinition = Record<string, string>;
258
- type LocaleDefinitionResolver = () => Promise<LocaleDefinition>;
259
- declare const defineLocale: (localeName: string, definitionOrResolver: LocaleDefinition | LocaleDefinitionResolver) => void;
260
-
261
- declare function buildOutputCollectionState<TCollectionStatus extends OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'>(uploaderBlock: UploaderBlock): OutputCollectionState<TCollectionStatus, TGroupFlag>;
262
-
263
- type TypedSchema = Record<string, {
264
- type: unknown;
265
- value: unknown;
266
- nullable?: boolean;
267
- }>;
268
- type Constructor<T = any> = new (...args: any[]) => T;
269
- type ExtractType<T, V> = T extends StringConstructor ? string : T extends BooleanConstructor ? boolean : T extends NumberConstructor ? number : T extends ArrayConstructor ? V : T extends Constructor ? InstanceType<T> : T;
270
- type ExtractDataFromSchema<T extends TypedSchema> = {
271
- [K in keyof T]: ExtractType<T[K]['type'], T[K]['value']> | (T[K]['nullable'] extends true ? null : never);
515
+ type PresenceToggleStyle = {
516
+ transition?: string;
517
+ visible?: string;
518
+ hidden?: string;
272
519
  };
273
- type ExtractKeysFromSchema<T extends TypedSchema> = Extract<keyof T, string>;
274
- declare class TypedData<T extends TypedSchema> {
275
- private __typedSchema;
276
- private __ctxId;
277
- private __schema;
278
- private __data;
279
- constructor(typedSchema: T, ctxName?: string);
280
- get uid(): string;
281
- setValue<K extends ExtractKeysFromSchema<T>>(prop: K, value: ExtractDataFromSchema<T>[K]): void;
282
- setMultipleValues(updObj: Partial<ExtractDataFromSchema<T>>): void;
283
- getValue<K extends ExtractKeysFromSchema<T>>(prop: K): ExtractDataFromSchema<T>[K];
284
- subscribe<K extends ExtractKeysFromSchema<T>>(prop: K, handler: (newVal: ExtractDataFromSchema<T>[K]) => void): {
285
- remove: () => void;
286
- callback: Function;
287
- };
288
- remove(): void;
520
+ declare class PresenceToggle extends LitBlock {
521
+ private _visible;
522
+ private _styles;
523
+ private _visibleStyle;
524
+ private _hiddenStyle;
525
+ private _externalTransitions;
526
+ private _initialRenderComplete;
527
+ set visible(value: boolean);
528
+ get visible(): boolean;
529
+ set styles(styles: PresenceToggleStyle);
530
+ get styles(): PresenceToggleStyle;
531
+ private _handleVisible;
532
+ private _dispatchInitialRenderEvent;
533
+ initCallback(): void;
534
+ }
535
+ declare global {
536
+ interface HTMLElementTagNameMap {
537
+ 'uc-presence-toggle': PresenceToggle;
538
+ }
289
539
  }
290
540
 
291
- declare const uploadEntrySchema: Readonly<{
292
- file: Readonly<{
293
- type: {
294
- new (fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;
295
- prototype: File;
296
- };
297
- value: null;
298
- nullable: true;
299
- }>;
300
- externalUrl: Readonly<{
301
- type: StringConstructor;
302
- value: null;
303
- nullable: true;
304
- }>;
305
- fileName: Readonly<{
306
- type: StringConstructor;
307
- value: null;
308
- nullable: true;
309
- }>;
310
- fileSize: Readonly<{
311
- type: NumberConstructor;
312
- value: null;
313
- nullable: true;
314
- }>;
315
- lastModified: Readonly<{
316
- type: NumberConstructor;
317
- value: number;
318
- }>;
319
- uploadProgress: Readonly<{
320
- type: NumberConstructor;
321
- value: 0;
322
- }>;
323
- uuid: Readonly<{
324
- type: StringConstructor;
325
- value: null;
326
- nullable: true;
327
- }>;
328
- isImage: Readonly<{
329
- type: BooleanConstructor;
330
- value: false;
331
- }>;
332
- mimeType: Readonly<{
333
- type: StringConstructor;
334
- value: null;
335
- nullable: true;
336
- }>;
337
- ctxName: Readonly<{
338
- type: StringConstructor;
339
- value: null;
340
- nullable: true;
341
- }>;
342
- cdnUrl: Readonly<{
343
- type: StringConstructor;
344
- value: null;
345
- nullable: true;
346
- }>;
347
- cdnUrlModifiers: Readonly<{
348
- type: StringConstructor;
349
- value: null;
350
- nullable: true;
351
- }>;
352
- fileInfo: Readonly<{
353
- type: typeof UploadcareFile;
354
- value: null;
355
- nullable: true;
356
- }>;
357
- isUploading: Readonly<{
358
- type: BooleanConstructor;
359
- value: false;
360
- }>;
361
- abortController: Readonly<{
362
- type: {
363
- new (): AbortController;
364
- prototype: AbortController;
365
- };
366
- value: null;
367
- nullable: true;
368
- }>;
369
- thumbUrl: Readonly<{
370
- type: StringConstructor;
371
- value: null;
372
- nullable: true;
373
- }>;
374
- silent: Readonly<{
375
- type: BooleanConstructor;
376
- value: false;
377
- }>;
378
- source: Readonly<{
379
- type: StringConstructor;
380
- value: null;
381
- nullable: true;
382
- }>;
383
- fullPath: Readonly<{
384
- type: StringConstructor;
385
- value: null;
386
- nullable: true;
387
- }>;
388
- metadata: Readonly<{
389
- type: ObjectConstructor;
390
- value: null;
391
- nullable: true;
392
- }>;
393
- errors: Readonly<{
394
- type: ArrayConstructor;
395
- value: OutputErrorFile[];
396
- }>;
397
- uploadError: Readonly<{
398
- type: ErrorConstructor;
399
- value: null;
400
- nullable: true;
401
- }>;
402
- isRemoved: Readonly<{
403
- type: BooleanConstructor;
404
- value: false;
405
- }>;
406
- isQueuedForUploading: Readonly<{
407
- type: BooleanConstructor;
408
- value: false;
409
- }>;
410
- isValidationPending: Readonly<{
411
- type: BooleanConstructor;
412
- value: false;
413
- }>;
414
- isQueuedForValidation: Readonly<{
415
- type: BooleanConstructor;
416
- value: false;
417
- }>;
418
- }>;
419
- type UploadEntryData = ExtractDataFromSchema<typeof uploadEntrySchema>;
420
- type UploadEntryTypedData = TypedData<typeof uploadEntrySchema>;
421
- type UploadEntryKeys = ExtractKeysFromSchema<typeof uploadEntrySchema>;
541
+ declare class LineLoaderUi extends LitBlock {
542
+ active: boolean;
543
+ private readonly _lineRef;
544
+ private _isAnimating;
545
+ private readonly _handleTransitionEndRight;
546
+ protected firstUpdated(changedProperties: PropertyValues<this>): void;
547
+ protected updated(changedProperties: PropertyValues<this>): void;
548
+ private _start;
549
+ private _stop;
550
+ private _resetLine;
551
+ render(): lit_html.TemplateResult<1>;
552
+ }
553
+ declare global {
554
+ interface HTMLElementTagNameMap {
555
+ 'uc-line-loader-ui': LineLoaderUi;
556
+ }
557
+ }
422
558
 
423
- type FuncFileValidator = (outputEntry: OutputFileEntry, api: UploaderPublicApi, options?: {
424
- signal?: AbortSignal;
425
- }) => undefined | OutputErrorFile | Promise<undefined | OutputErrorFile>;
426
- type FileValidatorDescriptor = {
427
- runOn: 'add' | 'upload' | 'change';
428
- validator: FuncFileValidator;
429
- };
430
- type FileValidator = FileValidatorDescriptor | FuncFileValidator;
431
- type FuncCollectionValidator = (collection: ReturnType<typeof buildOutputCollectionState<OutputCollectionStatus>>, api: UploaderPublicApi) => undefined | OutputErrorCollection;
432
- declare class ValidationManager {
433
- private _blockInstance;
434
- private _uploadCollection;
435
- private _commonFileValidators;
436
- private _commonCollectionValidators;
437
- private _queue;
438
- private _runQueueDebounced;
439
- private _entryValidationState;
440
- constructor(blockInstance: UploaderBlock);
441
- runFileValidators(runOn: FileValidatorDescriptor['runOn'], entryIds?: string[]): void;
442
- runCollectionValidators(): void;
443
- cleanupValidationForEntry(entry: TypedData<typeof uploadEntrySchema>): void;
444
- private _runFileValidatorsForEntry;
445
- private _addCustomTypeToValidationError;
446
- private _getEntryValidationState;
447
- private _getValidatorDescriptors;
448
- private _getValidatorDescriptorsForEntry;
559
+ declare class Icon extends LitBlock {
560
+ name: string;
561
+ private _resolvedHref;
562
+ private _iconHrefResolver;
563
+ initCallback(): void;
564
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
565
+ private _updateResolvedHref;
566
+ render(): lit_html.TemplateResult<1>;
567
+ }
568
+ declare global {
569
+ interface HTMLElementTagNameMap {
570
+ 'uc-icon': Icon;
571
+ }
449
572
  }
450
573
 
451
- type CameraMode = 'photo' | 'video';
452
- type CameraStatus = 'shot' | 'retake' | 'accept' | 'play' | 'stop' | 'pause' | 'resume';
453
- declare class CameraSource extends UploaderBlock {
454
- couldBeCtxOwner: boolean;
455
- activityType: "camera";
456
- private _unsubPermissions;
457
- private _capturing;
458
- private _chunks;
459
- private _mediaRecorder;
460
- private _stream;
461
- private _selectedAudioId;
462
- private _selectedCameraId;
463
- private _activeTab;
464
- private _options;
465
- private _canvas;
466
- private _ctx;
467
- private _cameraDevices;
468
- private _audioDevices;
469
- private _permissionResponses;
470
- constructor();
471
- _chooseActionWithCamera: () => void;
472
- _updateTimer: () => void;
473
- _startTimer: () => void;
474
- _stopTimer: () => void;
475
- _startTimeline: () => void;
476
- _stopTimeline: () => void;
477
- _animationFrameId: number | null;
478
- _startRecording: () => void;
479
- private _stopRecording;
480
- /** This method is used to toggle recording pause/resume */
481
- _toggleRecording: () => void;
482
- _toggleEnableAudio: () => void;
574
+ type AriaRole = 'alert' | 'alertdialog' | 'button' | 'checkbox' | 'dialog' | 'gridcell' | 'link' | 'log' | 'marquee' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'option' | 'progressbar' | 'radio' | 'scrollbar' | 'searchbox' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'tabpanel' | 'textbox' | 'timer' | 'tooltip' | 'treeitem' | 'combobox' | 'grid' | 'listbox' | 'menu' | 'menubar' | 'radiogroup' | 'tablist' | 'tree' | 'treegrid' | 'application' | 'article' | 'cell' | 'columnheader' | 'definition' | 'directory' | 'document' | 'feed' | 'figure' | 'group' | 'heading' | 'img' | 'list' | 'listitem' | 'math' | 'none' | 'note' | 'presentation' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'separator' | 'table' | 'term' | 'text' | 'toolbar' | 'banner' | 'complementary' | 'contentinfo' | 'form' | 'main' | 'navigation' | 'region' | 'search' | 'doc-abstract' | 'doc-acknowledgments' | 'doc-afterword' | 'doc-appendix' | 'doc-backlink' | 'doc-biblioentry' | 'doc-bibliography' | 'doc-biblioref' | 'doc-chapter' | 'doc-colophon' | 'doc-conclusion' | 'doc-cover' | 'doc-credit' | 'doc-credits' | 'doc-dedication' | 'doc-endnote' | 'doc-endnotes' | 'doc-epigraph' | 'doc-epilogue' | 'doc-errata' | 'doc-example' | 'doc-footnote' | 'doc-foreword' | 'doc-glossary' | 'doc-glossref' | 'doc-index' | 'doc-introduction' | 'doc-noteref' | 'doc-notice' | 'doc-pagebreak' | 'doc-pagelist' | 'doc-part' | 'doc-preface' | 'doc-prologue' | 'doc-pullquote' | 'doc-qna' | 'doc-subtitle' | 'doc-tip' | 'doc-toc';
575
+
576
+ type Theme = string | null;
577
+ declare class BtnUi extends LitBlock {
578
+ text: string;
579
+ icon: string;
580
+ reverse: boolean;
581
+ theme: Theme;
582
+ ariaRole: AriaRole | undefined;
583
+ ariaControls: string;
584
+ titleProp: string;
483
585
  /**
484
- * Previewing the video that was recorded on the camera
586
+ * CSS-only attribute
485
587
  */
486
- private _previewVideo;
487
- _retake: () => void;
488
- _accept: () => void;
489
- _handlePhoto: (status: CameraStatus) => void;
490
- _handleVideo: (status: CameraStatus) => void;
491
- private _setCameraState;
492
- private _shot;
493
- private _handleActiveTab;
494
- private _createFile;
495
- _guessExtensionByMime(mime: string | undefined): string;
588
+ active: boolean;
589
+ protected firstUpdated(changed: PropertyValues<this>): void;
590
+ protected updated(changed: PropertyValues<this>): void;
591
+ private _applyReverse;
592
+ private _applyThemeClass;
593
+ private get _iconClassMap();
594
+ private get _computedIconHidden();
595
+ private get _computedIconSingle();
596
+ render(): lit_html.TemplateResult<1>;
597
+ }
598
+ declare global {
599
+ interface HTMLElementTagNameMap {
600
+ 'uc-btn-ui': BtnUi;
601
+ }
602
+ }
603
+
604
+ declare class CropFrame extends LitBlock {
605
+ private _backdropMask?;
606
+ private _backdropMaskInner?;
607
+ private readonly _backdropMaskId;
608
+ private _frameThumbs?;
609
+ private _frameGuides?;
610
+ private _draggingThumb?;
611
+ private _hoverThumb?;
612
+ private _dragStartPoint?;
613
+ private _dragStartCrop?;
614
+ private _frameImage?;
615
+ private _guidesHidden;
616
+ private _draggingValue;
617
+ private readonly _svgRef;
618
+ private _svgReady;
619
+ private _pendingMaskHref;
620
+ private get _svgElement();
621
+ private get _dragging();
622
+ private set _dragging(value);
623
+ private _applyGuidesDragState;
624
+ private _shouldThumbBeDisabled;
625
+ private _createBackdrop;
496
626
  /**
497
- * The send file to the server
627
+ * @private Super Tricky workaround for the chromium bug See
628
+ * https://bugs.chromium.org/p/chromium/issues/detail?id=330815
498
629
  */
499
- _toSend: (file: File) => void;
500
- private get _cameraModes();
501
- private _setPermissionsState;
502
- _makeStreamInactive: () => boolean;
503
- _stopCapture: () => void;
504
- _capture: () => Promise<void>;
505
- _handlePermissionsChange: () => void;
506
- _permissionAccess: () => Promise<void>;
507
- _getPermission: () => void;
508
- _requestDeviceAccess: () => Promise<void>;
509
- _getDevices: () => Promise<void>;
510
- _onActivate: () => Promise<void>;
511
- _onDeactivate: () => Promise<void>;
512
- _handleCameraModes: (cameraModes: CameraMode[]) => void;
630
+ private _resizeBackdrop;
631
+ private _updateBackdrop;
632
+ private _updateFrame;
633
+ private _createThumb;
634
+ private _createThumbs;
635
+ private _createGuides;
636
+ private _createFrame;
637
+ private _handlePointerDown;
638
+ private readonly _handlePointerUp;
639
+ private readonly _handlePointerMove;
640
+ private _calcCropBox;
641
+ private readonly _handleSvgPointerMove;
642
+ private _updateCursor;
643
+ private _createMask;
644
+ private _updateMask;
645
+ private _render;
646
+ toggleThumbs(visible: boolean): void;
513
647
  initCallback(): void;
514
- _destroy(): void;
515
- destroyCallback(): Promise<void>;
648
+ protected firstUpdated(changedProperties: PropertyValues<this>): void;
649
+ private _initializeSvg;
650
+ disconnectedCallback(): void;
651
+ render(): TemplateResult;
652
+ }
653
+ declare global {
654
+ interface HTMLElementTagNameMap {
655
+ 'uc-crop-frame': CropFrame;
656
+ }
516
657
  }
517
658
 
518
- /**
519
- * Config keys that can't be passed as attribute (because they are object or function)
520
- */
521
- declare const complexConfigKeys: readonly ["metadata", "localeDefinitionOverride", "secureUploadsSignatureResolver", "secureDeliveryProxyUrlResolver", "iconHrefResolver", "fileValidators", "collectionValidators", "mediaRecorderOptions"];
522
- /** Mapping of attribute names to state */
523
- declare const attrStateMapping: Record<string, string>;
524
- declare class Config extends Block {
525
- requireCtxName: boolean;
526
- constructor();
527
- private _flushValueToAttribute;
528
- private _flushValueToState;
529
- private _setValue;
530
- private _getValue;
531
- _assertSameValueDifferentReference(key: string, previousValue: unknown, nextValue: unknown): void;
659
+ type Operations = {
660
+ flip: boolean;
661
+ mirror: boolean;
662
+ rotate: number;
663
+ };
664
+ declare class EditorImageCropper extends LitBlock {
665
+ ctxOwner: boolean;
666
+ private _commitDebounced;
667
+ private _handleResizeThrottled;
668
+ private _imageSize;
669
+ private _canvas?;
670
+ private _ctx;
671
+ private _isActive;
672
+ private _observer?;
673
+ private _image;
674
+ private _cancelPreload?;
675
+ private readonly _canvasRef;
676
+ private readonly _frameRef;
677
+ constructor();
678
+ protected firstUpdated(changedProperties: PropertyValues<this>): void;
679
+ private _syncTransformations;
680
+ private _initCanvas;
681
+ private _alignImage;
682
+ private _alignCrop;
683
+ private _drawImage;
684
+ private _draw;
685
+ private _animateIn;
686
+ private _getCropDimensions;
687
+ private _getCropTransformation;
688
+ private _commit;
689
+ setValue<K extends keyof Operations>(operation: K, value: Operations[K]): void;
690
+ getValue<K extends keyof Operations>(operation: K): Operations[K];
691
+ activate(imageSize: ImageSize, { fromViewer }?: {
692
+ fromViewer?: boolean;
693
+ }): Promise<void>;
694
+ deactivate({ reset }?: {
695
+ reset?: boolean;
696
+ }): void;
697
+ private _transitionToCrop;
698
+ private _transitionToImage;
699
+ private _reset;
700
+ private _waitForImage;
701
+ private _handleImageLoading;
532
702
  initCallback(): void;
533
- attributeChangedCallback(name: keyof typeof attrStateMapping, oldVal: string, newVal: string): void;
534
- get computationControllers(): any;
703
+ disconnectedCallback(): void;
704
+ render(): TemplateResult;
535
705
  }
536
- interface Config extends ConfigType {
706
+ declare global {
707
+ interface HTMLElementTagNameMap {
708
+ 'uc-editor-image-cropper': EditorImageCropper;
709
+ }
537
710
  }
538
711
 
539
- type FilesViewMode = 'grid' | 'list';
540
- declare class UploadList extends UploaderBlock {
541
- couldBeCtxOwner: boolean;
542
- historyTracked: boolean;
543
- activityType: "upload-list";
712
+ declare const TabId: Readonly<{
713
+ readonly CROP: "crop";
714
+ readonly TUNING: "tuning";
715
+ readonly FILTERS: "filters";
716
+ }>;
717
+ type TabIdValue$1 = (typeof TabId)[keyof typeof TabId];
718
+ declare const ALL_COLOR_OPERATIONS: readonly ["brightness", "exposure", "gamma", "contrast", "saturation", "vibrance", "warmth", "enhance"];
719
+ type ColorOperation = (typeof ALL_COLOR_OPERATIONS)[number];
720
+ declare const ALL_FILTERS: readonly ["adaris", "briaril", "calarel", "carris", "cynarel", "cyren", "elmet", "elonni", "enzana", "erydark", "fenralan", "ferand", "galen", "gavin", "gethriel", "iorill", "iothari", "iselva", "jadis", "lavra", "misiara", "namala", "nerion", "nethari", "pamaya", "sarnar", "sedis", "sewen", "sorahel", "sorlen", "tarian", "thellassan", "varriel", "varven", "vevera", "virkas", "yedis", "yllara", "zatvel", "zevcen"];
721
+ type FilterId = (typeof ALL_FILTERS)[number];
722
+ declare const ALL_CROP_OPERATIONS: readonly ["rotate", "mirror", "flip"];
723
+ type CropOperation = (typeof ALL_CROP_OPERATIONS)[number];
724
+ /** KeypointsNumber is the number of keypoints loaded from each side of zero, not total number */
725
+ declare const COLOR_OPERATIONS_CONFIG: Readonly<{
726
+ brightness: {
727
+ zero: number;
728
+ range: readonly [-100, 100];
729
+ keypointsNumber: number;
730
+ };
731
+ exposure: {
732
+ zero: number;
733
+ range: readonly [-500, 500];
734
+ keypointsNumber: number;
735
+ };
736
+ gamma: {
737
+ zero: number;
738
+ range: readonly [0, 1000];
739
+ keypointsNumber: number;
740
+ };
741
+ contrast: {
742
+ zero: number;
743
+ range: readonly [-100, 500];
744
+ keypointsNumber: number;
745
+ };
746
+ saturation: {
747
+ zero: number;
748
+ range: readonly [-100, 500];
749
+ keypointsNumber: number;
750
+ };
751
+ vibrance: {
752
+ zero: number;
753
+ range: readonly [-100, 500];
754
+ keypointsNumber: number;
755
+ };
756
+ warmth: {
757
+ zero: number;
758
+ range: readonly [-100, 100];
759
+ keypointsNumber: number;
760
+ };
761
+ enhance: {
762
+ zero: number;
763
+ range: readonly [0, 100];
764
+ keypointsNumber: number;
765
+ };
766
+ filter: {
767
+ zero: number;
768
+ range: readonly [0, 100];
769
+ keypointsNumber: number;
770
+ };
771
+ }>;
772
+
773
+ type OperationKey = keyof typeof COLOR_OPERATIONS_CONFIG;
774
+ declare class EditorImageFader extends LitBlock {
775
+ private _isActive;
776
+ private _hidden;
777
+ private _operation;
778
+ private _filter;
779
+ private _value?;
780
+ private _transformations;
781
+ private _keypoints;
782
+ private _previewImage?;
783
+ private _cancelLastImages?;
784
+ private _cancelBatchPreload?;
785
+ private _url?;
786
+ private _fromViewer?;
787
+ private _raf;
788
+ private _addKeypointDebounced;
789
+ private readonly _previewHostRef;
790
+ private readonly _layersHostRef;
544
791
  constructor();
545
- private _throttledHandleCollectionUpdate;
546
- private _updateUploadsState;
547
- private _getHeaderText;
548
- get couldOpenActivity(): boolean;
792
+ private _handleImageLoading;
793
+ private _flush;
794
+ private _imageSrc;
795
+ private _constructKeypoint;
796
+ /**
797
+ * Check if current operation and filter equals passed ones
798
+ */
799
+ private _isSame;
800
+ set(value: string | number): void;
801
+ private _update;
802
+ private _createPreviewImage;
803
+ private _initNodes;
804
+ setTransformations(transformations: Transformations): Promise<void>;
805
+ preload({ url, filter, operation, value, }: {
806
+ url: string;
807
+ filter?: string;
808
+ operation?: OperationKey;
809
+ value?: number;
810
+ }): Promise<void>;
811
+ private _setOriginalSrc;
812
+ activate({ url, operation, value, filter, fromViewer, }: {
813
+ url: string;
814
+ operation?: OperationKey;
815
+ value?: number;
816
+ filter?: string;
817
+ fromViewer?: boolean;
818
+ }): Promise<void>;
819
+ deactivate({ hide }?: {
820
+ hide?: boolean;
821
+ }): void;
822
+ private _ensurePreviewAttached;
823
+ private _clearLayersHost;
824
+ render(): TemplateResult;
825
+ }
826
+ declare global {
827
+ interface HTMLElementTagNameMap {
828
+ 'uc-editor-image-fader': EditorImageFader;
829
+ }
830
+ }
831
+
832
+ declare class EditorButtonControl extends LitBlock {
833
+ active: boolean;
834
+ title: string;
835
+ protected icon: string;
836
+ protected titleProp: string;
837
+ protected get buttonClasses(): Record<string, boolean>;
838
+ private _updateHostStateClasses;
839
+ protected onClick(_event: MouseEvent): void;
840
+ connectedCallback(): void;
841
+ protected updated(changedProperties: PropertyValues<this>): void;
842
+ render(): lit_html.TemplateResult<1>;
843
+ }
844
+
845
+ declare class EditorFreeformButtonControl extends EditorButtonControl {
846
+ initCallback(): void;
847
+ onClick(): void;
848
+ private _computeTitle;
849
+ render(): lit_html.TemplateResult<1>;
850
+ }
851
+ declare class EditorAspectRatioButtonControl extends EditorButtonControl {
852
+ private _aspectRatio;
853
+ get aspectRatio(): CropAspectRatio | null;
854
+ set aspectRatio(value: CropAspectRatio | null);
549
855
  initCallback(): void;
550
- destroyCallback(): void;
856
+ protected onClick(): void;
857
+ private _updateAspectRatioPresentation;
858
+ private _renderIcon;
859
+ render(): lit_html.TemplateResult<1>;
860
+ }
861
+ declare global {
862
+ interface HTMLElementTagNameMap {
863
+ 'uc-editor-freeform-button-control': EditorFreeformButtonControl;
864
+ 'uc-editor-aspect-ratio-button-control': EditorAspectRatioButtonControl;
865
+ }
551
866
  }
552
867
 
553
- declare const ExternalUploadSource: Readonly<{
554
- readonly FACEBOOK: "facebook";
555
- readonly DROPBOX: "dropbox";
556
- readonly GDRIVE: "gdrive";
557
- readonly GPHOTOS: "gphotos";
558
- readonly FLICKR: "flickr";
559
- readonly VK: "vk";
560
- readonly EVERNOTE: "evernote";
561
- readonly BOX: "box";
562
- readonly ONEDRIVE: "onedrive";
563
- readonly HUDDLE: "huddle";
564
- }>;
565
- declare const UploadSource: Readonly<{
566
- readonly FACEBOOK: "facebook";
567
- readonly DROPBOX: "dropbox";
568
- readonly GDRIVE: "gdrive";
569
- readonly GPHOTOS: "gphotos";
570
- readonly FLICKR: "flickr";
571
- readonly VK: "vk";
572
- readonly EVERNOTE: "evernote";
573
- readonly BOX: "box";
574
- readonly ONEDRIVE: "onedrive";
575
- readonly HUDDLE: "huddle";
576
- readonly MOBILE_VIDEO_CAMERA: "mobile-video-camera";
577
- readonly MOBILE_PHOTO_CAMERA: "mobile-photo-camera";
578
- readonly LOCAL: "local";
579
- readonly DROP_AREA: "drop-area";
580
- readonly CAMERA: "camera";
581
- readonly EXTERNAL: "external";
582
- readonly API: "js-api";
583
- readonly URL: "url";
584
- readonly DRAW: "draw";
585
- }>;
586
- type SourceTypes = (typeof UploadSource)[keyof typeof UploadSource];
868
+ declare class EditorCropButtonControl extends EditorButtonControl {
869
+ operation: CropOperation | undefined;
870
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
871
+ protected onClick(e: MouseEvent): void;
872
+ }
873
+ declare global {
874
+ interface HTMLElementTagNameMap {
875
+ 'uc-editor-crop-button-control': EditorCropButtonControl;
876
+ }
877
+ }
587
878
 
588
- declare const CameraSourceTypes: Readonly<{
589
- PHOTO: "photo";
590
- VIDEO: "video";
591
- }>;
592
- type ModeCameraType = (typeof CameraSourceTypes)[keyof typeof CameraSourceTypes];
879
+ declare class EditorFilterControl extends EditorButtonControl {
880
+ private _operation;
881
+ private _filter;
882
+ private _originalUrl;
883
+ private _observer?;
884
+ private _cancelPreload?;
885
+ private _lastPreviewRequestId;
886
+ private _previewVisibilityCheckRaf?;
887
+ private _previewVisibilityCheckTimeout?;
888
+ private _previewImage;
889
+ private _previewLoaded;
890
+ isOriginal: boolean;
891
+ private _iconSize;
892
+ get filter(): string;
893
+ set filter(value: string);
894
+ onClick(e: MouseEvent): void;
895
+ private _previewSrc;
896
+ private _observerCallback;
897
+ initCallback(): void;
898
+ disconnectedCallback(): void;
899
+ protected updated(changedProperties: PropertyValues<this>): void;
900
+ private _updateFilterLabels;
901
+ private _loadPreview;
902
+ private _schedulePreviewVisibilityCheck;
903
+ private _clearPreviewVisibilityChecks;
904
+ private get _shouldShowPreview();
905
+ render(): lit_html.TemplateResult<1>;
906
+ }
907
+ declare global {
908
+ interface HTMLElementTagNameMap {
909
+ 'uc-editor-filter-control': EditorFilterControl;
910
+ }
911
+ }
593
912
 
594
- type ApiAddFileCommonOptions = {
595
- silent?: boolean;
596
- fileName?: string;
597
- source?: string;
598
- };
599
- declare class UploaderPublicApi {
600
- private _ctx;
601
- constructor(ctx: UploaderBlock);
602
- private get _uploadCollection();
603
- get cfg(): ConfigType;
604
- get l10n(): (str: string, variables?: Record<string, string | number>) => string;
913
+ declare class EditorOperationControl extends EditorButtonControl {
914
+ private _operation;
915
+ get operation(): ColorOperation | '';
916
+ set operation(value: ColorOperation | '');
917
+ private _updateOperationMetadata;
918
+ initCallback(): void;
919
+ protected onClick(e: MouseEvent): void;
920
+ }
921
+ declare global {
922
+ interface HTMLElementTagNameMap {
923
+ 'uc-editor-operation-control': EditorOperationControl;
924
+ }
925
+ }
926
+
927
+ declare class EditorScroller extends LitBlock {
605
928
  /**
606
- * TODO: Probably we should not allow user to override `source` property
929
+ * CSS-only attribute
607
930
  */
608
- addFileFromUrl: (url: string, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"idle">;
609
- addFileFromUuid: (uuid: string, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"idle">;
610
- addFileFromCdnUrl: (cdnUrl: string, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"idle">;
611
- addFileFromObject: (file: File, { silent, fileName, source, fullPath, }?: ApiAddFileCommonOptions & {
612
- fullPath?: string;
613
- }) => OutputFileEntry<"idle">;
614
- removeFileByInternalId: (internalId: string) => void;
615
- removeAllFiles(): void;
616
- uploadAll: () => void;
617
- openSystemDialog: (options?: {
618
- captureCamera?: boolean;
619
- modeCamera?: ModeCameraType;
620
- }) => void;
621
- getOutputItem<TStatus extends OutputFileStatus>(entryId: string): OutputFileEntry<TStatus>;
622
- getOutputCollectionState<TStatus extends OutputCollectionStatus>(): ReturnType<typeof buildOutputCollectionState<TStatus>>;
623
- initFlow: (force?: boolean) => void;
624
- doneFlow: () => void;
625
- setCurrentActivity: <T extends ActivityType>(activityType: T, ...[params]: T extends keyof ActivityParamsMap ? [ActivityParamsMap[T]] : T extends RegisteredActivityType ? [undefined?] : [unknown?]) => void;
626
- getCurrentActivity: () => ActivityType;
627
- setModalState: (opened: boolean) => void;
628
- private get _sourceList();
931
+ hiddenScrollbar: boolean;
932
+ private readonly _handleWheel;
933
+ connectedCallback(): void;
934
+ disconnectedCallback(): void;
935
+ }
936
+ declare global {
937
+ interface HTMLElementTagNameMap {
938
+ 'uc-editor-scroller': EditorScroller;
939
+ }
629
940
  }
630
941
 
631
- type MetadataCallback = (fileEntry: OutputFileEntry) => Promise<Metadata> | Metadata;
632
- type LocaleDefinitionOverride = Record<string, LocaleDefinition>;
633
- type SecureDeliveryProxyUrlResolver = (previewUrl: string, urlParts: {
634
- uuid: string;
635
- cdnUrlModifiers: string;
636
- fileName: string;
637
- }) => Promise<string> | string;
638
- type SecureUploadsSignatureAndExpire = {
639
- secureSignature: string;
640
- secureExpire: string;
641
- };
642
- type SecureUploadsSignatureResolver = () => Promise<SecureUploadsSignatureAndExpire | null>;
643
- type IconHrefResolver = (iconName: string) => string;
644
- type FileValidators = FileValidator[];
645
- type CollectionValidators = FuncCollectionValidator[];
646
- type ConfigType = {
647
- /**
648
- * Your project’s Public Key.
649
- */
650
- pubkey: string;
651
- /**
652
- * Allow multiple file uploads.
653
- */
654
- multiple: boolean;
655
- /**
656
- * Minimum number of files to upload.
657
- */
658
- multipleMin: number;
659
- /**
660
- * Maximum number of files to upload.
661
- */
662
- multipleMax: number;
663
- /**
664
- * Require user confirmation before uploading.
665
- */
666
- confirmUpload: boolean;
667
- /**
668
- * Allow only image files.
669
- */
670
- imgOnly: boolean;
671
- /**
672
- * Native file input accept attribute value. Also affects client validation settings.
673
- */
674
- accept: string;
675
- /**
676
- * Preferred types for external sources.
677
- * See [here](https://uploadcare.com/docs/file-uploader/options/#external-sources-preferred-types)
678
- */
679
- externalSourcesPreferredTypes: string;
680
- /**
681
- * Provide custom CSS to the social sources iframe
682
- */
683
- externalSourcesEmbedCss: string;
684
- /**
685
- * Store uploaded files.
686
- */
687
- store: boolean | 'auto';
688
- /**
689
- * Mirror the camera view.
690
- */
691
- cameraMirror: boolean;
692
- /**
693
- * Default camera capture mode.
694
- */
695
- cameraCapture: 'user' | 'environment' | '';
696
- /**
697
- * List of sources for file uploads.
698
- */
699
- sourceList: string;
700
- /**
701
- * Top-level origin for the uploader.
702
- * This is used for Google Drive Picker if there is no access to the origin due to the cross-origin policy.
703
- */
704
- topLevelOrigin: string;
705
- /**
706
- * Maximum size of local files in bytes.
707
- */
708
- maxLocalFileSizeBytes: number;
709
- /**
710
- * Thumbnail size.
711
- */
712
- thumbSize: number;
713
- /**
714
- * Show the upload list even if it is empty.
715
- */
716
- showEmptyList: boolean;
717
- /**
718
- * Use local image editor.
719
- */
720
- useLocalImageEditor: boolean;
721
- /**
722
- * Enable cloud image editing.
723
- */
724
- useCloudImageEditor: boolean;
725
- /**
726
- * Tabs to show in the cloud image editor.
727
- *
728
- * @default 'crop, tuning, filters'
729
- */
730
- cloudImageEditorTabs: string;
731
- /**
732
- * Remove copyright information.
733
- */
734
- removeCopyright: boolean;
735
- /**
736
- * Defines the crop behavior. When uploading images, your users can select a crop area with a defined aspect ratio.
737
- */
942
+ declare class SliderUi extends LitBlock {
943
+ private _observer?;
944
+ private _thumbSize;
945
+ private _zeroDotEl?;
946
+ private _stepsCount?;
947
+ private readonly _inputRef;
948
+ private readonly _thumbRef;
949
+ private readonly _stepsRef;
950
+ disabled: boolean;
951
+ min: number;
952
+ max: number;
953
+ defaultValue: number;
954
+ zero: number;
955
+ private _currentValue;
956
+ constructor();
957
+ private _emitSliderEvent;
958
+ private readonly _handleSliderInput;
959
+ private readonly _handleSliderChange;
960
+ private readonly _handleInputFocus;
961
+ private readonly _handleInputBlur;
962
+ protected firstUpdated(changedProperties: PropertyValues<this>): void;
963
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
964
+ private _updateValue;
965
+ private _updateZeroDot;
966
+ private _updateSteps;
967
+ disconnectedCallback(): void;
968
+ private _setCurrentValue;
969
+ private _syncInputValue;
970
+ private _extractEventValue;
971
+ render(): lit_html.TemplateResult<1>;
972
+ }
973
+ declare global {
974
+ interface HTMLElementTagNameMap {
975
+ 'uc-slider-ui': SliderUi;
976
+ }
977
+ }
978
+
979
+ type SliderOperation = ColorOperation | 'filter';
980
+ type SliderFilter = FilterId | typeof FAKE_ORIGINAL_FILTER;
981
+ declare const FAKE_ORIGINAL_FILTER = "original";
982
+ declare class EditorSlider extends LitBlock {
983
+ state: {
984
+ operation: SliderOperation;
985
+ filter: SliderFilter | undefined;
986
+ originalUrl: string;
987
+ disabled: boolean;
988
+ min: number;
989
+ max: number;
990
+ value: number;
991
+ defaultValue: number;
992
+ zero: number;
993
+ };
994
+ private _handleInput;
995
+ setOperation(operation: SliderOperation, filter?: SliderFilter): void;
996
+ private _initializeValues;
997
+ apply(): void;
998
+ cancel(): void;
999
+ initCallback(): void;
1000
+ protected updated(changedProperties: PropertyValues<this>): void;
1001
+ render(): lit_html.TemplateResult<1>;
1002
+ }
1003
+ declare global {
1004
+ interface HTMLElementTagNameMap {
1005
+ 'uc-editor-slider': EditorSlider;
1006
+ }
1007
+ }
1008
+
1009
+ type TabIdValue = (typeof TabId)[keyof typeof TabId];
1010
+ declare class EditorToolbar extends LitBlock {
1011
+ private _showLoader;
1012
+ showMainToolbar: boolean;
1013
+ showSubToolbar: boolean;
1014
+ private _showTabToggles;
1015
+ tabList: readonly TabIdValue[];
1016
+ activeTab: TabIdValue;
1017
+ private _useSliderPanel;
1018
+ private _tooltipVisible;
1019
+ private _operationTooltip;
1020
+ private _tabIndicatorOffset;
1021
+ private _tabIndicatorWidth;
1022
+ private readonly _sliderRef;
1023
+ private readonly _tabIndicatorRef;
1024
+ protected readonly tabToggleRefs: Record<TabIdValue, Ref<HTMLElement>>;
1025
+ private readonly _handleWindowResize;
1026
+ private _cropPresets;
1027
+ private _cancelPreload?;
1028
+ private readonly _debouncedShowLoader;
1029
+ private readonly _updateInfoTooltip;
1030
+ private readonly _subTopToolbarStyles;
1031
+ private readonly _subBottomToolbarStyles;
1032
+ private readonly _tabToggleStyles;
1033
+ private readonly _tabTogglesStyles;
1034
+ init$: Record<string, unknown>;
1035
+ private _onSliderClose;
1036
+ private _activateTab;
1037
+ private _applyTabState;
1038
+ private _syncTabIndicator;
1039
+ private get _hasAspectRatioPicker();
1040
+ private _renderControlsByTab;
1041
+ private _renderCropTabControls;
1042
+ private _renderFilterTabControls;
1043
+ private _renderTuningTabControls;
1044
+ private _renderControlGroup;
1045
+ private _renderFreeformControl;
1046
+ private _renderAspectRatioControl;
1047
+ private _renderCropOperationControl;
1048
+ private _renderFilterControl;
1049
+ private _renderOperationControl;
1050
+ private _renderAspectRatioList;
1051
+ private _preloadEditedImage;
1052
+ initCallback(): void;
1053
+ connectedCallback(): void;
1054
+ firstUpdated(changedProperties: PropertyValues<this>): void;
1055
+ protected updated(changedProperties: PropertyValues<this>): void;
1056
+ disconnectedCallback(): void;
1057
+ private _assignSharedElements;
1058
+ private readonly _handleCancel;
1059
+ private readonly _handleApply;
1060
+ private readonly _handleApplySlider;
1061
+ private readonly _handleCancelSlider;
1062
+ private readonly _handleTabClick;
1063
+ private _renderTabToggle;
1064
+ private _renderTabContent;
1065
+ render(): TemplateResult<1>;
1066
+ }
1067
+ declare global {
1068
+ interface HTMLElementTagNameMap {
1069
+ 'uc-editor-toolbar': EditorToolbar;
1070
+ }
1071
+ }
1072
+
1073
+ declare class CloudImageEditorBlock extends LitBlock {
1074
+ attributesMeta: ({
1075
+ uuid: string;
1076
+ } | {
1077
+ 'cdn-url': string;
1078
+ }) & Partial<{
1079
+ tabs: string;
1080
+ 'crop-preset': string;
1081
+ }> & {
1082
+ 'ctx-name': string;
1083
+ };
1084
+ ctxOwner: boolean;
1085
+ static styleAttrs: string[];
1086
+ private _statusMessage;
1087
+ private _imageSrc;
1088
+ private _fileType;
1089
+ private _showLoader;
1090
+ uuid: string | null;
1091
+ cdnUrl: string | null;
738
1092
  cropPreset: string;
1093
+ tabs: string | null;
1094
+ private _hasNetworkProblems;
1095
+ private _isInitialized;
1096
+ private _pendingInitUpdate;
1097
+ private readonly _debouncedShowLoader;
1098
+ private readonly _imgRef;
1099
+ private readonly _cropperRef;
1100
+ private readonly _faderRef;
1101
+ private readonly _imgContainerRef;
1102
+ private readonly _handleImageLoad;
1103
+ private readonly _handleImageError;
1104
+ private readonly _handleRetryNetwork;
1105
+ private _scheduleInitialization;
1106
+ init$: ReturnType<typeof initState>;
1107
+ initCallback(): void;
1108
+ private _assignSharedElements;
1109
+ private _attachImageListeners;
1110
+ private _detachImageListeners;
1111
+ private get _imageClassName();
739
1112
  /**
740
- * Image shrink options.
741
- */
742
- imageShrink: string;
743
- /**
744
- * Lock scroll when modal is open.
745
- */
746
- modalScrollLock: boolean;
747
- /**
748
- * Show strokes on modal backdrop.
749
- */
750
- modalBackdropStrokes: boolean;
751
- /**
752
- * Wrap the source list.
753
- */
754
- sourceListWrap: boolean;
755
- /**
756
- * Key to revoke Custom OAuth access. See [OAuth docs](https://uploadcare.com/docs/upload-sources/#oauth) for details.
757
- */
758
- remoteTabSessionKey: string;
759
- /**
760
- * Set custom CNAME.
761
- */
762
- cdnCname: string;
763
- /**
764
- * Set CNAME base domain for prefixed CDN URLs.
765
- */
766
- cdnCnamePrefixed: string;
767
- /**
768
- * Set a custom upload URL.
769
- */
770
- baseUrl: string;
771
- /**
772
- * Set a custom social sources URL.
773
- */
774
- socialBaseUrl: string;
775
- /**
776
- * Secure signature for uploads.
777
- */
778
- secureSignature: string;
779
- /**
780
- * Expiry time for secure uploads.
781
- */
782
- secureExpire: string;
783
- /**
784
- * Proxy URL for secure delivery.
785
- */
786
- secureDeliveryProxy: string;
787
- /**
788
- * Maximum number of retry attempts for throttled requests.
789
- */
790
- retryThrottledRequestMaxTimes: number;
791
- /**
792
- * Maximum number of retry attempts for network errors.
793
- */
794
- retryNetworkErrorMaxTimes: number;
795
- /**
796
- * Minimum file size for multipart uploads.
797
- */
798
- multipartMinFileSize: number;
799
- /**
800
- * Chunk size for multipart uploads.
801
- */
802
- multipartChunkSize: number;
803
- /**
804
- * Maximum number of concurrent requests.
805
- */
806
- maxConcurrentRequests: number;
807
- /**
808
- * Maximum number of concurrent multipart requests.
809
- */
810
- multipartMaxConcurrentRequests: number;
811
- /**
812
- * Maximum number of attempts for multipart uploads.
813
- */
814
- multipartMaxAttempts: number;
815
- /**
816
- * Check for URL duplicates.
817
- */
818
- checkForUrlDuplicates: boolean;
819
- /**
820
- * Save URL for recurrent uploads.
1113
+ * To proper work, we need non-zero size the element. So, we'll wait for it.
821
1114
  */
822
- saveUrlForRecurrentUploads: boolean;
823
- /**
824
- * Group output files.
825
- */
826
- groupOutput: boolean;
827
- /**
828
- * User agent integration string.
829
- */
830
- userAgentIntegration: string;
831
- /**
832
- * Enable debug mode.
833
- */
834
- debug: boolean;
835
- /**
836
- * Locale name for the uploader.
837
- */
838
- localeName: string;
839
- /**
840
- * Expiry threshold for secure uploads.
841
- */
842
- secureUploadsExpireThreshold: number;
843
- /**
844
- * Metadata for the file.
845
- */
846
- metadata: Metadata | MetadataCallback | null;
847
- /**
848
- * Override locale definitions.
849
- */
850
- localeDefinitionOverride: LocaleDefinitionOverride | null;
851
- /**
852
- * Resolver for secure uploads signature.
853
- */
854
- secureUploadsSignatureResolver: SecureUploadsSignatureResolver | null;
855
- /**
856
- * Resolver for secure delivery proxy URL.
857
- */
858
- secureDeliveryProxyUrlResolver: SecureDeliveryProxyUrlResolver | null;
859
- /**
860
- * Resolver for icon href.
861
- */
862
- iconHrefResolver: IconHrefResolver | null;
863
- /**
864
- * Validators for individual files.
865
- */
866
- fileValidators: FileValidators;
867
- /**
868
- * Validators for file collections.
869
- */
870
- collectionValidators: CollectionValidators;
871
- /**
872
- * Timeout for async validation functions, in milliseconds.
873
- */
874
- validationTimeout: number;
875
- /**
876
- * The number of files to validate concurrently.
877
- */
878
- validationConcurrency: number;
879
- /**
880
- * The camera modes to enable in the camera modal,
881
- * it is possible to select photo or video capture.
882
- * The first mode is the default mode.
883
- * @default 'photo,video'
884
- */
885
- cameraModes: string;
886
- /**
887
- * The default tab to open in the camera modal,
888
- * it is possible to select video or photo capture
889
- * @default 'null'
890
- * @deprecated - use `cameraModes` instead
891
- */
892
- defaultCameraMode: CameraMode | null;
893
- /**
894
- * Enable audio recording.
895
- * @default true
896
- */
897
- enableAudioRecording: boolean;
898
- /**
899
- * Enable video recording.
900
- * @deprecated - use `cameraModes` instead
901
- * @default null
902
- */
903
- enableVideoRecording: boolean | null;
904
- /**
905
- * The maximum duration of the video recording in seconds
906
- * @default null
907
- */
908
- maxVideoRecordingDuration: number | null;
909
- /**
910
- * A dictionary object that can contain
911
- * the following properties from MediaRecorderOptions
912
- */
913
- mediaRecorderOptions: MediaRecorderOptions | null;
914
- filesViewMode: FilesViewMode;
915
- gridShowFileNames: boolean;
916
- cloudImageEditorAutoOpen: boolean;
917
- qualityInsights: boolean;
918
- cloudImageEditorMaskHref: string | null;
919
- /**
920
- * Adds data-testid attributes to the each block. Needed for testing purposes.
921
- * @default false
922
- */
923
- testMode: boolean;
924
- };
925
- type ConfigComplexType = Pick<ConfigType, (typeof complexConfigKeys)[number]>;
926
- type ConfigPlainType = Omit<ConfigType, keyof ConfigComplexType>;
927
- type ConfigAttributesType = KebabCaseKeys<ConfigPlainType> & LowerCaseKeys<ConfigPlainType>;
928
- type KebabCase$1<S extends string> = S extends `${infer C}${infer T}` ? T extends Uncapitalize<T> ? `${Uncapitalize<C>}${KebabCase$1<T>}` : `${Uncapitalize<C>}-${KebabCase$1<T>}` : S;
929
- type KebabCaseKeys<T extends Record<string, unknown>> = {
930
- [Key in keyof T as KebabCase$1<Key & string>]: T[Key];
1115
+ private _waitForSize;
1116
+ firstUpdated(changedProperties: PropertyValues<this>): void;
1117
+ disconnectedCallback(): void;
1118
+ render(): lit_html.TemplateResult<1>;
1119
+ protected updated(changedProperties: PropertyValues<this>): void;
1120
+ private _syncTabListFromProp;
1121
+ private _syncCropPresetState;
1122
+ updateImage(): Promise<void>;
1123
+ initEditor(): Promise<void>;
1124
+ }
1125
+ declare global {
1126
+ interface HTMLElementTagNameMap {
1127
+ 'uc-cloud-image-editor-block': CloudImageEditorBlock;
1128
+ }
1129
+ }
1130
+
1131
+ declare class CloudImageEditor extends CloudImageEditorBlock {
1132
+ static styleAttrs: string[];
1133
+ constructor();
1134
+ initCallback(): void;
1135
+ }
1136
+ declare global {
1137
+ interface HTMLElementTagNameMap {
1138
+ 'uc-cloud-image-editor': CloudImageEditor;
1139
+ }
1140
+ }
1141
+
1142
+ type ActivityParams$1 = {
1143
+ internalId: string;
931
1144
  };
932
- type LowerCase<S extends string> = Lowercase<S>;
933
- type LowerCaseKeys<T extends Record<string, unknown>> = {
934
- [Key in keyof T as Lowercase<Key & string>]: T[Key];
1145
+ declare class CloudImageEditorActivity extends LitUploaderBlock {
1146
+ couldBeCtxOwner: boolean;
1147
+ activityType: "cloud-image-edit";
1148
+ private _entry?;
1149
+ private _editorConfig;
1150
+ get activityParams(): ActivityParams$1;
1151
+ initCallback(): void;
1152
+ private _handleApply;
1153
+ private _handleCancel;
1154
+ handleChange(event: CustomEvent<ChangeResult>): void;
1155
+ private _mountEditor;
1156
+ private _unmountEditor;
1157
+ render(): lit_html.TemplateResult<1> | typeof nothing;
1158
+ private _createEditorConfig;
1159
+ }
1160
+ declare global {
1161
+ interface HTMLElementTagNameMap {
1162
+ 'uc-cloud-image-editor-activity': CloudImageEditorActivity;
1163
+ }
1164
+ }
1165
+
1166
+ declare class ActivityHeader extends LitActivityBlock {
1167
+ }
1168
+ declare global {
1169
+ interface HTMLElementTagNameMap {
1170
+ 'uc-activity-header': ActivityHeader;
1171
+ }
1172
+ }
1173
+
1174
+ declare class Spinner extends LitBlock {
1175
+ render(): lit_html.TemplateResult<1>;
1176
+ }
1177
+ declare global {
1178
+ interface HTMLElementTagNameMap {
1179
+ 'uc-spinner': Spinner;
1180
+ }
1181
+ }
1182
+
1183
+ type ActivityParams = {
1184
+ externalSourceType: string;
935
1185
  };
936
- type OutputFileStatus = 'idle' | 'uploading' | 'success' | 'failed' | 'removed';
937
- type OutputCustomErrorType = 'CUSTOM_ERROR';
938
- type OutputFileErrorType = OutputCustomErrorType | 'NOT_AN_IMAGE' | 'FORBIDDEN_FILE_TYPE' | 'FILE_SIZE_EXCEEDED' | 'UPLOAD_ERROR' | 'NETWORK_ERROR' | 'UNKNOWN_ERROR';
939
- type OutputCollectionErrorType = OutputCustomErrorType | 'SOME_FILES_HAS_ERRORS' | 'TOO_MANY_FILES' | 'TOO_FEW_FILES';
940
- type OutputFileErrorPayload = {
941
- entry: OutputFileEntry;
1186
+ declare class ExternalSource extends LitUploaderBlock {
1187
+ couldBeCtxOwner: boolean;
1188
+ activityType: "external";
1189
+ private _messageBridge?;
1190
+ private _iframeRef;
1191
+ private _latestSelectionSummary;
1192
+ private _selectedList;
1193
+ private _isSelectionReady;
1194
+ private _isDoneBtnEnabled;
1195
+ private _couldSelectAll;
1196
+ private _couldDeselectAll;
1197
+ private _showSelectionStatus;
1198
+ private _showDoneBtn;
1199
+ private _doneBtnTextClass;
1200
+ private _toolbarVisible;
1201
+ private get _counterText();
1202
+ get activityParams(): ActivityParams;
1203
+ initCallback(): void;
1204
+ private _extractUrlFromSelectedFile;
1205
+ private _handleToolbarStateChange;
1206
+ private _handleSelectedFilesChange;
1207
+ private _handleIframeLoad;
1208
+ private _applyTheme;
1209
+ private _applyEmbedCss;
1210
+ private _setupL10n;
1211
+ private _remoteUrl;
1212
+ private _handleDone;
1213
+ private _handleCancel;
1214
+ private _handleSelectAll;
1215
+ private _handleDeselectAll;
1216
+ private _setSelectionSummary;
1217
+ private _mountIframe;
1218
+ private _unmountIframe;
1219
+ private _resetSelectionStatus;
1220
+ disconnectedCallback(): void;
1221
+ render(): lit_html.TemplateResult<1>;
1222
+ }
1223
+ declare global {
1224
+ interface HTMLElementTagNameMap {
1225
+ 'uc-external-source': ExternalSource;
1226
+ }
1227
+ }
1228
+
1229
+ declare const ACTIVITY_TYPES: Readonly<{
1230
+ START_FROM: "start-from";
1231
+ CAMERA: "camera";
1232
+ DRAW: "draw";
1233
+ UPLOAD_LIST: "upload-list";
1234
+ URL: "url";
1235
+ CLOUD_IMG_EDIT: "cloud-image-edit";
1236
+ EXTERNAL: "external";
1237
+ }>;
1238
+ type RegisteredActivityType = (typeof ACTIVITY_TYPES)[keyof typeof ACTIVITY_TYPES];
1239
+ type ActivityType = RegisteredActivityType | (string & {}) | null;
1240
+
1241
+ declare const ACTIVE_PROP = "___ACTIVITY_IS_ACTIVE___";
1242
+ type ActivityParamsMap = {
1243
+ 'cloud-image-edit': ActivityParams$1;
1244
+ external: ActivityParams;
942
1245
  };
943
- type OutputErrorTypePayload = {
944
- NOT_AN_IMAGE: OutputFileErrorPayload;
945
- FORBIDDEN_FILE_TYPE: OutputFileErrorPayload;
946
- FILE_SIZE_EXCEEDED: OutputFileErrorPayload;
947
- SOME_FILES_HAS_ERRORS: {};
948
- TOO_MANY_FILES: {
949
- min: number;
950
- max: number;
951
- total: number;
952
- };
953
- TOO_FEW_FILES: {
954
- min: number;
955
- max: number;
956
- total: number;
957
- };
958
- UPLOAD_ERROR: OutputFileErrorPayload & {
959
- error: UploadError;
960
- };
961
- NETWORK_ERROR: OutputFileErrorPayload & {
962
- error: NetworkError;
963
- };
964
- UNKNOWN_ERROR: OutputFileErrorPayload & {
965
- error?: Error;
966
- };
967
- CUSTOM_ERROR: Record<string, unknown>;
968
- };
969
- type OutputError<T extends OutputFileErrorType | OutputCollectionErrorType> = T extends OutputCustomErrorType ? {
970
- type?: T;
971
- message: string;
972
- payload?: OutputErrorTypePayload[T];
973
- } : T extends keyof OutputErrorTypePayload ? {
974
- type: T;
975
- message: string;
976
- payload?: OutputErrorTypePayload[T];
977
- } : never;
978
- type OutputErrorFile = OutputError<OutputFileErrorType>;
979
- type OutputErrorCollection = OutputError<OutputCollectionErrorType>;
980
- type OutputFileEntry<TStatus extends OutputFileStatus = OutputFileStatus> = {
981
- status: TStatus;
982
- internalId: string;
983
- name: string;
984
- size: number;
985
- isImage: boolean;
986
- mimeType: string;
987
- metadata: Metadata | null;
988
- file: File | Blob | null;
989
- externalUrl: string | null;
990
- uploadProgress: number;
991
- fullPath: string | null;
992
- source: SourceTypes | null;
993
- isValidationPending: boolean;
994
- } & ({
995
- status: 'success';
996
- fileInfo: UploadcareFile;
997
- uuid: string;
998
- cdnUrl: string;
999
- cdnUrlModifiers: string;
1000
- isUploading: false;
1001
- isSuccess: true;
1002
- isFailed: false;
1003
- isRemoved: false;
1004
- errors: [];
1005
- } | {
1006
- status: 'failed';
1007
- fileInfo: UploadcareFile | null;
1008
- uuid: string | null;
1009
- cdnUrl: string | null;
1010
- cdnUrlModifiers: string | null;
1011
- isUploading: false;
1012
- isSuccess: false;
1013
- isFailed: true;
1014
- isRemoved: false;
1015
- errors: OutputError<OutputFileErrorType>[];
1016
- } | {
1017
- status: 'uploading';
1018
- fileInfo: null;
1019
- uuid: null;
1020
- cdnUrl: null;
1021
- cdnUrlModifiers: null;
1022
- isUploading: true;
1023
- isSuccess: false;
1024
- isFailed: false;
1025
- isRemoved: false;
1026
- errors: [];
1027
- } | {
1028
- status: 'removed';
1029
- fileInfo: UploadcareFile | null;
1030
- uuid: string | null;
1031
- cdnUrl: string | null;
1032
- cdnUrlModifiers: string | null;
1033
- isUploading: false;
1034
- isSuccess: false;
1035
- isFailed: false;
1036
- isRemoved: true;
1037
- errors: OutputError<OutputFileErrorType>[];
1038
- } | {
1039
- status: 'idle';
1040
- fileInfo: null;
1041
- uuid: null;
1042
- cdnUrl: null;
1043
- cdnUrlModifiers: null;
1044
- isUploading: false;
1045
- isSuccess: false;
1046
- isFailed: false;
1047
- isRemoved: false;
1048
- errors: [];
1049
- });
1050
- type OutputCollectionStatus = 'idle' | 'uploading' | 'success' | 'failed';
1051
- type GroupFlag = 'has-group' | 'maybe-has-group';
1052
- type OutputCollectionState<TStatus extends OutputCollectionStatus = OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'> = {
1053
- status: TStatus;
1054
- totalCount: number;
1055
- successCount: number;
1056
- failedCount: number;
1057
- uploadingCount: number;
1058
- progress: number;
1059
- successEntries: OutputFileEntry<'success'>[];
1060
- failedEntries: OutputFileEntry<'failed'>[];
1061
- uploadingEntries: OutputFileEntry<'uploading'>[];
1062
- idleEntries: OutputFileEntry<'idle'>[];
1063
- } & (TGroupFlag extends 'has-group' ? {
1064
- group: UploadcareGroup;
1065
- } : TGroupFlag extends 'maybe-has-group' ? {
1066
- group: UploadcareGroup | null;
1067
- } : never) & ({
1068
- status: 'idle';
1069
- isFailed: false;
1070
- isUploading: false;
1071
- isSuccess: false;
1072
- errors: [];
1073
- allEntries: OutputFileEntry<'idle' | 'success'>[];
1074
- } | {
1075
- status: 'uploading';
1076
- isFailed: false;
1077
- isUploading: true;
1078
- isSuccess: false;
1079
- errors: [];
1080
- allEntries: OutputFileEntry[];
1081
- } | {
1082
- status: 'success';
1083
- isFailed: false;
1084
- isUploading: false;
1085
- isSuccess: true;
1086
- errors: [];
1087
- allEntries: OutputFileEntry<'success'>[];
1088
- } | {
1089
- status: 'failed';
1090
- isFailed: true;
1091
- isUploading: false;
1092
- isSuccess: false;
1093
- errors: OutputError<OutputCollectionErrorType>[];
1094
- allEntries: OutputFileEntry[];
1095
- });
1096
-
1097
- declare class SecureUploadsManager {
1098
- private readonly _block;
1099
- private _secureToken;
1100
- constructor(block: UploaderBlock);
1101
- private _debugPrint;
1102
- getSecureToken(): Promise<SecureUploadsSignatureAndExpire | null>;
1103
- }
1104
-
1105
- type ChangeMap<T extends TypedSchema> = Record<keyof T, Set<string>>;
1106
- type TypedCollectionPropertyObserver<T extends TypedSchema> = (changeMap: ChangeMap<T>) => void;
1107
- type TypedCollectionObserverHandler<T extends TypedSchema> = (list: string[], added: Set<TypedData<T>>, removed: Set<TypedData<T>>) => void;
1108
- type TypedCollectionOptions<T extends TypedSchema> = {
1109
- typedSchema: T;
1110
- watchList?: ExtractKeysFromSchema<T>[];
1111
- handler?: TypedCollectionObserverHandler<T>;
1112
- ctxName?: string;
1113
- };
1114
- declare class TypedCollection<T extends TypedSchema> {
1115
- private __typedSchema;
1116
- private __ctxId;
1117
- private __data;
1118
- private __watchList;
1119
- private __subsMap;
1120
- private __propertyObservers;
1121
- private __collectionObservers;
1122
- private __items;
1123
- private __removed;
1124
- private __added;
1125
- private __observeTimeout?;
1126
- private __notifyTimeout?;
1127
- private __notifyObservers;
1128
- constructor(options: TypedCollectionOptions<T>);
1129
- notify(): void;
1130
- observeCollection(handler: TypedCollectionObserverHandler<T>): () => void;
1131
- unobserveCollection(handler: TypedCollectionObserverHandler<T>): void;
1132
- add(init: Partial<ExtractDataFromSchema<T>>): string;
1133
- read(id: string): TypedData<T> | null;
1134
- readProp<K extends ExtractKeysFromSchema<T>>(id: string, propName: K): ExtractDataFromSchema<T>[K] | null;
1135
- publishProp<K extends ExtractKeysFromSchema<T>>(id: string, propName: K, value: ExtractDataFromSchema<T>[K]): void;
1136
- remove(id: string): void;
1137
- clearAll(): void;
1138
- observeProperties(handler: TypedCollectionPropertyObserver<T>): () => void;
1139
- unobserveProperties(handler: TypedCollectionPropertyObserver<T>): void;
1140
- findItems(checkFn: (item: TypedData<T>) => boolean): string[];
1141
- items(): string[];
1142
- get size(): number;
1143
- destroy(): void;
1144
- }
1145
-
1146
- declare class UploaderBlock extends ActivityBlock {
1147
- static extSrcList: Readonly<typeof ExternalUploadSource>;
1148
- static sourceTypes: Readonly<typeof UploadSource>;
1149
- protected couldBeCtxOwner: boolean;
1150
- private isCtxOwner;
1151
- private _unobserveCollection?;
1152
- private _unobserveCollectionProperties?;
1153
- init$: {
1154
- '*commonProgress': number;
1155
- '*uploadList': never[];
1156
- '*uploadQueue': _uploadcare_upload_client.Queue;
1157
- '*collectionErrors': OutputErrorCollection[];
1158
- '*collectionState': OutputCollectionState | null;
1159
- '*groupInfo': _uploadcare_upload_client.UploadcareGroup | null;
1160
- '*uploadTrigger': Set<string>;
1161
- '*secureUploadsManager': SecureUploadsManager | null;
1162
- '*currentActivity': null;
1163
- '*currentActivityParams': {};
1164
- '*history': never[];
1165
- '*historyBack': null;
1166
- '*closeModal': () => void;
1167
- };
1168
- private get hasCtxOwner();
1169
- initCallback(): void;
1170
- protected get validationManager(): ValidationManager;
1171
- get api(): UploaderPublicApi;
1172
- getAPI(): UploaderPublicApi;
1173
- get uploadCollection(): TypedCollection<typeof uploadEntrySchema>;
1174
- destroyCtxCallback(): void;
1175
- disconnectedCallback(): void;
1176
- connectedCallback(): void;
1177
- destroyCallback(): void;
1178
- private _initCtxOwner;
1179
- private _observeUploadCollection;
1180
- private _unobserveUploadCollection;
1181
- private _createGroup;
1182
- private _flushOutputItems;
1183
- private _handleCollectionUpdate;
1184
- private _handleCollectionPropertiesUpdate;
1185
- private _flushCommonUploadProgress;
1186
- openCloudImageEditor(): void;
1187
- private setInitialCrop;
1188
- protected getMetadataFor(entryId: string): Promise<_uploadcare_upload_client.Metadata | undefined>;
1189
- protected getUploadClientOptions(): Promise<FileFromOptions>;
1190
- getOutputData(): OutputFileEntry[];
1191
- }
1192
-
1193
- /**
1194
- * Image size
1195
- */
1196
- interface ImageSize {
1197
- width: number;
1198
- height: number;
1199
- }
1200
- interface Transformations {
1201
- enhance?: number;
1202
- brightness?: number;
1203
- exposure?: number;
1204
- gamma?: number;
1205
- contrast?: number;
1206
- saturation?: number;
1207
- vibrance?: number;
1208
- warmth?: number;
1209
- rotate?: number;
1210
- mirror?: boolean;
1211
- flip?: boolean;
1212
- filter?: {
1213
- name: string;
1214
- amount: number;
1215
- };
1216
- crop?: {
1217
- dimensions: [number, number];
1218
- coords: [number, number];
1219
- };
1220
- }
1221
- interface ApplyResult {
1222
- originalUrl: string;
1223
- cdnUrlModifiers: string;
1224
- cdnUrl: string;
1225
- transformations: Transformations;
1226
- }
1227
- interface CropAspectRatio {
1228
- type: 'aspect-ratio';
1229
- width: number;
1230
- height: number;
1231
- id: string;
1232
- hasFreeform?: boolean;
1233
- }
1234
-
1235
- type ActivityParams$1 = {
1236
- internalId: string;
1237
- };
1238
- declare class CloudImageEditorActivity extends UploaderBlock {
1239
- couldBeCtxOwner: boolean;
1240
- activityType: "cloud-image-edit";
1241
- private _entry?;
1242
- private _instance?;
1243
- get activityParams(): ActivityParams$1;
1244
- initCallback(): void;
1245
- handleApply(e: CustomEvent<ApplyResult>): void;
1246
- handleCancel(): void;
1247
- mountEditor(): void;
1248
- unmountEditor(): void;
1249
- }
1250
-
1251
- type ActivityParams = {
1252
- externalSourceType: string;
1253
- };
1254
- declare class ExternalSource extends UploaderBlock {
1255
- couldBeCtxOwner: boolean;
1256
- activityType: "external";
1257
- private _messageBridge?;
1258
- constructor();
1259
- get activityParams(): ActivityParams;
1260
- initCallback(): void;
1261
- private extractUrlFromSelectedFile;
1262
- private handleToolbarStateChange;
1263
- private handleSelectedFilesChange;
1264
- private handleIframeLoad;
1265
- private applyTheme;
1266
- private applyEmbedCss;
1267
- private setupL10n;
1268
- private remoteUrl;
1269
- private mountIframe;
1270
- private unmountIframe;
1271
- private resetSelectionStatus;
1272
- }
1273
-
1274
- declare const ACTIVE_PROP = "___ACTIVITY_IS_ACTIVE___";
1275
- type ActivityParamsMap = {
1276
- 'cloud-image-edit': ActivityParams$1;
1277
- external: ActivityParams;
1278
- };
1279
- declare class ActivityBlock extends Block {
1280
- protected historyTracked: boolean;
1281
- private [ACTIVE_PROP]?;
1282
- init$: {
1283
- '*currentActivity': null;
1284
- '*currentActivityParams': {};
1285
- '*history': never[];
1286
- '*historyBack': null;
1287
- '*closeModal': () => void;
1288
- };
1289
- _debouncedHistoryFlush: (() => void) & {
1290
- cancel: () => void;
1246
+ declare class LitActivityBlock extends LitBlock {
1247
+ protected historyTracked: boolean;
1248
+ private [ACTIVE_PROP]?;
1249
+ init$: {
1250
+ '*currentActivity': null;
1251
+ '*currentActivityParams': {};
1252
+ '*history': never[];
1253
+ '*historyBack': null;
1254
+ '*closeModal': () => void;
1291
1255
  };
1256
+ private _debouncedHistoryFlush;
1292
1257
  private _deactivate;
1293
1258
  private _activate;
1294
1259
  initCallback(): void;
@@ -1304,679 +1269,1445 @@ declare class ActivityBlock extends Block {
1304
1269
  CLOUD_IMG_EDIT: 'cloud-image-edit';
1305
1270
  EXTERNAL: 'external';
1306
1271
  }>;
1307
- get isActivityActive(): boolean;
1272
+ protected get isActivityActive(): boolean;
1308
1273
  get couldOpenActivity(): boolean;
1309
1274
  /** TODO: remove name argument */
1310
- registerActivity(_name: string, options?: {
1275
+ protected registerActivity(_name: string, options?: {
1311
1276
  onActivate?: () => void;
1312
1277
  onDeactivate?: () => void;
1313
1278
  }): void;
1314
- unregisterActivity(): void;
1315
- destroyCallback(): void;
1316
- get activityKey(): string;
1279
+ private _unregisterActivity;
1280
+ disconnectedCallback(): void;
1317
1281
  get activityParams(): ActivityParamsMap[keyof ActivityParamsMap];
1318
- get initActivity(): string;
1319
- get doneActivity(): string;
1282
+ get initActivity(): string | null;
1283
+ get doneActivity(): string | null;
1320
1284
  historyBack(): void;
1321
1285
  }
1322
- type RegisteredActivityType = (typeof ActivityBlock)['activities'][keyof (typeof ActivityBlock)['activities']];
1323
- type ActivityType = RegisteredActivityType | (string & {}) | null;
1324
-
1325
- declare function defineComponents(blockExports: Record<string, any>): void;
1326
-
1327
- declare const UC_WINDOW_KEY = "UC";
1328
- type IndexModule = Record<string, any>;
1329
- declare global {
1330
- interface Window {
1331
- [UC_WINDOW_KEY]?: IndexModule;
1332
- }
1333
- }
1334
- /**
1335
- * @param url File Uploader pack url
1336
- * @param [register] Register connected package, if it not registered yet
1337
- */
1338
- declare function loadFileUploaderFrom(url: string, register?: boolean): Promise<IndexModule | null>;
1339
-
1340
- declare class SolutionBlock extends Block {
1341
- static styleAttrs: string[];
1342
- protected requireCtxName: boolean;
1343
- init$: {
1344
- '*solution': string | null;
1345
- '*commonProgress': number;
1346
- '*uploadList': never[];
1347
- '*uploadQueue': _uploadcare_upload_client.Queue;
1348
- '*collectionErrors': OutputErrorCollection[];
1349
- '*collectionState': OutputCollectionState | null;
1350
- '*groupInfo': _uploadcare_upload_client.UploadcareGroup | null;
1351
- '*uploadTrigger': Set<string>;
1352
- '*secureUploadsManager': SecureUploadsManager | null;
1353
- '*currentActivity': null;
1354
- '*currentActivityParams': {};
1355
- '*history': never[];
1356
- '*historyBack': null;
1357
- '*closeModal': () => void;
1358
- };
1359
- private static _template;
1360
- initCallback(): void;
1361
- static set template(value: string);
1362
- static get template(): string;
1363
- }
1364
1286
 
1365
- declare class ActivityHeader extends ActivityBlock {
1366
- }
1367
-
1368
- declare class CloudImageEditorBlock extends Block {
1369
- ctxOwner: boolean;
1370
- static styleAttrs: string[];
1371
- private _debouncedShowLoader;
1372
- constructor();
1373
- private _showLoader;
1287
+ declare const InternalEventType: Readonly<{
1288
+ readonly INIT_SOLUTION: "init-solution";
1289
+ readonly CHANGE_CONFIG: "change-config";
1290
+ readonly ACTION_EVENT: "action-event";
1291
+ readonly ERROR_EVENT: "error-event";
1292
+ }>;
1293
+ declare const EventType: Readonly<{
1294
+ readonly FILE_ADDED: "file-added";
1295
+ readonly FILE_REMOVED: "file-removed";
1296
+ readonly FILE_UPLOAD_START: "file-upload-start";
1297
+ readonly FILE_UPLOAD_PROGRESS: "file-upload-progress";
1298
+ readonly FILE_UPLOAD_SUCCESS: "file-upload-success";
1299
+ readonly FILE_UPLOAD_FAILED: "file-upload-failed";
1300
+ readonly FILE_URL_CHANGED: "file-url-changed";
1301
+ readonly MODAL_OPEN: "modal-open";
1302
+ readonly MODAL_CLOSE: "modal-close";
1303
+ readonly DONE_CLICK: "done-click";
1304
+ readonly UPLOAD_CLICK: "upload-click";
1305
+ readonly ACTIVITY_CHANGE: "activity-change";
1306
+ readonly COMMON_UPLOAD_START: "common-upload-start";
1307
+ readonly COMMON_UPLOAD_PROGRESS: "common-upload-progress";
1308
+ readonly COMMON_UPLOAD_SUCCESS: "common-upload-success";
1309
+ readonly COMMON_UPLOAD_FAILED: "common-upload-failed";
1310
+ readonly CHANGE: "change";
1311
+ readonly GROUP_CREATED: "group-created";
1312
+ }>;
1313
+ type EventKey = (typeof EventType)[keyof typeof EventType];
1314
+ type InternalEventKey = (typeof InternalEventType)[keyof typeof InternalEventType];
1315
+ type EventPayload = {
1316
+ [EventType.FILE_ADDED]: OutputFileEntry<'idle'>;
1317
+ [EventType.FILE_REMOVED]: OutputFileEntry<'removed'>;
1318
+ [EventType.FILE_UPLOAD_START]: OutputFileEntry<'uploading'>;
1319
+ [EventType.FILE_UPLOAD_PROGRESS]: OutputFileEntry<'uploading'>;
1320
+ [EventType.FILE_UPLOAD_SUCCESS]: OutputFileEntry<'success'>;
1321
+ [EventType.FILE_UPLOAD_FAILED]: OutputFileEntry<'failed'>;
1322
+ [EventType.FILE_URL_CHANGED]: OutputFileEntry<'success'>;
1323
+ [EventType.MODAL_OPEN]: {
1324
+ modalId: ModalId;
1325
+ };
1326
+ [EventType.MODAL_CLOSE]: {
1327
+ modalId: ModalId;
1328
+ hasActiveModals: boolean;
1329
+ };
1330
+ [EventType.ACTIVITY_CHANGE]: {
1331
+ activity: ActivityType;
1332
+ };
1333
+ [EventType.UPLOAD_CLICK]: undefined;
1334
+ [EventType.DONE_CLICK]: OutputCollectionState;
1335
+ [EventType.COMMON_UPLOAD_START]: OutputCollectionState<'uploading'>;
1336
+ [EventType.COMMON_UPLOAD_PROGRESS]: OutputCollectionState<'uploading'>;
1337
+ [EventType.COMMON_UPLOAD_SUCCESS]: OutputCollectionState<'success'>;
1338
+ [EventType.COMMON_UPLOAD_FAILED]: OutputCollectionState<'failed'>;
1339
+ [EventType.CHANGE]: OutputCollectionState;
1340
+ [EventType.GROUP_CREATED]: OutputCollectionState<'success', 'has-group'>;
1341
+ };
1342
+ declare class EventEmitter extends SharedInstance {
1343
+ private _timeoutStore;
1344
+ private _targets;
1345
+ bindTarget(target: LitBlock): () => void;
1346
+ private _dispatch;
1347
+ emit<T extends EventKey, TDebounce extends boolean | number | undefined = undefined>(type: T, payload?: TDebounce extends false | undefined ? EventPayload[T] : () => EventPayload[T], options?: {
1348
+ debounce?: TDebounce;
1349
+ }): void;
1350
+ destroy(): void;
1351
+ }
1352
+
1353
+ type EventMap = {
1354
+ [T in keyof EventPayload]: CustomEvent<EventPayload[T]>;
1355
+ };
1356
+
1357
+ type SelectOption = {
1358
+ text: string;
1359
+ value: string;
1360
+ };
1361
+ declare class Select extends LitBlock {
1362
+ value: string;
1363
+ disabled: boolean;
1364
+ options: SelectOption[];
1365
+ render(): lit_html.TemplateResult<1>;
1366
+ private _handleChange;
1367
+ }
1368
+ declare global {
1369
+ interface HTMLElementTagNameMap {
1370
+ 'uc-select': Select;
1371
+ }
1372
+ }
1373
+
1374
+ type CameraMode = 'photo' | 'video';
1375
+ declare class CameraSource extends LitUploaderBlock {
1376
+ couldBeCtxOwner: boolean;
1377
+ activityType: "camera";
1378
+ private _unsubPermissions;
1379
+ private _capturing;
1380
+ private _chunks;
1381
+ private _mediaRecorder;
1382
+ private _stream;
1383
+ private _selectedAudioId;
1384
+ private _selectedCameraId;
1385
+ private _activeTab;
1386
+ private _options;
1387
+ private _canvas;
1388
+ private _ctx;
1389
+ private _cameraDevices;
1390
+ private _audioDevices;
1391
+ private _permissionResponses;
1392
+ private _permissionCleanupFns;
1393
+ private _currentVideoSource;
1394
+ private readonly _handlePreviewPlay;
1395
+ private readonly _handlePreviewPause;
1396
+ private _timerRef;
1397
+ private _lineRef;
1398
+ private _videoRef;
1399
+ private _switcherRef;
1400
+ private _startTime;
1401
+ private _elapsedTime;
1402
+ private _videoTransformCss;
1403
+ private _videoHidden;
1404
+ private _messageHidden;
1405
+ private _requestBtnHidden;
1406
+ private _cameraSelectOptions;
1407
+ private _cameraSelectHidden;
1408
+ private _l10nMessage;
1409
+ private _timerHidden;
1410
+ private _cameraHidden;
1411
+ private _cameraActionsHidden;
1412
+ private _audioSelectOptions;
1413
+ private _audioSelectHidden;
1414
+ private _audioSelectDisabled;
1415
+ private _audioToggleMicrophoneHidden;
1416
+ private _tabCameraHidden;
1417
+ private _tabVideoHidden;
1418
+ private _currentIcon;
1419
+ private _currentTimelineIcon;
1420
+ private _toggleMicrophoneIcon;
1421
+ private _mutableClassButton;
1422
+ private _chooseActionWithCamera;
1423
+ private _handleCameraSelectChange;
1424
+ private _handleAudioSelectChange;
1425
+ private _handleRequestPermissions;
1426
+ private _handleStartCamera;
1427
+ private _handleToggleRecording;
1428
+ private _handleToggleAudio;
1429
+ private _handleRetake;
1430
+ private _handleAccept;
1431
+ private _handleClickTab;
1432
+ private _updateTimer;
1433
+ private _startTimer;
1434
+ private _stopTimer;
1435
+ private _startTimeline;
1436
+ private _stopTimeline;
1437
+ private _animationFrameId;
1438
+ private _startRecording;
1439
+ private _stopRecording;
1440
+ /** This method is used to toggle recording pause/resume */
1441
+ private _toggleRecording;
1442
+ private _toggleEnableAudio;
1443
+ /**
1444
+ * Previewing the video that was recorded on the camera
1445
+ */
1446
+ private _previewVideo;
1447
+ private _attachPreviewListeners;
1448
+ private _detachPreviewListeners;
1449
+ private _setVideoSource;
1450
+ /**
1451
+ * Do not bind srcObject directly in the template, because it stops video pausing on shot.
1452
+ * I really don'y know why but that's how it is. Assigning srcObject manually fixes the issue.
1453
+ */
1454
+ private _applyVideoSource;
1455
+ private _retake;
1456
+ private _accept;
1457
+ private _handlePhoto;
1458
+ private _handleVideo;
1459
+ private _setCameraState;
1460
+ private _shot;
1461
+ private _handleActiveTab;
1462
+ private _createFile;
1463
+ private _guessExtensionByMime;
1464
+ /**
1465
+ * The send file to the server
1466
+ */
1467
+ private _toSend;
1468
+ private get _cameraModes();
1469
+ private _setPermissionsState;
1470
+ private _makeStreamInactive;
1471
+ private _stopCapture;
1472
+ private _capture;
1473
+ private _handlePermissionsChange;
1474
+ private _permissionAccess;
1475
+ private _teardownPermissionListeners;
1476
+ private _requestDeviceAccess;
1477
+ private _getDevices;
1478
+ private _onActivate;
1479
+ private _onDeactivate;
1480
+ private _handleCameraModes;
1481
+ initCallback(): void;
1482
+ firstUpdated(changedProperties: PropertyValues<this>): void;
1483
+ updated(changedProperties: PropertyValues<this>): void;
1484
+ private _destroy;
1485
+ disconnectedCallback(): void;
1486
+ render(): lit_html.TemplateResult<1>;
1487
+ }
1488
+ declare global {
1489
+ interface HTMLElementTagNameMap {
1490
+ 'uc-camera-source': CameraSource;
1491
+ }
1492
+ }
1493
+
1494
+ /**
1495
+ * Config keys that can't be passed as attribute (because they are object or function)
1496
+ */
1497
+ declare const complexConfigKeys: readonly ["metadata", "localeDefinitionOverride", "secureUploadsSignatureResolver", "secureDeliveryProxyUrlResolver", "iconHrefResolver", "fileValidators", "collectionValidators", "mediaRecorderOptions"];
1498
+ /** Mapping of attribute names to state */
1499
+ declare const attrStateMapping: Record<string, string>;
1500
+ declare class Config extends LitBlock {
1501
+ attributesMeta: Partial<ConfigPlainType> & {
1502
+ 'ctx-name': string;
1503
+ };
1504
+ init$: LitBlock["init$"] & ConfigType;
1505
+ private _computationControllers;
1506
+ private _flushValueToAttribute;
1507
+ private _flushValueToState;
1508
+ private _setValue;
1509
+ private _getValue;
1510
+ private _assertSameValueDifferentReference;
1511
+ initCallback(): void;
1512
+ attributeChangedCallback(name: keyof typeof attrStateMapping, oldVal: string, newVal: string): void;
1513
+ static get observedAttributes(): string[];
1514
+ }
1515
+ interface Config extends ConfigType {
1516
+ }
1517
+ declare global {
1518
+ interface HTMLElementTagNameMap {
1519
+ 'uc-config': Config;
1520
+ }
1521
+ }
1522
+
1523
+ declare class FileItemConfig extends LitUploaderBlock {
1524
+ private _entrySubs;
1525
+ protected entry: UploadEntryTypedData | null;
1526
+ protected withEntry<A extends unknown[], R>(fn: (entry: UploadEntryTypedData, ...args: A) => R): (...args: A) => R | undefined;
1527
+ protected subEntry<K extends UploadEntryKeys>(prop: K, handler: (value: UploadEntryData[K]) => void): void;
1528
+ protected reset(): void;
1529
+ disconnectedCallback(): void;
1530
+ }
1531
+
1532
+ declare class Thumb extends FileItemConfig {
1533
+ badgeIcon: string;
1534
+ uid: Uid;
1535
+ private _thumbUrl;
1536
+ private _renderedGridOnce;
1537
+ private _thumbRect;
1538
+ private _isIntersecting;
1539
+ private _firstViewMode;
1540
+ private _observer?;
1541
+ private _pendingThumbUpdate?;
1542
+ private _calculateThumbSize;
1543
+ private _generateThumbnail;
1544
+ private _debouncedGenerateThumb;
1545
+ private _decodeImage;
1546
+ private _cancelPendingThumbUpdate;
1547
+ private _scheduleThumbUpdate;
1548
+ private _requestThumbGeneration;
1549
+ protected firstUpdated(changedProperties: PropertyValues<this>): void;
1550
+ protected updated(changedProperties: PropertyValues<this>): void;
1551
+ private _observerCallback;
1552
+ protected reset(): void;
1553
+ private _bindToEntry;
1554
+ initCallback(): void;
1555
+ connectedCallback(): void;
1556
+ disconnectedCallback(): void;
1557
+ render(): lit_html.TemplateResult<1>;
1558
+ }
1559
+ declare global {
1560
+ interface HTMLElementTagNameMap {
1561
+ 'uc-thumb': Thumb;
1562
+ }
1563
+ }
1564
+
1565
+ declare class ProgressBar extends LitBlock {
1566
+ hasFileName: boolean;
1567
+ value: number;
1568
+ visible: boolean;
1569
+ private _progressValue;
1570
+ private readonly _fakeProgressLineRef;
1571
+ private readonly _handleFakeProgressAnimation;
1572
+ protected firstUpdated(changedProperties: PropertyValues<this>): void;
1573
+ protected updated(changedProperties: PropertyValues<this>): void;
1574
+ disconnectedCallback(): void;
1575
+ private _normalizeProgressValue;
1576
+ private _updateProgressValueStyle;
1577
+ render(): lit_html.TemplateResult<1>;
1578
+ }
1579
+ declare global {
1580
+ interface HTMLElementTagNameMap {
1581
+ 'uc-progress-bar': ProgressBar;
1582
+ }
1583
+ }
1584
+
1585
+ declare class FileItem extends FileItemConfig {
1586
+ protected couldBeCtxOwner: boolean;
1587
+ private _pauseRender;
1588
+ uid: Uid;
1589
+ private _itemName;
1590
+ private _errorText;
1591
+ private _hint;
1592
+ private _progressValue;
1593
+ private _progressVisible;
1594
+ private _badgeIcon;
1595
+ private _isFinished;
1596
+ private _isFailed;
1597
+ private _isUploading;
1598
+ private _isFocused;
1599
+ private _isEditable;
1600
+ private _showFileNames;
1601
+ private _ariaLabelStatusFile;
1602
+ private _renderedOnce;
1603
+ private _observer?;
1604
+ private _handleEdit;
1605
+ private _handleRemove;
1606
+ private _handleUploadClick;
1607
+ private _calculateState;
1608
+ private _debouncedCalculateState;
1609
+ private _updateHintAndProgress;
1610
+ private _handleState;
1611
+ protected reset(): void;
1612
+ private _observerCallback;
1613
+ private _handleEntryId;
1614
+ private _updateShowFileNames;
1615
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
1616
+ initCallback(): void;
1617
+ connectedCallback(): void;
1618
+ disconnectedCallback(): void;
1619
+ private _upload;
1620
+ static activeInstances: Set<FileItem>;
1621
+ protected shouldUpdate(changedProperties: PropertyValues<this>): boolean;
1622
+ render(): lit_html.TemplateResult<1>;
1623
+ }
1624
+ declare global {
1625
+ interface HTMLElementTagNameMap {
1626
+ 'uc-file-item': FileItem;
1627
+ }
1628
+ }
1629
+
1630
+ declare class DropArea extends LitUploaderBlock {
1631
+ static styleAttrs: string[];
1632
+ /**
1633
+ * CSS-only attribute
1634
+ */
1635
+ single: boolean;
1636
+ /**
1637
+ * CSS-only attribute
1638
+ */
1639
+ ghost: boolean;
1640
+ disabled: boolean;
1641
+ clickable: boolean;
1642
+ withIcon: boolean;
1643
+ fullscreen: boolean;
1644
+ initflow: boolean;
1645
+ text?: string;
1646
+ private _isEnabled;
1647
+ private _isVisible;
1648
+ private get _localizedText();
1649
+ private _destroyDropzone;
1650
+ private _destroyContentWrapperDropzone;
1651
+ private _contentWrapperRef;
1652
+ private readonly _handleAreaInteraction;
1653
+ private _sourceListAllowsLocal;
1654
+ private _clickableListenersAttached;
1655
+ isActive(): boolean;
1656
+ initCallback(): void;
1657
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
1658
+ protected updated(changedProperties: PropertyValues<this>): void;
1659
+ /** Ignore drop events if there are other visible drop areas on the page. */
1660
+ private _shouldIgnore;
1661
+ private _couldHandleFiles;
1662
+ private _updateIsEnabled;
1663
+ private _updateVisibility;
1664
+ private _updateDragStateAttribute;
1665
+ private _updateClickableListeners;
1666
+ disconnectedCallback(): void;
1667
+ render(): lit_html.TemplateResult<1>;
1668
+ }
1669
+ declare global {
1670
+ interface HTMLElementTagNameMap {
1671
+ 'uc-drop-area': DropArea;
1672
+ }
1673
+ }
1674
+
1675
+ type FilesViewMode = 'grid' | 'list';
1676
+ declare class UploadList extends LitUploaderBlock {
1677
+ couldBeCtxOwner: boolean;
1678
+ protected historyTracked: boolean;
1679
+ activityType: "upload-list";
1680
+ private _doneBtnVisible;
1681
+ private _doneBtnEnabled;
1682
+ private _uploadBtnVisible;
1683
+ private _addMoreBtnVisible;
1684
+ private _addMoreBtnEnabled;
1685
+ private _commonErrorMessage;
1686
+ private _hasFiles;
1687
+ private _latestSummary;
1688
+ private get _headerText();
1689
+ private _handleAdd;
1690
+ private _handleUpload;
1691
+ private _handleDone;
1692
+ private _handleCancel;
1693
+ private _throttledHandleCollectionUpdate;
1694
+ private _updateUploadsState;
1695
+ private _getHeaderText;
1696
+ get couldOpenActivity(): boolean;
1697
+ initCallback(): void;
1698
+ disconnectedCallback(): void;
1699
+ render(): lit_html.TemplateResult<1>;
1700
+ }
1701
+ declare global {
1702
+ interface HTMLElementTagNameMap {
1703
+ 'uc-upload-list': UploadList;
1704
+ }
1705
+ }
1706
+
1707
+ type MetadataCallback = (fileEntry: OutputFileEntry) => Promise<Metadata> | Metadata;
1708
+ type LocaleDefinitionOverride = Record<string, Partial<LocaleDefinition>>;
1709
+ type SecureDeliveryProxyUrlResolver = (previewUrl: string, urlParts: {
1710
+ uuid: string;
1711
+ cdnUrlModifiers: string;
1712
+ fileName: string;
1713
+ }) => Promise<string> | string;
1714
+ type SecureUploadsSignatureAndExpire = {
1715
+ secureSignature: string;
1716
+ secureExpire: string;
1717
+ };
1718
+ type SecureUploadsSignatureResolver = () => Promise<SecureUploadsSignatureAndExpire | null>;
1719
+ type IconHrefResolver = (iconName: string) => string;
1720
+ type FileValidators = FileValidator[];
1721
+ type CollectionValidators = FuncCollectionValidator[];
1722
+ type ConfigType = {
1723
+ /**
1724
+ * Your project’s Public Key.
1725
+ */
1726
+ pubkey: string;
1727
+ /**
1728
+ * Allow multiple file uploads.
1729
+ */
1730
+ multiple: boolean;
1731
+ /**
1732
+ * Minimum number of files to upload.
1733
+ */
1734
+ multipleMin: number;
1735
+ /**
1736
+ * Maximum number of files to upload.
1737
+ */
1738
+ multipleMax: number;
1739
+ /**
1740
+ * Require user confirmation before uploading.
1741
+ */
1742
+ confirmUpload: boolean;
1743
+ /**
1744
+ * Allow only image files.
1745
+ */
1746
+ imgOnly: boolean;
1747
+ /**
1748
+ * Native file input accept attribute value. Also affects client validation settings.
1749
+ */
1750
+ accept: string;
1751
+ /**
1752
+ * Preferred types for external sources.
1753
+ * See [here](https://uploadcare.com/docs/file-uploader/options/#external-sources-preferred-types)
1754
+ */
1755
+ externalSourcesPreferredTypes: string;
1756
+ /**
1757
+ * Provide custom CSS to the social sources iframe
1758
+ */
1759
+ externalSourcesEmbedCss: string;
1760
+ /**
1761
+ * Store uploaded files.
1762
+ */
1763
+ store: boolean | 'auto';
1764
+ /**
1765
+ * Mirror the camera view.
1766
+ */
1767
+ cameraMirror: boolean;
1768
+ /**
1769
+ * Default camera capture mode.
1770
+ */
1771
+ cameraCapture: 'user' | 'environment' | '';
1772
+ /**
1773
+ * List of sources for file uploads.
1774
+ */
1775
+ sourceList: string;
1776
+ /**
1777
+ * Top-level origin for the uploader.
1778
+ * This is used for Google Drive Picker if there is no access to the origin due to the cross-origin policy.
1779
+ */
1780
+ topLevelOrigin: string;
1781
+ /**
1782
+ * Maximum size of local files in bytes.
1783
+ */
1784
+ maxLocalFileSizeBytes: number;
1785
+ /**
1786
+ * Thumbnail size.
1787
+ */
1788
+ thumbSize: number;
1789
+ /**
1790
+ * Show the upload list even if it is empty.
1791
+ */
1792
+ showEmptyList: boolean;
1793
+ /**
1794
+ * Use local image editor.
1795
+ */
1796
+ useLocalImageEditor: boolean;
1797
+ /**
1798
+ * Enable cloud image editing.
1799
+ */
1800
+ useCloudImageEditor: boolean;
1801
+ /**
1802
+ * Tabs to show in the cloud image editor.
1803
+ *
1804
+ * @default 'crop, tuning, filters'
1805
+ */
1806
+ cloudImageEditorTabs: string;
1807
+ /**
1808
+ * Remove copyright information.
1809
+ */
1810
+ removeCopyright: boolean;
1811
+ /**
1812
+ * Defines the crop behavior. When uploading images, your users can select a crop area with a defined aspect ratio.
1813
+ */
1814
+ cropPreset: string;
1815
+ /**
1816
+ * Image shrink options.
1817
+ */
1818
+ imageShrink: string;
1819
+ /**
1820
+ * Lock scroll when modal is open.
1821
+ */
1822
+ modalScrollLock: boolean;
1823
+ /**
1824
+ * Show strokes on modal backdrop.
1825
+ */
1826
+ modalBackdropStrokes: boolean;
1827
+ /**
1828
+ * Wrap the source list.
1829
+ */
1830
+ sourceListWrap: boolean;
1831
+ /**
1832
+ * Key to revoke Custom OAuth access. See [OAuth docs](https://uploadcare.com/docs/upload-sources/#oauth) for details.
1833
+ */
1834
+ remoteTabSessionKey: string;
1835
+ /**
1836
+ * Set custom CNAME.
1837
+ */
1838
+ cdnCname: string;
1839
+ /**
1840
+ * Set CNAME base domain for prefixed CDN URLs.
1841
+ */
1842
+ cdnCnamePrefixed: string;
1843
+ /**
1844
+ * Set a custom upload URL.
1845
+ */
1846
+ baseUrl: string;
1847
+ /**
1848
+ * Set a custom social sources URL.
1849
+ */
1850
+ socialBaseUrl: string;
1851
+ /**
1852
+ * Secure signature for uploads.
1853
+ */
1854
+ secureSignature: string;
1855
+ /**
1856
+ * Expiry time for secure uploads.
1857
+ */
1858
+ secureExpire: string;
1859
+ /**
1860
+ * Proxy URL for secure delivery.
1861
+ */
1862
+ secureDeliveryProxy: string;
1863
+ /**
1864
+ * Maximum number of retry attempts for throttled requests.
1865
+ */
1866
+ retryThrottledRequestMaxTimes: number;
1867
+ /**
1868
+ * Maximum number of retry attempts for network errors.
1869
+ */
1870
+ retryNetworkErrorMaxTimes: number;
1871
+ /**
1872
+ * Minimum file size for multipart uploads.
1873
+ */
1874
+ multipartMinFileSize: number;
1875
+ /**
1876
+ * Chunk size for multipart uploads.
1877
+ */
1878
+ multipartChunkSize: number;
1879
+ /**
1880
+ * Maximum number of concurrent requests.
1881
+ */
1882
+ maxConcurrentRequests: number;
1883
+ /**
1884
+ * Maximum number of concurrent multipart requests.
1885
+ */
1886
+ multipartMaxConcurrentRequests: number;
1887
+ /**
1888
+ * Maximum number of attempts for multipart uploads.
1889
+ */
1890
+ multipartMaxAttempts: number;
1891
+ /**
1892
+ * Check for URL duplicates.
1893
+ */
1894
+ checkForUrlDuplicates: boolean;
1895
+ /**
1896
+ * Save URL for recurrent uploads.
1897
+ */
1898
+ saveUrlForRecurrentUploads: boolean;
1899
+ /**
1900
+ * Group output files.
1901
+ */
1902
+ groupOutput: boolean;
1903
+ /**
1904
+ * User agent integration string.
1905
+ */
1906
+ userAgentIntegration: string;
1907
+ /**
1908
+ * Enable debug mode.
1909
+ */
1910
+ debug: boolean;
1911
+ /**
1912
+ * Locale name for the uploader.
1913
+ */
1914
+ localeName: string;
1915
+ /**
1916
+ * Expiry threshold for secure uploads.
1917
+ */
1918
+ secureUploadsExpireThreshold: number;
1919
+ /**
1920
+ * Metadata for the file.
1921
+ */
1922
+ metadata: Metadata | MetadataCallback | null;
1923
+ /**
1924
+ * Override locale definitions.
1925
+ */
1926
+ localeDefinitionOverride: LocaleDefinitionOverride | null;
1927
+ /**
1928
+ * Resolver for secure uploads signature.
1929
+ */
1930
+ secureUploadsSignatureResolver: SecureUploadsSignatureResolver | null;
1931
+ /**
1932
+ * Resolver for secure delivery proxy URL.
1933
+ */
1934
+ secureDeliveryProxyUrlResolver: SecureDeliveryProxyUrlResolver | null;
1935
+ /**
1936
+ * Resolver for icon href.
1937
+ */
1938
+ iconHrefResolver: IconHrefResolver | null;
1939
+ /**
1940
+ * Validators for individual files.
1941
+ */
1942
+ fileValidators: FileValidators;
1943
+ /**
1944
+ * Validators for file collections.
1945
+ */
1946
+ collectionValidators: CollectionValidators;
1947
+ /**
1948
+ * Timeout for async validation functions, in milliseconds.
1949
+ */
1950
+ validationTimeout: number;
1951
+ /**
1952
+ * The number of files to validate concurrently.
1953
+ */
1954
+ validationConcurrency: number;
1955
+ /**
1956
+ * The camera modes to enable in the camera modal,
1957
+ * it is possible to select photo or video capture.
1958
+ * The first mode is the default mode.
1959
+ * @default 'photo,video'
1960
+ */
1961
+ cameraModes: string;
1962
+ /**
1963
+ * The default tab to open in the camera modal,
1964
+ * it is possible to select video or photo capture
1965
+ * @default 'null'
1966
+ * @deprecated - use `cameraModes` instead
1967
+ */
1968
+ defaultCameraMode: CameraMode | null;
1969
+ /**
1970
+ * Enable audio recording.
1971
+ * @default true
1972
+ */
1973
+ enableAudioRecording: boolean;
1974
+ /**
1975
+ * Enable video recording.
1976
+ * @deprecated - use `cameraModes` instead
1977
+ * @default null
1978
+ */
1979
+ enableVideoRecording: boolean | null;
1374
1980
  /**
1375
- * To proper work, we need non-zero size the element. So, we'll wait for it.
1981
+ * The maximum duration of the video recording in seconds
1982
+ * @default null
1376
1983
  */
1377
- private _waitForSize;
1378
- initCallback(): void;
1379
- updateImage(): Promise<void>;
1380
- initEditor(): Promise<void>;
1381
- }
1382
-
1383
- declare class CropFrame extends Block {
1384
- private readonly _handlePointerUp;
1385
- private readonly _handlePointerMove;
1386
- private readonly _handleSvgPointerMove;
1387
- private readonly _backdropMaskId;
1388
- private _backdropMask?;
1389
- private _backdropMaskInner?;
1390
- private _frameThumbs?;
1391
- private _frameGuides?;
1392
- private _draggingThumb?;
1393
- private _hoverThumb?;
1394
- private _dragStartPoint?;
1395
- private _dragStartCrop?;
1396
- private _frameImage?;
1397
- private _guidesHidden;
1398
- constructor();
1399
- private _shouldThumbBeDisabled;
1400
- private _createBackdrop;
1984
+ maxVideoRecordingDuration: number | null;
1401
1985
  /**
1402
- * @private Super Tricky workaround for the chromium bug See
1403
- * https://bugs.chromium.org/p/chromium/issues/detail?id=330815
1986
+ * A dictionary object that can contain
1987
+ * the following properties from MediaRecorderOptions
1404
1988
  */
1405
- private _resizeBackdrop;
1406
- private _updateBackdrop;
1407
- private _updateFrame;
1408
- private _createThumb;
1409
- private _createThumbs;
1410
- private _createGuides;
1411
- private _createFrame;
1412
- private _handlePointerDown;
1413
- private _handlePointerUp_;
1414
- private _handlePointerMove_;
1415
- private _calcCropBox;
1416
- private _handleSvgPointerMove_;
1417
- private _updateCursor;
1418
- private _createMask;
1419
- private _updateMask;
1420
- private _render;
1421
- toggleThumbs(visible: boolean): void;
1422
- initCallback(): void;
1423
- destroyCallback(): void;
1424
- }
1425
-
1426
- declare class EditorButtonControl extends Block {
1427
- private _titleEl?;
1428
- constructor();
1429
- initCallback(): void;
1430
- }
1431
-
1432
- declare class EditorFreeformButtonControl extends EditorButtonControl {
1433
- initCallback(): void;
1434
- handleClick(): void;
1435
- }
1436
- interface EditorAspectRatioButtonControl {
1437
- get aspectRatio(): CropAspectRatio | undefined;
1438
- set aspectRatio(value: CropAspectRatio | undefined);
1439
- }
1440
- declare class EditorAspectRatioButtonControl extends EditorButtonControl {
1441
- constructor();
1442
- initCallback(): void;
1443
- handleClick(): void;
1444
- private _renderRectBasedOnAspectRatio;
1445
- private _aspectRatio?;
1446
- }
1447
-
1448
- declare const ALL_COLOR_OPERATIONS: readonly ["brightness", "exposure", "gamma", "contrast", "saturation", "vibrance", "warmth", "enhance"];
1449
- type ColorOperation = (typeof ALL_COLOR_OPERATIONS)[number];
1450
- declare const ALL_FILTERS: readonly ["adaris", "briaril", "calarel", "carris", "cynarel", "cyren", "elmet", "elonni", "enzana", "erydark", "fenralan", "ferand", "galen", "gavin", "gethriel", "iorill", "iothari", "iselva", "jadis", "lavra", "misiara", "namala", "nerion", "nethari", "pamaya", "sarnar", "sedis", "sewen", "sorahel", "sorlen", "tarian", "thellassan", "varriel", "varven", "vevera", "virkas", "yedis", "yllara", "zatvel", "zevcen"];
1451
- type FilterId = (typeof ALL_FILTERS)[number];
1452
- declare const ALL_CROP_OPERATIONS: readonly ["rotate", "mirror", "flip"];
1453
- type CropOperation = (typeof ALL_CROP_OPERATIONS)[number];
1454
- /** KeypointsNumber is the number of keypoints loaded from each side of zero, not total number */
1455
- declare const COLOR_OPERATIONS_CONFIG: Readonly<{
1456
- brightness: {
1457
- zero: number;
1458
- range: readonly [-100, 100];
1459
- keypointsNumber: number;
1460
- };
1461
- exposure: {
1462
- zero: number;
1463
- range: readonly [-500, 500];
1464
- keypointsNumber: number;
1465
- };
1466
- gamma: {
1467
- zero: number;
1468
- range: readonly [0, 1000];
1469
- keypointsNumber: number;
1470
- };
1471
- contrast: {
1472
- zero: number;
1473
- range: readonly [-100, 500];
1474
- keypointsNumber: number;
1989
+ mediaRecorderOptions: MediaRecorderOptions | null;
1990
+ filesViewMode: FilesViewMode;
1991
+ gridShowFileNames: boolean;
1992
+ cloudImageEditorAutoOpen: boolean;
1993
+ qualityInsights: boolean;
1994
+ cloudImageEditorMaskHref: string | null;
1995
+ /**
1996
+ * Adds data-testid attributes to the each block. Needed for testing purposes.
1997
+ * @default false
1998
+ */
1999
+ testMode: boolean;
2000
+ };
2001
+ type ConfigComplexType = Pick<ConfigType, (typeof complexConfigKeys)[number]>;
2002
+ type ConfigPlainType = Omit<ConfigType, keyof ConfigComplexType>;
2003
+ type ConfigAttributesType = KebabCaseKeys<ConfigPlainType> & LowerCaseKeys<ConfigPlainType>;
2004
+ type KebabCase$1<S extends string> = S extends `${infer C}${infer T}` ? T extends Uncapitalize<T> ? `${Uncapitalize<C>}${KebabCase$1<T>}` : `${Uncapitalize<C>}-${KebabCase$1<T>}` : S;
2005
+ type KebabCaseKeys<T extends Record<string, unknown>> = {
2006
+ [Key in keyof T as KebabCase$1<Key & string>]: T[Key];
2007
+ };
2008
+ type LowerCase<S extends string> = Lowercase<S>;
2009
+ type LowerCaseKeys<T extends Record<string, unknown>> = {
2010
+ [Key in keyof T as Lowercase<Key & string>]: T[Key];
2011
+ };
2012
+ type OutputFileStatus = 'idle' | 'uploading' | 'success' | 'failed' | 'removed';
2013
+ type OutputCustomErrorType = 'CUSTOM_ERROR';
2014
+ type OutputFileErrorType = OutputCustomErrorType | 'NOT_AN_IMAGE' | 'FORBIDDEN_FILE_TYPE' | 'FILE_SIZE_EXCEEDED' | 'UPLOAD_ERROR' | 'NETWORK_ERROR' | 'UNKNOWN_ERROR';
2015
+ type OutputCollectionErrorType = OutputCustomErrorType | 'SOME_FILES_HAS_ERRORS' | 'TOO_MANY_FILES' | 'TOO_FEW_FILES';
2016
+ type OutputFileErrorPayload = {
2017
+ entry: OutputFileEntry;
2018
+ };
2019
+ type OutputErrorTypePayload = {
2020
+ NOT_AN_IMAGE: OutputFileErrorPayload;
2021
+ FORBIDDEN_FILE_TYPE: OutputFileErrorPayload;
2022
+ FILE_SIZE_EXCEEDED: OutputFileErrorPayload;
2023
+ SOME_FILES_HAS_ERRORS: {
2024
+ [k: string]: never;
1475
2025
  };
1476
- saturation: {
1477
- zero: number;
1478
- range: readonly [-100, 500];
1479
- keypointsNumber: number;
2026
+ TOO_MANY_FILES: {
2027
+ min: number;
2028
+ max: number;
2029
+ total: number;
1480
2030
  };
1481
- vibrance: {
1482
- zero: number;
1483
- range: readonly [-100, 500];
1484
- keypointsNumber: number;
2031
+ TOO_FEW_FILES: {
2032
+ min: number;
2033
+ max: number;
2034
+ total: number;
1485
2035
  };
1486
- warmth: {
1487
- zero: number;
1488
- range: readonly [-100, 100];
1489
- keypointsNumber: number;
2036
+ UPLOAD_ERROR: OutputFileErrorPayload & {
2037
+ error: UploadError;
1490
2038
  };
1491
- enhance: {
1492
- zero: number;
1493
- range: readonly [0, 100];
1494
- keypointsNumber: number;
2039
+ NETWORK_ERROR: OutputFileErrorPayload & {
2040
+ error: NetworkError;
1495
2041
  };
1496
- filter: {
1497
- zero: number;
1498
- range: readonly [0, 100];
1499
- keypointsNumber: number;
2042
+ UNKNOWN_ERROR: OutputFileErrorPayload & {
2043
+ error?: Error;
1500
2044
  };
1501
- }>;
1502
-
1503
- interface EditorCropButtonControl {
1504
- get operation(): CropOperation | undefined;
1505
- set operation(value: CropOperation | undefined);
1506
- }
1507
- declare class EditorCropButtonControl extends EditorButtonControl {
1508
- private _operation;
1509
- initCallback(): void;
1510
- }
2045
+ CUSTOM_ERROR: Record<string, unknown>;
2046
+ };
2047
+ type OutputError<T extends OutputFileErrorType | OutputCollectionErrorType> = T extends OutputCustomErrorType ? {
2048
+ type?: T;
2049
+ message: string;
2050
+ payload?: OutputErrorTypePayload[T];
2051
+ } : T extends keyof OutputErrorTypePayload ? {
2052
+ type: T;
2053
+ message: string;
2054
+ payload?: OutputErrorTypePayload[T];
2055
+ } : never;
2056
+ type OutputErrorFile = OutputError<OutputFileErrorType>;
2057
+ type OutputErrorCollection = OutputError<OutputCollectionErrorType>;
2058
+ type OutputFileEntry<TStatus extends OutputFileStatus = OutputFileStatus> = {
2059
+ status: TStatus;
2060
+ internalId: string;
2061
+ name: string;
2062
+ size: number;
2063
+ isImage: boolean;
2064
+ mimeType: string;
2065
+ metadata: Metadata | null;
2066
+ file: File | Blob | null;
2067
+ externalUrl: string | null;
2068
+ uploadProgress: number;
2069
+ fullPath: string | null;
2070
+ source: SourceTypes | null;
2071
+ isValidationPending: boolean;
2072
+ } & ({
2073
+ status: 'success';
2074
+ fileInfo: UploadcareFile;
2075
+ uuid: string;
2076
+ cdnUrl: string;
2077
+ cdnUrlModifiers: string;
2078
+ isUploading: false;
2079
+ isSuccess: true;
2080
+ isFailed: false;
2081
+ isRemoved: false;
2082
+ errors: [];
2083
+ } | {
2084
+ status: 'failed';
2085
+ fileInfo: UploadcareFile | null;
2086
+ uuid: string | null;
2087
+ cdnUrl: string | null;
2088
+ cdnUrlModifiers: string | null;
2089
+ isUploading: false;
2090
+ isSuccess: false;
2091
+ isFailed: true;
2092
+ isRemoved: false;
2093
+ errors: OutputError<OutputFileErrorType>[];
2094
+ } | {
2095
+ status: 'uploading';
2096
+ fileInfo: null;
2097
+ uuid: null;
2098
+ cdnUrl: null;
2099
+ cdnUrlModifiers: null;
2100
+ isUploading: true;
2101
+ isSuccess: false;
2102
+ isFailed: false;
2103
+ isRemoved: false;
2104
+ errors: [];
2105
+ } | {
2106
+ status: 'removed';
2107
+ fileInfo: UploadcareFile | null;
2108
+ uuid: string | null;
2109
+ cdnUrl: string | null;
2110
+ cdnUrlModifiers: string | null;
2111
+ isUploading: false;
2112
+ isSuccess: false;
2113
+ isFailed: false;
2114
+ isRemoved: true;
2115
+ errors: OutputError<OutputFileErrorType>[];
2116
+ } | {
2117
+ status: 'idle';
2118
+ fileInfo: null;
2119
+ uuid: null;
2120
+ cdnUrl: null;
2121
+ cdnUrlModifiers: null;
2122
+ isUploading: false;
2123
+ isSuccess: false;
2124
+ isFailed: false;
2125
+ isRemoved: false;
2126
+ errors: [];
2127
+ });
2128
+ type OutputCollectionStatus = 'idle' | 'uploading' | 'success' | 'failed';
2129
+ type GroupFlag = 'has-group' | 'maybe-has-group';
2130
+ type OutputCollectionState<TStatus extends OutputCollectionStatus = OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'> = {
2131
+ status: TStatus;
2132
+ totalCount: number;
2133
+ successCount: number;
2134
+ failedCount: number;
2135
+ uploadingCount: number;
2136
+ progress: number;
2137
+ successEntries: OutputFileEntry<'success'>[];
2138
+ failedEntries: OutputFileEntry<'failed'>[];
2139
+ uploadingEntries: OutputFileEntry<'uploading'>[];
2140
+ idleEntries: OutputFileEntry<'idle'>[];
2141
+ } & (TGroupFlag extends 'has-group' ? {
2142
+ group: UploadcareGroup;
2143
+ } : TGroupFlag extends 'maybe-has-group' ? {
2144
+ group: UploadcareGroup | null;
2145
+ } : never) & ({
2146
+ status: 'idle';
2147
+ isFailed: false;
2148
+ isUploading: false;
2149
+ isSuccess: false;
2150
+ errors: [];
2151
+ allEntries: OutputFileEntry<'idle' | 'success'>[];
2152
+ } | {
2153
+ status: 'uploading';
2154
+ isFailed: false;
2155
+ isUploading: true;
2156
+ isSuccess: false;
2157
+ errors: [];
2158
+ allEntries: OutputFileEntry[];
2159
+ } | {
2160
+ status: 'success';
2161
+ isFailed: false;
2162
+ isUploading: false;
2163
+ isSuccess: true;
2164
+ errors: [];
2165
+ allEntries: OutputFileEntry<'success'>[];
2166
+ } | {
2167
+ status: 'failed';
2168
+ isFailed: true;
2169
+ isUploading: false;
2170
+ isSuccess: false;
2171
+ errors: OutputError<OutputCollectionErrorType>[];
2172
+ allEntries: OutputFileEntry[];
2173
+ });
1511
2174
 
1512
- declare class EditorFilterControl extends EditorButtonControl {
1513
- private _operation;
1514
- private _filter;
1515
- private _originalUrl;
1516
- private _observer?;
1517
- private _cancelPreload?;
1518
- constructor();
1519
- private _previewSrc;
1520
- private _observerCallback;
1521
- initCallback(): void;
1522
- destroyCallback(): void;
2175
+ declare class SecureUploadsManager extends SharedInstance {
2176
+ private _secureToken;
2177
+ getSecureToken(): Promise<SecureUploadsSignatureAndExpire | null>;
2178
+ destroy(): void;
1523
2179
  }
1524
2180
 
1525
- type Operations = {
1526
- flip: boolean;
1527
- mirror: boolean;
1528
- rotate: number;
2181
+ type CommonEventType = InternalEventKey | EventKey;
2182
+ type TelemetryState = TelemetryRequest & {
2183
+ eventTimestamp: number;
2184
+ location: string;
1529
2185
  };
1530
- declare class EditorImageCropper extends Block {
1531
- ctxOwner: boolean;
1532
- private _commitDebounced;
1533
- private _handleResizeThrottled;
1534
- private _imageSize;
1535
- private _canvas?;
1536
- private _ctx;
1537
- private _isActive;
1538
- private _observer?;
1539
- private _cancelPreload?;
1540
- constructor();
1541
- private _handleResize;
1542
- private _syncTransformations;
1543
- private _initCanvas;
1544
- private _alignImage;
1545
- private _alignCrop;
1546
- private _drawImage;
1547
- private _draw;
1548
- private _animateIn;
1549
- private _getCropDimensions;
1550
- private _getCropTransformation;
1551
- private _commit;
1552
- setValue<K extends keyof Operations>(operation: K, value: Operations[K]): void;
1553
- getValue<K extends keyof Operations>(operation: K): Operations[K];
1554
- activate(imageSize: ImageSize, { fromViewer }?: {
1555
- fromViewer?: boolean;
1556
- }): Promise<void>;
1557
- deactivate({ reset }?: {
1558
- reset?: boolean;
1559
- }): void;
1560
- private _transitionToCrop;
1561
- private _transitionToImage;
1562
- private _reset;
1563
- private _waitForImage;
1564
- private _handleImageLoading;
1565
- initCallback(): void;
1566
- destroyCallback(): void;
1567
- }
1568
-
1569
- type OperationKey = keyof typeof COLOR_OPERATIONS_CONFIG;
1570
- declare class EditorImageFader extends Block {
1571
- private _isActive;
1572
- private _hidden;
1573
- private _operation;
1574
- private _filter;
1575
- private _value?;
1576
- private _transformations;
1577
- private _keypoints;
1578
- private _container?;
1579
- private _previewImage?;
1580
- private _cancelLastImages?;
1581
- private _cancelBatchPreload?;
1582
- private _url?;
1583
- private _fromViewer?;
1584
- private _raf;
1585
- private _addKeypointDebounced;
1586
- constructor();
1587
- private _handleImageLoading;
1588
- private _flush;
1589
- private _imageSrc;
1590
- private _constructKeypoint;
2186
+ type TelemetryEventBody = Partial<Pick<TelemetryState, 'payload' | 'config'>> & {
2187
+ modalId?: string;
2188
+ eventType?: CommonEventType;
2189
+ };
2190
+ declare class TelemetryManager extends SharedInstance {
2191
+ private readonly _sessionId;
2192
+ private readonly _telemetryInstance;
2193
+ private _config;
2194
+ private _initialized;
2195
+ private _lastPayload;
2196
+ private readonly _queue;
2197
+ private _isEnabled;
2198
+ constructor(sharedInstancesBag: SharedInstancesBag);
2199
+ private _init;
2200
+ private _setConfig;
2201
+ private _formattingPayload;
2202
+ private _excludedEvents;
2203
+ sendEvent(body: TelemetryEventBody): void;
2204
+ sendEventError(error: unknown, context?: string): void;
1591
2205
  /**
1592
- * Check if current operation and filter equals passed ones
2206
+ * Method to send telemetry event for Cloud Image Editor.
1593
2207
  */
1594
- private _isSame;
1595
- private _addKeypoint;
1596
- set(value: string | number): void;
1597
- private _update;
1598
- private _createPreviewImage;
1599
- private _initNodes;
1600
- setTransformations(transformations: Transformations): Promise<void>;
1601
- preload({ url, filter, operation, value, }: {
1602
- url: string;
1603
- filter?: string;
1604
- operation?: OperationKey;
1605
- value?: number;
1606
- }): Promise<void>;
1607
- private _setOriginalSrc;
1608
- activate({ url, operation, value, filter, fromViewer, }: {
1609
- url: string;
1610
- operation?: OperationKey;
1611
- value?: number;
1612
- filter?: string;
1613
- fromViewer?: boolean;
1614
- }): Promise<void>;
1615
- deactivate({ hide }?: {
1616
- hide?: boolean;
1617
- }): void;
1618
- }
1619
-
1620
- declare class EditorOperationControl extends EditorButtonControl {
1621
- private _operation;
1622
- initCallback(): void;
1623
- }
1624
-
1625
- declare class EditorScroller extends Block {
1626
- initCallback(): void;
1627
- }
1628
-
1629
- type SliderOperation = ColorOperation | 'filter';
1630
- type SliderFilter = FilterId | typeof FAKE_ORIGINAL_FILTER;
1631
- declare const FAKE_ORIGINAL_FILTER = "original";
1632
- declare class EditorSlider extends Block {
1633
- private _operation;
1634
- private _filter?;
1635
- private _originalUrl;
1636
- constructor();
1637
- setOperation(operation: SliderOperation, filter?: SliderFilter): void;
1638
- private _initializeValues;
1639
- apply(): void;
1640
- cancel(): void;
1641
- initCallback(): void;
1642
- }
1643
-
1644
- declare class EditorToolbar extends Block {
1645
- private _debouncedShowLoader;
1646
- private _cancelPreload?;
1647
- private _updateInfoTooltip;
1648
- constructor();
1649
- private _onSliderClose;
1650
- private _createOperationControl;
1651
- private _createFilterControl;
1652
- private _createToggleControl;
1653
- private _createAspectRatioControl;
1654
- private _createFreeformControl;
1655
- private _clearListAspectRatio;
1656
- private _renderControlsList;
1657
- private _activateTab;
1658
- private _unmountTabControls;
1659
- private _syncTabIndicator;
1660
- private _preloadEditedImage;
1661
- private _showLoader;
1662
- private _updateInfoTooltipHandler;
1663
- initCallback(): void;
1664
- destroyCallback(): void;
1665
- }
1666
-
1667
- declare class BtnUi extends Block {
1668
- private _iconReversed;
1669
- private _iconSingle;
1670
- private _iconHidden;
1671
- constructor();
1672
- private _iconCss;
1673
- initCallback(): void;
1674
- set reverse(_value: boolean);
1675
- }
1676
-
1677
- declare class LineLoaderUi extends Block {
1678
- private _active;
1679
- private readonly _handleTransitionEndRight;
1680
- initCallback(): void;
1681
- private _start;
1682
- private _stop;
1683
- }
1684
-
1685
- declare class PresenceToggle extends Block {
1686
- private _visible;
1687
- private _visibleStyle;
1688
- private _hiddenStyle;
1689
- private _externalTransitions;
1690
- constructor();
1691
- private _handleVisible;
1692
- initCallback(): void;
2208
+ sendEventCloudImageEditor(e: MouseEvent, tabId: string, options?: Record<string, unknown>): void;
2209
+ /**
2210
+ * Deeply compares two objects and returns true if they are equal, false otherwise.
2211
+ */
2212
+ private _checkObj;
2213
+ private get _timestamp();
2214
+ private get _solution();
2215
+ private get _activity();
2216
+ private get _location();
1693
2217
  }
1694
2218
 
1695
- declare class SliderUi extends Block {
1696
- private _observer?;
1697
- private _thumbSize;
1698
- private _zero;
1699
- private _zeroDotEl?;
1700
- private _stepsCount?;
1701
- constructor();
1702
- initCallback(): void;
1703
- private _inputEl;
1704
- private _thumbEl;
1705
- private _stepsEl;
1706
- private _updateValue;
1707
- private _updateZeroDot;
1708
- private _updateSteps;
1709
- destroyCallback(): void;
2219
+ type SharedConfigState = {
2220
+ [K in keyof ConfigType as `*cfg/${K}`]: ConfigType[K];
2221
+ };
2222
+ type BlocksRegistry = Set<LitBlock>;
2223
+ type ActivityBlockCtxState = {
2224
+ '*currentActivity': string | null;
2225
+ '*currentActivityParams': Record<string, unknown>;
2226
+ '*history': (string | null)[];
2227
+ '*historyBack': (() => void) | null;
2228
+ '*closeModal': () => void;
2229
+ };
2230
+ type UploaderBlockCtxState = ActivityBlockCtxState & {
2231
+ '*commonProgress': number;
2232
+ '*uploadList': {
2233
+ uid: Uid;
2234
+ }[];
2235
+ '*uploadQueue': Queue;
2236
+ '*collectionErrors': OutputErrorCollection[];
2237
+ '*collectionState': OutputCollectionState | null;
2238
+ '*groupInfo': UploadcareGroup | null;
2239
+ '*uploadTrigger': Set<Uid>;
2240
+ };
2241
+ type SolutionBlockCtxState = UploaderBlockCtxState & {
2242
+ '*solution': string | null;
2243
+ };
2244
+ type CloudImageEditorState = {
2245
+ '*originalUrl': string | null;
2246
+ '*loadingOperations': LoadingOperations;
2247
+ '*faderEl': EditorImageFader | null;
2248
+ '*cropperEl': EditorImageCropper | null;
2249
+ '*imgEl': HTMLImageElement | null;
2250
+ '*imgContainerEl': HTMLElement | null;
2251
+ '*networkProblems': boolean;
2252
+ '*imageSize': {
2253
+ width: number;
2254
+ height: number;
2255
+ } | null;
2256
+ '*editorTransformations': Transformations;
2257
+ '*cropPresetList': CropPresetList;
2258
+ '*currentAspectRatio': CropAspectRatio | null;
2259
+ '*tabList': readonly TabIdValue$1[];
2260
+ '*tabId': TabIdValue$1;
2261
+ '*on.retryNetwork': () => void;
2262
+ '*on.apply': (transformations: Transformations) => void;
2263
+ '*on.cancel': () => void;
2264
+ };
2265
+ type EditorImageCropperState = {
2266
+ '*padding': number;
2267
+ '*operations': {
2268
+ rotate: number;
2269
+ mirror: boolean;
2270
+ flip: boolean;
2271
+ };
2272
+ '*imageBox': {
2273
+ x: number;
2274
+ y: number;
2275
+ width: number;
2276
+ height: number;
2277
+ };
2278
+ '*cropBox': {
2279
+ x: number;
2280
+ y: number;
2281
+ width: number;
2282
+ height: number;
2283
+ };
2284
+ };
2285
+ type EditorToolbarState = {
2286
+ '*showListAspectRatio': boolean;
2287
+ '*sliderEl': EditorSlider | null;
2288
+ '*showSlider': boolean;
2289
+ '*currentFilter': string;
2290
+ '*currentOperation': string | null;
2291
+ '*operationTooltip': string | null;
2292
+ };
2293
+ type DynamicBlockState = {
2294
+ '*blocksRegistry': BlocksRegistry;
2295
+ '*eventEmitter': EventEmitter;
2296
+ '*localeManager': LocaleManager;
2297
+ '*telemetryManager': TelemetryManager;
2298
+ '*a11y': A11y;
2299
+ '*modalManager': ModalManager | null;
2300
+ };
2301
+ type DynamicUploaderBlockState = {
2302
+ '*uploadCollection': TypedCollection<UploadEntryData>;
2303
+ '*publicApi': UploaderPublicApi;
2304
+ '*validationManager': ValidationManager;
2305
+ '*secureUploadsManager': SecureUploadsManager;
2306
+ };
2307
+ type LocaleState = {
2308
+ [K in keyof LocaleDefinition as `*l10n/${K}`]: string;
2309
+ };
2310
+ type SharedState = SolutionBlockCtxState & SharedConfigState & CloudImageEditorState & EditorImageCropperState & EditorToolbarState & DynamicBlockState & DynamicUploaderBlockState & LocaleState;
2311
+
2312
+ interface ISharedInstance {
2313
+ destroy?(): void;
2314
+ }
2315
+ declare class SharedInstance {
2316
+ protected _ctx: PubSub<SharedState>;
2317
+ protected _sharedInstancesBag: SharedInstancesBag;
2318
+ private _subscriptions;
2319
+ private _cfgProxy;
2320
+ protected _debugPrint: (...args: unknown[]) => void;
2321
+ constructor(sharedInstancesBag: SharedInstancesBag);
2322
+ protected addSub(unsub: () => void): void;
2323
+ protected get _cfg(): Readonly<ConfigType>;
2324
+ destroy(): void;
1710
2325
  }
2326
+ type SharedInstancesState = Pick<SharedState, '*blocksRegistry' | '*eventEmitter' | '*localeManager' | '*telemetryManager' | '*a11y' | '*modalManager' | '*uploadCollection' | '*publicApi' | '*validationManager' | '*secureUploadsManager'>;
2327
+ type SharedInstancesBag = ReturnType<typeof createSharedInstancesBag>;
2328
+ declare const createSharedInstancesBag: (getCtx: () => PubSub<SharedState>) => {
2329
+ readonly ctx: PubSub<SharedState>;
2330
+ readonly modalManager: ModalManager | null;
2331
+ readonly telemetryManager: TelemetryManager;
2332
+ readonly localeManager: LocaleManager;
2333
+ readonly a11y: A11y;
2334
+ readonly blocksRegistry: Set<LitBlock>;
2335
+ readonly eventEmitter: EventEmitter;
2336
+ readonly uploadCollection: TypedCollection<UploadEntryData>;
2337
+ readonly secureUploadsManager: SecureUploadsManager;
2338
+ readonly api: UploaderPublicApi;
2339
+ readonly validationManager: ValidationManager;
2340
+ };
1711
2341
 
1712
- declare class Copyright extends Block {
1713
- initCallback(): void;
1714
- static template: string;
2342
+ type FuncFileValidator = (outputEntry: OutputFileEntry, api: UploaderPublicApi, options?: {
2343
+ signal?: AbortSignal;
2344
+ }) => undefined | OutputErrorFile | Promise<undefined | OutputErrorFile>;
2345
+ type FileValidatorDescriptor = {
2346
+ runOn: 'add' | 'upload' | 'change';
2347
+ validator: FuncFileValidator;
2348
+ };
2349
+ type FileValidator = FileValidatorDescriptor | FuncFileValidator;
2350
+ type FuncCollectionValidator = (collection: ReturnType<typeof buildOutputCollectionState<OutputCollectionStatus>>, api: UploaderPublicApi) => undefined | OutputErrorCollection;
2351
+ declare class ValidationManager extends SharedInstance {
2352
+ private get _uploadCollection();
2353
+ private _commonFileValidators;
2354
+ private _commonCollectionValidators;
2355
+ private _queue;
2356
+ private _runQueueDebounced;
2357
+ private _isDestroyed;
2358
+ private _entryValidationState;
2359
+ constructor(sharedInstancesBag: SharedInstancesBag);
2360
+ runFileValidators(runOn: FileValidatorDescriptor['runOn'], entryIds?: Uid[]): void;
2361
+ runCollectionValidators(): void;
2362
+ cleanupValidationForEntry(entry: TypedData<UploadEntryData>): void;
2363
+ private _runFileValidatorsForEntry;
2364
+ private _addCustomTypeToValidationError;
2365
+ private _getEntryValidationState;
2366
+ private _getValidatorDescriptors;
2367
+ private _getValidatorDescriptorsForEntry;
2368
+ destroy(): void;
1715
2369
  }
1716
2370
 
1717
- declare class DropArea extends UploaderBlock {
2371
+ declare const LitBlockBase: typeof LitElement & Constructor<{
2372
+ willYield: boolean;
2373
+ yield(slot: string, defaultContent?: unknown): unknown;
2374
+ }> & Constructor<{
2375
+ getCssData(propName: string, silentCheck?: boolean): string | number | boolean | null | undefined;
2376
+ }> & Constructor<SymbioteComponent<SharedState>> & Constructor<LitElement> & {
2377
+ reg(tagName: string): void;
2378
+ };
2379
+ declare class LitBlock extends LitBlockBase {
2380
+ private _cfgProxy;
2381
+ protected _sharedContextInstances: Map<keyof SharedInstancesState, ISharedInstance>;
1718
2382
  static styleAttrs: string[];
1719
- private _destroyDropzone;
1720
- private _destroyContentWrapperDropzone;
1721
- private _onAreaClicked;
2383
+ activityType: ActivityType;
2384
+ init$: {};
1722
2385
  constructor();
1723
- isActive(): boolean;
2386
+ l10n: (str: string, variables?: Record<string, string | number>) => string;
2387
+ debugPrint: (...args: unknown[]) => void;
2388
+ protected _sharedInstancesBag: {
2389
+ readonly ctx: PubSub<SharedState>;
2390
+ readonly modalManager: ModalManager | null;
2391
+ readonly telemetryManager: TelemetryManager;
2392
+ readonly localeManager: LocaleManager;
2393
+ readonly a11y: A11y;
2394
+ readonly blocksRegistry: Set<LitBlock>;
2395
+ readonly eventEmitter: EventEmitter;
2396
+ readonly uploadCollection: TypedCollection<UploadEntryData>;
2397
+ readonly secureUploadsManager: SecureUploadsManager;
2398
+ readonly api: UploaderPublicApi;
2399
+ readonly validationManager: ValidationManager;
2400
+ };
2401
+ emit(type: Parameters<EventEmitter['emit']>[0], payload?: Parameters<EventEmitter['emit']>[1], options?: Parameters<EventEmitter['emit']>[2]): void;
2402
+ hasBlockInCtx(callback: (block: LitBlock) => boolean): boolean;
2403
+ connectedCallback(): void;
1724
2404
  initCallback(): void;
1725
- /** Ignore drop events if there are other visible drop areas on the page. */
1726
- private _shouldIgnore;
1727
- private _couldHandleFiles;
1728
- destroyCallback(): void;
1729
- }
1730
-
1731
- type EntrySubscription = ReturnType<UploadEntryTypedData['subscribe']>;
1732
- declare class FileItemConfig extends UploaderBlock {
1733
- protected _entrySubs: Set<EntrySubscription>;
1734
- protected _entry: UploadEntryTypedData | null;
1735
- protected _withEntry<A extends unknown[], R>(fn: (entry: UploadEntryTypedData, ...args: A) => R): (...args: A) => R | undefined;
1736
- protected _subEntry<K extends UploadEntryKeys>(prop: K, handler: (value: UploadEntryData[K]) => void): void;
1737
- protected _reset(): void;
2405
+ get testId(): string;
2406
+ get modalManager(): ModalManager | null;
2407
+ get telemetryManager(): TelemetryManager;
2408
+ get localeManager(): LocaleManager;
2409
+ get a11y(): A11y;
2410
+ get blocksRegistry(): Set<LitBlock>;
2411
+ get eventEmitter(): EventEmitter;
1738
2412
  disconnectedCallback(): void;
2413
+ /**
2414
+ * Called when the last block is removed from the context. Note that inheritors must run their callback before that.
2415
+ */
2416
+ private destroyCtxCallback;
2417
+ /**
2418
+ * Adds a shared context instance if it does not exist yet.
2419
+ * @param key The shared state key.
2420
+ * @param resolver The resolver function that creates the instance.
2421
+ */
2422
+ protected _addSharedContextInstance<TKey extends keyof SharedInstancesState>(key: TKey, resolver: (sharedInstancesBag: SharedInstancesBag) => NonNullable<SharedInstancesState[TKey]>): void;
2423
+ private _destroySharedContextInstances;
2424
+ protected _getSharedContextInstance<TKey extends keyof SharedState, TRequired extends boolean = true>(key: TKey, isRequired?: TRequired): TRequired extends true ? NonNullable<SharedState[TKey]> : SharedState[TKey];
2425
+ protected proxyUrl(url: string): Promise<string>;
2426
+ get cfg(): ConfigType;
2427
+ subConfigValue<T extends keyof ConfigType>(key: T, callback: (value: ConfigType[T]) => void): () => void;
1739
2428
  }
1740
2429
 
1741
- declare class FileItem extends FileItemConfig {
1742
- couldBeCtxOwner: boolean;
1743
- pauseRender: boolean;
1744
- private _renderedOnce;
1745
- private _observer?;
1746
- protected _isIntersecting: boolean;
1747
- protected _thumbRect?: DOMRectReadOnly;
1748
- constructor();
1749
- private _calculateState;
1750
- private _debouncedCalculateState;
1751
- private _updateHintAndProgress;
1752
- private _handleState;
1753
- _reset(): void;
1754
- private _observerCallback;
1755
- private _handleEntryId;
1756
- private _updateShowFileNames;
2430
+ declare class Modal extends LitBlock {
2431
+ static styleAttrs: string[];
2432
+ private _mouseDownTarget;
2433
+ /** WARNING: Do not rename/change this, it's used in dashboard */
2434
+ protected dialogEl: lit_html_directives_ref_js.Ref<HTMLDialogElement>;
2435
+ /**
2436
+ * CSS-only attribute
2437
+ */
2438
+ strokes: boolean;
2439
+ /**
2440
+ * CSS-only attribute
2441
+ */
2442
+ blockBodyScrolling: boolean;
2443
+ /** WARNING: Do not rename/change this, it's used in dashboard */
2444
+ protected closeDialog: () => void;
2445
+ private _handleDialogClose;
2446
+ private _handleDialogMouseDown;
2447
+ private _handleDialogMouseUp;
2448
+ show(): void;
2449
+ hide(): void;
2450
+ private _handleModalOpen;
2451
+ private _handleModalClose;
2452
+ private _handleModalCloseAll;
1757
2453
  initCallback(): void;
1758
- destroyCallback(): void;
1759
- connectedCallback(): void;
1760
2454
  disconnectedCallback(): void;
1761
- private _settingsOfShrink;
1762
- private _processShrink;
1763
- upload: () => Promise<void> | undefined;
1764
- static template: string;
1765
- static activeInstances: Set<FileItem>;
1766
- }
1767
-
1768
- declare class FormInput extends UploaderBlock {
1769
- requireCtxName: boolean;
1770
- _validationInputElement: HTMLInputElement | null;
1771
- _dynamicInputsContainer: HTMLDivElement | null;
1772
- private get _inputName();
1773
- _createValidationInput(): HTMLInputElement;
1774
- initCallback(): void;
2455
+ private _handleDialogRef;
2456
+ render(): lit_html.TemplateResult<1>;
1775
2457
  }
1776
-
1777
- declare class Icon extends Block {
1778
- constructor();
1779
- initCallback(): void;
2458
+ declare global {
2459
+ interface HTMLElementTagNameMap {
2460
+ 'uc-modal': Modal;
2461
+ }
1780
2462
  }
1781
2463
 
1782
- declare class ImgConfig extends BaseComponent<any> {
1783
- static get observedAttributes(): string[];
1784
- constructor();
1785
- cssInit$: any;
1786
- /**
1787
- * @param {String} key
1788
- * @returns {any}
1789
- */
1790
- $$(key: string): any;
1791
- /** @param {Object<String, String | Number>} kvObj */
1792
- set$$(kvObj: any): void;
2464
+ declare const ModalEvents: Readonly<{
2465
+ readonly ADD: "modal:add";
2466
+ readonly DELETE: "modal:delete";
2467
+ readonly OPEN: "modal:open";
2468
+ readonly CLOSE: "modal:close";
2469
+ readonly CLOSE_ALL: "modal:closeAll";
2470
+ readonly DESTROY: "modal:destroy";
2471
+ }>;
2472
+ type ModalId = ActivityType;
2473
+ type ModalCb = (data: {
2474
+ id: ModalId;
2475
+ modal: Modal;
2476
+ }) => void;
2477
+ type ModalEventType = (typeof ModalEvents)[keyof typeof ModalEvents];
2478
+ declare class ModalManager extends SharedInstance {
2479
+ private _modals;
2480
+ private _activeModals;
2481
+ private _subscribers;
1793
2482
  /**
1794
- * @param {String} key
1795
- * @param {(val: any) => void} kbFn
2483
+ * Register a modal with the manager
2484
+ * @param id Unique identifier for the modal
2485
+ * @param modal Modal component instance
1796
2486
  */
1797
- sub$$(key: string, kbFn: (val: any) => void): void;
1798
- analyticsParams(): string;
1799
- initAttributes(el: any): void;
2487
+ registerModal(id: ModalId, modal: Modal): void;
2488
+ /** Remove a modal by ID. */
2489
+ deleteModal(id: ModalId): boolean;
2490
+ /** Open a modal by its ID. */
2491
+ open(id: ModalId): boolean;
2492
+ /** Close a specific modal by ID. */
2493
+ close(id: ModalId): boolean;
2494
+ /** Toggle a modal - open if closed, close if open. */
2495
+ toggle(id: ModalId): boolean;
2496
+ /** True if there are any active modals. */
2497
+ get hasActiveModals(): boolean;
2498
+ /** Close the most recently opened modal and return to the previous one. */
2499
+ back(): boolean;
2500
+ /** Close all open modals. */
2501
+ closeAll(): number;
1800
2502
  /**
1801
- * @param {HTMLElement} el
1802
- * @param {() => void} cbkFn
2503
+ * Subscribe to modal events
2504
+ * @returns Unsubscribe function
1803
2505
  */
1804
- initIntersection(el: HTMLElement, cbkFn: () => void): void;
1805
- /** @private */
2506
+ subscribe(event: ModalEventType, callback: ModalCb): () => void;
2507
+ /** Unsubscribe from modal events */
2508
+ unsubscribe(event: ModalEventType, callback: ModalCb | undefined): void;
2509
+ /** Notify all subscribers of a modal event. */
2510
+ private _notify;
2511
+ /** Destroy the modal manager, clean up resources */
2512
+ destroy(): void;
2513
+ }
2514
+
2515
+ type KebabCase<T extends string> = T extends `${infer Head} ${infer Tail}` ? `${Lowercase<Head>}-${KebabCase<Tail>}` : Lowercase<T>;
2516
+ declare const toKebabCase: <T extends string>(str: T) => KebabCase<T>;
2517
+
2518
+ declare class LitSolutionBlock extends LitBlock {
2519
+ static styleAttrs: string[];
2520
+ init$: {
2521
+ '*solution': string | null;
2522
+ '*commonProgress': number;
2523
+ '*uploadList': never[];
2524
+ '*uploadQueue': _uploadcare_upload_client.Queue;
2525
+ '*collectionErrors': OutputErrorCollection[];
2526
+ '*collectionState': OutputCollectionState | null;
2527
+ '*groupInfo': _uploadcare_upload_client.UploadcareGroup | null;
2528
+ '*uploadTrigger': Set<string>;
2529
+ '*currentActivity': null;
2530
+ '*currentActivityParams': {};
2531
+ '*history': never[];
2532
+ '*historyBack': null;
2533
+ '*closeModal': () => void;
2534
+ };
2535
+ initCallback(): void;
2536
+ render(): lit_html.TemplateResult<1>;
2537
+ }
2538
+
2539
+ type CssPropValue = string | number | undefined | null;
2540
+ declare const ImgConfig_base: typeof LitElement & Constructor<LitElement> & {
2541
+ reg(tagName: string): void;
2542
+ } & Constructor<{
2543
+ getCssData(propName: string, silentCheck?: boolean): string | number | boolean | null | undefined;
2544
+ }>;
2545
+ declare class ImgConfig extends ImgConfig_base {
2546
+ private _state;
2547
+ private _subscribers;
1806
2548
  private _isnObserver;
1807
- /** @private */
1808
2549
  private _observed;
1809
- attributeChangedCallback(name: any, oldVal: any, newVal: any): void;
2550
+ createRenderRoot(): HTMLElement | ShadowRoot;
2551
+ constructor();
2552
+ protected $$(key: string): unknown;
2553
+ protected set$$(kvObj: Record<string, CssPropValue>): void;
2554
+ protected sub$$<T = unknown>(key: string, kbFn: (val: T) => void): void;
2555
+ private _notify;
2556
+ protected analyticsParams(): string;
2557
+ protected initAttributes(el: HTMLElement): void;
2558
+ protected initIntersection(el: HTMLElement, cbkFn: () => void): void;
2559
+ connectedCallback(): void;
2560
+ private _initCssProperties;
2561
+ disconnectedCallback(): void;
2562
+ static get observedAttributes(): string[];
2563
+ attributeChangedCallback(name: string, _oldVal: string | null, newVal: string | null): void;
1810
2564
  }
1811
2565
 
1812
2566
  declare class ImgBase extends ImgConfig {
1813
- _img: HTMLImageElement;
1814
- _imgPreview: HTMLImageElement;
1815
- /**
1816
- * @private
1817
- * @param {String} src
1818
- */
2567
+ private _img;
2568
+ private _imgPreview;
1819
2569
  private _fmtAbs;
1820
- /**
1821
- * Validate size
1822
- *
1823
- * @param {String} [size]
1824
- * @returns {String | Number}
1825
- */
1826
- _validateSize(size?: string): string | number;
1827
- /**
1828
- * Image operations
1829
- *
1830
- * @param {String} [size]
1831
- * @param {String} [blur]
1832
- */
1833
- _getCdnModifiers(size?: string, blur?: string): string;
1834
- /**
1835
- * @private
1836
- * @param {String} [size]
1837
- * @param {String} [blur]
1838
- * @returns {any}
1839
- */
2570
+ private _validateSize;
2571
+ private _getCdnModifiers;
2572
+ private _getTypedCssValue;
1840
2573
  private _getUrlBase;
1841
- /**
1842
- * @private
1843
- * @param {String} url
1844
- * @returns {String}
1845
- */
1846
2574
  private _proxyUrl;
1847
- /**
1848
- * @param {HTMLElement} el
1849
- * @param {Number} [k]
1850
- * @param {Boolean} [wOnly]
1851
- */
1852
- _getElSize(el: HTMLElement, k?: number, wOnly?: boolean): string | null;
1853
- /** @param {HTMLImageElement} img */
1854
- _setupEventProxy(img: HTMLImageElement): void;
1855
- /** @type {HTMLImageElement} */
1856
- get img(): HTMLImageElement;
1857
- get currentImg(): {
1858
- type: "PREVIEW";
1859
- img: HTMLImageElement;
1860
- } | {
1861
- type: "MAIN";
1862
- img: HTMLImageElement;
1863
- };
1864
- get hasPreviewImage(): any;
1865
- get bgSelector(): any;
1866
- get breakpoints(): number[] | null;
1867
- get hasFormatJPG(): boolean;
1868
- /** @param {HTMLElement} el */
1869
- renderBg(el: HTMLElement): void;
1870
- getSrcset(): string;
1871
- getSrc(): any;
1872
- get srcUrlPreview(): any;
1873
- renderBackground(): void;
1874
- _appendURL({ elNode, src, srcset }: {
1875
- elNode: any;
1876
- src: any;
1877
- srcset: any;
1878
- }): void;
1879
- _setupConfigForImage({ elNode }: {
1880
- elNode: any;
1881
- }): void;
1882
- loaderImage({ src, srcset, elNode }: {
1883
- src: any;
1884
- srcset: any;
1885
- elNode: any;
1886
- }): Promise<any>;
1887
- renderImage(): Promise<void>;
1888
- init(): void;
2575
+ protected _getElSize(el: HTMLElement, k?: number, wOnly?: boolean): string | null;
2576
+ private _setupEventProxy;
2577
+ protected get img(): HTMLImageElement;
2578
+ private get _currentImg();
2579
+ private get _hasPreviewImage();
2580
+ private get _bgSelector();
2581
+ private get _breakpoints();
2582
+ private get _hasFormatJPG();
2583
+ private _renderBg;
2584
+ private _getSrcset;
2585
+ private _getSrc;
2586
+ private get _srcUrlPreview();
2587
+ private _renderBackground;
2588
+ private _appendURL;
2589
+ private _setupConfigForImage;
2590
+ private _loaderImage;
2591
+ private _renderImage;
2592
+ protected init(): void;
1889
2593
  }
1890
2594
 
1891
2595
  declare class Img extends ImgBase {
2596
+ attributesMeta: {
2597
+ src: string;
2598
+ } | {
2599
+ uuid: string;
2600
+ };
2601
+ connectedCallback(): void;
1892
2602
  }
1893
-
1894
- declare class ProgressBar extends Block {
1895
- private _value;
1896
- private _visible;
1897
- constructor();
1898
- initCallback(): void;
2603
+ declare global {
2604
+ interface HTMLElementTagNameMap {
2605
+ 'uc-img': Img;
2606
+ }
1899
2607
  }
1900
2608
 
1901
- declare class ProgressBarCommon extends UploaderBlock {
1902
- private _unobserveCollectionCb?;
1903
- constructor();
2609
+ declare class FormInput extends LitUploaderBlock {
2610
+ attributesMeta: {
2611
+ 'ctx-name': string;
2612
+ name?: string;
2613
+ };
2614
+ private _validationInputElement;
2615
+ private _dynamicInputsContainer;
2616
+ nameAttrValue?: string;
2617
+ private get _inputName();
2618
+ private _createValidationInput;
1904
2619
  initCallback(): void;
1905
- destroyCallback(): void;
2620
+ }
2621
+ declare global {
2622
+ interface HTMLElementTagNameMap {
2623
+ 'uc-form-input': FormInput;
2624
+ }
1906
2625
  }
1907
2626
 
1908
- declare class Select extends Block {
1909
- ref: {
1910
- select: HTMLSelectElement;
1911
- } & Record<string, HTMLElement>;
1912
- value: string;
1913
- constructor();
2627
+ declare class Copyright extends LitBlock {
1914
2628
  initCallback(): void;
2629
+ render(): lit_html.TemplateResult<1>;
2630
+ }
2631
+ declare global {
2632
+ interface HTMLElementTagNameMap {
2633
+ 'uc-copyright': Copyright;
2634
+ }
1915
2635
  }
1916
2636
 
1917
- declare class SimpleBtn extends UploaderBlock {
1918
- static styleAttrs: string[];
1919
- couldBeCtxOwner: boolean;
2637
+ declare class ProgressBarCommon extends LitUploaderBlock {
2638
+ private _unobserveCollectionCb?;
2639
+ private _visible;
2640
+ private _value;
1920
2641
  constructor();
1921
2642
  initCallback(): void;
2643
+ protected updated(changedProperties: PropertyValues<this>): void;
2644
+ disconnectedCallback(): void;
2645
+ render(): lit_html.TemplateResult<1>;
2646
+ }
2647
+ declare global {
2648
+ interface HTMLElementTagNameMap {
2649
+ 'uc-progress-bar-common': ProgressBarCommon;
2650
+ }
1922
2651
  }
1923
2652
 
1924
- type SourceTypeConfig = {
1925
- type: string;
1926
- activity?: ActivityType | null;
1927
- textKey?: string;
1928
- icon?: string;
1929
- activate?: () => boolean;
1930
- activityParams?: Record<string, unknown>;
1931
- };
1932
- declare class SourceBtn extends UploaderBlock {
2653
+ declare class SourceBtn extends LitUploaderBlock {
1933
2654
  couldBeCtxOwner: boolean;
1934
- private type;
1935
2655
  private _registeredTypes;
1936
- constructor();
1937
- initTypes(): void;
2656
+ type?: string;
2657
+ private _iconName;
2658
+ private _srcTypeKey;
2659
+ private _initTypes;
1938
2660
  initCallback(): void;
1939
- registerType(typeConfig: SourceTypeConfig): void;
1940
- getType(type: string): SourceTypeConfig | undefined;
2661
+ private _registerType;
1941
2662
  activate(): void;
1942
- applyType(type: string): void;
2663
+ private _applyType;
2664
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
2665
+ render(): lit_html.TemplateResult<1>;
2666
+ }
2667
+ declare global {
2668
+ interface HTMLElementTagNameMap {
2669
+ 'uc-source-btn': SourceBtn;
2670
+ }
1943
2671
  }
1944
2672
 
1945
- declare class SourceList extends Block {
2673
+ declare class SourceList extends LitBlock {
2674
+ private _rawSourceList;
2675
+ private _cameraModes;
2676
+ /**
2677
+ * CSS-only attribute
2678
+ */
2679
+ wrap: boolean;
1946
2680
  initCallback(): void;
2681
+ protected updated(changedProperties: PropertyValues<this>): void;
2682
+ private _updateSources;
2683
+ private _sources;
2684
+ render(): lit_html.TemplateResult<1>;
1947
2685
  }
1948
-
1949
- declare class Spinner extends BaseComponent<void> {
2686
+ declare global {
2687
+ interface HTMLElementTagNameMap {
2688
+ 'uc-source-list': SourceList;
2689
+ }
1950
2690
  }
1951
2691
 
1952
- declare class StartFrom extends ActivityBlock {
1953
- historyTracked: boolean;
2692
+ declare class StartFrom extends LitActivityBlock {
2693
+ protected historyTracked: boolean;
1954
2694
  activityType: ActivityType;
1955
2695
  initCallback(): void;
2696
+ render(): lit_html.TemplateResult<1>;
1956
2697
  }
1957
-
1958
- declare class Thumb extends FileItemConfig {
1959
- private _renderedGridOnce;
1960
- private _thumbRect;
1961
- private _isIntersecting;
1962
- private _firstViewMode;
1963
- private _observer?;
1964
- constructor();
1965
- private _calculateThumbSize;
1966
- private _generateThumbnail;
1967
- private _debouncedGenerateThumb;
1968
- private _observerCallback;
1969
- protected _reset(): void;
1970
- private _handleEntryId;
1971
- initCallback(): void;
1972
- connectedCallback(): void;
1973
- disconnectedCallback(): void;
2698
+ declare global {
2699
+ interface HTMLElementTagNameMap {
2700
+ 'uc-start-from': StartFrom;
2701
+ }
1974
2702
  }
1975
2703
 
1976
2704
  type EventListenerMap = {
1977
2705
  [K in (typeof EventType)[keyof typeof EventType]]: (e: CustomEvent<EventPayload[K]>) => void;
1978
2706
  };
1979
- declare class UploadCtxProvider extends UploaderBlock {
2707
+ declare class UploadCtxProvider extends LitUploaderBlock {
2708
+ attributesMeta: {
2709
+ 'ctx-name': string;
2710
+ };
1980
2711
  static styleAttrs: string[];
1981
2712
  static EventType: Readonly<{
1982
2713
  readonly FILE_ADDED: "file-added";
@@ -1998,57 +2729,112 @@ declare class UploadCtxProvider extends UploaderBlock {
1998
2729
  readonly CHANGE: "change";
1999
2730
  readonly GROUP_CREATED: "group-created";
2000
2731
  }>;
2001
- requireCtxName: boolean;
2732
+ private _unbindEventEmitter;
2002
2733
  initCallback(): void;
2003
- destroyCallback(): void;
2734
+ disconnectedCallback(): void;
2004
2735
  }
2005
- interface UploadCtxProvider extends UploaderBlock {
2736
+ interface UploadCtxProvider extends LitUploaderBlock {
2006
2737
  addEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | AddEventListenerOptions): void;
2007
2738
  removeEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | EventListenerOptions): void;
2008
2739
  }
2740
+ declare global {
2741
+ interface HTMLElementTagNameMap {
2742
+ 'uc-upload-ctx-provider': UploadCtxProvider;
2743
+ }
2744
+ }
2009
2745
 
2010
- declare class UrlSource extends UploaderBlock {
2746
+ declare class UrlSource extends LitUploaderBlock {
2011
2747
  couldBeCtxOwner: boolean;
2012
2748
  activityType: ActivityType;
2013
- constructor();
2749
+ private _formState;
2014
2750
  initCallback(): void;
2751
+ private _inputRef;
2752
+ private _handleInput;
2753
+ private _handleUpload;
2754
+ render(): lit_html.TemplateResult<1>;
2755
+ }
2756
+ declare global {
2757
+ interface HTMLElementTagNameMap {
2758
+ 'uc-url-source': UrlSource;
2759
+ }
2015
2760
  }
2016
2761
 
2017
- declare const PACKAGE_NAME = "blocks";
2018
- declare const PACKAGE_VERSION: string;
2019
-
2020
- declare class CloudImageEditor extends CloudImageEditorBlock {
2762
+ declare class SimpleBtn extends LitUploaderBlock {
2021
2763
  static styleAttrs: string[];
2022
- constructor();
2764
+ couldBeCtxOwner: boolean;
2765
+ dropzone: boolean;
2766
+ private _buttonTextKey;
2767
+ private readonly _handleClick;
2023
2768
  initCallback(): void;
2769
+ render(): lit_html.TemplateResult<1>;
2770
+ }
2771
+ declare global {
2772
+ interface HTMLElementTagNameMap {
2773
+ 'uc-simple-btn': SimpleBtn;
2774
+ }
2024
2775
  }
2025
2776
 
2026
- declare class FileUploaderInline extends SolutionBlock {
2777
+ declare class FileUploaderRegular extends LitSolutionBlock {
2778
+ attributesMeta: {
2779
+ headless?: boolean;
2780
+ 'ctx-name': string;
2781
+ };
2027
2782
  static styleAttrs: string[];
2783
+ headless: boolean;
2028
2784
  constructor();
2029
- get couldHistoryBack(): boolean;
2030
- get couldShowList(): boolean;
2031
2785
  initCallback(): void;
2786
+ render(): lit_html.TemplateResult<1>;
2787
+ }
2788
+ declare global {
2789
+ interface HTMLElementTagNameMap {
2790
+ 'uc-file-uploader-regular': FileUploaderRegular;
2791
+ }
2032
2792
  }
2033
2793
 
2034
- declare class FileUploaderMinimal extends SolutionBlock {
2794
+ declare class FileUploaderInline extends LitSolutionBlock {
2795
+ attributesMeta: {
2796
+ 'ctx-name': string;
2797
+ };
2035
2798
  static styleAttrs: string[];
2036
- private handleModalOpen?;
2037
- private handleModalClose?;
2799
+ private _couldCancel;
2038
2800
  constructor();
2039
- private _handleModalOpen;
2040
- private _handleModalClose;
2801
+ private _handleCancel;
2802
+ private get _couldHistoryBack();
2803
+ private get _couldShowList();
2804
+ private _getInitActivity;
2041
2805
  initCallback(): void;
2042
- destroyCallback(): void;
2806
+ render(): lit_html.TemplateResult<1>;
2807
+ }
2808
+ declare global {
2809
+ interface HTMLElementTagNameMap {
2810
+ 'uc-file-uploader-inline': FileUploaderInline;
2811
+ }
2043
2812
  }
2044
2813
 
2045
- declare class FileUploaderRegular extends SolutionBlock {
2814
+ declare class FileUploaderMinimal extends LitSolutionBlock {
2815
+ attributesMeta: {
2816
+ 'ctx-name': string;
2817
+ };
2046
2818
  static styleAttrs: string[];
2819
+ private _singleUpload;
2820
+ private _isHiddenStartFrom;
2821
+ private _classUploadList;
2822
+ private _classStartFrom;
2823
+ private _getInitActivity;
2047
2824
  constructor();
2825
+ private _handleModalOpen;
2826
+ private _handleModalClose;
2048
2827
  initCallback(): void;
2828
+ disconnectedCallback(): void;
2829
+ render(): lit_html.TemplateResult<1>;
2830
+ }
2831
+ declare global {
2832
+ interface HTMLElementTagNameMap {
2833
+ 'uc-file-uploader-minimal': FileUploaderMinimal;
2834
+ }
2049
2835
  }
2050
2836
 
2051
- type KebabCase<T extends string> = T extends `${infer Head} ${infer Tail}` ? `${Lowercase<Head>}-${KebabCase<Tail>}` : Lowercase<T>;
2052
- declare const toKebabCase: <T extends string>(str: T) => KebabCase<T>;
2837
+ declare const PACKAGE_NAME = "blocks";
2838
+ declare const PACKAGE_VERSION: string;
2053
2839
 
2054
- export { ActivityBlock, ActivityHeader, type ApiAddFileCommonOptions, Block, BtnUi, CameraSource, CloudImageEditor, CloudImageEditorActivity, CloudImageEditorBlock, type CollectionValidators, Config, type ConfigAttributesType, type ConfigComplexType, type ConfigPlainType, type ConfigType, Copyright, CropFrame, 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, PACKAGE_NAME, PACKAGE_VERSION, PresenceToggle, ProgressBar, ProgressBarCommon, type SecureDeliveryProxyUrlResolver, type SecureUploadsSignatureAndExpire, type SecureUploadsSignatureResolver, Select, SimpleBtn, SliderUi, SolutionBlock, SourceBtn, SourceList, type SourceTypes, Spinner, StartFrom, Thumb, UploadCtxProvider, UploadList, UploadSource, UploaderBlock, UploaderPublicApi, UrlSource, defineComponents, defineLocale, loadFileUploaderFrom, toKebabCase };
2840
+ 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, 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, LitSolutionBlock as SolutionBlock, SourceBtn, SourceList, type SourceTypes, Spinner, StartFrom, Thumb, UID, UploadCtxProvider, UploadList, UploadSource, LitUploaderBlock as UploaderBlock, UploaderPublicApi, UrlSource, defineComponents, defineLocale, loadFileUploaderFrom, toKebabCase };