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