@uploadcare/file-uploader 1.25.0-alpha.3 → 1.25.0-alpha.6

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