@uploadcare/file-uploader 1.24.4 → 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 +480 -530
  4. package/dist/index.d.ts +868 -539
  5. package/dist/index.js +7615 -6044
  6. package/dist/index.layered.css +2723 -0
  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 +2 -2
  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 +35 -25
  46. package/web/file-uploader.iife.min.d.ts +872 -543
  47. package/web/file-uploader.iife.min.js +8 -4
  48. package/web/file-uploader.min.d.ts +872 -543
  49. package/web/file-uploader.min.js +7 -4
  50. package/web/uc-basic.layered.min.css +26 -0
  51. package/web/uc-basic.min.css +2 -3
  52. package/web/uc-cloud-image-editor.layered.min.css +26 -0
  53. package/web/uc-cloud-image-editor.min.css +1 -2
  54. package/web/uc-cloud-image-editor.min.d.ts +440 -235
  55. package/web/uc-cloud-image-editor.min.js +7 -4
  56. package/web/uc-file-uploader-inline.layered.min.css +26 -0
  57. package/web/uc-file-uploader-inline.min.css +2 -3
  58. package/web/uc-file-uploader-inline.min.d.ts +872 -543
  59. package/web/uc-file-uploader-inline.min.js +7 -4
  60. package/web/uc-file-uploader-minimal.layered.min.css +26 -0
  61. package/web/uc-file-uploader-minimal.min.css +2 -3
  62. package/web/uc-file-uploader-minimal.min.d.ts +872 -543
  63. package/web/uc-file-uploader-minimal.min.js +7 -4
  64. package/web/uc-file-uploader-regular.layered.min.css +26 -0
  65. package/web/uc-file-uploader-regular.min.css +2 -3
  66. package/web/uc-file-uploader-regular.min.d.ts +872 -543
  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,264 +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
- };
111
- type TelemetryEventBody = Partial<Pick<TelemetryState, 'payload' | 'config'>> & {
112
- modalId?: string;
113
- eventType?: CommonEventType;
114
- };
115
- declare class TelemetryManager {
116
- private readonly _sessionId;
117
- private readonly _telemetryInstance;
118
- private readonly _block;
119
- private _config;
120
- private _initialized;
121
- private _lastPayload;
122
- private readonly _queue;
123
- constructor(block: Block);
124
- private _init;
125
- private _setConfig;
126
- private _formattingPayload;
127
- private _excludedEvents;
128
- sendEvent(body: TelemetryEventBody): void;
129
- sendEventError(error: unknown, context?: string): void;
130
- /**
131
- * Method to send telemetry event for Cloud Image Editor.
132
- */
133
- sendEventCloudImageEditor(e: MouseEvent, tabId: string, options?: Record<string, unknown>): void;
134
- /**
135
- * Deeply compares two objects and returns true if they are equal, false otherwise.
136
- */
137
- private _checkObj;
138
- private get _timestamp();
139
- private get _solution();
140
- private get _activity();
141
- }
142
-
143
- declare class Block extends BaseComponent<any> {
144
- private __cfgProxy?;
145
- protected l10nProcessorSubs: Map<string, Set<{
146
- remove: () => void;
147
- }>>;
148
- static StateConsumerScope: string | null;
149
- static styleAttrs: string[];
150
- protected requireCtxName: boolean;
151
- activityType: ActivityType;
152
- init$: {};
153
- l10n(str: string, variables?: Record<string, string | number>): string;
154
- private pluralize;
155
- protected bindL10n(key: string, resolver: () => void): void;
156
- constructor();
157
- emit(type: Parameters<EventEmitter['emit']>[0], payload?: Parameters<EventEmitter['emit']>[1], options?: Parameters<EventEmitter['emit']>[2]): void;
158
- hasBlockInCtx(callback: (block: Block) => boolean): boolean;
159
- setOrAddState(prop: string, newVal: any): void;
160
- connectedCallback(): void;
161
- disconnectedCallback(): void;
162
- initCallback(): void;
163
- get testId(): string;
164
- get modalManager(): ModalManager | undefined;
165
- get telemetryManager(): TelemetryManager | {
166
- sendEvent: () => void;
167
- sendEventCloudImageEditor: () => void;
168
- sendEventError: () => void;
169
- };
170
- protected get localeManager(): LocaleManager | null;
171
- protected get a11y(): A11y | null;
172
- protected get blocksRegistry(): Set<Block>;
173
- destroyCallback(): void;
174
- /**
175
- * Called when the last block is removed from the context. Note that inheritors must run their callback before that.
176
- */
177
- protected destroyCtxCallback(): void;
178
- protected proxyUrl(url: string): Promise<string>;
179
- get cfg(): ConfigType;
180
- subConfigValue<T extends keyof ConfigType>(key: T, callback: (value: ConfigType[T]) => void): void;
181
- debugPrint(...args: unknown[]): void;
182
- static reg(name?: string): void;
183
- }
184
-
185
- declare const InternalEventType: Readonly<{
186
- readonly INIT_SOLUTION: "init-solution";
187
- readonly CHANGE_CONFIG: "change-config";
188
- readonly ACTION_EVENT: "action-event";
189
- readonly ERROR_EVENT: "error-event";
190
- }>;
191
- declare const EventType: Readonly<{
192
- readonly FILE_ADDED: "file-added";
193
- readonly FILE_REMOVED: "file-removed";
194
- readonly FILE_UPLOAD_START: "file-upload-start";
195
- readonly FILE_UPLOAD_PROGRESS: "file-upload-progress";
196
- readonly FILE_UPLOAD_SUCCESS: "file-upload-success";
197
- readonly FILE_UPLOAD_FAILED: "file-upload-failed";
198
- readonly FILE_URL_CHANGED: "file-url-changed";
199
- readonly MODAL_OPEN: "modal-open";
200
- readonly MODAL_CLOSE: "modal-close";
201
- readonly DONE_CLICK: "done-click";
202
- readonly UPLOAD_CLICK: "upload-click";
203
- readonly ACTIVITY_CHANGE: "activity-change";
204
- readonly COMMON_UPLOAD_START: "common-upload-start";
205
- readonly COMMON_UPLOAD_PROGRESS: "common-upload-progress";
206
- readonly COMMON_UPLOAD_SUCCESS: "common-upload-success";
207
- readonly COMMON_UPLOAD_FAILED: "common-upload-failed";
208
- readonly CHANGE: "change";
209
- readonly GROUP_CREATED: "group-created";
210
- }>;
211
- type EventKey = (typeof EventType)[keyof typeof EventType];
212
- type InternalEventKey = (typeof InternalEventType)[keyof typeof InternalEventType];
213
- type EventPayload = {
214
- [EventType.FILE_ADDED]: OutputFileEntry<'idle'>;
215
- [EventType.FILE_REMOVED]: OutputFileEntry<'removed'>;
216
- [EventType.FILE_UPLOAD_START]: OutputFileEntry<'uploading'>;
217
- [EventType.FILE_UPLOAD_PROGRESS]: OutputFileEntry<'uploading'>;
218
- [EventType.FILE_UPLOAD_SUCCESS]: OutputFileEntry<'success'>;
219
- [EventType.FILE_UPLOAD_FAILED]: OutputFileEntry<'failed'>;
220
- [EventType.FILE_URL_CHANGED]: OutputFileEntry<'success'>;
221
- [EventType.MODAL_OPEN]: {
222
- modalId: ModalId;
223
- };
224
- [EventType.MODAL_CLOSE]: {
225
- modalId: ModalId;
226
- hasActiveModals: boolean;
227
- };
228
- [EventType.ACTIVITY_CHANGE]: {
229
- activity: ActivityType;
230
- };
231
- [EventType.UPLOAD_CLICK]: void;
232
- [EventType.DONE_CLICK]: OutputCollectionState;
233
- [EventType.COMMON_UPLOAD_START]: OutputCollectionState<'uploading'>;
234
- [EventType.COMMON_UPLOAD_PROGRESS]: OutputCollectionState<'uploading'>;
235
- [EventType.COMMON_UPLOAD_SUCCESS]: OutputCollectionState<'success'>;
236
- [EventType.COMMON_UPLOAD_FAILED]: OutputCollectionState<'failed'>;
237
- [EventType.CHANGE]: OutputCollectionState;
238
- [EventType.GROUP_CREATED]: OutputCollectionState<'success', 'has-group'>;
239
- };
240
- declare class EventEmitter {
241
- private _timeoutStore;
242
- private _targets;
243
- private _debugPrint;
244
- constructor(debugPrint: (...args: unknown[]) => void);
245
- bindTarget(target: Block): void;
246
- unbindTarget(target: Block): void;
247
- private _dispatch;
248
- emit<T extends EventKey, TDebounce extends boolean | number | undefined = undefined>(type: T, payload?: TDebounce extends false | undefined ? EventPayload[T] : () => EventPayload[T], options?: {
249
- debounce?: TDebounce;
250
- }): void;
32
+ constructor(blockInstance: LitBlock);
251
33
  }
252
34
 
253
35
  type EventMap = {
254
36
  [T in keyof EventPayload]: CustomEvent<EventPayload[T]>;
255
37
  };
256
38
 
257
- type LocaleDefinition = Record<string, string>;
258
- type LocaleDefinitionResolver = () => Promise<LocaleDefinition>;
259
- declare const defineLocale: (localeName: string, definitionOrResolver: LocaleDefinition | LocaleDefinitionResolver) => void;
260
-
261
- declare function buildOutputCollectionState<TCollectionStatus extends OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'>(uploaderBlock: UploaderBlock): OutputCollectionState<TCollectionStatus, TGroupFlag>;
39
+ declare function buildOutputCollectionState<TCollectionStatus extends OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'>(uploaderBlock: LitUploaderBlock): OutputCollectionState<TCollectionStatus, TGroupFlag>;
262
40
 
263
41
  type TypedSchema = Record<string, {
264
42
  type: unknown;
@@ -283,7 +61,7 @@ declare class TypedData<T extends TypedSchema> {
283
61
  getValue<K extends ExtractKeysFromSchema<T>>(prop: K): ExtractDataFromSchema<T>[K];
284
62
  subscribe<K extends ExtractKeysFromSchema<T>>(prop: K, handler: (newVal: ExtractDataFromSchema<T>[K]) => void): {
285
63
  remove: () => void;
286
- callback: Function;
64
+ callback: (val: unknown) => void;
287
65
  };
288
66
  remove(): void;
289
67
  }
@@ -437,7 +215,7 @@ declare class ValidationManager {
437
215
  private _queue;
438
216
  private _runQueueDebounced;
439
217
  private _entryValidationState;
440
- constructor(blockInstance: UploaderBlock);
218
+ constructor(blockInstance: LitUploaderBlock);
441
219
  runFileValidators(runOn: FileValidatorDescriptor['runOn'], entryIds?: string[]): void;
442
220
  runCollectionValidators(): void;
443
221
  cleanupValidationForEntry(entry: TypedData<typeof uploadEntrySchema>): void;
@@ -448,9 +226,17 @@ declare class ValidationManager {
448
226
  private _getValidatorDescriptorsForEntry;
449
227
  }
450
228
 
229
+ type CameraDeviceOption = {
230
+ text: string;
231
+ value: string;
232
+ };
233
+ type AudioDeviceOption = {
234
+ text: string;
235
+ value: string;
236
+ };
451
237
  type CameraMode = 'photo' | 'video';
452
238
  type CameraStatus = 'shot' | 'retake' | 'accept' | 'play' | 'stop' | 'pause' | 'resume';
453
- declare class CameraSource extends UploaderBlock {
239
+ declare class CameraSource extends LitUploaderBlock {
454
240
  couldBeCtxOwner: boolean;
455
241
  activityType: "camera";
456
242
  private _unsubPermissions;
@@ -467,8 +253,43 @@ declare class CameraSource extends UploaderBlock {
467
253
  private _cameraDevices;
468
254
  private _audioDevices;
469
255
  private _permissionResponses;
470
- 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;
471
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;
472
293
  _updateTimer: () => void;
473
294
  _startTimer: () => void;
474
295
  _stopTimer: () => void;
@@ -512,7 +333,8 @@ declare class CameraSource extends UploaderBlock {
512
333
  _handleCameraModes: (cameraModes: CameraMode[]) => void;
513
334
  initCallback(): void;
514
335
  _destroy(): void;
515
- destroyCallback(): Promise<void>;
336
+ disconnectedCallback(): void;
337
+ render(): lit_html.TemplateResult<1>;
516
338
  }
517
339
 
518
340
  /**
@@ -521,9 +343,9 @@ declare class CameraSource extends UploaderBlock {
521
343
  declare const complexConfigKeys: readonly ["metadata", "localeDefinitionOverride", "secureUploadsSignatureResolver", "secureDeliveryProxyUrlResolver", "iconHrefResolver", "fileValidators", "collectionValidators", "mediaRecorderOptions"];
522
344
  /** Mapping of attribute names to state */
523
345
  declare const attrStateMapping: Record<string, string>;
524
- declare class Config extends Block {
525
- requireCtxName: boolean;
526
- constructor();
346
+ declare class Config extends LitBlock {
347
+ init$: LitBlock["init$"] & ConfigType;
348
+ private computationControllers;
527
349
  private _flushValueToAttribute;
528
350
  private _flushValueToState;
529
351
  private _setValue;
@@ -531,23 +353,36 @@ declare class Config extends Block {
531
353
  _assertSameValueDifferentReference(key: string, previousValue: unknown, nextValue: unknown): void;
532
354
  initCallback(): void;
533
355
  attributeChangedCallback(name: keyof typeof attrStateMapping, oldVal: string, newVal: string): void;
534
- get computationControllers(): any;
356
+ static get observedAttributes(): string[];
535
357
  }
536
358
  interface Config extends ConfigType {
537
359
  }
538
360
 
539
361
  type FilesViewMode = 'grid' | 'list';
540
- declare class UploadList extends UploaderBlock {
362
+ declare class UploadList extends LitUploaderBlock {
541
363
  couldBeCtxOwner: boolean;
542
364
  historyTracked: boolean;
543
365
  activityType: "upload-list";
544
- 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;
545
379
  private _throttledHandleCollectionUpdate;
546
- private _updateUploadsState;
380
+ protected _updateUploadsState(): void;
547
381
  private _getHeaderText;
548
382
  get couldOpenActivity(): boolean;
549
383
  initCallback(): void;
550
- destroyCallback(): void;
384
+ disconnectedCallback(): void;
385
+ render(): lit_html.TemplateResult<1>;
551
386
  }
552
387
 
553
388
  declare const ExternalUploadSource: Readonly<{
@@ -598,7 +433,7 @@ type ApiAddFileCommonOptions = {
598
433
  };
599
434
  declare class UploaderPublicApi {
600
435
  private _ctx;
601
- constructor(ctx: UploaderBlock);
436
+ constructor(ctx: LitUploaderBlock);
602
437
  private get _uploadCollection();
603
438
  get cfg(): ConfigType;
604
439
  get l10n(): (str: string, variables?: Record<string, string | number>) => string;
@@ -1097,7 +932,7 @@ type OutputCollectionState<TStatus extends OutputCollectionStatus = OutputCollec
1097
932
  declare class SecureUploadsManager {
1098
933
  private readonly _block;
1099
934
  private _secureToken;
1100
- constructor(block: UploaderBlock);
935
+ constructor(block: LitUploaderBlock);
1101
936
  private _debugPrint;
1102
937
  getSecureToken(): Promise<SecureUploadsSignatureAndExpire | null>;
1103
938
  }
@@ -1143,7 +978,7 @@ declare class TypedCollection<T extends TypedSchema> {
1143
978
  destroy(): void;
1144
979
  }
1145
980
 
1146
- declare class UploaderBlock extends ActivityBlock {
981
+ declare class LitUploaderBlock extends LitActivityBlock {
1147
982
  static extSrcList: Readonly<typeof ExternalUploadSource>;
1148
983
  static sourceTypes: Readonly<typeof UploadSource>;
1149
984
  protected couldBeCtxOwner: boolean;
@@ -1174,7 +1009,6 @@ declare class UploaderBlock extends ActivityBlock {
1174
1009
  destroyCtxCallback(): void;
1175
1010
  disconnectedCallback(): void;
1176
1011
  connectedCallback(): void;
1177
- destroyCallback(): void;
1178
1012
  private _initCtxOwner;
1179
1013
  private _observeUploadCollection;
1180
1014
  private _unobserveUploadCollection;
@@ -1190,6 +1024,10 @@ declare class UploaderBlock extends ActivityBlock {
1190
1024
  getOutputData(): OutputFileEntry[];
1191
1025
  }
1192
1026
 
1027
+ /**
1028
+ * Mapping of loading resources per operation
1029
+ */
1030
+ type LoadingOperations = Map<string, Map<string, boolean>>;
1193
1031
  /**
1194
1032
  * Image size
1195
1033
  */
@@ -1224,6 +1062,7 @@ interface ApplyResult {
1224
1062
  cdnUrl: string;
1225
1063
  transformations: Transformations;
1226
1064
  }
1065
+ type ChangeResult = ApplyResult;
1227
1066
  interface CropAspectRatio {
1228
1067
  type: 'aspect-ratio';
1229
1068
  width: number;
@@ -1235,27 +1074,41 @@ interface CropAspectRatio {
1235
1074
  type ActivityParams$1 = {
1236
1075
  internalId: string;
1237
1076
  };
1238
- declare class CloudImageEditorActivity extends UploaderBlock {
1077
+ declare class CloudImageEditorActivity extends LitUploaderBlock {
1239
1078
  couldBeCtxOwner: boolean;
1240
1079
  activityType: "cloud-image-edit";
1241
1080
  private _entry?;
1242
- private _instance?;
1081
+ private editorConfig;
1243
1082
  get activityParams(): ActivityParams$1;
1244
1083
  initCallback(): void;
1245
1084
  handleApply(e: CustomEvent<ApplyResult>): void;
1246
- handleCancel(): void;
1085
+ handleCancel(event?: Event): void;
1086
+ handleChange(event: CustomEvent<ChangeResult>): void;
1247
1087
  mountEditor(): void;
1248
1088
  unmountEditor(): void;
1089
+ render(): lit_html.TemplateResult<1> | typeof nothing;
1090
+ private _createEditorConfig;
1249
1091
  }
1250
1092
 
1251
1093
  type ActivityParams = {
1252
1094
  externalSourceType: string;
1253
1095
  };
1254
- declare class ExternalSource extends UploaderBlock {
1096
+ declare class ExternalSource extends LitUploaderBlock {
1255
1097
  couldBeCtxOwner: boolean;
1256
1098
  activityType: "external";
1257
1099
  private _messageBridge?;
1258
- 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();
1259
1112
  get activityParams(): ActivityParams;
1260
1113
  initCallback(): void;
1261
1114
  private extractUrlFromSelectedFile;
@@ -1266,9 +1119,15 @@ declare class ExternalSource extends UploaderBlock {
1266
1119
  private applyEmbedCss;
1267
1120
  private setupL10n;
1268
1121
  private remoteUrl;
1122
+ private _handleDone;
1123
+ private _handleCancel;
1124
+ private _handleSelectAll;
1125
+ private _handleDeselectAll;
1126
+ private _setSelectionSummary;
1269
1127
  private mountIframe;
1270
1128
  private unmountIframe;
1271
1129
  private resetSelectionStatus;
1130
+ render(): lit_html.TemplateResult<1>;
1272
1131
  }
1273
1132
 
1274
1133
  declare const ACTIVE_PROP = "___ACTIVITY_IS_ACTIVE___";
@@ -1276,7 +1135,7 @@ type ActivityParamsMap = {
1276
1135
  'cloud-image-edit': ActivityParams$1;
1277
1136
  external: ActivityParams;
1278
1137
  };
1279
- declare class ActivityBlock extends Block {
1138
+ declare class LitActivityBlock extends LitBlock {
1280
1139
  protected historyTracked: boolean;
1281
1140
  private [ACTIVE_PROP]?;
1282
1141
  init$: {
@@ -1312,66 +1171,331 @@ declare class ActivityBlock extends Block {
1312
1171
  onDeactivate?: () => void;
1313
1172
  }): void;
1314
1173
  unregisterActivity(): void;
1315
- destroyCallback(): void;
1174
+ disconnectedCallback(): void;
1316
1175
  get activityKey(): string;
1317
1176
  get activityParams(): ActivityParamsMap[keyof ActivityParamsMap];
1318
- get initActivity(): string;
1319
- get doneActivity(): string;
1177
+ get initActivity(): string | null;
1178
+ get doneActivity(): string | null;
1320
1179
  historyBack(): void;
1321
1180
  }
1322
- type RegisteredActivityType = (typeof ActivityBlock)['activities'][keyof (typeof ActivityBlock)['activities']];
1181
+ type RegisteredActivityType = (typeof LitActivityBlock)['activities'][keyof (typeof LitActivityBlock)['activities']];
1323
1182
  type ActivityType = RegisteredActivityType | (string & {}) | null;
1324
1183
 
1325
- declare function defineComponents(blockExports: Record<string, any>): void;
1326
-
1327
- declare class SolutionBlock extends Block {
1328
- static styleAttrs: string[];
1329
- protected requireCtxName: boolean;
1330
- init$: {
1331
- '*solution': string | null;
1332
- '*commonProgress': number;
1333
- '*uploadList': never[];
1334
- '*uploadQueue': _uploadcare_upload_client.Queue;
1335
- '*collectionErrors': OutputErrorCollection[];
1336
- '*collectionState': OutputCollectionState | null;
1337
- '*groupInfo': _uploadcare_upload_client.UploadcareGroup | null;
1338
- '*uploadTrigger': Set<string>;
1339
- '*secureUploadsManager': SecureUploadsManager | null;
1340
- '*currentActivity': null;
1341
- '*currentActivityParams': {};
1342
- '*history': never[];
1343
- '*historyBack': null;
1344
- '*closeModal': () => void;
1345
- };
1346
- private static _template;
1347
- initCallback(): void;
1348
- static set template(value: string);
1349
- static get template(): string;
1350
- }
1351
-
1352
- declare class ActivityHeader extends ActivityBlock {
1353
- }
1354
-
1355
- declare class CloudImageEditorBlock extends Block {
1356
- ctxOwner: boolean;
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;
1250
+ }
1251
+
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;
1357
1316
  static styleAttrs: string[];
1358
- private _debouncedShowLoader;
1317
+ activityType: ActivityType;
1318
+ init$: {};
1359
1319
  constructor();
1360
- 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();
1361
1484
  /**
1362
1485
  * To proper work, we need non-zero size the element. So, we'll wait for it.
1363
1486
  */
1364
1487
  private _waitForSize;
1365
- 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;
1366
1494
  updateImage(): Promise<void>;
1367
1495
  initEditor(): Promise<void>;
1368
1496
  }
1369
1497
 
1370
- declare class CropFrame extends Block {
1371
- private readonly _handlePointerUp;
1372
- private readonly _handlePointerMove;
1373
- private readonly _handleSvgPointerMove;
1374
- private readonly _backdropMaskId;
1498
+ declare class CropFrame extends LitBlock {
1375
1499
  private _backdropMask?;
1376
1500
  private _backdropMaskInner?;
1377
1501
  private _frameThumbs?;
@@ -1382,7 +1506,14 @@ declare class CropFrame extends Block {
1382
1506
  private _dragStartCrop?;
1383
1507
  private _frameImage?;
1384
1508
  private _guidesHidden;
1385
- 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;
1386
1517
  private _shouldThumbBeDisabled;
1387
1518
  private _createBackdrop;
1388
1519
  /**
@@ -1397,41 +1528,57 @@ declare class CropFrame extends Block {
1397
1528
  private _createGuides;
1398
1529
  private _createFrame;
1399
1530
  private _handlePointerDown;
1400
- private _handlePointerUp_;
1401
- private _handlePointerMove_;
1531
+ private readonly _handlePointerUp;
1532
+ private readonly _handlePointerMove;
1402
1533
  private _calcCropBox;
1403
- private _handleSvgPointerMove_;
1534
+ private readonly _handleSvgPointerMove;
1404
1535
  private _updateCursor;
1405
1536
  private _createMask;
1406
1537
  private _updateMask;
1407
1538
  private _render;
1408
1539
  toggleThumbs(visible: boolean): void;
1409
1540
  initCallback(): void;
1410
- destroyCallback(): void;
1541
+ protected firstUpdated(_changedProperties: PropertyValues<this>): void;
1542
+ private _initializeSvg;
1543
+ disconnectedCallback(): void;
1544
+ render(): TemplateResult;
1411
1545
  }
1412
1546
 
1413
- declare class EditorButtonControl extends Block {
1414
- private _titleEl?;
1415
- constructor();
1416
- 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>;
1417
1558
  }
1418
1559
 
1419
1560
  declare class EditorFreeformButtonControl extends EditorButtonControl {
1420
1561
  initCallback(): void;
1421
- handleClick(): void;
1562
+ onClick(): void;
1563
+ private computeTitle;
1564
+ render(): lit_html.TemplateResult<1>;
1422
1565
  }
1423
- interface EditorAspectRatioButtonControl {
1566
+ declare class EditorAspectRatioButtonControl extends EditorButtonControl {
1567
+ private _aspectRatio?;
1424
1568
  get aspectRatio(): CropAspectRatio | undefined;
1425
1569
  set aspectRatio(value: CropAspectRatio | undefined);
1426
- }
1427
- declare class EditorAspectRatioButtonControl extends EditorButtonControl {
1428
- constructor();
1429
1570
  initCallback(): void;
1430
- handleClick(): void;
1431
- private _renderRectBasedOnAspectRatio;
1432
- private _aspectRatio?;
1571
+ onClick(): void;
1572
+ private updateAspectRatioPresentation;
1573
+ private renderIcon;
1574
+ render(): lit_html.TemplateResult<1>;
1433
1575
  }
1434
1576
 
1577
+ declare const TabId: Readonly<{
1578
+ readonly CROP: "crop";
1579
+ readonly TUNING: "tuning";
1580
+ readonly FILTERS: "filters";
1581
+ }>;
1435
1582
  declare const ALL_COLOR_OPERATIONS: readonly ["brightness", "exposure", "gamma", "contrast", "saturation", "vibrance", "warmth", "enhance"];
1436
1583
  type ColorOperation = (typeof ALL_COLOR_OPERATIONS)[number];
1437
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"];
@@ -1487,13 +1634,10 @@ declare const COLOR_OPERATIONS_CONFIG: Readonly<{
1487
1634
  };
1488
1635
  }>;
1489
1636
 
1490
- interface EditorCropButtonControl {
1491
- get operation(): CropOperation | undefined;
1492
- set operation(value: CropOperation | undefined);
1493
- }
1494
1637
  declare class EditorCropButtonControl extends EditorButtonControl {
1495
- private _operation;
1496
- initCallback(): void;
1638
+ operation: CropOperation | undefined;
1639
+ protected willUpdate(_changedProperties: PropertyValues): void;
1640
+ onClick(e: MouseEvent): void;
1497
1641
  }
1498
1642
 
1499
1643
  declare class EditorFilterControl extends EditorButtonControl {
@@ -1502,11 +1646,27 @@ declare class EditorFilterControl extends EditorButtonControl {
1502
1646
  private _originalUrl;
1503
1647
  private _observer?;
1504
1648
  private _cancelPreload?;
1505
- 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;
1506
1659
  private _previewSrc;
1507
1660
  private _observerCallback;
1508
1661
  initCallback(): void;
1509
- 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>;
1510
1670
  }
1511
1671
 
1512
1672
  type Operations = {
@@ -1514,7 +1674,7 @@ type Operations = {
1514
1674
  mirror: boolean;
1515
1675
  rotate: number;
1516
1676
  };
1517
- declare class EditorImageCropper extends Block {
1677
+ declare class EditorImageCropper extends LitBlock {
1518
1678
  ctxOwner: boolean;
1519
1679
  private _commitDebounced;
1520
1680
  private _handleResizeThrottled;
@@ -1523,9 +1683,12 @@ declare class EditorImageCropper extends Block {
1523
1683
  private _ctx;
1524
1684
  private _isActive;
1525
1685
  private _observer?;
1686
+ private _image;
1526
1687
  private _cancelPreload?;
1688
+ private readonly canvasRef;
1689
+ private readonly frameRef;
1527
1690
  constructor();
1528
- private _handleResize;
1691
+ protected firstUpdated(_changedProperties: PropertyValues): void;
1529
1692
  private _syncTransformations;
1530
1693
  private _initCanvas;
1531
1694
  private _alignImage;
@@ -1550,11 +1713,12 @@ declare class EditorImageCropper extends Block {
1550
1713
  private _waitForImage;
1551
1714
  private _handleImageLoading;
1552
1715
  initCallback(): void;
1553
- destroyCallback(): void;
1716
+ disconnectedCallback(): void;
1717
+ render(): TemplateResult;
1554
1718
  }
1555
1719
 
1556
1720
  type OperationKey = keyof typeof COLOR_OPERATIONS_CONFIG;
1557
- declare class EditorImageFader extends Block {
1721
+ declare class EditorImageFader extends LitBlock {
1558
1722
  private _isActive;
1559
1723
  private _hidden;
1560
1724
  private _operation;
@@ -1562,7 +1726,6 @@ declare class EditorImageFader extends Block {
1562
1726
  private _value?;
1563
1727
  private _transformations;
1564
1728
  private _keypoints;
1565
- private _container?;
1566
1729
  private _previewImage?;
1567
1730
  private _cancelLastImages?;
1568
1731
  private _cancelBatchPreload?;
@@ -1570,6 +1733,8 @@ declare class EditorImageFader extends Block {
1570
1733
  private _fromViewer?;
1571
1734
  private _raf;
1572
1735
  private _addKeypointDebounced;
1736
+ private readonly _previewHostRef;
1737
+ private readonly _layersHostRef;
1573
1738
  constructor();
1574
1739
  private _handleImageLoading;
1575
1740
  private _flush;
@@ -1579,7 +1744,6 @@ declare class EditorImageFader extends Block {
1579
1744
  * Check if current operation and filter equals passed ones
1580
1745
  */
1581
1746
  private _isSame;
1582
- private _addKeypoint;
1583
1747
  set(value: string | number): void;
1584
1748
  private _update;
1585
1749
  private _createPreviewImage;
@@ -1602,121 +1766,228 @@ declare class EditorImageFader extends Block {
1602
1766
  deactivate({ hide }?: {
1603
1767
  hide?: boolean;
1604
1768
  }): void;
1769
+ private _ensurePreviewAttached;
1770
+ private _clearLayersHost;
1771
+ render(): TemplateResult;
1605
1772
  }
1606
1773
 
1607
1774
  declare class EditorOperationControl extends EditorButtonControl {
1608
1775
  private _operation;
1776
+ get operation(): ColorOperation | '';
1777
+ set operation(value: ColorOperation | '');
1778
+ private updateOperationMetadata;
1609
1779
  initCallback(): void;
1780
+ onClick(e: MouseEvent): void;
1610
1781
  }
1611
1782
 
1612
- declare class EditorScroller extends Block {
1613
- initCallback(): void;
1783
+ declare class EditorScroller extends LitBlock {
1784
+ private readonly handleWheel;
1785
+ connectedCallback(): void;
1786
+ disconnectedCallback(): void;
1614
1787
  }
1615
1788
 
1616
1789
  type SliderOperation = ColorOperation | 'filter';
1617
1790
  type SliderFilter = FilterId | typeof FAKE_ORIGINAL_FILTER;
1618
1791
  declare const FAKE_ORIGINAL_FILTER = "original";
1619
- declare class EditorSlider extends Block {
1620
- private _operation;
1621
- private _filter?;
1622
- private _originalUrl;
1623
- constructor();
1792
+ declare class EditorSlider extends LitBlock {
1793
+ private state;
1794
+ handleInput: (e: CustomEvent<{
1795
+ value: number;
1796
+ }>) => void;
1624
1797
  setOperation(operation: SliderOperation, filter?: SliderFilter): void;
1625
1798
  private _initializeValues;
1626
1799
  apply(): void;
1627
1800
  cancel(): void;
1628
1801
  initCallback(): void;
1629
- }
1630
-
1631
- declare class EditorToolbar extends Block {
1632
- 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;
1633
1824
  private _cancelPreload?;
1634
- private _updateInfoTooltip;
1635
- 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>;
1636
1833
  private _onSliderClose;
1637
- private _createOperationControl;
1638
- private _createFilterControl;
1639
- private _createToggleControl;
1640
- private _createAspectRatioControl;
1641
- private _createFreeformControl;
1642
- private _clearListAspectRatio;
1643
- private _renderControlsList;
1644
1834
  private _activateTab;
1645
- private _unmountTabControls;
1835
+ private applyTabState;
1646
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;
1647
1849
  private _preloadEditedImage;
1648
- private _showLoader;
1649
- private _updateInfoTooltipHandler;
1650
1850
  initCallback(): void;
1651
- destroyCallback(): void;
1652
- }
1653
-
1654
- declare class BtnUi extends Block {
1655
- private _iconReversed;
1656
- private _iconSingle;
1657
- private _iconHidden;
1658
- constructor();
1659
- private _iconCss;
1660
- initCallback(): void;
1661
- set reverse(_value: boolean);
1662
- }
1663
-
1664
- declare class LineLoaderUi extends Block {
1665
- private _active;
1666
- private readonly _handleTransitionEndRight;
1667
- initCallback(): void;
1668
- private _start;
1669
- private _stop;
1670
- }
1671
-
1672
- 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 {
1673
1905
  private _visible;
1906
+ private _styles;
1674
1907
  private _visibleStyle;
1675
1908
  private _hiddenStyle;
1676
1909
  private _externalTransitions;
1677
- constructor();
1910
+ private initialRenderComplete;
1911
+ set visible(value: boolean);
1912
+ get visible(): boolean;
1913
+ set styles(styles: PresenceToggleStyle);
1914
+ get styles(): PresenceToggleStyle;
1678
1915
  private _handleVisible;
1916
+ private dispatchInitialRenderEvent;
1679
1917
  initCallback(): void;
1680
1918
  }
1681
1919
 
1682
- declare class SliderUi extends Block {
1920
+ declare class SliderUi extends LitBlock {
1683
1921
  private _observer?;
1684
1922
  private _thumbSize;
1685
- private _zero;
1686
1923
  private _zeroDotEl?;
1687
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;
1688
1934
  constructor();
1689
- initCallback(): void;
1690
- private _inputEl;
1691
- private _thumbEl;
1692
- 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;
1693
1942
  private _updateValue;
1694
1943
  private _updateZeroDot;
1695
1944
  private _updateSteps;
1696
- destroyCallback(): void;
1945
+ disconnectedCallback(): void;
1946
+ private _setCurrentValue;
1947
+ private _syncInputValue;
1948
+ private _extractEventValue;
1949
+ render(): lit_html.TemplateResult<1>;
1697
1950
  }
1698
1951
 
1699
- declare class Copyright extends Block {
1952
+ declare class Copyright extends LitBlock {
1700
1953
  initCallback(): void;
1701
- static template: string;
1954
+ render(): lit_html.TemplateResult<1>;
1702
1955
  }
1703
1956
 
1704
- declare class DropArea extends UploaderBlock {
1957
+ declare class DropArea extends LitUploaderBlock {
1705
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();
1706
1968
  private _destroyDropzone;
1707
1969
  private _destroyContentWrapperDropzone;
1708
- private _onAreaClicked;
1709
- constructor();
1970
+ private contentWrapperRef;
1971
+ private readonly handleAreaInteraction;
1972
+ private sourceListAllowsLocal;
1973
+ private clickableListenersAttached;
1710
1974
  isActive(): boolean;
1711
1975
  initCallback(): void;
1976
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
1977
+ protected updated(changedProperties: PropertyValues<this>): void;
1712
1978
  /** Ignore drop events if there are other visible drop areas on the page. */
1713
1979
  private _shouldIgnore;
1714
1980
  private _couldHandleFiles;
1715
- destroyCallback(): void;
1981
+ private updateIsEnabled;
1982
+ private updateVisibility;
1983
+ private updateDragStateAttribute;
1984
+ private updateClickableListeners;
1985
+ disconnectedCallback(): void;
1986
+ render(): lit_html.TemplateResult<1>;
1716
1987
  }
1717
1988
 
1718
1989
  type EntrySubscription = ReturnType<UploadEntryTypedData['subscribe']>;
1719
- declare class FileItemConfig extends UploaderBlock {
1990
+ declare class FileItemConfig extends LitUploaderBlock {
1720
1991
  protected _entrySubs: Set<EntrySubscription>;
1721
1992
  protected _entry: UploadEntryTypedData | null;
1722
1993
  protected _withEntry<A extends unknown[], R>(fn: (entry: UploadEntryTypedData, ...args: A) => R): (...args: A) => R | undefined;
@@ -1728,11 +1999,27 @@ declare class FileItemConfig extends UploaderBlock {
1728
1999
  declare class FileItem extends FileItemConfig {
1729
2000
  couldBeCtxOwner: boolean;
1730
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;
1731
2016
  private _renderedOnce;
1732
2017
  private _observer?;
1733
2018
  protected _isIntersecting: boolean;
1734
2019
  protected _thumbRect?: DOMRectReadOnly;
1735
- constructor();
2020
+ private _handleEdit;
2021
+ private _handleRemove;
2022
+ private _handleUploadClick;
1736
2023
  private _calculateState;
1737
2024
  private _debouncedCalculateState;
1738
2025
  private _updateHintAndProgress;
@@ -1741,170 +2028,153 @@ declare class FileItem extends FileItemConfig {
1741
2028
  private _observerCallback;
1742
2029
  private _handleEntryId;
1743
2030
  private _updateShowFileNames;
2031
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
1744
2032
  initCallback(): void;
1745
- destroyCallback(): void;
1746
2033
  connectedCallback(): void;
1747
2034
  disconnectedCallback(): void;
1748
- private _settingsOfShrink;
1749
- private _processShrink;
1750
2035
  upload: () => Promise<void> | undefined;
1751
- static template: string;
1752
2036
  static activeInstances: Set<FileItem>;
2037
+ protected shouldUpdate(_changedProperties: PropertyValues): boolean;
2038
+ render(): lit_html.TemplateResult<1>;
1753
2039
  }
1754
2040
 
1755
- declare class FormInput extends UploaderBlock {
1756
- requireCtxName: boolean;
2041
+ declare class FormInput extends LitUploaderBlock {
1757
2042
  _validationInputElement: HTMLInputElement | null;
1758
2043
  _dynamicInputsContainer: HTMLDivElement | null;
1759
2044
  _createValidationInput(): HTMLInputElement;
1760
2045
  initCallback(): void;
1761
2046
  }
1762
2047
 
1763
- declare class Icon extends Block {
1764
- constructor();
2048
+ declare class Icon extends LitBlock {
2049
+ name: string;
2050
+ private resolvedHref;
2051
+ private iconHrefResolver;
1765
2052
  initCallback(): void;
2053
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
2054
+ private updateResolvedHref;
2055
+ render(): lit_html.TemplateResult<1>;
1766
2056
  }
1767
2057
 
1768
- declare class ImgConfig extends BaseComponent<any> {
1769
- 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;
1770
2075
  constructor();
1771
- cssInit$: any;
1772
- /**
1773
- * @param {String} key
1774
- * @returns {any}
1775
- */
1776
- $$(key: string): any;
1777
- /** @param {Object<String, String | Number>} kvObj */
1778
- set$$(kvObj: any): void;
1779
- /**
1780
- * @param {String} key
1781
- * @param {(val: any) => void} kbFn
1782
- */
1783
- 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;
1784
2080
  analyticsParams(): string;
1785
- initAttributes(el: any): void;
1786
- /**
1787
- * @param {HTMLElement} el
1788
- * @param {() => void} cbkFn
1789
- */
2081
+ initAttributes(el: HTMLElement): void;
1790
2082
  initIntersection(el: HTMLElement, cbkFn: () => void): void;
1791
- /** @private */
1792
- private _isnObserver;
1793
- /** @private */
1794
- private _observed;
1795
- 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;
1796
2088
  }
1797
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
+ };
1798
2100
  declare class ImgBase extends ImgConfig {
1799
- _img: HTMLImageElement;
1800
- _imgPreview: HTMLImageElement;
1801
- /**
1802
- * @private
1803
- * @param {String} src
1804
- */
2101
+ protected _img: HTMLImageElement;
2102
+ protected _imgPreview: HTMLImageElement;
1805
2103
  private _fmtAbs;
1806
- /**
1807
- * Validate size
1808
- *
1809
- * @param {String} [size]
1810
- * @returns {String | Number}
1811
- */
1812
- _validateSize(size?: string): string | number;
1813
- /**
1814
- * Image operations
1815
- *
1816
- * @param {String} [size]
1817
- * @param {String} [blur]
1818
- */
1819
- _getCdnModifiers(size?: string, blur?: string): string;
1820
- /**
1821
- * @private
1822
- * @param {String} [size]
1823
- * @param {String} [blur]
1824
- * @returns {any}
1825
- */
2104
+ private _validateSize;
2105
+ private _getCdnModifiers;
2106
+ private _getTypedCssValue;
1826
2107
  private _getUrlBase;
1827
- /**
1828
- * @private
1829
- * @param {String} url
1830
- * @returns {String}
1831
- */
1832
2108
  private _proxyUrl;
1833
- /**
1834
- * @param {HTMLElement} el
1835
- * @param {Number} [k]
1836
- * @param {Boolean} [wOnly]
1837
- */
1838
- _getElSize(el: HTMLElement, k?: number, wOnly?: boolean): string | null;
1839
- /** @param {HTMLImageElement} img */
1840
- _setupEventProxy(img: HTMLImageElement): void;
1841
- /** @type {HTMLImageElement} */
2109
+ protected _getElSize(el: HTMLElement, k?: number, wOnly?: boolean): string | null;
2110
+ private _setupEventProxy;
1842
2111
  get img(): HTMLImageElement;
1843
- get currentImg(): {
1844
- type: "PREVIEW";
1845
- img: HTMLImageElement;
1846
- } | {
1847
- type: "MAIN";
1848
- img: HTMLImageElement;
1849
- };
1850
- get hasPreviewImage(): any;
1851
- get bgSelector(): any;
2112
+ get currentImg(): CurrentImg;
2113
+ get hasPreviewImage(): string | number | boolean | undefined;
2114
+ get bgSelector(): string | undefined;
1852
2115
  get breakpoints(): number[] | null;
1853
2116
  get hasFormatJPG(): boolean;
1854
- /** @param {HTMLElement} el */
1855
2117
  renderBg(el: HTMLElement): void;
1856
2118
  getSrcset(): string;
1857
- getSrc(): any;
1858
- get srcUrlPreview(): any;
2119
+ getSrc(): string | undefined;
2120
+ get srcUrlPreview(): string | undefined;
1859
2121
  renderBackground(): void;
1860
- _appendURL({ elNode, src, srcset }: {
1861
- elNode: any;
1862
- src: any;
1863
- srcset: any;
1864
- }): void;
1865
- _setupConfigForImage({ elNode }: {
1866
- elNode: any;
1867
- }): void;
1868
- loaderImage({ src, srcset, elNode }: {
1869
- src: any;
1870
- srcset: any;
1871
- elNode: any;
1872
- }): Promise<any>;
2122
+ private _appendURL;
2123
+ private _setupConfigForImage;
2124
+ loaderImage({ src, srcset, elNode }: LoaderParams): Promise<HTMLImageElement>;
1873
2125
  renderImage(): Promise<void>;
1874
2126
  init(): void;
1875
2127
  }
1876
2128
 
1877
2129
  declare class Img extends ImgBase {
2130
+ connectedCallback(): void;
1878
2131
  }
1879
2132
 
1880
- declare class ProgressBar extends Block {
1881
- private _value;
1882
- private _visible;
1883
- constructor();
1884
- 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>;
1885
2145
  }
1886
2146
 
1887
- declare class ProgressBarCommon extends UploaderBlock {
2147
+ declare class ProgressBarCommon extends LitUploaderBlock {
1888
2148
  private _unobserveCollectionCb?;
2149
+ protected visible: boolean;
2150
+ protected value: number;
1889
2151
  constructor();
1890
2152
  initCallback(): void;
1891
- destroyCallback(): void;
2153
+ protected updated(changedProperties: PropertyValues<this>): void;
2154
+ disconnectedCallback(): void;
2155
+ render(): lit_html.TemplateResult<1>;
1892
2156
  }
1893
2157
 
1894
- declare class Select extends Block {
1895
- ref: {
1896
- select: HTMLSelectElement;
1897
- } & Record<string, HTMLElement>;
2158
+ type SelectOption = {
2159
+ text: string;
1898
2160
  value: string;
1899
- constructor();
1900
- 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;
1901
2168
  }
1902
2169
 
1903
- declare class SimpleBtn extends UploaderBlock {
2170
+ declare class SimpleBtn extends LitUploaderBlock {
1904
2171
  static styleAttrs: string[];
1905
2172
  couldBeCtxOwner: boolean;
1906
- constructor();
2173
+ dropzone: boolean;
2174
+ private buttonTextKey;
2175
+ private readonly handleClick;
1907
2176
  initCallback(): void;
2177
+ render(): lit_html.TemplateResult<1>;
1908
2178
  }
1909
2179
 
1910
2180
  type SourceTypeConfig = {
@@ -1915,54 +2185,76 @@ type SourceTypeConfig = {
1915
2185
  activate?: () => boolean;
1916
2186
  activityParams?: Record<string, unknown>;
1917
2187
  };
1918
- declare class SourceBtn extends UploaderBlock {
2188
+ declare class SourceBtn extends LitUploaderBlock {
1919
2189
  couldBeCtxOwner: boolean;
1920
- private type;
1921
2190
  private _registeredTypes;
1922
- constructor();
2191
+ type?: string;
2192
+ private iconName;
2193
+ private srcTypeKey;
1923
2194
  initTypes(): void;
1924
2195
  initCallback(): void;
1925
2196
  registerType(typeConfig: SourceTypeConfig): void;
1926
2197
  getType(type: string): SourceTypeConfig | undefined;
1927
2198
  activate(): void;
1928
2199
  applyType(type: string): void;
2200
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
2201
+ render(): lit_html.TemplateResult<1>;
1929
2202
  }
1930
2203
 
1931
- declare class SourceList extends Block {
2204
+ declare class SourceList extends LitBlock {
2205
+ private _rawSourceList;
2206
+ private _cameraModes;
2207
+ private _resolvedSources;
1932
2208
  initCallback(): void;
2209
+ protected updated(changedProperties: PropertyValues): void;
2210
+ private _updateSources;
2211
+ sources: string[];
2212
+ render(): lit_html.TemplateResult<1>;
1933
2213
  }
1934
2214
 
1935
- declare class Spinner extends BaseComponent<void> {
2215
+ declare class Spinner extends LitBlock {
2216
+ render(): lit_html.TemplateResult<1>;
1936
2217
  }
1937
2218
 
1938
- declare class StartFrom extends ActivityBlock {
2219
+ declare class StartFrom extends LitActivityBlock {
1939
2220
  historyTracked: boolean;
1940
2221
  activityType: ActivityType;
1941
2222
  initCallback(): void;
2223
+ render(): lit_html.TemplateResult<1>;
1942
2224
  }
1943
2225
 
1944
2226
  declare class Thumb extends FileItemConfig {
1945
- private _renderedGridOnce;
1946
- private _thumbRect;
1947
- private _isIntersecting;
1948
- private _firstViewMode;
1949
- private _observer?;
1950
- constructor();
1951
- private _calculateThumbSize;
1952
- private _generateThumbnail;
1953
- 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;
1954
2245
  private _observerCallback;
1955
2246
  protected _reset(): void;
1956
- private _handleEntryId;
2247
+ private bindToEntry;
1957
2248
  initCallback(): void;
1958
2249
  connectedCallback(): void;
1959
2250
  disconnectedCallback(): void;
2251
+ render(): lit_html.TemplateResult<1>;
1960
2252
  }
1961
2253
 
1962
2254
  type EventListenerMap = {
1963
2255
  [K in (typeof EventType)[keyof typeof EventType]]: (e: CustomEvent<EventPayload[K]>) => void;
1964
2256
  };
1965
- declare class UploadCtxProvider extends UploaderBlock {
2257
+ declare class UploadCtxProvider extends LitUploaderBlock {
1966
2258
  static styleAttrs: string[];
1967
2259
  static EventType: Readonly<{
1968
2260
  readonly FILE_ADDED: "file-added";
@@ -1984,20 +2276,45 @@ declare class UploadCtxProvider extends UploaderBlock {
1984
2276
  readonly CHANGE: "change";
1985
2277
  readonly GROUP_CREATED: "group-created";
1986
2278
  }>;
1987
- requireCtxName: boolean;
1988
2279
  initCallback(): void;
1989
- destroyCallback(): void;
2280
+ disconnectedCallback(): void;
1990
2281
  }
1991
- interface UploadCtxProvider extends UploaderBlock {
2282
+ interface UploadCtxProvider extends LitUploaderBlock {
1992
2283
  addEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | AddEventListenerOptions): void;
1993
2284
  removeEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | EventListenerOptions): void;
1994
2285
  }
1995
2286
 
1996
- declare class UrlSource extends UploaderBlock {
2287
+ declare class UrlSource extends LitUploaderBlock {
1997
2288
  couldBeCtxOwner: boolean;
1998
2289
  activityType: ActivityType;
1999
- constructor();
2290
+ private formState;
2000
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>;
2001
2318
  }
2002
2319
 
2003
2320
  declare class CloudImageEditor extends CloudImageEditorBlock {
@@ -2006,32 +2323,44 @@ declare class CloudImageEditor extends CloudImageEditorBlock {
2006
2323
  initCallback(): void;
2007
2324
  }
2008
2325
 
2009
- declare class FileUploaderInline extends SolutionBlock {
2326
+ declare class FileUploaderInline extends LitSolutionBlock {
2010
2327
  static styleAttrs: string[];
2328
+ private couldCancel;
2011
2329
  constructor();
2330
+ private _handleCancel;
2012
2331
  get couldHistoryBack(): boolean;
2013
2332
  get couldShowList(): boolean;
2333
+ private _getInitActivity;
2014
2334
  initCallback(): void;
2335
+ render(): lit_html.TemplateResult<1>;
2015
2336
  }
2016
2337
 
2017
- declare class FileUploaderMinimal extends SolutionBlock {
2338
+ declare class FileUploaderMinimal extends LitSolutionBlock {
2018
2339
  static styleAttrs: string[];
2340
+ protected singleUpload: boolean;
2341
+ protected isHiddenStartFrom: boolean;
2342
+ protected classUploadList: string;
2343
+ protected classStartFrom: string;
2019
2344
  private handleModalOpen?;
2020
2345
  private handleModalClose?;
2346
+ private _getInitActivity;
2021
2347
  constructor();
2022
2348
  private _handleModalOpen;
2023
2349
  private _handleModalClose;
2024
2350
  initCallback(): void;
2025
- destroyCallback(): void;
2351
+ disconnectedCallback(): void;
2352
+ render(): lit_html.TemplateResult<1>;
2026
2353
  }
2027
2354
 
2028
- declare class FileUploaderRegular extends SolutionBlock {
2355
+ declare class FileUploaderRegular extends LitSolutionBlock {
2029
2356
  static styleAttrs: string[];
2357
+ headless: boolean;
2030
2358
  constructor();
2031
2359
  initCallback(): void;
2360
+ render(): lit_html.TemplateResult<1>;
2032
2361
  }
2033
2362
 
2034
2363
  type KebabCase<T extends string> = T extends `${infer Head} ${infer Tail}` ? `${Lowercase<Head>}-${KebabCase<Tail>}` : Lowercase<T>;
2035
2364
  declare const toKebabCase: <T extends string>(str: T) => KebabCase<T>;
2036
2365
 
2037
- 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 };