@uploadcare/file-uploader 1.24.5 → 1.25.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/abstract/loadFileUploaderFrom.js +4 -0
  2. package/dist/env.js +1 -1
  3. package/dist/index.css +16 -6
  4. package/dist/index.d.ts +867 -539
  5. package/dist/index.js +7609 -6042
  6. package/dist/index.layered.css +16 -6
  7. package/dist/index.ssr.js +533 -762
  8. package/dist/lit.d.ts +1 -0
  9. package/dist/lit.js +28 -0
  10. package/dist/locales/file-uploader/ar.js +1 -1
  11. package/dist/locales/file-uploader/az.js +1 -1
  12. package/dist/locales/file-uploader/ca.js +1 -1
  13. package/dist/locales/file-uploader/cs.js +1 -1
  14. package/dist/locales/file-uploader/da.js +1 -1
  15. package/dist/locales/file-uploader/de.js +1 -1
  16. package/dist/locales/file-uploader/el.js +1 -1
  17. package/dist/locales/file-uploader/en.js +1 -1
  18. package/dist/locales/file-uploader/es.js +1 -1
  19. package/dist/locales/file-uploader/et.js +1 -1
  20. package/dist/locales/file-uploader/fi.js +1 -1
  21. package/dist/locales/file-uploader/fr.js +1 -1
  22. package/dist/locales/file-uploader/he.js +1 -1
  23. package/dist/locales/file-uploader/hy.js +1 -1
  24. package/dist/locales/file-uploader/is.js +1 -1
  25. package/dist/locales/file-uploader/it.js +1 -1
  26. package/dist/locales/file-uploader/ja.js +1 -1
  27. package/dist/locales/file-uploader/ka.js +1 -1
  28. package/dist/locales/file-uploader/kk.js +1 -1
  29. package/dist/locales/file-uploader/ko.js +1 -1
  30. package/dist/locales/file-uploader/lv.js +1 -1
  31. package/dist/locales/file-uploader/nb.js +1 -1
  32. package/dist/locales/file-uploader/nl.js +1 -1
  33. package/dist/locales/file-uploader/pl.js +1 -1
  34. package/dist/locales/file-uploader/pt.js +1 -1
  35. package/dist/locales/file-uploader/ro.js +1 -1
  36. package/dist/locales/file-uploader/ru.js +1 -1
  37. package/dist/locales/file-uploader/sk.js +1 -1
  38. package/dist/locales/file-uploader/sr.js +1 -1
  39. package/dist/locales/file-uploader/sv.js +1 -1
  40. package/dist/locales/file-uploader/tr.js +1 -1
  41. package/dist/locales/file-uploader/uk.js +1 -1
  42. package/dist/locales/file-uploader/vi.js +1 -1
  43. package/dist/locales/file-uploader/zh-TW.js +1 -1
  44. package/dist/locales/file-uploader/zh.js +1 -1
  45. package/package.json +29 -24
  46. package/web/file-uploader.iife.min.d.ts +873 -545
  47. package/web/file-uploader.iife.min.js +8 -4
  48. package/web/file-uploader.min.d.ts +873 -545
  49. package/web/file-uploader.min.js +7 -4
  50. package/web/uc-basic.layered.min.css +1 -1
  51. package/web/uc-basic.min.css +1 -1
  52. package/web/uc-cloud-image-editor.layered.min.css +1 -1
  53. package/web/uc-cloud-image-editor.min.css +1 -1
  54. package/web/uc-cloud-image-editor.min.d.ts +439 -235
  55. package/web/uc-cloud-image-editor.min.js +7 -4
  56. package/web/uc-file-uploader-inline.layered.min.css +1 -1
  57. package/web/uc-file-uploader-inline.min.css +1 -1
  58. package/web/uc-file-uploader-inline.min.d.ts +873 -545
  59. package/web/uc-file-uploader-inline.min.js +7 -4
  60. package/web/uc-file-uploader-minimal.layered.min.css +1 -1
  61. package/web/uc-file-uploader-minimal.min.css +1 -1
  62. package/web/uc-file-uploader-minimal.min.d.ts +873 -545
  63. package/web/uc-file-uploader-minimal.min.js +7 -4
  64. package/web/uc-file-uploader-regular.layered.min.css +1 -1
  65. package/web/uc-file-uploader-regular.min.css +1 -1
  66. package/web/uc-file-uploader-regular.min.d.ts +873 -545
  67. package/web/uc-file-uploader-regular.min.js +7 -4
  68. package/web/uc-img.min.d.ts +56 -91
  69. package/web/uc-img.min.js +3 -3
package/dist/index.d.ts CHANGED
@@ -1,266 +1,43 @@
1
- import { BaseComponent } from '@symbiotejs/symbiote';
2
- export { BaseComponent, Data, UID } from '@symbiotejs/symbiote';
1
+ import { PubSub } from '@symbiotejs/symbiote';
2
+ export { PubSub as Data, PubSub, UID } from '@symbiotejs/symbiote';
3
+ export { loadFileUploaderFrom } from './abstract/loadFileUploaderFrom.js';
4
+ import * as lit_html from 'lit-html';
5
+ import * as lit_html_directives_ref_js from 'lit-html/directives/ref.js';
6
+ import { nothing, LitElement, PropertyValues, TemplateResult } from 'lit';
7
+ import { TelemetryRequest } from '@uploadcare/quality-insights';
3
8
  import * as _uploadcare_upload_client from '@uploadcare/upload-client';
4
9
  import { UploadcareFile, Metadata, UploadError, NetworkError, UploadcareGroup, FileFromOptions } from '@uploadcare/upload-client';
5
10
  export { Metadata, NetworkError, UploadError, UploadcareError, UploadcareFile, UploadcareGroup } from '@uploadcare/upload-client';
6
- export { loadFileUploaderFrom } from './abstract/loadFileUploaderFrom.js';
7
- import { TelemetryRequest } from '@uploadcare/quality-insights';
11
+ import { Ref } from 'lit/directives/ref.js';
8
12
  export { PACKAGE_NAME, PACKAGE_VERSION } from './env.js';
9
13
 
14
+ declare function defineComponents(blockExports: Record<string, any>): void;
15
+
16
+ type LocaleDefinition = Record<string, string>;
17
+ type LocaleDefinitionResolver = () => Promise<LocaleDefinition>;
18
+ declare const defineLocale: (localeName: string, definitionOrResolver: LocaleDefinition | LocaleDefinitionResolver) => void;
19
+
20
+ type Constructor$1<T = {}> = new (...args: any[]) => T;
21
+
10
22
  declare class A11y {
11
23
  private _destroyKeyUX;
12
24
  private readonly _scopedWindow;
13
25
  constructor();
14
- registerBlock(scope: Block): void;
26
+ registerBlock(scope: LitBlock): void;
15
27
  destroy(): void;
16
28
  }
17
29
 
18
- type LocaleChangeCallback = () => void;
19
30
  declare class LocaleManager {
20
31
  private _blockInstance;
21
32
  private _localeName;
22
- private _callbacks;
23
- private _boundBlocks;
24
- constructor(blockInstance: Block);
25
- onLocaleChange(callback: LocaleChangeCallback): () => void;
26
- bindL10n(block: Block, key: string, resolver: LocaleChangeCallback): void;
27
- destroyL10nBindings(block: Block): void;
28
- destroy(): void;
29
- }
30
-
31
- declare class Modal extends Block {
32
- static styleAttrs: string[];
33
- static StateConsumerScope: string;
34
- private _mouseDownTarget;
35
- handleModalOpen: ModalCb;
36
- handleModalClose: ModalCb;
37
- handleModalCloseAll: ModalCb;
38
- constructor();
39
- _handleBackdropClick: () => void;
40
- _closeDialog: () => void;
41
- _handleDialogClose: () => void;
42
- _handleDialogMouseDown: (e: MouseEvent) => void;
43
- _handleDialogMouseUp: (e: MouseEvent) => void;
44
- show(): void;
45
- hide(): void;
46
- private _handleModalOpen;
47
- private _handleModalClose;
48
- private _handleModalCloseAll;
49
- initCallback(): void;
50
- destroyCallback(): void;
51
- }
52
-
53
- declare const ModalEvents: Readonly<{
54
- readonly ADD: "modal:add";
55
- readonly DELETE: "modal:delete";
56
- readonly OPEN: "modal:open";
57
- readonly CLOSE: "modal:close";
58
- readonly CLOSE_ALL: "modal:closeAll";
59
- readonly DESTROY: "modal:destroy";
60
- }>;
61
- type ModalId = ActivityType;
62
- type ModalCb = (data: {
63
- id: ModalId;
64
- modal: Modal;
65
- }) => void;
66
- type ModalEventType = (typeof ModalEvents)[keyof typeof ModalEvents];
67
- declare class ModalManager {
68
- private _modals;
69
- private _activeModals;
70
- private _subscribers;
71
- private _block;
72
- constructor(block: Block);
73
- private _debugPrint;
74
- /**
75
- * Register a modal with the manager
76
- * @param id Unique identifier for the modal
77
- * @param modal Modal component instance
78
- */
79
- registerModal(id: ModalId, modal: Modal): void;
80
- /** Remove a modal by ID. */
81
- deleteModal(id: ModalId): boolean;
82
- /** Open a modal by its ID. */
83
- open(id: ModalId): boolean;
84
- /** Close a specific modal by ID. */
85
- close(id: ModalId): boolean;
86
- /** Toggle a modal - open if closed, close if open. */
87
- toggle(id: ModalId): boolean;
88
- /** True if there are any active modals. */
89
- get hasActiveModals(): boolean;
90
- /** Close the most recently opened modal and return to the previous one. */
91
- back(): boolean;
92
- /** Close all open modals. */
93
- closeAll(): number;
94
- /**
95
- * Subscribe to modal events
96
- * @returns Unsubscribe function
97
- */
98
- subscribe(event: ModalEventType, callback: ModalCb): () => void;
99
- /** Unsubscribe from modal events */
100
- unsubscribe(event: ModalEventType, callback: ModalCb | undefined): void;
101
- /** Notify all subscribers of a modal event. */
102
- private _notify;
103
- /** Destroy the modal manager, clean up resources */
104
- destroy(): void;
105
- }
106
-
107
- type CommonEventType = InternalEventKey | EventKey;
108
- type TelemetryState = TelemetryRequest & {
109
- eventTimestamp: number;
110
- location: string;
111
- };
112
- type TelemetryEventBody = Partial<Pick<TelemetryState, 'payload' | 'config'>> & {
113
- modalId?: string;
114
- eventType?: CommonEventType;
115
- };
116
- declare class TelemetryManager {
117
- private readonly _sessionId;
118
- private readonly _telemetryInstance;
119
- private readonly _block;
120
- private _config;
121
- private _initialized;
122
- private _lastPayload;
123
- private readonly _queue;
124
- constructor(block: Block);
125
- private _init;
126
- private _setConfig;
127
- private _formattingPayload;
128
- private _excludedEvents;
129
- sendEvent(body: TelemetryEventBody): void;
130
- sendEventError(error: unknown, context?: string): void;
131
- /**
132
- * Method to send telemetry event for Cloud Image Editor.
133
- */
134
- sendEventCloudImageEditor(e: MouseEvent, tabId: string, options?: Record<string, unknown>): void;
135
- /**
136
- * Deeply compares two objects and returns true if they are equal, false otherwise.
137
- */
138
- private _checkObj;
139
- private get _timestamp();
140
- private get _solution();
141
- private get _activity();
142
- private get _location();
143
- }
144
-
145
- declare class Block extends BaseComponent<any> {
146
- private __cfgProxy?;
147
- protected l10nProcessorSubs: Map<string, Set<{
148
- remove: () => void;
149
- }>>;
150
- static StateConsumerScope: string | null;
151
- static styleAttrs: string[];
152
- protected requireCtxName: boolean;
153
- activityType: ActivityType;
154
- init$: {};
155
- l10n(str: string, variables?: Record<string, string | number>): string;
156
- private pluralize;
157
- protected bindL10n(key: string, resolver: () => void): void;
158
- constructor();
159
- emit(type: Parameters<EventEmitter['emit']>[0], payload?: Parameters<EventEmitter['emit']>[1], options?: Parameters<EventEmitter['emit']>[2]): void;
160
- hasBlockInCtx(callback: (block: Block) => boolean): boolean;
161
- setOrAddState(prop: string, newVal: any): void;
162
- connectedCallback(): void;
163
- disconnectedCallback(): void;
164
- initCallback(): void;
165
- get testId(): string;
166
- get modalManager(): ModalManager | undefined;
167
- get telemetryManager(): TelemetryManager | {
168
- sendEvent: () => void;
169
- sendEventCloudImageEditor: () => void;
170
- sendEventError: () => void;
171
- };
172
- protected get localeManager(): LocaleManager | null;
173
- protected get a11y(): A11y | null;
174
- protected get blocksRegistry(): Set<Block>;
175
- destroyCallback(): void;
176
- /**
177
- * Called when the last block is removed from the context. Note that inheritors must run their callback before that.
178
- */
179
- protected destroyCtxCallback(): void;
180
- protected proxyUrl(url: string): Promise<string>;
181
- get cfg(): ConfigType;
182
- subConfigValue<T extends keyof ConfigType>(key: T, callback: (value: ConfigType[T]) => void): void;
183
- debugPrint(...args: unknown[]): void;
184
- static reg(name?: string): void;
185
- }
186
-
187
- declare const InternalEventType: Readonly<{
188
- readonly INIT_SOLUTION: "init-solution";
189
- readonly CHANGE_CONFIG: "change-config";
190
- readonly ACTION_EVENT: "action-event";
191
- readonly ERROR_EVENT: "error-event";
192
- }>;
193
- declare const EventType: Readonly<{
194
- readonly FILE_ADDED: "file-added";
195
- readonly FILE_REMOVED: "file-removed";
196
- readonly FILE_UPLOAD_START: "file-upload-start";
197
- readonly FILE_UPLOAD_PROGRESS: "file-upload-progress";
198
- readonly FILE_UPLOAD_SUCCESS: "file-upload-success";
199
- readonly FILE_UPLOAD_FAILED: "file-upload-failed";
200
- readonly FILE_URL_CHANGED: "file-url-changed";
201
- readonly MODAL_OPEN: "modal-open";
202
- readonly MODAL_CLOSE: "modal-close";
203
- readonly DONE_CLICK: "done-click";
204
- readonly UPLOAD_CLICK: "upload-click";
205
- readonly ACTIVITY_CHANGE: "activity-change";
206
- readonly COMMON_UPLOAD_START: "common-upload-start";
207
- readonly COMMON_UPLOAD_PROGRESS: "common-upload-progress";
208
- readonly COMMON_UPLOAD_SUCCESS: "common-upload-success";
209
- readonly COMMON_UPLOAD_FAILED: "common-upload-failed";
210
- readonly CHANGE: "change";
211
- readonly GROUP_CREATED: "group-created";
212
- }>;
213
- type EventKey = (typeof EventType)[keyof typeof EventType];
214
- type InternalEventKey = (typeof InternalEventType)[keyof typeof InternalEventType];
215
- type EventPayload = {
216
- [EventType.FILE_ADDED]: OutputFileEntry<'idle'>;
217
- [EventType.FILE_REMOVED]: OutputFileEntry<'removed'>;
218
- [EventType.FILE_UPLOAD_START]: OutputFileEntry<'uploading'>;
219
- [EventType.FILE_UPLOAD_PROGRESS]: OutputFileEntry<'uploading'>;
220
- [EventType.FILE_UPLOAD_SUCCESS]: OutputFileEntry<'success'>;
221
- [EventType.FILE_UPLOAD_FAILED]: OutputFileEntry<'failed'>;
222
- [EventType.FILE_URL_CHANGED]: OutputFileEntry<'success'>;
223
- [EventType.MODAL_OPEN]: {
224
- modalId: ModalId;
225
- };
226
- [EventType.MODAL_CLOSE]: {
227
- modalId: ModalId;
228
- hasActiveModals: boolean;
229
- };
230
- [EventType.ACTIVITY_CHANGE]: {
231
- activity: ActivityType;
232
- };
233
- [EventType.UPLOAD_CLICK]: void;
234
- [EventType.DONE_CLICK]: OutputCollectionState;
235
- [EventType.COMMON_UPLOAD_START]: OutputCollectionState<'uploading'>;
236
- [EventType.COMMON_UPLOAD_PROGRESS]: OutputCollectionState<'uploading'>;
237
- [EventType.COMMON_UPLOAD_SUCCESS]: OutputCollectionState<'success'>;
238
- [EventType.COMMON_UPLOAD_FAILED]: OutputCollectionState<'failed'>;
239
- [EventType.CHANGE]: OutputCollectionState;
240
- [EventType.GROUP_CREATED]: OutputCollectionState<'success', 'has-group'>;
241
- };
242
- declare class EventEmitter {
243
- private _timeoutStore;
244
- private _targets;
245
- private _debugPrint;
246
- constructor(debugPrint: (...args: unknown[]) => void);
247
- bindTarget(target: Block): void;
248
- unbindTarget(target: Block): void;
249
- private _dispatch;
250
- emit<T extends EventKey, TDebounce extends boolean | number | undefined = undefined>(type: T, payload?: TDebounce extends false | undefined ? EventPayload[T] : () => EventPayload[T], options?: {
251
- debounce?: TDebounce;
252
- }): void;
33
+ constructor(blockInstance: LitBlock);
253
34
  }
254
35
 
255
36
  type EventMap = {
256
37
  [T in keyof EventPayload]: CustomEvent<EventPayload[T]>;
257
38
  };
258
39
 
259
- type LocaleDefinition = Record<string, string>;
260
- type LocaleDefinitionResolver = () => Promise<LocaleDefinition>;
261
- declare const defineLocale: (localeName: string, definitionOrResolver: LocaleDefinition | LocaleDefinitionResolver) => void;
262
-
263
- declare function buildOutputCollectionState<TCollectionStatus extends OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'>(uploaderBlock: UploaderBlock): OutputCollectionState<TCollectionStatus, TGroupFlag>;
40
+ declare function buildOutputCollectionState<TCollectionStatus extends OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'>(uploaderBlock: LitUploaderBlock): OutputCollectionState<TCollectionStatus, TGroupFlag>;
264
41
 
265
42
  type TypedSchema = Record<string, {
266
43
  type: unknown;
@@ -285,7 +62,7 @@ declare class TypedData<T extends TypedSchema> {
285
62
  getValue<K extends ExtractKeysFromSchema<T>>(prop: K): ExtractDataFromSchema<T>[K];
286
63
  subscribe<K extends ExtractKeysFromSchema<T>>(prop: K, handler: (newVal: ExtractDataFromSchema<T>[K]) => void): {
287
64
  remove: () => void;
288
- callback: Function;
65
+ callback: (val: unknown) => void;
289
66
  };
290
67
  remove(): void;
291
68
  }
@@ -439,7 +216,7 @@ declare class ValidationManager {
439
216
  private _queue;
440
217
  private _runQueueDebounced;
441
218
  private _entryValidationState;
442
- constructor(blockInstance: UploaderBlock);
219
+ constructor(blockInstance: LitUploaderBlock);
443
220
  runFileValidators(runOn: FileValidatorDescriptor['runOn'], entryIds?: string[]): void;
444
221
  runCollectionValidators(): void;
445
222
  cleanupValidationForEntry(entry: TypedData<typeof uploadEntrySchema>): void;
@@ -450,9 +227,17 @@ declare class ValidationManager {
450
227
  private _getValidatorDescriptorsForEntry;
451
228
  }
452
229
 
230
+ type CameraDeviceOption = {
231
+ text: string;
232
+ value: string;
233
+ };
234
+ type AudioDeviceOption = {
235
+ text: string;
236
+ value: string;
237
+ };
453
238
  type CameraMode = 'photo' | 'video';
454
239
  type CameraStatus = 'shot' | 'retake' | 'accept' | 'play' | 'stop' | 'pause' | 'resume';
455
- declare class CameraSource extends UploaderBlock {
240
+ declare class CameraSource extends LitUploaderBlock {
456
241
  couldBeCtxOwner: boolean;
457
242
  activityType: "camera";
458
243
  private _unsubPermissions;
@@ -469,8 +254,43 @@ declare class CameraSource extends UploaderBlock {
469
254
  private _cameraDevices;
470
255
  private _audioDevices;
471
256
  private _permissionResponses;
472
- constructor();
257
+ private timerRef;
258
+ private lineRef;
259
+ private videoRef;
260
+ private switcherRef;
261
+ private _startTime;
262
+ private _elapsedTime;
263
+ protected video: MediaStream | null;
264
+ protected videoTransformCss: string | null;
265
+ protected videoHidden: boolean;
266
+ protected messageHidden: boolean;
267
+ protected requestBtnHidden: boolean;
268
+ protected cameraSelectOptions: CameraDeviceOption[];
269
+ protected cameraSelectHidden: boolean;
270
+ protected l10nMessage: string;
271
+ protected timerHidden: boolean;
272
+ protected cameraHidden: boolean;
273
+ protected cameraActionsHidden: boolean;
274
+ protected audioSelectOptions: AudioDeviceOption[];
275
+ protected audioSelectHidden: boolean;
276
+ protected audioSelectDisabled: boolean;
277
+ protected audioToggleMicrophoneHidden: boolean;
278
+ protected tabCameraHidden: boolean;
279
+ protected tabVideoHidden: boolean;
280
+ protected currentIcon: string;
281
+ protected currentTimelineIcon: string;
282
+ protected toggleMicrophoneIcon: string;
283
+ protected mutableClassButton: string;
473
284
  _chooseActionWithCamera: () => void;
285
+ private _handleCameraSelectChange;
286
+ private _handleAudioSelectChange;
287
+ private _handleRequestPermissions;
288
+ private _handleStartCamera;
289
+ private _handleToggleRecording;
290
+ private _handleToggleAudio;
291
+ private _handleRetake;
292
+ private _handleAccept;
293
+ private _handleClickTab;
474
294
  _updateTimer: () => void;
475
295
  _startTimer: () => void;
476
296
  _stopTimer: () => void;
@@ -514,7 +334,8 @@ declare class CameraSource extends UploaderBlock {
514
334
  _handleCameraModes: (cameraModes: CameraMode[]) => void;
515
335
  initCallback(): void;
516
336
  _destroy(): void;
517
- destroyCallback(): Promise<void>;
337
+ disconnectedCallback(): void;
338
+ render(): lit_html.TemplateResult<1>;
518
339
  }
519
340
 
520
341
  /**
@@ -523,9 +344,9 @@ declare class CameraSource extends UploaderBlock {
523
344
  declare const complexConfigKeys: readonly ["metadata", "localeDefinitionOverride", "secureUploadsSignatureResolver", "secureDeliveryProxyUrlResolver", "iconHrefResolver", "fileValidators", "collectionValidators", "mediaRecorderOptions"];
524
345
  /** Mapping of attribute names to state */
525
346
  declare const attrStateMapping: Record<string, string>;
526
- declare class Config extends Block {
527
- requireCtxName: boolean;
528
- constructor();
347
+ declare class Config extends LitBlock {
348
+ init$: LitBlock["init$"] & ConfigType;
349
+ private computationControllers;
529
350
  private _flushValueToAttribute;
530
351
  private _flushValueToState;
531
352
  private _setValue;
@@ -533,23 +354,36 @@ declare class Config extends Block {
533
354
  _assertSameValueDifferentReference(key: string, previousValue: unknown, nextValue: unknown): void;
534
355
  initCallback(): void;
535
356
  attributeChangedCallback(name: keyof typeof attrStateMapping, oldVal: string, newVal: string): void;
536
- get computationControllers(): any;
357
+ static get observedAttributes(): string[];
537
358
  }
538
359
  interface Config extends ConfigType {
539
360
  }
540
361
 
541
362
  type FilesViewMode = 'grid' | 'list';
542
- declare class UploadList extends UploaderBlock {
363
+ declare class UploadList extends LitUploaderBlock {
543
364
  couldBeCtxOwner: boolean;
544
365
  historyTracked: boolean;
545
366
  activityType: "upload-list";
546
- constructor();
367
+ private doneBtnVisible;
368
+ private doneBtnEnabled;
369
+ private uploadBtnVisible;
370
+ private addMoreBtnVisible;
371
+ private addMoreBtnEnabled;
372
+ private commonErrorMessage;
373
+ private hasFiles;
374
+ private _latestSummary;
375
+ protected get headerText(): string;
376
+ private _handleAdd;
377
+ private _handleUpload;
378
+ private _handleDone;
379
+ private _handleCancel;
547
380
  private _throttledHandleCollectionUpdate;
548
- private _updateUploadsState;
381
+ protected _updateUploadsState(): void;
549
382
  private _getHeaderText;
550
383
  get couldOpenActivity(): boolean;
551
384
  initCallback(): void;
552
- destroyCallback(): void;
385
+ disconnectedCallback(): void;
386
+ render(): lit_html.TemplateResult<1>;
553
387
  }
554
388
 
555
389
  declare const ExternalUploadSource: Readonly<{
@@ -600,7 +434,7 @@ type ApiAddFileCommonOptions = {
600
434
  };
601
435
  declare class UploaderPublicApi {
602
436
  private _ctx;
603
- constructor(ctx: UploaderBlock);
437
+ constructor(ctx: LitUploaderBlock);
604
438
  private get _uploadCollection();
605
439
  get cfg(): ConfigType;
606
440
  get l10n(): (str: string, variables?: Record<string, string | number>) => string;
@@ -1099,7 +933,7 @@ type OutputCollectionState<TStatus extends OutputCollectionStatus = OutputCollec
1099
933
  declare class SecureUploadsManager {
1100
934
  private readonly _block;
1101
935
  private _secureToken;
1102
- constructor(block: UploaderBlock);
936
+ constructor(block: LitUploaderBlock);
1103
937
  private _debugPrint;
1104
938
  getSecureToken(): Promise<SecureUploadsSignatureAndExpire | null>;
1105
939
  }
@@ -1145,7 +979,7 @@ declare class TypedCollection<T extends TypedSchema> {
1145
979
  destroy(): void;
1146
980
  }
1147
981
 
1148
- declare class UploaderBlock extends ActivityBlock {
982
+ declare class LitUploaderBlock extends LitActivityBlock {
1149
983
  static extSrcList: Readonly<typeof ExternalUploadSource>;
1150
984
  static sourceTypes: Readonly<typeof UploadSource>;
1151
985
  protected couldBeCtxOwner: boolean;
@@ -1176,7 +1010,6 @@ declare class UploaderBlock extends ActivityBlock {
1176
1010
  destroyCtxCallback(): void;
1177
1011
  disconnectedCallback(): void;
1178
1012
  connectedCallback(): void;
1179
- destroyCallback(): void;
1180
1013
  private _initCtxOwner;
1181
1014
  private _observeUploadCollection;
1182
1015
  private _unobserveUploadCollection;
@@ -1192,6 +1025,10 @@ declare class UploaderBlock extends ActivityBlock {
1192
1025
  getOutputData(): OutputFileEntry[];
1193
1026
  }
1194
1027
 
1028
+ /**
1029
+ * Mapping of loading resources per operation
1030
+ */
1031
+ type LoadingOperations = Map<string, Map<string, boolean>>;
1195
1032
  /**
1196
1033
  * Image size
1197
1034
  */
@@ -1226,6 +1063,7 @@ interface ApplyResult {
1226
1063
  cdnUrl: string;
1227
1064
  transformations: Transformations;
1228
1065
  }
1066
+ type ChangeResult = ApplyResult;
1229
1067
  interface CropAspectRatio {
1230
1068
  type: 'aspect-ratio';
1231
1069
  width: number;
@@ -1237,27 +1075,41 @@ interface CropAspectRatio {
1237
1075
  type ActivityParams$1 = {
1238
1076
  internalId: string;
1239
1077
  };
1240
- declare class CloudImageEditorActivity extends UploaderBlock {
1078
+ declare class CloudImageEditorActivity extends LitUploaderBlock {
1241
1079
  couldBeCtxOwner: boolean;
1242
1080
  activityType: "cloud-image-edit";
1243
1081
  private _entry?;
1244
- private _instance?;
1082
+ private editorConfig;
1245
1083
  get activityParams(): ActivityParams$1;
1246
1084
  initCallback(): void;
1247
1085
  handleApply(e: CustomEvent<ApplyResult>): void;
1248
- handleCancel(): void;
1086
+ handleCancel(event?: Event): void;
1087
+ handleChange(event: CustomEvent<ChangeResult>): void;
1249
1088
  mountEditor(): void;
1250
1089
  unmountEditor(): void;
1090
+ render(): lit_html.TemplateResult<1> | typeof nothing;
1091
+ private _createEditorConfig;
1251
1092
  }
1252
1093
 
1253
1094
  type ActivityParams = {
1254
1095
  externalSourceType: string;
1255
1096
  };
1256
- declare class ExternalSource extends UploaderBlock {
1097
+ declare class ExternalSource extends LitUploaderBlock {
1257
1098
  couldBeCtxOwner: boolean;
1258
1099
  activityType: "external";
1259
1100
  private _messageBridge?;
1260
- constructor();
1101
+ private iframeRef;
1102
+ private _latestSelectionSummary;
1103
+ private selectedList;
1104
+ private isSelectionReady;
1105
+ private isDoneBtnEnabled;
1106
+ private couldSelectAll;
1107
+ private couldDeselectAll;
1108
+ private showSelectionStatus;
1109
+ private showDoneBtn;
1110
+ private doneBtnTextClass;
1111
+ private toolbarVisible;
1112
+ private get counterText();
1261
1113
  get activityParams(): ActivityParams;
1262
1114
  initCallback(): void;
1263
1115
  private extractUrlFromSelectedFile;
@@ -1268,9 +1120,15 @@ declare class ExternalSource extends UploaderBlock {
1268
1120
  private applyEmbedCss;
1269
1121
  private setupL10n;
1270
1122
  private remoteUrl;
1123
+ private _handleDone;
1124
+ private _handleCancel;
1125
+ private _handleSelectAll;
1126
+ private _handleDeselectAll;
1127
+ private _setSelectionSummary;
1271
1128
  private mountIframe;
1272
1129
  private unmountIframe;
1273
1130
  private resetSelectionStatus;
1131
+ render(): lit_html.TemplateResult<1>;
1274
1132
  }
1275
1133
 
1276
1134
  declare const ACTIVE_PROP = "___ACTIVITY_IS_ACTIVE___";
@@ -1278,7 +1136,7 @@ type ActivityParamsMap = {
1278
1136
  'cloud-image-edit': ActivityParams$1;
1279
1137
  external: ActivityParams;
1280
1138
  };
1281
- declare class ActivityBlock extends Block {
1139
+ declare class LitActivityBlock extends LitBlock {
1282
1140
  protected historyTracked: boolean;
1283
1141
  private [ACTIVE_PROP]?;
1284
1142
  init$: {
@@ -1314,66 +1172,331 @@ declare class ActivityBlock extends Block {
1314
1172
  onDeactivate?: () => void;
1315
1173
  }): void;
1316
1174
  unregisterActivity(): void;
1317
- destroyCallback(): void;
1175
+ disconnectedCallback(): void;
1318
1176
  get activityKey(): string;
1319
1177
  get activityParams(): ActivityParamsMap[keyof ActivityParamsMap];
1320
- get initActivity(): string;
1321
- get doneActivity(): string;
1178
+ get initActivity(): string | null;
1179
+ get doneActivity(): string | null;
1322
1180
  historyBack(): void;
1323
1181
  }
1324
- type RegisteredActivityType = (typeof ActivityBlock)['activities'][keyof (typeof ActivityBlock)['activities']];
1182
+ type RegisteredActivityType = (typeof LitActivityBlock)['activities'][keyof (typeof LitActivityBlock)['activities']];
1325
1183
  type ActivityType = RegisteredActivityType | (string & {}) | null;
1326
1184
 
1327
- declare function defineComponents(blockExports: Record<string, any>): void;
1328
-
1329
- declare class SolutionBlock extends Block {
1330
- static styleAttrs: string[];
1331
- protected requireCtxName: boolean;
1332
- init$: {
1333
- '*solution': string | null;
1334
- '*commonProgress': number;
1335
- '*uploadList': never[];
1336
- '*uploadQueue': _uploadcare_upload_client.Queue;
1337
- '*collectionErrors': OutputErrorCollection[];
1338
- '*collectionState': OutputCollectionState | null;
1339
- '*groupInfo': _uploadcare_upload_client.UploadcareGroup | null;
1340
- '*uploadTrigger': Set<string>;
1341
- '*secureUploadsManager': SecureUploadsManager | null;
1342
- '*currentActivity': null;
1343
- '*currentActivityParams': {};
1344
- '*history': never[];
1345
- '*historyBack': null;
1346
- '*closeModal': () => void;
1347
- };
1348
- private static _template;
1349
- initCallback(): void;
1350
- static set template(value: string);
1351
- static get template(): string;
1352
- }
1353
-
1354
- declare class ActivityHeader extends ActivityBlock {
1185
+ declare const InternalEventType: Readonly<{
1186
+ readonly INIT_SOLUTION: "init-solution";
1187
+ readonly CHANGE_CONFIG: "change-config";
1188
+ readonly ACTION_EVENT: "action-event";
1189
+ readonly ERROR_EVENT: "error-event";
1190
+ }>;
1191
+ declare const EventType: Readonly<{
1192
+ readonly FILE_ADDED: "file-added";
1193
+ readonly FILE_REMOVED: "file-removed";
1194
+ readonly FILE_UPLOAD_START: "file-upload-start";
1195
+ readonly FILE_UPLOAD_PROGRESS: "file-upload-progress";
1196
+ readonly FILE_UPLOAD_SUCCESS: "file-upload-success";
1197
+ readonly FILE_UPLOAD_FAILED: "file-upload-failed";
1198
+ readonly FILE_URL_CHANGED: "file-url-changed";
1199
+ readonly MODAL_OPEN: "modal-open";
1200
+ readonly MODAL_CLOSE: "modal-close";
1201
+ readonly DONE_CLICK: "done-click";
1202
+ readonly UPLOAD_CLICK: "upload-click";
1203
+ readonly ACTIVITY_CHANGE: "activity-change";
1204
+ readonly COMMON_UPLOAD_START: "common-upload-start";
1205
+ readonly COMMON_UPLOAD_PROGRESS: "common-upload-progress";
1206
+ readonly COMMON_UPLOAD_SUCCESS: "common-upload-success";
1207
+ readonly COMMON_UPLOAD_FAILED: "common-upload-failed";
1208
+ readonly CHANGE: "change";
1209
+ readonly GROUP_CREATED: "group-created";
1210
+ }>;
1211
+ type EventKey = (typeof EventType)[keyof typeof EventType];
1212
+ type InternalEventKey = (typeof InternalEventType)[keyof typeof InternalEventType];
1213
+ type EventPayload = {
1214
+ [EventType.FILE_ADDED]: OutputFileEntry<'idle'>;
1215
+ [EventType.FILE_REMOVED]: OutputFileEntry<'removed'>;
1216
+ [EventType.FILE_UPLOAD_START]: OutputFileEntry<'uploading'>;
1217
+ [EventType.FILE_UPLOAD_PROGRESS]: OutputFileEntry<'uploading'>;
1218
+ [EventType.FILE_UPLOAD_SUCCESS]: OutputFileEntry<'success'>;
1219
+ [EventType.FILE_UPLOAD_FAILED]: OutputFileEntry<'failed'>;
1220
+ [EventType.FILE_URL_CHANGED]: OutputFileEntry<'success'>;
1221
+ [EventType.MODAL_OPEN]: {
1222
+ modalId: ModalId;
1223
+ };
1224
+ [EventType.MODAL_CLOSE]: {
1225
+ modalId: ModalId;
1226
+ hasActiveModals: boolean;
1227
+ };
1228
+ [EventType.ACTIVITY_CHANGE]: {
1229
+ activity: ActivityType;
1230
+ };
1231
+ [EventType.UPLOAD_CLICK]: void;
1232
+ [EventType.DONE_CLICK]: OutputCollectionState;
1233
+ [EventType.COMMON_UPLOAD_START]: OutputCollectionState<'uploading'>;
1234
+ [EventType.COMMON_UPLOAD_PROGRESS]: OutputCollectionState<'uploading'>;
1235
+ [EventType.COMMON_UPLOAD_SUCCESS]: OutputCollectionState<'success'>;
1236
+ [EventType.COMMON_UPLOAD_FAILED]: OutputCollectionState<'failed'>;
1237
+ [EventType.CHANGE]: OutputCollectionState;
1238
+ [EventType.GROUP_CREATED]: OutputCollectionState<'success', 'has-group'>;
1239
+ };
1240
+ declare class EventEmitter {
1241
+ private _timeoutStore;
1242
+ private _targets;
1243
+ private _debugPrint;
1244
+ constructor(debugPrint: (...args: unknown[]) => void);
1245
+ bindTarget(target: LitBlock): void;
1246
+ unbindTarget(target: LitBlock): void;
1247
+ private _dispatch;
1248
+ emit<T extends EventKey, TDebounce extends boolean | number | undefined = undefined>(type: T, payload?: TDebounce extends false | undefined ? EventPayload[T] : () => EventPayload[T], options?: {
1249
+ debounce?: TDebounce;
1250
+ }): void;
1355
1251
  }
1356
1252
 
1357
- declare class CloudImageEditorBlock extends Block {
1358
- ctxOwner: boolean;
1253
+ type CommonEventType = InternalEventKey | EventKey;
1254
+ type TelemetryState = TelemetryRequest & {
1255
+ eventTimestamp: number;
1256
+ location: string;
1257
+ };
1258
+ type TelemetryEventBody = Partial<Pick<TelemetryState, 'payload' | 'config'>> & {
1259
+ modalId?: string;
1260
+ eventType?: CommonEventType;
1261
+ };
1262
+ declare class TelemetryManager {
1263
+ private readonly _sessionId;
1264
+ private readonly _telemetryInstance;
1265
+ private readonly _block;
1266
+ private _config;
1267
+ private _initialized;
1268
+ private _lastPayload;
1269
+ private readonly _queue;
1270
+ constructor(block: LitBlock);
1271
+ private _init;
1272
+ private _setConfig;
1273
+ private _formattingPayload;
1274
+ private _excludedEvents;
1275
+ sendEvent(body: TelemetryEventBody): void;
1276
+ sendEventError(error: unknown, context?: string): void;
1277
+ /**
1278
+ * Method to send telemetry event for Cloud Image Editor.
1279
+ */
1280
+ sendEventCloudImageEditor(e: MouseEvent, tabId: string, options?: Record<string, unknown>): void;
1281
+ /**
1282
+ * Deeply compares two objects and returns true if they are equal, false otherwise.
1283
+ */
1284
+ private _checkObj;
1285
+ private get _timestamp();
1286
+ private get _solution();
1287
+ private get _activity();
1288
+ private get _location();
1289
+ }
1290
+
1291
+ declare const LitBlockBase: typeof LitElement & Constructor$1<{
1292
+ yield(slot: string, defaultContent?: unknown): unknown;
1293
+ }> & Constructor$1<{
1294
+ getCssData(propName: string, silentCheck?: boolean): string | number | boolean | null | undefined;
1295
+ }> & Constructor$1<{
1296
+ $: {
1297
+ [x: string]: any;
1298
+ };
1299
+ sub<T = unknown>(key: string, callback: (value: T) => void, init?: boolean): () => void;
1300
+ pub(key: string, value: unknown): void;
1301
+ set$(obj: {
1302
+ [x: string]: any;
1303
+ }): void;
1304
+ has(key: string): boolean;
1305
+ add(key: string, val: unknown, rewrite?: boolean): void;
1306
+ add$(obj: {
1307
+ [x: string]: any;
1308
+ }, rewrite?: boolean): void;
1309
+ initCallback(): void;
1310
+ sharedCtx: PubSub<Record<string, unknown>>;
1311
+ ctxName: string;
1312
+ }> & Constructor$1<LitElement> & {
1313
+ reg(tagName: string): void;
1314
+ };
1315
+ declare class LitBlock extends LitBlockBase {
1316
+ private __cfgProxy;
1359
1317
  static styleAttrs: string[];
1360
- private _debouncedShowLoader;
1318
+ activityType: ActivityType;
1319
+ init$: {};
1361
1320
  constructor();
1362
- private _showLoader;
1321
+ l10n(str: string, variables?: Record<string, string | number>): string;
1322
+ private pluralize;
1323
+ emit(type: Parameters<EventEmitter['emit']>[0], payload?: Parameters<EventEmitter['emit']>[1], options?: Parameters<EventEmitter['emit']>[2]): void;
1324
+ hasBlockInCtx(callback: (block: LitBlock) => boolean): boolean;
1325
+ setOrAddState(prop: string, newVal: unknown): void;
1326
+ connectedCallback(): void;
1327
+ initCallback(): void;
1328
+ get testId(): string;
1329
+ get modalManager(): ModalManager | undefined;
1330
+ get telemetryManager(): TelemetryManager | {
1331
+ sendEvent: () => void;
1332
+ sendEventCloudImageEditor: () => void;
1333
+ sendEventError: () => void;
1334
+ };
1335
+ protected get localeManager(): LocaleManager | null;
1336
+ protected get a11y(): A11y | null;
1337
+ protected get blocksRegistry(): Set<LitBlock>;
1338
+ disconnectedCallback(): void;
1339
+ /**
1340
+ * Called when the last block is removed from the context. Note that inheritors must run their callback before that.
1341
+ */
1342
+ protected destroyCtxCallback(): void;
1343
+ protected proxyUrl(url: string): Promise<string>;
1344
+ get cfg(): ConfigType;
1345
+ subConfigValue<T extends keyof ConfigType>(key: T, callback: (value: ConfigType[T]) => void): () => void;
1346
+ debugPrint(...args: unknown[]): void;
1347
+ }
1348
+
1349
+ declare class Modal extends LitBlock {
1350
+ static styleAttrs: string[];
1351
+ private _mouseDownTarget;
1352
+ protected dialogEl: lit_html_directives_ref_js.Ref<HTMLDialogElement>;
1353
+ handleModalOpen: ModalCb;
1354
+ handleModalClose: ModalCb;
1355
+ handleModalCloseAll: ModalCb;
1356
+ _handleBackdropClick: () => void;
1357
+ _closeDialog: () => void;
1358
+ _handleDialogClose: () => void;
1359
+ _handleDialogMouseDown: (e: MouseEvent) => void;
1360
+ _handleDialogMouseUp: (e: MouseEvent) => void;
1361
+ show(): void;
1362
+ hide(): void;
1363
+ private _handleModalOpen;
1364
+ private _handleModalClose;
1365
+ private _handleModalCloseAll;
1366
+ initCallback(): void;
1367
+ disconnectedCallback(): void;
1368
+ private handleDialogRef;
1369
+ render(): lit_html.TemplateResult<1>;
1370
+ }
1371
+
1372
+ declare const ModalEvents: Readonly<{
1373
+ readonly ADD: "modal:add";
1374
+ readonly DELETE: "modal:delete";
1375
+ readonly OPEN: "modal:open";
1376
+ readonly CLOSE: "modal:close";
1377
+ readonly CLOSE_ALL: "modal:closeAll";
1378
+ readonly DESTROY: "modal:destroy";
1379
+ }>;
1380
+ type ModalId = ActivityType;
1381
+ type ModalCb = (data: {
1382
+ id: ModalId;
1383
+ modal: Modal;
1384
+ }) => void;
1385
+ type ModalEventType = (typeof ModalEvents)[keyof typeof ModalEvents];
1386
+ declare class ModalManager {
1387
+ private _modals;
1388
+ private _activeModals;
1389
+ private _subscribers;
1390
+ private _block;
1391
+ constructor(block: LitBlock);
1392
+ private _debugPrint;
1393
+ /**
1394
+ * Register a modal with the manager
1395
+ * @param id Unique identifier for the modal
1396
+ * @param modal Modal component instance
1397
+ */
1398
+ registerModal(id: ModalId, modal: Modal): void;
1399
+ /** Remove a modal by ID. */
1400
+ deleteModal(id: ModalId): boolean;
1401
+ /** Open a modal by its ID. */
1402
+ open(id: ModalId): boolean;
1403
+ /** Close a specific modal by ID. */
1404
+ close(id: ModalId): boolean;
1405
+ /** Toggle a modal - open if closed, close if open. */
1406
+ toggle(id: ModalId): boolean;
1407
+ /** True if there are any active modals. */
1408
+ get hasActiveModals(): boolean;
1409
+ /** Close the most recently opened modal and return to the previous one. */
1410
+ back(): boolean;
1411
+ /** Close all open modals. */
1412
+ closeAll(): number;
1413
+ /**
1414
+ * Subscribe to modal events
1415
+ * @returns Unsubscribe function
1416
+ */
1417
+ subscribe(event: ModalEventType, callback: ModalCb): () => void;
1418
+ /** Unsubscribe from modal events */
1419
+ unsubscribe(event: ModalEventType, callback: ModalCb | undefined): void;
1420
+ /** Notify all subscribers of a modal event. */
1421
+ private _notify;
1422
+ /** Destroy the modal manager, clean up resources */
1423
+ destroy(): void;
1424
+ }
1425
+
1426
+ declare class ActivityHeader extends LitActivityBlock {
1427
+ }
1428
+
1429
+ declare function initState(fnCtx: CloudImageEditorBlock): {
1430
+ '*originalUrl': null;
1431
+ '*loadingOperations': LoadingOperations;
1432
+ '*faderEl': null;
1433
+ '*cropperEl': null;
1434
+ '*imgEl': null;
1435
+ '*imgContainerEl': null;
1436
+ '*networkProblems': boolean;
1437
+ '*imageSize': null;
1438
+ '*editorTransformations': {};
1439
+ '*cropPresetList': never[];
1440
+ '*currentAspectRatio': null;
1441
+ '*tabList': readonly ["crop", "tuning", "filters"];
1442
+ '*tabId': "crop";
1443
+ '*on.retryNetwork': () => void;
1444
+ '*on.apply': (transformations: Transformations) => void;
1445
+ '*on.cancel': () => void;
1446
+ };
1447
+
1448
+ declare class CloudImageEditorBlock extends LitBlock {
1449
+ ctxOwner: boolean;
1450
+ static styleAttrs: string[];
1451
+ entry: unknown;
1452
+ extension: string | null;
1453
+ editorMode: boolean;
1454
+ modalCaption: string;
1455
+ isImage: boolean;
1456
+ msg: string;
1457
+ src: string;
1458
+ fileType: string;
1459
+ showLoader: boolean;
1460
+ uuid: string | null;
1461
+ cdnUrl: string | null;
1462
+ cropPreset: string;
1463
+ tabs: string | null;
1464
+ presenceNetworkProblems: boolean;
1465
+ presenceModalCaption: boolean;
1466
+ presenceEditorToolbar: boolean;
1467
+ presenceViewerToolbar: boolean;
1468
+ private isInitialized;
1469
+ private pendingInitUpdate;
1470
+ private readonly _debouncedShowLoader;
1471
+ private readonly imgRef;
1472
+ private readonly cropperRef;
1473
+ private readonly faderRef;
1474
+ private readonly imgContainerRef;
1475
+ private readonly handleImageLoad;
1476
+ private readonly handleImageError;
1477
+ private readonly handleRetryNetwork;
1478
+ private scheduleInitialization;
1479
+ init$: ReturnType<typeof initState>;
1480
+ initCallback(): void;
1481
+ private assignSharedElements;
1482
+ private attachImageListeners;
1483
+ private detachImageListeners;
1484
+ private get imageClassName();
1363
1485
  /**
1364
1486
  * To proper work, we need non-zero size the element. So, we'll wait for it.
1365
1487
  */
1366
1488
  private _waitForSize;
1367
- initCallback(): void;
1489
+ firstUpdated(_changedProperties: Map<PropertyKey, unknown>): void;
1490
+ disconnectedCallback(): void;
1491
+ render(): lit_html.TemplateResult<1>;
1492
+ protected updated(changedProperties: PropertyValues<this>): void;
1493
+ private syncTabListFromProp;
1494
+ private syncCropPresetState;
1368
1495
  updateImage(): Promise<void>;
1369
1496
  initEditor(): Promise<void>;
1370
1497
  }
1371
1498
 
1372
- declare class CropFrame extends Block {
1373
- private readonly _handlePointerUp;
1374
- private readonly _handlePointerMove;
1375
- private readonly _handleSvgPointerMove;
1376
- private readonly _backdropMaskId;
1499
+ declare class CropFrame extends LitBlock {
1377
1500
  private _backdropMask?;
1378
1501
  private _backdropMaskInner?;
1379
1502
  private _frameThumbs?;
@@ -1384,7 +1507,14 @@ declare class CropFrame extends Block {
1384
1507
  private _dragStartCrop?;
1385
1508
  private _frameImage?;
1386
1509
  private _guidesHidden;
1387
- constructor();
1510
+ private _dragging;
1511
+ private readonly svgRef;
1512
+ private _svgReady;
1513
+ private _pendingMaskHref;
1514
+ private get _svgElement();
1515
+ private get dragging();
1516
+ private set dragging(value);
1517
+ private _applyGuidesDragState;
1388
1518
  private _shouldThumbBeDisabled;
1389
1519
  private _createBackdrop;
1390
1520
  /**
@@ -1399,41 +1529,57 @@ declare class CropFrame extends Block {
1399
1529
  private _createGuides;
1400
1530
  private _createFrame;
1401
1531
  private _handlePointerDown;
1402
- private _handlePointerUp_;
1403
- private _handlePointerMove_;
1532
+ private readonly _handlePointerUp;
1533
+ private readonly _handlePointerMove;
1404
1534
  private _calcCropBox;
1405
- private _handleSvgPointerMove_;
1535
+ private readonly _handleSvgPointerMove;
1406
1536
  private _updateCursor;
1407
1537
  private _createMask;
1408
1538
  private _updateMask;
1409
1539
  private _render;
1410
1540
  toggleThumbs(visible: boolean): void;
1411
1541
  initCallback(): void;
1412
- destroyCallback(): void;
1542
+ protected firstUpdated(_changedProperties: PropertyValues<this>): void;
1543
+ private _initializeSvg;
1544
+ disconnectedCallback(): void;
1545
+ render(): TemplateResult;
1413
1546
  }
1414
1547
 
1415
- declare class EditorButtonControl extends Block {
1416
- private _titleEl?;
1417
- constructor();
1418
- initCallback(): void;
1548
+ declare class EditorButtonControl extends LitBlock {
1549
+ active: boolean;
1550
+ title: string;
1551
+ icon: string;
1552
+ titleProp: string;
1553
+ protected get buttonClasses(): Record<string, boolean>;
1554
+ private updateHostStateClasses;
1555
+ protected onClick(_event: MouseEvent): void;
1556
+ connectedCallback(): void;
1557
+ protected updated(changedProperties: PropertyValues): void;
1558
+ render(): lit_html.TemplateResult<1>;
1419
1559
  }
1420
1560
 
1421
1561
  declare class EditorFreeformButtonControl extends EditorButtonControl {
1422
1562
  initCallback(): void;
1423
- handleClick(): void;
1563
+ onClick(): void;
1564
+ private computeTitle;
1565
+ render(): lit_html.TemplateResult<1>;
1424
1566
  }
1425
- interface EditorAspectRatioButtonControl {
1567
+ declare class EditorAspectRatioButtonControl extends EditorButtonControl {
1568
+ private _aspectRatio?;
1426
1569
  get aspectRatio(): CropAspectRatio | undefined;
1427
1570
  set aspectRatio(value: CropAspectRatio | undefined);
1428
- }
1429
- declare class EditorAspectRatioButtonControl extends EditorButtonControl {
1430
- constructor();
1431
1571
  initCallback(): void;
1432
- handleClick(): void;
1433
- private _renderRectBasedOnAspectRatio;
1434
- private _aspectRatio?;
1572
+ onClick(): void;
1573
+ private updateAspectRatioPresentation;
1574
+ private renderIcon;
1575
+ render(): lit_html.TemplateResult<1>;
1435
1576
  }
1436
1577
 
1578
+ declare const TabId: Readonly<{
1579
+ readonly CROP: "crop";
1580
+ readonly TUNING: "tuning";
1581
+ readonly FILTERS: "filters";
1582
+ }>;
1437
1583
  declare const ALL_COLOR_OPERATIONS: readonly ["brightness", "exposure", "gamma", "contrast", "saturation", "vibrance", "warmth", "enhance"];
1438
1584
  type ColorOperation = (typeof ALL_COLOR_OPERATIONS)[number];
1439
1585
  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"];
@@ -1489,13 +1635,10 @@ declare const COLOR_OPERATIONS_CONFIG: Readonly<{
1489
1635
  };
1490
1636
  }>;
1491
1637
 
1492
- interface EditorCropButtonControl {
1493
- get operation(): CropOperation | undefined;
1494
- set operation(value: CropOperation | undefined);
1495
- }
1496
1638
  declare class EditorCropButtonControl extends EditorButtonControl {
1497
- private _operation;
1498
- initCallback(): void;
1639
+ operation: CropOperation | undefined;
1640
+ protected willUpdate(_changedProperties: PropertyValues): void;
1641
+ onClick(e: MouseEvent): void;
1499
1642
  }
1500
1643
 
1501
1644
  declare class EditorFilterControl extends EditorButtonControl {
@@ -1504,11 +1647,27 @@ declare class EditorFilterControl extends EditorButtonControl {
1504
1647
  private _originalUrl;
1505
1648
  private _observer?;
1506
1649
  private _cancelPreload?;
1507
- constructor();
1650
+ private _lastPreviewRequestId;
1651
+ private previewVisibilityCheckRaf?;
1652
+ private previewVisibilityCheckTimeout?;
1653
+ private previewImage;
1654
+ private previewLoaded;
1655
+ isOriginal: boolean;
1656
+ iconSize: number;
1657
+ get filter(): string;
1658
+ set filter(value: string);
1659
+ onClick(e: MouseEvent): void;
1508
1660
  private _previewSrc;
1509
1661
  private _observerCallback;
1510
1662
  initCallback(): void;
1511
- destroyCallback(): void;
1663
+ disconnectedCallback(): void;
1664
+ protected updated(changedProperties: PropertyValues<this>): void;
1665
+ private updateFilterLabels;
1666
+ private loadPreview;
1667
+ private schedulePreviewVisibilityCheck;
1668
+ private clearPreviewVisibilityChecks;
1669
+ private get shouldShowPreview();
1670
+ render(): lit_html.TemplateResult<1>;
1512
1671
  }
1513
1672
 
1514
1673
  type Operations = {
@@ -1516,7 +1675,7 @@ type Operations = {
1516
1675
  mirror: boolean;
1517
1676
  rotate: number;
1518
1677
  };
1519
- declare class EditorImageCropper extends Block {
1678
+ declare class EditorImageCropper extends LitBlock {
1520
1679
  ctxOwner: boolean;
1521
1680
  private _commitDebounced;
1522
1681
  private _handleResizeThrottled;
@@ -1525,9 +1684,12 @@ declare class EditorImageCropper extends Block {
1525
1684
  private _ctx;
1526
1685
  private _isActive;
1527
1686
  private _observer?;
1687
+ private _image;
1528
1688
  private _cancelPreload?;
1689
+ private readonly canvasRef;
1690
+ private readonly frameRef;
1529
1691
  constructor();
1530
- private _handleResize;
1692
+ protected firstUpdated(_changedProperties: PropertyValues): void;
1531
1693
  private _syncTransformations;
1532
1694
  private _initCanvas;
1533
1695
  private _alignImage;
@@ -1552,11 +1714,12 @@ declare class EditorImageCropper extends Block {
1552
1714
  private _waitForImage;
1553
1715
  private _handleImageLoading;
1554
1716
  initCallback(): void;
1555
- destroyCallback(): void;
1717
+ disconnectedCallback(): void;
1718
+ render(): TemplateResult;
1556
1719
  }
1557
1720
 
1558
1721
  type OperationKey = keyof typeof COLOR_OPERATIONS_CONFIG;
1559
- declare class EditorImageFader extends Block {
1722
+ declare class EditorImageFader extends LitBlock {
1560
1723
  private _isActive;
1561
1724
  private _hidden;
1562
1725
  private _operation;
@@ -1564,7 +1727,6 @@ declare class EditorImageFader extends Block {
1564
1727
  private _value?;
1565
1728
  private _transformations;
1566
1729
  private _keypoints;
1567
- private _container?;
1568
1730
  private _previewImage?;
1569
1731
  private _cancelLastImages?;
1570
1732
  private _cancelBatchPreload?;
@@ -1572,6 +1734,8 @@ declare class EditorImageFader extends Block {
1572
1734
  private _fromViewer?;
1573
1735
  private _raf;
1574
1736
  private _addKeypointDebounced;
1737
+ private readonly _previewHostRef;
1738
+ private readonly _layersHostRef;
1575
1739
  constructor();
1576
1740
  private _handleImageLoading;
1577
1741
  private _flush;
@@ -1581,7 +1745,6 @@ declare class EditorImageFader extends Block {
1581
1745
  * Check if current operation and filter equals passed ones
1582
1746
  */
1583
1747
  private _isSame;
1584
- private _addKeypoint;
1585
1748
  set(value: string | number): void;
1586
1749
  private _update;
1587
1750
  private _createPreviewImage;
@@ -1604,121 +1767,228 @@ declare class EditorImageFader extends Block {
1604
1767
  deactivate({ hide }?: {
1605
1768
  hide?: boolean;
1606
1769
  }): void;
1770
+ private _ensurePreviewAttached;
1771
+ private _clearLayersHost;
1772
+ render(): TemplateResult;
1607
1773
  }
1608
1774
 
1609
1775
  declare class EditorOperationControl extends EditorButtonControl {
1610
1776
  private _operation;
1777
+ get operation(): ColorOperation | '';
1778
+ set operation(value: ColorOperation | '');
1779
+ private updateOperationMetadata;
1611
1780
  initCallback(): void;
1781
+ onClick(e: MouseEvent): void;
1612
1782
  }
1613
1783
 
1614
- declare class EditorScroller extends Block {
1615
- initCallback(): void;
1784
+ declare class EditorScroller extends LitBlock {
1785
+ private readonly handleWheel;
1786
+ connectedCallback(): void;
1787
+ disconnectedCallback(): void;
1616
1788
  }
1617
1789
 
1618
1790
  type SliderOperation = ColorOperation | 'filter';
1619
1791
  type SliderFilter = FilterId | typeof FAKE_ORIGINAL_FILTER;
1620
1792
  declare const FAKE_ORIGINAL_FILTER = "original";
1621
- declare class EditorSlider extends Block {
1622
- private _operation;
1623
- private _filter?;
1624
- private _originalUrl;
1625
- constructor();
1793
+ declare class EditorSlider extends LitBlock {
1794
+ private state;
1795
+ handleInput: (e: CustomEvent<{
1796
+ value: number;
1797
+ }>) => void;
1626
1798
  setOperation(operation: SliderOperation, filter?: SliderFilter): void;
1627
1799
  private _initializeValues;
1628
1800
  apply(): void;
1629
1801
  cancel(): void;
1630
1802
  initCallback(): void;
1631
- }
1632
-
1633
- declare class EditorToolbar extends Block {
1634
- private _debouncedShowLoader;
1803
+ protected updated(changedProperties: Map<PropertyKey, unknown>): void;
1804
+ render(): lit_html.TemplateResult<1>;
1805
+ }
1806
+
1807
+ type TabIdValue = (typeof TabId)[keyof typeof TabId];
1808
+ declare class EditorToolbar extends LitBlock {
1809
+ private showLoader;
1810
+ private showMainToolbar;
1811
+ private showSubToolbar;
1812
+ private showTabToggles;
1813
+ private tabList;
1814
+ private activeTab;
1815
+ private useSliderPanel;
1816
+ private tooltipVisible;
1817
+ private operationTooltip;
1818
+ private tabIndicatorOffset;
1819
+ private tabIndicatorWidth;
1820
+ private readonly sliderRef;
1821
+ private readonly tabIndicatorRef;
1822
+ protected readonly tabToggleRefs: Record<TabIdValue, Ref<HTMLElement>>;
1823
+ private readonly handleWindowResize;
1824
+ private cropPresets;
1635
1825
  private _cancelPreload?;
1636
- private _updateInfoTooltip;
1637
- constructor();
1826
+ private readonly _debouncedShowLoader;
1827
+ private readonly _updateInfoTooltip;
1828
+ private readonly subTopToolbarStyles;
1829
+ private readonly subBottomToolbarStyles;
1830
+ private readonly tabContentStyles;
1831
+ private readonly tabToggleStyles;
1832
+ private readonly tabTogglesStyles;
1833
+ init$: Record<string, unknown>;
1638
1834
  private _onSliderClose;
1639
- private _createOperationControl;
1640
- private _createFilterControl;
1641
- private _createToggleControl;
1642
- private _createAspectRatioControl;
1643
- private _createFreeformControl;
1644
- private _clearListAspectRatio;
1645
- private _renderControlsList;
1646
1835
  private _activateTab;
1647
- private _unmountTabControls;
1836
+ private applyTabState;
1648
1837
  private _syncTabIndicator;
1838
+ private get hasAspectRatioPicker();
1839
+ private renderControlsByTab;
1840
+ private renderCropTabControls;
1841
+ private renderFilterTabControls;
1842
+ private renderTuningTabControls;
1843
+ private renderControlGroup;
1844
+ private renderFreeformControl;
1845
+ private renderAspectRatioControl;
1846
+ private renderCropOperationControl;
1847
+ private renderFilterControl;
1848
+ private renderOperationControl;
1849
+ private renderAspectRatioList;
1649
1850
  private _preloadEditedImage;
1650
- private _showLoader;
1651
- private _updateInfoTooltipHandler;
1652
1851
  initCallback(): void;
1653
- destroyCallback(): void;
1654
- }
1655
-
1656
- declare class BtnUi extends Block {
1657
- private _iconReversed;
1658
- private _iconSingle;
1659
- private _iconHidden;
1660
- constructor();
1661
- private _iconCss;
1662
- initCallback(): void;
1663
- set reverse(_value: boolean);
1664
- }
1665
-
1666
- declare class LineLoaderUi extends Block {
1667
- private _active;
1668
- private readonly _handleTransitionEndRight;
1669
- initCallback(): void;
1670
- private _start;
1671
- private _stop;
1672
- }
1673
-
1674
- declare class PresenceToggle extends Block {
1852
+ connectedCallback(): void;
1853
+ firstUpdated(_changedProperties: PropertyValues): void;
1854
+ protected updated(changedProperties: PropertyValues): void;
1855
+ disconnectedCallback(): void;
1856
+ private assignSharedElements;
1857
+ private handleCancel;
1858
+ private handleApply;
1859
+ private handleApplySlider;
1860
+ private handleCancelSlider;
1861
+ private handleTabClick;
1862
+ private renderTabToggle;
1863
+ private renderTabContent;
1864
+ render(): TemplateResult<1>;
1865
+ }
1866
+
1867
+ type Theme = string | null;
1868
+ declare class BtnUi extends LitBlock {
1869
+ text: string;
1870
+ icon: string;
1871
+ active: boolean;
1872
+ reverse: boolean;
1873
+ theme: Theme;
1874
+ ariaRole: string;
1875
+ ariaControls: string;
1876
+ titleProp: string;
1877
+ protected firstUpdated(_changed: PropertyValues<this>): void;
1878
+ protected updated(changed: PropertyValues<this>): void;
1879
+ private applyReverse;
1880
+ private applyThemeClass;
1881
+ private get iconClassMap();
1882
+ private get computedIconHidden();
1883
+ private get computedIconSingle();
1884
+ render(): lit_html.TemplateResult<1>;
1885
+ }
1886
+
1887
+ declare class LineLoaderUi extends LitBlock {
1888
+ active: boolean;
1889
+ private readonly lineRef;
1890
+ private _isAnimating;
1891
+ private readonly handleTransitionEndRight;
1892
+ protected firstUpdated(_changedProperties: PropertyValues<this>): void;
1893
+ protected updated(changedProperties: PropertyValues<this>): void;
1894
+ private start;
1895
+ private stop;
1896
+ private resetLine;
1897
+ render(): lit_html.TemplateResult<1>;
1898
+ }
1899
+
1900
+ type PresenceToggleStyle = {
1901
+ transition?: string;
1902
+ visible?: string;
1903
+ hidden?: string;
1904
+ };
1905
+ declare class PresenceToggle extends LitBlock {
1675
1906
  private _visible;
1907
+ private _styles;
1676
1908
  private _visibleStyle;
1677
1909
  private _hiddenStyle;
1678
1910
  private _externalTransitions;
1679
- constructor();
1911
+ private initialRenderComplete;
1912
+ set visible(value: boolean);
1913
+ get visible(): boolean;
1914
+ set styles(styles: PresenceToggleStyle);
1915
+ get styles(): PresenceToggleStyle;
1680
1916
  private _handleVisible;
1917
+ private dispatchInitialRenderEvent;
1681
1918
  initCallback(): void;
1682
1919
  }
1683
1920
 
1684
- declare class SliderUi extends Block {
1921
+ declare class SliderUi extends LitBlock {
1685
1922
  private _observer?;
1686
1923
  private _thumbSize;
1687
- private _zero;
1688
1924
  private _zeroDotEl?;
1689
1925
  private _stepsCount?;
1926
+ private readonly inputRef;
1927
+ private readonly thumbRef;
1928
+ private readonly stepsRef;
1929
+ disabled: boolean;
1930
+ min: number;
1931
+ max: number;
1932
+ defaultValue: number;
1933
+ zero: number;
1934
+ private _currentValue;
1690
1935
  constructor();
1691
- initCallback(): void;
1692
- private _inputEl;
1693
- private _thumbEl;
1694
- private _stepsEl;
1936
+ private emitSliderEvent;
1937
+ private readonly handleSliderInput;
1938
+ private readonly handleSliderChange;
1939
+ private readonly handleInputFocus;
1940
+ private readonly handleInputBlur;
1941
+ protected firstUpdated(changedProperties: Map<PropertyKey, unknown>): void;
1942
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
1695
1943
  private _updateValue;
1696
1944
  private _updateZeroDot;
1697
1945
  private _updateSteps;
1698
- destroyCallback(): void;
1946
+ disconnectedCallback(): void;
1947
+ private _setCurrentValue;
1948
+ private _syncInputValue;
1949
+ private _extractEventValue;
1950
+ render(): lit_html.TemplateResult<1>;
1699
1951
  }
1700
1952
 
1701
- declare class Copyright extends Block {
1953
+ declare class Copyright extends LitBlock {
1702
1954
  initCallback(): void;
1703
- static template: string;
1955
+ render(): lit_html.TemplateResult<1>;
1704
1956
  }
1705
1957
 
1706
- declare class DropArea extends UploaderBlock {
1958
+ declare class DropArea extends LitUploaderBlock {
1707
1959
  static styleAttrs: string[];
1960
+ disabled: boolean;
1961
+ clickable: boolean;
1962
+ withIcon: boolean;
1963
+ fullscreen: boolean;
1964
+ initflow: boolean;
1965
+ text?: string;
1966
+ private isEnabled;
1967
+ private isVisible;
1968
+ private get localizedText();
1708
1969
  private _destroyDropzone;
1709
1970
  private _destroyContentWrapperDropzone;
1710
- private _onAreaClicked;
1711
- constructor();
1971
+ private contentWrapperRef;
1972
+ private readonly handleAreaInteraction;
1973
+ private sourceListAllowsLocal;
1974
+ private clickableListenersAttached;
1712
1975
  isActive(): boolean;
1713
1976
  initCallback(): void;
1977
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
1978
+ protected updated(changedProperties: PropertyValues<this>): void;
1714
1979
  /** Ignore drop events if there are other visible drop areas on the page. */
1715
1980
  private _shouldIgnore;
1716
1981
  private _couldHandleFiles;
1717
- destroyCallback(): void;
1982
+ private updateIsEnabled;
1983
+ private updateVisibility;
1984
+ private updateDragStateAttribute;
1985
+ private updateClickableListeners;
1986
+ disconnectedCallback(): void;
1987
+ render(): lit_html.TemplateResult<1>;
1718
1988
  }
1719
1989
 
1720
1990
  type EntrySubscription = ReturnType<UploadEntryTypedData['subscribe']>;
1721
- declare class FileItemConfig extends UploaderBlock {
1991
+ declare class FileItemConfig extends LitUploaderBlock {
1722
1992
  protected _entrySubs: Set<EntrySubscription>;
1723
1993
  protected _entry: UploadEntryTypedData | null;
1724
1994
  protected _withEntry<A extends unknown[], R>(fn: (entry: UploadEntryTypedData, ...args: A) => R): (...args: A) => R | undefined;
@@ -1730,11 +2000,27 @@ declare class FileItemConfig extends UploaderBlock {
1730
2000
  declare class FileItem extends FileItemConfig {
1731
2001
  couldBeCtxOwner: boolean;
1732
2002
  pauseRender: boolean;
2003
+ uid: string;
2004
+ protected itemName: string;
2005
+ protected errorText: string;
2006
+ protected hint: string;
2007
+ protected progressValue: number;
2008
+ protected progressVisible: boolean;
2009
+ protected badgeIcon: string;
2010
+ protected isFinished: boolean;
2011
+ protected isFailed: boolean;
2012
+ protected isUploading: boolean;
2013
+ protected isFocused: boolean;
2014
+ protected isEditable: boolean;
2015
+ protected showFileNames: boolean;
2016
+ protected ariaLabelStatusFile: string;
1733
2017
  private _renderedOnce;
1734
2018
  private _observer?;
1735
2019
  protected _isIntersecting: boolean;
1736
2020
  protected _thumbRect?: DOMRectReadOnly;
1737
- constructor();
2021
+ private _handleEdit;
2022
+ private _handleRemove;
2023
+ private _handleUploadClick;
1738
2024
  private _calculateState;
1739
2025
  private _debouncedCalculateState;
1740
2026
  private _updateHintAndProgress;
@@ -1743,170 +2029,153 @@ declare class FileItem extends FileItemConfig {
1743
2029
  private _observerCallback;
1744
2030
  private _handleEntryId;
1745
2031
  private _updateShowFileNames;
2032
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
1746
2033
  initCallback(): void;
1747
- destroyCallback(): void;
1748
2034
  connectedCallback(): void;
1749
2035
  disconnectedCallback(): void;
1750
- private _settingsOfShrink;
1751
- private _processShrink;
1752
2036
  upload: () => Promise<void> | undefined;
1753
- static template: string;
1754
2037
  static activeInstances: Set<FileItem>;
2038
+ protected shouldUpdate(_changedProperties: PropertyValues): boolean;
2039
+ render(): lit_html.TemplateResult<1>;
1755
2040
  }
1756
2041
 
1757
- declare class FormInput extends UploaderBlock {
1758
- requireCtxName: boolean;
2042
+ declare class FormInput extends LitUploaderBlock {
1759
2043
  _validationInputElement: HTMLInputElement | null;
1760
2044
  _dynamicInputsContainer: HTMLDivElement | null;
1761
2045
  _createValidationInput(): HTMLInputElement;
1762
2046
  initCallback(): void;
1763
2047
  }
1764
2048
 
1765
- declare class Icon extends Block {
1766
- constructor();
2049
+ declare class Icon extends LitBlock {
2050
+ name: string;
2051
+ private resolvedHref;
2052
+ private iconHrefResolver;
1767
2053
  initCallback(): void;
2054
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
2055
+ private updateResolvedHref;
2056
+ render(): lit_html.TemplateResult<1>;
1768
2057
  }
1769
2058
 
1770
- declare class ImgConfig extends BaseComponent<any> {
1771
- static get observedAttributes(): string[];
2059
+ declare const ImgTypeEnum: Readonly<{
2060
+ PREVIEW: "PREVIEW";
2061
+ MAIN: "MAIN";
2062
+ }>;
2063
+
2064
+ type CssPropValue = string | number | undefined | null;
2065
+ declare const ImgConfig_base: typeof LitElement & Constructor$1<LitElement> & {
2066
+ reg(tagName: string): void;
2067
+ } & Constructor$1<{
2068
+ getCssData(propName: string, silentCheck?: boolean): string | number | boolean | null | undefined;
2069
+ }>;
2070
+ declare class ImgConfig extends ImgConfig_base {
2071
+ private _state;
2072
+ private _subscribers;
2073
+ private _isnObserver;
2074
+ private _observed;
2075
+ createRenderRoot(): HTMLElement | ShadowRoot;
1772
2076
  constructor();
1773
- cssInit$: any;
1774
- /**
1775
- * @param {String} key
1776
- * @returns {any}
1777
- */
1778
- $$(key: string): any;
1779
- /** @param {Object<String, String | Number>} kvObj */
1780
- set$$(kvObj: any): void;
1781
- /**
1782
- * @param {String} key
1783
- * @param {(val: any) => void} kbFn
1784
- */
1785
- sub$$(key: string, kbFn: (val: any) => void): void;
2077
+ $$(key: string): unknown;
2078
+ set$$(kvObj: Record<string, CssPropValue>): void;
2079
+ sub$$<T = unknown>(key: string, kbFn: (val: T) => void): void;
2080
+ private _notify;
1786
2081
  analyticsParams(): string;
1787
- initAttributes(el: any): void;
1788
- /**
1789
- * @param {HTMLElement} el
1790
- * @param {() => void} cbkFn
1791
- */
2082
+ initAttributes(el: HTMLElement): void;
1792
2083
  initIntersection(el: HTMLElement, cbkFn: () => void): void;
1793
- /** @private */
1794
- private _isnObserver;
1795
- /** @private */
1796
- private _observed;
1797
- attributeChangedCallback(name: any, oldVal: any, newVal: any): void;
2084
+ connectedCallback(): void;
2085
+ private _initCssProperties;
2086
+ disconnectedCallback(): void;
2087
+ static get observedAttributes(): string[];
2088
+ attributeChangedCallback(name: string, _oldVal: string | null, newVal: string | null): void;
1798
2089
  }
1799
2090
 
2091
+ type ImgType = (typeof ImgTypeEnum)[keyof typeof ImgTypeEnum];
2092
+ type LoaderParams = {
2093
+ src?: string;
2094
+ srcset?: string;
2095
+ elNode: HTMLImageElement;
2096
+ };
2097
+ type CurrentImg = {
2098
+ type: ImgType;
2099
+ img: HTMLImageElement;
2100
+ };
1800
2101
  declare class ImgBase extends ImgConfig {
1801
- _img: HTMLImageElement;
1802
- _imgPreview: HTMLImageElement;
1803
- /**
1804
- * @private
1805
- * @param {String} src
1806
- */
2102
+ protected _img: HTMLImageElement;
2103
+ protected _imgPreview: HTMLImageElement;
1807
2104
  private _fmtAbs;
1808
- /**
1809
- * Validate size
1810
- *
1811
- * @param {String} [size]
1812
- * @returns {String | Number}
1813
- */
1814
- _validateSize(size?: string): string | number;
1815
- /**
1816
- * Image operations
1817
- *
1818
- * @param {String} [size]
1819
- * @param {String} [blur]
1820
- */
1821
- _getCdnModifiers(size?: string, blur?: string): string;
1822
- /**
1823
- * @private
1824
- * @param {String} [size]
1825
- * @param {String} [blur]
1826
- * @returns {any}
1827
- */
2105
+ private _validateSize;
2106
+ private _getCdnModifiers;
2107
+ private _getTypedCssValue;
1828
2108
  private _getUrlBase;
1829
- /**
1830
- * @private
1831
- * @param {String} url
1832
- * @returns {String}
1833
- */
1834
2109
  private _proxyUrl;
1835
- /**
1836
- * @param {HTMLElement} el
1837
- * @param {Number} [k]
1838
- * @param {Boolean} [wOnly]
1839
- */
1840
- _getElSize(el: HTMLElement, k?: number, wOnly?: boolean): string | null;
1841
- /** @param {HTMLImageElement} img */
1842
- _setupEventProxy(img: HTMLImageElement): void;
1843
- /** @type {HTMLImageElement} */
2110
+ protected _getElSize(el: HTMLElement, k?: number, wOnly?: boolean): string | null;
2111
+ private _setupEventProxy;
1844
2112
  get img(): HTMLImageElement;
1845
- get currentImg(): {
1846
- type: "PREVIEW";
1847
- img: HTMLImageElement;
1848
- } | {
1849
- type: "MAIN";
1850
- img: HTMLImageElement;
1851
- };
1852
- get hasPreviewImage(): any;
1853
- get bgSelector(): any;
2113
+ get currentImg(): CurrentImg;
2114
+ get hasPreviewImage(): string | number | boolean | undefined;
2115
+ get bgSelector(): string | undefined;
1854
2116
  get breakpoints(): number[] | null;
1855
2117
  get hasFormatJPG(): boolean;
1856
- /** @param {HTMLElement} el */
1857
2118
  renderBg(el: HTMLElement): void;
1858
2119
  getSrcset(): string;
1859
- getSrc(): any;
1860
- get srcUrlPreview(): any;
2120
+ getSrc(): string | undefined;
2121
+ get srcUrlPreview(): string | undefined;
1861
2122
  renderBackground(): void;
1862
- _appendURL({ elNode, src, srcset }: {
1863
- elNode: any;
1864
- src: any;
1865
- srcset: any;
1866
- }): void;
1867
- _setupConfigForImage({ elNode }: {
1868
- elNode: any;
1869
- }): void;
1870
- loaderImage({ src, srcset, elNode }: {
1871
- src: any;
1872
- srcset: any;
1873
- elNode: any;
1874
- }): Promise<any>;
2123
+ private _appendURL;
2124
+ private _setupConfigForImage;
2125
+ loaderImage({ src, srcset, elNode }: LoaderParams): Promise<HTMLImageElement>;
1875
2126
  renderImage(): Promise<void>;
1876
2127
  init(): void;
1877
2128
  }
1878
2129
 
1879
2130
  declare class Img extends ImgBase {
2131
+ connectedCallback(): void;
1880
2132
  }
1881
2133
 
1882
- declare class ProgressBar extends Block {
1883
- private _value;
1884
- private _visible;
1885
- constructor();
1886
- initCallback(): void;
2134
+ declare class ProgressBar extends LitBlock {
2135
+ value: number;
2136
+ visible: boolean;
2137
+ private _progressValue;
2138
+ private readonly fakeProgressLineRef;
2139
+ private readonly handleFakeProgressAnimation;
2140
+ protected firstUpdated(changedProperties: PropertyValues<this>): void;
2141
+ protected updated(changedProperties: PropertyValues<this>): void;
2142
+ disconnectedCallback(): void;
2143
+ private normalizeProgressValue;
2144
+ private updateProgressValueStyle;
2145
+ render(): lit_html.TemplateResult<1>;
1887
2146
  }
1888
2147
 
1889
- declare class ProgressBarCommon extends UploaderBlock {
2148
+ declare class ProgressBarCommon extends LitUploaderBlock {
1890
2149
  private _unobserveCollectionCb?;
2150
+ protected visible: boolean;
2151
+ protected value: number;
1891
2152
  constructor();
1892
2153
  initCallback(): void;
1893
- destroyCallback(): void;
2154
+ protected updated(changedProperties: PropertyValues<this>): void;
2155
+ disconnectedCallback(): void;
2156
+ render(): lit_html.TemplateResult<1>;
1894
2157
  }
1895
2158
 
1896
- declare class Select extends Block {
1897
- ref: {
1898
- select: HTMLSelectElement;
1899
- } & Record<string, HTMLElement>;
2159
+ type SelectOption = {
2160
+ text: string;
1900
2161
  value: string;
1901
- constructor();
1902
- initCallback(): void;
2162
+ };
2163
+ declare class Select extends LitBlock {
2164
+ value: string;
2165
+ disabled: boolean;
2166
+ options: SelectOption[];
2167
+ render(): lit_html.TemplateResult<1>;
2168
+ private _handleChange;
1903
2169
  }
1904
2170
 
1905
- declare class SimpleBtn extends UploaderBlock {
2171
+ declare class SimpleBtn extends LitUploaderBlock {
1906
2172
  static styleAttrs: string[];
1907
2173
  couldBeCtxOwner: boolean;
1908
- constructor();
2174
+ dropzone: boolean;
2175
+ private buttonTextKey;
2176
+ private readonly handleClick;
1909
2177
  initCallback(): void;
2178
+ render(): lit_html.TemplateResult<1>;
1910
2179
  }
1911
2180
 
1912
2181
  type SourceTypeConfig = {
@@ -1917,54 +2186,76 @@ type SourceTypeConfig = {
1917
2186
  activate?: () => boolean;
1918
2187
  activityParams?: Record<string, unknown>;
1919
2188
  };
1920
- declare class SourceBtn extends UploaderBlock {
2189
+ declare class SourceBtn extends LitUploaderBlock {
1921
2190
  couldBeCtxOwner: boolean;
1922
- private type;
1923
2191
  private _registeredTypes;
1924
- constructor();
2192
+ type?: string;
2193
+ private iconName;
2194
+ private srcTypeKey;
1925
2195
  initTypes(): void;
1926
2196
  initCallback(): void;
1927
2197
  registerType(typeConfig: SourceTypeConfig): void;
1928
2198
  getType(type: string): SourceTypeConfig | undefined;
1929
2199
  activate(): void;
1930
2200
  applyType(type: string): void;
2201
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
2202
+ render(): lit_html.TemplateResult<1>;
1931
2203
  }
1932
2204
 
1933
- declare class SourceList extends Block {
2205
+ declare class SourceList extends LitBlock {
2206
+ private _rawSourceList;
2207
+ private _cameraModes;
2208
+ private _resolvedSources;
1934
2209
  initCallback(): void;
2210
+ protected updated(changedProperties: PropertyValues): void;
2211
+ private _updateSources;
2212
+ sources: string[];
2213
+ render(): lit_html.TemplateResult<1>;
1935
2214
  }
1936
2215
 
1937
- declare class Spinner extends BaseComponent<void> {
2216
+ declare class Spinner extends LitBlock {
2217
+ render(): lit_html.TemplateResult<1>;
1938
2218
  }
1939
2219
 
1940
- declare class StartFrom extends ActivityBlock {
2220
+ declare class StartFrom extends LitActivityBlock {
1941
2221
  historyTracked: boolean;
1942
2222
  activityType: ActivityType;
1943
2223
  initCallback(): void;
2224
+ render(): lit_html.TemplateResult<1>;
1944
2225
  }
1945
2226
 
1946
2227
  declare class Thumb extends FileItemConfig {
1947
- private _renderedGridOnce;
1948
- private _thumbRect;
1949
- private _isIntersecting;
1950
- private _firstViewMode;
1951
- private _observer?;
1952
- constructor();
1953
- private _calculateThumbSize;
1954
- private _generateThumbnail;
1955
- private _debouncedGenerateThumb;
2228
+ badgeIcon: string;
2229
+ uid: string;
2230
+ private thumbUrl;
2231
+ private renderedGridOnce;
2232
+ private thumbRect;
2233
+ private isIntersecting;
2234
+ private firstViewMode;
2235
+ private observer?;
2236
+ private pendingThumbUpdate?;
2237
+ private calculateThumbSize;
2238
+ private generateThumbnail;
2239
+ private debouncedGenerateThumb;
2240
+ private decodeImage;
2241
+ private cancelPendingThumbUpdate;
2242
+ private scheduleThumbUpdate;
2243
+ private requestThumbGeneration;
2244
+ protected firstUpdated(changedProperties: PropertyValues<this>): void;
2245
+ protected updated(changedProperties: PropertyValues<this>): void;
1956
2246
  private _observerCallback;
1957
2247
  protected _reset(): void;
1958
- private _handleEntryId;
2248
+ private bindToEntry;
1959
2249
  initCallback(): void;
1960
2250
  connectedCallback(): void;
1961
2251
  disconnectedCallback(): void;
2252
+ render(): lit_html.TemplateResult<1>;
1962
2253
  }
1963
2254
 
1964
2255
  type EventListenerMap = {
1965
2256
  [K in (typeof EventType)[keyof typeof EventType]]: (e: CustomEvent<EventPayload[K]>) => void;
1966
2257
  };
1967
- declare class UploadCtxProvider extends UploaderBlock {
2258
+ declare class UploadCtxProvider extends LitUploaderBlock {
1968
2259
  static styleAttrs: string[];
1969
2260
  static EventType: Readonly<{
1970
2261
  readonly FILE_ADDED: "file-added";
@@ -1986,20 +2277,45 @@ declare class UploadCtxProvider extends UploaderBlock {
1986
2277
  readonly CHANGE: "change";
1987
2278
  readonly GROUP_CREATED: "group-created";
1988
2279
  }>;
1989
- requireCtxName: boolean;
1990
2280
  initCallback(): void;
1991
- destroyCallback(): void;
2281
+ disconnectedCallback(): void;
1992
2282
  }
1993
- interface UploadCtxProvider extends UploaderBlock {
2283
+ interface UploadCtxProvider extends LitUploaderBlock {
1994
2284
  addEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | AddEventListenerOptions): void;
1995
2285
  removeEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | EventListenerOptions): void;
1996
2286
  }
1997
2287
 
1998
- declare class UrlSource extends UploaderBlock {
2288
+ declare class UrlSource extends LitUploaderBlock {
1999
2289
  couldBeCtxOwner: boolean;
2000
2290
  activityType: ActivityType;
2001
- constructor();
2291
+ private formState;
2002
2292
  initCallback(): void;
2293
+ private inputRef;
2294
+ private handleInput;
2295
+ private handleUpload;
2296
+ render(): lit_html.TemplateResult<1>;
2297
+ }
2298
+
2299
+ declare class LitSolutionBlock extends LitBlock {
2300
+ static styleAttrs: string[];
2301
+ init$: {
2302
+ '*solution': string | null;
2303
+ '*commonProgress': number;
2304
+ '*uploadList': never[];
2305
+ '*uploadQueue': _uploadcare_upload_client.Queue;
2306
+ '*collectionErrors': OutputErrorCollection[];
2307
+ '*collectionState': OutputCollectionState | null;
2308
+ '*groupInfo': _uploadcare_upload_client.UploadcareGroup | null;
2309
+ '*uploadTrigger': Set<string>;
2310
+ '*secureUploadsManager': SecureUploadsManager | null;
2311
+ '*currentActivity': null;
2312
+ '*currentActivityParams': {};
2313
+ '*history': never[];
2314
+ '*historyBack': null;
2315
+ '*closeModal': () => void;
2316
+ };
2317
+ initCallback(): void;
2318
+ render(): lit_html.TemplateResult<1>;
2003
2319
  }
2004
2320
 
2005
2321
  declare class CloudImageEditor extends CloudImageEditorBlock {
@@ -2008,32 +2324,44 @@ declare class CloudImageEditor extends CloudImageEditorBlock {
2008
2324
  initCallback(): void;
2009
2325
  }
2010
2326
 
2011
- declare class FileUploaderInline extends SolutionBlock {
2327
+ declare class FileUploaderInline extends LitSolutionBlock {
2012
2328
  static styleAttrs: string[];
2329
+ private couldCancel;
2013
2330
  constructor();
2331
+ private _handleCancel;
2014
2332
  get couldHistoryBack(): boolean;
2015
2333
  get couldShowList(): boolean;
2334
+ private _getInitActivity;
2016
2335
  initCallback(): void;
2336
+ render(): lit_html.TemplateResult<1>;
2017
2337
  }
2018
2338
 
2019
- declare class FileUploaderMinimal extends SolutionBlock {
2339
+ declare class FileUploaderMinimal extends LitSolutionBlock {
2020
2340
  static styleAttrs: string[];
2341
+ protected singleUpload: boolean;
2342
+ protected isHiddenStartFrom: boolean;
2343
+ protected classUploadList: string;
2344
+ protected classStartFrom: string;
2021
2345
  private handleModalOpen?;
2022
2346
  private handleModalClose?;
2347
+ private _getInitActivity;
2023
2348
  constructor();
2024
2349
  private _handleModalOpen;
2025
2350
  private _handleModalClose;
2026
2351
  initCallback(): void;
2027
- destroyCallback(): void;
2352
+ disconnectedCallback(): void;
2353
+ render(): lit_html.TemplateResult<1>;
2028
2354
  }
2029
2355
 
2030
- declare class FileUploaderRegular extends SolutionBlock {
2356
+ declare class FileUploaderRegular extends LitSolutionBlock {
2031
2357
  static styleAttrs: string[];
2358
+ headless: boolean;
2032
2359
  constructor();
2033
2360
  initCallback(): void;
2361
+ render(): lit_html.TemplateResult<1>;
2034
2362
  }
2035
2363
 
2036
2364
  type KebabCase<T extends string> = T extends `${infer Head} ${infer Tail}` ? `${Lowercase<Head>}-${KebabCase<Tail>}` : Lowercase<T>;
2037
2365
  declare const toKebabCase: <T extends string>(str: T) => KebabCase<T>;
2038
2366
 
2039
- 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, 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, toKebabCase };
2367
+ export { LitActivityBlock as ActivityBlock, ActivityHeader, type ApiAddFileCommonOptions, LitBlock as 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, PresenceToggle, ProgressBar, ProgressBarCommon, type SecureDeliveryProxyUrlResolver, type SecureUploadsSignatureAndExpire, type SecureUploadsSignatureResolver, Select, SimpleBtn, SliderUi, LitSolutionBlock as SolutionBlock, SourceBtn, SourceList, type SourceTypes, Spinner, StartFrom, Thumb, UploadCtxProvider, UploadList, UploadSource, LitUploaderBlock as UploaderBlock, UploaderPublicApi, UrlSource, defineComponents, defineLocale, toKebabCase };