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

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