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

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