@uploadcare/file-uploader 1.25.0 → 1.26.0

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