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