@uploadcare/file-uploader 1.25.0-alpha.9 → 1.25.0

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 +75 -4
  2. package/dist/env.js +33 -4
  3. package/dist/index.css +2660 -5
  4. package/dist/index.d.ts +976 -1316
  5. package/dist/index.js +12012 -6
  6. package/dist/index.layered.css +2716 -4
  7. package/dist/index.ssr.js +768 -549
  8. package/dist/locales/file-uploader/ar.js +165 -4
  9. package/dist/locales/file-uploader/az.js +157 -4
  10. package/dist/locales/file-uploader/ca.js +159 -4
  11. package/dist/locales/file-uploader/cs.js +161 -4
  12. package/dist/locales/file-uploader/da.js +157 -4
  13. package/dist/locales/file-uploader/de.js +157 -4
  14. package/dist/locales/file-uploader/el.js +157 -4
  15. package/dist/locales/file-uploader/en.js +157 -4
  16. package/dist/locales/file-uploader/es.js +159 -4
  17. package/dist/locales/file-uploader/et.js +157 -4
  18. package/dist/locales/file-uploader/fi.js +157 -4
  19. package/dist/locales/file-uploader/fr.js +159 -4
  20. package/dist/locales/file-uploader/he.js +159 -4
  21. package/dist/locales/file-uploader/hy.js +157 -4
  22. package/dist/locales/file-uploader/is.js +157 -4
  23. package/dist/locales/file-uploader/it.js +159 -4
  24. package/dist/locales/file-uploader/ja.js +157 -4
  25. package/dist/locales/file-uploader/ka.js +157 -4
  26. package/dist/locales/file-uploader/kk.js +157 -4
  27. package/dist/locales/file-uploader/ko.js +157 -4
  28. package/dist/locales/file-uploader/lv.js +159 -4
  29. package/dist/locales/file-uploader/nb.js +157 -4
  30. package/dist/locales/file-uploader/nl.js +157 -4
  31. package/dist/locales/file-uploader/pl.js +161 -4
  32. package/dist/locales/file-uploader/pt.js +159 -4
  33. package/dist/locales/file-uploader/ro.js +159 -4
  34. package/dist/locales/file-uploader/ru.js +161 -4
  35. package/dist/locales/file-uploader/sk.js +161 -4
  36. package/dist/locales/file-uploader/sr.js +159 -4
  37. package/dist/locales/file-uploader/sv.js +157 -4
  38. package/dist/locales/file-uploader/tr.js +157 -4
  39. package/dist/locales/file-uploader/uk.js +161 -4
  40. package/dist/locales/file-uploader/vi.js +157 -4
  41. package/dist/locales/file-uploader/zh-TW.js +157 -4
  42. package/dist/locales/file-uploader/zh.js +157 -4
  43. package/package.json +31 -36
  44. package/types/jsx.d.ts +48 -75
  45. package/web/file-uploader.iife.min.d.ts +987 -1327
  46. package/web/file-uploader.iife.min.js +27 -6
  47. package/web/file-uploader.min.d.ts +987 -1327
  48. package/web/file-uploader.min.js +26 -5
  49. package/web/uc-basic.layered.min.css +23 -4
  50. package/web/uc-basic.min.css +23 -4
  51. package/web/uc-cloud-image-editor.layered.min.css +23 -4
  52. package/web/uc-cloud-image-editor.min.css +23 -4
  53. package/web/uc-cloud-image-editor.min.d.ts +550 -756
  54. package/web/uc-cloud-image-editor.min.js +26 -5
  55. package/web/uc-file-uploader-inline.layered.min.css +23 -4
  56. package/web/uc-file-uploader-inline.min.css +23 -4
  57. package/web/uc-file-uploader-inline.min.d.ts +987 -1327
  58. package/web/uc-file-uploader-inline.min.js +26 -5
  59. package/web/uc-file-uploader-minimal.layered.min.css +23 -4
  60. package/web/uc-file-uploader-minimal.min.css +23 -4
  61. package/web/uc-file-uploader-minimal.min.d.ts +987 -1327
  62. package/web/uc-file-uploader-minimal.min.js +26 -5
  63. package/web/uc-file-uploader-regular.layered.min.css +23 -4
  64. package/web/uc-file-uploader-regular.min.css +23 -4
  65. package/web/uc-file-uploader-regular.min.d.ts +987 -1327
  66. package/web/uc-file-uploader-regular.min.js +26 -5
  67. package/web/uc-img.min.d.ts +100 -55
  68. package/web/uc-img.min.js +25 -5
  69. package/web/file-uploader.iife.min.js.LEGAL.txt +0 -71
  70. package/web/file-uploader.min.js.LEGAL.txt +0 -71
  71. package/web/uc-cloud-image-editor.min.js.LEGAL.txt +0 -70
  72. package/web/uc-file-uploader-inline.min.js.LEGAL.txt +0 -71
  73. package/web/uc-file-uploader-minimal.min.js.LEGAL.txt +0 -71
  74. package/web/uc-file-uploader-regular.min.js.LEGAL.txt +0 -71
  75. package/web/uc-img.min.js.LEGAL.txt +0 -24
@@ -1,179 +1,168 @@
1
- import * as lit_html from 'lit-html';
2
- import { PropertyValues, LitElement, TemplateResult } from 'lit';
3
- import * as lit_html_directives_ref_js from 'lit-html/directives/ref.js';
4
- import { TelemetryRequest } from '@uploadcare/quality-insights';
1
+ import { BaseComponent } from '@symbiotejs/symbiote';
5
2
  import * as _uploadcare_upload_client from '@uploadcare/upload-client';
6
- import { Metadata, UploadcareFile, UploadError, NetworkError, UploadcareGroup, FileFromOptions, Queue } from '@uploadcare/upload-client';
7
- import { Ref } from 'lit/directives/ref.js';
8
-
9
- type Constructor<T = unknown> = new (...args: any[]) => T;
10
-
11
- type SymbioteStateBag<T extends Record<string, unknown>> = T;
12
- /**
13
- * Interface for components using SymbioteMixin
14
- */
15
- declare class SymbioteComponent<TState extends Record<string, unknown> = Record<string, unknown>> {
16
- $: SymbioteStateBag<TState>;
17
- sub<TKey extends keyof TState>(key: TKey, callback: (value: TState[TKey]) => void, init?: boolean): () => void;
18
- pub<TKey extends keyof TState>(key: TKey, value: TState[TKey]): void;
19
- set$<T extends {
20
- [K in keyof T]: K extends keyof TState ? TState[K] : never;
21
- }>(obj: T): void;
22
- has<TKey extends keyof TState>(key: TKey): boolean;
23
- add<TKey extends keyof TState>(key: TKey, val: TState[TKey], rewrite?: boolean): void;
24
- add$<T extends {
25
- [K in keyof T]: K extends keyof TState ? TState[K] : never;
26
- }>(obj: T, rewrite?: boolean): void;
27
- initCallback(): void;
28
- ctxName: string;
29
- ctxOwner: boolean;
30
- }
31
-
32
- declare class A11y {
33
- private _destroyKeyUX;
34
- private readonly _scopedWindow;
35
- constructor();
36
- registerBlock(scope: LitBlock): void;
37
- destroy(): void;
38
- }
39
-
40
- declare class LocaleManager {
41
- private _blockInstance;
42
- private _localeName;
43
- constructor(blockInstance: LitBlock);
44
- }
45
-
46
- declare class Modal extends LitBlock {
47
- static styleAttrs: string[];
48
- private _mouseDownTarget;
49
- /** WARNING: Do not rename/change this, it's used in dashboard */
50
- protected dialogEl: lit_html_directives_ref_js.Ref<HTMLDialogElement>;
51
- /** WARNING: Do not rename/change this, it's used in dashboard */
52
- protected closeDialog: () => void;
53
- private _handleDialogClose;
54
- private _handleDialogMouseDown;
55
- private _handleDialogMouseUp;
56
- show(): void;
57
- hide(): void;
58
- private _handleModalOpen;
59
- private _handleModalClose;
60
- private _handleModalCloseAll;
61
- initCallback(): void;
62
- disconnectedCallback(): void;
63
- private _handleDialogRef;
64
- render(): lit_html.TemplateResult<1>;
65
- }
66
-
67
- type Subscription = {
68
- remove: () => void;
69
- };
70
-
71
- type Uid = string & {
72
- __uid: true;
73
- };
74
-
75
- declare function defineComponents(blockExports: Record<string, any>): void;
76
-
77
- declare const UC_WINDOW_KEY = "UC";
78
- type IndexModule = Record<string, any>;
79
- declare global {
80
- interface Window {
81
- [UC_WINDOW_KEY]?: IndexModule;
82
- }
83
- }
3
+ import { UploadcareFile, Metadata, UploadError, NetworkError, UploadcareGroup, FileFromOptions } from '@uploadcare/upload-client';
4
+ import { TelemetryRequest } from '@uploadcare/quality-insights';
84
5
 
85
6
  type LocaleDefinition = Record<string, string>;
86
7
 
87
- declare class Icon extends LitBlock {
88
- name: string;
89
- private _resolvedHref;
90
- private _iconHrefResolver;
91
- initCallback(): void;
92
- protected willUpdate(changedProperties: PropertyValues<this>): void;
93
- private _updateResolvedHref;
94
- render(): lit_html.TemplateResult<1>;
95
- }
8
+ declare function buildOutputCollectionState<TCollectionStatus extends OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'>(uploaderBlock: UploaderBlock): OutputCollectionState<TCollectionStatus, TGroupFlag>;
96
9
 
97
- declare const InternalEventType: Readonly<{
98
- readonly INIT_SOLUTION: "init-solution";
99
- readonly CHANGE_CONFIG: "change-config";
100
- readonly ACTION_EVENT: "action-event";
101
- readonly ERROR_EVENT: "error-event";
102
- }>;
103
- declare const EventType: Readonly<{
104
- readonly FILE_ADDED: "file-added";
105
- readonly FILE_REMOVED: "file-removed";
106
- readonly FILE_UPLOAD_START: "file-upload-start";
107
- readonly FILE_UPLOAD_PROGRESS: "file-upload-progress";
108
- readonly FILE_UPLOAD_SUCCESS: "file-upload-success";
109
- readonly FILE_UPLOAD_FAILED: "file-upload-failed";
110
- readonly FILE_URL_CHANGED: "file-url-changed";
111
- readonly MODAL_OPEN: "modal-open";
112
- readonly MODAL_CLOSE: "modal-close";
113
- readonly DONE_CLICK: "done-click";
114
- readonly UPLOAD_CLICK: "upload-click";
115
- readonly ACTIVITY_CHANGE: "activity-change";
116
- readonly COMMON_UPLOAD_START: "common-upload-start";
117
- readonly COMMON_UPLOAD_PROGRESS: "common-upload-progress";
118
- readonly COMMON_UPLOAD_SUCCESS: "common-upload-success";
119
- readonly COMMON_UPLOAD_FAILED: "common-upload-failed";
120
- readonly CHANGE: "change";
121
- readonly GROUP_CREATED: "group-created";
10
+ type TypedSchema = Record<string, {
11
+ type: unknown;
12
+ value: unknown;
13
+ nullable?: boolean;
122
14
  }>;
123
- type EventKey = (typeof EventType)[keyof typeof EventType];
124
- type InternalEventKey = (typeof InternalEventType)[keyof typeof InternalEventType];
125
- type EventPayload = {
126
- [EventType.FILE_ADDED]: OutputFileEntry<'idle'>;
127
- [EventType.FILE_REMOVED]: OutputFileEntry<'removed'>;
128
- [EventType.FILE_UPLOAD_START]: OutputFileEntry<'uploading'>;
129
- [EventType.FILE_UPLOAD_PROGRESS]: OutputFileEntry<'uploading'>;
130
- [EventType.FILE_UPLOAD_SUCCESS]: OutputFileEntry<'success'>;
131
- [EventType.FILE_UPLOAD_FAILED]: OutputFileEntry<'failed'>;
132
- [EventType.FILE_URL_CHANGED]: OutputFileEntry<'success'>;
133
- [EventType.MODAL_OPEN]: {
134
- modalId: ModalId;
135
- };
136
- [EventType.MODAL_CLOSE]: {
137
- modalId: ModalId;
138
- hasActiveModals: boolean;
139
- };
140
- [EventType.ACTIVITY_CHANGE]: {
141
- activity: ActivityType;
142
- };
143
- [EventType.UPLOAD_CLICK]: void;
144
- [EventType.DONE_CLICK]: OutputCollectionState;
145
- [EventType.COMMON_UPLOAD_START]: OutputCollectionState<'uploading'>;
146
- [EventType.COMMON_UPLOAD_PROGRESS]: OutputCollectionState<'uploading'>;
147
- [EventType.COMMON_UPLOAD_SUCCESS]: OutputCollectionState<'success'>;
148
- [EventType.COMMON_UPLOAD_FAILED]: OutputCollectionState<'failed'>;
149
- [EventType.CHANGE]: OutputCollectionState;
150
- [EventType.GROUP_CREATED]: OutputCollectionState<'success', 'has-group'>;
15
+ type Constructor<T = any> = new (...args: any[]) => T;
16
+ 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;
17
+ type ExtractDataFromSchema<T extends TypedSchema> = {
18
+ [K in keyof T]: ExtractType<T[K]['type'], T[K]['value']> | (T[K]['nullable'] extends true ? null : never);
151
19
  };
152
- declare class EventEmitter {
153
- private _timeoutStore;
154
- private _targets;
155
- private _debugPrint;
156
- constructor(debugPrint: (...args: unknown[]) => void);
157
- bindTarget(target: LitBlock): () => void;
158
- private _dispatch;
159
- emit<T extends EventKey, TDebounce extends boolean | number | undefined = undefined>(type: T, payload?: TDebounce extends false | undefined ? EventPayload[T] : () => EventPayload[T], options?: {
160
- debounce?: TDebounce;
161
- }): void;
20
+ type ExtractKeysFromSchema<T extends TypedSchema> = Extract<keyof T, string>;
21
+ declare class TypedData<T extends TypedSchema> {
22
+ private __typedSchema;
23
+ private __ctxId;
24
+ private __schema;
25
+ private __data;
26
+ constructor(typedSchema: T, ctxName?: string);
27
+ get uid(): string;
28
+ setValue<K extends ExtractKeysFromSchema<T>>(prop: K, value: ExtractDataFromSchema<T>[K]): void;
29
+ setMultipleValues(updObj: Partial<ExtractDataFromSchema<T>>): void;
30
+ getValue<K extends ExtractKeysFromSchema<T>>(prop: K): ExtractDataFromSchema<T>[K];
31
+ subscribe<K extends ExtractKeysFromSchema<T>>(prop: K, handler: (newVal: ExtractDataFromSchema<T>[K]) => void): {
32
+ remove: () => void;
33
+ callback: Function;
34
+ };
35
+ remove(): void;
162
36
  }
163
37
 
164
- declare function buildOutputCollectionState<TCollectionStatus extends OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'>(uploaderBlock: LitUploaderBlock): OutputCollectionState<TCollectionStatus, TGroupFlag>;
165
-
166
- declare class TypedData<T extends Record<string, unknown>> {
167
- private _ctxId;
168
- private _data;
169
- constructor(initialValue: T);
170
- get uid(): Uid;
171
- setValue<K extends keyof T>(prop: K, value: T[K]): void;
172
- setMultipleValues(updObj: Partial<T>): void;
173
- getValue<K extends keyof T>(prop: K): T[K];
174
- subscribe<K extends keyof T>(prop: K, handler: (newVal: T[K]) => void): Subscription;
175
- destroy(): void;
176
- }
38
+ declare const uploadEntrySchema: Readonly<{
39
+ file: Readonly<{
40
+ type: {
41
+ new (fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;
42
+ prototype: File;
43
+ };
44
+ value: null;
45
+ nullable: true;
46
+ }>;
47
+ externalUrl: Readonly<{
48
+ type: StringConstructor;
49
+ value: null;
50
+ nullable: true;
51
+ }>;
52
+ fileName: Readonly<{
53
+ type: StringConstructor;
54
+ value: null;
55
+ nullable: true;
56
+ }>;
57
+ fileSize: Readonly<{
58
+ type: NumberConstructor;
59
+ value: null;
60
+ nullable: true;
61
+ }>;
62
+ lastModified: Readonly<{
63
+ type: NumberConstructor;
64
+ value: number;
65
+ }>;
66
+ uploadProgress: Readonly<{
67
+ type: NumberConstructor;
68
+ value: 0;
69
+ }>;
70
+ uuid: Readonly<{
71
+ type: StringConstructor;
72
+ value: null;
73
+ nullable: true;
74
+ }>;
75
+ isImage: Readonly<{
76
+ type: BooleanConstructor;
77
+ value: false;
78
+ }>;
79
+ mimeType: Readonly<{
80
+ type: StringConstructor;
81
+ value: null;
82
+ nullable: true;
83
+ }>;
84
+ ctxName: Readonly<{
85
+ type: StringConstructor;
86
+ value: null;
87
+ nullable: true;
88
+ }>;
89
+ cdnUrl: Readonly<{
90
+ type: StringConstructor;
91
+ value: null;
92
+ nullable: true;
93
+ }>;
94
+ cdnUrlModifiers: Readonly<{
95
+ type: StringConstructor;
96
+ value: null;
97
+ nullable: true;
98
+ }>;
99
+ fileInfo: Readonly<{
100
+ type: typeof UploadcareFile;
101
+ value: null;
102
+ nullable: true;
103
+ }>;
104
+ isUploading: Readonly<{
105
+ type: BooleanConstructor;
106
+ value: false;
107
+ }>;
108
+ abortController: Readonly<{
109
+ type: {
110
+ new (): AbortController;
111
+ prototype: AbortController;
112
+ };
113
+ value: null;
114
+ nullable: true;
115
+ }>;
116
+ thumbUrl: Readonly<{
117
+ type: StringConstructor;
118
+ value: null;
119
+ nullable: true;
120
+ }>;
121
+ silent: Readonly<{
122
+ type: BooleanConstructor;
123
+ value: false;
124
+ }>;
125
+ source: Readonly<{
126
+ type: StringConstructor;
127
+ value: null;
128
+ nullable: true;
129
+ }>;
130
+ fullPath: Readonly<{
131
+ type: StringConstructor;
132
+ value: null;
133
+ nullable: true;
134
+ }>;
135
+ metadata: Readonly<{
136
+ type: ObjectConstructor;
137
+ value: null;
138
+ nullable: true;
139
+ }>;
140
+ errors: Readonly<{
141
+ type: ArrayConstructor;
142
+ value: OutputErrorFile[];
143
+ }>;
144
+ uploadError: Readonly<{
145
+ type: ErrorConstructor;
146
+ value: null;
147
+ nullable: true;
148
+ }>;
149
+ isRemoved: Readonly<{
150
+ type: BooleanConstructor;
151
+ value: false;
152
+ }>;
153
+ isQueuedForUploading: Readonly<{
154
+ type: BooleanConstructor;
155
+ value: false;
156
+ }>;
157
+ isValidationPending: Readonly<{
158
+ type: BooleanConstructor;
159
+ value: false;
160
+ }>;
161
+ isQueuedForValidation: Readonly<{
162
+ type: BooleanConstructor;
163
+ value: false;
164
+ }>;
165
+ }>;
177
166
 
178
167
  type FuncFileValidator = (outputEntry: OutputFileEntry, api: UploaderPublicApi, options?: {
179
168
  signal?: AbortSignal;
@@ -192,10 +181,10 @@ declare class ValidationManager {
192
181
  private _queue;
193
182
  private _runQueueDebounced;
194
183
  private _entryValidationState;
195
- constructor(blockInstance: LitUploaderBlock);
196
- runFileValidators(runOn: FileValidatorDescriptor['runOn'], entryIds?: Uid[]): void;
184
+ constructor(blockInstance: UploaderBlock);
185
+ runFileValidators(runOn: FileValidatorDescriptor['runOn'], entryIds?: string[]): void;
197
186
  runCollectionValidators(): void;
198
- cleanupValidationForEntry(entry: TypedData<UploadEntryData>): void;
187
+ cleanupValidationForEntry(entry: TypedData<typeof uploadEntrySchema>): void;
199
188
  private _runFileValidatorsForEntry;
200
189
  private _addCustomTypeToValidationError;
201
190
  private _getEntryValidationState;
@@ -205,26 +194,19 @@ declare class ValidationManager {
205
194
 
206
195
  type CameraMode = 'photo' | 'video';
207
196
 
208
- /**
209
- * Config keys that can't be passed as attribute (because they are object or function)
210
- */
211
- declare const complexConfigKeys: readonly ["metadata", "localeDefinitionOverride", "secureUploadsSignatureResolver", "secureDeliveryProxyUrlResolver", "iconHrefResolver", "fileValidators", "collectionValidators", "mediaRecorderOptions"];
212
197
  /** Mapping of attribute names to state */
213
198
  declare const attrStateMapping: Record<string, string>;
214
- declare class Config extends LitBlock {
215
- attributesMeta: Partial<ConfigPlainType> & {
216
- 'ctx-name': string;
217
- };
218
- init$: LitBlock["init$"] & ConfigType;
219
- private _computationControllers;
199
+ declare class Config extends Block {
200
+ requireCtxName: boolean;
201
+ constructor();
220
202
  private _flushValueToAttribute;
221
203
  private _flushValueToState;
222
204
  private _setValue;
223
205
  private _getValue;
224
- private _assertSameValueDifferentReference;
206
+ _assertSameValueDifferentReference(key: string, previousValue: unknown, nextValue: unknown): void;
225
207
  initCallback(): void;
226
208
  attributeChangedCallback(name: keyof typeof attrStateMapping, oldVal: string, newVal: string): void;
227
- static get observedAttributes(): string[];
209
+ get computationControllers(): any;
228
210
  }
229
211
  interface Config extends ConfigType {
230
212
  }
@@ -266,51 +248,6 @@ declare const UploadSource: Readonly<{
266
248
  }>;
267
249
  type SourceTypes = (typeof UploadSource)[keyof typeof UploadSource];
268
250
 
269
- type ChangeMap<T extends Record<string, unknown>> = Record<keyof T, Set<Uid>>;
270
- type TypedCollectionPropertyObserver<T extends Record<string, unknown>> = (changeMap: ChangeMap<T>) => void;
271
- type TypedCollectionObserverHandler<T extends Record<string, unknown>> = (list: Uid[], added: Set<TypedData<T>>, removed: Set<TypedData<T>>) => void;
272
- type TypedCollectionOptions<T extends Record<string, unknown>> = {
273
- initialValue: T;
274
- watchList?: (keyof T)[];
275
- handler?: TypedCollectionObserverHandler<T>;
276
- };
277
- declare class TypedCollection<T extends Record<string, unknown>> {
278
- private static readonly _destroyDelayMs;
279
- private _ctxId;
280
- private _data;
281
- private _watchList;
282
- private _subsMap;
283
- private _propertyObservers;
284
- private _collectionObservers;
285
- private _items;
286
- private _removed;
287
- private _added;
288
- private _markedToDestroy;
289
- private _observeTimeout?;
290
- private _notifyTimeout?;
291
- private _destroyTimeout?;
292
- private _notifyObservers;
293
- private _initialValue;
294
- constructor(options: TypedCollectionOptions<T>);
295
- private _notify;
296
- private _scheduleDestroyMarkedItems;
297
- observeCollection(handler: TypedCollectionObserverHandler<T>): () => void;
298
- unobserveCollection(handler: TypedCollectionObserverHandler<T>): void;
299
- add(init: Partial<T>): Uid;
300
- hasItem(id: Uid): boolean;
301
- read(id: Uid): TypedData<T> | null;
302
- readProp<K extends keyof T>(id: Uid, propName: K): T[K];
303
- publishProp<K extends keyof T>(id: Uid, propName: K, value: T[K]): void;
304
- remove(id: Uid): void;
305
- clearAll(): void;
306
- observeProperties(handler: TypedCollectionPropertyObserver<T>): () => void;
307
- unobserveProperties(handler: TypedCollectionPropertyObserver<T>): void;
308
- findItems(checkFn: (item: TypedData<T>) => boolean): Uid[];
309
- items(): Uid[];
310
- get size(): number;
311
- destroy(): void;
312
- }
313
-
314
251
  declare const CameraSourceTypes: Readonly<{
315
252
  PHOTO: "photo";
316
253
  VIDEO: "video";
@@ -324,8 +261,8 @@ type ApiAddFileCommonOptions = {
324
261
  };
325
262
  declare class UploaderPublicApi {
326
263
  private _ctx;
327
- constructor(ctx: LitUploaderBlock);
328
- get _uploadCollection(): TypedCollection<UploadEntryData>;
264
+ constructor(ctx: UploaderBlock);
265
+ private get _uploadCollection();
329
266
  get cfg(): ConfigType;
330
267
  get l10n(): (str: string, variables?: Record<string, string | number>) => string;
331
268
  /**
@@ -348,7 +285,7 @@ declare class UploaderPublicApi {
348
285
  getOutputCollectionState<TStatus extends OutputCollectionStatus>(): ReturnType<typeof buildOutputCollectionState<TStatus>>;
349
286
  initFlow: (force?: boolean) => void;
350
287
  doneFlow: () => void;
351
- setCurrentActivity: <T extends RegisteredActivityType>(activityType: T, ...params: T extends keyof ActivityParamsMap ? [ActivityParamsMap[T]] : T extends RegisteredActivityType ? [undefined?] : [never]) => void;
288
+ setCurrentActivity: <T extends ActivityType>(activityType: T, ...[params]: T extends keyof ActivityParamsMap ? [ActivityParamsMap[T]] : T extends RegisteredActivityType ? [undefined?] : [unknown?]) => void;
352
289
  getCurrentActivity: () => ActivityType;
353
290
  setModalState: (opened: boolean) => void;
354
291
  private get _sourceList();
@@ -648,8 +585,6 @@ type ConfigType = {
648
585
  */
649
586
  testMode: boolean;
650
587
  };
651
- type ConfigComplexType = Pick<ConfigType, (typeof complexConfigKeys)[number]>;
652
- type ConfigPlainType = Omit<ConfigType, keyof ConfigComplexType>;
653
588
  type OutputFileStatus = 'idle' | 'uploading' | 'success' | 'failed' | 'removed';
654
589
  type OutputCustomErrorType = 'CUSTOM_ERROR';
655
590
  type OutputFileErrorType = OutputCustomErrorType | 'NOT_AN_IMAGE' | 'FORBIDDEN_FILE_TYPE' | 'FILE_SIZE_EXCEEDED' | 'UPLOAD_ERROR' | 'NETWORK_ERROR' | 'UNKNOWN_ERROR';
@@ -661,9 +596,7 @@ type OutputErrorTypePayload = {
661
596
  NOT_AN_IMAGE: OutputFileErrorPayload;
662
597
  FORBIDDEN_FILE_TYPE: OutputFileErrorPayload;
663
598
  FILE_SIZE_EXCEEDED: OutputFileErrorPayload;
664
- SOME_FILES_HAS_ERRORS: {
665
- [k: string]: never;
666
- };
599
+ SOME_FILES_HAS_ERRORS: {};
667
600
  TOO_MANY_FILES: {
668
601
  min: number;
669
602
  max: number;
@@ -813,58 +746,60 @@ type OutputCollectionState<TStatus extends OutputCollectionStatus = OutputCollec
813
746
  allEntries: OutputFileEntry[];
814
747
  });
815
748
 
816
- interface UploadEntryData extends Record<string, unknown> {
817
- file: File | null;
818
- externalUrl: string | null;
819
- fileName: string | null;
820
- fileSize: number | null;
821
- lastModified: number;
822
- uploadProgress: number;
823
- uuid: string | null;
824
- isImage: boolean;
825
- mimeType: string | null;
826
- ctxName: string | null;
827
- cdnUrl: string | null;
828
- cdnUrlModifiers: string | null;
829
- fileInfo: UploadcareFile | null;
830
- isUploading: boolean;
831
- abortController: AbortController | null;
832
- thumbUrl: string | null;
833
- silent: boolean;
834
- source: string | null;
835
- fullPath: string | null;
836
- metadata: Metadata | null;
837
- errors: OutputErrorFile[];
838
- uploadError: Error | null;
839
- isRemoved: boolean;
840
- isQueuedForUploading: boolean;
841
- isValidationPending: boolean;
842
- isQueuedForValidation: boolean;
843
- }
844
-
845
- type ActivityParams$1 = {
846
- externalSourceType: string;
847
- };
848
-
849
- declare class CloudImageEditor extends CloudImageEditorBlock {
850
- static styleAttrs: string[];
851
- constructor();
852
- initCallback(): void;
853
- }
854
-
855
749
  declare class SecureUploadsManager {
856
750
  private readonly _block;
857
751
  private _secureToken;
858
- constructor(block: LitUploaderBlock);
752
+ constructor(block: UploaderBlock);
859
753
  private _debugPrint;
860
754
  getSecureToken(): Promise<SecureUploadsSignatureAndExpire | null>;
861
755
  }
862
756
 
863
- declare class LitUploaderBlock extends LitActivityBlock {
757
+ type ChangeMap<T extends TypedSchema> = Record<keyof T, Set<string>>;
758
+ type TypedCollectionPropertyObserver<T extends TypedSchema> = (changeMap: ChangeMap<T>) => void;
759
+ type TypedCollectionObserverHandler<T extends TypedSchema> = (list: string[], added: Set<TypedData<T>>, removed: Set<TypedData<T>>) => void;
760
+ type TypedCollectionOptions<T extends TypedSchema> = {
761
+ typedSchema: T;
762
+ watchList?: ExtractKeysFromSchema<T>[];
763
+ handler?: TypedCollectionObserverHandler<T>;
764
+ ctxName?: string;
765
+ };
766
+ declare class TypedCollection<T extends TypedSchema> {
767
+ private __typedSchema;
768
+ private __ctxId;
769
+ private __data;
770
+ private __watchList;
771
+ private __subsMap;
772
+ private __propertyObservers;
773
+ private __collectionObservers;
774
+ private __items;
775
+ private __removed;
776
+ private __added;
777
+ private __observeTimeout?;
778
+ private __notifyTimeout?;
779
+ private __notifyObservers;
780
+ constructor(options: TypedCollectionOptions<T>);
781
+ notify(): void;
782
+ observeCollection(handler: TypedCollectionObserverHandler<T>): () => void;
783
+ unobserveCollection(handler: TypedCollectionObserverHandler<T>): void;
784
+ add(init: Partial<ExtractDataFromSchema<T>>): string;
785
+ read(id: string): TypedData<T> | null;
786
+ readProp<K extends ExtractKeysFromSchema<T>>(id: string, propName: K): ExtractDataFromSchema<T>[K] | null;
787
+ publishProp<K extends ExtractKeysFromSchema<T>>(id: string, propName: K, value: ExtractDataFromSchema<T>[K]): void;
788
+ remove(id: string): void;
789
+ clearAll(): void;
790
+ observeProperties(handler: TypedCollectionPropertyObserver<T>): () => void;
791
+ unobserveProperties(handler: TypedCollectionPropertyObserver<T>): void;
792
+ findItems(checkFn: (item: TypedData<T>) => boolean): string[];
793
+ items(): string[];
794
+ get size(): number;
795
+ destroy(): void;
796
+ }
797
+
798
+ declare class UploaderBlock extends ActivityBlock {
864
799
  static extSrcList: Readonly<typeof ExternalUploadSource>;
865
800
  static sourceTypes: Readonly<typeof UploadSource>;
866
801
  protected couldBeCtxOwner: boolean;
867
- private _isCtxOwner;
802
+ private isCtxOwner;
868
803
  private _unobserveCollection?;
869
804
  private _unobserveCollectionProperties?;
870
805
  init$: {
@@ -875,21 +810,23 @@ declare class LitUploaderBlock extends LitActivityBlock {
875
810
  '*collectionState': OutputCollectionState | null;
876
811
  '*groupInfo': _uploadcare_upload_client.UploadcareGroup | null;
877
812
  '*uploadTrigger': Set<string>;
813
+ '*secureUploadsManager': SecureUploadsManager | null;
878
814
  '*currentActivity': null;
879
815
  '*currentActivityParams': {};
880
816
  '*history': never[];
881
817
  '*historyBack': null;
882
818
  '*closeModal': () => void;
883
819
  };
884
- private get _hasCtxOwner();
820
+ private get hasCtxOwner();
885
821
  initCallback(): void;
886
822
  protected get validationManager(): ValidationManager;
887
823
  get api(): UploaderPublicApi;
888
824
  getAPI(): UploaderPublicApi;
889
- get uploadCollection(): TypedCollection<UploadEntryData>;
890
- get secureUploadsManager(): SecureUploadsManager;
825
+ get uploadCollection(): TypedCollection<typeof uploadEntrySchema>;
826
+ destroyCtxCallback(): void;
891
827
  disconnectedCallback(): void;
892
828
  connectedCallback(): void;
829
+ destroyCallback(): void;
893
830
  private _initCtxOwner;
894
831
  private _observeUploadCollection;
895
832
  private _unobserveUploadCollection;
@@ -898,17 +835,13 @@ declare class LitUploaderBlock extends LitActivityBlock {
898
835
  private _handleCollectionUpdate;
899
836
  private _handleCollectionPropertiesUpdate;
900
837
  private _flushCommonUploadProgress;
901
- private _openCloudImageEditor;
902
- private _setInitialCrop;
838
+ openCloudImageEditor(): void;
839
+ private setInitialCrop;
903
840
  protected getMetadataFor(entryId: string): Promise<_uploadcare_upload_client.Metadata | undefined>;
904
841
  protected getUploadClientOptions(): Promise<FileFromOptions>;
905
842
  getOutputData(): OutputFileEntry[];
906
843
  }
907
844
 
908
- /**
909
- * Mapping of loading resources per operation
910
- */
911
- type LoadingOperations = Map<string, Map<string, boolean>>;
912
845
  /**
913
846
  * Image size
914
847
  */
@@ -944,18 +877,21 @@ interface CropAspectRatio {
944
877
  id: string;
945
878
  hasFreeform?: boolean;
946
879
  }
947
- type CropPresetList = CropAspectRatio[];
948
880
 
949
- type ActivityParams = {
881
+ type ActivityParams$1 = {
950
882
  internalId: string;
951
883
  };
952
884
 
885
+ type ActivityParams = {
886
+ externalSourceType: string;
887
+ };
888
+
953
889
  declare const ACTIVE_PROP = "___ACTIVITY_IS_ACTIVE___";
954
890
  type ActivityParamsMap = {
955
- 'cloud-image-edit': ActivityParams;
956
- external: ActivityParams$1;
891
+ 'cloud-image-edit': ActivityParams$1;
892
+ external: ActivityParams;
957
893
  };
958
- declare class LitActivityBlock extends LitBlock {
894
+ declare class ActivityBlock extends Block {
959
895
  protected historyTracked: boolean;
960
896
  private [ACTIVE_PROP]?;
961
897
  init$: {
@@ -965,7 +901,9 @@ declare class LitActivityBlock extends LitBlock {
965
901
  '*historyBack': null;
966
902
  '*closeModal': () => void;
967
903
  };
968
- private _debouncedHistoryFlush;
904
+ _debouncedHistoryFlush: (() => void) & {
905
+ cancel: () => void;
906
+ };
969
907
  private _deactivate;
970
908
  private _activate;
971
909
  initCallback(): void;
@@ -981,23 +919,46 @@ declare class LitActivityBlock extends LitBlock {
981
919
  CLOUD_IMG_EDIT: 'cloud-image-edit';
982
920
  EXTERNAL: 'external';
983
921
  }>;
984
- protected get isActivityActive(): boolean;
922
+ get isActivityActive(): boolean;
985
923
  get couldOpenActivity(): boolean;
986
924
  /** TODO: remove name argument */
987
- protected registerActivity(_name: string, options?: {
925
+ registerActivity(_name: string, options?: {
988
926
  onActivate?: () => void;
989
927
  onDeactivate?: () => void;
990
928
  }): void;
991
- private _unregisterActivity;
992
- disconnectedCallback(): void;
929
+ unregisterActivity(): void;
930
+ destroyCallback(): void;
931
+ get activityKey(): string;
993
932
  get activityParams(): ActivityParamsMap[keyof ActivityParamsMap];
994
- get initActivity(): string | null;
995
- get doneActivity(): string | null;
933
+ get initActivity(): string;
934
+ get doneActivity(): string;
996
935
  historyBack(): void;
997
936
  }
998
- type RegisteredActivityType = (typeof LitActivityBlock)['activities'][keyof (typeof LitActivityBlock)['activities']];
937
+ type RegisteredActivityType = (typeof ActivityBlock)['activities'][keyof (typeof ActivityBlock)['activities']];
999
938
  type ActivityType = RegisteredActivityType | (string & {}) | null;
1000
939
 
940
+ declare class Modal extends Block {
941
+ static styleAttrs: string[];
942
+ static StateConsumerScope: string;
943
+ private _mouseDownTarget;
944
+ handleModalOpen: ModalCb;
945
+ handleModalClose: ModalCb;
946
+ handleModalCloseAll: ModalCb;
947
+ constructor();
948
+ _handleBackdropClick: () => void;
949
+ _closeDialog: () => void;
950
+ _handleDialogClose: () => void;
951
+ _handleDialogMouseDown: (e: MouseEvent) => void;
952
+ _handleDialogMouseUp: (e: MouseEvent) => void;
953
+ show(): void;
954
+ hide(): void;
955
+ private _handleModalOpen;
956
+ private _handleModalClose;
957
+ private _handleModalCloseAll;
958
+ initCallback(): void;
959
+ destroyCallback(): void;
960
+ }
961
+
1001
962
  declare const ModalEvents: Readonly<{
1002
963
  readonly ADD: "modal:add";
1003
964
  readonly DELETE: "modal:delete";
@@ -1017,7 +978,7 @@ declare class ModalManager {
1017
978
  private _activeModals;
1018
979
  private _subscribers;
1019
980
  private _block;
1020
- constructor(block: LitBlock);
981
+ constructor(block: Block);
1021
982
  private _debugPrint;
1022
983
  /**
1023
984
  * Register a modal with the manager
@@ -1052,6 +1013,95 @@ declare class ModalManager {
1052
1013
  destroy(): void;
1053
1014
  }
1054
1015
 
1016
+ declare const InternalEventType: Readonly<{
1017
+ readonly INIT_SOLUTION: "init-solution";
1018
+ readonly CHANGE_CONFIG: "change-config";
1019
+ readonly ACTION_EVENT: "action-event";
1020
+ readonly ERROR_EVENT: "error-event";
1021
+ }>;
1022
+ declare const EventType: Readonly<{
1023
+ readonly FILE_ADDED: "file-added";
1024
+ readonly FILE_REMOVED: "file-removed";
1025
+ readonly FILE_UPLOAD_START: "file-upload-start";
1026
+ readonly FILE_UPLOAD_PROGRESS: "file-upload-progress";
1027
+ readonly FILE_UPLOAD_SUCCESS: "file-upload-success";
1028
+ readonly FILE_UPLOAD_FAILED: "file-upload-failed";
1029
+ readonly FILE_URL_CHANGED: "file-url-changed";
1030
+ readonly MODAL_OPEN: "modal-open";
1031
+ readonly MODAL_CLOSE: "modal-close";
1032
+ readonly DONE_CLICK: "done-click";
1033
+ readonly UPLOAD_CLICK: "upload-click";
1034
+ readonly ACTIVITY_CHANGE: "activity-change";
1035
+ readonly COMMON_UPLOAD_START: "common-upload-start";
1036
+ readonly COMMON_UPLOAD_PROGRESS: "common-upload-progress";
1037
+ readonly COMMON_UPLOAD_SUCCESS: "common-upload-success";
1038
+ readonly COMMON_UPLOAD_FAILED: "common-upload-failed";
1039
+ readonly CHANGE: "change";
1040
+ readonly GROUP_CREATED: "group-created";
1041
+ }>;
1042
+ type EventKey = (typeof EventType)[keyof typeof EventType];
1043
+ type InternalEventKey = (typeof InternalEventType)[keyof typeof InternalEventType];
1044
+ type EventPayload = {
1045
+ [EventType.FILE_ADDED]: OutputFileEntry<'idle'>;
1046
+ [EventType.FILE_REMOVED]: OutputFileEntry<'removed'>;
1047
+ [EventType.FILE_UPLOAD_START]: OutputFileEntry<'uploading'>;
1048
+ [EventType.FILE_UPLOAD_PROGRESS]: OutputFileEntry<'uploading'>;
1049
+ [EventType.FILE_UPLOAD_SUCCESS]: OutputFileEntry<'success'>;
1050
+ [EventType.FILE_UPLOAD_FAILED]: OutputFileEntry<'failed'>;
1051
+ [EventType.FILE_URL_CHANGED]: OutputFileEntry<'success'>;
1052
+ [EventType.MODAL_OPEN]: {
1053
+ modalId: ModalId;
1054
+ };
1055
+ [EventType.MODAL_CLOSE]: {
1056
+ modalId: ModalId;
1057
+ hasActiveModals: boolean;
1058
+ };
1059
+ [EventType.ACTIVITY_CHANGE]: {
1060
+ activity: ActivityType;
1061
+ };
1062
+ [EventType.UPLOAD_CLICK]: void;
1063
+ [EventType.DONE_CLICK]: OutputCollectionState;
1064
+ [EventType.COMMON_UPLOAD_START]: OutputCollectionState<'uploading'>;
1065
+ [EventType.COMMON_UPLOAD_PROGRESS]: OutputCollectionState<'uploading'>;
1066
+ [EventType.COMMON_UPLOAD_SUCCESS]: OutputCollectionState<'success'>;
1067
+ [EventType.COMMON_UPLOAD_FAILED]: OutputCollectionState<'failed'>;
1068
+ [EventType.CHANGE]: OutputCollectionState;
1069
+ [EventType.GROUP_CREATED]: OutputCollectionState<'success', 'has-group'>;
1070
+ };
1071
+ declare class EventEmitter {
1072
+ private _timeoutStore;
1073
+ private _targets;
1074
+ private _debugPrint;
1075
+ constructor(debugPrint: (...args: unknown[]) => void);
1076
+ bindTarget(target: Block): void;
1077
+ unbindTarget(target: Block): void;
1078
+ private _dispatch;
1079
+ emit<T extends EventKey, TDebounce extends boolean | number | undefined = undefined>(type: T, payload?: TDebounce extends false | undefined ? EventPayload[T] : () => EventPayload[T], options?: {
1080
+ debounce?: TDebounce;
1081
+ }): void;
1082
+ }
1083
+
1084
+ declare class A11y {
1085
+ private _destroyKeyUX;
1086
+ private readonly _scopedWindow;
1087
+ constructor();
1088
+ registerBlock(scope: Block): void;
1089
+ destroy(): void;
1090
+ }
1091
+
1092
+ type LocaleChangeCallback = () => void;
1093
+ declare class LocaleManager {
1094
+ private _blockInstance;
1095
+ private _localeName;
1096
+ private _callbacks;
1097
+ private _boundBlocks;
1098
+ constructor(blockInstance: Block);
1099
+ onLocaleChange(callback: LocaleChangeCallback): () => void;
1100
+ bindL10n(block: Block, key: string, resolver: LocaleChangeCallback): void;
1101
+ destroyL10nBindings(block: Block): void;
1102
+ destroy(): void;
1103
+ }
1104
+
1055
1105
  type CommonEventType = InternalEventKey | EventKey;
1056
1106
  type TelemetryState = TelemetryRequest & {
1057
1107
  eventTimestamp: number;
@@ -1061,292 +1111,99 @@ type TelemetryEventBody = Partial<Pick<TelemetryState, 'payload' | 'config'>> &
1061
1111
  modalId?: string;
1062
1112
  eventType?: CommonEventType;
1063
1113
  };
1064
- interface ITelemetryManager {
1114
+ declare class TelemetryManager {
1115
+ private readonly _sessionId;
1116
+ private readonly _telemetryInstance;
1117
+ private readonly _block;
1118
+ private _config;
1119
+ private _initialized;
1120
+ private _lastPayload;
1121
+ private readonly _queue;
1122
+ constructor(block: Block);
1123
+ private _init;
1124
+ private _setConfig;
1125
+ private _formattingPayload;
1126
+ private _excludedEvents;
1065
1127
  sendEvent(body: TelemetryEventBody): void;
1066
1128
  sendEventError(error: unknown, context?: string): void;
1129
+ /**
1130
+ * Method to send telemetry event for Cloud Image Editor.
1131
+ */
1067
1132
  sendEventCloudImageEditor(e: MouseEvent, tabId: string, options?: Record<string, unknown>): void;
1133
+ /**
1134
+ * Deeply compares two objects and returns true if they are equal, false otherwise.
1135
+ */
1136
+ private _checkObj;
1137
+ private get _timestamp();
1138
+ private get _solution();
1139
+ private get _activity();
1140
+ private get _location();
1068
1141
  }
1069
1142
 
1070
- declare const TabId: Readonly<{
1071
- readonly CROP: "crop";
1072
- readonly TUNING: "tuning";
1073
- readonly FILTERS: "filters";
1074
- }>;
1075
- type TabIdValue$1 = (typeof TabId)[keyof typeof TabId];
1076
- declare const ALL_COLOR_OPERATIONS: readonly ["brightness", "exposure", "gamma", "contrast", "saturation", "vibrance", "warmth", "enhance"];
1077
- type ColorOperation = (typeof ALL_COLOR_OPERATIONS)[number];
1078
- 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"];
1079
- type FilterId = (typeof ALL_FILTERS)[number];
1080
- declare const ALL_CROP_OPERATIONS: readonly ["rotate", "mirror", "flip"];
1081
- type CropOperation = (typeof ALL_CROP_OPERATIONS)[number];
1082
- /** KeypointsNumber is the number of keypoints loaded from each side of zero, not total number */
1083
- declare const COLOR_OPERATIONS_CONFIG: Readonly<{
1084
- brightness: {
1085
- zero: number;
1086
- range: readonly [-100, 100];
1087
- keypointsNumber: number;
1088
- };
1089
- exposure: {
1090
- zero: number;
1091
- range: readonly [-500, 500];
1092
- keypointsNumber: number;
1093
- };
1094
- gamma: {
1095
- zero: number;
1096
- range: readonly [0, 1000];
1097
- keypointsNumber: number;
1098
- };
1099
- contrast: {
1100
- zero: number;
1101
- range: readonly [-100, 500];
1102
- keypointsNumber: number;
1103
- };
1104
- saturation: {
1105
- zero: number;
1106
- range: readonly [-100, 500];
1107
- keypointsNumber: number;
1108
- };
1109
- vibrance: {
1110
- zero: number;
1111
- range: readonly [-100, 500];
1112
- keypointsNumber: number;
1113
- };
1114
- warmth: {
1115
- zero: number;
1116
- range: readonly [-100, 100];
1117
- keypointsNumber: number;
1118
- };
1119
- enhance: {
1120
- zero: number;
1121
- range: readonly [0, 100];
1122
- keypointsNumber: number;
1123
- };
1124
- filter: {
1125
- zero: number;
1126
- range: readonly [0, 100];
1127
- keypointsNumber: number;
1128
- };
1129
- }>;
1130
-
1131
- type SharedConfigState = {
1132
- [K in keyof ConfigType as `*cfg/${K}`]: ConfigType[K];
1133
- };
1134
- type BlocksRegistry = Set<LitBlock>;
1135
- type ActivityBlockCtxState = {
1136
- '*currentActivity': string | null;
1137
- '*currentActivityParams': Record<string, unknown>;
1138
- '*history': (string | null)[];
1139
- '*historyBack': (() => void) | null;
1140
- '*closeModal': () => void;
1141
- };
1142
- type UploaderBlockCtxState = ActivityBlockCtxState & {
1143
- '*commonProgress': number;
1144
- '*uploadList': {
1145
- uid: Uid;
1146
- }[];
1147
- '*uploadQueue': Queue;
1148
- '*collectionErrors': OutputErrorCollection[];
1149
- '*collectionState': OutputCollectionState | null;
1150
- '*groupInfo': UploadcareGroup | null;
1151
- '*uploadTrigger': Set<Uid>;
1152
- };
1153
- type SolutionBlockCtxState = UploaderBlockCtxState & {
1154
- '*solution': string | null;
1155
- };
1156
- type CloudImageEditorState = {
1157
- '*originalUrl': string | null;
1158
- '*loadingOperations': LoadingOperations;
1159
- '*faderEl': EditorImageFader | null;
1160
- '*cropperEl': EditorImageCropper | null;
1161
- '*imgEl': HTMLImageElement | null;
1162
- '*imgContainerEl': HTMLElement | null;
1163
- '*networkProblems': boolean;
1164
- '*imageSize': {
1165
- width: number;
1166
- height: number;
1167
- } | null;
1168
- '*editorTransformations': Transformations;
1169
- '*cropPresetList': CropPresetList;
1170
- '*currentAspectRatio': CropAspectRatio | null;
1171
- '*tabList': readonly TabIdValue$1[];
1172
- '*tabId': TabIdValue$1;
1173
- '*on.retryNetwork': () => void;
1174
- '*on.apply': (transformations: Transformations) => void;
1175
- '*on.cancel': () => void;
1176
- };
1177
- type EditorImageCropperState = {
1178
- '*padding': number;
1179
- '*operations': {
1180
- rotate: number;
1181
- mirror: boolean;
1182
- flip: boolean;
1183
- };
1184
- '*imageBox': {
1185
- x: number;
1186
- y: number;
1187
- width: number;
1188
- height: number;
1189
- };
1190
- '*cropBox': {
1191
- x: number;
1192
- y: number;
1193
- width: number;
1194
- height: number;
1195
- };
1196
- };
1197
- type EditorToolbarState = {
1198
- '*showListAspectRatio': boolean;
1199
- '*sliderEl': EditorSlider | null;
1200
- '*showSlider': boolean;
1201
- '*currentFilter': string;
1202
- '*currentOperation': string | null;
1203
- '*operationTooltip': string | null;
1204
- };
1205
- type DynamicBlockState = {
1206
- '*blocksRegistry': BlocksRegistry;
1207
- '*eventEmitter': EventEmitter;
1208
- '*localeManager': LocaleManager;
1209
- '*telemetryManager': ITelemetryManager;
1210
- '*a11y': A11y;
1211
- '*modalManager': ModalManager | null;
1212
- };
1213
- type DynamicUploaderBlockState = {
1214
- '*uploadCollection': TypedCollection<UploadEntryData>;
1215
- '*publicApi': UploaderPublicApi;
1216
- '*validationManager': ValidationManager;
1217
- '*secureUploadsManager': SecureUploadsManager;
1218
- };
1219
- type LocaleState = {
1220
- [K in keyof LocaleDefinition as `*l10n/${K}`]: string;
1221
- };
1222
- type SharedState = SolutionBlockCtxState & SharedConfigState & CloudImageEditorState & EditorImageCropperState & EditorToolbarState & DynamicBlockState & DynamicUploaderBlockState & LocaleState;
1223
-
1224
- declare const LitBlockBase: typeof LitElement & Constructor<{
1225
- willYield: boolean;
1226
- yield(slot: string, defaultContent?: unknown): unknown;
1227
- }> & Constructor<{
1228
- getCssData(propName: string, silentCheck?: boolean): string | number | boolean | null | undefined;
1229
- }> & Constructor<SymbioteComponent<SharedState>> & Constructor<LitElement> & {
1230
- reg(tagName: string): void;
1231
- };
1232
- declare class LitBlock extends LitBlockBase {
1233
- private _cfgProxy;
1234
- private _sharedContextInstances;
1143
+ declare class Block extends BaseComponent<any> {
1144
+ private __cfgProxy?;
1145
+ protected l10nProcessorSubs: Map<string, Set<{
1146
+ remove: () => void;
1147
+ }>>;
1148
+ static StateConsumerScope: string | null;
1235
1149
  static styleAttrs: string[];
1150
+ protected requireCtxName: boolean;
1236
1151
  activityType: ActivityType;
1237
1152
  init$: {};
1238
- constructor();
1239
1153
  l10n(str: string, variables?: Record<string, string | number>): string;
1240
- private _pluralize;
1154
+ private pluralize;
1155
+ protected bindL10n(key: string, resolver: () => void): void;
1156
+ constructor();
1241
1157
  emit(type: Parameters<EventEmitter['emit']>[0], payload?: Parameters<EventEmitter['emit']>[1], options?: Parameters<EventEmitter['emit']>[2]): void;
1242
- hasBlockInCtx(callback: (block: LitBlock) => boolean): boolean;
1158
+ hasBlockInCtx(callback: (block: Block) => boolean): boolean;
1159
+ setOrAddState(prop: string, newVal: any): void;
1243
1160
  connectedCallback(): void;
1161
+ disconnectedCallback(): void;
1244
1162
  initCallback(): void;
1245
1163
  get testId(): string;
1246
- get modalManager(): ModalManager | null;
1247
- get telemetryManager(): ITelemetryManager;
1248
- get localeManager(): LocaleManager;
1249
- get a11y(): A11y;
1250
- get blocksRegistry(): Set<LitBlock>;
1251
- get eventEmitter(): EventEmitter;
1252
- disconnectedCallback(): void;
1164
+ get modalManager(): ModalManager | undefined;
1165
+ get telemetryManager(): TelemetryManager | {
1166
+ sendEvent: () => void;
1167
+ sendEventCloudImageEditor: () => void;
1168
+ sendEventError: () => void;
1169
+ };
1170
+ protected get localeManager(): LocaleManager | null;
1171
+ protected get a11y(): A11y | null;
1172
+ protected get blocksRegistry(): Set<Block>;
1173
+ destroyCallback(): void;
1253
1174
  /**
1254
1175
  * Called when the last block is removed from the context. Note that inheritors must run their callback before that.
1255
1176
  */
1256
1177
  protected destroyCtxCallback(): void;
1257
- /**
1258
- * Adds a shared context instance if it does not exist yet.
1259
- * @param key The shared state key.
1260
- * @param resolver The resolver function that creates the instance.
1261
- * @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.
1262
- */
1263
- protected addSharedContextInstance<TKey extends keyof SharedState>(key: TKey, resolver: () => SharedState[TKey], { persist }?: {
1264
- persist?: boolean | undefined;
1265
- }): void;
1266
- private _destroySharedContextInstances;
1267
- protected getSharedContextInstance<TKey extends keyof SharedState, TRequired extends boolean = true>(key: TKey, isRequired?: TRequired): TRequired extends true ? NonNullable<SharedState[TKey]> : SharedState[TKey];
1268
1178
  protected proxyUrl(url: string): Promise<string>;
1269
1179
  get cfg(): ConfigType;
1270
- subConfigValue<T extends keyof ConfigType>(key: T, callback: (value: ConfigType[T]) => void): () => void;
1180
+ subConfigValue<T extends keyof ConfigType>(key: T, callback: (value: ConfigType[T]) => void): void;
1271
1181
  debugPrint(...args: unknown[]): void;
1182
+ static reg(name?: string): void;
1272
1183
  }
1273
1184
 
1274
- declare function initState(fnCtx: CloudImageEditorBlock): {
1275
- '*originalUrl': null;
1276
- '*loadingOperations': LoadingOperations;
1277
- '*faderEl': null;
1278
- '*cropperEl': null;
1279
- '*imgEl': null;
1280
- '*imgContainerEl': null;
1281
- '*networkProblems': boolean;
1282
- '*imageSize': null;
1283
- '*editorTransformations': {};
1284
- '*cropPresetList': never[];
1285
- '*currentAspectRatio': null;
1286
- '*tabList': readonly ["crop", "tuning", "filters"];
1287
- '*tabId': "crop";
1288
- '*on.retryNetwork': () => void;
1289
- '*on.apply': (transformations: Transformations) => void;
1290
- '*on.cancel': () => void;
1291
- };
1292
-
1293
- declare class CloudImageEditorBlock extends LitBlock {
1294
- attributesMeta: ({
1295
- uuid: string;
1296
- } | {
1297
- 'cdn-url': string;
1298
- }) & Partial<{
1299
- tabs: string;
1300
- 'crop-preset': string;
1301
- }> & {
1302
- 'ctx-name': string;
1303
- };
1185
+ declare class CloudImageEditorBlock extends Block {
1304
1186
  ctxOwner: boolean;
1305
1187
  static styleAttrs: string[];
1306
- private _statusMessage;
1307
- private _imageSrc;
1308
- private _fileType;
1188
+ private _debouncedShowLoader;
1189
+ constructor();
1309
1190
  private _showLoader;
1310
- uuid: string | null;
1311
- cdnUrl: string | null;
1312
- cropPreset: string;
1313
- tabs: string | null;
1314
- private _hasNetworkProblems;
1315
- private _isInitialized;
1316
- private _pendingInitUpdate;
1317
- private readonly _debouncedShowLoader;
1318
- private readonly _imgRef;
1319
- private readonly _cropperRef;
1320
- private readonly _faderRef;
1321
- private readonly _imgContainerRef;
1322
- private readonly _handleImageLoad;
1323
- private readonly _handleImageError;
1324
- private readonly _handleRetryNetwork;
1325
- private _scheduleInitialization;
1326
- init$: ReturnType<typeof initState>;
1327
- initCallback(): void;
1328
- private _assignSharedElements;
1329
- private _attachImageListeners;
1330
- private _detachImageListeners;
1331
- private get _imageClassName();
1332
1191
  /**
1333
1192
  * To proper work, we need non-zero size the element. So, we'll wait for it.
1334
1193
  */
1335
1194
  private _waitForSize;
1336
- firstUpdated(changedProperties: PropertyValues<this>): void;
1337
- disconnectedCallback(): void;
1338
- render(): lit_html.TemplateResult<1>;
1339
- protected updated(changedProperties: PropertyValues<this>): void;
1340
- private _syncTabListFromProp;
1341
- private _syncCropPresetState;
1195
+ initCallback(): void;
1342
1196
  updateImage(): Promise<void>;
1343
1197
  initEditor(): Promise<void>;
1344
1198
  }
1345
1199
 
1346
- declare class CropFrame extends LitBlock {
1200
+ declare class CropFrame extends Block {
1201
+ private readonly _handlePointerUp;
1202
+ private readonly _handlePointerMove;
1203
+ private readonly _handleSvgPointerMove;
1204
+ private readonly _backdropMaskId;
1347
1205
  private _backdropMask?;
1348
1206
  private _backdropMaskInner?;
1349
- private readonly _backdropMaskId;
1350
1207
  private _frameThumbs?;
1351
1208
  private _frameGuides?;
1352
1209
  private _draggingThumb?;
@@ -1355,14 +1212,7 @@ declare class CropFrame extends LitBlock {
1355
1212
  private _dragStartCrop?;
1356
1213
  private _frameImage?;
1357
1214
  private _guidesHidden;
1358
- private _draggingValue;
1359
- private readonly _svgRef;
1360
- private _svgReady;
1361
- private _pendingMaskHref;
1362
- private get _svgElement();
1363
- private get _dragging();
1364
- private set _dragging(value);
1365
- private _applyGuidesDragState;
1215
+ constructor();
1366
1216
  private _shouldThumbBeDisabled;
1367
1217
  private _createBackdrop;
1368
1218
  /**
@@ -1377,56 +1227,103 @@ declare class CropFrame extends LitBlock {
1377
1227
  private _createGuides;
1378
1228
  private _createFrame;
1379
1229
  private _handlePointerDown;
1380
- private readonly _handlePointerUp;
1381
- private readonly _handlePointerMove;
1230
+ private _handlePointerUp_;
1231
+ private _handlePointerMove_;
1382
1232
  private _calcCropBox;
1383
- private readonly _handleSvgPointerMove;
1233
+ private _handleSvgPointerMove_;
1384
1234
  private _updateCursor;
1385
1235
  private _createMask;
1386
1236
  private _updateMask;
1387
1237
  private _render;
1388
1238
  toggleThumbs(visible: boolean): void;
1389
1239
  initCallback(): void;
1390
- protected firstUpdated(changedProperties: PropertyValues<this>): void;
1391
- private _initializeSvg;
1392
- disconnectedCallback(): void;
1393
- render(): TemplateResult;
1240
+ destroyCallback(): void;
1394
1241
  }
1395
1242
 
1396
- declare class EditorButtonControl extends LitBlock {
1397
- active: boolean;
1398
- title: string;
1399
- protected icon: string;
1400
- protected titleProp: string;
1401
- protected get buttonClasses(): Record<string, boolean>;
1402
- private _updateHostStateClasses;
1403
- protected onClick(_event: MouseEvent): void;
1404
- connectedCallback(): void;
1405
- protected updated(changedProperties: PropertyValues<this>): void;
1406
- render(): lit_html.TemplateResult<1>;
1243
+ declare class EditorButtonControl extends Block {
1244
+ private _titleEl?;
1245
+ constructor();
1246
+ initCallback(): void;
1407
1247
  }
1408
1248
 
1409
1249
  declare class EditorFreeformButtonControl extends EditorButtonControl {
1410
1250
  initCallback(): void;
1411
- onClick(): void;
1412
- private _computeTitle;
1413
- render(): lit_html.TemplateResult<1>;
1251
+ handleClick(): void;
1252
+ }
1253
+ interface EditorAspectRatioButtonControl {
1254
+ get aspectRatio(): CropAspectRatio | undefined;
1255
+ set aspectRatio(value: CropAspectRatio | undefined);
1414
1256
  }
1415
1257
  declare class EditorAspectRatioButtonControl extends EditorButtonControl {
1416
- private _aspectRatio;
1417
- get aspectRatio(): CropAspectRatio | null;
1418
- set aspectRatio(value: CropAspectRatio | null);
1258
+ constructor();
1419
1259
  initCallback(): void;
1420
- protected onClick(): void;
1421
- private _updateAspectRatioPresentation;
1422
- private _renderIcon;
1423
- render(): lit_html.TemplateResult<1>;
1260
+ handleClick(): void;
1261
+ private _renderRectBasedOnAspectRatio;
1262
+ private _aspectRatio?;
1424
1263
  }
1425
1264
 
1265
+ declare const ALL_COLOR_OPERATIONS: readonly ["brightness", "exposure", "gamma", "contrast", "saturation", "vibrance", "warmth", "enhance"];
1266
+ type ColorOperation = (typeof ALL_COLOR_OPERATIONS)[number];
1267
+ 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"];
1268
+ type FilterId = (typeof ALL_FILTERS)[number];
1269
+ declare const ALL_CROP_OPERATIONS: readonly ["rotate", "mirror", "flip"];
1270
+ type CropOperation = (typeof ALL_CROP_OPERATIONS)[number];
1271
+ /** KeypointsNumber is the number of keypoints loaded from each side of zero, not total number */
1272
+ declare const COLOR_OPERATIONS_CONFIG: Readonly<{
1273
+ brightness: {
1274
+ zero: number;
1275
+ range: readonly [-100, 100];
1276
+ keypointsNumber: number;
1277
+ };
1278
+ exposure: {
1279
+ zero: number;
1280
+ range: readonly [-500, 500];
1281
+ keypointsNumber: number;
1282
+ };
1283
+ gamma: {
1284
+ zero: number;
1285
+ range: readonly [0, 1000];
1286
+ keypointsNumber: number;
1287
+ };
1288
+ contrast: {
1289
+ zero: number;
1290
+ range: readonly [-100, 500];
1291
+ keypointsNumber: number;
1292
+ };
1293
+ saturation: {
1294
+ zero: number;
1295
+ range: readonly [-100, 500];
1296
+ keypointsNumber: number;
1297
+ };
1298
+ vibrance: {
1299
+ zero: number;
1300
+ range: readonly [-100, 500];
1301
+ keypointsNumber: number;
1302
+ };
1303
+ warmth: {
1304
+ zero: number;
1305
+ range: readonly [-100, 100];
1306
+ keypointsNumber: number;
1307
+ };
1308
+ enhance: {
1309
+ zero: number;
1310
+ range: readonly [0, 100];
1311
+ keypointsNumber: number;
1312
+ };
1313
+ filter: {
1314
+ zero: number;
1315
+ range: readonly [0, 100];
1316
+ keypointsNumber: number;
1317
+ };
1318
+ }>;
1319
+
1320
+ interface EditorCropButtonControl {
1321
+ get operation(): CropOperation | undefined;
1322
+ set operation(value: CropOperation | undefined);
1323
+ }
1426
1324
  declare class EditorCropButtonControl extends EditorButtonControl {
1427
- operation: CropOperation | undefined;
1428
- protected willUpdate(changedProperties: PropertyValues<this>): void;
1429
- protected onClick(e: MouseEvent): void;
1325
+ private _operation;
1326
+ initCallback(): void;
1430
1327
  }
1431
1328
 
1432
1329
  declare class EditorFilterControl extends EditorButtonControl {
@@ -1435,27 +1332,11 @@ declare class EditorFilterControl extends EditorButtonControl {
1435
1332
  private _originalUrl;
1436
1333
  private _observer?;
1437
1334
  private _cancelPreload?;
1438
- private _lastPreviewRequestId;
1439
- private _previewVisibilityCheckRaf?;
1440
- private _previewVisibilityCheckTimeout?;
1441
- private _previewImage;
1442
- private _previewLoaded;
1443
- isOriginal: boolean;
1444
- private _iconSize;
1445
- get filter(): string;
1446
- set filter(value: string);
1447
- onClick(e: MouseEvent): void;
1335
+ constructor();
1448
1336
  private _previewSrc;
1449
1337
  private _observerCallback;
1450
1338
  initCallback(): void;
1451
- disconnectedCallback(): void;
1452
- protected updated(changedProperties: PropertyValues<this>): void;
1453
- private _updateFilterLabels;
1454
- private _loadPreview;
1455
- private _schedulePreviewVisibilityCheck;
1456
- private _clearPreviewVisibilityChecks;
1457
- private get _shouldShowPreview();
1458
- render(): lit_html.TemplateResult<1>;
1339
+ destroyCallback(): void;
1459
1340
  }
1460
1341
 
1461
1342
  type Operations = {
@@ -1463,7 +1344,7 @@ type Operations = {
1463
1344
  mirror: boolean;
1464
1345
  rotate: number;
1465
1346
  };
1466
- declare class EditorImageCropper extends LitBlock {
1347
+ declare class EditorImageCropper extends Block {
1467
1348
  ctxOwner: boolean;
1468
1349
  private _commitDebounced;
1469
1350
  private _handleResizeThrottled;
@@ -1472,12 +1353,9 @@ declare class EditorImageCropper extends LitBlock {
1472
1353
  private _ctx;
1473
1354
  private _isActive;
1474
1355
  private _observer?;
1475
- private _image;
1476
1356
  private _cancelPreload?;
1477
- private readonly _canvasRef;
1478
- private readonly _frameRef;
1479
1357
  constructor();
1480
- protected firstUpdated(changedProperties: PropertyValues<this>): void;
1358
+ private _handleResize;
1481
1359
  private _syncTransformations;
1482
1360
  private _initCanvas;
1483
1361
  private _alignImage;
@@ -1502,12 +1380,11 @@ declare class EditorImageCropper extends LitBlock {
1502
1380
  private _waitForImage;
1503
1381
  private _handleImageLoading;
1504
1382
  initCallback(): void;
1505
- disconnectedCallback(): void;
1506
- render(): TemplateResult;
1383
+ destroyCallback(): void;
1507
1384
  }
1508
1385
 
1509
1386
  type OperationKey = keyof typeof COLOR_OPERATIONS_CONFIG;
1510
- declare class EditorImageFader extends LitBlock {
1387
+ declare class EditorImageFader extends Block {
1511
1388
  private _isActive;
1512
1389
  private _hidden;
1513
1390
  private _operation;
@@ -1515,6 +1392,7 @@ declare class EditorImageFader extends LitBlock {
1515
1392
  private _value?;
1516
1393
  private _transformations;
1517
1394
  private _keypoints;
1395
+ private _container?;
1518
1396
  private _previewImage?;
1519
1397
  private _cancelLastImages?;
1520
1398
  private _cancelBatchPreload?;
@@ -1522,8 +1400,6 @@ declare class EditorImageFader extends LitBlock {
1522
1400
  private _fromViewer?;
1523
1401
  private _raf;
1524
1402
  private _addKeypointDebounced;
1525
- private readonly _previewHostRef;
1526
- private readonly _layersHostRef;
1527
1403
  constructor();
1528
1404
  private _handleImageLoading;
1529
1405
  private _flush;
@@ -1533,6 +1409,7 @@ declare class EditorImageFader extends LitBlock {
1533
1409
  * Check if current operation and filter equals passed ones
1534
1410
  */
1535
1411
  private _isSame;
1412
+ private _addKeypoint;
1536
1413
  set(value: string | number): void;
1537
1414
  private _update;
1538
1415
  private _createPreviewImage;
@@ -1555,194 +1432,111 @@ declare class EditorImageFader extends LitBlock {
1555
1432
  deactivate({ hide }?: {
1556
1433
  hide?: boolean;
1557
1434
  }): void;
1558
- private _ensurePreviewAttached;
1559
- private _clearLayersHost;
1560
- render(): TemplateResult;
1561
1435
  }
1562
1436
 
1563
1437
  declare class EditorOperationControl extends EditorButtonControl {
1564
1438
  private _operation;
1565
- get operation(): ColorOperation | '';
1566
- set operation(value: ColorOperation | '');
1567
- private _updateOperationMetadata;
1568
1439
  initCallback(): void;
1569
- protected onClick(e: MouseEvent): void;
1570
1440
  }
1571
1441
 
1572
- declare class EditorScroller extends LitBlock {
1573
- private readonly _handleWheel;
1574
- connectedCallback(): void;
1575
- disconnectedCallback(): void;
1442
+ declare class EditorScroller extends Block {
1443
+ initCallback(): void;
1576
1444
  }
1577
1445
 
1578
1446
  type SliderOperation = ColorOperation | 'filter';
1579
1447
  type SliderFilter = FilterId | typeof FAKE_ORIGINAL_FILTER;
1580
1448
  declare const FAKE_ORIGINAL_FILTER = "original";
1581
- declare class EditorSlider extends LitBlock {
1582
- state: {
1583
- operation: SliderOperation;
1584
- filter: SliderFilter | undefined;
1585
- originalUrl: string;
1586
- disabled: boolean;
1587
- min: number;
1588
- max: number;
1589
- value: number;
1590
- defaultValue: number;
1591
- zero: number;
1592
- };
1593
- private _handleInput;
1449
+ declare class EditorSlider extends Block {
1450
+ private _operation;
1451
+ private _filter?;
1452
+ private _originalUrl;
1453
+ constructor();
1594
1454
  setOperation(operation: SliderOperation, filter?: SliderFilter): void;
1595
1455
  private _initializeValues;
1596
1456
  apply(): void;
1597
1457
  cancel(): void;
1598
1458
  initCallback(): void;
1599
- protected updated(changedProperties: PropertyValues<this>): void;
1600
- render(): lit_html.TemplateResult<1>;
1601
1459
  }
1602
1460
 
1603
- type TabIdValue = (typeof TabId)[keyof typeof TabId];
1604
- declare class EditorToolbar extends LitBlock {
1605
- private _showLoader;
1606
- showMainToolbar: boolean;
1607
- showSubToolbar: boolean;
1608
- private _showTabToggles;
1609
- tabList: readonly TabIdValue[];
1610
- activeTab: TabIdValue;
1611
- private _useSliderPanel;
1612
- private _tooltipVisible;
1613
- private _operationTooltip;
1614
- private _tabIndicatorOffset;
1615
- private _tabIndicatorWidth;
1616
- private readonly _sliderRef;
1617
- private readonly _tabIndicatorRef;
1618
- protected readonly tabToggleRefs: Record<TabIdValue, Ref<HTMLElement>>;
1619
- private readonly _handleWindowResize;
1620
- private _cropPresets;
1461
+ declare class EditorToolbar extends Block {
1462
+ private _debouncedShowLoader;
1621
1463
  private _cancelPreload?;
1622
- private readonly _debouncedShowLoader;
1623
- private readonly _updateInfoTooltip;
1624
- private readonly _subTopToolbarStyles;
1625
- private readonly _subBottomToolbarStyles;
1626
- private readonly _tabContentStyles;
1627
- private readonly _tabToggleStyles;
1628
- private readonly _tabTogglesStyles;
1629
- init$: Record<string, unknown>;
1464
+ private _updateInfoTooltip;
1465
+ constructor();
1630
1466
  private _onSliderClose;
1467
+ private _createOperationControl;
1468
+ private _createFilterControl;
1469
+ private _createToggleControl;
1470
+ private _createAspectRatioControl;
1471
+ private _createFreeformControl;
1472
+ private _clearListAspectRatio;
1473
+ private _renderControlsList;
1631
1474
  private _activateTab;
1632
- private _applyTabState;
1475
+ private _unmountTabControls;
1633
1476
  private _syncTabIndicator;
1634
- private get _hasAspectRatioPicker();
1635
- private _renderControlsByTab;
1636
- private _renderCropTabControls;
1637
- private _renderFilterTabControls;
1638
- private _renderTuningTabControls;
1639
- private _renderControlGroup;
1640
- private _renderFreeformControl;
1641
- private _renderAspectRatioControl;
1642
- private _renderCropOperationControl;
1643
- private _renderFilterControl;
1644
- private _renderOperationControl;
1645
- private _renderAspectRatioList;
1646
1477
  private _preloadEditedImage;
1478
+ private _showLoader;
1479
+ private _updateInfoTooltipHandler;
1647
1480
  initCallback(): void;
1648
- connectedCallback(): void;
1649
- firstUpdated(changedProperties: PropertyValues<this>): void;
1650
- protected updated(changedProperties: PropertyValues<this>): void;
1651
- disconnectedCallback(): void;
1652
- private _assignSharedElements;
1653
- private readonly _handleCancel;
1654
- private readonly _handleApply;
1655
- private readonly _handleApplySlider;
1656
- private readonly _handleCancelSlider;
1657
- private readonly _handleTabClick;
1658
- private _renderTabToggle;
1659
- private _renderTabContent;
1660
- render(): TemplateResult<1>;
1481
+ destroyCallback(): void;
1661
1482
  }
1662
1483
 
1663
- type Theme = string | null;
1664
- declare class BtnUi extends LitBlock {
1665
- text: string;
1666
- icon: string;
1667
- reverse: boolean;
1668
- theme: Theme;
1669
- ariaRole: string;
1670
- ariaControls: string;
1671
- titleProp: string;
1672
- protected firstUpdated(changed: PropertyValues<this>): void;
1673
- protected updated(changed: PropertyValues<this>): void;
1674
- private _applyReverse;
1675
- private _applyThemeClass;
1676
- private get _iconClassMap();
1677
- private get _computedIconHidden();
1678
- private get _computedIconSingle();
1679
- render(): lit_html.TemplateResult<1>;
1484
+ declare class BtnUi extends Block {
1485
+ private _iconReversed;
1486
+ private _iconSingle;
1487
+ private _iconHidden;
1488
+ constructor();
1489
+ private _iconCss;
1490
+ initCallback(): void;
1491
+ set reverse(_value: boolean);
1680
1492
  }
1681
1493
 
1682
- declare class LineLoaderUi extends LitBlock {
1683
- active: boolean;
1684
- private readonly _lineRef;
1685
- private _isAnimating;
1494
+ declare class LineLoaderUi extends Block {
1495
+ private _active;
1686
1496
  private readonly _handleTransitionEndRight;
1687
- protected firstUpdated(changedProperties: PropertyValues<this>): void;
1688
- protected updated(changedProperties: PropertyValues<this>): void;
1497
+ initCallback(): void;
1689
1498
  private _start;
1690
1499
  private _stop;
1691
- private _resetLine;
1692
- render(): lit_html.TemplateResult<1>;
1693
1500
  }
1694
1501
 
1695
- type PresenceToggleStyle = {
1696
- transition?: string;
1697
- visible?: string;
1698
- hidden?: string;
1699
- };
1700
- declare class PresenceToggle extends LitBlock {
1502
+ declare class PresenceToggle extends Block {
1701
1503
  private _visible;
1702
- private _styles;
1703
1504
  private _visibleStyle;
1704
1505
  private _hiddenStyle;
1705
1506
  private _externalTransitions;
1706
- private _initialRenderComplete;
1707
- set visible(value: boolean);
1708
- get visible(): boolean;
1709
- set styles(styles: PresenceToggleStyle);
1710
- get styles(): PresenceToggleStyle;
1507
+ constructor();
1711
1508
  private _handleVisible;
1712
- private _dispatchInitialRenderEvent;
1713
1509
  initCallback(): void;
1714
1510
  }
1715
1511
 
1716
- declare class SliderUi extends LitBlock {
1512
+ declare class SliderUi extends Block {
1717
1513
  private _observer?;
1718
1514
  private _thumbSize;
1515
+ private _zero;
1719
1516
  private _zeroDotEl?;
1720
1517
  private _stepsCount?;
1721
- private readonly _inputRef;
1722
- private readonly _thumbRef;
1723
- private readonly _stepsRef;
1724
- disabled: boolean;
1725
- min: number;
1726
- max: number;
1727
- defaultValue: number;
1728
- zero: number;
1729
- private _currentValue;
1730
1518
  constructor();
1731
- private _emitSliderEvent;
1732
- private readonly _handleSliderInput;
1733
- private readonly _handleSliderChange;
1734
- private readonly _handleInputFocus;
1735
- private readonly _handleInputBlur;
1736
- protected firstUpdated(changedProperties: PropertyValues<this>): void;
1737
- protected willUpdate(changedProperties: PropertyValues<this>): void;
1519
+ initCallback(): void;
1520
+ private _inputEl;
1521
+ private _thumbEl;
1522
+ private _stepsEl;
1738
1523
  private _updateValue;
1739
1524
  private _updateZeroDot;
1740
1525
  private _updateSteps;
1741
- disconnectedCallback(): void;
1742
- private _setCurrentValue;
1743
- private _syncInputValue;
1744
- private _extractEventValue;
1745
- render(): lit_html.TemplateResult<1>;
1526
+ destroyCallback(): void;
1527
+ }
1528
+
1529
+ declare class CloudImageEditor extends CloudImageEditorBlock {
1530
+ static styleAttrs: string[];
1531
+ constructor();
1532
+ initCallback(): void;
1533
+ }
1534
+
1535
+ declare function defineComponents(blockExports: Record<string, any>): void;
1536
+
1537
+ declare class Icon extends Block {
1538
+ constructor();
1539
+ initCallback(): void;
1746
1540
  }
1747
1541
 
1748
1542
  export { BtnUi, CloudImageEditor, CloudImageEditorBlock, Config, CropFrame, EditorAspectRatioButtonControl, EditorCropButtonControl, EditorFilterControl, EditorFreeformButtonControl, EditorImageCropper, EditorImageFader, EditorOperationControl, EditorScroller, EditorSlider, EditorToolbar, Icon, LineLoaderUi, PresenceToggle, SliderUi, defineComponents };