@uploadcare/file-uploader 1.25.0-alpha.9 → 1.25.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 +75 -4
  2. package/dist/env.js +33 -4
  3. package/dist/index.css +2660 -5
  4. package/dist/index.d.ts +976 -1316
  5. package/dist/index.js +12012 -6
  6. package/dist/index.layered.css +2716 -4
  7. package/dist/index.ssr.js +768 -549
  8. package/dist/locales/file-uploader/ar.js +165 -4
  9. package/dist/locales/file-uploader/az.js +157 -4
  10. package/dist/locales/file-uploader/ca.js +159 -4
  11. package/dist/locales/file-uploader/cs.js +161 -4
  12. package/dist/locales/file-uploader/da.js +157 -4
  13. package/dist/locales/file-uploader/de.js +157 -4
  14. package/dist/locales/file-uploader/el.js +157 -4
  15. package/dist/locales/file-uploader/en.js +157 -4
  16. package/dist/locales/file-uploader/es.js +159 -4
  17. package/dist/locales/file-uploader/et.js +157 -4
  18. package/dist/locales/file-uploader/fi.js +157 -4
  19. package/dist/locales/file-uploader/fr.js +159 -4
  20. package/dist/locales/file-uploader/he.js +159 -4
  21. package/dist/locales/file-uploader/hy.js +157 -4
  22. package/dist/locales/file-uploader/is.js +157 -4
  23. package/dist/locales/file-uploader/it.js +159 -4
  24. package/dist/locales/file-uploader/ja.js +157 -4
  25. package/dist/locales/file-uploader/ka.js +157 -4
  26. package/dist/locales/file-uploader/kk.js +157 -4
  27. package/dist/locales/file-uploader/ko.js +157 -4
  28. package/dist/locales/file-uploader/lv.js +159 -4
  29. package/dist/locales/file-uploader/nb.js +157 -4
  30. package/dist/locales/file-uploader/nl.js +157 -4
  31. package/dist/locales/file-uploader/pl.js +161 -4
  32. package/dist/locales/file-uploader/pt.js +159 -4
  33. package/dist/locales/file-uploader/ro.js +159 -4
  34. package/dist/locales/file-uploader/ru.js +161 -4
  35. package/dist/locales/file-uploader/sk.js +161 -4
  36. package/dist/locales/file-uploader/sr.js +159 -4
  37. package/dist/locales/file-uploader/sv.js +157 -4
  38. package/dist/locales/file-uploader/tr.js +157 -4
  39. package/dist/locales/file-uploader/uk.js +161 -4
  40. package/dist/locales/file-uploader/vi.js +157 -4
  41. package/dist/locales/file-uploader/zh-TW.js +157 -4
  42. package/dist/locales/file-uploader/zh.js +157 -4
  43. package/package.json +31 -36
  44. package/types/jsx.d.ts +48 -75
  45. package/web/file-uploader.iife.min.d.ts +987 -1327
  46. package/web/file-uploader.iife.min.js +27 -6
  47. package/web/file-uploader.min.d.ts +987 -1327
  48. package/web/file-uploader.min.js +26 -5
  49. package/web/uc-basic.layered.min.css +23 -4
  50. package/web/uc-basic.min.css +23 -4
  51. package/web/uc-cloud-image-editor.layered.min.css +23 -4
  52. package/web/uc-cloud-image-editor.min.css +23 -4
  53. package/web/uc-cloud-image-editor.min.d.ts +550 -756
  54. package/web/uc-cloud-image-editor.min.js +26 -5
  55. package/web/uc-file-uploader-inline.layered.min.css +23 -4
  56. package/web/uc-file-uploader-inline.min.css +23 -4
  57. package/web/uc-file-uploader-inline.min.d.ts +987 -1327
  58. package/web/uc-file-uploader-inline.min.js +26 -5
  59. package/web/uc-file-uploader-minimal.layered.min.css +23 -4
  60. package/web/uc-file-uploader-minimal.min.css +23 -4
  61. package/web/uc-file-uploader-minimal.min.d.ts +987 -1327
  62. package/web/uc-file-uploader-minimal.min.js +26 -5
  63. package/web/uc-file-uploader-regular.layered.min.css +23 -4
  64. package/web/uc-file-uploader-regular.min.css +23 -4
  65. package/web/uc-file-uploader-regular.min.d.ts +987 -1327
  66. package/web/uc-file-uploader-regular.min.js +26 -5
  67. package/web/uc-img.min.d.ts +100 -55
  68. package/web/uc-img.min.js +25 -5
  69. package/web/file-uploader.iife.min.js.LEGAL.txt +0 -71
  70. package/web/file-uploader.min.js.LEGAL.txt +0 -71
  71. package/web/uc-cloud-image-editor.min.js.LEGAL.txt +0 -70
  72. package/web/uc-file-uploader-inline.min.js.LEGAL.txt +0 -71
  73. package/web/uc-file-uploader-minimal.min.js.LEGAL.txt +0 -71
  74. package/web/uc-file-uploader-regular.min.js.LEGAL.txt +0 -71
  75. package/web/uc-img.min.js.LEGAL.txt +0 -24
@@ -1,155 +1,424 @@
1
- import { LitElement, PropertyValues, nothing, TemplateResult } from 'lit';
2
- import * as lit_html from 'lit-html';
3
- import * as lit_html_directives_ref_js from 'lit-html/directives/ref.js';
4
- import { TelemetryRequest } from '@uploadcare/quality-insights';
1
+ import { BaseComponent } from '@symbiotejs/symbiote';
2
+ export { BaseComponent, Data, UID } from '@symbiotejs/symbiote';
5
3
  import * as _uploadcare_upload_client from '@uploadcare/upload-client';
6
- import { UploadcareFile, Metadata, UploadError, NetworkError, UploadcareGroup, FileFromOptions, Queue } from '@uploadcare/upload-client';
4
+ import { UploadcareFile, Metadata, UploadError, NetworkError, UploadcareGroup, FileFromOptions } from '@uploadcare/upload-client';
7
5
  export { Metadata, NetworkError, UploadError, UploadcareError, UploadcareFile, UploadcareGroup } from '@uploadcare/upload-client';
8
- import { Ref } from 'lit/directives/ref.js';
6
+ import { TelemetryRequest } from '@uploadcare/quality-insights';
9
7
 
10
- type Subscription = {
11
- remove: () => void;
12
- };
13
- declare class PubSub<T extends Record<string, unknown> = Record<string, unknown>> {
14
- private static _contexts;
15
- private _store;
16
- private constructor();
17
- pub<K extends keyof T>(key: K, value: T[K]): void;
18
- sub<K extends keyof T>(key: K, callback: (value: T[K]) => void, init?: boolean): Subscription;
19
- read<K extends keyof T>(key: K): T[K];
20
- add<K extends keyof T>(key: K, value: T[K], rewrite?: boolean): void;
21
- has(key: keyof T): boolean;
22
- get store(): T;
23
- static registerCtx<T extends Record<string, unknown>>(initialValue: T, ctxId: string): PubSub<T>;
24
- static deleteCtx(ctxId: string): void;
25
- static getCtx<T extends Record<string, unknown> = Record<string, unknown>>(ctxId: string): PubSub<T> | null;
26
- static hasCtx(ctxId: string): boolean;
27
- }
28
-
29
- type Constructor<T = unknown> = new (...args: any[]) => T;
30
-
31
- type SymbioteStateBag<T extends Record<string, unknown>> = T;
32
- /**
33
- * Interface for components using SymbioteMixin
34
- */
35
- declare class SymbioteComponent<TState extends Record<string, unknown> = Record<string, unknown>> {
36
- $: SymbioteStateBag<TState>;
37
- sub<TKey extends keyof TState>(key: TKey, callback: (value: TState[TKey]) => void, init?: boolean): () => void;
38
- pub<TKey extends keyof TState>(key: TKey, value: TState[TKey]): void;
39
- set$<T extends {
40
- [K in keyof T]: K extends keyof TState ? TState[K] : never;
41
- }>(obj: T): void;
42
- has<TKey extends keyof TState>(key: TKey): boolean;
43
- add<TKey extends keyof TState>(key: TKey, val: TState[TKey], rewrite?: boolean): void;
44
- add$<T extends {
45
- [K in keyof T]: K extends keyof TState ? TState[K] : never;
46
- }>(obj: T, rewrite?: boolean): void;
47
- initCallback(): void;
48
- ctxName: string;
49
- ctxOwner: boolean;
8
+ declare class A11y {
9
+ private _destroyKeyUX;
10
+ private readonly _scopedWindow;
11
+ constructor();
12
+ registerBlock(scope: Block): void;
13
+ destroy(): void;
50
14
  }
51
15
 
52
- declare const BaseComponent_base: typeof LitElement & Constructor<{
53
- willYield: boolean;
54
- yield(slot: string, defaultContent?: unknown): unknown;
55
- }> & Constructor<{
56
- getCssData(propName: string, silentCheck?: boolean): string | number | boolean | null | undefined;
57
- }> & Constructor<SymbioteComponent<Record<string, unknown>>> & Constructor<LitElement> & {
58
- reg(tagName: string): void;
59
- };
60
- declare class BaseComponent extends BaseComponent_base {
16
+ type LocaleChangeCallback = () => void;
17
+ declare class LocaleManager {
18
+ private _blockInstance;
19
+ private _localeName;
20
+ private _callbacks;
21
+ private _boundBlocks;
22
+ constructor(blockInstance: Block);
23
+ onLocaleChange(callback: LocaleChangeCallback): () => void;
24
+ bindL10n(block: Block, key: string, resolver: LocaleChangeCallback): void;
25
+ destroyL10nBindings(block: Block): void;
26
+ destroy(): void;
61
27
  }
62
28
 
63
- type Uid = string & {
64
- __uid: true;
65
- };
66
-
67
- declare class UID {
68
- static generateFastUid(): Uid;
69
- static generateRandomUUID(): string;
29
+ declare class Modal extends Block {
30
+ static styleAttrs: string[];
31
+ static StateConsumerScope: string;
32
+ private _mouseDownTarget;
33
+ handleModalOpen: ModalCb;
34
+ handleModalClose: ModalCb;
35
+ handleModalCloseAll: ModalCb;
36
+ constructor();
37
+ _handleBackdropClick: () => void;
38
+ _closeDialog: () => void;
39
+ _handleDialogClose: () => void;
40
+ _handleDialogMouseDown: (e: MouseEvent) => void;
41
+ _handleDialogMouseUp: (e: MouseEvent) => void;
42
+ show(): void;
43
+ hide(): void;
44
+ private _handleModalOpen;
45
+ private _handleModalClose;
46
+ private _handleModalCloseAll;
47
+ initCallback(): void;
48
+ destroyCallback(): void;
70
49
  }
71
50
 
72
- declare function defineComponents(blockExports: Record<string, any>): void;
73
-
74
- declare const UC_WINDOW_KEY = "UC";
75
- type IndexModule = Record<string, any>;
76
- declare global {
77
- interface Window {
78
- [UC_WINDOW_KEY]?: IndexModule;
79
- }
51
+ declare const ModalEvents: Readonly<{
52
+ readonly ADD: "modal:add";
53
+ readonly DELETE: "modal:delete";
54
+ readonly OPEN: "modal:open";
55
+ readonly CLOSE: "modal:close";
56
+ readonly CLOSE_ALL: "modal:closeAll";
57
+ readonly DESTROY: "modal:destroy";
58
+ }>;
59
+ type ModalId = ActivityType;
60
+ type ModalCb = (data: {
61
+ id: ModalId;
62
+ modal: Modal;
63
+ }) => void;
64
+ type ModalEventType = (typeof ModalEvents)[keyof typeof ModalEvents];
65
+ declare class ModalManager {
66
+ private _modals;
67
+ private _activeModals;
68
+ private _subscribers;
69
+ private _block;
70
+ constructor(block: Block);
71
+ private _debugPrint;
72
+ /**
73
+ * Register a modal with the manager
74
+ * @param id Unique identifier for the modal
75
+ * @param modal Modal component instance
76
+ */
77
+ registerModal(id: ModalId, modal: Modal): void;
78
+ /** Remove a modal by ID. */
79
+ deleteModal(id: ModalId): boolean;
80
+ /** Open a modal by its ID. */
81
+ open(id: ModalId): boolean;
82
+ /** Close a specific modal by ID. */
83
+ close(id: ModalId): boolean;
84
+ /** Toggle a modal - open if closed, close if open. */
85
+ toggle(id: ModalId): boolean;
86
+ /** True if there are any active modals. */
87
+ get hasActiveModals(): boolean;
88
+ /** Close the most recently opened modal and return to the previous one. */
89
+ back(): boolean;
90
+ /** Close all open modals. */
91
+ closeAll(): number;
92
+ /**
93
+ * Subscribe to modal events
94
+ * @returns Unsubscribe function
95
+ */
96
+ subscribe(event: ModalEventType, callback: ModalCb): () => void;
97
+ /** Unsubscribe from modal events */
98
+ unsubscribe(event: ModalEventType, callback: ModalCb | undefined): void;
99
+ /** Notify all subscribers of a modal event. */
100
+ private _notify;
101
+ /** Destroy the modal manager, clean up resources */
102
+ destroy(): void;
80
103
  }
81
- /**
82
- * @param url File Uploader pack url
83
- * @param [register] Register connected package, if it not registered yet
84
- */
85
- declare function loadFileUploaderFrom(url: string, register?: boolean): Promise<IndexModule | null>;
86
104
 
87
- type LocaleDefinition = Record<string, string>;
88
- type LocaleDefinitionResolver = () => Promise<LocaleDefinition>;
89
- declare const defineLocale: (localeName: string, definitionOrResolver: LocaleDefinition | LocaleDefinitionResolver) => void;
105
+ type CommonEventType = InternalEventKey | EventKey;
106
+ type TelemetryState = TelemetryRequest & {
107
+ eventTimestamp: number;
108
+ location: string;
109
+ };
110
+ type TelemetryEventBody = Partial<Pick<TelemetryState, 'payload' | 'config'>> & {
111
+ modalId?: string;
112
+ eventType?: CommonEventType;
113
+ };
114
+ declare class TelemetryManager {
115
+ private readonly _sessionId;
116
+ private readonly _telemetryInstance;
117
+ private readonly _block;
118
+ private _config;
119
+ private _initialized;
120
+ private _lastPayload;
121
+ private readonly _queue;
122
+ constructor(block: Block);
123
+ private _init;
124
+ private _setConfig;
125
+ private _formattingPayload;
126
+ private _excludedEvents;
127
+ sendEvent(body: TelemetryEventBody): void;
128
+ sendEventError(error: unknown, context?: string): void;
129
+ /**
130
+ * Method to send telemetry event for Cloud Image Editor.
131
+ */
132
+ sendEventCloudImageEditor(e: MouseEvent, tabId: string, options?: Record<string, unknown>): void;
133
+ /**
134
+ * Deeply compares two objects and returns true if they are equal, false otherwise.
135
+ */
136
+ private _checkObj;
137
+ private get _timestamp();
138
+ private get _solution();
139
+ private get _activity();
140
+ private get _location();
141
+ }
90
142
 
91
- declare class A11y {
92
- private _destroyKeyUX;
93
- private readonly _scopedWindow;
143
+ declare class Block extends BaseComponent<any> {
144
+ private __cfgProxy?;
145
+ protected l10nProcessorSubs: Map<string, Set<{
146
+ remove: () => void;
147
+ }>>;
148
+ static StateConsumerScope: string | null;
149
+ static styleAttrs: string[];
150
+ protected requireCtxName: boolean;
151
+ activityType: ActivityType;
152
+ init$: {};
153
+ l10n(str: string, variables?: Record<string, string | number>): string;
154
+ private pluralize;
155
+ protected bindL10n(key: string, resolver: () => void): void;
94
156
  constructor();
95
- registerBlock(scope: LitBlock): void;
96
- destroy(): void;
157
+ emit(type: Parameters<EventEmitter['emit']>[0], payload?: Parameters<EventEmitter['emit']>[1], options?: Parameters<EventEmitter['emit']>[2]): void;
158
+ hasBlockInCtx(callback: (block: Block) => boolean): boolean;
159
+ setOrAddState(prop: string, newVal: any): void;
160
+ connectedCallback(): void;
161
+ disconnectedCallback(): void;
162
+ initCallback(): void;
163
+ get testId(): string;
164
+ get modalManager(): ModalManager | undefined;
165
+ get telemetryManager(): TelemetryManager | {
166
+ sendEvent: () => void;
167
+ sendEventCloudImageEditor: () => void;
168
+ sendEventError: () => void;
169
+ };
170
+ protected get localeManager(): LocaleManager | null;
171
+ protected get a11y(): A11y | null;
172
+ protected get blocksRegistry(): Set<Block>;
173
+ destroyCallback(): void;
174
+ /**
175
+ * Called when the last block is removed from the context. Note that inheritors must run their callback before that.
176
+ */
177
+ protected destroyCtxCallback(): void;
178
+ protected proxyUrl(url: string): Promise<string>;
179
+ get cfg(): ConfigType;
180
+ subConfigValue<T extends keyof ConfigType>(key: T, callback: (value: ConfigType[T]) => void): void;
181
+ debugPrint(...args: unknown[]): void;
182
+ static reg(name?: string): void;
97
183
  }
98
184
 
99
- declare class LocaleManager {
100
- private _blockInstance;
101
- private _localeName;
102
- constructor(blockInstance: LitBlock);
185
+ declare const InternalEventType: Readonly<{
186
+ readonly INIT_SOLUTION: "init-solution";
187
+ readonly CHANGE_CONFIG: "change-config";
188
+ readonly ACTION_EVENT: "action-event";
189
+ readonly ERROR_EVENT: "error-event";
190
+ }>;
191
+ declare const EventType: Readonly<{
192
+ readonly FILE_ADDED: "file-added";
193
+ readonly FILE_REMOVED: "file-removed";
194
+ readonly FILE_UPLOAD_START: "file-upload-start";
195
+ readonly FILE_UPLOAD_PROGRESS: "file-upload-progress";
196
+ readonly FILE_UPLOAD_SUCCESS: "file-upload-success";
197
+ readonly FILE_UPLOAD_FAILED: "file-upload-failed";
198
+ readonly FILE_URL_CHANGED: "file-url-changed";
199
+ readonly MODAL_OPEN: "modal-open";
200
+ readonly MODAL_CLOSE: "modal-close";
201
+ readonly DONE_CLICK: "done-click";
202
+ readonly UPLOAD_CLICK: "upload-click";
203
+ readonly ACTIVITY_CHANGE: "activity-change";
204
+ readonly COMMON_UPLOAD_START: "common-upload-start";
205
+ readonly COMMON_UPLOAD_PROGRESS: "common-upload-progress";
206
+ readonly COMMON_UPLOAD_SUCCESS: "common-upload-success";
207
+ readonly COMMON_UPLOAD_FAILED: "common-upload-failed";
208
+ readonly CHANGE: "change";
209
+ readonly GROUP_CREATED: "group-created";
210
+ }>;
211
+ type EventKey = (typeof EventType)[keyof typeof EventType];
212
+ type InternalEventKey = (typeof InternalEventType)[keyof typeof InternalEventType];
213
+ type EventPayload = {
214
+ [EventType.FILE_ADDED]: OutputFileEntry<'idle'>;
215
+ [EventType.FILE_REMOVED]: OutputFileEntry<'removed'>;
216
+ [EventType.FILE_UPLOAD_START]: OutputFileEntry<'uploading'>;
217
+ [EventType.FILE_UPLOAD_PROGRESS]: OutputFileEntry<'uploading'>;
218
+ [EventType.FILE_UPLOAD_SUCCESS]: OutputFileEntry<'success'>;
219
+ [EventType.FILE_UPLOAD_FAILED]: OutputFileEntry<'failed'>;
220
+ [EventType.FILE_URL_CHANGED]: OutputFileEntry<'success'>;
221
+ [EventType.MODAL_OPEN]: {
222
+ modalId: ModalId;
223
+ };
224
+ [EventType.MODAL_CLOSE]: {
225
+ modalId: ModalId;
226
+ hasActiveModals: boolean;
227
+ };
228
+ [EventType.ACTIVITY_CHANGE]: {
229
+ activity: ActivityType;
230
+ };
231
+ [EventType.UPLOAD_CLICK]: void;
232
+ [EventType.DONE_CLICK]: OutputCollectionState;
233
+ [EventType.COMMON_UPLOAD_START]: OutputCollectionState<'uploading'>;
234
+ [EventType.COMMON_UPLOAD_PROGRESS]: OutputCollectionState<'uploading'>;
235
+ [EventType.COMMON_UPLOAD_SUCCESS]: OutputCollectionState<'success'>;
236
+ [EventType.COMMON_UPLOAD_FAILED]: OutputCollectionState<'failed'>;
237
+ [EventType.CHANGE]: OutputCollectionState;
238
+ [EventType.GROUP_CREATED]: OutputCollectionState<'success', 'has-group'>;
239
+ };
240
+ declare class EventEmitter {
241
+ private _timeoutStore;
242
+ private _targets;
243
+ private _debugPrint;
244
+ constructor(debugPrint: (...args: unknown[]) => void);
245
+ bindTarget(target: Block): void;
246
+ unbindTarget(target: Block): void;
247
+ private _dispatch;
248
+ emit<T extends EventKey, TDebounce extends boolean | number | undefined = undefined>(type: T, payload?: TDebounce extends false | undefined ? EventPayload[T] : () => EventPayload[T], options?: {
249
+ debounce?: TDebounce;
250
+ }): void;
103
251
  }
104
252
 
105
253
  type EventMap = {
106
254
  [T in keyof EventPayload]: CustomEvent<EventPayload[T]>;
107
255
  };
108
256
 
109
- declare function buildOutputCollectionState<TCollectionStatus extends OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'>(uploaderBlock: LitUploaderBlock): OutputCollectionState<TCollectionStatus, TGroupFlag>;
110
-
111
- declare class TypedData<T extends Record<string, unknown>> {
112
- private _ctxId;
113
- private _data;
114
- constructor(initialValue: T);
115
- get uid(): Uid;
116
- setValue<K extends keyof T>(prop: K, value: T[K]): void;
117
- setMultipleValues(updObj: Partial<T>): void;
118
- getValue<K extends keyof T>(prop: K): T[K];
119
- subscribe<K extends keyof T>(prop: K, handler: (newVal: T[K]) => void): Subscription;
120
- destroy(): void;
121
- }
257
+ type LocaleDefinition = Record<string, string>;
258
+ type LocaleDefinitionResolver = () => Promise<LocaleDefinition>;
259
+ declare const defineLocale: (localeName: string, definitionOrResolver: LocaleDefinition | LocaleDefinitionResolver) => void;
122
260
 
123
- interface UploadEntryData extends Record<string, unknown> {
124
- file: File | null;
125
- externalUrl: string | null;
126
- fileName: string | null;
127
- fileSize: number | null;
128
- lastModified: number;
129
- uploadProgress: number;
130
- uuid: string | null;
131
- isImage: boolean;
132
- mimeType: string | null;
133
- ctxName: string | null;
134
- cdnUrl: string | null;
135
- cdnUrlModifiers: string | null;
136
- fileInfo: UploadcareFile | null;
137
- isUploading: boolean;
138
- abortController: AbortController | null;
139
- thumbUrl: string | null;
140
- silent: boolean;
141
- source: string | null;
142
- fullPath: string | null;
143
- metadata: Metadata | null;
144
- errors: OutputErrorFile[];
145
- uploadError: Error | null;
146
- isRemoved: boolean;
147
- isQueuedForUploading: boolean;
148
- isValidationPending: boolean;
149
- isQueuedForValidation: boolean;
261
+ declare function buildOutputCollectionState<TCollectionStatus extends OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'>(uploaderBlock: UploaderBlock): OutputCollectionState<TCollectionStatus, TGroupFlag>;
262
+
263
+ type TypedSchema = Record<string, {
264
+ type: unknown;
265
+ value: unknown;
266
+ nullable?: boolean;
267
+ }>;
268
+ type Constructor<T = any> = new (...args: any[]) => T;
269
+ type ExtractType<T, V> = T extends StringConstructor ? string : T extends BooleanConstructor ? boolean : T extends NumberConstructor ? number : T extends ArrayConstructor ? V : T extends Constructor ? InstanceType<T> : T;
270
+ type ExtractDataFromSchema<T extends TypedSchema> = {
271
+ [K in keyof T]: ExtractType<T[K]['type'], T[K]['value']> | (T[K]['nullable'] extends true ? null : never);
272
+ };
273
+ type ExtractKeysFromSchema<T extends TypedSchema> = Extract<keyof T, string>;
274
+ declare class TypedData<T extends TypedSchema> {
275
+ private __typedSchema;
276
+ private __ctxId;
277
+ private __schema;
278
+ private __data;
279
+ constructor(typedSchema: T, ctxName?: string);
280
+ get uid(): string;
281
+ setValue<K extends ExtractKeysFromSchema<T>>(prop: K, value: ExtractDataFromSchema<T>[K]): void;
282
+ setMultipleValues(updObj: Partial<ExtractDataFromSchema<T>>): void;
283
+ getValue<K extends ExtractKeysFromSchema<T>>(prop: K): ExtractDataFromSchema<T>[K];
284
+ subscribe<K extends ExtractKeysFromSchema<T>>(prop: K, handler: (newVal: ExtractDataFromSchema<T>[K]) => void): {
285
+ remove: () => void;
286
+ callback: Function;
287
+ };
288
+ remove(): void;
150
289
  }
151
- type UploadEntryTypedData = TypedData<UploadEntryData>;
152
- type UploadEntryKeys = keyof UploadEntryData;
290
+
291
+ declare const uploadEntrySchema: Readonly<{
292
+ file: Readonly<{
293
+ type: {
294
+ new (fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;
295
+ prototype: File;
296
+ };
297
+ value: null;
298
+ nullable: true;
299
+ }>;
300
+ externalUrl: Readonly<{
301
+ type: StringConstructor;
302
+ value: null;
303
+ nullable: true;
304
+ }>;
305
+ fileName: Readonly<{
306
+ type: StringConstructor;
307
+ value: null;
308
+ nullable: true;
309
+ }>;
310
+ fileSize: Readonly<{
311
+ type: NumberConstructor;
312
+ value: null;
313
+ nullable: true;
314
+ }>;
315
+ lastModified: Readonly<{
316
+ type: NumberConstructor;
317
+ value: number;
318
+ }>;
319
+ uploadProgress: Readonly<{
320
+ type: NumberConstructor;
321
+ value: 0;
322
+ }>;
323
+ uuid: Readonly<{
324
+ type: StringConstructor;
325
+ value: null;
326
+ nullable: true;
327
+ }>;
328
+ isImage: Readonly<{
329
+ type: BooleanConstructor;
330
+ value: false;
331
+ }>;
332
+ mimeType: Readonly<{
333
+ type: StringConstructor;
334
+ value: null;
335
+ nullable: true;
336
+ }>;
337
+ ctxName: Readonly<{
338
+ type: StringConstructor;
339
+ value: null;
340
+ nullable: true;
341
+ }>;
342
+ cdnUrl: Readonly<{
343
+ type: StringConstructor;
344
+ value: null;
345
+ nullable: true;
346
+ }>;
347
+ cdnUrlModifiers: Readonly<{
348
+ type: StringConstructor;
349
+ value: null;
350
+ nullable: true;
351
+ }>;
352
+ fileInfo: Readonly<{
353
+ type: typeof UploadcareFile;
354
+ value: null;
355
+ nullable: true;
356
+ }>;
357
+ isUploading: Readonly<{
358
+ type: BooleanConstructor;
359
+ value: false;
360
+ }>;
361
+ abortController: Readonly<{
362
+ type: {
363
+ new (): AbortController;
364
+ prototype: AbortController;
365
+ };
366
+ value: null;
367
+ nullable: true;
368
+ }>;
369
+ thumbUrl: Readonly<{
370
+ type: StringConstructor;
371
+ value: null;
372
+ nullable: true;
373
+ }>;
374
+ silent: Readonly<{
375
+ type: BooleanConstructor;
376
+ value: false;
377
+ }>;
378
+ source: Readonly<{
379
+ type: StringConstructor;
380
+ value: null;
381
+ nullable: true;
382
+ }>;
383
+ fullPath: Readonly<{
384
+ type: StringConstructor;
385
+ value: null;
386
+ nullable: true;
387
+ }>;
388
+ metadata: Readonly<{
389
+ type: ObjectConstructor;
390
+ value: null;
391
+ nullable: true;
392
+ }>;
393
+ errors: Readonly<{
394
+ type: ArrayConstructor;
395
+ value: OutputErrorFile[];
396
+ }>;
397
+ uploadError: Readonly<{
398
+ type: ErrorConstructor;
399
+ value: null;
400
+ nullable: true;
401
+ }>;
402
+ isRemoved: Readonly<{
403
+ type: BooleanConstructor;
404
+ value: false;
405
+ }>;
406
+ isQueuedForUploading: Readonly<{
407
+ type: BooleanConstructor;
408
+ value: false;
409
+ }>;
410
+ isValidationPending: Readonly<{
411
+ type: BooleanConstructor;
412
+ value: false;
413
+ }>;
414
+ isQueuedForValidation: Readonly<{
415
+ type: BooleanConstructor;
416
+ value: false;
417
+ }>;
418
+ }>;
419
+ type UploadEntryData = ExtractDataFromSchema<typeof uploadEntrySchema>;
420
+ type UploadEntryTypedData = TypedData<typeof uploadEntrySchema>;
421
+ type UploadEntryKeys = ExtractKeysFromSchema<typeof uploadEntrySchema>;
153
422
 
154
423
  type FuncFileValidator = (outputEntry: OutputFileEntry, api: UploaderPublicApi, options?: {
155
424
  signal?: AbortSignal;
@@ -168,10 +437,10 @@ declare class ValidationManager {
168
437
  private _queue;
169
438
  private _runQueueDebounced;
170
439
  private _entryValidationState;
171
- constructor(blockInstance: LitUploaderBlock);
172
- runFileValidators(runOn: FileValidatorDescriptor['runOn'], entryIds?: Uid[]): void;
440
+ constructor(blockInstance: UploaderBlock);
441
+ runFileValidators(runOn: FileValidatorDescriptor['runOn'], entryIds?: string[]): void;
173
442
  runCollectionValidators(): void;
174
- cleanupValidationForEntry(entry: TypedData<UploadEntryData>): void;
443
+ cleanupValidationForEntry(entry: TypedData<typeof uploadEntrySchema>): void;
175
444
  private _runFileValidatorsForEntry;
176
445
  private _addCustomTypeToValidationError;
177
446
  private _getEntryValidationState;
@@ -180,7 +449,8 @@ declare class ValidationManager {
180
449
  }
181
450
 
182
451
  type CameraMode = 'photo' | 'video';
183
- declare class CameraSource extends LitUploaderBlock {
452
+ type CameraStatus = 'shot' | 'retake' | 'accept' | 'play' | 'stop' | 'pause' | 'resume';
453
+ declare class CameraSource extends UploaderBlock {
184
454
  couldBeCtxOwner: boolean;
185
455
  activityType: "camera";
186
456
  private _unsubPermissions;
@@ -197,101 +467,52 @@ declare class CameraSource extends LitUploaderBlock {
197
467
  private _cameraDevices;
198
468
  private _audioDevices;
199
469
  private _permissionResponses;
200
- private _permissionCleanupFns;
201
- private _currentVideoSource;
202
- private readonly _handlePreviewPlay;
203
- private readonly _handlePreviewPause;
204
- private _timerRef;
205
- private _lineRef;
206
- private _videoRef;
207
- private _switcherRef;
208
- private _startTime;
209
- private _elapsedTime;
210
- private _videoTransformCss;
211
- private _videoHidden;
212
- private _messageHidden;
213
- private _requestBtnHidden;
214
- private _cameraSelectOptions;
215
- private _cameraSelectHidden;
216
- private _l10nMessage;
217
- private _timerHidden;
218
- private _cameraHidden;
219
- private _cameraActionsHidden;
220
- private _audioSelectOptions;
221
- private _audioSelectHidden;
222
- private _audioSelectDisabled;
223
- private _audioToggleMicrophoneHidden;
224
- private _tabCameraHidden;
225
- private _tabVideoHidden;
226
- private _currentIcon;
227
- private _currentTimelineIcon;
228
- private _toggleMicrophoneIcon;
229
- private _mutableClassButton;
230
- private _chooseActionWithCamera;
231
- private _handleCameraSelectChange;
232
- private _handleAudioSelectChange;
233
- private _handleRequestPermissions;
234
- private _handleStartCamera;
235
- private _handleToggleRecording;
236
- private _handleToggleAudio;
237
- private _handleRetake;
238
- private _handleAccept;
239
- private _handleClickTab;
240
- private _updateTimer;
241
- private _startTimer;
242
- private _stopTimer;
243
- private _startTimeline;
244
- private _stopTimeline;
245
- private _animationFrameId;
246
- private _startRecording;
470
+ constructor();
471
+ _chooseActionWithCamera: () => void;
472
+ _updateTimer: () => void;
473
+ _startTimer: () => void;
474
+ _stopTimer: () => void;
475
+ _startTimeline: () => void;
476
+ _stopTimeline: () => void;
477
+ _animationFrameId: number | null;
478
+ _startRecording: () => void;
247
479
  private _stopRecording;
248
480
  /** This method is used to toggle recording pause/resume */
249
- private _toggleRecording;
250
- private _toggleEnableAudio;
481
+ _toggleRecording: () => void;
482
+ _toggleEnableAudio: () => void;
251
483
  /**
252
484
  * Previewing the video that was recorded on the camera
253
485
  */
254
486
  private _previewVideo;
255
- private _attachPreviewListeners;
256
- private _detachPreviewListeners;
257
- private _setVideoSource;
258
- /**
259
- * Do not bind srcObject directly in the template, because it stops video pausing on shot.
260
- * I really don'y know why but that's how it is. Assigning srcObject manually fixes the issue.
261
- */
262
- private _applyVideoSource;
263
- private _retake;
264
- private _accept;
265
- private _handlePhoto;
266
- private _handleVideo;
487
+ _retake: () => void;
488
+ _accept: () => void;
489
+ _handlePhoto: (status: CameraStatus) => void;
490
+ _handleVideo: (status: CameraStatus) => void;
267
491
  private _setCameraState;
268
492
  private _shot;
269
493
  private _handleActiveTab;
270
494
  private _createFile;
271
- private _guessExtensionByMime;
495
+ _guessExtensionByMime(mime: string | undefined): string;
272
496
  /**
273
497
  * The send file to the server
274
498
  */
275
- private _toSend;
499
+ _toSend: (file: File) => void;
276
500
  private get _cameraModes();
277
501
  private _setPermissionsState;
278
- private _makeStreamInactive;
279
- private _stopCapture;
280
- private _capture;
281
- private _handlePermissionsChange;
282
- private _permissionAccess;
283
- private _teardownPermissionListeners;
284
- private _requestDeviceAccess;
285
- private _getDevices;
286
- private _onActivate;
287
- private _onDeactivate;
288
- private _handleCameraModes;
502
+ _makeStreamInactive: () => boolean;
503
+ _stopCapture: () => void;
504
+ _capture: () => Promise<void>;
505
+ _handlePermissionsChange: () => void;
506
+ _permissionAccess: () => Promise<void>;
507
+ _getPermission: () => void;
508
+ _requestDeviceAccess: () => Promise<void>;
509
+ _getDevices: () => Promise<void>;
510
+ _onActivate: () => Promise<void>;
511
+ _onDeactivate: () => Promise<void>;
512
+ _handleCameraModes: (cameraModes: CameraMode[]) => void;
289
513
  initCallback(): void;
290
- firstUpdated(changedProperties: PropertyValues<this>): void;
291
- updated(changedProperties: PropertyValues<this>): void;
292
- private _destroy;
293
- disconnectedCallback(): void;
294
- render(): lit_html.TemplateResult<1>;
514
+ _destroy(): void;
515
+ destroyCallback(): Promise<void>;
295
516
  }
296
517
 
297
518
  /**
@@ -300,49 +521,33 @@ declare class CameraSource extends LitUploaderBlock {
300
521
  declare const complexConfigKeys: readonly ["metadata", "localeDefinitionOverride", "secureUploadsSignatureResolver", "secureDeliveryProxyUrlResolver", "iconHrefResolver", "fileValidators", "collectionValidators", "mediaRecorderOptions"];
301
522
  /** Mapping of attribute names to state */
302
523
  declare const attrStateMapping: Record<string, string>;
303
- declare class Config extends LitBlock {
304
- attributesMeta: Partial<ConfigPlainType> & {
305
- 'ctx-name': string;
306
- };
307
- init$: LitBlock["init$"] & ConfigType;
308
- private _computationControllers;
524
+ declare class Config extends Block {
525
+ requireCtxName: boolean;
526
+ constructor();
309
527
  private _flushValueToAttribute;
310
528
  private _flushValueToState;
311
529
  private _setValue;
312
530
  private _getValue;
313
- private _assertSameValueDifferentReference;
531
+ _assertSameValueDifferentReference(key: string, previousValue: unknown, nextValue: unknown): void;
314
532
  initCallback(): void;
315
533
  attributeChangedCallback(name: keyof typeof attrStateMapping, oldVal: string, newVal: string): void;
316
- static get observedAttributes(): string[];
534
+ get computationControllers(): any;
317
535
  }
318
536
  interface Config extends ConfigType {
319
537
  }
320
538
 
321
539
  type FilesViewMode = 'grid' | 'list';
322
- declare class UploadList extends LitUploaderBlock {
540
+ declare class UploadList extends UploaderBlock {
323
541
  couldBeCtxOwner: boolean;
324
- protected historyTracked: boolean;
542
+ historyTracked: boolean;
325
543
  activityType: "upload-list";
326
- private _doneBtnVisible;
327
- private _doneBtnEnabled;
328
- private _uploadBtnVisible;
329
- private _addMoreBtnVisible;
330
- private _addMoreBtnEnabled;
331
- private _commonErrorMessage;
332
- private _hasFiles;
333
- private _latestSummary;
334
- private get _headerText();
335
- private _handleAdd;
336
- private _handleUpload;
337
- private _handleDone;
338
- private _handleCancel;
544
+ constructor();
339
545
  private _throttledHandleCollectionUpdate;
340
546
  private _updateUploadsState;
341
547
  private _getHeaderText;
342
548
  get couldOpenActivity(): boolean;
343
549
  initCallback(): void;
344
- disconnectedCallback(): void;
345
- render(): lit_html.TemplateResult<1>;
550
+ destroyCallback(): void;
346
551
  }
347
552
 
348
553
  declare const ExternalUploadSource: Readonly<{
@@ -380,51 +585,6 @@ declare const UploadSource: Readonly<{
380
585
  }>;
381
586
  type SourceTypes = (typeof UploadSource)[keyof typeof UploadSource];
382
587
 
383
- type ChangeMap<T extends Record<string, unknown>> = Record<keyof T, Set<Uid>>;
384
- type TypedCollectionPropertyObserver<T extends Record<string, unknown>> = (changeMap: ChangeMap<T>) => void;
385
- type TypedCollectionObserverHandler<T extends Record<string, unknown>> = (list: Uid[], added: Set<TypedData<T>>, removed: Set<TypedData<T>>) => void;
386
- type TypedCollectionOptions<T extends Record<string, unknown>> = {
387
- initialValue: T;
388
- watchList?: (keyof T)[];
389
- handler?: TypedCollectionObserverHandler<T>;
390
- };
391
- declare class TypedCollection<T extends Record<string, unknown>> {
392
- private static readonly _destroyDelayMs;
393
- private _ctxId;
394
- private _data;
395
- private _watchList;
396
- private _subsMap;
397
- private _propertyObservers;
398
- private _collectionObservers;
399
- private _items;
400
- private _removed;
401
- private _added;
402
- private _markedToDestroy;
403
- private _observeTimeout?;
404
- private _notifyTimeout?;
405
- private _destroyTimeout?;
406
- private _notifyObservers;
407
- private _initialValue;
408
- constructor(options: TypedCollectionOptions<T>);
409
- private _notify;
410
- private _scheduleDestroyMarkedItems;
411
- observeCollection(handler: TypedCollectionObserverHandler<T>): () => void;
412
- unobserveCollection(handler: TypedCollectionObserverHandler<T>): void;
413
- add(init: Partial<T>): Uid;
414
- hasItem(id: Uid): boolean;
415
- read(id: Uid): TypedData<T> | null;
416
- readProp<K extends keyof T>(id: Uid, propName: K): T[K];
417
- publishProp<K extends keyof T>(id: Uid, propName: K, value: T[K]): void;
418
- remove(id: Uid): void;
419
- clearAll(): void;
420
- observeProperties(handler: TypedCollectionPropertyObserver<T>): () => void;
421
- unobserveProperties(handler: TypedCollectionPropertyObserver<T>): void;
422
- findItems(checkFn: (item: TypedData<T>) => boolean): Uid[];
423
- items(): Uid[];
424
- get size(): number;
425
- destroy(): void;
426
- }
427
-
428
588
  declare const CameraSourceTypes: Readonly<{
429
589
  PHOTO: "photo";
430
590
  VIDEO: "video";
@@ -438,8 +598,8 @@ type ApiAddFileCommonOptions = {
438
598
  };
439
599
  declare class UploaderPublicApi {
440
600
  private _ctx;
441
- constructor(ctx: LitUploaderBlock);
442
- get _uploadCollection(): TypedCollection<UploadEntryData>;
601
+ constructor(ctx: UploaderBlock);
602
+ private get _uploadCollection();
443
603
  get cfg(): ConfigType;
444
604
  get l10n(): (str: string, variables?: Record<string, string | number>) => string;
445
605
  /**
@@ -462,7 +622,7 @@ declare class UploaderPublicApi {
462
622
  getOutputCollectionState<TStatus extends OutputCollectionStatus>(): ReturnType<typeof buildOutputCollectionState<TStatus>>;
463
623
  initFlow: (force?: boolean) => void;
464
624
  doneFlow: () => void;
465
- setCurrentActivity: <T extends RegisteredActivityType>(activityType: T, ...params: T extends keyof ActivityParamsMap ? [ActivityParamsMap[T]] : T extends RegisteredActivityType ? [undefined?] : [never]) => void;
625
+ setCurrentActivity: <T extends ActivityType>(activityType: T, ...[params]: T extends keyof ActivityParamsMap ? [ActivityParamsMap[T]] : T extends RegisteredActivityType ? [undefined?] : [unknown?]) => void;
466
626
  getCurrentActivity: () => ActivityType;
467
627
  setModalState: (opened: boolean) => void;
468
628
  private get _sourceList();
@@ -784,9 +944,7 @@ type OutputErrorTypePayload = {
784
944
  NOT_AN_IMAGE: OutputFileErrorPayload;
785
945
  FORBIDDEN_FILE_TYPE: OutputFileErrorPayload;
786
946
  FILE_SIZE_EXCEEDED: OutputFileErrorPayload;
787
- SOME_FILES_HAS_ERRORS: {
788
- [k: string]: never;
789
- };
947
+ SOME_FILES_HAS_ERRORS: {};
790
948
  TOO_MANY_FILES: {
791
949
  min: number;
792
950
  max: number;
@@ -939,16 +1097,57 @@ type OutputCollectionState<TStatus extends OutputCollectionStatus = OutputCollec
939
1097
  declare class SecureUploadsManager {
940
1098
  private readonly _block;
941
1099
  private _secureToken;
942
- constructor(block: LitUploaderBlock);
1100
+ constructor(block: UploaderBlock);
943
1101
  private _debugPrint;
944
1102
  getSecureToken(): Promise<SecureUploadsSignatureAndExpire | null>;
945
1103
  }
946
1104
 
947
- declare class LitUploaderBlock extends LitActivityBlock {
1105
+ type ChangeMap<T extends TypedSchema> = Record<keyof T, Set<string>>;
1106
+ type TypedCollectionPropertyObserver<T extends TypedSchema> = (changeMap: ChangeMap<T>) => void;
1107
+ type TypedCollectionObserverHandler<T extends TypedSchema> = (list: string[], added: Set<TypedData<T>>, removed: Set<TypedData<T>>) => void;
1108
+ type TypedCollectionOptions<T extends TypedSchema> = {
1109
+ typedSchema: T;
1110
+ watchList?: ExtractKeysFromSchema<T>[];
1111
+ handler?: TypedCollectionObserverHandler<T>;
1112
+ ctxName?: string;
1113
+ };
1114
+ declare class TypedCollection<T extends TypedSchema> {
1115
+ private __typedSchema;
1116
+ private __ctxId;
1117
+ private __data;
1118
+ private __watchList;
1119
+ private __subsMap;
1120
+ private __propertyObservers;
1121
+ private __collectionObservers;
1122
+ private __items;
1123
+ private __removed;
1124
+ private __added;
1125
+ private __observeTimeout?;
1126
+ private __notifyTimeout?;
1127
+ private __notifyObservers;
1128
+ constructor(options: TypedCollectionOptions<T>);
1129
+ notify(): void;
1130
+ observeCollection(handler: TypedCollectionObserverHandler<T>): () => void;
1131
+ unobserveCollection(handler: TypedCollectionObserverHandler<T>): void;
1132
+ add(init: Partial<ExtractDataFromSchema<T>>): string;
1133
+ read(id: string): TypedData<T> | null;
1134
+ readProp<K extends ExtractKeysFromSchema<T>>(id: string, propName: K): ExtractDataFromSchema<T>[K] | null;
1135
+ publishProp<K extends ExtractKeysFromSchema<T>>(id: string, propName: K, value: ExtractDataFromSchema<T>[K]): void;
1136
+ remove(id: string): void;
1137
+ clearAll(): void;
1138
+ observeProperties(handler: TypedCollectionPropertyObserver<T>): () => void;
1139
+ unobserveProperties(handler: TypedCollectionPropertyObserver<T>): void;
1140
+ findItems(checkFn: (item: TypedData<T>) => boolean): string[];
1141
+ items(): string[];
1142
+ get size(): number;
1143
+ destroy(): void;
1144
+ }
1145
+
1146
+ declare class UploaderBlock extends ActivityBlock {
948
1147
  static extSrcList: Readonly<typeof ExternalUploadSource>;
949
1148
  static sourceTypes: Readonly<typeof UploadSource>;
950
1149
  protected couldBeCtxOwner: boolean;
951
- private _isCtxOwner;
1150
+ private isCtxOwner;
952
1151
  private _unobserveCollection?;
953
1152
  private _unobserveCollectionProperties?;
954
1153
  init$: {
@@ -959,21 +1158,23 @@ declare class LitUploaderBlock extends LitActivityBlock {
959
1158
  '*collectionState': OutputCollectionState | null;
960
1159
  '*groupInfo': _uploadcare_upload_client.UploadcareGroup | null;
961
1160
  '*uploadTrigger': Set<string>;
1161
+ '*secureUploadsManager': SecureUploadsManager | null;
962
1162
  '*currentActivity': null;
963
1163
  '*currentActivityParams': {};
964
1164
  '*history': never[];
965
1165
  '*historyBack': null;
966
1166
  '*closeModal': () => void;
967
1167
  };
968
- private get _hasCtxOwner();
1168
+ private get hasCtxOwner();
969
1169
  initCallback(): void;
970
1170
  protected get validationManager(): ValidationManager;
971
1171
  get api(): UploaderPublicApi;
972
1172
  getAPI(): UploaderPublicApi;
973
- get uploadCollection(): TypedCollection<UploadEntryData>;
974
- get secureUploadsManager(): SecureUploadsManager;
1173
+ get uploadCollection(): TypedCollection<typeof uploadEntrySchema>;
1174
+ destroyCtxCallback(): void;
975
1175
  disconnectedCallback(): void;
976
1176
  connectedCallback(): void;
1177
+ destroyCallback(): void;
977
1178
  private _initCtxOwner;
978
1179
  private _observeUploadCollection;
979
1180
  private _unobserveUploadCollection;
@@ -982,17 +1183,13 @@ declare class LitUploaderBlock extends LitActivityBlock {
982
1183
  private _handleCollectionUpdate;
983
1184
  private _handleCollectionPropertiesUpdate;
984
1185
  private _flushCommonUploadProgress;
985
- private _openCloudImageEditor;
986
- private _setInitialCrop;
1186
+ openCloudImageEditor(): void;
1187
+ private setInitialCrop;
987
1188
  protected getMetadataFor(entryId: string): Promise<_uploadcare_upload_client.Metadata | undefined>;
988
1189
  protected getUploadClientOptions(): Promise<FileFromOptions>;
989
1190
  getOutputData(): OutputFileEntry[];
990
1191
  }
991
1192
 
992
- /**
993
- * Mapping of loading resources per operation
994
- */
995
- type LoadingOperations = Map<string, Map<string, boolean>>;
996
1193
  /**
997
1194
  * Image size
998
1195
  */
@@ -1027,7 +1224,6 @@ interface ApplyResult {
1027
1224
  cdnUrl: string;
1028
1225
  transformations: Transformations;
1029
1226
  }
1030
- type ChangeResult = ApplyResult;
1031
1227
  interface CropAspectRatio {
1032
1228
  type: 'aspect-ratio';
1033
1229
  width: number;
@@ -1035,66 +1231,44 @@ interface CropAspectRatio {
1035
1231
  id: string;
1036
1232
  hasFreeform?: boolean;
1037
1233
  }
1038
- type CropPresetList = CropAspectRatio[];
1039
1234
 
1040
1235
  type ActivityParams$1 = {
1041
1236
  internalId: string;
1042
1237
  };
1043
- declare class CloudImageEditorActivity extends LitUploaderBlock {
1238
+ declare class CloudImageEditorActivity extends UploaderBlock {
1044
1239
  couldBeCtxOwner: boolean;
1045
1240
  activityType: "cloud-image-edit";
1046
1241
  private _entry?;
1047
- private _editorConfig;
1242
+ private _instance?;
1048
1243
  get activityParams(): ActivityParams$1;
1049
1244
  initCallback(): void;
1050
- private _handleApply;
1051
- private _handleCancel;
1052
- handleChange(event: CustomEvent<ChangeResult>): void;
1053
- private _mountEditor;
1054
- private _unmountEditor;
1055
- render(): lit_html.TemplateResult<1> | typeof nothing;
1056
- private _createEditorConfig;
1245
+ handleApply(e: CustomEvent<ApplyResult>): void;
1246
+ handleCancel(): void;
1247
+ mountEditor(): void;
1248
+ unmountEditor(): void;
1057
1249
  }
1058
1250
 
1059
1251
  type ActivityParams = {
1060
1252
  externalSourceType: string;
1061
1253
  };
1062
- declare class ExternalSource extends LitUploaderBlock {
1254
+ declare class ExternalSource extends UploaderBlock {
1063
1255
  couldBeCtxOwner: boolean;
1064
1256
  activityType: "external";
1065
1257
  private _messageBridge?;
1066
- private _iframeRef;
1067
- private _latestSelectionSummary;
1068
- private _selectedList;
1069
- private _isSelectionReady;
1070
- private _isDoneBtnEnabled;
1071
- private _couldSelectAll;
1072
- private _couldDeselectAll;
1073
- private _showSelectionStatus;
1074
- private _showDoneBtn;
1075
- private _doneBtnTextClass;
1076
- private _toolbarVisible;
1077
- private get _counterText();
1258
+ constructor();
1078
1259
  get activityParams(): ActivityParams;
1079
1260
  initCallback(): void;
1080
- private _extractUrlFromSelectedFile;
1081
- private _handleToolbarStateChange;
1082
- private _handleSelectedFilesChange;
1083
- private _handleIframeLoad;
1084
- private _applyTheme;
1085
- private _applyEmbedCss;
1086
- private _setupL10n;
1087
- private _remoteUrl;
1088
- private _handleDone;
1089
- private _handleCancel;
1090
- private _handleSelectAll;
1091
- private _handleDeselectAll;
1092
- private _setSelectionSummary;
1093
- private _mountIframe;
1094
- private _unmountIframe;
1095
- private _resetSelectionStatus;
1096
- disconnectedCallback(): void;
1097
- render(): lit_html.TemplateResult<1>;
1261
+ private extractUrlFromSelectedFile;
1262
+ private handleToolbarStateChange;
1263
+ private handleSelectedFilesChange;
1264
+ private handleIframeLoad;
1265
+ private applyTheme;
1266
+ private applyEmbedCss;
1267
+ private setupL10n;
1268
+ private remoteUrl;
1269
+ private mountIframe;
1270
+ private unmountIframe;
1271
+ private resetSelectionStatus;
1098
1272
  }
1099
1273
 
1100
1274
  declare const ACTIVE_PROP = "___ACTIVITY_IS_ACTIVE___";
@@ -1102,7 +1276,7 @@ type ActivityParamsMap = {
1102
1276
  'cloud-image-edit': ActivityParams$1;
1103
1277
  external: ActivityParams;
1104
1278
  };
1105
- declare class LitActivityBlock extends LitBlock {
1279
+ declare class ActivityBlock extends Block {
1106
1280
  protected historyTracked: boolean;
1107
1281
  private [ACTIVE_PROP]?;
1108
1282
  init$: {
@@ -1112,7 +1286,9 @@ declare class LitActivityBlock extends LitBlock {
1112
1286
  '*historyBack': null;
1113
1287
  '*closeModal': () => void;
1114
1288
  };
1115
- private _debouncedHistoryFlush;
1289
+ _debouncedHistoryFlush: (() => void) & {
1290
+ cancel: () => void;
1291
+ };
1116
1292
  private _deactivate;
1117
1293
  private _activate;
1118
1294
  initCallback(): void;
@@ -1128,714 +1304,89 @@ declare class LitActivityBlock extends LitBlock {
1128
1304
  CLOUD_IMG_EDIT: 'cloud-image-edit';
1129
1305
  EXTERNAL: 'external';
1130
1306
  }>;
1131
- protected get isActivityActive(): boolean;
1307
+ get isActivityActive(): boolean;
1132
1308
  get couldOpenActivity(): boolean;
1133
1309
  /** TODO: remove name argument */
1134
- protected registerActivity(_name: string, options?: {
1310
+ registerActivity(_name: string, options?: {
1135
1311
  onActivate?: () => void;
1136
1312
  onDeactivate?: () => void;
1137
1313
  }): void;
1138
- private _unregisterActivity;
1139
- disconnectedCallback(): void;
1314
+ unregisterActivity(): void;
1315
+ destroyCallback(): void;
1316
+ get activityKey(): string;
1140
1317
  get activityParams(): ActivityParamsMap[keyof ActivityParamsMap];
1141
- get initActivity(): string | null;
1142
- get doneActivity(): string | null;
1318
+ get initActivity(): string;
1319
+ get doneActivity(): string;
1143
1320
  historyBack(): void;
1144
1321
  }
1145
- type RegisteredActivityType = (typeof LitActivityBlock)['activities'][keyof (typeof LitActivityBlock)['activities']];
1322
+ type RegisteredActivityType = (typeof ActivityBlock)['activities'][keyof (typeof ActivityBlock)['activities']];
1146
1323
  type ActivityType = RegisteredActivityType | (string & {}) | null;
1147
1324
 
1148
- declare const InternalEventType: Readonly<{
1149
- readonly INIT_SOLUTION: "init-solution";
1150
- readonly CHANGE_CONFIG: "change-config";
1151
- readonly ACTION_EVENT: "action-event";
1152
- readonly ERROR_EVENT: "error-event";
1153
- }>;
1154
- declare const EventType: Readonly<{
1155
- readonly FILE_ADDED: "file-added";
1156
- readonly FILE_REMOVED: "file-removed";
1157
- readonly FILE_UPLOAD_START: "file-upload-start";
1158
- readonly FILE_UPLOAD_PROGRESS: "file-upload-progress";
1159
- readonly FILE_UPLOAD_SUCCESS: "file-upload-success";
1160
- readonly FILE_UPLOAD_FAILED: "file-upload-failed";
1161
- readonly FILE_URL_CHANGED: "file-url-changed";
1162
- readonly MODAL_OPEN: "modal-open";
1163
- readonly MODAL_CLOSE: "modal-close";
1164
- readonly DONE_CLICK: "done-click";
1165
- readonly UPLOAD_CLICK: "upload-click";
1166
- readonly ACTIVITY_CHANGE: "activity-change";
1167
- readonly COMMON_UPLOAD_START: "common-upload-start";
1168
- readonly COMMON_UPLOAD_PROGRESS: "common-upload-progress";
1169
- readonly COMMON_UPLOAD_SUCCESS: "common-upload-success";
1170
- readonly COMMON_UPLOAD_FAILED: "common-upload-failed";
1171
- readonly CHANGE: "change";
1172
- readonly GROUP_CREATED: "group-created";
1173
- }>;
1174
- type EventKey = (typeof EventType)[keyof typeof EventType];
1175
- type InternalEventKey = (typeof InternalEventType)[keyof typeof InternalEventType];
1176
- type EventPayload = {
1177
- [EventType.FILE_ADDED]: OutputFileEntry<'idle'>;
1178
- [EventType.FILE_REMOVED]: OutputFileEntry<'removed'>;
1179
- [EventType.FILE_UPLOAD_START]: OutputFileEntry<'uploading'>;
1180
- [EventType.FILE_UPLOAD_PROGRESS]: OutputFileEntry<'uploading'>;
1181
- [EventType.FILE_UPLOAD_SUCCESS]: OutputFileEntry<'success'>;
1182
- [EventType.FILE_UPLOAD_FAILED]: OutputFileEntry<'failed'>;
1183
- [EventType.FILE_URL_CHANGED]: OutputFileEntry<'success'>;
1184
- [EventType.MODAL_OPEN]: {
1185
- modalId: ModalId;
1186
- };
1187
- [EventType.MODAL_CLOSE]: {
1188
- modalId: ModalId;
1189
- hasActiveModals: boolean;
1190
- };
1191
- [EventType.ACTIVITY_CHANGE]: {
1192
- activity: ActivityType;
1193
- };
1194
- [EventType.UPLOAD_CLICK]: void;
1195
- [EventType.DONE_CLICK]: OutputCollectionState;
1196
- [EventType.COMMON_UPLOAD_START]: OutputCollectionState<'uploading'>;
1197
- [EventType.COMMON_UPLOAD_PROGRESS]: OutputCollectionState<'uploading'>;
1198
- [EventType.COMMON_UPLOAD_SUCCESS]: OutputCollectionState<'success'>;
1199
- [EventType.COMMON_UPLOAD_FAILED]: OutputCollectionState<'failed'>;
1200
- [EventType.CHANGE]: OutputCollectionState;
1201
- [EventType.GROUP_CREATED]: OutputCollectionState<'success', 'has-group'>;
1202
- };
1203
- declare class EventEmitter {
1204
- private _timeoutStore;
1205
- private _targets;
1206
- private _debugPrint;
1207
- constructor(debugPrint: (...args: unknown[]) => void);
1208
- bindTarget(target: LitBlock): () => void;
1209
- private _dispatch;
1210
- emit<T extends EventKey, TDebounce extends boolean | number | undefined = undefined>(type: T, payload?: TDebounce extends false | undefined ? EventPayload[T] : () => EventPayload[T], options?: {
1211
- debounce?: TDebounce;
1212
- }): void;
1213
- }
1214
-
1215
- type CommonEventType = InternalEventKey | EventKey;
1216
- type TelemetryState = TelemetryRequest & {
1217
- eventTimestamp: number;
1218
- location: string;
1219
- };
1220
- type TelemetryEventBody = Partial<Pick<TelemetryState, 'payload' | 'config'>> & {
1221
- modalId?: string;
1222
- eventType?: CommonEventType;
1223
- };
1224
- interface ITelemetryManager {
1225
- sendEvent(body: TelemetryEventBody): void;
1226
- sendEventError(error: unknown, context?: string): void;
1227
- sendEventCloudImageEditor(e: MouseEvent, tabId: string, options?: Record<string, unknown>): void;
1228
- }
1229
-
1230
- declare const TabId: Readonly<{
1231
- readonly CROP: "crop";
1232
- readonly TUNING: "tuning";
1233
- readonly FILTERS: "filters";
1234
- }>;
1235
- type TabIdValue$1 = (typeof TabId)[keyof typeof TabId];
1236
- declare const ALL_COLOR_OPERATIONS: readonly ["brightness", "exposure", "gamma", "contrast", "saturation", "vibrance", "warmth", "enhance"];
1237
- type ColorOperation = (typeof ALL_COLOR_OPERATIONS)[number];
1238
- 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"];
1239
- type FilterId = (typeof ALL_FILTERS)[number];
1240
- declare const ALL_CROP_OPERATIONS: readonly ["rotate", "mirror", "flip"];
1241
- type CropOperation = (typeof ALL_CROP_OPERATIONS)[number];
1242
- /** KeypointsNumber is the number of keypoints loaded from each side of zero, not total number */
1243
- declare const COLOR_OPERATIONS_CONFIG: Readonly<{
1244
- brightness: {
1245
- zero: number;
1246
- range: readonly [-100, 100];
1247
- keypointsNumber: number;
1248
- };
1249
- exposure: {
1250
- zero: number;
1251
- range: readonly [-500, 500];
1252
- keypointsNumber: number;
1253
- };
1254
- gamma: {
1255
- zero: number;
1256
- range: readonly [0, 1000];
1257
- keypointsNumber: number;
1258
- };
1259
- contrast: {
1260
- zero: number;
1261
- range: readonly [-100, 500];
1262
- keypointsNumber: number;
1263
- };
1264
- saturation: {
1265
- zero: number;
1266
- range: readonly [-100, 500];
1267
- keypointsNumber: number;
1268
- };
1269
- vibrance: {
1270
- zero: number;
1271
- range: readonly [-100, 500];
1272
- keypointsNumber: number;
1273
- };
1274
- warmth: {
1275
- zero: number;
1276
- range: readonly [-100, 100];
1277
- keypointsNumber: number;
1278
- };
1279
- enhance: {
1280
- zero: number;
1281
- range: readonly [0, 100];
1282
- keypointsNumber: number;
1283
- };
1284
- filter: {
1285
- zero: number;
1286
- range: readonly [0, 100];
1287
- keypointsNumber: number;
1288
- };
1289
- }>;
1325
+ declare function defineComponents(blockExports: Record<string, any>): void;
1290
1326
 
1291
- type SharedConfigState = {
1292
- [K in keyof ConfigType as `*cfg/${K}`]: ConfigType[K];
1293
- };
1294
- type BlocksRegistry = Set<LitBlock>;
1295
- type ActivityBlockCtxState = {
1296
- '*currentActivity': string | null;
1297
- '*currentActivityParams': Record<string, unknown>;
1298
- '*history': (string | null)[];
1299
- '*historyBack': (() => void) | null;
1300
- '*closeModal': () => void;
1301
- };
1302
- type UploaderBlockCtxState = ActivityBlockCtxState & {
1303
- '*commonProgress': number;
1304
- '*uploadList': {
1305
- uid: Uid;
1306
- }[];
1307
- '*uploadQueue': Queue;
1308
- '*collectionErrors': OutputErrorCollection[];
1309
- '*collectionState': OutputCollectionState | null;
1310
- '*groupInfo': UploadcareGroup | null;
1311
- '*uploadTrigger': Set<Uid>;
1312
- };
1313
- type SolutionBlockCtxState = UploaderBlockCtxState & {
1314
- '*solution': string | null;
1315
- };
1316
- type CloudImageEditorState = {
1317
- '*originalUrl': string | null;
1318
- '*loadingOperations': LoadingOperations;
1319
- '*faderEl': EditorImageFader | null;
1320
- '*cropperEl': EditorImageCropper | null;
1321
- '*imgEl': HTMLImageElement | null;
1322
- '*imgContainerEl': HTMLElement | null;
1323
- '*networkProblems': boolean;
1324
- '*imageSize': {
1325
- width: number;
1326
- height: number;
1327
- } | null;
1328
- '*editorTransformations': Transformations;
1329
- '*cropPresetList': CropPresetList;
1330
- '*currentAspectRatio': CropAspectRatio | null;
1331
- '*tabList': readonly TabIdValue$1[];
1332
- '*tabId': TabIdValue$1;
1333
- '*on.retryNetwork': () => void;
1334
- '*on.apply': (transformations: Transformations) => void;
1335
- '*on.cancel': () => void;
1336
- };
1337
- type EditorImageCropperState = {
1338
- '*padding': number;
1339
- '*operations': {
1340
- rotate: number;
1341
- mirror: boolean;
1342
- flip: boolean;
1343
- };
1344
- '*imageBox': {
1345
- x: number;
1346
- y: number;
1347
- width: number;
1348
- height: number;
1349
- };
1350
- '*cropBox': {
1351
- x: number;
1352
- y: number;
1353
- width: number;
1354
- height: number;
1355
- };
1356
- };
1357
- type EditorToolbarState = {
1358
- '*showListAspectRatio': boolean;
1359
- '*sliderEl': EditorSlider | null;
1360
- '*showSlider': boolean;
1361
- '*currentFilter': string;
1362
- '*currentOperation': string | null;
1363
- '*operationTooltip': string | null;
1364
- };
1365
- type DynamicBlockState = {
1366
- '*blocksRegistry': BlocksRegistry;
1367
- '*eventEmitter': EventEmitter;
1368
- '*localeManager': LocaleManager;
1369
- '*telemetryManager': ITelemetryManager;
1370
- '*a11y': A11y;
1371
- '*modalManager': ModalManager | null;
1372
- };
1373
- type DynamicUploaderBlockState = {
1374
- '*uploadCollection': TypedCollection<UploadEntryData>;
1375
- '*publicApi': UploaderPublicApi;
1376
- '*validationManager': ValidationManager;
1377
- '*secureUploadsManager': SecureUploadsManager;
1378
- };
1379
- type LocaleState = {
1380
- [K in keyof LocaleDefinition as `*l10n/${K}`]: string;
1381
- };
1382
- type SharedState = SolutionBlockCtxState & SharedConfigState & CloudImageEditorState & EditorImageCropperState & EditorToolbarState & DynamicBlockState & DynamicUploaderBlockState & LocaleState;
1383
-
1384
- declare const LitBlockBase: typeof LitElement & Constructor<{
1385
- willYield: boolean;
1386
- yield(slot: string, defaultContent?: unknown): unknown;
1387
- }> & Constructor<{
1388
- getCssData(propName: string, silentCheck?: boolean): string | number | boolean | null | undefined;
1389
- }> & Constructor<SymbioteComponent<SharedState>> & Constructor<LitElement> & {
1390
- reg(tagName: string): void;
1391
- };
1392
- declare class LitBlock extends LitBlockBase {
1393
- private _cfgProxy;
1394
- private _sharedContextInstances;
1395
- static styleAttrs: string[];
1396
- activityType: ActivityType;
1397
- init$: {};
1398
- constructor();
1399
- l10n(str: string, variables?: Record<string, string | number>): string;
1400
- private _pluralize;
1401
- emit(type: Parameters<EventEmitter['emit']>[0], payload?: Parameters<EventEmitter['emit']>[1], options?: Parameters<EventEmitter['emit']>[2]): void;
1402
- hasBlockInCtx(callback: (block: LitBlock) => boolean): boolean;
1403
- connectedCallback(): void;
1404
- initCallback(): void;
1405
- get testId(): string;
1406
- get modalManager(): ModalManager | null;
1407
- get telemetryManager(): ITelemetryManager;
1408
- get localeManager(): LocaleManager;
1409
- get a11y(): A11y;
1410
- get blocksRegistry(): Set<LitBlock>;
1411
- get eventEmitter(): EventEmitter;
1412
- disconnectedCallback(): void;
1413
- /**
1414
- * Called when the last block is removed from the context. Note that inheritors must run their callback before that.
1415
- */
1416
- protected destroyCtxCallback(): void;
1417
- /**
1418
- * Adds a shared context instance if it does not exist yet.
1419
- * @param key The shared state key.
1420
- * @param resolver The resolver function that creates the instance.
1421
- * @param persist Whether to persist the instance in the context if the creator block is removed. It's usually needed for those instances that depends on the current block. Defaults to false.
1422
- */
1423
- protected addSharedContextInstance<TKey extends keyof SharedState>(key: TKey, resolver: () => SharedState[TKey], { persist }?: {
1424
- persist?: boolean | undefined;
1425
- }): void;
1426
- private _destroySharedContextInstances;
1427
- protected getSharedContextInstance<TKey extends keyof SharedState, TRequired extends boolean = true>(key: TKey, isRequired?: TRequired): TRequired extends true ? NonNullable<SharedState[TKey]> : SharedState[TKey];
1428
- protected proxyUrl(url: string): Promise<string>;
1429
- get cfg(): ConfigType;
1430
- subConfigValue<T extends keyof ConfigType>(key: T, callback: (value: ConfigType[T]) => void): () => void;
1431
- debugPrint(...args: unknown[]): void;
1327
+ declare const UC_WINDOW_KEY = "UC";
1328
+ type IndexModule = Record<string, any>;
1329
+ declare global {
1330
+ interface Window {
1331
+ [UC_WINDOW_KEY]?: IndexModule;
1332
+ }
1432
1333
  }
1334
+ /**
1335
+ * @param url File Uploader pack url
1336
+ * @param [register] Register connected package, if it not registered yet
1337
+ */
1338
+ declare function loadFileUploaderFrom(url: string, register?: boolean): Promise<IndexModule | null>;
1433
1339
 
1434
- declare class Modal extends LitBlock {
1340
+ declare class SolutionBlock extends Block {
1435
1341
  static styleAttrs: string[];
1436
- private _mouseDownTarget;
1437
- /** WARNING: Do not rename/change this, it's used in dashboard */
1438
- protected dialogEl: lit_html_directives_ref_js.Ref<HTMLDialogElement>;
1439
- /** WARNING: Do not rename/change this, it's used in dashboard */
1440
- protected closeDialog: () => void;
1441
- private _handleDialogClose;
1442
- private _handleDialogMouseDown;
1443
- private _handleDialogMouseUp;
1444
- show(): void;
1445
- hide(): void;
1446
- private _handleModalOpen;
1447
- private _handleModalClose;
1448
- private _handleModalCloseAll;
1449
- initCallback(): void;
1450
- disconnectedCallback(): void;
1451
- private _handleDialogRef;
1452
- render(): lit_html.TemplateResult<1>;
1453
- }
1454
-
1455
- declare const ModalEvents: Readonly<{
1456
- readonly ADD: "modal:add";
1457
- readonly DELETE: "modal:delete";
1458
- readonly OPEN: "modal:open";
1459
- readonly CLOSE: "modal:close";
1460
- readonly CLOSE_ALL: "modal:closeAll";
1461
- readonly DESTROY: "modal:destroy";
1462
- }>;
1463
- type ModalId = ActivityType;
1464
- type ModalCb = (data: {
1465
- id: ModalId;
1466
- modal: Modal;
1467
- }) => void;
1468
- type ModalEventType = (typeof ModalEvents)[keyof typeof ModalEvents];
1469
- declare class ModalManager {
1470
- private _modals;
1471
- private _activeModals;
1472
- private _subscribers;
1473
- private _block;
1474
- constructor(block: LitBlock);
1475
- private _debugPrint;
1476
- /**
1477
- * Register a modal with the manager
1478
- * @param id Unique identifier for the modal
1479
- * @param modal Modal component instance
1480
- */
1481
- registerModal(id: ModalId, modal: Modal): void;
1482
- /** Remove a modal by ID. */
1483
- deleteModal(id: ModalId): boolean;
1484
- /** Open a modal by its ID. */
1485
- open(id: ModalId): boolean;
1486
- /** Close a specific modal by ID. */
1487
- close(id: ModalId): boolean;
1488
- /** Toggle a modal - open if closed, close if open. */
1489
- toggle(id: ModalId): boolean;
1490
- /** True if there are any active modals. */
1491
- get hasActiveModals(): boolean;
1492
- /** Close the most recently opened modal and return to the previous one. */
1493
- back(): boolean;
1494
- /** Close all open modals. */
1495
- closeAll(): number;
1496
- /**
1497
- * Subscribe to modal events
1498
- * @returns Unsubscribe function
1499
- */
1500
- subscribe(event: ModalEventType, callback: ModalCb): () => void;
1501
- /** Unsubscribe from modal events */
1502
- unsubscribe(event: ModalEventType, callback: ModalCb | undefined): void;
1503
- /** Notify all subscribers of a modal event. */
1504
- private _notify;
1505
- /** Destroy the modal manager, clean up resources */
1506
- destroy(): void;
1507
- }
1508
-
1509
- type KebabCase<T extends string> = T extends `${infer Head} ${infer Tail}` ? `${Lowercase<Head>}-${KebabCase<Tail>}` : Lowercase<T>;
1510
- declare const toKebabCase: <T extends string>(str: T) => KebabCase<T>;
1511
-
1512
- declare class Icon extends LitBlock {
1513
- name: string;
1514
- private _resolvedHref;
1515
- private _iconHrefResolver;
1516
- initCallback(): void;
1517
- protected willUpdate(changedProperties: PropertyValues<this>): void;
1518
- private _updateResolvedHref;
1519
- render(): lit_html.TemplateResult<1>;
1520
- }
1521
-
1522
- type CssPropValue = string | number | undefined | null;
1523
- declare const ImgConfig_base: typeof LitElement & Constructor<LitElement> & {
1524
- reg(tagName: string): void;
1525
- } & Constructor<{
1526
- getCssData(propName: string, silentCheck?: boolean): string | number | boolean | null | undefined;
1527
- }>;
1528
- declare class ImgConfig extends ImgConfig_base {
1529
- private _state;
1530
- private _subscribers;
1531
- private _isnObserver;
1532
- private _observed;
1533
- createRenderRoot(): HTMLElement | ShadowRoot;
1534
- constructor();
1535
- protected $$(key: string): unknown;
1536
- protected set$$(kvObj: Record<string, CssPropValue>): void;
1537
- protected sub$$<T = unknown>(key: string, kbFn: (val: T) => void): void;
1538
- private _notify;
1539
- protected analyticsParams(): string;
1540
- protected initAttributes(el: HTMLElement): void;
1541
- protected initIntersection(el: HTMLElement, cbkFn: () => void): void;
1542
- connectedCallback(): void;
1543
- private _initCssProperties;
1544
- disconnectedCallback(): void;
1545
- static get observedAttributes(): string[];
1546
- attributeChangedCallback(name: string, _oldVal: string | null, newVal: string | null): void;
1547
- }
1548
-
1549
- declare class ImgBase extends ImgConfig {
1550
- private _img;
1551
- private _imgPreview;
1552
- private _fmtAbs;
1553
- private _validateSize;
1554
- private _getCdnModifiers;
1555
- private _getTypedCssValue;
1556
- private _getUrlBase;
1557
- private _proxyUrl;
1558
- protected _getElSize(el: HTMLElement, k?: number, wOnly?: boolean): string | null;
1559
- private _setupEventProxy;
1560
- protected get img(): HTMLImageElement;
1561
- private get _currentImg();
1562
- private get _hasPreviewImage();
1563
- private get _bgSelector();
1564
- private get _breakpoints();
1565
- private get _hasFormatJPG();
1566
- private _renderBg;
1567
- private _getSrcset;
1568
- private _getSrc;
1569
- private get _srcUrlPreview();
1570
- private _renderBackground;
1571
- private _appendURL;
1572
- private _setupConfigForImage;
1573
- private _loaderImage;
1574
- private _renderImage;
1575
- protected init(): void;
1576
- }
1577
-
1578
- declare class Img extends ImgBase {
1579
- attributesMeta: {
1580
- src: string;
1581
- } | {
1582
- uuid: string;
1583
- };
1584
- connectedCallback(): void;
1585
- }
1586
-
1587
- declare class FormInput extends LitUploaderBlock {
1588
- propertiesMeta: {
1589
- 'ctx-name': string;
1342
+ protected requireCtxName: boolean;
1343
+ init$: {
1344
+ '*solution': string | null;
1345
+ '*commonProgress': number;
1346
+ '*uploadList': never[];
1347
+ '*uploadQueue': _uploadcare_upload_client.Queue;
1348
+ '*collectionErrors': OutputErrorCollection[];
1349
+ '*collectionState': OutputCollectionState | null;
1350
+ '*groupInfo': _uploadcare_upload_client.UploadcareGroup | null;
1351
+ '*uploadTrigger': Set<string>;
1352
+ '*secureUploadsManager': SecureUploadsManager | null;
1353
+ '*currentActivity': null;
1354
+ '*currentActivityParams': {};
1355
+ '*history': never[];
1356
+ '*historyBack': null;
1357
+ '*closeModal': () => void;
1590
1358
  };
1591
- private _validationInputElement;
1592
- private _dynamicInputsContainer;
1593
- private _createValidationInput;
1594
- initCallback(): void;
1595
- }
1596
-
1597
- declare class Copyright extends LitBlock {
1598
- initCallback(): void;
1599
- render(): lit_html.TemplateResult<1>;
1600
- }
1601
-
1602
- declare class ProgressBar extends LitBlock {
1603
- value: number;
1604
- visible: boolean;
1605
- private _progressValue;
1606
- private readonly _fakeProgressLineRef;
1607
- private readonly _handleFakeProgressAnimation;
1608
- protected firstUpdated(changedProperties: PropertyValues<this>): void;
1609
- protected updated(changedProperties: PropertyValues<this>): void;
1610
- disconnectedCallback(): void;
1611
- private _normalizeProgressValue;
1612
- private _updateProgressValueStyle;
1613
- render(): lit_html.TemplateResult<1>;
1614
- }
1615
-
1616
- declare class ProgressBarCommon extends LitUploaderBlock {
1617
- private _unobserveCollectionCb?;
1618
- private _visible;
1619
- private _value;
1620
- constructor();
1621
- initCallback(): void;
1622
- protected updated(changedProperties: PropertyValues<this>): void;
1623
- disconnectedCallback(): void;
1624
- render(): lit_html.TemplateResult<1>;
1625
- }
1626
-
1627
- type SelectOption = {
1628
- text: string;
1629
- value: string;
1630
- };
1631
- declare class Select extends LitBlock {
1632
- value: string;
1633
- disabled: boolean;
1634
- options: SelectOption[];
1635
- render(): lit_html.TemplateResult<1>;
1636
- private _handleChange;
1637
- }
1638
-
1639
- declare class SourceBtn extends LitUploaderBlock {
1640
- couldBeCtxOwner: boolean;
1641
- private _registeredTypes;
1642
- type?: string;
1643
- private _iconName;
1644
- private _srcTypeKey;
1645
- private _initTypes;
1646
- initCallback(): void;
1647
- private _registerType;
1648
- activate(): void;
1649
- private _applyType;
1650
- protected willUpdate(changedProperties: PropertyValues<this>): void;
1651
- render(): lit_html.TemplateResult<1>;
1652
- }
1653
-
1654
- declare class SourceList extends LitBlock {
1655
- private _rawSourceList;
1656
- private _cameraModes;
1657
- initCallback(): void;
1658
- protected updated(changedProperties: PropertyValues<this>): void;
1659
- private _updateSources;
1660
- private _sources;
1661
- render(): lit_html.TemplateResult<1>;
1662
- }
1663
-
1664
- declare class Spinner extends LitBlock {
1665
- render(): lit_html.TemplateResult<1>;
1666
- }
1667
-
1668
- declare class FileItemConfig extends LitUploaderBlock {
1669
- private _entrySubs;
1670
- protected entry: UploadEntryTypedData | null;
1671
- protected withEntry<A extends unknown[], R>(fn: (entry: UploadEntryTypedData, ...args: A) => R): (...args: A) => R | undefined;
1672
- protected subEntry<K extends UploadEntryKeys>(prop: K, handler: (value: UploadEntryData[K]) => void): void;
1673
- protected reset(): void;
1674
- disconnectedCallback(): void;
1675
- }
1676
-
1677
- declare class Thumb extends FileItemConfig {
1678
- badgeIcon: string;
1679
- uid: Uid;
1680
- private _thumbUrl;
1681
- private _renderedGridOnce;
1682
- private _thumbRect;
1683
- private _isIntersecting;
1684
- private _firstViewMode;
1685
- private _observer?;
1686
- private _pendingThumbUpdate?;
1687
- private _calculateThumbSize;
1688
- private _generateThumbnail;
1689
- private _debouncedGenerateThumb;
1690
- private _decodeImage;
1691
- private _cancelPendingThumbUpdate;
1692
- private _scheduleThumbUpdate;
1693
- private _requestThumbGeneration;
1694
- protected firstUpdated(changedProperties: PropertyValues<this>): void;
1695
- protected updated(changedProperties: PropertyValues<this>): void;
1696
- private _observerCallback;
1697
- protected reset(): void;
1698
- private _bindToEntry;
1359
+ private static _template;
1699
1360
  initCallback(): void;
1700
- connectedCallback(): void;
1701
- disconnectedCallback(): void;
1702
- render(): lit_html.TemplateResult<1>;
1361
+ static set template(value: string);
1362
+ static get template(): string;
1703
1363
  }
1704
1364
 
1705
- declare class ActivityHeader extends LitActivityBlock {
1706
- }
1707
-
1708
- declare class StartFrom extends LitActivityBlock {
1709
- protected historyTracked: boolean;
1710
- activityType: ActivityType;
1711
- initCallback(): void;
1712
- render(): lit_html.TemplateResult<1>;
1713
- }
1714
-
1715
- type EventListenerMap = {
1716
- [K in (typeof EventType)[keyof typeof EventType]]: (e: CustomEvent<EventPayload[K]>) => void;
1717
- };
1718
- declare class UploadCtxProvider extends LitUploaderBlock {
1719
- propertiesMeta: {
1720
- 'ctx-name': string;
1721
- };
1722
- static styleAttrs: string[];
1723
- static EventType: Readonly<{
1724
- readonly FILE_ADDED: "file-added";
1725
- readonly FILE_REMOVED: "file-removed";
1726
- readonly FILE_UPLOAD_START: "file-upload-start";
1727
- readonly FILE_UPLOAD_PROGRESS: "file-upload-progress";
1728
- readonly FILE_UPLOAD_SUCCESS: "file-upload-success";
1729
- readonly FILE_UPLOAD_FAILED: "file-upload-failed";
1730
- readonly FILE_URL_CHANGED: "file-url-changed";
1731
- readonly MODAL_OPEN: "modal-open";
1732
- readonly MODAL_CLOSE: "modal-close";
1733
- readonly DONE_CLICK: "done-click";
1734
- readonly UPLOAD_CLICK: "upload-click";
1735
- readonly ACTIVITY_CHANGE: "activity-change";
1736
- readonly COMMON_UPLOAD_START: "common-upload-start";
1737
- readonly COMMON_UPLOAD_PROGRESS: "common-upload-progress";
1738
- readonly COMMON_UPLOAD_SUCCESS: "common-upload-success";
1739
- readonly COMMON_UPLOAD_FAILED: "common-upload-failed";
1740
- readonly CHANGE: "change";
1741
- readonly GROUP_CREATED: "group-created";
1742
- }>;
1743
- private _unbindEventEmitter;
1744
- initCallback(): void;
1745
- disconnectedCallback(): void;
1746
- }
1747
- interface UploadCtxProvider extends LitUploaderBlock {
1748
- addEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | AddEventListenerOptions): void;
1749
- removeEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | EventListenerOptions): void;
1365
+ declare class ActivityHeader extends ActivityBlock {
1750
1366
  }
1751
1367
 
1752
- declare class UrlSource extends LitUploaderBlock {
1753
- couldBeCtxOwner: boolean;
1754
- activityType: ActivityType;
1755
- private _formState;
1756
- initCallback(): void;
1757
- private _inputRef;
1758
- private _handleInput;
1759
- private _handleUpload;
1760
- render(): lit_html.TemplateResult<1>;
1761
- }
1762
-
1763
- declare function initState(fnCtx: CloudImageEditorBlock): {
1764
- '*originalUrl': null;
1765
- '*loadingOperations': LoadingOperations;
1766
- '*faderEl': null;
1767
- '*cropperEl': null;
1768
- '*imgEl': null;
1769
- '*imgContainerEl': null;
1770
- '*networkProblems': boolean;
1771
- '*imageSize': null;
1772
- '*editorTransformations': {};
1773
- '*cropPresetList': never[];
1774
- '*currentAspectRatio': null;
1775
- '*tabList': readonly ["crop", "tuning", "filters"];
1776
- '*tabId': "crop";
1777
- '*on.retryNetwork': () => void;
1778
- '*on.apply': (transformations: Transformations) => void;
1779
- '*on.cancel': () => void;
1780
- };
1781
-
1782
- declare class CloudImageEditorBlock extends LitBlock {
1783
- attributesMeta: ({
1784
- uuid: string;
1785
- } | {
1786
- 'cdn-url': string;
1787
- }) & Partial<{
1788
- tabs: string;
1789
- 'crop-preset': string;
1790
- }> & {
1791
- 'ctx-name': string;
1792
- };
1368
+ declare class CloudImageEditorBlock extends Block {
1793
1369
  ctxOwner: boolean;
1794
1370
  static styleAttrs: string[];
1795
- private _statusMessage;
1796
- private _imageSrc;
1797
- private _fileType;
1371
+ private _debouncedShowLoader;
1372
+ constructor();
1798
1373
  private _showLoader;
1799
- uuid: string | null;
1800
- cdnUrl: string | null;
1801
- cropPreset: string;
1802
- tabs: string | null;
1803
- private _hasNetworkProblems;
1804
- private _isInitialized;
1805
- private _pendingInitUpdate;
1806
- private readonly _debouncedShowLoader;
1807
- private readonly _imgRef;
1808
- private readonly _cropperRef;
1809
- private readonly _faderRef;
1810
- private readonly _imgContainerRef;
1811
- private readonly _handleImageLoad;
1812
- private readonly _handleImageError;
1813
- private readonly _handleRetryNetwork;
1814
- private _scheduleInitialization;
1815
- init$: ReturnType<typeof initState>;
1816
- initCallback(): void;
1817
- private _assignSharedElements;
1818
- private _attachImageListeners;
1819
- private _detachImageListeners;
1820
- private get _imageClassName();
1821
1374
  /**
1822
1375
  * To proper work, we need non-zero size the element. So, we'll wait for it.
1823
1376
  */
1824
1377
  private _waitForSize;
1825
- firstUpdated(changedProperties: PropertyValues<this>): void;
1826
- disconnectedCallback(): void;
1827
- render(): lit_html.TemplateResult<1>;
1828
- protected updated(changedProperties: PropertyValues<this>): void;
1829
- private _syncTabListFromProp;
1830
- private _syncCropPresetState;
1378
+ initCallback(): void;
1831
1379
  updateImage(): Promise<void>;
1832
1380
  initEditor(): Promise<void>;
1833
1381
  }
1834
1382
 
1835
- declare class CropFrame extends LitBlock {
1383
+ declare class CropFrame extends Block {
1384
+ private readonly _handlePointerUp;
1385
+ private readonly _handlePointerMove;
1386
+ private readonly _handleSvgPointerMove;
1387
+ private readonly _backdropMaskId;
1836
1388
  private _backdropMask?;
1837
1389
  private _backdropMaskInner?;
1838
- private readonly _backdropMaskId;
1839
1390
  private _frameThumbs?;
1840
1391
  private _frameGuides?;
1841
1392
  private _draggingThumb?;
@@ -1844,14 +1395,7 @@ declare class CropFrame extends LitBlock {
1844
1395
  private _dragStartCrop?;
1845
1396
  private _frameImage?;
1846
1397
  private _guidesHidden;
1847
- private _draggingValue;
1848
- private readonly _svgRef;
1849
- private _svgReady;
1850
- private _pendingMaskHref;
1851
- private get _svgElement();
1852
- private get _dragging();
1853
- private set _dragging(value);
1854
- private _applyGuidesDragState;
1398
+ constructor();
1855
1399
  private _shouldThumbBeDisabled;
1856
1400
  private _createBackdrop;
1857
1401
  /**
@@ -1866,56 +1410,103 @@ declare class CropFrame extends LitBlock {
1866
1410
  private _createGuides;
1867
1411
  private _createFrame;
1868
1412
  private _handlePointerDown;
1869
- private readonly _handlePointerUp;
1870
- private readonly _handlePointerMove;
1413
+ private _handlePointerUp_;
1414
+ private _handlePointerMove_;
1871
1415
  private _calcCropBox;
1872
- private readonly _handleSvgPointerMove;
1416
+ private _handleSvgPointerMove_;
1873
1417
  private _updateCursor;
1874
1418
  private _createMask;
1875
1419
  private _updateMask;
1876
1420
  private _render;
1877
1421
  toggleThumbs(visible: boolean): void;
1878
1422
  initCallback(): void;
1879
- protected firstUpdated(changedProperties: PropertyValues<this>): void;
1880
- private _initializeSvg;
1881
- disconnectedCallback(): void;
1882
- render(): TemplateResult;
1423
+ destroyCallback(): void;
1883
1424
  }
1884
1425
 
1885
- declare class EditorButtonControl extends LitBlock {
1886
- active: boolean;
1887
- title: string;
1888
- protected icon: string;
1889
- protected titleProp: string;
1890
- protected get buttonClasses(): Record<string, boolean>;
1891
- private _updateHostStateClasses;
1892
- protected onClick(_event: MouseEvent): void;
1893
- connectedCallback(): void;
1894
- protected updated(changedProperties: PropertyValues<this>): void;
1895
- render(): lit_html.TemplateResult<1>;
1426
+ declare class EditorButtonControl extends Block {
1427
+ private _titleEl?;
1428
+ constructor();
1429
+ initCallback(): void;
1896
1430
  }
1897
1431
 
1898
1432
  declare class EditorFreeformButtonControl extends EditorButtonControl {
1899
1433
  initCallback(): void;
1900
- onClick(): void;
1901
- private _computeTitle;
1902
- render(): lit_html.TemplateResult<1>;
1434
+ handleClick(): void;
1435
+ }
1436
+ interface EditorAspectRatioButtonControl {
1437
+ get aspectRatio(): CropAspectRatio | undefined;
1438
+ set aspectRatio(value: CropAspectRatio | undefined);
1903
1439
  }
1904
1440
  declare class EditorAspectRatioButtonControl extends EditorButtonControl {
1905
- private _aspectRatio;
1906
- get aspectRatio(): CropAspectRatio | null;
1907
- set aspectRatio(value: CropAspectRatio | null);
1441
+ constructor();
1908
1442
  initCallback(): void;
1909
- protected onClick(): void;
1910
- private _updateAspectRatioPresentation;
1911
- private _renderIcon;
1912
- render(): lit_html.TemplateResult<1>;
1443
+ handleClick(): void;
1444
+ private _renderRectBasedOnAspectRatio;
1445
+ private _aspectRatio?;
1913
1446
  }
1914
1447
 
1448
+ declare const ALL_COLOR_OPERATIONS: readonly ["brightness", "exposure", "gamma", "contrast", "saturation", "vibrance", "warmth", "enhance"];
1449
+ type ColorOperation = (typeof ALL_COLOR_OPERATIONS)[number];
1450
+ declare const ALL_FILTERS: readonly ["adaris", "briaril", "calarel", "carris", "cynarel", "cyren", "elmet", "elonni", "enzana", "erydark", "fenralan", "ferand", "galen", "gavin", "gethriel", "iorill", "iothari", "iselva", "jadis", "lavra", "misiara", "namala", "nerion", "nethari", "pamaya", "sarnar", "sedis", "sewen", "sorahel", "sorlen", "tarian", "thellassan", "varriel", "varven", "vevera", "virkas", "yedis", "yllara", "zatvel", "zevcen"];
1451
+ type FilterId = (typeof ALL_FILTERS)[number];
1452
+ declare const ALL_CROP_OPERATIONS: readonly ["rotate", "mirror", "flip"];
1453
+ type CropOperation = (typeof ALL_CROP_OPERATIONS)[number];
1454
+ /** KeypointsNumber is the number of keypoints loaded from each side of zero, not total number */
1455
+ declare const COLOR_OPERATIONS_CONFIG: Readonly<{
1456
+ brightness: {
1457
+ zero: number;
1458
+ range: readonly [-100, 100];
1459
+ keypointsNumber: number;
1460
+ };
1461
+ exposure: {
1462
+ zero: number;
1463
+ range: readonly [-500, 500];
1464
+ keypointsNumber: number;
1465
+ };
1466
+ gamma: {
1467
+ zero: number;
1468
+ range: readonly [0, 1000];
1469
+ keypointsNumber: number;
1470
+ };
1471
+ contrast: {
1472
+ zero: number;
1473
+ range: readonly [-100, 500];
1474
+ keypointsNumber: number;
1475
+ };
1476
+ saturation: {
1477
+ zero: number;
1478
+ range: readonly [-100, 500];
1479
+ keypointsNumber: number;
1480
+ };
1481
+ vibrance: {
1482
+ zero: number;
1483
+ range: readonly [-100, 500];
1484
+ keypointsNumber: number;
1485
+ };
1486
+ warmth: {
1487
+ zero: number;
1488
+ range: readonly [-100, 100];
1489
+ keypointsNumber: number;
1490
+ };
1491
+ enhance: {
1492
+ zero: number;
1493
+ range: readonly [0, 100];
1494
+ keypointsNumber: number;
1495
+ };
1496
+ filter: {
1497
+ zero: number;
1498
+ range: readonly [0, 100];
1499
+ keypointsNumber: number;
1500
+ };
1501
+ }>;
1502
+
1503
+ interface EditorCropButtonControl {
1504
+ get operation(): CropOperation | undefined;
1505
+ set operation(value: CropOperation | undefined);
1506
+ }
1915
1507
  declare class EditorCropButtonControl extends EditorButtonControl {
1916
- operation: CropOperation | undefined;
1917
- protected willUpdate(changedProperties: PropertyValues<this>): void;
1918
- protected onClick(e: MouseEvent): void;
1508
+ private _operation;
1509
+ initCallback(): void;
1919
1510
  }
1920
1511
 
1921
1512
  declare class EditorFilterControl extends EditorButtonControl {
@@ -1924,27 +1515,11 @@ declare class EditorFilterControl extends EditorButtonControl {
1924
1515
  private _originalUrl;
1925
1516
  private _observer?;
1926
1517
  private _cancelPreload?;
1927
- private _lastPreviewRequestId;
1928
- private _previewVisibilityCheckRaf?;
1929
- private _previewVisibilityCheckTimeout?;
1930
- private _previewImage;
1931
- private _previewLoaded;
1932
- isOriginal: boolean;
1933
- private _iconSize;
1934
- get filter(): string;
1935
- set filter(value: string);
1936
- onClick(e: MouseEvent): void;
1518
+ constructor();
1937
1519
  private _previewSrc;
1938
1520
  private _observerCallback;
1939
1521
  initCallback(): void;
1940
- disconnectedCallback(): void;
1941
- protected updated(changedProperties: PropertyValues<this>): void;
1942
- private _updateFilterLabels;
1943
- private _loadPreview;
1944
- private _schedulePreviewVisibilityCheck;
1945
- private _clearPreviewVisibilityChecks;
1946
- private get _shouldShowPreview();
1947
- render(): lit_html.TemplateResult<1>;
1522
+ destroyCallback(): void;
1948
1523
  }
1949
1524
 
1950
1525
  type Operations = {
@@ -1952,7 +1527,7 @@ type Operations = {
1952
1527
  mirror: boolean;
1953
1528
  rotate: number;
1954
1529
  };
1955
- declare class EditorImageCropper extends LitBlock {
1530
+ declare class EditorImageCropper extends Block {
1956
1531
  ctxOwner: boolean;
1957
1532
  private _commitDebounced;
1958
1533
  private _handleResizeThrottled;
@@ -1961,12 +1536,9 @@ declare class EditorImageCropper extends LitBlock {
1961
1536
  private _ctx;
1962
1537
  private _isActive;
1963
1538
  private _observer?;
1964
- private _image;
1965
1539
  private _cancelPreload?;
1966
- private readonly _canvasRef;
1967
- private readonly _frameRef;
1968
1540
  constructor();
1969
- protected firstUpdated(changedProperties: PropertyValues<this>): void;
1541
+ private _handleResize;
1970
1542
  private _syncTransformations;
1971
1543
  private _initCanvas;
1972
1544
  private _alignImage;
@@ -1991,12 +1563,11 @@ declare class EditorImageCropper extends LitBlock {
1991
1563
  private _waitForImage;
1992
1564
  private _handleImageLoading;
1993
1565
  initCallback(): void;
1994
- disconnectedCallback(): void;
1995
- render(): TemplateResult;
1566
+ destroyCallback(): void;
1996
1567
  }
1997
1568
 
1998
1569
  type OperationKey = keyof typeof COLOR_OPERATIONS_CONFIG;
1999
- declare class EditorImageFader extends LitBlock {
1570
+ declare class EditorImageFader extends Block {
2000
1571
  private _isActive;
2001
1572
  private _hidden;
2002
1573
  private _operation;
@@ -2004,6 +1575,7 @@ declare class EditorImageFader extends LitBlock {
2004
1575
  private _value?;
2005
1576
  private _transformations;
2006
1577
  private _keypoints;
1578
+ private _container?;
2007
1579
  private _previewImage?;
2008
1580
  private _cancelLastImages?;
2009
1581
  private _cancelBatchPreload?;
@@ -2011,8 +1583,6 @@ declare class EditorImageFader extends LitBlock {
2011
1583
  private _fromViewer?;
2012
1584
  private _raf;
2013
1585
  private _addKeypointDebounced;
2014
- private readonly _previewHostRef;
2015
- private readonly _layersHostRef;
2016
1586
  constructor();
2017
1587
  private _handleImageLoading;
2018
1588
  private _flush;
@@ -2022,6 +1592,7 @@ declare class EditorImageFader extends LitBlock {
2022
1592
  * Check if current operation and filter equals passed ones
2023
1593
  */
2024
1594
  private _isSame;
1595
+ private _addKeypoint;
2025
1596
  set(value: string | number): void;
2026
1597
  private _update;
2027
1598
  private _createPreviewImage;
@@ -2044,351 +1615,440 @@ declare class EditorImageFader extends LitBlock {
2044
1615
  deactivate({ hide }?: {
2045
1616
  hide?: boolean;
2046
1617
  }): void;
2047
- private _ensurePreviewAttached;
2048
- private _clearLayersHost;
2049
- render(): TemplateResult;
2050
1618
  }
2051
1619
 
2052
1620
  declare class EditorOperationControl extends EditorButtonControl {
2053
1621
  private _operation;
2054
- get operation(): ColorOperation | '';
2055
- set operation(value: ColorOperation | '');
2056
- private _updateOperationMetadata;
2057
1622
  initCallback(): void;
2058
- protected onClick(e: MouseEvent): void;
2059
1623
  }
2060
1624
 
2061
- declare class EditorScroller extends LitBlock {
2062
- private readonly _handleWheel;
2063
- connectedCallback(): void;
2064
- disconnectedCallback(): void;
1625
+ declare class EditorScroller extends Block {
1626
+ initCallback(): void;
2065
1627
  }
2066
1628
 
2067
1629
  type SliderOperation = ColorOperation | 'filter';
2068
1630
  type SliderFilter = FilterId | typeof FAKE_ORIGINAL_FILTER;
2069
1631
  declare const FAKE_ORIGINAL_FILTER = "original";
2070
- declare class EditorSlider extends LitBlock {
2071
- state: {
2072
- operation: SliderOperation;
2073
- filter: SliderFilter | undefined;
2074
- originalUrl: string;
2075
- disabled: boolean;
2076
- min: number;
2077
- max: number;
2078
- value: number;
2079
- defaultValue: number;
2080
- zero: number;
2081
- };
2082
- private _handleInput;
1632
+ declare class EditorSlider extends Block {
1633
+ private _operation;
1634
+ private _filter?;
1635
+ private _originalUrl;
1636
+ constructor();
2083
1637
  setOperation(operation: SliderOperation, filter?: SliderFilter): void;
2084
1638
  private _initializeValues;
2085
1639
  apply(): void;
2086
1640
  cancel(): void;
2087
1641
  initCallback(): void;
2088
- protected updated(changedProperties: PropertyValues<this>): void;
2089
- render(): lit_html.TemplateResult<1>;
2090
1642
  }
2091
1643
 
2092
- type TabIdValue = (typeof TabId)[keyof typeof TabId];
2093
- declare class EditorToolbar extends LitBlock {
2094
- private _showLoader;
2095
- showMainToolbar: boolean;
2096
- showSubToolbar: boolean;
2097
- private _showTabToggles;
2098
- tabList: readonly TabIdValue[];
2099
- activeTab: TabIdValue;
2100
- private _useSliderPanel;
2101
- private _tooltipVisible;
2102
- private _operationTooltip;
2103
- private _tabIndicatorOffset;
2104
- private _tabIndicatorWidth;
2105
- private readonly _sliderRef;
2106
- private readonly _tabIndicatorRef;
2107
- protected readonly tabToggleRefs: Record<TabIdValue, Ref<HTMLElement>>;
2108
- private readonly _handleWindowResize;
2109
- private _cropPresets;
1644
+ declare class EditorToolbar extends Block {
1645
+ private _debouncedShowLoader;
2110
1646
  private _cancelPreload?;
2111
- private readonly _debouncedShowLoader;
2112
- private readonly _updateInfoTooltip;
2113
- private readonly _subTopToolbarStyles;
2114
- private readonly _subBottomToolbarStyles;
2115
- private readonly _tabContentStyles;
2116
- private readonly _tabToggleStyles;
2117
- private readonly _tabTogglesStyles;
2118
- init$: Record<string, unknown>;
1647
+ private _updateInfoTooltip;
1648
+ constructor();
2119
1649
  private _onSliderClose;
1650
+ private _createOperationControl;
1651
+ private _createFilterControl;
1652
+ private _createToggleControl;
1653
+ private _createAspectRatioControl;
1654
+ private _createFreeformControl;
1655
+ private _clearListAspectRatio;
1656
+ private _renderControlsList;
2120
1657
  private _activateTab;
2121
- private _applyTabState;
1658
+ private _unmountTabControls;
2122
1659
  private _syncTabIndicator;
2123
- private get _hasAspectRatioPicker();
2124
- private _renderControlsByTab;
2125
- private _renderCropTabControls;
2126
- private _renderFilterTabControls;
2127
- private _renderTuningTabControls;
2128
- private _renderControlGroup;
2129
- private _renderFreeformControl;
2130
- private _renderAspectRatioControl;
2131
- private _renderCropOperationControl;
2132
- private _renderFilterControl;
2133
- private _renderOperationControl;
2134
- private _renderAspectRatioList;
2135
1660
  private _preloadEditedImage;
1661
+ private _showLoader;
1662
+ private _updateInfoTooltipHandler;
2136
1663
  initCallback(): void;
2137
- connectedCallback(): void;
2138
- firstUpdated(changedProperties: PropertyValues<this>): void;
2139
- protected updated(changedProperties: PropertyValues<this>): void;
2140
- disconnectedCallback(): void;
2141
- private _assignSharedElements;
2142
- private readonly _handleCancel;
2143
- private readonly _handleApply;
2144
- private readonly _handleApplySlider;
2145
- private readonly _handleCancelSlider;
2146
- private readonly _handleTabClick;
2147
- private _renderTabToggle;
2148
- private _renderTabContent;
2149
- render(): TemplateResult<1>;
2150
- }
2151
-
2152
- type Theme = string | null;
2153
- declare class BtnUi extends LitBlock {
2154
- text: string;
2155
- icon: string;
2156
- reverse: boolean;
2157
- theme: Theme;
2158
- ariaRole: string;
2159
- ariaControls: string;
2160
- titleProp: string;
2161
- protected firstUpdated(changed: PropertyValues<this>): void;
2162
- protected updated(changed: PropertyValues<this>): void;
2163
- private _applyReverse;
2164
- private _applyThemeClass;
2165
- private get _iconClassMap();
2166
- private get _computedIconHidden();
2167
- private get _computedIconSingle();
2168
- render(): lit_html.TemplateResult<1>;
2169
- }
2170
-
2171
- declare class LineLoaderUi extends LitBlock {
2172
- active: boolean;
2173
- private readonly _lineRef;
2174
- private _isAnimating;
1664
+ destroyCallback(): void;
1665
+ }
1666
+
1667
+ declare class BtnUi extends Block {
1668
+ private _iconReversed;
1669
+ private _iconSingle;
1670
+ private _iconHidden;
1671
+ constructor();
1672
+ private _iconCss;
1673
+ initCallback(): void;
1674
+ set reverse(_value: boolean);
1675
+ }
1676
+
1677
+ declare class LineLoaderUi extends Block {
1678
+ private _active;
2175
1679
  private readonly _handleTransitionEndRight;
2176
- protected firstUpdated(changedProperties: PropertyValues<this>): void;
2177
- protected updated(changedProperties: PropertyValues<this>): void;
1680
+ initCallback(): void;
2178
1681
  private _start;
2179
1682
  private _stop;
2180
- private _resetLine;
2181
- render(): lit_html.TemplateResult<1>;
2182
1683
  }
2183
1684
 
2184
- type PresenceToggleStyle = {
2185
- transition?: string;
2186
- visible?: string;
2187
- hidden?: string;
2188
- };
2189
- declare class PresenceToggle extends LitBlock {
1685
+ declare class PresenceToggle extends Block {
2190
1686
  private _visible;
2191
- private _styles;
2192
1687
  private _visibleStyle;
2193
1688
  private _hiddenStyle;
2194
1689
  private _externalTransitions;
2195
- private _initialRenderComplete;
2196
- set visible(value: boolean);
2197
- get visible(): boolean;
2198
- set styles(styles: PresenceToggleStyle);
2199
- get styles(): PresenceToggleStyle;
1690
+ constructor();
2200
1691
  private _handleVisible;
2201
- private _dispatchInitialRenderEvent;
2202
1692
  initCallback(): void;
2203
1693
  }
2204
1694
 
2205
- declare class SliderUi extends LitBlock {
1695
+ declare class SliderUi extends Block {
2206
1696
  private _observer?;
2207
1697
  private _thumbSize;
1698
+ private _zero;
2208
1699
  private _zeroDotEl?;
2209
1700
  private _stepsCount?;
2210
- private readonly _inputRef;
2211
- private readonly _thumbRef;
2212
- private readonly _stepsRef;
2213
- disabled: boolean;
2214
- min: number;
2215
- max: number;
2216
- defaultValue: number;
2217
- zero: number;
2218
- private _currentValue;
2219
1701
  constructor();
2220
- private _emitSliderEvent;
2221
- private readonly _handleSliderInput;
2222
- private readonly _handleSliderChange;
2223
- private readonly _handleInputFocus;
2224
- private readonly _handleInputBlur;
2225
- protected firstUpdated(changedProperties: PropertyValues<this>): void;
2226
- protected willUpdate(changedProperties: PropertyValues<this>): void;
1702
+ initCallback(): void;
1703
+ private _inputEl;
1704
+ private _thumbEl;
1705
+ private _stepsEl;
2227
1706
  private _updateValue;
2228
1707
  private _updateZeroDot;
2229
1708
  private _updateSteps;
2230
- disconnectedCallback(): void;
2231
- private _setCurrentValue;
2232
- private _syncInputValue;
2233
- private _extractEventValue;
2234
- render(): lit_html.TemplateResult<1>;
1709
+ destroyCallback(): void;
1710
+ }
1711
+
1712
+ declare class Copyright extends Block {
1713
+ initCallback(): void;
1714
+ static template: string;
2235
1715
  }
2236
1716
 
2237
- declare class DropArea extends LitUploaderBlock {
1717
+ declare class DropArea extends UploaderBlock {
2238
1718
  static styleAttrs: string[];
2239
- disabled: boolean;
2240
- clickable: boolean;
2241
- withIcon: boolean;
2242
- fullscreen: boolean;
2243
- initflow: boolean;
2244
- text?: string;
2245
- private _isEnabled;
2246
- private _isVisible;
2247
- private get _localizedText();
2248
1719
  private _destroyDropzone;
2249
1720
  private _destroyContentWrapperDropzone;
2250
- private _contentWrapperRef;
2251
- private readonly _handleAreaInteraction;
2252
- private _sourceListAllowsLocal;
2253
- private _clickableListenersAttached;
1721
+ private _onAreaClicked;
1722
+ constructor();
2254
1723
  isActive(): boolean;
2255
1724
  initCallback(): void;
2256
- protected willUpdate(changedProperties: PropertyValues<this>): void;
2257
- protected updated(changedProperties: PropertyValues<this>): void;
2258
1725
  /** Ignore drop events if there are other visible drop areas on the page. */
2259
1726
  private _shouldIgnore;
2260
1727
  private _couldHandleFiles;
2261
- private _updateIsEnabled;
2262
- private _updateVisibility;
2263
- private _updateDragStateAttribute;
2264
- private _updateClickableListeners;
1728
+ destroyCallback(): void;
1729
+ }
1730
+
1731
+ type EntrySubscription = ReturnType<UploadEntryTypedData['subscribe']>;
1732
+ declare class FileItemConfig extends UploaderBlock {
1733
+ protected _entrySubs: Set<EntrySubscription>;
1734
+ protected _entry: UploadEntryTypedData | null;
1735
+ protected _withEntry<A extends unknown[], R>(fn: (entry: UploadEntryTypedData, ...args: A) => R): (...args: A) => R | undefined;
1736
+ protected _subEntry<K extends UploadEntryKeys>(prop: K, handler: (value: UploadEntryData[K]) => void): void;
1737
+ protected _reset(): void;
2265
1738
  disconnectedCallback(): void;
2266
- render(): lit_html.TemplateResult<1>;
2267
1739
  }
2268
1740
 
2269
1741
  declare class FileItem extends FileItemConfig {
2270
- protected couldBeCtxOwner: boolean;
2271
- private _pauseRender;
2272
- uid: Uid;
2273
- private _itemName;
2274
- private _errorText;
2275
- private _hint;
2276
- private _progressValue;
2277
- private _progressVisible;
2278
- private _badgeIcon;
2279
- private _isFinished;
2280
- private _isFailed;
2281
- private _isUploading;
2282
- private _isFocused;
2283
- private _isEditable;
2284
- private _showFileNames;
2285
- private _ariaLabelStatusFile;
1742
+ couldBeCtxOwner: boolean;
1743
+ pauseRender: boolean;
2286
1744
  private _renderedOnce;
2287
1745
  private _observer?;
2288
- private _handleEdit;
2289
- private _handleRemove;
2290
- private _handleUploadClick;
1746
+ protected _isIntersecting: boolean;
1747
+ protected _thumbRect?: DOMRectReadOnly;
1748
+ constructor();
2291
1749
  private _calculateState;
2292
1750
  private _debouncedCalculateState;
2293
1751
  private _updateHintAndProgress;
2294
1752
  private _handleState;
2295
- protected reset(): void;
1753
+ _reset(): void;
2296
1754
  private _observerCallback;
2297
1755
  private _handleEntryId;
2298
1756
  private _updateShowFileNames;
2299
- protected willUpdate(changedProperties: PropertyValues<this>): void;
2300
1757
  initCallback(): void;
1758
+ destroyCallback(): void;
2301
1759
  connectedCallback(): void;
2302
1760
  disconnectedCallback(): void;
2303
- private _upload;
1761
+ private _settingsOfShrink;
1762
+ private _processShrink;
1763
+ upload: () => Promise<void> | undefined;
1764
+ static template: string;
2304
1765
  static activeInstances: Set<FileItem>;
2305
- protected shouldUpdate(changedProperties: PropertyValues<this>): boolean;
2306
- render(): lit_html.TemplateResult<1>;
2307
1766
  }
2308
1767
 
2309
- declare class SimpleBtn extends LitUploaderBlock {
1768
+ declare class FormInput extends UploaderBlock {
1769
+ requireCtxName: boolean;
1770
+ _validationInputElement: HTMLInputElement | null;
1771
+ _dynamicInputsContainer: HTMLDivElement | null;
1772
+ private get _inputName();
1773
+ _createValidationInput(): HTMLInputElement;
1774
+ initCallback(): void;
1775
+ }
1776
+
1777
+ declare class Icon extends Block {
1778
+ constructor();
1779
+ initCallback(): void;
1780
+ }
1781
+
1782
+ declare class ImgConfig extends BaseComponent<any> {
1783
+ static get observedAttributes(): string[];
1784
+ constructor();
1785
+ cssInit$: any;
1786
+ /**
1787
+ * @param {String} key
1788
+ * @returns {any}
1789
+ */
1790
+ $$(key: string): any;
1791
+ /** @param {Object<String, String | Number>} kvObj */
1792
+ set$$(kvObj: any): void;
1793
+ /**
1794
+ * @param {String} key
1795
+ * @param {(val: any) => void} kbFn
1796
+ */
1797
+ sub$$(key: string, kbFn: (val: any) => void): void;
1798
+ analyticsParams(): string;
1799
+ initAttributes(el: any): void;
1800
+ /**
1801
+ * @param {HTMLElement} el
1802
+ * @param {() => void} cbkFn
1803
+ */
1804
+ initIntersection(el: HTMLElement, cbkFn: () => void): void;
1805
+ /** @private */
1806
+ private _isnObserver;
1807
+ /** @private */
1808
+ private _observed;
1809
+ attributeChangedCallback(name: any, oldVal: any, newVal: any): void;
1810
+ }
1811
+
1812
+ declare class ImgBase extends ImgConfig {
1813
+ _img: HTMLImageElement;
1814
+ _imgPreview: HTMLImageElement;
1815
+ /**
1816
+ * @private
1817
+ * @param {String} src
1818
+ */
1819
+ private _fmtAbs;
1820
+ /**
1821
+ * Validate size
1822
+ *
1823
+ * @param {String} [size]
1824
+ * @returns {String | Number}
1825
+ */
1826
+ _validateSize(size?: string): string | number;
1827
+ /**
1828
+ * Image operations
1829
+ *
1830
+ * @param {String} [size]
1831
+ * @param {String} [blur]
1832
+ */
1833
+ _getCdnModifiers(size?: string, blur?: string): string;
1834
+ /**
1835
+ * @private
1836
+ * @param {String} [size]
1837
+ * @param {String} [blur]
1838
+ * @returns {any}
1839
+ */
1840
+ private _getUrlBase;
1841
+ /**
1842
+ * @private
1843
+ * @param {String} url
1844
+ * @returns {String}
1845
+ */
1846
+ private _proxyUrl;
1847
+ /**
1848
+ * @param {HTMLElement} el
1849
+ * @param {Number} [k]
1850
+ * @param {Boolean} [wOnly]
1851
+ */
1852
+ _getElSize(el: HTMLElement, k?: number, wOnly?: boolean): string | null;
1853
+ /** @param {HTMLImageElement} img */
1854
+ _setupEventProxy(img: HTMLImageElement): void;
1855
+ /** @type {HTMLImageElement} */
1856
+ get img(): HTMLImageElement;
1857
+ get currentImg(): {
1858
+ type: "PREVIEW";
1859
+ img: HTMLImageElement;
1860
+ } | {
1861
+ type: "MAIN";
1862
+ img: HTMLImageElement;
1863
+ };
1864
+ get hasPreviewImage(): any;
1865
+ get bgSelector(): any;
1866
+ get breakpoints(): number[] | null;
1867
+ get hasFormatJPG(): boolean;
1868
+ /** @param {HTMLElement} el */
1869
+ renderBg(el: HTMLElement): void;
1870
+ getSrcset(): string;
1871
+ getSrc(): any;
1872
+ get srcUrlPreview(): any;
1873
+ renderBackground(): void;
1874
+ _appendURL({ elNode, src, srcset }: {
1875
+ elNode: any;
1876
+ src: any;
1877
+ srcset: any;
1878
+ }): void;
1879
+ _setupConfigForImage({ elNode }: {
1880
+ elNode: any;
1881
+ }): void;
1882
+ loaderImage({ src, srcset, elNode }: {
1883
+ src: any;
1884
+ srcset: any;
1885
+ elNode: any;
1886
+ }): Promise<any>;
1887
+ renderImage(): Promise<void>;
1888
+ init(): void;
1889
+ }
1890
+
1891
+ declare class Img extends ImgBase {
1892
+ }
1893
+
1894
+ declare class ProgressBar extends Block {
1895
+ private _value;
1896
+ private _visible;
1897
+ constructor();
1898
+ initCallback(): void;
1899
+ }
1900
+
1901
+ declare class ProgressBarCommon extends UploaderBlock {
1902
+ private _unobserveCollectionCb?;
1903
+ constructor();
1904
+ initCallback(): void;
1905
+ destroyCallback(): void;
1906
+ }
1907
+
1908
+ declare class Select extends Block {
1909
+ ref: {
1910
+ select: HTMLSelectElement;
1911
+ } & Record<string, HTMLElement>;
1912
+ value: string;
1913
+ constructor();
1914
+ initCallback(): void;
1915
+ }
1916
+
1917
+ declare class SimpleBtn extends UploaderBlock {
2310
1918
  static styleAttrs: string[];
2311
1919
  couldBeCtxOwner: boolean;
2312
- dropzone: boolean;
2313
- private _buttonTextKey;
2314
- private readonly _handleClick;
1920
+ constructor();
2315
1921
  initCallback(): void;
2316
- render(): lit_html.TemplateResult<1>;
2317
1922
  }
2318
1923
 
2319
- declare class LitSolutionBlock extends LitBlock {
2320
- static styleAttrs: string[];
2321
- init$: {
2322
- '*solution': string | null;
2323
- '*commonProgress': number;
2324
- '*uploadList': never[];
2325
- '*uploadQueue': _uploadcare_upload_client.Queue;
2326
- '*collectionErrors': OutputErrorCollection[];
2327
- '*collectionState': OutputCollectionState | null;
2328
- '*groupInfo': _uploadcare_upload_client.UploadcareGroup | null;
2329
- '*uploadTrigger': Set<string>;
2330
- '*currentActivity': null;
2331
- '*currentActivityParams': {};
2332
- '*history': never[];
2333
- '*historyBack': null;
2334
- '*closeModal': () => void;
2335
- };
1924
+ type SourceTypeConfig = {
1925
+ type: string;
1926
+ activity?: ActivityType | null;
1927
+ textKey?: string;
1928
+ icon?: string;
1929
+ activate?: () => boolean;
1930
+ activityParams?: Record<string, unknown>;
1931
+ };
1932
+ declare class SourceBtn extends UploaderBlock {
1933
+ couldBeCtxOwner: boolean;
1934
+ private type;
1935
+ private _registeredTypes;
1936
+ constructor();
1937
+ initTypes(): void;
2336
1938
  initCallback(): void;
2337
- render(): lit_html.TemplateResult<1>;
1939
+ registerType(typeConfig: SourceTypeConfig): void;
1940
+ getType(type: string): SourceTypeConfig | undefined;
1941
+ activate(): void;
1942
+ applyType(type: string): void;
2338
1943
  }
2339
1944
 
2340
- declare class FileUploaderRegular extends LitSolutionBlock {
2341
- attributesMeta: {
2342
- headless?: boolean;
2343
- 'ctx-name': string;
2344
- };
1945
+ declare class SourceList extends Block {
1946
+ initCallback(): void;
1947
+ }
1948
+
1949
+ declare class Spinner extends BaseComponent<void> {
1950
+ }
1951
+
1952
+ declare class StartFrom extends ActivityBlock {
1953
+ historyTracked: boolean;
1954
+ activityType: ActivityType;
1955
+ initCallback(): void;
1956
+ }
1957
+
1958
+ declare class Thumb extends FileItemConfig {
1959
+ private _renderedGridOnce;
1960
+ private _thumbRect;
1961
+ private _isIntersecting;
1962
+ private _firstViewMode;
1963
+ private _observer?;
1964
+ constructor();
1965
+ private _calculateThumbSize;
1966
+ private _generateThumbnail;
1967
+ private _debouncedGenerateThumb;
1968
+ private _observerCallback;
1969
+ protected _reset(): void;
1970
+ private _handleEntryId;
1971
+ initCallback(): void;
1972
+ connectedCallback(): void;
1973
+ disconnectedCallback(): void;
1974
+ }
1975
+
1976
+ type EventListenerMap = {
1977
+ [K in (typeof EventType)[keyof typeof EventType]]: (e: CustomEvent<EventPayload[K]>) => void;
1978
+ };
1979
+ declare class UploadCtxProvider extends UploaderBlock {
2345
1980
  static styleAttrs: string[];
2346
- headless: boolean;
1981
+ static EventType: Readonly<{
1982
+ readonly FILE_ADDED: "file-added";
1983
+ readonly FILE_REMOVED: "file-removed";
1984
+ readonly FILE_UPLOAD_START: "file-upload-start";
1985
+ readonly FILE_UPLOAD_PROGRESS: "file-upload-progress";
1986
+ readonly FILE_UPLOAD_SUCCESS: "file-upload-success";
1987
+ readonly FILE_UPLOAD_FAILED: "file-upload-failed";
1988
+ readonly FILE_URL_CHANGED: "file-url-changed";
1989
+ readonly MODAL_OPEN: "modal-open";
1990
+ readonly MODAL_CLOSE: "modal-close";
1991
+ readonly DONE_CLICK: "done-click";
1992
+ readonly UPLOAD_CLICK: "upload-click";
1993
+ readonly ACTIVITY_CHANGE: "activity-change";
1994
+ readonly COMMON_UPLOAD_START: "common-upload-start";
1995
+ readonly COMMON_UPLOAD_PROGRESS: "common-upload-progress";
1996
+ readonly COMMON_UPLOAD_SUCCESS: "common-upload-success";
1997
+ readonly COMMON_UPLOAD_FAILED: "common-upload-failed";
1998
+ readonly CHANGE: "change";
1999
+ readonly GROUP_CREATED: "group-created";
2000
+ }>;
2001
+ requireCtxName: boolean;
2002
+ initCallback(): void;
2003
+ destroyCallback(): void;
2004
+ }
2005
+ interface UploadCtxProvider extends UploaderBlock {
2006
+ addEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | AddEventListenerOptions): void;
2007
+ removeEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | EventListenerOptions): void;
2008
+ }
2009
+
2010
+ declare class UrlSource extends UploaderBlock {
2011
+ couldBeCtxOwner: boolean;
2012
+ activityType: ActivityType;
2347
2013
  constructor();
2348
2014
  initCallback(): void;
2349
- render(): lit_html.TemplateResult<1>;
2350
2015
  }
2351
2016
 
2017
+ declare const PACKAGE_NAME = "blocks";
2018
+ declare const PACKAGE_VERSION: string;
2019
+
2352
2020
  declare class CloudImageEditor extends CloudImageEditorBlock {
2353
2021
  static styleAttrs: string[];
2354
2022
  constructor();
2355
2023
  initCallback(): void;
2356
2024
  }
2357
2025
 
2358
- declare class FileUploaderInline extends LitSolutionBlock {
2359
- propertiesMeta: {
2360
- 'ctx-name': string;
2361
- };
2026
+ declare class FileUploaderInline extends SolutionBlock {
2362
2027
  static styleAttrs: string[];
2363
- private _couldCancel;
2364
2028
  constructor();
2365
- private _handleCancel;
2366
- private get _couldHistoryBack();
2367
- private get _couldShowList();
2368
- private _getInitActivity;
2029
+ get couldHistoryBack(): boolean;
2030
+ get couldShowList(): boolean;
2369
2031
  initCallback(): void;
2370
- render(): lit_html.TemplateResult<1>;
2371
2032
  }
2372
2033
 
2373
- declare class FileUploaderMinimal extends LitSolutionBlock {
2374
- propertiesMeta: {
2375
- 'ctx-name': string;
2376
- };
2034
+ declare class FileUploaderMinimal extends SolutionBlock {
2377
2035
  static styleAttrs: string[];
2378
- private _singleUpload;
2379
- private _isHiddenStartFrom;
2380
- private _classUploadList;
2381
- private _classStartFrom;
2382
- private _getInitActivity;
2036
+ private handleModalOpen?;
2037
+ private handleModalClose?;
2383
2038
  constructor();
2384
2039
  private _handleModalOpen;
2385
2040
  private _handleModalClose;
2386
2041
  initCallback(): void;
2387
- disconnectedCallback(): void;
2388
- render(): lit_html.TemplateResult<1>;
2042
+ destroyCallback(): void;
2389
2043
  }
2390
2044
 
2391
- declare const PACKAGE_NAME = "blocks";
2392
- declare const PACKAGE_VERSION: string;
2045
+ declare class FileUploaderRegular extends SolutionBlock {
2046
+ static styleAttrs: string[];
2047
+ constructor();
2048
+ initCallback(): void;
2049
+ }
2050
+
2051
+ type KebabCase<T extends string> = T extends `${infer Head} ${infer Tail}` ? `${Lowercase<Head>}-${KebabCase<Tail>}` : Lowercase<T>;
2052
+ declare const toKebabCase: <T extends string>(str: T) => KebabCase<T>;
2393
2053
 
2394
- export { LitActivityBlock as ActivityBlock, ActivityHeader, type ApiAddFileCommonOptions, BaseComponent, LitBlock as Block, BtnUi, CameraSource, CloudImageEditor, CloudImageEditorActivity, CloudImageEditorBlock, type CollectionValidators, Config, type ConfigAttributesType, type ConfigComplexType, type ConfigPlainType, type ConfigType, Copyright, CropFrame, PubSub as Data, DropArea, EditorAspectRatioButtonControl, EditorCropButtonControl, EditorFilterControl, EditorFreeformButtonControl, EditorImageCropper, EditorImageFader, EditorOperationControl, EditorScroller, EditorSlider, EditorToolbar, type EventMap, type EventPayload, EventType, ExternalSource, ExternalUploadSource, FileItem, FileUploaderInline, FileUploaderMinimal, FileUploaderRegular, type FileValidator, type FileValidatorDescriptor, type FileValidators, FormInput, type FuncCollectionValidator, type FuncFileValidator, type GroupFlag, Icon, type IconHrefResolver, Img, type KebabCase$1 as KebabCase, type KebabCaseKeys, LineLoaderUi, type LocaleDefinitionOverride, type LowerCase, type LowerCaseKeys, type MetadataCallback, Modal, ModalEvents, type ModalId, type OutputCollectionErrorType, type OutputCollectionState, type OutputCollectionStatus, type OutputCustomErrorType, type OutputError, type OutputErrorCollection, type OutputErrorFile, type OutputErrorTypePayload, type OutputFileEntry, type OutputFileErrorPayload, type OutputFileErrorType, type OutputFileStatus, PACKAGE_NAME, PACKAGE_VERSION, PresenceToggle, ProgressBar, ProgressBarCommon, type SecureDeliveryProxyUrlResolver, type SecureUploadsSignatureAndExpire, type SecureUploadsSignatureResolver, Select, SimpleBtn, SliderUi, LitSolutionBlock as SolutionBlock, SourceBtn, SourceList, type SourceTypes, Spinner, StartFrom, Thumb, UID, UploadCtxProvider, UploadList, UploadSource, LitUploaderBlock as UploaderBlock, UploaderPublicApi, UrlSource, defineComponents, defineLocale, loadFileUploaderFrom, toKebabCase };
2054
+ export { ActivityBlock, ActivityHeader, type ApiAddFileCommonOptions, Block, BtnUi, CameraSource, CloudImageEditor, CloudImageEditorActivity, CloudImageEditorBlock, type CollectionValidators, Config, type ConfigAttributesType, type ConfigComplexType, type ConfigPlainType, type ConfigType, Copyright, CropFrame, DropArea, EditorAspectRatioButtonControl, EditorCropButtonControl, EditorFilterControl, EditorFreeformButtonControl, EditorImageCropper, EditorImageFader, EditorOperationControl, EditorScroller, EditorSlider, EditorToolbar, type EventMap, type EventPayload, EventType, ExternalSource, ExternalUploadSource, FileItem, FileUploaderInline, FileUploaderMinimal, FileUploaderRegular, type FileValidator, type FileValidatorDescriptor, type FileValidators, FormInput, type FuncCollectionValidator, type FuncFileValidator, type GroupFlag, Icon, type IconHrefResolver, Img, type KebabCase$1 as KebabCase, type KebabCaseKeys, LineLoaderUi, type LocaleDefinitionOverride, type LowerCase, type LowerCaseKeys, type MetadataCallback, Modal, ModalEvents, type ModalId, type OutputCollectionErrorType, type OutputCollectionState, type OutputCollectionStatus, type OutputCustomErrorType, type OutputError, type OutputErrorCollection, type OutputErrorFile, type OutputErrorTypePayload, type OutputFileEntry, type OutputFileErrorPayload, type OutputFileErrorType, type OutputFileStatus, PACKAGE_NAME, PACKAGE_VERSION, PresenceToggle, ProgressBar, ProgressBarCommon, type SecureDeliveryProxyUrlResolver, type SecureUploadsSignatureAndExpire, type SecureUploadsSignatureResolver, Select, SimpleBtn, SliderUi, SolutionBlock, SourceBtn, SourceList, type SourceTypes, Spinner, StartFrom, Thumb, UploadCtxProvider, UploadList, UploadSource, UploaderBlock, UploaderPublicApi, UrlSource, defineComponents, defineLocale, loadFileUploaderFrom, toKebabCase };