@uploadcare/file-uploader 1.25.0-alpha.9 → 1.26.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.
- package/dist/abstract/loadFileUploaderFrom.js +2 -2
- package/dist/env.js +3 -3
- package/dist/index.css +3 -3
- package/dist/index.d.ts +2206 -1890
- package/dist/index.js +5 -5
- package/dist/index.layered.css +3 -3
- package/dist/index.ssr.js +4 -21
- package/dist/locales/file-uploader/ar.js +2 -2
- package/dist/locales/file-uploader/az.js +2 -2
- package/dist/locales/file-uploader/ca.js +2 -2
- package/dist/locales/file-uploader/cs.js +2 -2
- package/dist/locales/file-uploader/da.js +2 -2
- package/dist/locales/file-uploader/de.js +2 -2
- package/dist/locales/file-uploader/el.js +2 -2
- package/dist/locales/file-uploader/en.js +2 -2
- package/dist/locales/file-uploader/es.js +2 -2
- package/dist/locales/file-uploader/et.js +2 -2
- package/dist/locales/file-uploader/fi.js +2 -2
- package/dist/locales/file-uploader/fr.js +2 -2
- package/dist/locales/file-uploader/he.js +2 -2
- package/dist/locales/file-uploader/hy.js +2 -2
- package/dist/locales/file-uploader/is.js +2 -2
- package/dist/locales/file-uploader/it.js +2 -2
- package/dist/locales/file-uploader/ja.js +2 -2
- package/dist/locales/file-uploader/ka.js +2 -2
- package/dist/locales/file-uploader/kk.js +2 -2
- package/dist/locales/file-uploader/ko.js +2 -2
- package/dist/locales/file-uploader/lv.js +2 -2
- package/dist/locales/file-uploader/nb.js +2 -2
- package/dist/locales/file-uploader/nl.js +2 -2
- package/dist/locales/file-uploader/pl.js +2 -2
- package/dist/locales/file-uploader/pt.js +2 -2
- package/dist/locales/file-uploader/ro.js +2 -2
- package/dist/locales/file-uploader/ru.js +2 -2
- package/dist/locales/file-uploader/sk.js +2 -2
- package/dist/locales/file-uploader/sr.js +2 -2
- package/dist/locales/file-uploader/sv.js +2 -2
- package/dist/locales/file-uploader/tr.js +2 -2
- package/dist/locales/file-uploader/uk.js +2 -2
- package/dist/locales/file-uploader/vi.js +2 -2
- package/dist/locales/file-uploader/zh-TW.js +2 -2
- package/dist/locales/file-uploader/zh.js +2 -2
- package/package.json +13 -6
- package/web/file-uploader.iife.min.d.ts +2448 -2002
- package/web/file-uploader.iife.min.js +4 -4
- package/web/file-uploader.iife.min.js.LEGAL.txt +2 -2
- package/web/file-uploader.min.d.ts +2448 -2002
- package/web/file-uploader.min.js +4 -4
- package/web/file-uploader.min.js.LEGAL.txt +2 -2
- package/web/uc-basic.layered.min.css +3 -3
- package/web/uc-basic.min.css +3 -3
- package/web/uc-cloud-image-editor.layered.min.css +3 -3
- package/web/uc-cloud-image-editor.min.css +3 -3
- package/web/uc-cloud-image-editor.min.d.ts +1421 -372
- package/web/uc-cloud-image-editor.min.js +4 -4
- package/web/uc-file-uploader-inline.layered.min.css +3 -3
- package/web/uc-file-uploader-inline.min.css +3 -3
- package/web/uc-file-uploader-inline.min.d.ts +2448 -2002
- package/web/uc-file-uploader-inline.min.js +4 -4
- package/web/uc-file-uploader-inline.min.js.LEGAL.txt +2 -2
- package/web/uc-file-uploader-minimal.layered.min.css +3 -3
- package/web/uc-file-uploader-minimal.min.css +3 -3
- package/web/uc-file-uploader-minimal.min.d.ts +2448 -2002
- package/web/uc-file-uploader-minimal.min.js +4 -4
- package/web/uc-file-uploader-minimal.min.js.LEGAL.txt +2 -2
- package/web/uc-file-uploader-regular.layered.min.css +3 -3
- package/web/uc-file-uploader-regular.min.css +3 -3
- package/web/uc-file-uploader-regular.min.d.ts +2448 -2002
- package/web/uc-file-uploader-regular.min.js +4 -4
- package/web/uc-file-uploader-regular.min.js.LEGAL.txt +2 -2
- package/web/uc-img.min.d.ts +5 -0
- package/web/uc-img.min.js +4 -4
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
|
-
import { PropertyValues, LitElement, TemplateResult } from 'lit';
|
|
2
|
+
import { PropertyValues, nothing, LitElement, TemplateResult } from 'lit';
|
|
3
3
|
import * as lit_html_directives_ref_js from 'lit-html/directives/ref.js';
|
|
4
|
-
import { TelemetryRequest } from '@uploadcare/quality-insights';
|
|
5
4
|
import * as _uploadcare_upload_client from '@uploadcare/upload-client';
|
|
6
|
-
import {
|
|
5
|
+
import { UploadcareFile, Metadata, UploadError, NetworkError, UploadcareGroup, FileFromOptions, Queue } from '@uploadcare/upload-client';
|
|
7
6
|
import { Ref } from 'lit/directives/ref.js';
|
|
7
|
+
import { TelemetryRequest } from '@uploadcare/quality-insights';
|
|
8
|
+
|
|
9
|
+
type Unsubscriber = () => void;
|
|
10
|
+
declare class PubSub<T extends Record<string, unknown>> {
|
|
11
|
+
private static _contexts;
|
|
12
|
+
private _store;
|
|
13
|
+
private _ctxId;
|
|
14
|
+
private constructor();
|
|
15
|
+
get id(): string;
|
|
16
|
+
pub<K extends keyof T>(key: K, value: T[K]): void;
|
|
17
|
+
sub<K extends keyof T>(key: K, callback: (value: T[K]) => void, init?: boolean): Unsubscriber;
|
|
18
|
+
read<K extends keyof T>(key: K): T[K];
|
|
19
|
+
add<K extends keyof T>(key: K, value: T[K], rewrite?: boolean): void;
|
|
20
|
+
has(key: keyof T): boolean;
|
|
21
|
+
get store(): T;
|
|
22
|
+
static registerCtx<T extends Record<string, unknown>>(initialValue: T, ctxId: string): PubSub<T>;
|
|
23
|
+
static deleteCtx(ctxId: string): void;
|
|
24
|
+
static getCtx<T extends Record<string, unknown> = Record<string, unknown>>(ctxId: string): PubSub<T> | null;
|
|
25
|
+
static hasCtx(ctxId: string): boolean;
|
|
26
|
+
}
|
|
8
27
|
|
|
9
28
|
type Constructor<T = unknown> = new (...args: any[]) => T;
|
|
10
29
|
|
|
@@ -25,29 +44,171 @@ declare class SymbioteComponent<TState extends Record<string, unknown> = Record<
|
|
|
25
44
|
[K in keyof T]: K extends keyof TState ? TState[K] : never;
|
|
26
45
|
}>(obj: T, rewrite?: boolean): void;
|
|
27
46
|
initCallback(): void;
|
|
47
|
+
sharedCtx: PubSub<TState>;
|
|
28
48
|
ctxName: string;
|
|
29
49
|
ctxOwner: boolean;
|
|
30
50
|
}
|
|
31
51
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
constructor();
|
|
36
|
-
registerBlock(scope: LitBlock): void;
|
|
37
|
-
destroy(): void;
|
|
38
|
-
}
|
|
52
|
+
type Uid = string & {
|
|
53
|
+
__uid: true;
|
|
54
|
+
};
|
|
39
55
|
|
|
40
|
-
declare
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
56
|
+
declare function defineComponents(blockExports: Record<string, any>): void;
|
|
57
|
+
|
|
58
|
+
declare const UC_WINDOW_KEY = "UC";
|
|
59
|
+
type IndexModule = Record<string, any>;
|
|
60
|
+
declare global {
|
|
61
|
+
interface Window {
|
|
62
|
+
[UC_WINDOW_KEY]?: IndexModule;
|
|
63
|
+
}
|
|
44
64
|
}
|
|
45
65
|
|
|
66
|
+
declare const _default: {
|
|
67
|
+
'locale-id': string;
|
|
68
|
+
'social-source-lang': string;
|
|
69
|
+
'upload-file': string;
|
|
70
|
+
'upload-files': string;
|
|
71
|
+
'choose-file': string;
|
|
72
|
+
'choose-files': string;
|
|
73
|
+
'drop-files-here': string;
|
|
74
|
+
'select-file-source': string;
|
|
75
|
+
selected: string;
|
|
76
|
+
upload: string;
|
|
77
|
+
'add-more': string;
|
|
78
|
+
cancel: string;
|
|
79
|
+
'start-from-cancel': string;
|
|
80
|
+
clear: string;
|
|
81
|
+
'camera-shot': string;
|
|
82
|
+
'upload-url': string;
|
|
83
|
+
'upload-url-placeholder': string;
|
|
84
|
+
'edit-image': string;
|
|
85
|
+
'edit-detail': string;
|
|
86
|
+
back: string;
|
|
87
|
+
done: string;
|
|
88
|
+
ok: string;
|
|
89
|
+
'remove-from-list': string;
|
|
90
|
+
no: string;
|
|
91
|
+
yes: string;
|
|
92
|
+
'confirm-your-action': string;
|
|
93
|
+
'are-you-sure': string;
|
|
94
|
+
'selected-count': string;
|
|
95
|
+
'select-all': string;
|
|
96
|
+
'deselect-all': string;
|
|
97
|
+
'upload-error': string;
|
|
98
|
+
'validation-error': string;
|
|
99
|
+
'no-files': string;
|
|
100
|
+
browse: string;
|
|
101
|
+
'not-uploaded-yet': string;
|
|
102
|
+
file__one: string;
|
|
103
|
+
file__other: string;
|
|
104
|
+
error__one: string;
|
|
105
|
+
error__other: string;
|
|
106
|
+
'header-uploading': string;
|
|
107
|
+
'header-failed': string;
|
|
108
|
+
'header-succeed': string;
|
|
109
|
+
'header-total': string;
|
|
110
|
+
'src-type-local': string;
|
|
111
|
+
'src-type-from-url': string;
|
|
112
|
+
'src-type-camera': string;
|
|
113
|
+
'src-type-mobile-video-camera': string;
|
|
114
|
+
'src-type-mobile-photo-camera': string;
|
|
115
|
+
'src-type-draw': string;
|
|
116
|
+
'src-type-facebook': string;
|
|
117
|
+
'src-type-dropbox': string;
|
|
118
|
+
'src-type-gdrive': string;
|
|
119
|
+
'src-type-ngdrive': string;
|
|
120
|
+
'src-type-gphotos': string;
|
|
121
|
+
'src-type-flickr': string;
|
|
122
|
+
'src-type-vk': string;
|
|
123
|
+
'src-type-evernote': string;
|
|
124
|
+
'src-type-box': string;
|
|
125
|
+
'src-type-onedrive': string;
|
|
126
|
+
'src-type-huddle': string;
|
|
127
|
+
'src-type-other': string;
|
|
128
|
+
'caption-from-url': string;
|
|
129
|
+
'caption-camera': string;
|
|
130
|
+
'caption-draw': string;
|
|
131
|
+
'caption-edit-file': string;
|
|
132
|
+
'file-no-name': string;
|
|
133
|
+
'toggle-fullscreen': string;
|
|
134
|
+
'toggle-guides': string;
|
|
135
|
+
rotate: string;
|
|
136
|
+
'flip-vertical': string;
|
|
137
|
+
'flip-horizontal': string;
|
|
138
|
+
apply: string;
|
|
139
|
+
brightness: string;
|
|
140
|
+
contrast: string;
|
|
141
|
+
saturation: string;
|
|
142
|
+
exposure: string;
|
|
143
|
+
gamma: string;
|
|
144
|
+
vibrance: string;
|
|
145
|
+
warmth: string;
|
|
146
|
+
enhance: string;
|
|
147
|
+
original: string;
|
|
148
|
+
resize: string;
|
|
149
|
+
crop: string;
|
|
150
|
+
'select-color': string;
|
|
151
|
+
text: string;
|
|
152
|
+
draw: string;
|
|
153
|
+
'cancel-edit': string;
|
|
154
|
+
'tab-view': string;
|
|
155
|
+
'tab-details': string;
|
|
156
|
+
'file-name': string;
|
|
157
|
+
'file-size': string;
|
|
158
|
+
'cdn-url': string;
|
|
159
|
+
'file-size-unknown': string;
|
|
160
|
+
'camera-permissions-denied': string;
|
|
161
|
+
'camera-permissions-prompt': string;
|
|
162
|
+
'camera-permissions-request': string;
|
|
163
|
+
'files-count-limit-error-title': string;
|
|
164
|
+
'files-count-limit-error-too-few': string;
|
|
165
|
+
'files-count-limit-error-too-many': string;
|
|
166
|
+
'files-max-size-limit-error': string;
|
|
167
|
+
'has-validation-errors': string;
|
|
168
|
+
'images-only-accepted': string;
|
|
169
|
+
'file-type-not-allowed': string;
|
|
170
|
+
'some-files-were-not-uploaded': string;
|
|
171
|
+
'file-item-edit-button': string;
|
|
172
|
+
'file-item-remove-button': string;
|
|
173
|
+
'a11y-editor-tab-filters': string;
|
|
174
|
+
'a11y-editor-tab-tuning': string;
|
|
175
|
+
'a11y-editor-tab-crop': string;
|
|
176
|
+
'a11y-activity-header-button-close': string;
|
|
177
|
+
flip: string;
|
|
178
|
+
mirror: string;
|
|
179
|
+
'a11y-cloud-editor-apply-filter': string;
|
|
180
|
+
'a11y-cloud-editor-apply-crop': string;
|
|
181
|
+
'a11y-cloud-editor-apply-tuning': string;
|
|
182
|
+
'a11y-cloud-editor-apply-aspect-ratio': string;
|
|
183
|
+
finished: string;
|
|
184
|
+
failed: string;
|
|
185
|
+
uploading: string;
|
|
186
|
+
idle: string;
|
|
187
|
+
'a11y-file-item-status': string;
|
|
188
|
+
'waiting-for': string;
|
|
189
|
+
'queued-uploading': string;
|
|
190
|
+
'queued-validation': string;
|
|
191
|
+
validation: string;
|
|
192
|
+
'crop-to-shape': string;
|
|
193
|
+
custom: string;
|
|
194
|
+
'freeform-crop': string;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
type LocaleDefinition = typeof _default;
|
|
198
|
+
|
|
46
199
|
declare class Modal extends LitBlock {
|
|
47
200
|
static styleAttrs: string[];
|
|
48
201
|
private _mouseDownTarget;
|
|
49
202
|
/** WARNING: Do not rename/change this, it's used in dashboard */
|
|
50
203
|
protected dialogEl: lit_html_directives_ref_js.Ref<HTMLDialogElement>;
|
|
204
|
+
/**
|
|
205
|
+
* CSS-only attribute
|
|
206
|
+
*/
|
|
207
|
+
strokes: boolean;
|
|
208
|
+
/**
|
|
209
|
+
* CSS-only attribute
|
|
210
|
+
*/
|
|
211
|
+
blockBodyScrolling: boolean;
|
|
51
212
|
/** WARNING: Do not rename/change this, it's used in dashboard */
|
|
52
213
|
protected closeDialog: () => void;
|
|
53
214
|
private _handleDialogClose;
|
|
@@ -63,37 +224,12 @@ declare class Modal extends LitBlock {
|
|
|
63
224
|
private _handleDialogRef;
|
|
64
225
|
render(): lit_html.TemplateResult<1>;
|
|
65
226
|
}
|
|
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
227
|
declare global {
|
|
80
|
-
interface
|
|
81
|
-
|
|
228
|
+
interface HTMLElementTagNameMap {
|
|
229
|
+
'uc-modal': Modal;
|
|
82
230
|
}
|
|
83
231
|
}
|
|
84
232
|
|
|
85
|
-
type LocaleDefinition = Record<string, string>;
|
|
86
|
-
|
|
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
|
-
}
|
|
96
|
-
|
|
97
233
|
declare const InternalEventType: Readonly<{
|
|
98
234
|
readonly INIT_SOLUTION: "init-solution";
|
|
99
235
|
readonly CHANGE_CONFIG: "change-config";
|
|
@@ -140,7 +276,7 @@ type EventPayload = {
|
|
|
140
276
|
[EventType.ACTIVITY_CHANGE]: {
|
|
141
277
|
activity: ActivityType;
|
|
142
278
|
};
|
|
143
|
-
[EventType.UPLOAD_CLICK]:
|
|
279
|
+
[EventType.UPLOAD_CLICK]: undefined;
|
|
144
280
|
[EventType.DONE_CLICK]: OutputCollectionState;
|
|
145
281
|
[EventType.COMMON_UPLOAD_START]: OutputCollectionState<'uploading'>;
|
|
146
282
|
[EventType.COMMON_UPLOAD_PROGRESS]: OutputCollectionState<'uploading'>;
|
|
@@ -149,61 +285,176 @@ type EventPayload = {
|
|
|
149
285
|
[EventType.CHANGE]: OutputCollectionState;
|
|
150
286
|
[EventType.GROUP_CREATED]: OutputCollectionState<'success', 'has-group'>;
|
|
151
287
|
};
|
|
152
|
-
declare class EventEmitter {
|
|
288
|
+
declare class EventEmitter extends SharedInstance {
|
|
153
289
|
private _timeoutStore;
|
|
154
290
|
private _targets;
|
|
155
|
-
private _debugPrint;
|
|
156
|
-
constructor(debugPrint: (...args: unknown[]) => void);
|
|
157
291
|
bindTarget(target: LitBlock): () => void;
|
|
158
292
|
private _dispatch;
|
|
159
293
|
emit<T extends EventKey, TDebounce extends boolean | number | undefined = undefined>(type: T, payload?: TDebounce extends false | undefined ? EventPayload[T] : () => EventPayload[T], options?: {
|
|
160
294
|
debounce?: TDebounce;
|
|
161
295
|
}): void;
|
|
296
|
+
destroy(): void;
|
|
162
297
|
}
|
|
163
298
|
|
|
164
|
-
declare
|
|
299
|
+
declare class ActivityHeader extends LitActivityBlock {
|
|
300
|
+
}
|
|
301
|
+
declare global {
|
|
302
|
+
interface HTMLElementTagNameMap {
|
|
303
|
+
'uc-activity-header': ActivityHeader;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
165
306
|
|
|
166
|
-
declare class
|
|
167
|
-
|
|
168
|
-
private
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
307
|
+
declare class Icon extends LitBlock {
|
|
308
|
+
name: string;
|
|
309
|
+
private _resolvedHref;
|
|
310
|
+
private _iconHrefResolver;
|
|
311
|
+
initCallback(): void;
|
|
312
|
+
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
313
|
+
private _updateResolvedHref;
|
|
314
|
+
render(): lit_html.TemplateResult<1>;
|
|
315
|
+
}
|
|
316
|
+
declare global {
|
|
317
|
+
interface HTMLElementTagNameMap {
|
|
318
|
+
'uc-icon': Icon;
|
|
319
|
+
}
|
|
176
320
|
}
|
|
177
321
|
|
|
178
|
-
type
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
type FileValidatorDescriptor = {
|
|
182
|
-
runOn: 'add' | 'upload' | 'change';
|
|
183
|
-
validator: FuncFileValidator;
|
|
322
|
+
type SelectOption = {
|
|
323
|
+
text: string;
|
|
324
|
+
value: string;
|
|
184
325
|
};
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
private
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
runFileValidators(runOn: FileValidatorDescriptor['runOn'], entryIds?: Uid[]): void;
|
|
197
|
-
runCollectionValidators(): void;
|
|
198
|
-
cleanupValidationForEntry(entry: TypedData<UploadEntryData>): void;
|
|
199
|
-
private _runFileValidatorsForEntry;
|
|
200
|
-
private _addCustomTypeToValidationError;
|
|
201
|
-
private _getEntryValidationState;
|
|
202
|
-
private _getValidatorDescriptors;
|
|
203
|
-
private _getValidatorDescriptorsForEntry;
|
|
326
|
+
declare class Select extends LitBlock {
|
|
327
|
+
value: string;
|
|
328
|
+
disabled: boolean;
|
|
329
|
+
options: SelectOption[];
|
|
330
|
+
render(): lit_html.TemplateResult<1>;
|
|
331
|
+
private _handleChange;
|
|
332
|
+
}
|
|
333
|
+
declare global {
|
|
334
|
+
interface HTMLElementTagNameMap {
|
|
335
|
+
'uc-select': Select;
|
|
336
|
+
}
|
|
204
337
|
}
|
|
205
338
|
|
|
206
339
|
type CameraMode = 'photo' | 'video';
|
|
340
|
+
declare class CameraSource extends LitUploaderBlock {
|
|
341
|
+
couldBeCtxOwner: boolean;
|
|
342
|
+
activityType: "camera";
|
|
343
|
+
private _unsubPermissions;
|
|
344
|
+
private _capturing;
|
|
345
|
+
private _chunks;
|
|
346
|
+
private _mediaRecorder;
|
|
347
|
+
private _stream;
|
|
348
|
+
private _selectedAudioId;
|
|
349
|
+
private _selectedCameraId;
|
|
350
|
+
private _activeTab;
|
|
351
|
+
private _options;
|
|
352
|
+
private _canvas;
|
|
353
|
+
private _ctx;
|
|
354
|
+
private _cameraDevices;
|
|
355
|
+
private _audioDevices;
|
|
356
|
+
private _permissionResponses;
|
|
357
|
+
private _permissionCleanupFns;
|
|
358
|
+
private _currentVideoSource;
|
|
359
|
+
private readonly _handlePreviewPlay;
|
|
360
|
+
private readonly _handlePreviewPause;
|
|
361
|
+
private _timerRef;
|
|
362
|
+
private _lineRef;
|
|
363
|
+
private _videoRef;
|
|
364
|
+
private _switcherRef;
|
|
365
|
+
private _startTime;
|
|
366
|
+
private _elapsedTime;
|
|
367
|
+
private _videoTransformCss;
|
|
368
|
+
private _videoHidden;
|
|
369
|
+
private _messageHidden;
|
|
370
|
+
private _requestBtnHidden;
|
|
371
|
+
private _cameraSelectOptions;
|
|
372
|
+
private _cameraSelectHidden;
|
|
373
|
+
private _l10nMessage;
|
|
374
|
+
private _timerHidden;
|
|
375
|
+
private _cameraHidden;
|
|
376
|
+
private _cameraActionsHidden;
|
|
377
|
+
private _audioSelectOptions;
|
|
378
|
+
private _audioSelectHidden;
|
|
379
|
+
private _audioSelectDisabled;
|
|
380
|
+
private _audioToggleMicrophoneHidden;
|
|
381
|
+
private _tabCameraHidden;
|
|
382
|
+
private _tabVideoHidden;
|
|
383
|
+
private _currentIcon;
|
|
384
|
+
private _currentTimelineIcon;
|
|
385
|
+
private _toggleMicrophoneIcon;
|
|
386
|
+
private _mutableClassButton;
|
|
387
|
+
private _chooseActionWithCamera;
|
|
388
|
+
private _handleCameraSelectChange;
|
|
389
|
+
private _handleAudioSelectChange;
|
|
390
|
+
private _handleRequestPermissions;
|
|
391
|
+
private _handleStartCamera;
|
|
392
|
+
private _handleToggleRecording;
|
|
393
|
+
private _handleToggleAudio;
|
|
394
|
+
private _handleRetake;
|
|
395
|
+
private _handleAccept;
|
|
396
|
+
private _handleClickTab;
|
|
397
|
+
private _updateTimer;
|
|
398
|
+
private _startTimer;
|
|
399
|
+
private _stopTimer;
|
|
400
|
+
private _startTimeline;
|
|
401
|
+
private _stopTimeline;
|
|
402
|
+
private _animationFrameId;
|
|
403
|
+
private _startRecording;
|
|
404
|
+
private _stopRecording;
|
|
405
|
+
/** This method is used to toggle recording pause/resume */
|
|
406
|
+
private _toggleRecording;
|
|
407
|
+
private _toggleEnableAudio;
|
|
408
|
+
/**
|
|
409
|
+
* Previewing the video that was recorded on the camera
|
|
410
|
+
*/
|
|
411
|
+
private _previewVideo;
|
|
412
|
+
private _attachPreviewListeners;
|
|
413
|
+
private _detachPreviewListeners;
|
|
414
|
+
private _setVideoSource;
|
|
415
|
+
/**
|
|
416
|
+
* Do not bind srcObject directly in the template, because it stops video pausing on shot.
|
|
417
|
+
* I really don'y know why but that's how it is. Assigning srcObject manually fixes the issue.
|
|
418
|
+
*/
|
|
419
|
+
private _applyVideoSource;
|
|
420
|
+
private _retake;
|
|
421
|
+
private _accept;
|
|
422
|
+
private _handlePhoto;
|
|
423
|
+
private _handleVideo;
|
|
424
|
+
private _setCameraState;
|
|
425
|
+
private _shot;
|
|
426
|
+
private _handleActiveTab;
|
|
427
|
+
private _createFile;
|
|
428
|
+
private _guessExtensionByMime;
|
|
429
|
+
/**
|
|
430
|
+
* The send file to the server
|
|
431
|
+
*/
|
|
432
|
+
private _toSend;
|
|
433
|
+
private get _cameraModes();
|
|
434
|
+
private _setPermissionsState;
|
|
435
|
+
private _makeStreamInactive;
|
|
436
|
+
private _stopCapture;
|
|
437
|
+
private _capture;
|
|
438
|
+
private _handlePermissionsChange;
|
|
439
|
+
private _permissionAccess;
|
|
440
|
+
private _teardownPermissionListeners;
|
|
441
|
+
private _requestDeviceAccess;
|
|
442
|
+
private _getDevices;
|
|
443
|
+
private _onActivate;
|
|
444
|
+
private _onDeactivate;
|
|
445
|
+
private _handleCameraModes;
|
|
446
|
+
initCallback(): void;
|
|
447
|
+
firstUpdated(changedProperties: PropertyValues<this>): void;
|
|
448
|
+
updated(changedProperties: PropertyValues<this>): void;
|
|
449
|
+
private _destroy;
|
|
450
|
+
disconnectedCallback(): void;
|
|
451
|
+
render(): lit_html.TemplateResult<1>;
|
|
452
|
+
}
|
|
453
|
+
declare global {
|
|
454
|
+
interface HTMLElementTagNameMap {
|
|
455
|
+
'uc-camera-source': CameraSource;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
207
458
|
|
|
208
459
|
/**
|
|
209
460
|
* Config keys that can't be passed as attribute (because they are object or function)
|
|
@@ -228,8 +479,238 @@ declare class Config extends LitBlock {
|
|
|
228
479
|
}
|
|
229
480
|
interface Config extends ConfigType {
|
|
230
481
|
}
|
|
482
|
+
declare global {
|
|
483
|
+
interface HTMLElementTagNameMap {
|
|
484
|
+
'uc-config': Config;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
declare class TypedData<T extends Record<string, unknown>> {
|
|
489
|
+
private _ctxId;
|
|
490
|
+
private _data;
|
|
491
|
+
constructor(initialValue: T);
|
|
492
|
+
get uid(): Uid;
|
|
493
|
+
setValue<K extends keyof T>(prop: K, value: T[K]): void;
|
|
494
|
+
setMultipleValues(updObj: Partial<T>): void;
|
|
495
|
+
getValue<K extends keyof T>(prop: K): T[K];
|
|
496
|
+
subscribe<K extends keyof T>(prop: K, handler: (newVal: T[K]) => void): Unsubscriber;
|
|
497
|
+
destroy(): void;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
interface UploadEntryData extends Record<string, unknown> {
|
|
501
|
+
file: File | null;
|
|
502
|
+
externalUrl: string | null;
|
|
503
|
+
fileName: string | null;
|
|
504
|
+
fileSize: number | null;
|
|
505
|
+
lastModified: number;
|
|
506
|
+
uploadProgress: number;
|
|
507
|
+
uuid: string | null;
|
|
508
|
+
isImage: boolean;
|
|
509
|
+
mimeType: string | null;
|
|
510
|
+
ctxName: string | null;
|
|
511
|
+
cdnUrl: string | null;
|
|
512
|
+
cdnUrlModifiers: string | null;
|
|
513
|
+
fileInfo: UploadcareFile | null;
|
|
514
|
+
isUploading: boolean;
|
|
515
|
+
abortController: AbortController | null;
|
|
516
|
+
thumbUrl: string | null;
|
|
517
|
+
silent: boolean;
|
|
518
|
+
source: string | null;
|
|
519
|
+
fullPath: string | null;
|
|
520
|
+
metadata: Metadata | null;
|
|
521
|
+
errors: OutputErrorFile[];
|
|
522
|
+
uploadError: Error | null;
|
|
523
|
+
isRemoved: boolean;
|
|
524
|
+
isQueuedForUploading: boolean;
|
|
525
|
+
isValidationPending: boolean;
|
|
526
|
+
isQueuedForValidation: boolean;
|
|
527
|
+
}
|
|
528
|
+
type UploadEntryTypedData = TypedData<UploadEntryData>;
|
|
529
|
+
type UploadEntryKeys = keyof UploadEntryData;
|
|
530
|
+
|
|
531
|
+
declare class FileItemConfig extends LitUploaderBlock {
|
|
532
|
+
private _entrySubs;
|
|
533
|
+
protected entry: UploadEntryTypedData | null;
|
|
534
|
+
protected withEntry<A extends unknown[], R>(fn: (entry: UploadEntryTypedData, ...args: A) => R): (...args: A) => R | undefined;
|
|
535
|
+
protected subEntry<K extends UploadEntryKeys>(prop: K, handler: (value: UploadEntryData[K]) => void): void;
|
|
536
|
+
protected reset(): void;
|
|
537
|
+
disconnectedCallback(): void;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
declare class Thumb extends FileItemConfig {
|
|
541
|
+
badgeIcon: string;
|
|
542
|
+
uid: Uid;
|
|
543
|
+
private _thumbUrl;
|
|
544
|
+
private _renderedGridOnce;
|
|
545
|
+
private _thumbRect;
|
|
546
|
+
private _isIntersecting;
|
|
547
|
+
private _firstViewMode;
|
|
548
|
+
private _observer?;
|
|
549
|
+
private _pendingThumbUpdate?;
|
|
550
|
+
private _calculateThumbSize;
|
|
551
|
+
private _generateThumbnail;
|
|
552
|
+
private _debouncedGenerateThumb;
|
|
553
|
+
private _decodeImage;
|
|
554
|
+
private _cancelPendingThumbUpdate;
|
|
555
|
+
private _scheduleThumbUpdate;
|
|
556
|
+
private _requestThumbGeneration;
|
|
557
|
+
protected firstUpdated(changedProperties: PropertyValues<this>): void;
|
|
558
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
559
|
+
private _observerCallback;
|
|
560
|
+
protected reset(): void;
|
|
561
|
+
private _bindToEntry;
|
|
562
|
+
initCallback(): void;
|
|
563
|
+
connectedCallback(): void;
|
|
564
|
+
disconnectedCallback(): void;
|
|
565
|
+
render(): lit_html.TemplateResult<1>;
|
|
566
|
+
}
|
|
567
|
+
declare global {
|
|
568
|
+
interface HTMLElementTagNameMap {
|
|
569
|
+
'uc-thumb': Thumb;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
declare class ProgressBar extends LitBlock {
|
|
574
|
+
hasFileName: boolean;
|
|
575
|
+
value: number;
|
|
576
|
+
visible: boolean;
|
|
577
|
+
private _progressValue;
|
|
578
|
+
private readonly _fakeProgressLineRef;
|
|
579
|
+
private readonly _handleFakeProgressAnimation;
|
|
580
|
+
protected firstUpdated(changedProperties: PropertyValues<this>): void;
|
|
581
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
582
|
+
disconnectedCallback(): void;
|
|
583
|
+
private _normalizeProgressValue;
|
|
584
|
+
private _updateProgressValueStyle;
|
|
585
|
+
render(): lit_html.TemplateResult<1>;
|
|
586
|
+
}
|
|
587
|
+
declare global {
|
|
588
|
+
interface HTMLElementTagNameMap {
|
|
589
|
+
'uc-progress-bar': ProgressBar;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
declare class FileItem extends FileItemConfig {
|
|
594
|
+
protected couldBeCtxOwner: boolean;
|
|
595
|
+
private _pauseRender;
|
|
596
|
+
uid: Uid;
|
|
597
|
+
private _itemName;
|
|
598
|
+
private _errorText;
|
|
599
|
+
private _hint;
|
|
600
|
+
private _progressValue;
|
|
601
|
+
private _progressVisible;
|
|
602
|
+
private _badgeIcon;
|
|
603
|
+
private _isFinished;
|
|
604
|
+
private _isFailed;
|
|
605
|
+
private _isUploading;
|
|
606
|
+
private _isFocused;
|
|
607
|
+
private _isEditable;
|
|
608
|
+
private _showFileNames;
|
|
609
|
+
private _ariaLabelStatusFile;
|
|
610
|
+
private _renderedOnce;
|
|
611
|
+
private _observer?;
|
|
612
|
+
private _handleEdit;
|
|
613
|
+
private _handleRemove;
|
|
614
|
+
private _handleUploadClick;
|
|
615
|
+
private _calculateState;
|
|
616
|
+
private _debouncedCalculateState;
|
|
617
|
+
private _updateHintAndProgress;
|
|
618
|
+
private _handleState;
|
|
619
|
+
protected reset(): void;
|
|
620
|
+
private _observerCallback;
|
|
621
|
+
private _handleEntryId;
|
|
622
|
+
private _updateShowFileNames;
|
|
623
|
+
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
624
|
+
initCallback(): void;
|
|
625
|
+
connectedCallback(): void;
|
|
626
|
+
disconnectedCallback(): void;
|
|
627
|
+
private _upload;
|
|
628
|
+
static activeInstances: Set<FileItem>;
|
|
629
|
+
protected shouldUpdate(changedProperties: PropertyValues<this>): boolean;
|
|
630
|
+
render(): lit_html.TemplateResult<1>;
|
|
631
|
+
}
|
|
632
|
+
declare global {
|
|
633
|
+
interface HTMLElementTagNameMap {
|
|
634
|
+
'uc-file-item': FileItem;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
declare class DropArea extends LitUploaderBlock {
|
|
639
|
+
static styleAttrs: string[];
|
|
640
|
+
/**
|
|
641
|
+
* CSS-only attribute
|
|
642
|
+
*/
|
|
643
|
+
single: boolean;
|
|
644
|
+
/**
|
|
645
|
+
* CSS-only attribute
|
|
646
|
+
*/
|
|
647
|
+
ghost: boolean;
|
|
648
|
+
disabled: boolean;
|
|
649
|
+
clickable: boolean;
|
|
650
|
+
withIcon: boolean;
|
|
651
|
+
fullscreen: boolean;
|
|
652
|
+
initflow: boolean;
|
|
653
|
+
text?: string;
|
|
654
|
+
private _isEnabled;
|
|
655
|
+
private _isVisible;
|
|
656
|
+
private get _localizedText();
|
|
657
|
+
private _destroyDropzone;
|
|
658
|
+
private _destroyContentWrapperDropzone;
|
|
659
|
+
private _contentWrapperRef;
|
|
660
|
+
private readonly _handleAreaInteraction;
|
|
661
|
+
private _sourceListAllowsLocal;
|
|
662
|
+
private _clickableListenersAttached;
|
|
663
|
+
isActive(): boolean;
|
|
664
|
+
initCallback(): void;
|
|
665
|
+
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
666
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
667
|
+
/** Ignore drop events if there are other visible drop areas on the page. */
|
|
668
|
+
private _shouldIgnore;
|
|
669
|
+
private _couldHandleFiles;
|
|
670
|
+
private _updateIsEnabled;
|
|
671
|
+
private _updateVisibility;
|
|
672
|
+
private _updateDragStateAttribute;
|
|
673
|
+
private _updateClickableListeners;
|
|
674
|
+
disconnectedCallback(): void;
|
|
675
|
+
render(): lit_html.TemplateResult<1>;
|
|
676
|
+
}
|
|
677
|
+
declare global {
|
|
678
|
+
interface HTMLElementTagNameMap {
|
|
679
|
+
'uc-drop-area': DropArea;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
231
682
|
|
|
232
683
|
type FilesViewMode = 'grid' | 'list';
|
|
684
|
+
declare class UploadList extends LitUploaderBlock {
|
|
685
|
+
couldBeCtxOwner: boolean;
|
|
686
|
+
protected historyTracked: boolean;
|
|
687
|
+
activityType: "upload-list";
|
|
688
|
+
private _doneBtnVisible;
|
|
689
|
+
private _doneBtnEnabled;
|
|
690
|
+
private _uploadBtnVisible;
|
|
691
|
+
private _addMoreBtnVisible;
|
|
692
|
+
private _addMoreBtnEnabled;
|
|
693
|
+
private _commonErrorMessage;
|
|
694
|
+
private _hasFiles;
|
|
695
|
+
private _latestSummary;
|
|
696
|
+
private get _headerText();
|
|
697
|
+
private _handleAdd;
|
|
698
|
+
private _handleUpload;
|
|
699
|
+
private _handleDone;
|
|
700
|
+
private _handleCancel;
|
|
701
|
+
private _throttledHandleCollectionUpdate;
|
|
702
|
+
private _updateUploadsState;
|
|
703
|
+
private _getHeaderText;
|
|
704
|
+
get couldOpenActivity(): boolean;
|
|
705
|
+
initCallback(): void;
|
|
706
|
+
disconnectedCallback(): void;
|
|
707
|
+
render(): lit_html.TemplateResult<1>;
|
|
708
|
+
}
|
|
709
|
+
declare global {
|
|
710
|
+
interface HTMLElementTagNameMap {
|
|
711
|
+
'uc-upload-list': UploadList;
|
|
712
|
+
}
|
|
713
|
+
}
|
|
233
714
|
|
|
234
715
|
declare const ExternalUploadSource: Readonly<{
|
|
235
716
|
readonly FACEBOOK: "facebook";
|
|
@@ -317,16 +798,17 @@ declare const CameraSourceTypes: Readonly<{
|
|
|
317
798
|
}>;
|
|
318
799
|
type ModeCameraType = (typeof CameraSourceTypes)[keyof typeof CameraSourceTypes];
|
|
319
800
|
|
|
801
|
+
declare function buildOutputCollectionState<TCollectionStatus extends OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'>(bag: SharedInstancesBag): OutputCollectionState<TCollectionStatus, TGroupFlag>;
|
|
802
|
+
|
|
320
803
|
type ApiAddFileCommonOptions = {
|
|
321
804
|
silent?: boolean;
|
|
322
805
|
fileName?: string;
|
|
323
806
|
source?: string;
|
|
324
807
|
};
|
|
325
|
-
declare class UploaderPublicApi {
|
|
326
|
-
private
|
|
327
|
-
constructor(ctx: LitUploaderBlock);
|
|
808
|
+
declare class UploaderPublicApi extends SharedInstance {
|
|
809
|
+
private _l10n;
|
|
328
810
|
get _uploadCollection(): TypedCollection<UploadEntryData>;
|
|
329
|
-
get cfg(): ConfigType
|
|
811
|
+
get cfg(): Readonly<ConfigType>;
|
|
330
812
|
get l10n(): (str: string, variables?: Record<string, string | number>) => string;
|
|
331
813
|
/**
|
|
332
814
|
* TODO: Probably we should not allow user to override `source` property
|
|
@@ -355,7 +837,7 @@ declare class UploaderPublicApi {
|
|
|
355
837
|
}
|
|
356
838
|
|
|
357
839
|
type MetadataCallback = (fileEntry: OutputFileEntry) => Promise<Metadata> | Metadata;
|
|
358
|
-
type LocaleDefinitionOverride = Record<string, LocaleDefinition
|
|
840
|
+
type LocaleDefinitionOverride = Record<string, Partial<LocaleDefinition>>;
|
|
359
841
|
type SecureDeliveryProxyUrlResolver = (previewUrl: string, urlParts: {
|
|
360
842
|
uuid: string;
|
|
361
843
|
cdnUrlModifiers: string;
|
|
@@ -813,51 +1295,10 @@ type OutputCollectionState<TStatus extends OutputCollectionStatus = OutputCollec
|
|
|
813
1295
|
allEntries: OutputFileEntry[];
|
|
814
1296
|
});
|
|
815
1297
|
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
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
|
-
declare class SecureUploadsManager {
|
|
856
|
-
private readonly _block;
|
|
857
|
-
private _secureToken;
|
|
858
|
-
constructor(block: LitUploaderBlock);
|
|
859
|
-
private _debugPrint;
|
|
860
|
-
getSecureToken(): Promise<SecureUploadsSignatureAndExpire | null>;
|
|
1298
|
+
declare class SecureUploadsManager extends SharedInstance {
|
|
1299
|
+
private _secureToken;
|
|
1300
|
+
getSecureToken(): Promise<SecureUploadsSignatureAndExpire | null>;
|
|
1301
|
+
destroy(): void;
|
|
861
1302
|
}
|
|
862
1303
|
|
|
863
1304
|
declare class LitUploaderBlock extends LitActivityBlock {
|
|
@@ -883,9 +1324,9 @@ declare class LitUploaderBlock extends LitActivityBlock {
|
|
|
883
1324
|
};
|
|
884
1325
|
private get _hasCtxOwner();
|
|
885
1326
|
initCallback(): void;
|
|
886
|
-
protected get validationManager(): ValidationManager;
|
|
887
|
-
get api(): UploaderPublicApi;
|
|
888
1327
|
getAPI(): UploaderPublicApi;
|
|
1328
|
+
get validationManager(): ValidationManager;
|
|
1329
|
+
get api(): UploaderPublicApi;
|
|
889
1330
|
get uploadCollection(): TypedCollection<UploadEntryData>;
|
|
890
1331
|
get secureUploadsManager(): SecureUploadsManager;
|
|
891
1332
|
disconnectedCallback(): void;
|
|
@@ -937,6 +1378,13 @@ interface Transformations {
|
|
|
937
1378
|
coords: [number, number];
|
|
938
1379
|
};
|
|
939
1380
|
}
|
|
1381
|
+
interface ApplyResult {
|
|
1382
|
+
originalUrl: string;
|
|
1383
|
+
cdnUrlModifiers: string;
|
|
1384
|
+
cdnUrl: string;
|
|
1385
|
+
transformations: Transformations;
|
|
1386
|
+
}
|
|
1387
|
+
type ChangeResult = ApplyResult;
|
|
940
1388
|
interface CropAspectRatio {
|
|
941
1389
|
type: 'aspect-ratio';
|
|
942
1390
|
width: number;
|
|
@@ -946,14 +1394,112 @@ interface CropAspectRatio {
|
|
|
946
1394
|
}
|
|
947
1395
|
type CropPresetList = CropAspectRatio[];
|
|
948
1396
|
|
|
949
|
-
|
|
1397
|
+
declare class CloudImageEditor extends CloudImageEditorBlock {
|
|
1398
|
+
static styleAttrs: string[];
|
|
1399
|
+
constructor();
|
|
1400
|
+
initCallback(): void;
|
|
1401
|
+
}
|
|
1402
|
+
declare global {
|
|
1403
|
+
interface HTMLElementTagNameMap {
|
|
1404
|
+
'uc-cloud-image-editor': CloudImageEditor;
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
type ActivityParams$1 = {
|
|
950
1409
|
internalId: string;
|
|
951
1410
|
};
|
|
1411
|
+
declare class CloudImageEditorActivity extends LitUploaderBlock {
|
|
1412
|
+
couldBeCtxOwner: boolean;
|
|
1413
|
+
activityType: "cloud-image-edit";
|
|
1414
|
+
private _entry?;
|
|
1415
|
+
private _editorConfig;
|
|
1416
|
+
get activityParams(): ActivityParams$1;
|
|
1417
|
+
initCallback(): void;
|
|
1418
|
+
private _handleApply;
|
|
1419
|
+
private _handleCancel;
|
|
1420
|
+
handleChange(event: CustomEvent<ChangeResult>): void;
|
|
1421
|
+
private _mountEditor;
|
|
1422
|
+
private _unmountEditor;
|
|
1423
|
+
render(): lit_html.TemplateResult<1> | typeof nothing;
|
|
1424
|
+
private _createEditorConfig;
|
|
1425
|
+
}
|
|
1426
|
+
declare global {
|
|
1427
|
+
interface HTMLElementTagNameMap {
|
|
1428
|
+
'uc-cloud-image-editor-activity': CloudImageEditorActivity;
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
declare class Spinner extends LitBlock {
|
|
1433
|
+
render(): lit_html.TemplateResult<1>;
|
|
1434
|
+
}
|
|
1435
|
+
declare global {
|
|
1436
|
+
interface HTMLElementTagNameMap {
|
|
1437
|
+
'uc-spinner': Spinner;
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
type ActivityParams = {
|
|
1442
|
+
externalSourceType: string;
|
|
1443
|
+
};
|
|
1444
|
+
declare class ExternalSource extends LitUploaderBlock {
|
|
1445
|
+
couldBeCtxOwner: boolean;
|
|
1446
|
+
activityType: "external";
|
|
1447
|
+
private _messageBridge?;
|
|
1448
|
+
private _iframeRef;
|
|
1449
|
+
private _latestSelectionSummary;
|
|
1450
|
+
private _selectedList;
|
|
1451
|
+
private _isSelectionReady;
|
|
1452
|
+
private _isDoneBtnEnabled;
|
|
1453
|
+
private _couldSelectAll;
|
|
1454
|
+
private _couldDeselectAll;
|
|
1455
|
+
private _showSelectionStatus;
|
|
1456
|
+
private _showDoneBtn;
|
|
1457
|
+
private _doneBtnTextClass;
|
|
1458
|
+
private _toolbarVisible;
|
|
1459
|
+
private get _counterText();
|
|
1460
|
+
get activityParams(): ActivityParams;
|
|
1461
|
+
initCallback(): void;
|
|
1462
|
+
private _extractUrlFromSelectedFile;
|
|
1463
|
+
private _handleToolbarStateChange;
|
|
1464
|
+
private _handleSelectedFilesChange;
|
|
1465
|
+
private _handleIframeLoad;
|
|
1466
|
+
private _applyTheme;
|
|
1467
|
+
private _applyEmbedCss;
|
|
1468
|
+
private _setupL10n;
|
|
1469
|
+
private _remoteUrl;
|
|
1470
|
+
private _handleDone;
|
|
1471
|
+
private _handleCancel;
|
|
1472
|
+
private _handleSelectAll;
|
|
1473
|
+
private _handleDeselectAll;
|
|
1474
|
+
private _setSelectionSummary;
|
|
1475
|
+
private _mountIframe;
|
|
1476
|
+
private _unmountIframe;
|
|
1477
|
+
private _resetSelectionStatus;
|
|
1478
|
+
disconnectedCallback(): void;
|
|
1479
|
+
render(): lit_html.TemplateResult<1>;
|
|
1480
|
+
}
|
|
1481
|
+
declare global {
|
|
1482
|
+
interface HTMLElementTagNameMap {
|
|
1483
|
+
'uc-external-source': ExternalSource;
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
declare const ACTIVITY_TYPES: Readonly<{
|
|
1488
|
+
START_FROM: "start-from";
|
|
1489
|
+
CAMERA: "camera";
|
|
1490
|
+
DRAW: "draw";
|
|
1491
|
+
UPLOAD_LIST: "upload-list";
|
|
1492
|
+
URL: "url";
|
|
1493
|
+
CLOUD_IMG_EDIT: "cloud-image-edit";
|
|
1494
|
+
EXTERNAL: "external";
|
|
1495
|
+
}>;
|
|
1496
|
+
type RegisteredActivityType = (typeof ACTIVITY_TYPES)[keyof typeof ACTIVITY_TYPES];
|
|
1497
|
+
type ActivityType = RegisteredActivityType | (string & {}) | null;
|
|
952
1498
|
|
|
953
1499
|
declare const ACTIVE_PROP = "___ACTIVITY_IS_ACTIVE___";
|
|
954
1500
|
type ActivityParamsMap = {
|
|
955
|
-
'cloud-image-edit': ActivityParams;
|
|
956
|
-
external: ActivityParams
|
|
1501
|
+
'cloud-image-edit': ActivityParams$1;
|
|
1502
|
+
external: ActivityParams;
|
|
957
1503
|
};
|
|
958
1504
|
declare class LitActivityBlock extends LitBlock {
|
|
959
1505
|
protected historyTracked: boolean;
|
|
@@ -995,8 +1541,6 @@ declare class LitActivityBlock extends LitBlock {
|
|
|
995
1541
|
get doneActivity(): string | null;
|
|
996
1542
|
historyBack(): void;
|
|
997
1543
|
}
|
|
998
|
-
type RegisteredActivityType = (typeof LitActivityBlock)['activities'][keyof (typeof LitActivityBlock)['activities']];
|
|
999
|
-
type ActivityType = RegisteredActivityType | (string & {}) | null;
|
|
1000
1544
|
|
|
1001
1545
|
declare const ModalEvents: Readonly<{
|
|
1002
1546
|
readonly ADD: "modal:add";
|
|
@@ -1012,13 +1556,10 @@ type ModalCb = (data: {
|
|
|
1012
1556
|
modal: Modal;
|
|
1013
1557
|
}) => void;
|
|
1014
1558
|
type ModalEventType = (typeof ModalEvents)[keyof typeof ModalEvents];
|
|
1015
|
-
declare class ModalManager {
|
|
1559
|
+
declare class ModalManager extends SharedInstance {
|
|
1016
1560
|
private _modals;
|
|
1017
1561
|
private _activeModals;
|
|
1018
1562
|
private _subscribers;
|
|
1019
|
-
private _block;
|
|
1020
|
-
constructor(block: LitBlock);
|
|
1021
|
-
private _debugPrint;
|
|
1022
1563
|
/**
|
|
1023
1564
|
* Register a modal with the manager
|
|
1024
1565
|
* @param id Unique identifier for the modal
|
|
@@ -1052,6 +1593,338 @@ declare class ModalManager {
|
|
|
1052
1593
|
destroy(): void;
|
|
1053
1594
|
}
|
|
1054
1595
|
|
|
1596
|
+
declare class LitSolutionBlock extends LitBlock {
|
|
1597
|
+
static styleAttrs: string[];
|
|
1598
|
+
init$: {
|
|
1599
|
+
'*solution': string | null;
|
|
1600
|
+
'*commonProgress': number;
|
|
1601
|
+
'*uploadList': never[];
|
|
1602
|
+
'*uploadQueue': _uploadcare_upload_client.Queue;
|
|
1603
|
+
'*collectionErrors': OutputErrorCollection[];
|
|
1604
|
+
'*collectionState': OutputCollectionState | null;
|
|
1605
|
+
'*groupInfo': _uploadcare_upload_client.UploadcareGroup | null;
|
|
1606
|
+
'*uploadTrigger': Set<string>;
|
|
1607
|
+
'*currentActivity': null;
|
|
1608
|
+
'*currentActivityParams': {};
|
|
1609
|
+
'*history': never[];
|
|
1610
|
+
'*historyBack': null;
|
|
1611
|
+
'*closeModal': () => void;
|
|
1612
|
+
};
|
|
1613
|
+
initCallback(): void;
|
|
1614
|
+
render(): lit_html.TemplateResult<1>;
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
type CssPropValue = string | number | undefined | null;
|
|
1618
|
+
declare const ImgConfig_base: typeof LitElement & Constructor<LitElement> & {
|
|
1619
|
+
reg(tagName: string): void;
|
|
1620
|
+
} & Constructor<{
|
|
1621
|
+
getCssData(propName: string, silentCheck?: boolean): string | number | boolean | null | undefined;
|
|
1622
|
+
}>;
|
|
1623
|
+
declare class ImgConfig extends ImgConfig_base {
|
|
1624
|
+
private _state;
|
|
1625
|
+
private _subscribers;
|
|
1626
|
+
private _isnObserver;
|
|
1627
|
+
private _observed;
|
|
1628
|
+
createRenderRoot(): HTMLElement | ShadowRoot;
|
|
1629
|
+
constructor();
|
|
1630
|
+
protected $$(key: string): unknown;
|
|
1631
|
+
protected set$$(kvObj: Record<string, CssPropValue>): void;
|
|
1632
|
+
protected sub$$<T = unknown>(key: string, kbFn: (val: T) => void): void;
|
|
1633
|
+
private _notify;
|
|
1634
|
+
protected analyticsParams(): string;
|
|
1635
|
+
protected initAttributes(el: HTMLElement): void;
|
|
1636
|
+
protected initIntersection(el: HTMLElement, cbkFn: () => void): void;
|
|
1637
|
+
connectedCallback(): void;
|
|
1638
|
+
private _initCssProperties;
|
|
1639
|
+
disconnectedCallback(): void;
|
|
1640
|
+
static get observedAttributes(): string[];
|
|
1641
|
+
attributeChangedCallback(name: string, _oldVal: string | null, newVal: string | null): void;
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
declare class ImgBase extends ImgConfig {
|
|
1645
|
+
private _img;
|
|
1646
|
+
private _imgPreview;
|
|
1647
|
+
private _fmtAbs;
|
|
1648
|
+
private _validateSize;
|
|
1649
|
+
private _getCdnModifiers;
|
|
1650
|
+
private _getTypedCssValue;
|
|
1651
|
+
private _getUrlBase;
|
|
1652
|
+
private _proxyUrl;
|
|
1653
|
+
protected _getElSize(el: HTMLElement, k?: number, wOnly?: boolean): string | null;
|
|
1654
|
+
private _setupEventProxy;
|
|
1655
|
+
protected get img(): HTMLImageElement;
|
|
1656
|
+
private get _currentImg();
|
|
1657
|
+
private get _hasPreviewImage();
|
|
1658
|
+
private get _bgSelector();
|
|
1659
|
+
private get _breakpoints();
|
|
1660
|
+
private get _hasFormatJPG();
|
|
1661
|
+
private _renderBg;
|
|
1662
|
+
private _getSrcset;
|
|
1663
|
+
private _getSrc;
|
|
1664
|
+
private get _srcUrlPreview();
|
|
1665
|
+
private _renderBackground;
|
|
1666
|
+
private _appendURL;
|
|
1667
|
+
private _setupConfigForImage;
|
|
1668
|
+
private _loaderImage;
|
|
1669
|
+
private _renderImage;
|
|
1670
|
+
protected init(): void;
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
declare class Img extends ImgBase {
|
|
1674
|
+
attributesMeta: {
|
|
1675
|
+
src: string;
|
|
1676
|
+
} | {
|
|
1677
|
+
uuid: string;
|
|
1678
|
+
};
|
|
1679
|
+
connectedCallback(): void;
|
|
1680
|
+
}
|
|
1681
|
+
declare global {
|
|
1682
|
+
interface HTMLElementTagNameMap {
|
|
1683
|
+
'uc-img': Img;
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
declare class FormInput extends LitUploaderBlock {
|
|
1688
|
+
attributesMeta: {
|
|
1689
|
+
'ctx-name': string;
|
|
1690
|
+
name?: string;
|
|
1691
|
+
};
|
|
1692
|
+
private _validationInputElement;
|
|
1693
|
+
private _dynamicInputsContainer;
|
|
1694
|
+
nameAttrValue?: string;
|
|
1695
|
+
private get _inputName();
|
|
1696
|
+
private _createValidationInput;
|
|
1697
|
+
initCallback(): void;
|
|
1698
|
+
}
|
|
1699
|
+
declare global {
|
|
1700
|
+
interface HTMLElementTagNameMap {
|
|
1701
|
+
'uc-form-input': FormInput;
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
declare class Copyright extends LitBlock {
|
|
1706
|
+
initCallback(): void;
|
|
1707
|
+
render(): lit_html.TemplateResult<1>;
|
|
1708
|
+
}
|
|
1709
|
+
declare global {
|
|
1710
|
+
interface HTMLElementTagNameMap {
|
|
1711
|
+
'uc-copyright': Copyright;
|
|
1712
|
+
}
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
declare class ProgressBarCommon extends LitUploaderBlock {
|
|
1716
|
+
private _unobserveCollectionCb?;
|
|
1717
|
+
private _visible;
|
|
1718
|
+
private _value;
|
|
1719
|
+
constructor();
|
|
1720
|
+
initCallback(): void;
|
|
1721
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
1722
|
+
disconnectedCallback(): void;
|
|
1723
|
+
render(): lit_html.TemplateResult<1>;
|
|
1724
|
+
}
|
|
1725
|
+
declare global {
|
|
1726
|
+
interface HTMLElementTagNameMap {
|
|
1727
|
+
'uc-progress-bar-common': ProgressBarCommon;
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
declare class SourceBtn extends LitUploaderBlock {
|
|
1732
|
+
couldBeCtxOwner: boolean;
|
|
1733
|
+
private _registeredTypes;
|
|
1734
|
+
type?: string;
|
|
1735
|
+
private _iconName;
|
|
1736
|
+
private _srcTypeKey;
|
|
1737
|
+
private _initTypes;
|
|
1738
|
+
initCallback(): void;
|
|
1739
|
+
private _registerType;
|
|
1740
|
+
activate(): void;
|
|
1741
|
+
private _applyType;
|
|
1742
|
+
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
1743
|
+
render(): lit_html.TemplateResult<1>;
|
|
1744
|
+
}
|
|
1745
|
+
declare global {
|
|
1746
|
+
interface HTMLElementTagNameMap {
|
|
1747
|
+
'uc-source-btn': SourceBtn;
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
declare class SourceList extends LitBlock {
|
|
1752
|
+
private _rawSourceList;
|
|
1753
|
+
private _cameraModes;
|
|
1754
|
+
/**
|
|
1755
|
+
* CSS-only attribute
|
|
1756
|
+
*/
|
|
1757
|
+
wrap: boolean;
|
|
1758
|
+
initCallback(): void;
|
|
1759
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
1760
|
+
private _updateSources;
|
|
1761
|
+
private _sources;
|
|
1762
|
+
render(): lit_html.TemplateResult<1>;
|
|
1763
|
+
}
|
|
1764
|
+
declare global {
|
|
1765
|
+
interface HTMLElementTagNameMap {
|
|
1766
|
+
'uc-source-list': SourceList;
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
declare class StartFrom extends LitActivityBlock {
|
|
1771
|
+
protected historyTracked: boolean;
|
|
1772
|
+
activityType: ActivityType;
|
|
1773
|
+
initCallback(): void;
|
|
1774
|
+
render(): lit_html.TemplateResult<1>;
|
|
1775
|
+
}
|
|
1776
|
+
declare global {
|
|
1777
|
+
interface HTMLElementTagNameMap {
|
|
1778
|
+
'uc-start-from': StartFrom;
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
type EventListenerMap = {
|
|
1783
|
+
[K in (typeof EventType)[keyof typeof EventType]]: (e: CustomEvent<EventPayload[K]>) => void;
|
|
1784
|
+
};
|
|
1785
|
+
declare class UploadCtxProvider extends LitUploaderBlock {
|
|
1786
|
+
attributesMeta: {
|
|
1787
|
+
'ctx-name': string;
|
|
1788
|
+
};
|
|
1789
|
+
static styleAttrs: string[];
|
|
1790
|
+
static EventType: Readonly<{
|
|
1791
|
+
readonly FILE_ADDED: "file-added";
|
|
1792
|
+
readonly FILE_REMOVED: "file-removed";
|
|
1793
|
+
readonly FILE_UPLOAD_START: "file-upload-start";
|
|
1794
|
+
readonly FILE_UPLOAD_PROGRESS: "file-upload-progress";
|
|
1795
|
+
readonly FILE_UPLOAD_SUCCESS: "file-upload-success";
|
|
1796
|
+
readonly FILE_UPLOAD_FAILED: "file-upload-failed";
|
|
1797
|
+
readonly FILE_URL_CHANGED: "file-url-changed";
|
|
1798
|
+
readonly MODAL_OPEN: "modal-open";
|
|
1799
|
+
readonly MODAL_CLOSE: "modal-close";
|
|
1800
|
+
readonly DONE_CLICK: "done-click";
|
|
1801
|
+
readonly UPLOAD_CLICK: "upload-click";
|
|
1802
|
+
readonly ACTIVITY_CHANGE: "activity-change";
|
|
1803
|
+
readonly COMMON_UPLOAD_START: "common-upload-start";
|
|
1804
|
+
readonly COMMON_UPLOAD_PROGRESS: "common-upload-progress";
|
|
1805
|
+
readonly COMMON_UPLOAD_SUCCESS: "common-upload-success";
|
|
1806
|
+
readonly COMMON_UPLOAD_FAILED: "common-upload-failed";
|
|
1807
|
+
readonly CHANGE: "change";
|
|
1808
|
+
readonly GROUP_CREATED: "group-created";
|
|
1809
|
+
}>;
|
|
1810
|
+
private _unbindEventEmitter;
|
|
1811
|
+
initCallback(): void;
|
|
1812
|
+
disconnectedCallback(): void;
|
|
1813
|
+
}
|
|
1814
|
+
interface UploadCtxProvider extends LitUploaderBlock {
|
|
1815
|
+
addEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | AddEventListenerOptions): void;
|
|
1816
|
+
removeEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | EventListenerOptions): void;
|
|
1817
|
+
}
|
|
1818
|
+
declare global {
|
|
1819
|
+
interface HTMLElementTagNameMap {
|
|
1820
|
+
'uc-upload-ctx-provider': UploadCtxProvider;
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
declare class UrlSource extends LitUploaderBlock {
|
|
1825
|
+
couldBeCtxOwner: boolean;
|
|
1826
|
+
activityType: ActivityType;
|
|
1827
|
+
private _formState;
|
|
1828
|
+
initCallback(): void;
|
|
1829
|
+
private _inputRef;
|
|
1830
|
+
private _handleInput;
|
|
1831
|
+
private _handleUpload;
|
|
1832
|
+
render(): lit_html.TemplateResult<1>;
|
|
1833
|
+
}
|
|
1834
|
+
declare global {
|
|
1835
|
+
interface HTMLElementTagNameMap {
|
|
1836
|
+
'uc-url-source': UrlSource;
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
declare class SimpleBtn extends LitUploaderBlock {
|
|
1841
|
+
static styleAttrs: string[];
|
|
1842
|
+
couldBeCtxOwner: boolean;
|
|
1843
|
+
dropzone: boolean;
|
|
1844
|
+
private _buttonTextKey;
|
|
1845
|
+
private readonly _handleClick;
|
|
1846
|
+
initCallback(): void;
|
|
1847
|
+
render(): lit_html.TemplateResult<1>;
|
|
1848
|
+
}
|
|
1849
|
+
declare global {
|
|
1850
|
+
interface HTMLElementTagNameMap {
|
|
1851
|
+
'uc-simple-btn': SimpleBtn;
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
declare class FileUploaderRegular extends LitSolutionBlock {
|
|
1856
|
+
attributesMeta: {
|
|
1857
|
+
headless?: boolean;
|
|
1858
|
+
'ctx-name': string;
|
|
1859
|
+
};
|
|
1860
|
+
static styleAttrs: string[];
|
|
1861
|
+
headless: boolean;
|
|
1862
|
+
constructor();
|
|
1863
|
+
initCallback(): void;
|
|
1864
|
+
render(): lit_html.TemplateResult<1>;
|
|
1865
|
+
}
|
|
1866
|
+
declare global {
|
|
1867
|
+
interface HTMLElementTagNameMap {
|
|
1868
|
+
'uc-file-uploader-regular': FileUploaderRegular;
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
declare class FileUploaderInline extends LitSolutionBlock {
|
|
1873
|
+
attributesMeta: {
|
|
1874
|
+
'ctx-name': string;
|
|
1875
|
+
};
|
|
1876
|
+
static styleAttrs: string[];
|
|
1877
|
+
private _couldCancel;
|
|
1878
|
+
constructor();
|
|
1879
|
+
private _handleCancel;
|
|
1880
|
+
private get _couldHistoryBack();
|
|
1881
|
+
private get _couldShowList();
|
|
1882
|
+
private _getInitActivity;
|
|
1883
|
+
initCallback(): void;
|
|
1884
|
+
render(): lit_html.TemplateResult<1>;
|
|
1885
|
+
}
|
|
1886
|
+
declare global {
|
|
1887
|
+
interface HTMLElementTagNameMap {
|
|
1888
|
+
'uc-file-uploader-inline': FileUploaderInline;
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
declare class FileUploaderMinimal extends LitSolutionBlock {
|
|
1893
|
+
attributesMeta: {
|
|
1894
|
+
'ctx-name': string;
|
|
1895
|
+
};
|
|
1896
|
+
static styleAttrs: string[];
|
|
1897
|
+
private _singleUpload;
|
|
1898
|
+
private _isHiddenStartFrom;
|
|
1899
|
+
private _classUploadList;
|
|
1900
|
+
private _classStartFrom;
|
|
1901
|
+
private _getInitActivity;
|
|
1902
|
+
constructor();
|
|
1903
|
+
private _handleModalOpen;
|
|
1904
|
+
private _handleModalClose;
|
|
1905
|
+
initCallback(): void;
|
|
1906
|
+
disconnectedCallback(): void;
|
|
1907
|
+
render(): lit_html.TemplateResult<1>;
|
|
1908
|
+
}
|
|
1909
|
+
declare global {
|
|
1910
|
+
interface HTMLElementTagNameMap {
|
|
1911
|
+
'uc-file-uploader-minimal': FileUploaderMinimal;
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
declare class A11y implements ISharedInstance {
|
|
1916
|
+
private _destroyKeyUX;
|
|
1917
|
+
private readonly _scopedWindow;
|
|
1918
|
+
constructor();
|
|
1919
|
+
registerBlock(scope: LitBlock): void;
|
|
1920
|
+
destroy(): void;
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
declare class LocaleManager extends SharedInstance {
|
|
1924
|
+
private _localeName;
|
|
1925
|
+
constructor(sharedInstancesBag: SharedInstancesBag);
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1055
1928
|
type CommonEventType = InternalEventKey | EventKey;
|
|
1056
1929
|
type TelemetryState = TelemetryRequest & {
|
|
1057
1930
|
eventTimestamp: number;
|
|
@@ -1061,10 +1934,33 @@ type TelemetryEventBody = Partial<Pick<TelemetryState, 'payload' | 'config'>> &
|
|
|
1061
1934
|
modalId?: string;
|
|
1062
1935
|
eventType?: CommonEventType;
|
|
1063
1936
|
};
|
|
1064
|
-
|
|
1937
|
+
declare class TelemetryManager extends SharedInstance {
|
|
1938
|
+
private readonly _sessionId;
|
|
1939
|
+
private readonly _telemetryInstance;
|
|
1940
|
+
private _config;
|
|
1941
|
+
private _initialized;
|
|
1942
|
+
private _lastPayload;
|
|
1943
|
+
private readonly _queue;
|
|
1944
|
+
private _isEnabled;
|
|
1945
|
+
constructor(sharedInstancesBag: SharedInstancesBag);
|
|
1946
|
+
private _init;
|
|
1947
|
+
private _setConfig;
|
|
1948
|
+
private _formattingPayload;
|
|
1949
|
+
private _excludedEvents;
|
|
1065
1950
|
sendEvent(body: TelemetryEventBody): void;
|
|
1066
1951
|
sendEventError(error: unknown, context?: string): void;
|
|
1952
|
+
/**
|
|
1953
|
+
* Method to send telemetry event for Cloud Image Editor.
|
|
1954
|
+
*/
|
|
1067
1955
|
sendEventCloudImageEditor(e: MouseEvent, tabId: string, options?: Record<string, unknown>): void;
|
|
1956
|
+
/**
|
|
1957
|
+
* Deeply compares two objects and returns true if they are equal, false otherwise.
|
|
1958
|
+
*/
|
|
1959
|
+
private _checkObj;
|
|
1960
|
+
private get _timestamp();
|
|
1961
|
+
private get _solution();
|
|
1962
|
+
private get _activity();
|
|
1963
|
+
private get _location();
|
|
1068
1964
|
}
|
|
1069
1965
|
|
|
1070
1966
|
declare const TabId: Readonly<{
|
|
@@ -1206,7 +2102,7 @@ type DynamicBlockState = {
|
|
|
1206
2102
|
'*blocksRegistry': BlocksRegistry;
|
|
1207
2103
|
'*eventEmitter': EventEmitter;
|
|
1208
2104
|
'*localeManager': LocaleManager;
|
|
1209
|
-
'*telemetryManager':
|
|
2105
|
+
'*telemetryManager': TelemetryManager;
|
|
1210
2106
|
'*a11y': A11y;
|
|
1211
2107
|
'*modalManager': ModalManager | null;
|
|
1212
2108
|
};
|
|
@@ -1221,54 +2117,122 @@ type LocaleState = {
|
|
|
1221
2117
|
};
|
|
1222
2118
|
type SharedState = SolutionBlockCtxState & SharedConfigState & CloudImageEditorState & EditorImageCropperState & EditorToolbarState & DynamicBlockState & DynamicUploaderBlockState & LocaleState;
|
|
1223
2119
|
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
};
|
|
1232
|
-
declare class LitBlock extends LitBlockBase {
|
|
2120
|
+
interface ISharedInstance {
|
|
2121
|
+
destroy?(): void;
|
|
2122
|
+
}
|
|
2123
|
+
declare class SharedInstance {
|
|
2124
|
+
protected _ctx: PubSub<SharedState>;
|
|
2125
|
+
protected _sharedInstancesBag: SharedInstancesBag;
|
|
2126
|
+
private _subscriptions;
|
|
1233
2127
|
private _cfgProxy;
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
2128
|
+
protected _debugPrint: (...args: unknown[]) => void;
|
|
2129
|
+
constructor(sharedInstancesBag: SharedInstancesBag);
|
|
2130
|
+
protected addSub(unsub: () => void): void;
|
|
2131
|
+
protected get _cfg(): Readonly<ConfigType>;
|
|
2132
|
+
destroy(): void;
|
|
2133
|
+
}
|
|
2134
|
+
type SharedInstancesState = Pick<SharedState, '*blocksRegistry' | '*eventEmitter' | '*localeManager' | '*telemetryManager' | '*a11y' | '*modalManager' | '*uploadCollection' | '*publicApi' | '*validationManager' | '*secureUploadsManager'>;
|
|
2135
|
+
type SharedInstancesBag = ReturnType<typeof createSharedInstancesBag>;
|
|
2136
|
+
declare const createSharedInstancesBag: (getCtx: () => PubSub<SharedState>) => {
|
|
2137
|
+
readonly ctx: PubSub<SharedState>;
|
|
2138
|
+
readonly modalManager: ModalManager | null;
|
|
2139
|
+
readonly telemetryManager: TelemetryManager;
|
|
2140
|
+
readonly localeManager: LocaleManager;
|
|
2141
|
+
readonly a11y: A11y;
|
|
2142
|
+
readonly blocksRegistry: Set<LitBlock>;
|
|
2143
|
+
readonly eventEmitter: EventEmitter;
|
|
2144
|
+
readonly uploadCollection: TypedCollection<UploadEntryData>;
|
|
2145
|
+
readonly secureUploadsManager: SecureUploadsManager;
|
|
2146
|
+
readonly api: UploaderPublicApi;
|
|
2147
|
+
readonly validationManager: ValidationManager;
|
|
2148
|
+
};
|
|
2149
|
+
|
|
2150
|
+
type FuncFileValidator = (outputEntry: OutputFileEntry, api: UploaderPublicApi, options?: {
|
|
2151
|
+
signal?: AbortSignal;
|
|
2152
|
+
}) => undefined | OutputErrorFile | Promise<undefined | OutputErrorFile>;
|
|
2153
|
+
type FileValidatorDescriptor = {
|
|
2154
|
+
runOn: 'add' | 'upload' | 'change';
|
|
2155
|
+
validator: FuncFileValidator;
|
|
2156
|
+
};
|
|
2157
|
+
type FileValidator = FileValidatorDescriptor | FuncFileValidator;
|
|
2158
|
+
type FuncCollectionValidator = (collection: ReturnType<typeof buildOutputCollectionState<OutputCollectionStatus>>, api: UploaderPublicApi) => undefined | OutputErrorCollection;
|
|
2159
|
+
declare class ValidationManager extends SharedInstance {
|
|
2160
|
+
private get _uploadCollection();
|
|
2161
|
+
private _commonFileValidators;
|
|
2162
|
+
private _commonCollectionValidators;
|
|
2163
|
+
private _queue;
|
|
2164
|
+
private _runQueueDebounced;
|
|
2165
|
+
private _isDestroyed;
|
|
2166
|
+
private _entryValidationState;
|
|
2167
|
+
constructor(sharedInstancesBag: SharedInstancesBag);
|
|
2168
|
+
runFileValidators(runOn: FileValidatorDescriptor['runOn'], entryIds?: Uid[]): void;
|
|
2169
|
+
runCollectionValidators(): void;
|
|
2170
|
+
cleanupValidationForEntry(entry: TypedData<UploadEntryData>): void;
|
|
2171
|
+
private _runFileValidatorsForEntry;
|
|
2172
|
+
private _addCustomTypeToValidationError;
|
|
2173
|
+
private _getEntryValidationState;
|
|
2174
|
+
private _getValidatorDescriptors;
|
|
2175
|
+
private _getValidatorDescriptorsForEntry;
|
|
2176
|
+
destroy(): void;
|
|
2177
|
+
}
|
|
2178
|
+
|
|
2179
|
+
declare const LitBlockBase: typeof LitElement & Constructor<{
|
|
2180
|
+
willYield: boolean;
|
|
2181
|
+
yield(slot: string, defaultContent?: unknown): unknown;
|
|
2182
|
+
}> & Constructor<{
|
|
2183
|
+
getCssData(propName: string, silentCheck?: boolean): string | number | boolean | null | undefined;
|
|
2184
|
+
}> & Constructor<SymbioteComponent<SharedState>> & Constructor<LitElement> & {
|
|
2185
|
+
reg(tagName: string): void;
|
|
2186
|
+
};
|
|
2187
|
+
declare class LitBlock extends LitBlockBase {
|
|
2188
|
+
private _cfgProxy;
|
|
2189
|
+
protected _sharedContextInstances: Map<keyof SharedInstancesState, ISharedInstance>;
|
|
2190
|
+
static styleAttrs: string[];
|
|
2191
|
+
activityType: ActivityType;
|
|
2192
|
+
init$: {};
|
|
2193
|
+
constructor();
|
|
2194
|
+
l10n: (str: string, variables?: Record<string, string | number>) => string;
|
|
2195
|
+
debugPrint: (...args: unknown[]) => void;
|
|
2196
|
+
protected _sharedInstancesBag: {
|
|
2197
|
+
readonly ctx: PubSub<SharedState>;
|
|
2198
|
+
readonly modalManager: ModalManager | null;
|
|
2199
|
+
readonly telemetryManager: TelemetryManager;
|
|
2200
|
+
readonly localeManager: LocaleManager;
|
|
2201
|
+
readonly a11y: A11y;
|
|
2202
|
+
readonly blocksRegistry: Set<LitBlock>;
|
|
2203
|
+
readonly eventEmitter: EventEmitter;
|
|
2204
|
+
readonly uploadCollection: TypedCollection<UploadEntryData>;
|
|
2205
|
+
readonly secureUploadsManager: SecureUploadsManager;
|
|
2206
|
+
readonly api: UploaderPublicApi;
|
|
2207
|
+
readonly validationManager: ValidationManager;
|
|
2208
|
+
};
|
|
2209
|
+
emit(type: Parameters<EventEmitter['emit']>[0], payload?: Parameters<EventEmitter['emit']>[1], options?: Parameters<EventEmitter['emit']>[2]): void;
|
|
2210
|
+
hasBlockInCtx(callback: (block: LitBlock) => boolean): boolean;
|
|
2211
|
+
connectedCallback(): void;
|
|
2212
|
+
initCallback(): void;
|
|
2213
|
+
get testId(): string;
|
|
2214
|
+
get modalManager(): ModalManager | null;
|
|
2215
|
+
get telemetryManager(): TelemetryManager;
|
|
2216
|
+
get localeManager(): LocaleManager;
|
|
2217
|
+
get a11y(): A11y;
|
|
2218
|
+
get blocksRegistry(): Set<LitBlock>;
|
|
2219
|
+
get eventEmitter(): EventEmitter;
|
|
2220
|
+
disconnectedCallback(): void;
|
|
2221
|
+
/**
|
|
2222
|
+
* Called when the last block is removed from the context. Note that inheritors must run their callback before that.
|
|
1255
2223
|
*/
|
|
1256
|
-
|
|
2224
|
+
private destroyCtxCallback;
|
|
1257
2225
|
/**
|
|
1258
2226
|
* Adds a shared context instance if it does not exist yet.
|
|
1259
2227
|
* @param key The shared state key.
|
|
1260
2228
|
* @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
2229
|
*/
|
|
1263
|
-
protected
|
|
1264
|
-
persist?: boolean | undefined;
|
|
1265
|
-
}): void;
|
|
2230
|
+
protected _addSharedContextInstance<TKey extends keyof SharedInstancesState>(key: TKey, resolver: (sharedInstancesBag: SharedInstancesBag) => NonNullable<SharedInstancesState[TKey]>): void;
|
|
1266
2231
|
private _destroySharedContextInstances;
|
|
1267
|
-
protected
|
|
2232
|
+
protected _getSharedContextInstance<TKey extends keyof SharedState, TRequired extends boolean = true>(key: TKey, isRequired?: TRequired): TRequired extends true ? NonNullable<SharedState[TKey]> : SharedState[TKey];
|
|
1268
2233
|
protected proxyUrl(url: string): Promise<string>;
|
|
1269
2234
|
get cfg(): ConfigType;
|
|
1270
2235
|
subConfigValue<T extends keyof ConfigType>(key: T, callback: (value: ConfigType[T]) => void): () => void;
|
|
1271
|
-
debugPrint(...args: unknown[]): void;
|
|
1272
2236
|
}
|
|
1273
2237
|
|
|
1274
2238
|
declare function initState(fnCtx: CloudImageEditorBlock): {
|
|
@@ -1290,57 +2254,78 @@ declare function initState(fnCtx: CloudImageEditorBlock): {
|
|
|
1290
2254
|
'*on.cancel': () => void;
|
|
1291
2255
|
};
|
|
1292
2256
|
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
private
|
|
1310
|
-
|
|
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>;
|
|
2257
|
+
type PresenceToggleStyle = {
|
|
2258
|
+
transition?: string;
|
|
2259
|
+
visible?: string;
|
|
2260
|
+
hidden?: string;
|
|
2261
|
+
};
|
|
2262
|
+
declare class PresenceToggle extends LitBlock {
|
|
2263
|
+
private _visible;
|
|
2264
|
+
private _styles;
|
|
2265
|
+
private _visibleStyle;
|
|
2266
|
+
private _hiddenStyle;
|
|
2267
|
+
private _externalTransitions;
|
|
2268
|
+
private _initialRenderComplete;
|
|
2269
|
+
set visible(value: boolean);
|
|
2270
|
+
get visible(): boolean;
|
|
2271
|
+
set styles(styles: PresenceToggleStyle);
|
|
2272
|
+
get styles(): PresenceToggleStyle;
|
|
2273
|
+
private _handleVisible;
|
|
2274
|
+
private _dispatchInitialRenderEvent;
|
|
1327
2275
|
initCallback(): void;
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
2276
|
+
}
|
|
2277
|
+
declare global {
|
|
2278
|
+
interface HTMLElementTagNameMap {
|
|
2279
|
+
'uc-presence-toggle': PresenceToggle;
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
|
|
2283
|
+
declare class LineLoaderUi extends LitBlock {
|
|
2284
|
+
active: boolean;
|
|
2285
|
+
private readonly _lineRef;
|
|
2286
|
+
private _isAnimating;
|
|
2287
|
+
private readonly _handleTransitionEndRight;
|
|
2288
|
+
protected firstUpdated(changedProperties: PropertyValues<this>): void;
|
|
2289
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
2290
|
+
private _start;
|
|
2291
|
+
private _stop;
|
|
2292
|
+
private _resetLine;
|
|
2293
|
+
render(): lit_html.TemplateResult<1>;
|
|
2294
|
+
}
|
|
2295
|
+
declare global {
|
|
2296
|
+
interface HTMLElementTagNameMap {
|
|
2297
|
+
'uc-line-loader-ui': LineLoaderUi;
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
|
|
2301
|
+
type AriaRole = 'alert' | 'alertdialog' | 'button' | 'checkbox' | 'dialog' | 'gridcell' | 'link' | 'log' | 'marquee' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'option' | 'progressbar' | 'radio' | 'scrollbar' | 'searchbox' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'tabpanel' | 'textbox' | 'timer' | 'tooltip' | 'treeitem' | 'combobox' | 'grid' | 'listbox' | 'menu' | 'menubar' | 'radiogroup' | 'tablist' | 'tree' | 'treegrid' | 'application' | 'article' | 'cell' | 'columnheader' | 'definition' | 'directory' | 'document' | 'feed' | 'figure' | 'group' | 'heading' | 'img' | 'list' | 'listitem' | 'math' | 'none' | 'note' | 'presentation' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'separator' | 'table' | 'term' | 'text' | 'toolbar' | 'banner' | 'complementary' | 'contentinfo' | 'form' | 'main' | 'navigation' | 'region' | 'search' | 'doc-abstract' | 'doc-acknowledgments' | 'doc-afterword' | 'doc-appendix' | 'doc-backlink' | 'doc-biblioentry' | 'doc-bibliography' | 'doc-biblioref' | 'doc-chapter' | 'doc-colophon' | 'doc-conclusion' | 'doc-cover' | 'doc-credit' | 'doc-credits' | 'doc-dedication' | 'doc-endnote' | 'doc-endnotes' | 'doc-epigraph' | 'doc-epilogue' | 'doc-errata' | 'doc-example' | 'doc-footnote' | 'doc-foreword' | 'doc-glossary' | 'doc-glossref' | 'doc-index' | 'doc-introduction' | 'doc-noteref' | 'doc-notice' | 'doc-pagebreak' | 'doc-pagelist' | 'doc-part' | 'doc-preface' | 'doc-prologue' | 'doc-pullquote' | 'doc-qna' | 'doc-subtitle' | 'doc-tip' | 'doc-toc';
|
|
2302
|
+
|
|
2303
|
+
type Theme = string | null;
|
|
2304
|
+
declare class BtnUi extends LitBlock {
|
|
2305
|
+
text: string;
|
|
2306
|
+
icon: string;
|
|
2307
|
+
reverse: boolean;
|
|
2308
|
+
theme: Theme;
|
|
2309
|
+
ariaRole: AriaRole | undefined;
|
|
2310
|
+
ariaControls: string;
|
|
2311
|
+
titleProp: string;
|
|
1332
2312
|
/**
|
|
1333
|
-
*
|
|
2313
|
+
* CSS-only attribute
|
|
1334
2314
|
*/
|
|
1335
|
-
|
|
1336
|
-
firstUpdated(
|
|
1337
|
-
|
|
2315
|
+
active: boolean;
|
|
2316
|
+
protected firstUpdated(changed: PropertyValues<this>): void;
|
|
2317
|
+
protected updated(changed: PropertyValues<this>): void;
|
|
2318
|
+
private _applyReverse;
|
|
2319
|
+
private _applyThemeClass;
|
|
2320
|
+
private get _iconClassMap();
|
|
2321
|
+
private get _computedIconHidden();
|
|
2322
|
+
private get _computedIconSingle();
|
|
1338
2323
|
render(): lit_html.TemplateResult<1>;
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
2324
|
+
}
|
|
2325
|
+
declare global {
|
|
2326
|
+
interface HTMLElementTagNameMap {
|
|
2327
|
+
'uc-btn-ui': BtnUi;
|
|
2328
|
+
}
|
|
1344
2329
|
}
|
|
1345
2330
|
|
|
1346
2331
|
declare class CropFrame extends LitBlock {
|
|
@@ -1392,70 +2377,10 @@ declare class CropFrame extends LitBlock {
|
|
|
1392
2377
|
disconnectedCallback(): void;
|
|
1393
2378
|
render(): TemplateResult;
|
|
1394
2379
|
}
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
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>;
|
|
1407
|
-
}
|
|
1408
|
-
|
|
1409
|
-
declare class EditorFreeformButtonControl extends EditorButtonControl {
|
|
1410
|
-
initCallback(): void;
|
|
1411
|
-
onClick(): void;
|
|
1412
|
-
private _computeTitle;
|
|
1413
|
-
render(): lit_html.TemplateResult<1>;
|
|
1414
|
-
}
|
|
1415
|
-
declare class EditorAspectRatioButtonControl extends EditorButtonControl {
|
|
1416
|
-
private _aspectRatio;
|
|
1417
|
-
get aspectRatio(): CropAspectRatio | null;
|
|
1418
|
-
set aspectRatio(value: CropAspectRatio | null);
|
|
1419
|
-
initCallback(): void;
|
|
1420
|
-
protected onClick(): void;
|
|
1421
|
-
private _updateAspectRatioPresentation;
|
|
1422
|
-
private _renderIcon;
|
|
1423
|
-
render(): lit_html.TemplateResult<1>;
|
|
1424
|
-
}
|
|
1425
|
-
|
|
1426
|
-
declare class EditorCropButtonControl extends EditorButtonControl {
|
|
1427
|
-
operation: CropOperation | undefined;
|
|
1428
|
-
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
1429
|
-
protected onClick(e: MouseEvent): void;
|
|
1430
|
-
}
|
|
1431
|
-
|
|
1432
|
-
declare class EditorFilterControl extends EditorButtonControl {
|
|
1433
|
-
private _operation;
|
|
1434
|
-
private _filter;
|
|
1435
|
-
private _originalUrl;
|
|
1436
|
-
private _observer?;
|
|
1437
|
-
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;
|
|
1448
|
-
private _previewSrc;
|
|
1449
|
-
private _observerCallback;
|
|
1450
|
-
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>;
|
|
2380
|
+
declare global {
|
|
2381
|
+
interface HTMLElementTagNameMap {
|
|
2382
|
+
'uc-crop-frame': CropFrame;
|
|
2383
|
+
}
|
|
1459
2384
|
}
|
|
1460
2385
|
|
|
1461
2386
|
type Operations = {
|
|
@@ -1505,6 +2430,11 @@ declare class EditorImageCropper extends LitBlock {
|
|
|
1505
2430
|
disconnectedCallback(): void;
|
|
1506
2431
|
render(): TemplateResult;
|
|
1507
2432
|
}
|
|
2433
|
+
declare global {
|
|
2434
|
+
interface HTMLElementTagNameMap {
|
|
2435
|
+
'uc-editor-image-cropper': EditorImageCropper;
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
1508
2438
|
|
|
1509
2439
|
type OperationKey = keyof typeof COLOR_OPERATIONS_CONFIG;
|
|
1510
2440
|
declare class EditorImageFader extends LitBlock {
|
|
@@ -1559,6 +2489,92 @@ declare class EditorImageFader extends LitBlock {
|
|
|
1559
2489
|
private _clearLayersHost;
|
|
1560
2490
|
render(): TemplateResult;
|
|
1561
2491
|
}
|
|
2492
|
+
declare global {
|
|
2493
|
+
interface HTMLElementTagNameMap {
|
|
2494
|
+
'uc-editor-image-fader': EditorImageFader;
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
|
|
2498
|
+
declare class EditorButtonControl extends LitBlock {
|
|
2499
|
+
active: boolean;
|
|
2500
|
+
title: string;
|
|
2501
|
+
protected icon: string;
|
|
2502
|
+
protected titleProp: string;
|
|
2503
|
+
protected get buttonClasses(): Record<string, boolean>;
|
|
2504
|
+
private _updateHostStateClasses;
|
|
2505
|
+
protected onClick(_event: MouseEvent): void;
|
|
2506
|
+
connectedCallback(): void;
|
|
2507
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
2508
|
+
render(): lit_html.TemplateResult<1>;
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2511
|
+
declare class EditorFreeformButtonControl extends EditorButtonControl {
|
|
2512
|
+
initCallback(): void;
|
|
2513
|
+
onClick(): void;
|
|
2514
|
+
private _computeTitle;
|
|
2515
|
+
render(): lit_html.TemplateResult<1>;
|
|
2516
|
+
}
|
|
2517
|
+
declare class EditorAspectRatioButtonControl extends EditorButtonControl {
|
|
2518
|
+
private _aspectRatio;
|
|
2519
|
+
get aspectRatio(): CropAspectRatio | null;
|
|
2520
|
+
set aspectRatio(value: CropAspectRatio | null);
|
|
2521
|
+
initCallback(): void;
|
|
2522
|
+
protected onClick(): void;
|
|
2523
|
+
private _updateAspectRatioPresentation;
|
|
2524
|
+
private _renderIcon;
|
|
2525
|
+
render(): lit_html.TemplateResult<1>;
|
|
2526
|
+
}
|
|
2527
|
+
declare global {
|
|
2528
|
+
interface HTMLElementTagNameMap {
|
|
2529
|
+
'uc-editor-freeform-button-control': EditorFreeformButtonControl;
|
|
2530
|
+
'uc-editor-aspect-ratio-button-control': EditorAspectRatioButtonControl;
|
|
2531
|
+
}
|
|
2532
|
+
}
|
|
2533
|
+
|
|
2534
|
+
declare class EditorCropButtonControl extends EditorButtonControl {
|
|
2535
|
+
operation: CropOperation | undefined;
|
|
2536
|
+
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
2537
|
+
protected onClick(e: MouseEvent): void;
|
|
2538
|
+
}
|
|
2539
|
+
declare global {
|
|
2540
|
+
interface HTMLElementTagNameMap {
|
|
2541
|
+
'uc-editor-crop-button-control': EditorCropButtonControl;
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2545
|
+
declare class EditorFilterControl extends EditorButtonControl {
|
|
2546
|
+
private _operation;
|
|
2547
|
+
private _filter;
|
|
2548
|
+
private _originalUrl;
|
|
2549
|
+
private _observer?;
|
|
2550
|
+
private _cancelPreload?;
|
|
2551
|
+
private _lastPreviewRequestId;
|
|
2552
|
+
private _previewVisibilityCheckRaf?;
|
|
2553
|
+
private _previewVisibilityCheckTimeout?;
|
|
2554
|
+
private _previewImage;
|
|
2555
|
+
private _previewLoaded;
|
|
2556
|
+
isOriginal: boolean;
|
|
2557
|
+
private _iconSize;
|
|
2558
|
+
get filter(): string;
|
|
2559
|
+
set filter(value: string);
|
|
2560
|
+
onClick(e: MouseEvent): void;
|
|
2561
|
+
private _previewSrc;
|
|
2562
|
+
private _observerCallback;
|
|
2563
|
+
initCallback(): void;
|
|
2564
|
+
disconnectedCallback(): void;
|
|
2565
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
2566
|
+
private _updateFilterLabels;
|
|
2567
|
+
private _loadPreview;
|
|
2568
|
+
private _schedulePreviewVisibilityCheck;
|
|
2569
|
+
private _clearPreviewVisibilityChecks;
|
|
2570
|
+
private get _shouldShowPreview();
|
|
2571
|
+
render(): lit_html.TemplateResult<1>;
|
|
2572
|
+
}
|
|
2573
|
+
declare global {
|
|
2574
|
+
interface HTMLElementTagNameMap {
|
|
2575
|
+
'uc-editor-filter-control': EditorFilterControl;
|
|
2576
|
+
}
|
|
2577
|
+
}
|
|
1562
2578
|
|
|
1563
2579
|
declare class EditorOperationControl extends EditorButtonControl {
|
|
1564
2580
|
private _operation;
|
|
@@ -1568,12 +2584,63 @@ declare class EditorOperationControl extends EditorButtonControl {
|
|
|
1568
2584
|
initCallback(): void;
|
|
1569
2585
|
protected onClick(e: MouseEvent): void;
|
|
1570
2586
|
}
|
|
2587
|
+
declare global {
|
|
2588
|
+
interface HTMLElementTagNameMap {
|
|
2589
|
+
'uc-editor-operation-control': EditorOperationControl;
|
|
2590
|
+
}
|
|
2591
|
+
}
|
|
1571
2592
|
|
|
1572
2593
|
declare class EditorScroller extends LitBlock {
|
|
2594
|
+
/**
|
|
2595
|
+
* CSS-only attribute
|
|
2596
|
+
*/
|
|
2597
|
+
hiddenScrollbar: boolean;
|
|
1573
2598
|
private readonly _handleWheel;
|
|
1574
2599
|
connectedCallback(): void;
|
|
1575
2600
|
disconnectedCallback(): void;
|
|
1576
2601
|
}
|
|
2602
|
+
declare global {
|
|
2603
|
+
interface HTMLElementTagNameMap {
|
|
2604
|
+
'uc-editor-scroller': EditorScroller;
|
|
2605
|
+
}
|
|
2606
|
+
}
|
|
2607
|
+
|
|
2608
|
+
declare class SliderUi extends LitBlock {
|
|
2609
|
+
private _observer?;
|
|
2610
|
+
private _thumbSize;
|
|
2611
|
+
private _zeroDotEl?;
|
|
2612
|
+
private _stepsCount?;
|
|
2613
|
+
private readonly _inputRef;
|
|
2614
|
+
private readonly _thumbRef;
|
|
2615
|
+
private readonly _stepsRef;
|
|
2616
|
+
disabled: boolean;
|
|
2617
|
+
min: number;
|
|
2618
|
+
max: number;
|
|
2619
|
+
defaultValue: number;
|
|
2620
|
+
zero: number;
|
|
2621
|
+
private _currentValue;
|
|
2622
|
+
constructor();
|
|
2623
|
+
private _emitSliderEvent;
|
|
2624
|
+
private readonly _handleSliderInput;
|
|
2625
|
+
private readonly _handleSliderChange;
|
|
2626
|
+
private readonly _handleInputFocus;
|
|
2627
|
+
private readonly _handleInputBlur;
|
|
2628
|
+
protected firstUpdated(changedProperties: PropertyValues<this>): void;
|
|
2629
|
+
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
2630
|
+
private _updateValue;
|
|
2631
|
+
private _updateZeroDot;
|
|
2632
|
+
private _updateSteps;
|
|
2633
|
+
disconnectedCallback(): void;
|
|
2634
|
+
private _setCurrentValue;
|
|
2635
|
+
private _syncInputValue;
|
|
2636
|
+
private _extractEventValue;
|
|
2637
|
+
render(): lit_html.TemplateResult<1>;
|
|
2638
|
+
}
|
|
2639
|
+
declare global {
|
|
2640
|
+
interface HTMLElementTagNameMap {
|
|
2641
|
+
'uc-slider-ui': SliderUi;
|
|
2642
|
+
}
|
|
2643
|
+
}
|
|
1577
2644
|
|
|
1578
2645
|
type SliderOperation = ColorOperation | 'filter';
|
|
1579
2646
|
type SliderFilter = FilterId | typeof FAKE_ORIGINAL_FILTER;
|
|
@@ -1599,6 +2666,11 @@ declare class EditorSlider extends LitBlock {
|
|
|
1599
2666
|
protected updated(changedProperties: PropertyValues<this>): void;
|
|
1600
2667
|
render(): lit_html.TemplateResult<1>;
|
|
1601
2668
|
}
|
|
2669
|
+
declare global {
|
|
2670
|
+
interface HTMLElementTagNameMap {
|
|
2671
|
+
'uc-editor-slider': EditorSlider;
|
|
2672
|
+
}
|
|
2673
|
+
}
|
|
1602
2674
|
|
|
1603
2675
|
type TabIdValue = (typeof TabId)[keyof typeof TabId];
|
|
1604
2676
|
declare class EditorToolbar extends LitBlock {
|
|
@@ -1623,7 +2695,6 @@ declare class EditorToolbar extends LitBlock {
|
|
|
1623
2695
|
private readonly _updateInfoTooltip;
|
|
1624
2696
|
private readonly _subTopToolbarStyles;
|
|
1625
2697
|
private readonly _subBottomToolbarStyles;
|
|
1626
|
-
private readonly _tabContentStyles;
|
|
1627
2698
|
private readonly _tabToggleStyles;
|
|
1628
2699
|
private readonly _tabTogglesStyles;
|
|
1629
2700
|
init$: Record<string, unknown>;
|
|
@@ -1659,90 +2730,68 @@ declare class EditorToolbar extends LitBlock {
|
|
|
1659
2730
|
private _renderTabContent;
|
|
1660
2731
|
render(): TemplateResult<1>;
|
|
1661
2732
|
}
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
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>;
|
|
1680
|
-
}
|
|
1681
|
-
|
|
1682
|
-
declare class LineLoaderUi extends LitBlock {
|
|
1683
|
-
active: boolean;
|
|
1684
|
-
private readonly _lineRef;
|
|
1685
|
-
private _isAnimating;
|
|
1686
|
-
private readonly _handleTransitionEndRight;
|
|
1687
|
-
protected firstUpdated(changedProperties: PropertyValues<this>): void;
|
|
1688
|
-
protected updated(changedProperties: PropertyValues<this>): void;
|
|
1689
|
-
private _start;
|
|
1690
|
-
private _stop;
|
|
1691
|
-
private _resetLine;
|
|
1692
|
-
render(): lit_html.TemplateResult<1>;
|
|
2733
|
+
declare global {
|
|
2734
|
+
interface HTMLElementTagNameMap {
|
|
2735
|
+
'uc-editor-toolbar': EditorToolbar;
|
|
2736
|
+
}
|
|
1693
2737
|
}
|
|
1694
2738
|
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
private
|
|
1712
|
-
|
|
2739
|
+
declare class CloudImageEditorBlock extends LitBlock {
|
|
2740
|
+
attributesMeta: ({
|
|
2741
|
+
uuid: string;
|
|
2742
|
+
} | {
|
|
2743
|
+
'cdn-url': string;
|
|
2744
|
+
}) & Partial<{
|
|
2745
|
+
tabs: string;
|
|
2746
|
+
'crop-preset': string;
|
|
2747
|
+
}> & {
|
|
2748
|
+
'ctx-name': string;
|
|
2749
|
+
};
|
|
2750
|
+
ctxOwner: boolean;
|
|
2751
|
+
static styleAttrs: string[];
|
|
2752
|
+
private _statusMessage;
|
|
2753
|
+
private _imageSrc;
|
|
2754
|
+
private _fileType;
|
|
2755
|
+
private _showLoader;
|
|
2756
|
+
uuid: string | null;
|
|
2757
|
+
cdnUrl: string | null;
|
|
2758
|
+
cropPreset: string;
|
|
2759
|
+
tabs: string | null;
|
|
2760
|
+
private _hasNetworkProblems;
|
|
2761
|
+
private _isInitialized;
|
|
2762
|
+
private _pendingInitUpdate;
|
|
2763
|
+
private readonly _debouncedShowLoader;
|
|
2764
|
+
private readonly _imgRef;
|
|
2765
|
+
private readonly _cropperRef;
|
|
2766
|
+
private readonly _faderRef;
|
|
2767
|
+
private readonly _imgContainerRef;
|
|
2768
|
+
private readonly _handleImageLoad;
|
|
2769
|
+
private readonly _handleImageError;
|
|
2770
|
+
private readonly _handleRetryNetwork;
|
|
2771
|
+
private _scheduleInitialization;
|
|
2772
|
+
init$: ReturnType<typeof initState>;
|
|
1713
2773
|
initCallback(): void;
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
private
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
private
|
|
1722
|
-
|
|
1723
|
-
private readonly _stepsRef;
|
|
1724
|
-
disabled: boolean;
|
|
1725
|
-
min: number;
|
|
1726
|
-
max: number;
|
|
1727
|
-
defaultValue: number;
|
|
1728
|
-
zero: number;
|
|
1729
|
-
private _currentValue;
|
|
1730
|
-
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;
|
|
1738
|
-
private _updateValue;
|
|
1739
|
-
private _updateZeroDot;
|
|
1740
|
-
private _updateSteps;
|
|
2774
|
+
private _assignSharedElements;
|
|
2775
|
+
private _attachImageListeners;
|
|
2776
|
+
private _detachImageListeners;
|
|
2777
|
+
private get _imageClassName();
|
|
2778
|
+
/**
|
|
2779
|
+
* To proper work, we need non-zero size the element. So, we'll wait for it.
|
|
2780
|
+
*/
|
|
2781
|
+
private _waitForSize;
|
|
2782
|
+
firstUpdated(changedProperties: PropertyValues<this>): void;
|
|
1741
2783
|
disconnectedCallback(): void;
|
|
1742
|
-
private _setCurrentValue;
|
|
1743
|
-
private _syncInputValue;
|
|
1744
|
-
private _extractEventValue;
|
|
1745
2784
|
render(): lit_html.TemplateResult<1>;
|
|
2785
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
2786
|
+
private _syncTabListFromProp;
|
|
2787
|
+
private _syncCropPresetState;
|
|
2788
|
+
updateImage(): Promise<void>;
|
|
2789
|
+
initEditor(): Promise<void>;
|
|
2790
|
+
}
|
|
2791
|
+
declare global {
|
|
2792
|
+
interface HTMLElementTagNameMap {
|
|
2793
|
+
'uc-cloud-image-editor-block': CloudImageEditorBlock;
|
|
2794
|
+
}
|
|
1746
2795
|
}
|
|
1747
2796
|
|
|
1748
2797
|
export { BtnUi, CloudImageEditor, CloudImageEditorBlock, Config, CropFrame, EditorAspectRatioButtonControl, EditorCropButtonControl, EditorFilterControl, EditorFreeformButtonControl, EditorImageCropper, EditorImageFader, EditorOperationControl, EditorScroller, EditorSlider, EditorToolbar, Icon, LineLoaderUi, PresenceToggle, SliderUi, defineComponents };
|