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

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 -926
  5. package/dist/index.js +6 -13630
  6. package/dist/index.layered.css +4 -2720
  7. package/dist/index.ssr.js +34 -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 -928
  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 -928
  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 -494
  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 -928
  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 -928
  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 -928
  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$: {
@@ -1018,13 +959,13 @@ declare class LitUploaderBlock extends LitActivityBlock {
1018
959
  '*historyBack': null;
1019
960
  '*closeModal': () => void;
1020
961
  };
1021
- private get hasCtxOwner();
962
+ private get _hasCtxOwner();
1022
963
  initCallback(): void;
1023
964
  protected get validationManager(): ValidationManager;
1024
965
  get api(): UploaderPublicApi;
1025
966
  getAPI(): UploaderPublicApi;
1026
- get uploadCollection(): TypedCollection<typeof uploadEntrySchema>;
1027
- destroyCtxCallback(): void;
967
+ get uploadCollection(): TypedCollection<UploadEntryData>;
968
+ get secureUploadsManager(): SecureUploadsManager;
1028
969
  disconnectedCallback(): void;
1029
970
  connectedCallback(): void;
1030
971
  private _initCtxOwner;
@@ -1035,8 +976,8 @@ declare class LitUploaderBlock extends LitActivityBlock {
1035
976
  private _handleCollectionUpdate;
1036
977
  private _handleCollectionPropertiesUpdate;
1037
978
  private _flushCommonUploadProgress;
1038
- openCloudImageEditor(): void;
1039
- private setInitialCrop;
979
+ private _openCloudImageEditor;
980
+ private _setInitialCrop;
1040
981
  protected getMetadataFor(entryId: string): Promise<_uploadcare_upload_client.Metadata | undefined>;
1041
982
  protected getUploadClientOptions(): Promise<FileFromOptions>;
1042
983
  getOutputData(): OutputFileEntry[];
@@ -1088,6 +1029,7 @@ interface CropAspectRatio {
1088
1029
  id: string;
1089
1030
  hasFreeform?: boolean;
1090
1031
  }
1032
+ type CropPresetList = CropAspectRatio[];
1091
1033
 
1092
1034
  type ActivityParams$1 = {
1093
1035
  internalId: string;
@@ -1096,14 +1038,14 @@ declare class CloudImageEditorActivity extends LitUploaderBlock {
1096
1038
  couldBeCtxOwner: boolean;
1097
1039
  activityType: "cloud-image-edit";
1098
1040
  private _entry?;
1099
- private editorConfig;
1041
+ private _editorConfig;
1100
1042
  get activityParams(): ActivityParams$1;
1101
1043
  initCallback(): void;
1102
- handleApply(e: CustomEvent<ApplyResult>): void;
1103
- handleCancel(event?: Event): void;
1044
+ private _handleApply;
1045
+ private _handleCancel;
1104
1046
  handleChange(event: CustomEvent<ChangeResult>): void;
1105
- mountEditor(): void;
1106
- unmountEditor(): void;
1047
+ private _mountEditor;
1048
+ private _unmountEditor;
1107
1049
  render(): lit_html.TemplateResult<1> | typeof nothing;
1108
1050
  private _createEditorConfig;
1109
1051
  }
@@ -1115,36 +1057,36 @@ declare class ExternalSource extends LitUploaderBlock {
1115
1057
  couldBeCtxOwner: boolean;
1116
1058
  activityType: "external";
1117
1059
  private _messageBridge?;
1118
- private iframeRef;
1060
+ private _iframeRef;
1119
1061
  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();
1062
+ private _selectedList;
1063
+ private _isSelectionReady;
1064
+ private _isDoneBtnEnabled;
1065
+ private _couldSelectAll;
1066
+ private _couldDeselectAll;
1067
+ private _showSelectionStatus;
1068
+ private _showDoneBtn;
1069
+ private _doneBtnTextClass;
1070
+ private _toolbarVisible;
1071
+ private get _counterText();
1130
1072
  get activityParams(): ActivityParams;
1131
1073
  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;
1074
+ private _extractUrlFromSelectedFile;
1075
+ private _handleToolbarStateChange;
1076
+ private _handleSelectedFilesChange;
1077
+ private _handleIframeLoad;
1078
+ private _applyTheme;
1079
+ private _applyEmbedCss;
1080
+ private _setupL10n;
1081
+ private _remoteUrl;
1140
1082
  private _handleDone;
1141
1083
  private _handleCancel;
1142
1084
  private _handleSelectAll;
1143
1085
  private _handleDeselectAll;
1144
1086
  private _setSelectionSummary;
1145
- private mountIframe;
1146
- private unmountIframe;
1147
- private resetSelectionStatus;
1087
+ private _mountIframe;
1088
+ private _unmountIframe;
1089
+ private _resetSelectionStatus;
1148
1090
  disconnectedCallback(): void;
1149
1091
  render(): lit_html.TemplateResult<1>;
1150
1092
  }
@@ -1164,9 +1106,7 @@ declare class LitActivityBlock extends LitBlock {
1164
1106
  '*historyBack': null;
1165
1107
  '*closeModal': () => void;
1166
1108
  };
1167
- _debouncedHistoryFlush: (() => void) & {
1168
- cancel: () => void;
1169
- };
1109
+ private _debouncedHistoryFlush;
1170
1110
  private _deactivate;
1171
1111
  private _activate;
1172
1112
  initCallback(): void;
@@ -1182,16 +1122,15 @@ declare class LitActivityBlock extends LitBlock {
1182
1122
  CLOUD_IMG_EDIT: 'cloud-image-edit';
1183
1123
  EXTERNAL: 'external';
1184
1124
  }>;
1185
- get isActivityActive(): boolean;
1125
+ protected get isActivityActive(): boolean;
1186
1126
  get couldOpenActivity(): boolean;
1187
1127
  /** TODO: remove name argument */
1188
- registerActivity(_name: string, options?: {
1128
+ protected registerActivity(_name: string, options?: {
1189
1129
  onActivate?: () => void;
1190
1130
  onDeactivate?: () => void;
1191
1131
  }): void;
1192
- unregisterActivity(): void;
1132
+ private _unregisterActivity;
1193
1133
  disconnectedCallback(): void;
1194
- get activityKey(): string;
1195
1134
  get activityParams(): ActivityParamsMap[keyof ActivityParamsMap];
1196
1135
  get initActivity(): string | null;
1197
1136
  get doneActivity(): string | null;
@@ -1260,8 +1199,7 @@ declare class EventEmitter {
1260
1199
  private _targets;
1261
1200
  private _debugPrint;
1262
1201
  constructor(debugPrint: (...args: unknown[]) => void);
1263
- bindTarget(target: LitBlock): void;
1264
- unbindTarget(target: LitBlock): void;
1202
+ bindTarget(target: LitBlock): () => void;
1265
1203
  private _dispatch;
1266
1204
  emit<T extends EventKey, TDebounce extends boolean | number | undefined = undefined>(type: T, payload?: TDebounce extends false | undefined ? EventPayload[T] : () => EventPayload[T], options?: {
1267
1205
  debounce?: TDebounce;
@@ -1277,87 +1215,210 @@ type TelemetryEventBody = Partial<Pick<TelemetryState, 'payload' | 'config'>> &
1277
1215
  modalId?: string;
1278
1216
  eventType?: CommonEventType;
1279
1217
  };
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;
1218
+ interface ITelemetryManager {
1293
1219
  sendEvent(body: TelemetryEventBody): void;
1294
1220
  sendEventError(error: unknown, context?: string): void;
1295
- /**
1296
- * Method to send telemetry event for Cloud Image Editor.
1297
- */
1298
1221
  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
1222
  }
1308
1223
 
1309
- declare const LitBlockBase: typeof LitElement & Constructor$1<{
1224
+ declare const TabId: Readonly<{
1225
+ readonly CROP: "crop";
1226
+ readonly TUNING: "tuning";
1227
+ readonly FILTERS: "filters";
1228
+ }>;
1229
+ type TabIdValue$1 = (typeof TabId)[keyof typeof TabId];
1230
+ declare const ALL_COLOR_OPERATIONS: readonly ["brightness", "exposure", "gamma", "contrast", "saturation", "vibrance", "warmth", "enhance"];
1231
+ type ColorOperation = (typeof ALL_COLOR_OPERATIONS)[number];
1232
+ 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"];
1233
+ type FilterId = (typeof ALL_FILTERS)[number];
1234
+ declare const ALL_CROP_OPERATIONS: readonly ["rotate", "mirror", "flip"];
1235
+ type CropOperation = (typeof ALL_CROP_OPERATIONS)[number];
1236
+ /** KeypointsNumber is the number of keypoints loaded from each side of zero, not total number */
1237
+ declare const COLOR_OPERATIONS_CONFIG: Readonly<{
1238
+ brightness: {
1239
+ zero: number;
1240
+ range: readonly [-100, 100];
1241
+ keypointsNumber: number;
1242
+ };
1243
+ exposure: {
1244
+ zero: number;
1245
+ range: readonly [-500, 500];
1246
+ keypointsNumber: number;
1247
+ };
1248
+ gamma: {
1249
+ zero: number;
1250
+ range: readonly [0, 1000];
1251
+ keypointsNumber: number;
1252
+ };
1253
+ contrast: {
1254
+ zero: number;
1255
+ range: readonly [-100, 500];
1256
+ keypointsNumber: number;
1257
+ };
1258
+ saturation: {
1259
+ zero: number;
1260
+ range: readonly [-100, 500];
1261
+ keypointsNumber: number;
1262
+ };
1263
+ vibrance: {
1264
+ zero: number;
1265
+ range: readonly [-100, 500];
1266
+ keypointsNumber: number;
1267
+ };
1268
+ warmth: {
1269
+ zero: number;
1270
+ range: readonly [-100, 100];
1271
+ keypointsNumber: number;
1272
+ };
1273
+ enhance: {
1274
+ zero: number;
1275
+ range: readonly [0, 100];
1276
+ keypointsNumber: number;
1277
+ };
1278
+ filter: {
1279
+ zero: number;
1280
+ range: readonly [0, 100];
1281
+ keypointsNumber: number;
1282
+ };
1283
+ }>;
1284
+
1285
+ type SharedConfigState = {
1286
+ [K in keyof ConfigType as `*cfg/${K}`]: ConfigType[K];
1287
+ };
1288
+ type BlockCtxState = Record<string, never>;
1289
+ type ActivityBlockCtxState = BlockCtxState & {
1290
+ '*currentActivity': string | null;
1291
+ '*currentActivityParams': Record<string, unknown>;
1292
+ '*history': (string | null)[];
1293
+ '*historyBack': (() => void) | null;
1294
+ '*closeModal': () => void;
1295
+ };
1296
+ type UploaderBlockCtxState = ActivityBlockCtxState & {
1297
+ '*commonProgress': number;
1298
+ '*uploadList': {
1299
+ uid: Uid;
1300
+ }[];
1301
+ '*uploadQueue': Queue;
1302
+ '*collectionErrors': OutputErrorCollection[];
1303
+ '*collectionState': OutputCollectionState | null;
1304
+ '*groupInfo': UploadcareGroup | null;
1305
+ '*uploadTrigger': Set<Uid>;
1306
+ '*secureUploadsManager': SecureUploadsManager;
1307
+ };
1308
+ type SolutionBlockCtxState = UploaderBlockCtxState & {
1309
+ '*solution': string | null;
1310
+ };
1311
+ type CloudImageEditorState = {
1312
+ '*originalUrl': string | null;
1313
+ '*loadingOperations': LoadingOperations;
1314
+ '*faderEl': EditorImageFader | null;
1315
+ '*cropperEl': EditorImageCropper | null;
1316
+ '*imgEl': HTMLImageElement | null;
1317
+ '*imgContainerEl': HTMLElement | null;
1318
+ '*networkProblems': boolean;
1319
+ '*imageSize': {
1320
+ width: number;
1321
+ height: number;
1322
+ } | null;
1323
+ '*editorTransformations': Transformations;
1324
+ '*cropPresetList': CropPresetList;
1325
+ '*currentAspectRatio': CropAspectRatio | null;
1326
+ '*tabList': readonly TabIdValue$1[];
1327
+ '*tabId': TabIdValue$1;
1328
+ '*on.retryNetwork': () => void;
1329
+ '*on.apply': (transformations: Transformations) => void;
1330
+ '*on.cancel': () => void;
1331
+ };
1332
+ type EditorImageCropperState = {
1333
+ '*padding': number;
1334
+ '*operations': {
1335
+ rotate: number;
1336
+ mirror: boolean;
1337
+ flip: boolean;
1338
+ };
1339
+ '*imageBox': {
1340
+ x: number;
1341
+ y: number;
1342
+ width: number;
1343
+ height: number;
1344
+ };
1345
+ '*cropBox': {
1346
+ x: number;
1347
+ y: number;
1348
+ width: number;
1349
+ height: number;
1350
+ };
1351
+ };
1352
+ type EditorToolbarState = {
1353
+ '*showListAspectRatio': boolean;
1354
+ '*sliderEl': EditorSlider | null;
1355
+ '*showSlider': boolean;
1356
+ '*currentFilter': string;
1357
+ '*currentOperation': string | null;
1358
+ '*operationTooltip': string | null;
1359
+ };
1360
+ type DynamicBlockState = {
1361
+ '*blocksRegistry': Set<LitBlock>;
1362
+ '*eventEmitter': EventEmitter;
1363
+ '*localeManager': LocaleManager;
1364
+ '*telemetryManager': ITelemetryManager;
1365
+ '*a11y': A11y;
1366
+ '*modalManager': ModalManager | null;
1367
+ };
1368
+ type DynamicUploaderBlockState = {
1369
+ '*uploadCollection': TypedCollection<UploadEntryData> | null;
1370
+ '*publicApi': UploaderPublicApi;
1371
+ '*validationManager': ValidationManager;
1372
+ };
1373
+ type LocaleState = {
1374
+ [key: `*l10n/${string}`]: string;
1375
+ };
1376
+ type SharedState = SolutionBlockCtxState & SharedConfigState & CloudImageEditorState & EditorImageCropperState & EditorToolbarState & DynamicBlockState & DynamicUploaderBlockState & LocaleState;
1377
+
1378
+ declare const LitBlockBase: typeof LitElement & Constructor<{
1379
+ willYield: boolean;
1310
1380
  yield(slot: string, defaultContent?: unknown): unknown;
1311
- }> & Constructor$1<{
1381
+ }> & Constructor<{
1312
1382
  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> & {
1383
+ }> & Constructor<SymbioteComponent<SharedState>> & Constructor<LitElement> & {
1331
1384
  reg(tagName: string): void;
1332
1385
  };
1333
1386
  declare class LitBlock extends LitBlockBase {
1334
- private __cfgProxy;
1387
+ private _cfgProxy;
1388
+ private _sharedContextInstances;
1335
1389
  static styleAttrs: string[];
1336
1390
  activityType: ActivityType;
1337
1391
  init$: {};
1338
1392
  constructor();
1339
1393
  l10n(str: string, variables?: Record<string, string | number>): string;
1340
- private pluralize;
1394
+ private _pluralize;
1341
1395
  emit(type: Parameters<EventEmitter['emit']>[0], payload?: Parameters<EventEmitter['emit']>[1], options?: Parameters<EventEmitter['emit']>[2]): void;
1342
1396
  hasBlockInCtx(callback: (block: LitBlock) => boolean): boolean;
1343
- setOrAddState(prop: string, newVal: unknown): void;
1344
1397
  connectedCallback(): void;
1345
1398
  initCallback(): void;
1346
1399
  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>;
1400
+ get modalManager(): ModalManager | null;
1401
+ get telemetryManager(): ITelemetryManager;
1402
+ get localeManager(): LocaleManager;
1403
+ get a11y(): A11y;
1404
+ get blocksRegistry(): Set<LitBlock>;
1405
+ get eventEmitter(): EventEmitter;
1356
1406
  disconnectedCallback(): void;
1357
1407
  /**
1358
1408
  * Called when the last block is removed from the context. Note that inheritors must run their callback before that.
1359
1409
  */
1360
1410
  protected destroyCtxCallback(): void;
1411
+ /**
1412
+ * Adds a shared context instance if it does not exist yet.
1413
+ * @param key The shared state key.
1414
+ * @param resolver The resolver function that creates the instance.
1415
+ * @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.
1416
+ */
1417
+ protected addSharedContextInstance<TKey extends keyof SharedState>(key: TKey, resolver: () => SharedState[TKey], { persist }?: {
1418
+ persist?: boolean | undefined;
1419
+ }): void;
1420
+ private _destroySharedContextInstances;
1421
+ protected getSharedContextInstance<TKey extends keyof SharedState, TRequired extends boolean = true>(key: TKey, isRequired?: TRequired): TRequired extends true ? NonNullable<SharedState[TKey]> : SharedState[TKey];
1361
1422
  protected proxyUrl(url: string): Promise<string>;
1362
1423
  get cfg(): ConfigType;
1363
1424
  subConfigValue<T extends keyof ConfigType>(key: T, callback: (value: ConfigType[T]) => void): () => void;
@@ -1367,15 +1428,11 @@ declare class LitBlock extends LitBlockBase {
1367
1428
  declare class Modal extends LitBlock {
1368
1429
  static styleAttrs: string[];
1369
1430
  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;
1431
+ private _dialogEl;
1432
+ private _closeDialog;
1433
+ private _handleDialogClose;
1434
+ private _handleDialogMouseDown;
1435
+ private _handleDialogMouseUp;
1379
1436
  show(): void;
1380
1437
  hide(): void;
1381
1438
  private _handleModalOpen;
@@ -1383,7 +1440,7 @@ declare class Modal extends LitBlock {
1383
1440
  private _handleModalCloseAll;
1384
1441
  initCallback(): void;
1385
1442
  disconnectedCallback(): void;
1386
- private handleDialogRef;
1443
+ private _handleDialogRef;
1387
1444
  render(): lit_html.TemplateResult<1>;
1388
1445
  }
1389
1446
 
@@ -1441,80 +1498,333 @@ declare class ModalManager {
1441
1498
  destroy(): void;
1442
1499
  }
1443
1500
 
1444
- declare class ActivityHeader extends LitActivityBlock {
1501
+ type KebabCase<T extends string> = T extends `${infer Head} ${infer Tail}` ? `${Lowercase<Head>}-${KebabCase<Tail>}` : Lowercase<T>;
1502
+ declare const toKebabCase: <T extends string>(str: T) => KebabCase<T>;
1503
+
1504
+ declare class Icon extends LitBlock {
1505
+ name: string;
1506
+ private _resolvedHref;
1507
+ private _iconHrefResolver;
1508
+ initCallback(): void;
1509
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
1510
+ private _updateResolvedHref;
1511
+ render(): lit_html.TemplateResult<1>;
1445
1512
  }
1446
1513
 
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
- };
1514
+ type CssPropValue = string | number | undefined | null;
1515
+ declare const ImgConfig_base: typeof LitElement & Constructor<LitElement> & {
1516
+ reg(tagName: string): void;
1517
+ } & Constructor<{
1518
+ getCssData(propName: string, silentCheck?: boolean): string | number | boolean | null | undefined;
1519
+ }>;
1520
+ declare class ImgConfig extends ImgConfig_base {
1521
+ private _state;
1522
+ private _subscribers;
1523
+ private _isnObserver;
1524
+ private _observed;
1525
+ createRenderRoot(): HTMLElement | ShadowRoot;
1526
+ constructor();
1527
+ protected $$(key: string): unknown;
1528
+ protected set$$(kvObj: Record<string, CssPropValue>): void;
1529
+ protected sub$$<T = unknown>(key: string, kbFn: (val: T) => void): void;
1530
+ private _notify;
1531
+ protected analyticsParams(): string;
1532
+ protected initAttributes(el: HTMLElement): void;
1533
+ protected initIntersection(el: HTMLElement, cbkFn: () => void): void;
1534
+ connectedCallback(): void;
1535
+ private _initCssProperties;
1536
+ disconnectedCallback(): void;
1537
+ static get observedAttributes(): string[];
1538
+ attributeChangedCallback(name: string, _oldVal: string | null, newVal: string | null): void;
1539
+ }
1465
1540
 
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>;
1541
+ declare class ImgBase extends ImgConfig {
1542
+ private _img;
1543
+ private _imgPreview;
1544
+ private _fmtAbs;
1545
+ private _validateSize;
1546
+ private _getCdnModifiers;
1547
+ private _getTypedCssValue;
1548
+ private _getUrlBase;
1549
+ private _proxyUrl;
1550
+ protected _getElSize(el: HTMLElement, k?: number, wOnly?: boolean): string | null;
1551
+ private _setupEventProxy;
1552
+ protected get img(): HTMLImageElement;
1553
+ private get _currentImg();
1554
+ private get _hasPreviewImage();
1555
+ private get _bgSelector();
1556
+ private get _breakpoints();
1557
+ private get _hasFormatJPG();
1558
+ private _renderBg;
1559
+ private _getSrcset;
1560
+ private _getSrc;
1561
+ private get _srcUrlPreview();
1562
+ private _renderBackground;
1563
+ private _appendURL;
1564
+ private _setupConfigForImage;
1565
+ private _loaderImage;
1566
+ private _renderImage;
1567
+ protected init(): void;
1568
+ }
1569
+
1570
+ declare class Img extends ImgBase {
1571
+ attributesMeta: {
1572
+ src: string;
1573
+ } | {
1574
+ uuid: string;
1575
+ };
1576
+ connectedCallback(): void;
1577
+ }
1578
+
1579
+ declare class FormInput extends LitUploaderBlock {
1580
+ propertiesMeta: {
1581
+ 'ctx-name': string;
1582
+ };
1583
+ private _validationInputElement;
1584
+ private _dynamicInputsContainer;
1585
+ private _createValidationInput;
1586
+ initCallback(): void;
1587
+ }
1588
+
1589
+ declare class Copyright extends LitBlock {
1498
1590
  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
1591
  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
1592
  }
1516
1593
 
1517
- declare class CropFrame extends LitBlock {
1594
+ declare class ProgressBar extends LitBlock {
1595
+ value: number;
1596
+ visible: boolean;
1597
+ private _progressValue;
1598
+ private readonly _fakeProgressLineRef;
1599
+ private readonly _handleFakeProgressAnimation;
1600
+ protected firstUpdated(changedProperties: PropertyValues<this>): void;
1601
+ protected updated(changedProperties: PropertyValues<this>): void;
1602
+ disconnectedCallback(): void;
1603
+ private _normalizeProgressValue;
1604
+ private _updateProgressValueStyle;
1605
+ render(): lit_html.TemplateResult<1>;
1606
+ }
1607
+
1608
+ declare class ProgressBarCommon extends LitUploaderBlock {
1609
+ private _unobserveCollectionCb?;
1610
+ private _visible;
1611
+ private _value;
1612
+ constructor();
1613
+ initCallback(): void;
1614
+ protected updated(changedProperties: PropertyValues<this>): void;
1615
+ disconnectedCallback(): void;
1616
+ render(): lit_html.TemplateResult<1>;
1617
+ }
1618
+
1619
+ type SelectOption = {
1620
+ text: string;
1621
+ value: string;
1622
+ };
1623
+ declare class Select extends LitBlock {
1624
+ value: string;
1625
+ disabled: boolean;
1626
+ options: SelectOption[];
1627
+ render(): lit_html.TemplateResult<1>;
1628
+ private _handleChange;
1629
+ }
1630
+
1631
+ declare class SourceBtn extends LitUploaderBlock {
1632
+ couldBeCtxOwner: boolean;
1633
+ private _registeredTypes;
1634
+ type?: string;
1635
+ private _iconName;
1636
+ private _srcTypeKey;
1637
+ private _initTypes;
1638
+ initCallback(): void;
1639
+ private _registerType;
1640
+ activate(): void;
1641
+ private _applyType;
1642
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
1643
+ render(): lit_html.TemplateResult<1>;
1644
+ }
1645
+
1646
+ declare class SourceList extends LitBlock {
1647
+ private _rawSourceList;
1648
+ private _cameraModes;
1649
+ initCallback(): void;
1650
+ protected updated(changedProperties: PropertyValues<this>): void;
1651
+ private _updateSources;
1652
+ private _sources;
1653
+ render(): lit_html.TemplateResult<1>;
1654
+ }
1655
+
1656
+ declare class Spinner extends LitBlock {
1657
+ render(): lit_html.TemplateResult<1>;
1658
+ }
1659
+
1660
+ declare class FileItemConfig extends LitUploaderBlock {
1661
+ private _entrySubs;
1662
+ protected entry: UploadEntryTypedData | null;
1663
+ protected withEntry<A extends unknown[], R>(fn: (entry: UploadEntryTypedData, ...args: A) => R): (...args: A) => R | undefined;
1664
+ protected subEntry<K extends UploadEntryKeys>(prop: K, handler: (value: UploadEntryData[K]) => void): void;
1665
+ protected reset(): void;
1666
+ disconnectedCallback(): void;
1667
+ }
1668
+
1669
+ declare class Thumb extends FileItemConfig {
1670
+ badgeIcon: string;
1671
+ uid: Uid;
1672
+ private _thumbUrl;
1673
+ private _renderedGridOnce;
1674
+ private _thumbRect;
1675
+ private _isIntersecting;
1676
+ private _firstViewMode;
1677
+ private _observer?;
1678
+ private _pendingThumbUpdate?;
1679
+ private _calculateThumbSize;
1680
+ private _generateThumbnail;
1681
+ private _debouncedGenerateThumb;
1682
+ private _decodeImage;
1683
+ private _cancelPendingThumbUpdate;
1684
+ private _scheduleThumbUpdate;
1685
+ private _requestThumbGeneration;
1686
+ protected firstUpdated(changedProperties: PropertyValues<this>): void;
1687
+ protected updated(changedProperties: PropertyValues<this>): void;
1688
+ private _observerCallback;
1689
+ protected reset(): void;
1690
+ private _bindToEntry;
1691
+ initCallback(): void;
1692
+ connectedCallback(): void;
1693
+ disconnectedCallback(): void;
1694
+ render(): lit_html.TemplateResult<1>;
1695
+ }
1696
+
1697
+ declare class ActivityHeader extends LitActivityBlock {
1698
+ }
1699
+
1700
+ declare class StartFrom extends LitActivityBlock {
1701
+ protected historyTracked: boolean;
1702
+ activityType: ActivityType;
1703
+ initCallback(): void;
1704
+ render(): lit_html.TemplateResult<1>;
1705
+ }
1706
+
1707
+ type EventListenerMap = {
1708
+ [K in (typeof EventType)[keyof typeof EventType]]: (e: CustomEvent<EventPayload[K]>) => void;
1709
+ };
1710
+ declare class UploadCtxProvider extends LitUploaderBlock {
1711
+ propertiesMeta: {
1712
+ 'ctx-name': string;
1713
+ };
1714
+ static styleAttrs: string[];
1715
+ static EventType: Readonly<{
1716
+ readonly FILE_ADDED: "file-added";
1717
+ readonly FILE_REMOVED: "file-removed";
1718
+ readonly FILE_UPLOAD_START: "file-upload-start";
1719
+ readonly FILE_UPLOAD_PROGRESS: "file-upload-progress";
1720
+ readonly FILE_UPLOAD_SUCCESS: "file-upload-success";
1721
+ readonly FILE_UPLOAD_FAILED: "file-upload-failed";
1722
+ readonly FILE_URL_CHANGED: "file-url-changed";
1723
+ readonly MODAL_OPEN: "modal-open";
1724
+ readonly MODAL_CLOSE: "modal-close";
1725
+ readonly DONE_CLICK: "done-click";
1726
+ readonly UPLOAD_CLICK: "upload-click";
1727
+ readonly ACTIVITY_CHANGE: "activity-change";
1728
+ readonly COMMON_UPLOAD_START: "common-upload-start";
1729
+ readonly COMMON_UPLOAD_PROGRESS: "common-upload-progress";
1730
+ readonly COMMON_UPLOAD_SUCCESS: "common-upload-success";
1731
+ readonly COMMON_UPLOAD_FAILED: "common-upload-failed";
1732
+ readonly CHANGE: "change";
1733
+ readonly GROUP_CREATED: "group-created";
1734
+ }>;
1735
+ private _unbindEventEmitter;
1736
+ initCallback(): void;
1737
+ disconnectedCallback(): void;
1738
+ }
1739
+ interface UploadCtxProvider extends LitUploaderBlock {
1740
+ addEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | AddEventListenerOptions): void;
1741
+ removeEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | EventListenerOptions): void;
1742
+ }
1743
+
1744
+ declare class UrlSource extends LitUploaderBlock {
1745
+ couldBeCtxOwner: boolean;
1746
+ activityType: ActivityType;
1747
+ private _formState;
1748
+ initCallback(): void;
1749
+ private _inputRef;
1750
+ private _handleInput;
1751
+ private _handleUpload;
1752
+ render(): lit_html.TemplateResult<1>;
1753
+ }
1754
+
1755
+ declare function initState(fnCtx: CloudImageEditorBlock): {
1756
+ '*originalUrl': null;
1757
+ '*loadingOperations': LoadingOperations;
1758
+ '*faderEl': null;
1759
+ '*cropperEl': null;
1760
+ '*imgEl': null;
1761
+ '*imgContainerEl': null;
1762
+ '*networkProblems': boolean;
1763
+ '*imageSize': null;
1764
+ '*editorTransformations': {};
1765
+ '*cropPresetList': never[];
1766
+ '*currentAspectRatio': null;
1767
+ '*tabList': readonly ["crop", "tuning", "filters"];
1768
+ '*tabId': "crop";
1769
+ '*on.retryNetwork': () => void;
1770
+ '*on.apply': (transformations: Transformations) => void;
1771
+ '*on.cancel': () => void;
1772
+ };
1773
+
1774
+ declare class CloudImageEditorBlock extends LitBlock {
1775
+ attributesMeta: ({
1776
+ uuid: string;
1777
+ } | {
1778
+ 'cdn-url': string;
1779
+ }) & Partial<{
1780
+ tabs: string;
1781
+ 'crop-preset': string;
1782
+ }> & {
1783
+ 'ctx-name': string;
1784
+ };
1785
+ ctxOwner: boolean;
1786
+ static styleAttrs: string[];
1787
+ private _statusMessage;
1788
+ private _imageSrc;
1789
+ private _fileType;
1790
+ private _showLoader;
1791
+ uuid: string | null;
1792
+ cdnUrl: string | null;
1793
+ cropPreset: string;
1794
+ tabs: string | null;
1795
+ private _hasNetworkProblems;
1796
+ private _isInitialized;
1797
+ private _pendingInitUpdate;
1798
+ private readonly _debouncedShowLoader;
1799
+ private readonly _imgRef;
1800
+ private readonly _cropperRef;
1801
+ private readonly _faderRef;
1802
+ private readonly _imgContainerRef;
1803
+ private readonly _handleImageLoad;
1804
+ private readonly _handleImageError;
1805
+ private readonly _handleRetryNetwork;
1806
+ private _scheduleInitialization;
1807
+ init$: ReturnType<typeof initState>;
1808
+ initCallback(): void;
1809
+ private _assignSharedElements;
1810
+ private _attachImageListeners;
1811
+ private _detachImageListeners;
1812
+ private get _imageClassName();
1813
+ /**
1814
+ * To proper work, we need non-zero size the element. So, we'll wait for it.
1815
+ */
1816
+ private _waitForSize;
1817
+ firstUpdated(changedProperties: PropertyValues<this>): void;
1818
+ disconnectedCallback(): void;
1819
+ render(): lit_html.TemplateResult<1>;
1820
+ protected updated(changedProperties: PropertyValues<this>): void;
1821
+ private _syncTabListFromProp;
1822
+ private _syncCropPresetState;
1823
+ updateImage(): Promise<void>;
1824
+ initEditor(): Promise<void>;
1825
+ }
1826
+
1827
+ declare class CropFrame extends LitBlock {
1518
1828
  private _backdropMask?;
1519
1829
  private _backdropMaskInner?;
1520
1830
  private _frameThumbs?;
@@ -1525,13 +1835,13 @@ declare class CropFrame extends LitBlock {
1525
1835
  private _dragStartCrop?;
1526
1836
  private _frameImage?;
1527
1837
  private _guidesHidden;
1528
- private _dragging;
1529
- private readonly svgRef;
1838
+ private _draggingValue;
1839
+ private readonly _svgRef;
1530
1840
  private _svgReady;
1531
1841
  private _pendingMaskHref;
1532
1842
  private get _svgElement();
1533
- private get dragging();
1534
- private set dragging(value);
1843
+ private get _dragging();
1844
+ private set _dragging(value);
1535
1845
  private _applyGuidesDragState;
1536
1846
  private _shouldThumbBeDisabled;
1537
1847
  private _createBackdrop;
@@ -1557,7 +1867,7 @@ declare class CropFrame extends LitBlock {
1557
1867
  private _render;
1558
1868
  toggleThumbs(visible: boolean): void;
1559
1869
  initCallback(): void;
1560
- protected firstUpdated(_changedProperties: PropertyValues<this>): void;
1870
+ protected firstUpdated(changedProperties: PropertyValues<this>): void;
1561
1871
  private _initializeSvg;
1562
1872
  disconnectedCallback(): void;
1563
1873
  render(): TemplateResult;
@@ -1566,97 +1876,37 @@ declare class CropFrame extends LitBlock {
1566
1876
  declare class EditorButtonControl extends LitBlock {
1567
1877
  active: boolean;
1568
1878
  title: string;
1569
- icon: string;
1570
- titleProp: string;
1879
+ protected icon: string;
1880
+ protected titleProp: string;
1571
1881
  protected get buttonClasses(): Record<string, boolean>;
1572
- private updateHostStateClasses;
1882
+ private _updateHostStateClasses;
1573
1883
  protected onClick(_event: MouseEvent): void;
1574
1884
  connectedCallback(): void;
1575
- protected updated(changedProperties: PropertyValues): void;
1885
+ protected updated(changedProperties: PropertyValues<this>): void;
1576
1886
  render(): lit_html.TemplateResult<1>;
1577
1887
  }
1578
1888
 
1579
1889
  declare class EditorFreeformButtonControl extends EditorButtonControl {
1580
1890
  initCallback(): void;
1581
1891
  onClick(): void;
1582
- private computeTitle;
1892
+ private _computeTitle;
1583
1893
  render(): lit_html.TemplateResult<1>;
1584
1894
  }
1585
1895
  declare class EditorAspectRatioButtonControl extends EditorButtonControl {
1586
- private _aspectRatio?;
1587
- get aspectRatio(): CropAspectRatio | undefined;
1588
- set aspectRatio(value: CropAspectRatio | undefined);
1896
+ private _aspectRatio;
1897
+ get aspectRatio(): CropAspectRatio | null;
1898
+ set aspectRatio(value: CropAspectRatio | null);
1589
1899
  initCallback(): void;
1590
- onClick(): void;
1591
- private updateAspectRatioPresentation;
1592
- private renderIcon;
1900
+ protected onClick(): void;
1901
+ private _updateAspectRatioPresentation;
1902
+ private _renderIcon;
1593
1903
  render(): lit_html.TemplateResult<1>;
1594
1904
  }
1595
1905
 
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
1906
  declare class EditorCropButtonControl extends EditorButtonControl {
1657
1907
  operation: CropOperation | undefined;
1658
- protected willUpdate(_changedProperties: PropertyValues): void;
1659
- onClick(e: MouseEvent): void;
1908
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
1909
+ protected onClick(e: MouseEvent): void;
1660
1910
  }
1661
1911
 
1662
1912
  declare class EditorFilterControl extends EditorButtonControl {
@@ -1666,12 +1916,12 @@ declare class EditorFilterControl extends EditorButtonControl {
1666
1916
  private _observer?;
1667
1917
  private _cancelPreload?;
1668
1918
  private _lastPreviewRequestId;
1669
- private previewVisibilityCheckRaf?;
1670
- private previewVisibilityCheckTimeout?;
1671
- private previewImage;
1672
- private previewLoaded;
1919
+ private _previewVisibilityCheckRaf?;
1920
+ private _previewVisibilityCheckTimeout?;
1921
+ private _previewImage;
1922
+ private _previewLoaded;
1673
1923
  isOriginal: boolean;
1674
- iconSize: number;
1924
+ private _iconSize;
1675
1925
  get filter(): string;
1676
1926
  set filter(value: string);
1677
1927
  onClick(e: MouseEvent): void;
@@ -1680,11 +1930,11 @@ declare class EditorFilterControl extends EditorButtonControl {
1680
1930
  initCallback(): void;
1681
1931
  disconnectedCallback(): void;
1682
1932
  protected updated(changedProperties: PropertyValues<this>): void;
1683
- private updateFilterLabels;
1684
- private loadPreview;
1685
- private schedulePreviewVisibilityCheck;
1686
- private clearPreviewVisibilityChecks;
1687
- private get shouldShowPreview();
1933
+ private _updateFilterLabels;
1934
+ private _loadPreview;
1935
+ private _schedulePreviewVisibilityCheck;
1936
+ private _clearPreviewVisibilityChecks;
1937
+ private get _shouldShowPreview();
1688
1938
  render(): lit_html.TemplateResult<1>;
1689
1939
  }
1690
1940
 
@@ -1704,10 +1954,10 @@ declare class EditorImageCropper extends LitBlock {
1704
1954
  private _observer?;
1705
1955
  private _image;
1706
1956
  private _cancelPreload?;
1707
- private readonly canvasRef;
1708
- private readonly frameRef;
1957
+ private readonly _canvasRef;
1958
+ private readonly _frameRef;
1709
1959
  constructor();
1710
- protected firstUpdated(_changedProperties: PropertyValues): void;
1960
+ protected firstUpdated(changedProperties: PropertyValues<this>): void;
1711
1961
  private _syncTransformations;
1712
1962
  private _initCanvas;
1713
1963
  private _alignImage;
@@ -1794,13 +2044,13 @@ declare class EditorOperationControl extends EditorButtonControl {
1794
2044
  private _operation;
1795
2045
  get operation(): ColorOperation | '';
1796
2046
  set operation(value: ColorOperation | '');
1797
- private updateOperationMetadata;
2047
+ private _updateOperationMetadata;
1798
2048
  initCallback(): void;
1799
- onClick(e: MouseEvent): void;
2049
+ protected onClick(e: MouseEvent): void;
1800
2050
  }
1801
2051
 
1802
2052
  declare class EditorScroller extends LitBlock {
1803
- private readonly handleWheel;
2053
+ private readonly _handleWheel;
1804
2054
  connectedCallback(): void;
1805
2055
  disconnectedCallback(): void;
1806
2056
  }
@@ -1809,76 +2059,84 @@ type SliderOperation = ColorOperation | 'filter';
1809
2059
  type SliderFilter = FilterId | typeof FAKE_ORIGINAL_FILTER;
1810
2060
  declare const FAKE_ORIGINAL_FILTER = "original";
1811
2061
  declare class EditorSlider extends LitBlock {
1812
- private state;
1813
- handleInput: (e: CustomEvent<{
2062
+ state: {
2063
+ operation: SliderOperation;
2064
+ filter: SliderFilter | undefined;
2065
+ originalUrl: string;
2066
+ disabled: boolean;
2067
+ min: number;
2068
+ max: number;
1814
2069
  value: number;
1815
- }>) => void;
2070
+ defaultValue: number;
2071
+ zero: number;
2072
+ };
2073
+ private _handleInput;
1816
2074
  setOperation(operation: SliderOperation, filter?: SliderFilter): void;
1817
2075
  private _initializeValues;
1818
2076
  apply(): void;
1819
2077
  cancel(): void;
1820
2078
  initCallback(): void;
1821
- protected updated(changedProperties: Map<PropertyKey, unknown>): void;
2079
+ protected updated(changedProperties: PropertyValues<this>): void;
1822
2080
  render(): lit_html.TemplateResult<1>;
1823
2081
  }
1824
2082
 
1825
2083
  type TabIdValue = (typeof TabId)[keyof typeof TabId];
1826
2084
  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;
2085
+ private _showLoader;
2086
+ showMainToolbar: boolean;
2087
+ showSubToolbar: boolean;
2088
+ private _showTabToggles;
2089
+ tabList: readonly TabIdValue[];
2090
+ activeTab: TabIdValue;
2091
+ private _useSliderPanel;
2092
+ private _tooltipVisible;
2093
+ private _operationTooltip;
2094
+ private _tabIndicatorOffset;
2095
+ private _tabIndicatorWidth;
2096
+ private readonly _sliderRef;
2097
+ private readonly _tabIndicatorRef;
1840
2098
  protected readonly tabToggleRefs: Record<TabIdValue, Ref<HTMLElement>>;
1841
- private readonly handleWindowResize;
1842
- private cropPresets;
2099
+ private readonly _handleWindowResize;
2100
+ private _cropPresets;
1843
2101
  private _cancelPreload?;
1844
2102
  private readonly _debouncedShowLoader;
1845
2103
  private readonly _updateInfoTooltip;
1846
- private readonly subTopToolbarStyles;
1847
- private readonly subBottomToolbarStyles;
1848
- private readonly tabContentStyles;
1849
- private readonly tabToggleStyles;
1850
- private readonly tabTogglesStyles;
2104
+ private readonly _subTopToolbarStyles;
2105
+ private readonly _subBottomToolbarStyles;
2106
+ private readonly _tabContentStyles;
2107
+ private readonly _tabToggleStyles;
2108
+ private readonly _tabTogglesStyles;
1851
2109
  init$: Record<string, unknown>;
1852
2110
  private _onSliderClose;
1853
2111
  private _activateTab;
1854
- private applyTabState;
2112
+ private _applyTabState;
1855
2113
  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;
2114
+ private get _hasAspectRatioPicker();
2115
+ private _renderControlsByTab;
2116
+ private _renderCropTabControls;
2117
+ private _renderFilterTabControls;
2118
+ private _renderTuningTabControls;
2119
+ private _renderControlGroup;
2120
+ private _renderFreeformControl;
2121
+ private _renderAspectRatioControl;
2122
+ private _renderCropOperationControl;
2123
+ private _renderFilterControl;
2124
+ private _renderOperationControl;
2125
+ private _renderAspectRatioList;
1868
2126
  private _preloadEditedImage;
1869
2127
  initCallback(): void;
1870
2128
  connectedCallback(): void;
1871
- firstUpdated(_changedProperties: PropertyValues): void;
1872
- protected updated(changedProperties: PropertyValues): void;
2129
+ firstUpdated(changedProperties: PropertyValues<this>): void;
2130
+ protected updated(changedProperties: PropertyValues<this>): void;
1873
2131
  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;
2132
+ private _assignSharedElements;
2133
+ private readonly _handleCancel;
2134
+ private readonly _handleApply;
2135
+ private readonly _handleApplySlider;
2136
+ private readonly _handleCancelSlider;
2137
+ private readonly _handleTabClick;
2138
+ private _renderTabToggle;
2139
+ private _renderTabContent;
1882
2140
  render(): TemplateResult<1>;
1883
2141
  }
1884
2142
 
@@ -1892,26 +2150,26 @@ declare class BtnUi extends LitBlock {
1892
2150
  ariaRole: string;
1893
2151
  ariaControls: string;
1894
2152
  titleProp: string;
1895
- protected firstUpdated(_changed: PropertyValues<this>): void;
2153
+ protected firstUpdated(changed: PropertyValues<this>): void;
1896
2154
  protected updated(changed: PropertyValues<this>): void;
1897
- private applyReverse;
1898
- private applyThemeClass;
1899
- private get iconClassMap();
1900
- private get computedIconHidden();
1901
- private get computedIconSingle();
2155
+ private _applyReverse;
2156
+ private _applyThemeClass;
2157
+ private get _iconClassMap();
2158
+ private get _computedIconHidden();
2159
+ private get _computedIconSingle();
1902
2160
  render(): lit_html.TemplateResult<1>;
1903
2161
  }
1904
2162
 
1905
2163
  declare class LineLoaderUi extends LitBlock {
1906
2164
  active: boolean;
1907
- private readonly lineRef;
2165
+ private readonly _lineRef;
1908
2166
  private _isAnimating;
1909
- private readonly handleTransitionEndRight;
1910
- protected firstUpdated(_changedProperties: PropertyValues<this>): void;
2167
+ private readonly _handleTransitionEndRight;
2168
+ protected firstUpdated(changedProperties: PropertyValues<this>): void;
1911
2169
  protected updated(changedProperties: PropertyValues<this>): void;
1912
- private start;
1913
- private stop;
1914
- private resetLine;
2170
+ private _start;
2171
+ private _stop;
2172
+ private _resetLine;
1915
2173
  render(): lit_html.TemplateResult<1>;
1916
2174
  }
1917
2175
 
@@ -1926,13 +2184,13 @@ declare class PresenceToggle extends LitBlock {
1926
2184
  private _visibleStyle;
1927
2185
  private _hiddenStyle;
1928
2186
  private _externalTransitions;
1929
- private initialRenderComplete;
2187
+ private _initialRenderComplete;
1930
2188
  set visible(value: boolean);
1931
2189
  get visible(): boolean;
1932
2190
  set styles(styles: PresenceToggleStyle);
1933
2191
  get styles(): PresenceToggleStyle;
1934
2192
  private _handleVisible;
1935
- private dispatchInitialRenderEvent;
2193
+ private _dispatchInitialRenderEvent;
1936
2194
  initCallback(): void;
1937
2195
  }
1938
2196
 
@@ -1941,9 +2199,9 @@ declare class SliderUi extends LitBlock {
1941
2199
  private _thumbSize;
1942
2200
  private _zeroDotEl?;
1943
2201
  private _stepsCount?;
1944
- private readonly inputRef;
1945
- private readonly thumbRef;
1946
- private readonly stepsRef;
2202
+ private readonly _inputRef;
2203
+ private readonly _thumbRef;
2204
+ private readonly _stepsRef;
1947
2205
  disabled: boolean;
1948
2206
  min: number;
1949
2207
  max: number;
@@ -1951,12 +2209,12 @@ declare class SliderUi extends LitBlock {
1951
2209
  zero: number;
1952
2210
  private _currentValue;
1953
2211
  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;
2212
+ private _emitSliderEvent;
2213
+ private readonly _handleSliderInput;
2214
+ private readonly _handleSliderChange;
2215
+ private readonly _handleInputFocus;
2216
+ private readonly _handleInputBlur;
2217
+ protected firstUpdated(changedProperties: PropertyValues<this>): void;
1960
2218
  protected willUpdate(changedProperties: PropertyValues<this>): void;
1961
2219
  private _updateValue;
1962
2220
  private _updateZeroDot;
@@ -1968,11 +2226,6 @@ declare class SliderUi extends LitBlock {
1968
2226
  render(): lit_html.TemplateResult<1>;
1969
2227
  }
1970
2228
 
1971
- declare class Copyright extends LitBlock {
1972
- initCallback(): void;
1973
- render(): lit_html.TemplateResult<1>;
1974
- }
1975
-
1976
2229
  declare class DropArea extends LitUploaderBlock {
1977
2230
  static styleAttrs: string[];
1978
2231
  disabled: boolean;
@@ -1981,15 +2234,15 @@ declare class DropArea extends LitUploaderBlock {
1981
2234
  fullscreen: boolean;
1982
2235
  initflow: boolean;
1983
2236
  text?: string;
1984
- private isEnabled;
1985
- private isVisible;
1986
- private get localizedText();
2237
+ private _isEnabled;
2238
+ private _isVisible;
2239
+ private get _localizedText();
1987
2240
  private _destroyDropzone;
1988
2241
  private _destroyContentWrapperDropzone;
1989
- private contentWrapperRef;
1990
- private readonly handleAreaInteraction;
1991
- private sourceListAllowsLocal;
1992
- private clickableListenersAttached;
2242
+ private _contentWrapperRef;
2243
+ private readonly _handleAreaInteraction;
2244
+ private _sourceListAllowsLocal;
2245
+ private _clickableListenersAttached;
1993
2246
  isActive(): boolean;
1994
2247
  initCallback(): void;
1995
2248
  protected willUpdate(changedProperties: PropertyValues<this>): void;
@@ -1997,45 +2250,33 @@ declare class DropArea extends LitUploaderBlock {
1997
2250
  /** Ignore drop events if there are other visible drop areas on the page. */
1998
2251
  private _shouldIgnore;
1999
2252
  private _couldHandleFiles;
2000
- private updateIsEnabled;
2001
- private updateVisibility;
2002
- private updateDragStateAttribute;
2003
- private updateClickableListeners;
2253
+ private _updateIsEnabled;
2254
+ private _updateVisibility;
2255
+ private _updateDragStateAttribute;
2256
+ private _updateClickableListeners;
2004
2257
  disconnectedCallback(): void;
2005
2258
  render(): lit_html.TemplateResult<1>;
2006
2259
  }
2007
2260
 
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
2261
  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;
2262
+ protected couldBeCtxOwner: boolean;
2263
+ private _pauseRender;
2264
+ uid: Uid;
2265
+ private _itemName;
2266
+ private _errorText;
2267
+ private _hint;
2268
+ private _progressValue;
2269
+ private _progressVisible;
2270
+ private _badgeIcon;
2271
+ private _isFinished;
2272
+ private _isFailed;
2273
+ private _isUploading;
2274
+ private _isFocused;
2275
+ private _isEditable;
2276
+ private _showFileNames;
2277
+ private _ariaLabelStatusFile;
2035
2278
  private _renderedOnce;
2036
2279
  private _observer?;
2037
- protected _isIntersecting: boolean;
2038
- protected _thumbRect?: DOMRectReadOnly;
2039
2280
  private _handleEdit;
2040
2281
  private _handleRemove;
2041
2282
  private _handleUploadClick;
@@ -2043,7 +2284,7 @@ declare class FileItem extends FileItemConfig {
2043
2284
  private _debouncedCalculateState;
2044
2285
  private _updateHintAndProgress;
2045
2286
  private _handleState;
2046
- _reset(): void;
2287
+ protected reset(): void;
2047
2288
  private _observerCallback;
2048
2289
  private _handleEntryId;
2049
2290
  private _updateShowFileNames;
@@ -2051,272 +2292,22 @@ declare class FileItem extends FileItemConfig {
2051
2292
  initCallback(): void;
2052
2293
  connectedCallback(): void;
2053
2294
  disconnectedCallback(): void;
2054
- upload: () => Promise<void> | undefined;
2295
+ private _upload;
2055
2296
  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;
2297
+ protected shouldUpdate(changedProperties: PropertyValues<this>): boolean;
2074
2298
  render(): lit_html.TemplateResult<1>;
2075
2299
  }
2076
2300
 
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
2301
  declare class SimpleBtn extends LitUploaderBlock {
2190
2302
  static styleAttrs: string[];
2191
2303
  couldBeCtxOwner: boolean;
2192
2304
  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
- }>;
2305
+ private _buttonTextKey;
2306
+ private readonly _handleClick;
2298
2307
  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
2308
  render(): lit_html.TemplateResult<1>;
2315
2309
  }
2316
2310
 
2317
- declare const PACKAGE_NAME = "blocks";
2318
- declare const PACKAGE_VERSION: string;
2319
-
2320
2311
  declare class LitSolutionBlock extends LitBlock {
2321
2312
  static styleAttrs: string[];
2322
2313
  init$: {
@@ -2339,6 +2330,18 @@ declare class LitSolutionBlock extends LitBlock {
2339
2330
  render(): lit_html.TemplateResult<1>;
2340
2331
  }
2341
2332
 
2333
+ declare class FileUploaderRegular extends LitSolutionBlock {
2334
+ attributesMeta: {
2335
+ headless?: boolean;
2336
+ 'ctx-name': string;
2337
+ };
2338
+ static styleAttrs: string[];
2339
+ headless: boolean;
2340
+ constructor();
2341
+ initCallback(): void;
2342
+ render(): lit_html.TemplateResult<1>;
2343
+ }
2344
+
2342
2345
  declare class CloudImageEditor extends CloudImageEditorBlock {
2343
2346
  static styleAttrs: string[];
2344
2347
  constructor();
@@ -2346,25 +2349,29 @@ declare class CloudImageEditor extends CloudImageEditorBlock {
2346
2349
  }
2347
2350
 
2348
2351
  declare class FileUploaderInline extends LitSolutionBlock {
2352
+ propertiesMeta: {
2353
+ 'ctx-name': string;
2354
+ };
2349
2355
  static styleAttrs: string[];
2350
- private couldCancel;
2356
+ private _couldCancel;
2351
2357
  constructor();
2352
2358
  private _handleCancel;
2353
- get couldHistoryBack(): boolean;
2354
- get couldShowList(): boolean;
2359
+ private get _couldHistoryBack();
2360
+ private get _couldShowList();
2355
2361
  private _getInitActivity;
2356
2362
  initCallback(): void;
2357
2363
  render(): lit_html.TemplateResult<1>;
2358
2364
  }
2359
2365
 
2360
2366
  declare class FileUploaderMinimal extends LitSolutionBlock {
2367
+ propertiesMeta: {
2368
+ 'ctx-name': string;
2369
+ };
2361
2370
  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?;
2371
+ private _singleUpload;
2372
+ private _isHiddenStartFrom;
2373
+ private _classUploadList;
2374
+ private _classStartFrom;
2368
2375
  private _getInitActivity;
2369
2376
  constructor();
2370
2377
  private _handleModalOpen;
@@ -2374,15 +2381,7 @@ declare class FileUploaderMinimal extends LitSolutionBlock {
2374
2381
  render(): lit_html.TemplateResult<1>;
2375
2382
  }
2376
2383
 
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>;
2384
+ declare const PACKAGE_NAME = "blocks";
2385
+ declare const PACKAGE_VERSION: string;
2387
2386
 
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 };
2387
+ 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 };