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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/abstract/loadFileUploaderFrom.js +4 -79
  2. package/dist/env.js +4 -33
  3. package/dist/index.css +5 -2664
  4. package/dist/index.d.ts +925 -928
  5. package/dist/index.js +6 -13630
  6. package/dist/index.layered.css +4 -2720
  7. package/dist/index.ssr.js +33 -29
  8. package/dist/locales/file-uploader/ar.js +4 -165
  9. package/dist/locales/file-uploader/az.js +4 -157
  10. package/dist/locales/file-uploader/ca.js +4 -159
  11. package/dist/locales/file-uploader/cs.js +4 -161
  12. package/dist/locales/file-uploader/da.js +4 -157
  13. package/dist/locales/file-uploader/de.js +4 -157
  14. package/dist/locales/file-uploader/el.js +4 -157
  15. package/dist/locales/file-uploader/en.js +4 -157
  16. package/dist/locales/file-uploader/es.js +4 -159
  17. package/dist/locales/file-uploader/et.js +4 -157
  18. package/dist/locales/file-uploader/fi.js +4 -157
  19. package/dist/locales/file-uploader/fr.js +4 -159
  20. package/dist/locales/file-uploader/he.js +4 -159
  21. package/dist/locales/file-uploader/hy.js +4 -157
  22. package/dist/locales/file-uploader/is.js +4 -157
  23. package/dist/locales/file-uploader/it.js +4 -159
  24. package/dist/locales/file-uploader/ja.js +4 -157
  25. package/dist/locales/file-uploader/ka.js +4 -157
  26. package/dist/locales/file-uploader/kk.js +4 -157
  27. package/dist/locales/file-uploader/ko.js +4 -157
  28. package/dist/locales/file-uploader/lv.js +4 -159
  29. package/dist/locales/file-uploader/nb.js +4 -157
  30. package/dist/locales/file-uploader/nl.js +4 -157
  31. package/dist/locales/file-uploader/pl.js +4 -161
  32. package/dist/locales/file-uploader/pt.js +4 -159
  33. package/dist/locales/file-uploader/ro.js +4 -159
  34. package/dist/locales/file-uploader/ru.js +4 -161
  35. package/dist/locales/file-uploader/sk.js +4 -161
  36. package/dist/locales/file-uploader/sr.js +4 -159
  37. package/dist/locales/file-uploader/sv.js +4 -157
  38. package/dist/locales/file-uploader/tr.js +4 -157
  39. package/dist/locales/file-uploader/uk.js +4 -161
  40. package/dist/locales/file-uploader/vi.js +4 -157
  41. package/dist/locales/file-uploader/zh-TW.js +4 -157
  42. package/dist/locales/file-uploader/zh.js +4 -157
  43. package/package.json +19 -18
  44. package/types/jsx.d.ts +75 -48
  45. package/web/file-uploader.iife.min.d.ts +927 -930
  46. package/web/file-uploader.iife.min.js +6 -31
  47. package/web/file-uploader.iife.min.js.LEGAL.txt +71 -0
  48. package/web/file-uploader.min.d.ts +927 -930
  49. package/web/file-uploader.min.js +5 -29
  50. package/web/file-uploader.min.js.LEGAL.txt +71 -0
  51. package/web/uc-basic.layered.min.css +4 -23
  52. package/web/uc-basic.min.css +4 -23
  53. package/web/uc-cloud-image-editor.layered.min.css +4 -23
  54. package/web/uc-cloud-image-editor.min.css +4 -23
  55. package/web/uc-cloud-image-editor.min.d.ts +489 -495
  56. package/web/uc-cloud-image-editor.min.js +5 -29
  57. package/web/uc-cloud-image-editor.min.js.LEGAL.txt +70 -0
  58. package/web/uc-file-uploader-inline.layered.min.css +4 -23
  59. package/web/uc-file-uploader-inline.min.css +4 -23
  60. package/web/uc-file-uploader-inline.min.d.ts +927 -930
  61. package/web/uc-file-uploader-inline.min.js +5 -29
  62. package/web/uc-file-uploader-inline.min.js.LEGAL.txt +71 -0
  63. package/web/uc-file-uploader-minimal.layered.min.css +4 -23
  64. package/web/uc-file-uploader-minimal.min.css +4 -23
  65. package/web/uc-file-uploader-minimal.min.d.ts +927 -930
  66. package/web/uc-file-uploader-minimal.min.js +5 -29
  67. package/web/uc-file-uploader-minimal.min.js.LEGAL.txt +71 -0
  68. package/web/uc-file-uploader-regular.layered.min.css +4 -23
  69. package/web/uc-file-uploader-regular.min.css +4 -23
  70. package/web/uc-file-uploader-regular.min.d.ts +927 -930
  71. package/web/uc-file-uploader-regular.min.js +5 -29
  72. package/web/uc-file-uploader-regular.min.js.LEGAL.txt +71 -0
  73. package/web/uc-img.min.d.ts +28 -38
  74. package/web/uc-img.min.js +5 -25
  75. package/web/uc-img.min.js.LEGAL.txt +24 -0
@@ -1,13 +1,32 @@
1
1
  import * as lit_html from 'lit-html';
2
- import { LitElement, PropertyValues, TemplateResult } from 'lit';
3
- import { PubSub } from '@symbiotejs/symbiote';
4
- import * as lit_html_directives_ref_js from 'lit-html/directives/ref.js';
2
+ import { PropertyValues, LitElement, TemplateResult } from 'lit';
5
3
  import { TelemetryRequest } from '@uploadcare/quality-insights';
6
4
  import * as _uploadcare_upload_client from '@uploadcare/upload-client';
7
- import { UploadcareFile, Metadata, UploadError, NetworkError, UploadcareGroup, FileFromOptions } from '@uploadcare/upload-client';
5
+ import { Metadata, UploadcareFile, UploadError, NetworkError, UploadcareGroup, FileFromOptions, Queue } from '@uploadcare/upload-client';
8
6
  import { Ref } from 'lit/directives/ref.js';
9
7
 
10
- type Constructor$1<T = {}> = new (...args: any[]) => T;
8
+ type Constructor<T = unknown> = new (...args: any[]) => T;
9
+
10
+ type SymbioteStateBag<T extends Record<string, unknown>> = T;
11
+ /**
12
+ * Interface for components using SymbioteMixin
13
+ */
14
+ declare class SymbioteComponent<TState extends Record<string, unknown> = Record<string, unknown>> {
15
+ $: SymbioteStateBag<TState>;
16
+ sub<TKey extends keyof TState>(key: TKey, callback: (value: TState[TKey]) => void, init?: boolean): () => void;
17
+ pub<TKey extends keyof TState>(key: TKey, value: TState[TKey]): void;
18
+ set$<T extends {
19
+ [K in keyof T]: K extends keyof TState ? TState[K] : never;
20
+ }>(obj: T): void;
21
+ has<TKey extends keyof TState>(key: TKey): boolean;
22
+ add<TKey extends keyof TState>(key: TKey, val: TState[TKey], rewrite?: boolean): void;
23
+ add$<T extends {
24
+ [K in keyof T]: K extends keyof TState ? TState[K] : never;
25
+ }>(obj: T, rewrite?: boolean): void;
26
+ initCallback(): void;
27
+ ctxName: string;
28
+ ctxOwner: boolean;
29
+ }
11
30
 
12
31
  declare class A11y {
13
32
  private _destroyKeyUX;
@@ -26,15 +45,11 @@ declare class LocaleManager {
26
45
  declare class Modal extends LitBlock {
27
46
  static styleAttrs: string[];
28
47
  private _mouseDownTarget;
29
- protected dialogEl: lit_html_directives_ref_js.Ref<HTMLDialogElement>;
30
- handleModalOpen: ModalCb;
31
- handleModalClose: ModalCb;
32
- handleModalCloseAll: ModalCb;
33
- _handleBackdropClick: () => void;
34
- _closeDialog: () => void;
35
- _handleDialogClose: () => void;
36
- _handleDialogMouseDown: (e: MouseEvent) => void;
37
- _handleDialogMouseUp: (e: MouseEvent) => void;
48
+ private _dialogEl;
49
+ private _closeDialog;
50
+ private _handleDialogClose;
51
+ private _handleDialogMouseDown;
52
+ private _handleDialogMouseUp;
38
53
  show(): void;
39
54
  hide(): void;
40
55
  private _handleModalOpen;
@@ -42,12 +57,40 @@ declare class Modal extends LitBlock {
42
57
  private _handleModalCloseAll;
43
58
  initCallback(): void;
44
59
  disconnectedCallback(): void;
45
- private handleDialogRef;
60
+ private _handleDialogRef;
46
61
  render(): lit_html.TemplateResult<1>;
47
62
  }
48
63
 
64
+ type Subscription = {
65
+ remove: () => void;
66
+ };
67
+
68
+ type Uid = string & {
69
+ __uid: true;
70
+ };
71
+
72
+ declare function defineComponents(blockExports: Record<string, any>): void;
73
+
74
+ declare const UC_WINDOW_KEY = "UC";
75
+ type IndexModule = Record<string, any>;
76
+ declare global {
77
+ interface Window {
78
+ [UC_WINDOW_KEY]?: IndexModule;
79
+ }
80
+ }
81
+
49
82
  type LocaleDefinition = Record<string, string>;
50
83
 
84
+ declare class Icon extends LitBlock {
85
+ name: string;
86
+ private _resolvedHref;
87
+ private _iconHrefResolver;
88
+ initCallback(): void;
89
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
90
+ private _updateResolvedHref;
91
+ render(): lit_html.TemplateResult<1>;
92
+ }
93
+
51
94
  declare const InternalEventType: Readonly<{
52
95
  readonly INIT_SOLUTION: "init-solution";
53
96
  readonly CHANGE_CONFIG: "change-config";
@@ -108,8 +151,7 @@ declare class EventEmitter {
108
151
  private _targets;
109
152
  private _debugPrint;
110
153
  constructor(debugPrint: (...args: unknown[]) => void);
111
- bindTarget(target: LitBlock): void;
112
- unbindTarget(target: LitBlock): void;
154
+ bindTarget(target: LitBlock): () => void;
113
155
  private _dispatch;
114
156
  emit<T extends EventKey, TDebounce extends boolean | number | undefined = undefined>(type: T, payload?: TDebounce extends false | undefined ? EventPayload[T] : () => EventPayload[T], options?: {
115
157
  debounce?: TDebounce;
@@ -118,163 +160,18 @@ declare class EventEmitter {
118
160
 
119
161
  declare function buildOutputCollectionState<TCollectionStatus extends OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'>(uploaderBlock: LitUploaderBlock): OutputCollectionState<TCollectionStatus, TGroupFlag>;
120
162
 
121
- type TypedSchema = Record<string, {
122
- type: unknown;
123
- value: unknown;
124
- nullable?: boolean;
125
- }>;
126
- type Constructor<T = any> = new (...args: any[]) => T;
127
- 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;
128
- type ExtractDataFromSchema<T extends TypedSchema> = {
129
- [K in keyof T]: ExtractType<T[K]['type'], T[K]['value']> | (T[K]['nullable'] extends true ? null : never);
130
- };
131
- type ExtractKeysFromSchema<T extends TypedSchema> = Extract<keyof T, string>;
132
- declare class TypedData<T extends TypedSchema> {
133
- private __typedSchema;
134
- private __ctxId;
135
- private __schema;
136
- private __data;
137
- constructor(typedSchema: T, ctxName?: string);
138
- get uid(): string;
139
- setValue<K extends ExtractKeysFromSchema<T>>(prop: K, value: ExtractDataFromSchema<T>[K]): void;
140
- setMultipleValues(updObj: Partial<ExtractDataFromSchema<T>>): void;
141
- getValue<K extends ExtractKeysFromSchema<T>>(prop: K): ExtractDataFromSchema<T>[K];
142
- subscribe<K extends ExtractKeysFromSchema<T>>(prop: K, handler: (newVal: ExtractDataFromSchema<T>[K]) => void): {
143
- remove: () => void;
144
- callback: (val: unknown) => void;
145
- };
163
+ declare class TypedData<T extends Record<string, unknown>> {
164
+ private _ctxId;
165
+ private _data;
166
+ constructor(initialValue: T);
167
+ get uid(): Uid;
168
+ setValue<K extends keyof T>(prop: K, value: T[K]): void;
169
+ setMultipleValues(updObj: Partial<T>): void;
170
+ getValue<K extends keyof T>(prop: K): T[K];
171
+ subscribe<K extends keyof T>(prop: K, handler: (newVal: T[K]) => void): Subscription;
146
172
  remove(): void;
147
173
  }
148
174
 
149
- declare const uploadEntrySchema: Readonly<{
150
- file: Readonly<{
151
- type: {
152
- new (fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;
153
- prototype: File;
154
- };
155
- value: null;
156
- nullable: true;
157
- }>;
158
- externalUrl: Readonly<{
159
- type: StringConstructor;
160
- value: null;
161
- nullable: true;
162
- }>;
163
- fileName: Readonly<{
164
- type: StringConstructor;
165
- value: null;
166
- nullable: true;
167
- }>;
168
- fileSize: Readonly<{
169
- type: NumberConstructor;
170
- value: null;
171
- nullable: true;
172
- }>;
173
- lastModified: Readonly<{
174
- type: NumberConstructor;
175
- value: number;
176
- }>;
177
- uploadProgress: Readonly<{
178
- type: NumberConstructor;
179
- value: 0;
180
- }>;
181
- uuid: Readonly<{
182
- type: StringConstructor;
183
- value: null;
184
- nullable: true;
185
- }>;
186
- isImage: Readonly<{
187
- type: BooleanConstructor;
188
- value: false;
189
- }>;
190
- mimeType: Readonly<{
191
- type: StringConstructor;
192
- value: null;
193
- nullable: true;
194
- }>;
195
- ctxName: Readonly<{
196
- type: StringConstructor;
197
- value: null;
198
- nullable: true;
199
- }>;
200
- cdnUrl: Readonly<{
201
- type: StringConstructor;
202
- value: null;
203
- nullable: true;
204
- }>;
205
- cdnUrlModifiers: Readonly<{
206
- type: StringConstructor;
207
- value: null;
208
- nullable: true;
209
- }>;
210
- fileInfo: Readonly<{
211
- type: typeof UploadcareFile;
212
- value: null;
213
- nullable: true;
214
- }>;
215
- isUploading: Readonly<{
216
- type: BooleanConstructor;
217
- value: false;
218
- }>;
219
- abortController: Readonly<{
220
- type: {
221
- new (): AbortController;
222
- prototype: AbortController;
223
- };
224
- value: null;
225
- nullable: true;
226
- }>;
227
- thumbUrl: Readonly<{
228
- type: StringConstructor;
229
- value: null;
230
- nullable: true;
231
- }>;
232
- silent: Readonly<{
233
- type: BooleanConstructor;
234
- value: false;
235
- }>;
236
- source: Readonly<{
237
- type: StringConstructor;
238
- value: null;
239
- nullable: true;
240
- }>;
241
- fullPath: Readonly<{
242
- type: StringConstructor;
243
- value: null;
244
- nullable: true;
245
- }>;
246
- metadata: Readonly<{
247
- type: ObjectConstructor;
248
- value: null;
249
- nullable: true;
250
- }>;
251
- errors: Readonly<{
252
- type: ArrayConstructor;
253
- value: OutputErrorFile[];
254
- }>;
255
- uploadError: Readonly<{
256
- type: ErrorConstructor;
257
- value: null;
258
- nullable: true;
259
- }>;
260
- isRemoved: Readonly<{
261
- type: BooleanConstructor;
262
- value: false;
263
- }>;
264
- isQueuedForUploading: Readonly<{
265
- type: BooleanConstructor;
266
- value: false;
267
- }>;
268
- isValidationPending: Readonly<{
269
- type: BooleanConstructor;
270
- value: false;
271
- }>;
272
- isQueuedForValidation: Readonly<{
273
- type: BooleanConstructor;
274
- value: false;
275
- }>;
276
- }>;
277
-
278
175
  type FuncFileValidator = (outputEntry: OutputFileEntry, api: UploaderPublicApi, options?: {
279
176
  signal?: AbortSignal;
280
177
  }) => undefined | OutputErrorFile | Promise<undefined | OutputErrorFile>;
@@ -293,9 +190,9 @@ declare class ValidationManager {
293
190
  private _runQueueDebounced;
294
191
  private _entryValidationState;
295
192
  constructor(blockInstance: LitUploaderBlock);
296
- runFileValidators(runOn: FileValidatorDescriptor['runOn'], entryIds?: string[]): void;
193
+ runFileValidators(runOn: FileValidatorDescriptor['runOn'], entryIds?: Uid[]): void;
297
194
  runCollectionValidators(): void;
298
- cleanupValidationForEntry(entry: TypedData<typeof uploadEntrySchema>): void;
195
+ cleanupValidationForEntry(entry: TypedData<UploadEntryData>): void;
299
196
  private _runFileValidatorsForEntry;
300
197
  private _addCustomTypeToValidationError;
301
198
  private _getEntryValidationState;
@@ -305,16 +202,23 @@ declare class ValidationManager {
305
202
 
306
203
  type CameraMode = 'photo' | 'video';
307
204
 
205
+ /**
206
+ * Config keys that can't be passed as attribute (because they are object or function)
207
+ */
208
+ declare const complexConfigKeys: readonly ["metadata", "localeDefinitionOverride", "secureUploadsSignatureResolver", "secureDeliveryProxyUrlResolver", "iconHrefResolver", "fileValidators", "collectionValidators", "mediaRecorderOptions"];
308
209
  /** Mapping of attribute names to state */
309
210
  declare const attrStateMapping: Record<string, string>;
310
211
  declare class Config extends LitBlock {
212
+ attributesMeta: Partial<ConfigPlainType> & {
213
+ 'ctx-name': string;
214
+ };
311
215
  init$: LitBlock["init$"] & ConfigType;
312
- private computationControllers;
216
+ private _computationControllers;
313
217
  private _flushValueToAttribute;
314
218
  private _flushValueToState;
315
219
  private _setValue;
316
220
  private _getValue;
317
- _assertSameValueDifferentReference(key: string, previousValue: unknown, nextValue: unknown): void;
221
+ private _assertSameValueDifferentReference;
318
222
  initCallback(): void;
319
223
  attributeChangedCallback(name: keyof typeof attrStateMapping, oldVal: string, newVal: string): void;
320
224
  static get observedAttributes(): string[];
@@ -396,7 +300,7 @@ declare class UploaderPublicApi {
396
300
  getOutputCollectionState<TStatus extends OutputCollectionStatus>(): ReturnType<typeof buildOutputCollectionState<TStatus>>;
397
301
  initFlow: (force?: boolean) => void;
398
302
  doneFlow: () => void;
399
- setCurrentActivity: <T extends ActivityType>(activityType: T, ...params: T extends keyof ActivityParamsMap ? [ActivityParamsMap[T]] : T extends RegisteredActivityType ? [undefined?] : [any?]) => void;
303
+ setCurrentActivity: <T extends RegisteredActivityType>(activityType: T, ...params: T extends keyof ActivityParamsMap ? [ActivityParamsMap[T]] : T extends RegisteredActivityType ? [undefined?] : [never]) => void;
400
304
  getCurrentActivity: () => ActivityType;
401
305
  setModalState: (opened: boolean) => void;
402
306
  private get _sourceList();
@@ -696,6 +600,8 @@ type ConfigType = {
696
600
  */
697
601
  testMode: boolean;
698
602
  };
603
+ type ConfigComplexType = Pick<ConfigType, (typeof complexConfigKeys)[number]>;
604
+ type ConfigPlainType = Omit<ConfigType, keyof ConfigComplexType>;
699
605
  type OutputFileStatus = 'idle' | 'uploading' | 'success' | 'failed' | 'removed';
700
606
  type OutputCustomErrorType = 'CUSTOM_ERROR';
701
607
  type OutputFileErrorType = OutputCustomErrorType | 'NOT_AN_IMAGE' | 'FORBIDDEN_FILE_TYPE' | 'FILE_SIZE_EXCEEDED' | 'UPLOAD_ERROR' | 'NETWORK_ERROR' | 'UNKNOWN_ERROR';
@@ -707,7 +613,9 @@ type OutputErrorTypePayload = {
707
613
  NOT_AN_IMAGE: OutputFileErrorPayload;
708
614
  FORBIDDEN_FILE_TYPE: OutputFileErrorPayload;
709
615
  FILE_SIZE_EXCEEDED: OutputFileErrorPayload;
710
- SOME_FILES_HAS_ERRORS: {};
616
+ SOME_FILES_HAS_ERRORS: {
617
+ [k: string]: never;
618
+ };
711
619
  TOO_MANY_FILES: {
712
620
  min: number;
713
621
  max: number;
@@ -857,6 +765,45 @@ type OutputCollectionState<TStatus extends OutputCollectionStatus = OutputCollec
857
765
  allEntries: OutputFileEntry[];
858
766
  });
859
767
 
768
+ interface UploadEntryData extends Record<string, unknown> {
769
+ file: File | null;
770
+ externalUrl: string | null;
771
+ fileName: string | null;
772
+ fileSize: number | null;
773
+ lastModified: number;
774
+ uploadProgress: number;
775
+ uuid: string | null;
776
+ isImage: boolean;
777
+ mimeType: string | null;
778
+ ctxName: string | null;
779
+ cdnUrl: string | null;
780
+ cdnUrlModifiers: string | null;
781
+ fileInfo: UploadcareFile | null;
782
+ isUploading: boolean;
783
+ abortController: AbortController | null;
784
+ thumbUrl: string | null;
785
+ silent: boolean;
786
+ source: string | null;
787
+ fullPath: string | null;
788
+ metadata: Metadata | null;
789
+ errors: OutputErrorFile[];
790
+ uploadError: Error | null;
791
+ isRemoved: boolean;
792
+ isQueuedForUploading: boolean;
793
+ isValidationPending: boolean;
794
+ isQueuedForValidation: boolean;
795
+ }
796
+
797
+ type ActivityParams$1 = {
798
+ externalSourceType: string;
799
+ };
800
+
801
+ declare class CloudImageEditor extends CloudImageEditorBlock {
802
+ static styleAttrs: string[];
803
+ constructor();
804
+ initCallback(): void;
805
+ }
806
+
860
807
  declare class SecureUploadsManager {
861
808
  private readonly _block;
862
809
  private _secureToken;
@@ -865,43 +812,42 @@ declare class SecureUploadsManager {
865
812
  getSecureToken(): Promise<SecureUploadsSignatureAndExpire | null>;
866
813
  }
867
814
 
868
- type ChangeMap<T extends TypedSchema> = Record<keyof T, Set<string>>;
869
- type TypedCollectionPropertyObserver<T extends TypedSchema> = (changeMap: ChangeMap<T>) => void;
870
- type TypedCollectionObserverHandler<T extends TypedSchema> = (list: string[], added: Set<TypedData<T>>, removed: Set<TypedData<T>>) => void;
871
- type TypedCollectionOptions<T extends TypedSchema> = {
872
- typedSchema: T;
873
- watchList?: ExtractKeysFromSchema<T>[];
815
+ type ChangeMap<T extends Record<string, unknown>> = Record<keyof T, Set<Uid>>;
816
+ type TypedCollectionPropertyObserver<T extends Record<string, unknown>> = (changeMap: ChangeMap<T>) => void;
817
+ type TypedCollectionObserverHandler<T extends Record<string, unknown>> = (list: Uid[], added: Set<TypedData<T>>, removed: Set<TypedData<T>>) => void;
818
+ type TypedCollectionOptions<T extends Record<string, unknown>> = {
819
+ initialValue: T;
820
+ watchList?: (keyof T)[];
874
821
  handler?: TypedCollectionObserverHandler<T>;
875
- ctxName?: string;
876
822
  };
877
- declare class TypedCollection<T extends TypedSchema> {
878
- private __typedSchema;
879
- private __ctxId;
880
- private __data;
881
- private __watchList;
882
- private __subsMap;
883
- private __propertyObservers;
884
- private __collectionObservers;
885
- private __items;
886
- private __removed;
887
- private __added;
888
- private __observeTimeout?;
889
- private __notifyTimeout?;
890
- private __notifyObservers;
823
+ declare class TypedCollection<T extends Record<string, unknown>> {
824
+ private _ctxId;
825
+ private _data;
826
+ private _watchList;
827
+ private _subsMap;
828
+ private _propertyObservers;
829
+ private _collectionObservers;
830
+ private _items;
831
+ private _removed;
832
+ private _added;
833
+ private _observeTimeout?;
834
+ private _notifyTimeout?;
835
+ private _notifyObservers;
836
+ private _initialValue;
891
837
  constructor(options: TypedCollectionOptions<T>);
892
- notify(): void;
838
+ private _notify;
893
839
  observeCollection(handler: TypedCollectionObserverHandler<T>): () => void;
894
840
  unobserveCollection(handler: TypedCollectionObserverHandler<T>): void;
895
- add(init: Partial<ExtractDataFromSchema<T>>): string;
896
- read(id: string): TypedData<T> | null;
897
- readProp<K extends ExtractKeysFromSchema<T>>(id: string, propName: K): ExtractDataFromSchema<T>[K] | null;
898
- publishProp<K extends ExtractKeysFromSchema<T>>(id: string, propName: K, value: ExtractDataFromSchema<T>[K]): void;
899
- remove(id: string): void;
841
+ add(init: Partial<T>): string;
842
+ read(id: Uid): TypedData<T> | null;
843
+ readProp<K extends keyof T>(id: Uid, propName: K): T[K];
844
+ publishProp<K extends keyof T>(id: Uid, propName: K, value: T[K]): void;
845
+ remove(id: Uid): void;
900
846
  clearAll(): void;
901
847
  observeProperties(handler: TypedCollectionPropertyObserver<T>): () => void;
902
848
  unobserveProperties(handler: TypedCollectionPropertyObserver<T>): void;
903
- findItems(checkFn: (item: TypedData<T>) => boolean): string[];
904
- items(): string[];
849
+ findItems(checkFn: (item: TypedData<T>) => boolean): Uid[];
850
+ items(): Uid[];
905
851
  get size(): number;
906
852
  destroy(): void;
907
853
  }
@@ -910,7 +856,7 @@ declare class LitUploaderBlock extends LitActivityBlock {
910
856
  static extSrcList: Readonly<typeof ExternalUploadSource>;
911
857
  static sourceTypes: Readonly<typeof UploadSource>;
912
858
  protected couldBeCtxOwner: boolean;
913
- private isCtxOwner;
859
+ private _isCtxOwner;
914
860
  private _unobserveCollection?;
915
861
  private _unobserveCollectionProperties?;
916
862
  init$: {
@@ -921,20 +867,19 @@ declare class LitUploaderBlock extends LitActivityBlock {
921
867
  '*collectionState': OutputCollectionState | null;
922
868
  '*groupInfo': _uploadcare_upload_client.UploadcareGroup | null;
923
869
  '*uploadTrigger': Set<string>;
924
- '*secureUploadsManager': SecureUploadsManager | null;
925
870
  '*currentActivity': null;
926
871
  '*currentActivityParams': {};
927
872
  '*history': never[];
928
873
  '*historyBack': null;
929
874
  '*closeModal': () => void;
930
875
  };
931
- private get hasCtxOwner();
876
+ private get _hasCtxOwner();
932
877
  initCallback(): void;
933
878
  protected get validationManager(): ValidationManager;
934
879
  get api(): UploaderPublicApi;
935
880
  getAPI(): UploaderPublicApi;
936
- get uploadCollection(): TypedCollection<typeof uploadEntrySchema>;
937
- destroyCtxCallback(): void;
881
+ get uploadCollection(): TypedCollection<UploadEntryData>;
882
+ get secureUploadsManager(): SecureUploadsManager;
938
883
  disconnectedCallback(): void;
939
884
  connectedCallback(): void;
940
885
  private _initCtxOwner;
@@ -945,8 +890,8 @@ declare class LitUploaderBlock extends LitActivityBlock {
945
890
  private _handleCollectionUpdate;
946
891
  private _handleCollectionPropertiesUpdate;
947
892
  private _flushCommonUploadProgress;
948
- openCloudImageEditor(): void;
949
- private setInitialCrop;
893
+ private _openCloudImageEditor;
894
+ private _setInitialCrop;
950
895
  protected getMetadataFor(entryId: string): Promise<_uploadcare_upload_client.Metadata | undefined>;
951
896
  protected getUploadClientOptions(): Promise<FileFromOptions>;
952
897
  getOutputData(): OutputFileEntry[];
@@ -991,19 +936,16 @@ interface CropAspectRatio {
991
936
  id: string;
992
937
  hasFreeform?: boolean;
993
938
  }
994
-
995
- type ActivityParams$1 = {
996
- internalId: string;
997
- };
939
+ type CropPresetList = CropAspectRatio[];
998
940
 
999
941
  type ActivityParams = {
1000
- externalSourceType: string;
942
+ internalId: string;
1001
943
  };
1002
944
 
1003
945
  declare const ACTIVE_PROP = "___ACTIVITY_IS_ACTIVE___";
1004
946
  type ActivityParamsMap = {
1005
- 'cloud-image-edit': ActivityParams$1;
1006
- external: ActivityParams;
947
+ 'cloud-image-edit': ActivityParams;
948
+ external: ActivityParams$1;
1007
949
  };
1008
950
  declare class LitActivityBlock extends LitBlock {
1009
951
  protected historyTracked: boolean;
@@ -1015,9 +957,7 @@ declare class LitActivityBlock extends LitBlock {
1015
957
  '*historyBack': null;
1016
958
  '*closeModal': () => void;
1017
959
  };
1018
- _debouncedHistoryFlush: (() => void) & {
1019
- cancel: () => void;
1020
- };
960
+ private _debouncedHistoryFlush;
1021
961
  private _deactivate;
1022
962
  private _activate;
1023
963
  initCallback(): void;
@@ -1033,16 +973,15 @@ declare class LitActivityBlock extends LitBlock {
1033
973
  CLOUD_IMG_EDIT: 'cloud-image-edit';
1034
974
  EXTERNAL: 'external';
1035
975
  }>;
1036
- get isActivityActive(): boolean;
976
+ protected get isActivityActive(): boolean;
1037
977
  get couldOpenActivity(): boolean;
1038
978
  /** TODO: remove name argument */
1039
- registerActivity(_name: string, options?: {
979
+ protected registerActivity(_name: string, options?: {
1040
980
  onActivate?: () => void;
1041
981
  onDeactivate?: () => void;
1042
982
  }): void;
1043
- unregisterActivity(): void;
983
+ private _unregisterActivity;
1044
984
  disconnectedCallback(): void;
1045
- get activityKey(): string;
1046
985
  get activityParams(): ActivityParamsMap[keyof ActivityParamsMap];
1047
986
  get initActivity(): string | null;
1048
987
  get doneActivity(): string | null;
@@ -1114,87 +1053,210 @@ type TelemetryEventBody = Partial<Pick<TelemetryState, 'payload' | 'config'>> &
1114
1053
  modalId?: string;
1115
1054
  eventType?: CommonEventType;
1116
1055
  };
1117
- declare class TelemetryManager {
1118
- private readonly _sessionId;
1119
- private readonly _telemetryInstance;
1120
- private readonly _block;
1121
- private _config;
1122
- private _initialized;
1123
- private _lastPayload;
1124
- private readonly _queue;
1125
- constructor(block: LitBlock);
1126
- private _init;
1127
- private _setConfig;
1128
- private _formattingPayload;
1129
- private _excludedEvents;
1056
+ interface ITelemetryManager {
1130
1057
  sendEvent(body: TelemetryEventBody): void;
1131
1058
  sendEventError(error: unknown, context?: string): void;
1132
- /**
1133
- * Method to send telemetry event for Cloud Image Editor.
1134
- */
1135
1059
  sendEventCloudImageEditor(e: MouseEvent, tabId: string, options?: Record<string, unknown>): void;
1136
- /**
1137
- * Deeply compares two objects and returns true if they are equal, false otherwise.
1138
- */
1139
- private _checkObj;
1140
- private get _timestamp();
1141
- private get _solution();
1142
- private get _activity();
1143
- private get _location();
1144
1060
  }
1145
1061
 
1146
- declare const LitBlockBase: typeof LitElement & Constructor$1<{
1062
+ declare const TabId: Readonly<{
1063
+ readonly CROP: "crop";
1064
+ readonly TUNING: "tuning";
1065
+ readonly FILTERS: "filters";
1066
+ }>;
1067
+ type TabIdValue$1 = (typeof TabId)[keyof typeof TabId];
1068
+ declare const ALL_COLOR_OPERATIONS: readonly ["brightness", "exposure", "gamma", "contrast", "saturation", "vibrance", "warmth", "enhance"];
1069
+ type ColorOperation = (typeof ALL_COLOR_OPERATIONS)[number];
1070
+ 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"];
1071
+ type FilterId = (typeof ALL_FILTERS)[number];
1072
+ declare const ALL_CROP_OPERATIONS: readonly ["rotate", "mirror", "flip"];
1073
+ type CropOperation = (typeof ALL_CROP_OPERATIONS)[number];
1074
+ /** KeypointsNumber is the number of keypoints loaded from each side of zero, not total number */
1075
+ declare const COLOR_OPERATIONS_CONFIG: Readonly<{
1076
+ brightness: {
1077
+ zero: number;
1078
+ range: readonly [-100, 100];
1079
+ keypointsNumber: number;
1080
+ };
1081
+ exposure: {
1082
+ zero: number;
1083
+ range: readonly [-500, 500];
1084
+ keypointsNumber: number;
1085
+ };
1086
+ gamma: {
1087
+ zero: number;
1088
+ range: readonly [0, 1000];
1089
+ keypointsNumber: number;
1090
+ };
1091
+ contrast: {
1092
+ zero: number;
1093
+ range: readonly [-100, 500];
1094
+ keypointsNumber: number;
1095
+ };
1096
+ saturation: {
1097
+ zero: number;
1098
+ range: readonly [-100, 500];
1099
+ keypointsNumber: number;
1100
+ };
1101
+ vibrance: {
1102
+ zero: number;
1103
+ range: readonly [-100, 500];
1104
+ keypointsNumber: number;
1105
+ };
1106
+ warmth: {
1107
+ zero: number;
1108
+ range: readonly [-100, 100];
1109
+ keypointsNumber: number;
1110
+ };
1111
+ enhance: {
1112
+ zero: number;
1113
+ range: readonly [0, 100];
1114
+ keypointsNumber: number;
1115
+ };
1116
+ filter: {
1117
+ zero: number;
1118
+ range: readonly [0, 100];
1119
+ keypointsNumber: number;
1120
+ };
1121
+ }>;
1122
+
1123
+ type SharedConfigState = {
1124
+ [K in keyof ConfigType as `*cfg/${K}`]: ConfigType[K];
1125
+ };
1126
+ type BlocksRegistry = Set<LitBlock>;
1127
+ type ActivityBlockCtxState = {
1128
+ '*currentActivity': string | null;
1129
+ '*currentActivityParams': Record<string, unknown>;
1130
+ '*history': (string | null)[];
1131
+ '*historyBack': (() => void) | null;
1132
+ '*closeModal': () => void;
1133
+ };
1134
+ type UploaderBlockCtxState = ActivityBlockCtxState & {
1135
+ '*commonProgress': number;
1136
+ '*uploadList': {
1137
+ uid: Uid;
1138
+ }[];
1139
+ '*uploadQueue': Queue;
1140
+ '*collectionErrors': OutputErrorCollection[];
1141
+ '*collectionState': OutputCollectionState | null;
1142
+ '*groupInfo': UploadcareGroup | null;
1143
+ '*uploadTrigger': Set<Uid>;
1144
+ };
1145
+ type SolutionBlockCtxState = UploaderBlockCtxState & {
1146
+ '*solution': string | null;
1147
+ };
1148
+ type CloudImageEditorState = {
1149
+ '*originalUrl': string | null;
1150
+ '*loadingOperations': LoadingOperations;
1151
+ '*faderEl': EditorImageFader | null;
1152
+ '*cropperEl': EditorImageCropper | null;
1153
+ '*imgEl': HTMLImageElement | null;
1154
+ '*imgContainerEl': HTMLElement | null;
1155
+ '*networkProblems': boolean;
1156
+ '*imageSize': {
1157
+ width: number;
1158
+ height: number;
1159
+ } | null;
1160
+ '*editorTransformations': Transformations;
1161
+ '*cropPresetList': CropPresetList;
1162
+ '*currentAspectRatio': CropAspectRatio | null;
1163
+ '*tabList': readonly TabIdValue$1[];
1164
+ '*tabId': TabIdValue$1;
1165
+ '*on.retryNetwork': () => void;
1166
+ '*on.apply': (transformations: Transformations) => void;
1167
+ '*on.cancel': () => void;
1168
+ };
1169
+ type EditorImageCropperState = {
1170
+ '*padding': number;
1171
+ '*operations': {
1172
+ rotate: number;
1173
+ mirror: boolean;
1174
+ flip: boolean;
1175
+ };
1176
+ '*imageBox': {
1177
+ x: number;
1178
+ y: number;
1179
+ width: number;
1180
+ height: number;
1181
+ };
1182
+ '*cropBox': {
1183
+ x: number;
1184
+ y: number;
1185
+ width: number;
1186
+ height: number;
1187
+ };
1188
+ };
1189
+ type EditorToolbarState = {
1190
+ '*showListAspectRatio': boolean;
1191
+ '*sliderEl': EditorSlider | null;
1192
+ '*showSlider': boolean;
1193
+ '*currentFilter': string;
1194
+ '*currentOperation': string | null;
1195
+ '*operationTooltip': string | null;
1196
+ };
1197
+ type DynamicBlockState = {
1198
+ '*blocksRegistry': BlocksRegistry;
1199
+ '*eventEmitter': EventEmitter;
1200
+ '*localeManager': LocaleManager;
1201
+ '*telemetryManager': ITelemetryManager;
1202
+ '*a11y': A11y;
1203
+ '*modalManager': ModalManager | null;
1204
+ };
1205
+ type DynamicUploaderBlockState = {
1206
+ '*uploadCollection': TypedCollection<UploadEntryData>;
1207
+ '*publicApi': UploaderPublicApi;
1208
+ '*validationManager': ValidationManager;
1209
+ '*secureUploadsManager': SecureUploadsManager;
1210
+ };
1211
+ type LocaleState = {
1212
+ [K in keyof LocaleDefinition as `*l10n/${K}`]: string;
1213
+ };
1214
+ type SharedState = SolutionBlockCtxState & SharedConfigState & CloudImageEditorState & EditorImageCropperState & EditorToolbarState & DynamicBlockState & DynamicUploaderBlockState & LocaleState;
1215
+
1216
+ declare const LitBlockBase: typeof LitElement & Constructor<{
1217
+ willYield: boolean;
1147
1218
  yield(slot: string, defaultContent?: unknown): unknown;
1148
- }> & Constructor$1<{
1219
+ }> & Constructor<{
1149
1220
  getCssData(propName: string, silentCheck?: boolean): string | number | boolean | null | undefined;
1150
- }> & Constructor$1<{
1151
- $: {
1152
- [x: string]: any;
1153
- };
1154
- sub<T = unknown>(key: string, callback: (value: T) => void, init?: boolean): () => void;
1155
- pub(key: string, value: unknown): void;
1156
- set$(obj: {
1157
- [x: string]: any;
1158
- }): void;
1159
- has(key: string): boolean;
1160
- add(key: string, val: unknown, rewrite?: boolean): void;
1161
- add$(obj: {
1162
- [x: string]: any;
1163
- }, rewrite?: boolean): void;
1164
- initCallback(): void;
1165
- sharedCtx: PubSub<Record<string, unknown>>;
1166
- ctxName: string;
1167
- }> & Constructor$1<LitElement> & {
1221
+ }> & Constructor<SymbioteComponent<SharedState>> & Constructor<LitElement> & {
1168
1222
  reg(tagName: string): void;
1169
1223
  };
1170
1224
  declare class LitBlock extends LitBlockBase {
1171
- private __cfgProxy;
1225
+ private _cfgProxy;
1226
+ private _sharedContextInstances;
1172
1227
  static styleAttrs: string[];
1173
1228
  activityType: ActivityType;
1174
1229
  init$: {};
1175
1230
  constructor();
1176
1231
  l10n(str: string, variables?: Record<string, string | number>): string;
1177
- private pluralize;
1232
+ private _pluralize;
1178
1233
  emit(type: Parameters<EventEmitter['emit']>[0], payload?: Parameters<EventEmitter['emit']>[1], options?: Parameters<EventEmitter['emit']>[2]): void;
1179
1234
  hasBlockInCtx(callback: (block: LitBlock) => boolean): boolean;
1180
- setOrAddState(prop: string, newVal: unknown): void;
1181
1235
  connectedCallback(): void;
1182
1236
  initCallback(): void;
1183
1237
  get testId(): string;
1184
- get modalManager(): ModalManager | undefined;
1185
- get telemetryManager(): TelemetryManager | {
1186
- sendEvent: () => void;
1187
- sendEventCloudImageEditor: () => void;
1188
- sendEventError: () => void;
1189
- };
1190
- protected get localeManager(): LocaleManager | null;
1191
- protected get a11y(): A11y | null;
1192
- protected get blocksRegistry(): Set<LitBlock>;
1238
+ get modalManager(): ModalManager | null;
1239
+ get telemetryManager(): ITelemetryManager;
1240
+ get localeManager(): LocaleManager;
1241
+ get a11y(): A11y;
1242
+ get blocksRegistry(): Set<LitBlock>;
1243
+ get eventEmitter(): EventEmitter;
1193
1244
  disconnectedCallback(): void;
1194
1245
  /**
1195
1246
  * Called when the last block is removed from the context. Note that inheritors must run their callback before that.
1196
1247
  */
1197
1248
  protected destroyCtxCallback(): void;
1249
+ /**
1250
+ * Adds a shared context instance if it does not exist yet.
1251
+ * @param key The shared state key.
1252
+ * @param resolver The resolver function that creates the instance.
1253
+ * @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.
1254
+ */
1255
+ protected addSharedContextInstance<TKey extends keyof SharedState>(key: TKey, resolver: () => SharedState[TKey], { persist }?: {
1256
+ persist?: boolean | undefined;
1257
+ }): void;
1258
+ private _destroySharedContextInstances;
1259
+ protected getSharedContextInstance<TKey extends keyof SharedState, TRequired extends boolean = true>(key: TKey, isRequired?: TRequired): TRequired extends true ? NonNullable<SharedState[TKey]> : SharedState[TKey];
1198
1260
  protected proxyUrl(url: string): Promise<string>;
1199
1261
  get cfg(): ConfigType;
1200
1262
  subConfigValue<T extends keyof ConfigType>(key: T, callback: (value: ConfigType[T]) => void): () => void;
@@ -1221,52 +1283,54 @@ declare function initState(fnCtx: CloudImageEditorBlock): {
1221
1283
  };
1222
1284
 
1223
1285
  declare class CloudImageEditorBlock extends LitBlock {
1286
+ attributesMeta: ({
1287
+ uuid: string;
1288
+ } | {
1289
+ 'cdn-url': string;
1290
+ }) & Partial<{
1291
+ tabs: string;
1292
+ 'crop-preset': string;
1293
+ }> & {
1294
+ 'ctx-name': string;
1295
+ };
1224
1296
  ctxOwner: boolean;
1225
1297
  static styleAttrs: string[];
1226
- entry: unknown;
1227
- extension: string | null;
1228
- editorMode: boolean;
1229
- modalCaption: string;
1230
- isImage: boolean;
1231
- msg: string;
1232
- src: string;
1233
- fileType: string;
1234
- showLoader: boolean;
1298
+ private _statusMessage;
1299
+ private _imageSrc;
1300
+ private _fileType;
1301
+ private _showLoader;
1235
1302
  uuid: string | null;
1236
1303
  cdnUrl: string | null;
1237
1304
  cropPreset: string;
1238
1305
  tabs: string | null;
1239
- presenceNetworkProblems: boolean;
1240
- presenceModalCaption: boolean;
1241
- presenceEditorToolbar: boolean;
1242
- presenceViewerToolbar: boolean;
1243
- private isInitialized;
1244
- private pendingInitUpdate;
1306
+ private _hasNetworkProblems;
1307
+ private _isInitialized;
1308
+ private _pendingInitUpdate;
1245
1309
  private readonly _debouncedShowLoader;
1246
- private readonly imgRef;
1247
- private readonly cropperRef;
1248
- private readonly faderRef;
1249
- private readonly imgContainerRef;
1250
- private readonly handleImageLoad;
1251
- private readonly handleImageError;
1252
- private readonly handleRetryNetwork;
1253
- private scheduleInitialization;
1310
+ private readonly _imgRef;
1311
+ private readonly _cropperRef;
1312
+ private readonly _faderRef;
1313
+ private readonly _imgContainerRef;
1314
+ private readonly _handleImageLoad;
1315
+ private readonly _handleImageError;
1316
+ private readonly _handleRetryNetwork;
1317
+ private _scheduleInitialization;
1254
1318
  init$: ReturnType<typeof initState>;
1255
1319
  initCallback(): void;
1256
- private assignSharedElements;
1257
- private attachImageListeners;
1258
- private detachImageListeners;
1259
- private get imageClassName();
1320
+ private _assignSharedElements;
1321
+ private _attachImageListeners;
1322
+ private _detachImageListeners;
1323
+ private get _imageClassName();
1260
1324
  /**
1261
1325
  * To proper work, we need non-zero size the element. So, we'll wait for it.
1262
1326
  */
1263
1327
  private _waitForSize;
1264
- firstUpdated(_changedProperties: Map<PropertyKey, unknown>): void;
1328
+ firstUpdated(changedProperties: PropertyValues<this>): void;
1265
1329
  disconnectedCallback(): void;
1266
1330
  render(): lit_html.TemplateResult<1>;
1267
1331
  protected updated(changedProperties: PropertyValues<this>): void;
1268
- private syncTabListFromProp;
1269
- private syncCropPresetState;
1332
+ private _syncTabListFromProp;
1333
+ private _syncCropPresetState;
1270
1334
  updateImage(): Promise<void>;
1271
1335
  initEditor(): Promise<void>;
1272
1336
  }
@@ -1282,13 +1346,13 @@ declare class CropFrame extends LitBlock {
1282
1346
  private _dragStartCrop?;
1283
1347
  private _frameImage?;
1284
1348
  private _guidesHidden;
1285
- private _dragging;
1286
- private readonly svgRef;
1349
+ private _draggingValue;
1350
+ private readonly _svgRef;
1287
1351
  private _svgReady;
1288
1352
  private _pendingMaskHref;
1289
1353
  private get _svgElement();
1290
- private get dragging();
1291
- private set dragging(value);
1354
+ private get _dragging();
1355
+ private set _dragging(value);
1292
1356
  private _applyGuidesDragState;
1293
1357
  private _shouldThumbBeDisabled;
1294
1358
  private _createBackdrop;
@@ -1314,7 +1378,7 @@ declare class CropFrame extends LitBlock {
1314
1378
  private _render;
1315
1379
  toggleThumbs(visible: boolean): void;
1316
1380
  initCallback(): void;
1317
- protected firstUpdated(_changedProperties: PropertyValues<this>): void;
1381
+ protected firstUpdated(changedProperties: PropertyValues<this>): void;
1318
1382
  private _initializeSvg;
1319
1383
  disconnectedCallback(): void;
1320
1384
  render(): TemplateResult;
@@ -1323,97 +1387,37 @@ declare class CropFrame extends LitBlock {
1323
1387
  declare class EditorButtonControl extends LitBlock {
1324
1388
  active: boolean;
1325
1389
  title: string;
1326
- icon: string;
1327
- titleProp: string;
1390
+ protected icon: string;
1391
+ protected titleProp: string;
1328
1392
  protected get buttonClasses(): Record<string, boolean>;
1329
- private updateHostStateClasses;
1393
+ private _updateHostStateClasses;
1330
1394
  protected onClick(_event: MouseEvent): void;
1331
1395
  connectedCallback(): void;
1332
- protected updated(changedProperties: PropertyValues): void;
1396
+ protected updated(changedProperties: PropertyValues<this>): void;
1333
1397
  render(): lit_html.TemplateResult<1>;
1334
1398
  }
1335
1399
 
1336
1400
  declare class EditorFreeformButtonControl extends EditorButtonControl {
1337
1401
  initCallback(): void;
1338
1402
  onClick(): void;
1339
- private computeTitle;
1403
+ private _computeTitle;
1340
1404
  render(): lit_html.TemplateResult<1>;
1341
1405
  }
1342
1406
  declare class EditorAspectRatioButtonControl extends EditorButtonControl {
1343
- private _aspectRatio?;
1344
- get aspectRatio(): CropAspectRatio | undefined;
1345
- set aspectRatio(value: CropAspectRatio | undefined);
1407
+ private _aspectRatio;
1408
+ get aspectRatio(): CropAspectRatio | null;
1409
+ set aspectRatio(value: CropAspectRatio | null);
1346
1410
  initCallback(): void;
1347
- onClick(): void;
1348
- private updateAspectRatioPresentation;
1349
- private renderIcon;
1411
+ protected onClick(): void;
1412
+ private _updateAspectRatioPresentation;
1413
+ private _renderIcon;
1350
1414
  render(): lit_html.TemplateResult<1>;
1351
1415
  }
1352
1416
 
1353
- declare const TabId: Readonly<{
1354
- readonly CROP: "crop";
1355
- readonly TUNING: "tuning";
1356
- readonly FILTERS: "filters";
1357
- }>;
1358
- declare const ALL_COLOR_OPERATIONS: readonly ["brightness", "exposure", "gamma", "contrast", "saturation", "vibrance", "warmth", "enhance"];
1359
- type ColorOperation = (typeof ALL_COLOR_OPERATIONS)[number];
1360
- 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"];
1361
- type FilterId = (typeof ALL_FILTERS)[number];
1362
- declare const ALL_CROP_OPERATIONS: readonly ["rotate", "mirror", "flip"];
1363
- type CropOperation = (typeof ALL_CROP_OPERATIONS)[number];
1364
- /** KeypointsNumber is the number of keypoints loaded from each side of zero, not total number */
1365
- declare const COLOR_OPERATIONS_CONFIG: Readonly<{
1366
- brightness: {
1367
- zero: number;
1368
- range: readonly [-100, 100];
1369
- keypointsNumber: number;
1370
- };
1371
- exposure: {
1372
- zero: number;
1373
- range: readonly [-500, 500];
1374
- keypointsNumber: number;
1375
- };
1376
- gamma: {
1377
- zero: number;
1378
- range: readonly [0, 1000];
1379
- keypointsNumber: number;
1380
- };
1381
- contrast: {
1382
- zero: number;
1383
- range: readonly [-100, 500];
1384
- keypointsNumber: number;
1385
- };
1386
- saturation: {
1387
- zero: number;
1388
- range: readonly [-100, 500];
1389
- keypointsNumber: number;
1390
- };
1391
- vibrance: {
1392
- zero: number;
1393
- range: readonly [-100, 500];
1394
- keypointsNumber: number;
1395
- };
1396
- warmth: {
1397
- zero: number;
1398
- range: readonly [-100, 100];
1399
- keypointsNumber: number;
1400
- };
1401
- enhance: {
1402
- zero: number;
1403
- range: readonly [0, 100];
1404
- keypointsNumber: number;
1405
- };
1406
- filter: {
1407
- zero: number;
1408
- range: readonly [0, 100];
1409
- keypointsNumber: number;
1410
- };
1411
- }>;
1412
-
1413
1417
  declare class EditorCropButtonControl extends EditorButtonControl {
1414
1418
  operation: CropOperation | undefined;
1415
- protected willUpdate(_changedProperties: PropertyValues): void;
1416
- onClick(e: MouseEvent): void;
1419
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
1420
+ protected onClick(e: MouseEvent): void;
1417
1421
  }
1418
1422
 
1419
1423
  declare class EditorFilterControl extends EditorButtonControl {
@@ -1423,12 +1427,12 @@ declare class EditorFilterControl extends EditorButtonControl {
1423
1427
  private _observer?;
1424
1428
  private _cancelPreload?;
1425
1429
  private _lastPreviewRequestId;
1426
- private previewVisibilityCheckRaf?;
1427
- private previewVisibilityCheckTimeout?;
1428
- private previewImage;
1429
- private previewLoaded;
1430
+ private _previewVisibilityCheckRaf?;
1431
+ private _previewVisibilityCheckTimeout?;
1432
+ private _previewImage;
1433
+ private _previewLoaded;
1430
1434
  isOriginal: boolean;
1431
- iconSize: number;
1435
+ private _iconSize;
1432
1436
  get filter(): string;
1433
1437
  set filter(value: string);
1434
1438
  onClick(e: MouseEvent): void;
@@ -1437,11 +1441,11 @@ declare class EditorFilterControl extends EditorButtonControl {
1437
1441
  initCallback(): void;
1438
1442
  disconnectedCallback(): void;
1439
1443
  protected updated(changedProperties: PropertyValues<this>): void;
1440
- private updateFilterLabels;
1441
- private loadPreview;
1442
- private schedulePreviewVisibilityCheck;
1443
- private clearPreviewVisibilityChecks;
1444
- private get shouldShowPreview();
1444
+ private _updateFilterLabels;
1445
+ private _loadPreview;
1446
+ private _schedulePreviewVisibilityCheck;
1447
+ private _clearPreviewVisibilityChecks;
1448
+ private get _shouldShowPreview();
1445
1449
  render(): lit_html.TemplateResult<1>;
1446
1450
  }
1447
1451
 
@@ -1461,10 +1465,10 @@ declare class EditorImageCropper extends LitBlock {
1461
1465
  private _observer?;
1462
1466
  private _image;
1463
1467
  private _cancelPreload?;
1464
- private readonly canvasRef;
1465
- private readonly frameRef;
1468
+ private readonly _canvasRef;
1469
+ private readonly _frameRef;
1466
1470
  constructor();
1467
- protected firstUpdated(_changedProperties: PropertyValues): void;
1471
+ protected firstUpdated(changedProperties: PropertyValues<this>): void;
1468
1472
  private _syncTransformations;
1469
1473
  private _initCanvas;
1470
1474
  private _alignImage;
@@ -1551,13 +1555,13 @@ declare class EditorOperationControl extends EditorButtonControl {
1551
1555
  private _operation;
1552
1556
  get operation(): ColorOperation | '';
1553
1557
  set operation(value: ColorOperation | '');
1554
- private updateOperationMetadata;
1558
+ private _updateOperationMetadata;
1555
1559
  initCallback(): void;
1556
- onClick(e: MouseEvent): void;
1560
+ protected onClick(e: MouseEvent): void;
1557
1561
  }
1558
1562
 
1559
1563
  declare class EditorScroller extends LitBlock {
1560
- private readonly handleWheel;
1564
+ private readonly _handleWheel;
1561
1565
  connectedCallback(): void;
1562
1566
  disconnectedCallback(): void;
1563
1567
  }
@@ -1566,76 +1570,84 @@ type SliderOperation = ColorOperation | 'filter';
1566
1570
  type SliderFilter = FilterId | typeof FAKE_ORIGINAL_FILTER;
1567
1571
  declare const FAKE_ORIGINAL_FILTER = "original";
1568
1572
  declare class EditorSlider extends LitBlock {
1569
- private state;
1570
- handleInput: (e: CustomEvent<{
1573
+ state: {
1574
+ operation: SliderOperation;
1575
+ filter: SliderFilter | undefined;
1576
+ originalUrl: string;
1577
+ disabled: boolean;
1578
+ min: number;
1579
+ max: number;
1571
1580
  value: number;
1572
- }>) => void;
1581
+ defaultValue: number;
1582
+ zero: number;
1583
+ };
1584
+ private _handleInput;
1573
1585
  setOperation(operation: SliderOperation, filter?: SliderFilter): void;
1574
1586
  private _initializeValues;
1575
1587
  apply(): void;
1576
1588
  cancel(): void;
1577
1589
  initCallback(): void;
1578
- protected updated(changedProperties: Map<PropertyKey, unknown>): void;
1590
+ protected updated(changedProperties: PropertyValues<this>): void;
1579
1591
  render(): lit_html.TemplateResult<1>;
1580
1592
  }
1581
1593
 
1582
1594
  type TabIdValue = (typeof TabId)[keyof typeof TabId];
1583
1595
  declare class EditorToolbar extends LitBlock {
1584
- private showLoader;
1585
- private showMainToolbar;
1586
- private showSubToolbar;
1587
- private showTabToggles;
1588
- private tabList;
1589
- private activeTab;
1590
- private useSliderPanel;
1591
- private tooltipVisible;
1592
- private operationTooltip;
1593
- private tabIndicatorOffset;
1594
- private tabIndicatorWidth;
1595
- private readonly sliderRef;
1596
- private readonly tabIndicatorRef;
1596
+ private _showLoader;
1597
+ showMainToolbar: boolean;
1598
+ showSubToolbar: boolean;
1599
+ private _showTabToggles;
1600
+ tabList: readonly TabIdValue[];
1601
+ activeTab: TabIdValue;
1602
+ private _useSliderPanel;
1603
+ private _tooltipVisible;
1604
+ private _operationTooltip;
1605
+ private _tabIndicatorOffset;
1606
+ private _tabIndicatorWidth;
1607
+ private readonly _sliderRef;
1608
+ private readonly _tabIndicatorRef;
1597
1609
  protected readonly tabToggleRefs: Record<TabIdValue, Ref<HTMLElement>>;
1598
- private readonly handleWindowResize;
1599
- private cropPresets;
1610
+ private readonly _handleWindowResize;
1611
+ private _cropPresets;
1600
1612
  private _cancelPreload?;
1601
1613
  private readonly _debouncedShowLoader;
1602
1614
  private readonly _updateInfoTooltip;
1603
- private readonly subTopToolbarStyles;
1604
- private readonly subBottomToolbarStyles;
1605
- private readonly tabContentStyles;
1606
- private readonly tabToggleStyles;
1607
- private readonly tabTogglesStyles;
1615
+ private readonly _subTopToolbarStyles;
1616
+ private readonly _subBottomToolbarStyles;
1617
+ private readonly _tabContentStyles;
1618
+ private readonly _tabToggleStyles;
1619
+ private readonly _tabTogglesStyles;
1608
1620
  init$: Record<string, unknown>;
1609
1621
  private _onSliderClose;
1610
1622
  private _activateTab;
1611
- private applyTabState;
1623
+ private _applyTabState;
1612
1624
  private _syncTabIndicator;
1613
- private get hasAspectRatioPicker();
1614
- private renderControlsByTab;
1615
- private renderCropTabControls;
1616
- private renderFilterTabControls;
1617
- private renderTuningTabControls;
1618
- private renderControlGroup;
1619
- private renderFreeformControl;
1620
- private renderAspectRatioControl;
1621
- private renderCropOperationControl;
1622
- private renderFilterControl;
1623
- private renderOperationControl;
1624
- private renderAspectRatioList;
1625
+ private get _hasAspectRatioPicker();
1626
+ private _renderControlsByTab;
1627
+ private _renderCropTabControls;
1628
+ private _renderFilterTabControls;
1629
+ private _renderTuningTabControls;
1630
+ private _renderControlGroup;
1631
+ private _renderFreeformControl;
1632
+ private _renderAspectRatioControl;
1633
+ private _renderCropOperationControl;
1634
+ private _renderFilterControl;
1635
+ private _renderOperationControl;
1636
+ private _renderAspectRatioList;
1625
1637
  private _preloadEditedImage;
1626
1638
  initCallback(): void;
1627
1639
  connectedCallback(): void;
1628
- firstUpdated(_changedProperties: PropertyValues): void;
1629
- protected updated(changedProperties: PropertyValues): void;
1640
+ firstUpdated(changedProperties: PropertyValues<this>): void;
1641
+ protected updated(changedProperties: PropertyValues<this>): void;
1630
1642
  disconnectedCallback(): void;
1631
- private assignSharedElements;
1632
- private handleCancel;
1633
- private handleApply;
1634
- private handleApplySlider;
1635
- private handleCancelSlider;
1636
- private handleTabClick;
1637
- private renderTabToggle;
1638
- private renderTabContent;
1643
+ private _assignSharedElements;
1644
+ private readonly _handleCancel;
1645
+ private readonly _handleApply;
1646
+ private readonly _handleApplySlider;
1647
+ private readonly _handleCancelSlider;
1648
+ private readonly _handleTabClick;
1649
+ private _renderTabToggle;
1650
+ private _renderTabContent;
1639
1651
  render(): TemplateResult<1>;
1640
1652
  }
1641
1653
 
@@ -1649,26 +1661,26 @@ declare class BtnUi extends LitBlock {
1649
1661
  ariaRole: string;
1650
1662
  ariaControls: string;
1651
1663
  titleProp: string;
1652
- protected firstUpdated(_changed: PropertyValues<this>): void;
1664
+ protected firstUpdated(changed: PropertyValues<this>): void;
1653
1665
  protected updated(changed: PropertyValues<this>): void;
1654
- private applyReverse;
1655
- private applyThemeClass;
1656
- private get iconClassMap();
1657
- private get computedIconHidden();
1658
- private get computedIconSingle();
1666
+ private _applyReverse;
1667
+ private _applyThemeClass;
1668
+ private get _iconClassMap();
1669
+ private get _computedIconHidden();
1670
+ private get _computedIconSingle();
1659
1671
  render(): lit_html.TemplateResult<1>;
1660
1672
  }
1661
1673
 
1662
1674
  declare class LineLoaderUi extends LitBlock {
1663
1675
  active: boolean;
1664
- private readonly lineRef;
1676
+ private readonly _lineRef;
1665
1677
  private _isAnimating;
1666
- private readonly handleTransitionEndRight;
1667
- protected firstUpdated(_changedProperties: PropertyValues<this>): void;
1678
+ private readonly _handleTransitionEndRight;
1679
+ protected firstUpdated(changedProperties: PropertyValues<this>): void;
1668
1680
  protected updated(changedProperties: PropertyValues<this>): void;
1669
- private start;
1670
- private stop;
1671
- private resetLine;
1681
+ private _start;
1682
+ private _stop;
1683
+ private _resetLine;
1672
1684
  render(): lit_html.TemplateResult<1>;
1673
1685
  }
1674
1686
 
@@ -1683,13 +1695,13 @@ declare class PresenceToggle extends LitBlock {
1683
1695
  private _visibleStyle;
1684
1696
  private _hiddenStyle;
1685
1697
  private _externalTransitions;
1686
- private initialRenderComplete;
1698
+ private _initialRenderComplete;
1687
1699
  set visible(value: boolean);
1688
1700
  get visible(): boolean;
1689
1701
  set styles(styles: PresenceToggleStyle);
1690
1702
  get styles(): PresenceToggleStyle;
1691
1703
  private _handleVisible;
1692
- private dispatchInitialRenderEvent;
1704
+ private _dispatchInitialRenderEvent;
1693
1705
  initCallback(): void;
1694
1706
  }
1695
1707
 
@@ -1698,9 +1710,9 @@ declare class SliderUi extends LitBlock {
1698
1710
  private _thumbSize;
1699
1711
  private _zeroDotEl?;
1700
1712
  private _stepsCount?;
1701
- private readonly inputRef;
1702
- private readonly thumbRef;
1703
- private readonly stepsRef;
1713
+ private readonly _inputRef;
1714
+ private readonly _thumbRef;
1715
+ private readonly _stepsRef;
1704
1716
  disabled: boolean;
1705
1717
  min: number;
1706
1718
  max: number;
@@ -1708,12 +1720,12 @@ declare class SliderUi extends LitBlock {
1708
1720
  zero: number;
1709
1721
  private _currentValue;
1710
1722
  constructor();
1711
- private emitSliderEvent;
1712
- private readonly handleSliderInput;
1713
- private readonly handleSliderChange;
1714
- private readonly handleInputFocus;
1715
- private readonly handleInputBlur;
1716
- protected firstUpdated(changedProperties: Map<PropertyKey, unknown>): void;
1723
+ private _emitSliderEvent;
1724
+ private readonly _handleSliderInput;
1725
+ private readonly _handleSliderChange;
1726
+ private readonly _handleInputFocus;
1727
+ private readonly _handleInputBlur;
1728
+ protected firstUpdated(changedProperties: PropertyValues<this>): void;
1717
1729
  protected willUpdate(changedProperties: PropertyValues<this>): void;
1718
1730
  private _updateValue;
1719
1731
  private _updateZeroDot;
@@ -1725,22 +1737,4 @@ declare class SliderUi extends LitBlock {
1725
1737
  render(): lit_html.TemplateResult<1>;
1726
1738
  }
1727
1739
 
1728
- declare class CloudImageEditor extends CloudImageEditorBlock {
1729
- static styleAttrs: string[];
1730
- constructor();
1731
- initCallback(): void;
1732
- }
1733
-
1734
- declare function defineComponents(blockExports: Record<string, any>): void;
1735
-
1736
- declare class Icon extends LitBlock {
1737
- name: string;
1738
- private resolvedHref;
1739
- private iconHrefResolver;
1740
- initCallback(): void;
1741
- protected willUpdate(changedProperties: PropertyValues<this>): void;
1742
- private updateResolvedHref;
1743
- render(): lit_html.TemplateResult<1>;
1744
- }
1745
-
1746
1740
  export { BtnUi, CloudImageEditor, CloudImageEditorBlock, Config, CropFrame, EditorAspectRatioButtonControl, EditorCropButtonControl, EditorFilterControl, EditorFreeformButtonControl, EditorImageCropper, EditorImageFader, EditorOperationControl, EditorScroller, EditorSlider, EditorToolbar, Icon, LineLoaderUi, PresenceToggle, SliderUi, defineComponents };