@uploadcare/file-uploader 1.24.4 → 1.25.0-alpha.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 +4 -0
- package/dist/env.js +1 -1
- package/dist/index.css +480 -530
- package/dist/index.d.ts +868 -539
- package/dist/index.js +7615 -6044
- package/dist/index.layered.css +2723 -0
- package/dist/index.ssr.js +533 -762
- package/dist/lit.d.ts +1 -0
- package/dist/lit.js +28 -0
- package/dist/locales/file-uploader/ar.js +1 -1
- package/dist/locales/file-uploader/az.js +1 -1
- package/dist/locales/file-uploader/ca.js +1 -1
- package/dist/locales/file-uploader/cs.js +1 -1
- package/dist/locales/file-uploader/da.js +1 -1
- package/dist/locales/file-uploader/de.js +1 -1
- package/dist/locales/file-uploader/el.js +1 -1
- package/dist/locales/file-uploader/en.js +1 -1
- package/dist/locales/file-uploader/es.js +1 -1
- package/dist/locales/file-uploader/et.js +1 -1
- package/dist/locales/file-uploader/fi.js +1 -1
- package/dist/locales/file-uploader/fr.js +1 -1
- package/dist/locales/file-uploader/he.js +1 -1
- package/dist/locales/file-uploader/hy.js +1 -1
- package/dist/locales/file-uploader/is.js +1 -1
- package/dist/locales/file-uploader/it.js +1 -1
- package/dist/locales/file-uploader/ja.js +1 -1
- package/dist/locales/file-uploader/ka.js +1 -1
- package/dist/locales/file-uploader/kk.js +1 -1
- package/dist/locales/file-uploader/ko.js +1 -1
- package/dist/locales/file-uploader/lv.js +1 -1
- package/dist/locales/file-uploader/nb.js +1 -1
- package/dist/locales/file-uploader/nl.js +2 -2
- package/dist/locales/file-uploader/pl.js +1 -1
- package/dist/locales/file-uploader/pt.js +1 -1
- package/dist/locales/file-uploader/ro.js +1 -1
- package/dist/locales/file-uploader/ru.js +1 -1
- package/dist/locales/file-uploader/sk.js +1 -1
- package/dist/locales/file-uploader/sr.js +1 -1
- package/dist/locales/file-uploader/sv.js +1 -1
- package/dist/locales/file-uploader/tr.js +1 -1
- package/dist/locales/file-uploader/uk.js +1 -1
- package/dist/locales/file-uploader/vi.js +1 -1
- package/dist/locales/file-uploader/zh-TW.js +1 -1
- package/dist/locales/file-uploader/zh.js +1 -1
- package/package.json +35 -25
- package/web/file-uploader.iife.min.d.ts +872 -543
- package/web/file-uploader.iife.min.js +8 -4
- package/web/file-uploader.min.d.ts +872 -543
- package/web/file-uploader.min.js +7 -4
- package/web/uc-basic.layered.min.css +26 -0
- package/web/uc-basic.min.css +2 -3
- package/web/uc-cloud-image-editor.layered.min.css +26 -0
- package/web/uc-cloud-image-editor.min.css +1 -2
- package/web/uc-cloud-image-editor.min.d.ts +440 -235
- package/web/uc-cloud-image-editor.min.js +7 -4
- package/web/uc-file-uploader-inline.layered.min.css +26 -0
- package/web/uc-file-uploader-inline.min.css +2 -3
- package/web/uc-file-uploader-inline.min.d.ts +872 -543
- package/web/uc-file-uploader-inline.min.js +7 -4
- package/web/uc-file-uploader-minimal.layered.min.css +26 -0
- package/web/uc-file-uploader-minimal.min.css +2 -3
- package/web/uc-file-uploader-minimal.min.d.ts +872 -543
- package/web/uc-file-uploader-minimal.min.js +7 -4
- package/web/uc-file-uploader-regular.layered.min.css +26 -0
- package/web/uc-file-uploader-regular.min.css +2 -3
- package/web/uc-file-uploader-regular.min.d.ts +872 -543
- package/web/uc-file-uploader-regular.min.js +7 -4
- package/web/uc-img.min.d.ts +56 -91
- package/web/uc-img.min.js +3 -3
|
@@ -1,262 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { PubSub } from '@symbiotejs/symbiote';
|
|
2
|
+
export { PubSub as Data, PubSub, UID } from '@symbiotejs/symbiote';
|
|
3
|
+
import * as lit_html from 'lit-html';
|
|
4
|
+
import { nothing, LitElement, PropertyValues, TemplateResult } from 'lit';
|
|
5
|
+
import { TelemetryRequest } from '@uploadcare/quality-insights';
|
|
3
6
|
import * as _uploadcare_upload_client from '@uploadcare/upload-client';
|
|
4
7
|
import { UploadcareFile, Metadata, UploadError, NetworkError, UploadcareGroup, FileFromOptions } from '@uploadcare/upload-client';
|
|
5
8
|
export { Metadata, NetworkError, UploadError, UploadcareError, UploadcareFile, UploadcareGroup } from '@uploadcare/upload-client';
|
|
6
|
-
import {
|
|
9
|
+
import { Ref } from 'lit/directives/ref.js';
|
|
10
|
+
|
|
11
|
+
declare function defineComponents(blockExports: Record<string, any>): void;
|
|
12
|
+
|
|
13
|
+
declare const UC_WINDOW_KEY = "UC";
|
|
14
|
+
type IndexModule = Record<string, any>;
|
|
15
|
+
declare global {
|
|
16
|
+
interface Window {
|
|
17
|
+
[UC_WINDOW_KEY]?: IndexModule;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @param url File Uploader pack url
|
|
22
|
+
* @param [register] Register connected package, if it not registered yet
|
|
23
|
+
*/
|
|
24
|
+
declare function loadFileUploaderFrom(url: string, register?: boolean): Promise<IndexModule | null>;
|
|
25
|
+
|
|
26
|
+
type LocaleDefinition = Record<string, string>;
|
|
27
|
+
type LocaleDefinitionResolver = () => Promise<LocaleDefinition>;
|
|
28
|
+
declare const defineLocale: (localeName: string, definitionOrResolver: LocaleDefinition | LocaleDefinitionResolver) => void;
|
|
29
|
+
|
|
30
|
+
type Constructor$1<T = {}> = new (...args: any[]) => T;
|
|
7
31
|
|
|
8
32
|
declare class A11y {
|
|
9
33
|
private _destroyKeyUX;
|
|
10
34
|
private readonly _scopedWindow;
|
|
11
35
|
constructor();
|
|
12
|
-
registerBlock(scope:
|
|
36
|
+
registerBlock(scope: LitBlock): void;
|
|
13
37
|
destroy(): void;
|
|
14
38
|
}
|
|
15
39
|
|
|
16
|
-
type LocaleChangeCallback = () => void;
|
|
17
40
|
declare class LocaleManager {
|
|
18
41
|
private _blockInstance;
|
|
19
42
|
private _localeName;
|
|
20
|
-
|
|
21
|
-
private _boundBlocks;
|
|
22
|
-
constructor(blockInstance: Block);
|
|
23
|
-
onLocaleChange(callback: LocaleChangeCallback): () => void;
|
|
24
|
-
bindL10n(block: Block, key: string, resolver: LocaleChangeCallback): void;
|
|
25
|
-
destroyL10nBindings(block: Block): void;
|
|
26
|
-
destroy(): void;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
declare class Modal extends Block {
|
|
30
|
-
static styleAttrs: string[];
|
|
31
|
-
static StateConsumerScope: string;
|
|
32
|
-
private _mouseDownTarget;
|
|
33
|
-
handleModalOpen: ModalCb;
|
|
34
|
-
handleModalClose: ModalCb;
|
|
35
|
-
handleModalCloseAll: ModalCb;
|
|
36
|
-
constructor();
|
|
37
|
-
_handleBackdropClick: () => void;
|
|
38
|
-
_closeDialog: () => void;
|
|
39
|
-
_handleDialogClose: () => void;
|
|
40
|
-
_handleDialogMouseDown: (e: MouseEvent) => void;
|
|
41
|
-
_handleDialogMouseUp: (e: MouseEvent) => void;
|
|
42
|
-
show(): void;
|
|
43
|
-
hide(): void;
|
|
44
|
-
private _handleModalOpen;
|
|
45
|
-
private _handleModalClose;
|
|
46
|
-
private _handleModalCloseAll;
|
|
47
|
-
initCallback(): void;
|
|
48
|
-
destroyCallback(): void;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
declare const ModalEvents: Readonly<{
|
|
52
|
-
readonly ADD: "modal:add";
|
|
53
|
-
readonly DELETE: "modal:delete";
|
|
54
|
-
readonly OPEN: "modal:open";
|
|
55
|
-
readonly CLOSE: "modal:close";
|
|
56
|
-
readonly CLOSE_ALL: "modal:closeAll";
|
|
57
|
-
readonly DESTROY: "modal:destroy";
|
|
58
|
-
}>;
|
|
59
|
-
type ModalId = ActivityType;
|
|
60
|
-
type ModalCb = (data: {
|
|
61
|
-
id: ModalId;
|
|
62
|
-
modal: Modal;
|
|
63
|
-
}) => void;
|
|
64
|
-
type ModalEventType = (typeof ModalEvents)[keyof typeof ModalEvents];
|
|
65
|
-
declare class ModalManager {
|
|
66
|
-
private _modals;
|
|
67
|
-
private _activeModals;
|
|
68
|
-
private _subscribers;
|
|
69
|
-
private _block;
|
|
70
|
-
constructor(block: Block);
|
|
71
|
-
private _debugPrint;
|
|
72
|
-
/**
|
|
73
|
-
* Register a modal with the manager
|
|
74
|
-
* @param id Unique identifier for the modal
|
|
75
|
-
* @param modal Modal component instance
|
|
76
|
-
*/
|
|
77
|
-
registerModal(id: ModalId, modal: Modal): void;
|
|
78
|
-
/** Remove a modal by ID. */
|
|
79
|
-
deleteModal(id: ModalId): boolean;
|
|
80
|
-
/** Open a modal by its ID. */
|
|
81
|
-
open(id: ModalId): boolean;
|
|
82
|
-
/** Close a specific modal by ID. */
|
|
83
|
-
close(id: ModalId): boolean;
|
|
84
|
-
/** Toggle a modal - open if closed, close if open. */
|
|
85
|
-
toggle(id: ModalId): boolean;
|
|
86
|
-
/** True if there are any active modals. */
|
|
87
|
-
get hasActiveModals(): boolean;
|
|
88
|
-
/** Close the most recently opened modal and return to the previous one. */
|
|
89
|
-
back(): boolean;
|
|
90
|
-
/** Close all open modals. */
|
|
91
|
-
closeAll(): number;
|
|
92
|
-
/**
|
|
93
|
-
* Subscribe to modal events
|
|
94
|
-
* @returns Unsubscribe function
|
|
95
|
-
*/
|
|
96
|
-
subscribe(event: ModalEventType, callback: ModalCb): () => void;
|
|
97
|
-
/** Unsubscribe from modal events */
|
|
98
|
-
unsubscribe(event: ModalEventType, callback: ModalCb | undefined): void;
|
|
99
|
-
/** Notify all subscribers of a modal event. */
|
|
100
|
-
private _notify;
|
|
101
|
-
/** Destroy the modal manager, clean up resources */
|
|
102
|
-
destroy(): void;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
type CommonEventType = InternalEventKey | EventKey;
|
|
106
|
-
type TelemetryState = TelemetryRequest & {
|
|
107
|
-
eventTimestamp: number;
|
|
108
|
-
};
|
|
109
|
-
type TelemetryEventBody = Partial<Pick<TelemetryState, 'payload' | 'config'>> & {
|
|
110
|
-
modalId?: string;
|
|
111
|
-
eventType?: CommonEventType;
|
|
112
|
-
};
|
|
113
|
-
declare class TelemetryManager {
|
|
114
|
-
private readonly _sessionId;
|
|
115
|
-
private readonly _telemetryInstance;
|
|
116
|
-
private readonly _block;
|
|
117
|
-
private _config;
|
|
118
|
-
private _initialized;
|
|
119
|
-
private _lastPayload;
|
|
120
|
-
private readonly _queue;
|
|
121
|
-
constructor(block: Block);
|
|
122
|
-
private _init;
|
|
123
|
-
private _setConfig;
|
|
124
|
-
private _formattingPayload;
|
|
125
|
-
private _excludedEvents;
|
|
126
|
-
sendEvent(body: TelemetryEventBody): void;
|
|
127
|
-
sendEventError(error: unknown, context?: string): void;
|
|
128
|
-
/**
|
|
129
|
-
* Method to send telemetry event for Cloud Image Editor.
|
|
130
|
-
*/
|
|
131
|
-
sendEventCloudImageEditor(e: MouseEvent, tabId: string, options?: Record<string, unknown>): void;
|
|
132
|
-
/**
|
|
133
|
-
* Deeply compares two objects and returns true if they are equal, false otherwise.
|
|
134
|
-
*/
|
|
135
|
-
private _checkObj;
|
|
136
|
-
private get _timestamp();
|
|
137
|
-
private get _solution();
|
|
138
|
-
private get _activity();
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
declare class Block extends BaseComponent<any> {
|
|
142
|
-
private __cfgProxy?;
|
|
143
|
-
protected l10nProcessorSubs: Map<string, Set<{
|
|
144
|
-
remove: () => void;
|
|
145
|
-
}>>;
|
|
146
|
-
static StateConsumerScope: string | null;
|
|
147
|
-
static styleAttrs: string[];
|
|
148
|
-
protected requireCtxName: boolean;
|
|
149
|
-
activityType: ActivityType;
|
|
150
|
-
init$: {};
|
|
151
|
-
l10n(str: string, variables?: Record<string, string | number>): string;
|
|
152
|
-
private pluralize;
|
|
153
|
-
protected bindL10n(key: string, resolver: () => void): void;
|
|
154
|
-
constructor();
|
|
155
|
-
emit(type: Parameters<EventEmitter['emit']>[0], payload?: Parameters<EventEmitter['emit']>[1], options?: Parameters<EventEmitter['emit']>[2]): void;
|
|
156
|
-
hasBlockInCtx(callback: (block: Block) => boolean): boolean;
|
|
157
|
-
setOrAddState(prop: string, newVal: any): void;
|
|
158
|
-
connectedCallback(): void;
|
|
159
|
-
disconnectedCallback(): void;
|
|
160
|
-
initCallback(): void;
|
|
161
|
-
get testId(): string;
|
|
162
|
-
get modalManager(): ModalManager | undefined;
|
|
163
|
-
get telemetryManager(): TelemetryManager | {
|
|
164
|
-
sendEvent: () => void;
|
|
165
|
-
sendEventCloudImageEditor: () => void;
|
|
166
|
-
sendEventError: () => void;
|
|
167
|
-
};
|
|
168
|
-
protected get localeManager(): LocaleManager | null;
|
|
169
|
-
protected get a11y(): A11y | null;
|
|
170
|
-
protected get blocksRegistry(): Set<Block>;
|
|
171
|
-
destroyCallback(): void;
|
|
172
|
-
/**
|
|
173
|
-
* Called when the last block is removed from the context. Note that inheritors must run their callback before that.
|
|
174
|
-
*/
|
|
175
|
-
protected destroyCtxCallback(): void;
|
|
176
|
-
protected proxyUrl(url: string): Promise<string>;
|
|
177
|
-
get cfg(): ConfigType;
|
|
178
|
-
subConfigValue<T extends keyof ConfigType>(key: T, callback: (value: ConfigType[T]) => void): void;
|
|
179
|
-
debugPrint(...args: unknown[]): void;
|
|
180
|
-
static reg(name?: string): void;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
declare const InternalEventType: Readonly<{
|
|
184
|
-
readonly INIT_SOLUTION: "init-solution";
|
|
185
|
-
readonly CHANGE_CONFIG: "change-config";
|
|
186
|
-
readonly ACTION_EVENT: "action-event";
|
|
187
|
-
readonly ERROR_EVENT: "error-event";
|
|
188
|
-
}>;
|
|
189
|
-
declare const EventType: Readonly<{
|
|
190
|
-
readonly FILE_ADDED: "file-added";
|
|
191
|
-
readonly FILE_REMOVED: "file-removed";
|
|
192
|
-
readonly FILE_UPLOAD_START: "file-upload-start";
|
|
193
|
-
readonly FILE_UPLOAD_PROGRESS: "file-upload-progress";
|
|
194
|
-
readonly FILE_UPLOAD_SUCCESS: "file-upload-success";
|
|
195
|
-
readonly FILE_UPLOAD_FAILED: "file-upload-failed";
|
|
196
|
-
readonly FILE_URL_CHANGED: "file-url-changed";
|
|
197
|
-
readonly MODAL_OPEN: "modal-open";
|
|
198
|
-
readonly MODAL_CLOSE: "modal-close";
|
|
199
|
-
readonly DONE_CLICK: "done-click";
|
|
200
|
-
readonly UPLOAD_CLICK: "upload-click";
|
|
201
|
-
readonly ACTIVITY_CHANGE: "activity-change";
|
|
202
|
-
readonly COMMON_UPLOAD_START: "common-upload-start";
|
|
203
|
-
readonly COMMON_UPLOAD_PROGRESS: "common-upload-progress";
|
|
204
|
-
readonly COMMON_UPLOAD_SUCCESS: "common-upload-success";
|
|
205
|
-
readonly COMMON_UPLOAD_FAILED: "common-upload-failed";
|
|
206
|
-
readonly CHANGE: "change";
|
|
207
|
-
readonly GROUP_CREATED: "group-created";
|
|
208
|
-
}>;
|
|
209
|
-
type EventKey = (typeof EventType)[keyof typeof EventType];
|
|
210
|
-
type InternalEventKey = (typeof InternalEventType)[keyof typeof InternalEventType];
|
|
211
|
-
type EventPayload = {
|
|
212
|
-
[EventType.FILE_ADDED]: OutputFileEntry<'idle'>;
|
|
213
|
-
[EventType.FILE_REMOVED]: OutputFileEntry<'removed'>;
|
|
214
|
-
[EventType.FILE_UPLOAD_START]: OutputFileEntry<'uploading'>;
|
|
215
|
-
[EventType.FILE_UPLOAD_PROGRESS]: OutputFileEntry<'uploading'>;
|
|
216
|
-
[EventType.FILE_UPLOAD_SUCCESS]: OutputFileEntry<'success'>;
|
|
217
|
-
[EventType.FILE_UPLOAD_FAILED]: OutputFileEntry<'failed'>;
|
|
218
|
-
[EventType.FILE_URL_CHANGED]: OutputFileEntry<'success'>;
|
|
219
|
-
[EventType.MODAL_OPEN]: {
|
|
220
|
-
modalId: ModalId;
|
|
221
|
-
};
|
|
222
|
-
[EventType.MODAL_CLOSE]: {
|
|
223
|
-
modalId: ModalId;
|
|
224
|
-
hasActiveModals: boolean;
|
|
225
|
-
};
|
|
226
|
-
[EventType.ACTIVITY_CHANGE]: {
|
|
227
|
-
activity: ActivityType;
|
|
228
|
-
};
|
|
229
|
-
[EventType.UPLOAD_CLICK]: void;
|
|
230
|
-
[EventType.DONE_CLICK]: OutputCollectionState;
|
|
231
|
-
[EventType.COMMON_UPLOAD_START]: OutputCollectionState<'uploading'>;
|
|
232
|
-
[EventType.COMMON_UPLOAD_PROGRESS]: OutputCollectionState<'uploading'>;
|
|
233
|
-
[EventType.COMMON_UPLOAD_SUCCESS]: OutputCollectionState<'success'>;
|
|
234
|
-
[EventType.COMMON_UPLOAD_FAILED]: OutputCollectionState<'failed'>;
|
|
235
|
-
[EventType.CHANGE]: OutputCollectionState;
|
|
236
|
-
[EventType.GROUP_CREATED]: OutputCollectionState<'success', 'has-group'>;
|
|
237
|
-
};
|
|
238
|
-
declare class EventEmitter {
|
|
239
|
-
private _timeoutStore;
|
|
240
|
-
private _targets;
|
|
241
|
-
private _debugPrint;
|
|
242
|
-
constructor(debugPrint: (...args: unknown[]) => void);
|
|
243
|
-
bindTarget(target: Block): void;
|
|
244
|
-
unbindTarget(target: Block): void;
|
|
245
|
-
private _dispatch;
|
|
246
|
-
emit<T extends EventKey, TDebounce extends boolean | number | undefined = undefined>(type: T, payload?: TDebounce extends false | undefined ? EventPayload[T] : () => EventPayload[T], options?: {
|
|
247
|
-
debounce?: TDebounce;
|
|
248
|
-
}): void;
|
|
43
|
+
constructor(blockInstance: LitBlock);
|
|
249
44
|
}
|
|
250
45
|
|
|
251
46
|
type EventMap = {
|
|
252
47
|
[T in keyof EventPayload]: CustomEvent<EventPayload[T]>;
|
|
253
48
|
};
|
|
254
49
|
|
|
255
|
-
|
|
256
|
-
type LocaleDefinitionResolver = () => Promise<LocaleDefinition>;
|
|
257
|
-
declare const defineLocale: (localeName: string, definitionOrResolver: LocaleDefinition | LocaleDefinitionResolver) => void;
|
|
258
|
-
|
|
259
|
-
declare function buildOutputCollectionState<TCollectionStatus extends OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'>(uploaderBlock: UploaderBlock): OutputCollectionState<TCollectionStatus, TGroupFlag>;
|
|
50
|
+
declare function buildOutputCollectionState<TCollectionStatus extends OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'>(uploaderBlock: LitUploaderBlock): OutputCollectionState<TCollectionStatus, TGroupFlag>;
|
|
260
51
|
|
|
261
52
|
type TypedSchema = Record<string, {
|
|
262
53
|
type: unknown;
|
|
@@ -281,7 +72,7 @@ declare class TypedData<T extends TypedSchema> {
|
|
|
281
72
|
getValue<K extends ExtractKeysFromSchema<T>>(prop: K): ExtractDataFromSchema<T>[K];
|
|
282
73
|
subscribe<K extends ExtractKeysFromSchema<T>>(prop: K, handler: (newVal: ExtractDataFromSchema<T>[K]) => void): {
|
|
283
74
|
remove: () => void;
|
|
284
|
-
callback:
|
|
75
|
+
callback: (val: unknown) => void;
|
|
285
76
|
};
|
|
286
77
|
remove(): void;
|
|
287
78
|
}
|
|
@@ -435,7 +226,7 @@ declare class ValidationManager {
|
|
|
435
226
|
private _queue;
|
|
436
227
|
private _runQueueDebounced;
|
|
437
228
|
private _entryValidationState;
|
|
438
|
-
constructor(blockInstance:
|
|
229
|
+
constructor(blockInstance: LitUploaderBlock);
|
|
439
230
|
runFileValidators(runOn: FileValidatorDescriptor['runOn'], entryIds?: string[]): void;
|
|
440
231
|
runCollectionValidators(): void;
|
|
441
232
|
cleanupValidationForEntry(entry: TypedData<typeof uploadEntrySchema>): void;
|
|
@@ -446,9 +237,17 @@ declare class ValidationManager {
|
|
|
446
237
|
private _getValidatorDescriptorsForEntry;
|
|
447
238
|
}
|
|
448
239
|
|
|
240
|
+
type CameraDeviceOption = {
|
|
241
|
+
text: string;
|
|
242
|
+
value: string;
|
|
243
|
+
};
|
|
244
|
+
type AudioDeviceOption = {
|
|
245
|
+
text: string;
|
|
246
|
+
value: string;
|
|
247
|
+
};
|
|
449
248
|
type CameraMode = 'photo' | 'video';
|
|
450
249
|
type CameraStatus = 'shot' | 'retake' | 'accept' | 'play' | 'stop' | 'pause' | 'resume';
|
|
451
|
-
declare class CameraSource extends
|
|
250
|
+
declare class CameraSource extends LitUploaderBlock {
|
|
452
251
|
couldBeCtxOwner: boolean;
|
|
453
252
|
activityType: "camera";
|
|
454
253
|
private _unsubPermissions;
|
|
@@ -465,8 +264,43 @@ declare class CameraSource extends UploaderBlock {
|
|
|
465
264
|
private _cameraDevices;
|
|
466
265
|
private _audioDevices;
|
|
467
266
|
private _permissionResponses;
|
|
468
|
-
|
|
267
|
+
private timerRef;
|
|
268
|
+
private lineRef;
|
|
269
|
+
private videoRef;
|
|
270
|
+
private switcherRef;
|
|
271
|
+
private _startTime;
|
|
272
|
+
private _elapsedTime;
|
|
273
|
+
protected video: MediaStream | null;
|
|
274
|
+
protected videoTransformCss: string | null;
|
|
275
|
+
protected videoHidden: boolean;
|
|
276
|
+
protected messageHidden: boolean;
|
|
277
|
+
protected requestBtnHidden: boolean;
|
|
278
|
+
protected cameraSelectOptions: CameraDeviceOption[];
|
|
279
|
+
protected cameraSelectHidden: boolean;
|
|
280
|
+
protected l10nMessage: string;
|
|
281
|
+
protected timerHidden: boolean;
|
|
282
|
+
protected cameraHidden: boolean;
|
|
283
|
+
protected cameraActionsHidden: boolean;
|
|
284
|
+
protected audioSelectOptions: AudioDeviceOption[];
|
|
285
|
+
protected audioSelectHidden: boolean;
|
|
286
|
+
protected audioSelectDisabled: boolean;
|
|
287
|
+
protected audioToggleMicrophoneHidden: boolean;
|
|
288
|
+
protected tabCameraHidden: boolean;
|
|
289
|
+
protected tabVideoHidden: boolean;
|
|
290
|
+
protected currentIcon: string;
|
|
291
|
+
protected currentTimelineIcon: string;
|
|
292
|
+
protected toggleMicrophoneIcon: string;
|
|
293
|
+
protected mutableClassButton: string;
|
|
469
294
|
_chooseActionWithCamera: () => void;
|
|
295
|
+
private _handleCameraSelectChange;
|
|
296
|
+
private _handleAudioSelectChange;
|
|
297
|
+
private _handleRequestPermissions;
|
|
298
|
+
private _handleStartCamera;
|
|
299
|
+
private _handleToggleRecording;
|
|
300
|
+
private _handleToggleAudio;
|
|
301
|
+
private _handleRetake;
|
|
302
|
+
private _handleAccept;
|
|
303
|
+
private _handleClickTab;
|
|
470
304
|
_updateTimer: () => void;
|
|
471
305
|
_startTimer: () => void;
|
|
472
306
|
_stopTimer: () => void;
|
|
@@ -510,7 +344,8 @@ declare class CameraSource extends UploaderBlock {
|
|
|
510
344
|
_handleCameraModes: (cameraModes: CameraMode[]) => void;
|
|
511
345
|
initCallback(): void;
|
|
512
346
|
_destroy(): void;
|
|
513
|
-
|
|
347
|
+
disconnectedCallback(): void;
|
|
348
|
+
render(): lit_html.TemplateResult<1>;
|
|
514
349
|
}
|
|
515
350
|
|
|
516
351
|
/**
|
|
@@ -519,9 +354,9 @@ declare class CameraSource extends UploaderBlock {
|
|
|
519
354
|
declare const complexConfigKeys: readonly ["metadata", "localeDefinitionOverride", "secureUploadsSignatureResolver", "secureDeliveryProxyUrlResolver", "iconHrefResolver", "fileValidators", "collectionValidators", "mediaRecorderOptions"];
|
|
520
355
|
/** Mapping of attribute names to state */
|
|
521
356
|
declare const attrStateMapping: Record<string, string>;
|
|
522
|
-
declare class Config extends
|
|
523
|
-
|
|
524
|
-
|
|
357
|
+
declare class Config extends LitBlock {
|
|
358
|
+
init$: LitBlock["init$"] & ConfigType;
|
|
359
|
+
private computationControllers;
|
|
525
360
|
private _flushValueToAttribute;
|
|
526
361
|
private _flushValueToState;
|
|
527
362
|
private _setValue;
|
|
@@ -529,23 +364,36 @@ declare class Config extends Block {
|
|
|
529
364
|
_assertSameValueDifferentReference(key: string, previousValue: unknown, nextValue: unknown): void;
|
|
530
365
|
initCallback(): void;
|
|
531
366
|
attributeChangedCallback(name: keyof typeof attrStateMapping, oldVal: string, newVal: string): void;
|
|
532
|
-
get
|
|
367
|
+
static get observedAttributes(): string[];
|
|
533
368
|
}
|
|
534
369
|
interface Config extends ConfigType {
|
|
535
370
|
}
|
|
536
371
|
|
|
537
372
|
type FilesViewMode = 'grid' | 'list';
|
|
538
|
-
declare class UploadList extends
|
|
373
|
+
declare class UploadList extends LitUploaderBlock {
|
|
539
374
|
couldBeCtxOwner: boolean;
|
|
540
375
|
historyTracked: boolean;
|
|
541
376
|
activityType: "upload-list";
|
|
542
|
-
|
|
377
|
+
private doneBtnVisible;
|
|
378
|
+
private doneBtnEnabled;
|
|
379
|
+
private uploadBtnVisible;
|
|
380
|
+
private addMoreBtnVisible;
|
|
381
|
+
private addMoreBtnEnabled;
|
|
382
|
+
private commonErrorMessage;
|
|
383
|
+
private hasFiles;
|
|
384
|
+
private _latestSummary;
|
|
385
|
+
protected get headerText(): string;
|
|
386
|
+
private _handleAdd;
|
|
387
|
+
private _handleUpload;
|
|
388
|
+
private _handleDone;
|
|
389
|
+
private _handleCancel;
|
|
543
390
|
private _throttledHandleCollectionUpdate;
|
|
544
|
-
|
|
391
|
+
protected _updateUploadsState(): void;
|
|
545
392
|
private _getHeaderText;
|
|
546
393
|
get couldOpenActivity(): boolean;
|
|
547
394
|
initCallback(): void;
|
|
548
|
-
|
|
395
|
+
disconnectedCallback(): void;
|
|
396
|
+
render(): lit_html.TemplateResult<1>;
|
|
549
397
|
}
|
|
550
398
|
|
|
551
399
|
declare const ExternalUploadSource: Readonly<{
|
|
@@ -596,7 +444,7 @@ type ApiAddFileCommonOptions = {
|
|
|
596
444
|
};
|
|
597
445
|
declare class UploaderPublicApi {
|
|
598
446
|
private _ctx;
|
|
599
|
-
constructor(ctx:
|
|
447
|
+
constructor(ctx: LitUploaderBlock);
|
|
600
448
|
private get _uploadCollection();
|
|
601
449
|
get cfg(): ConfigType;
|
|
602
450
|
get l10n(): (str: string, variables?: Record<string, string | number>) => string;
|
|
@@ -1095,7 +943,7 @@ type OutputCollectionState<TStatus extends OutputCollectionStatus = OutputCollec
|
|
|
1095
943
|
declare class SecureUploadsManager {
|
|
1096
944
|
private readonly _block;
|
|
1097
945
|
private _secureToken;
|
|
1098
|
-
constructor(block:
|
|
946
|
+
constructor(block: LitUploaderBlock);
|
|
1099
947
|
private _debugPrint;
|
|
1100
948
|
getSecureToken(): Promise<SecureUploadsSignatureAndExpire | null>;
|
|
1101
949
|
}
|
|
@@ -1141,7 +989,7 @@ declare class TypedCollection<T extends TypedSchema> {
|
|
|
1141
989
|
destroy(): void;
|
|
1142
990
|
}
|
|
1143
991
|
|
|
1144
|
-
declare class
|
|
992
|
+
declare class LitUploaderBlock extends LitActivityBlock {
|
|
1145
993
|
static extSrcList: Readonly<typeof ExternalUploadSource>;
|
|
1146
994
|
static sourceTypes: Readonly<typeof UploadSource>;
|
|
1147
995
|
protected couldBeCtxOwner: boolean;
|
|
@@ -1172,7 +1020,6 @@ declare class UploaderBlock extends ActivityBlock {
|
|
|
1172
1020
|
destroyCtxCallback(): void;
|
|
1173
1021
|
disconnectedCallback(): void;
|
|
1174
1022
|
connectedCallback(): void;
|
|
1175
|
-
destroyCallback(): void;
|
|
1176
1023
|
private _initCtxOwner;
|
|
1177
1024
|
private _observeUploadCollection;
|
|
1178
1025
|
private _unobserveUploadCollection;
|
|
@@ -1188,6 +1035,10 @@ declare class UploaderBlock extends ActivityBlock {
|
|
|
1188
1035
|
getOutputData(): OutputFileEntry[];
|
|
1189
1036
|
}
|
|
1190
1037
|
|
|
1038
|
+
/**
|
|
1039
|
+
* Mapping of loading resources per operation
|
|
1040
|
+
*/
|
|
1041
|
+
type LoadingOperations = Map<string, Map<string, boolean>>;
|
|
1191
1042
|
/**
|
|
1192
1043
|
* Image size
|
|
1193
1044
|
*/
|
|
@@ -1222,6 +1073,7 @@ interface ApplyResult {
|
|
|
1222
1073
|
cdnUrl: string;
|
|
1223
1074
|
transformations: Transformations;
|
|
1224
1075
|
}
|
|
1076
|
+
type ChangeResult = ApplyResult;
|
|
1225
1077
|
interface CropAspectRatio {
|
|
1226
1078
|
type: 'aspect-ratio';
|
|
1227
1079
|
width: number;
|
|
@@ -1233,27 +1085,41 @@ interface CropAspectRatio {
|
|
|
1233
1085
|
type ActivityParams$1 = {
|
|
1234
1086
|
internalId: string;
|
|
1235
1087
|
};
|
|
1236
|
-
declare class CloudImageEditorActivity extends
|
|
1088
|
+
declare class CloudImageEditorActivity extends LitUploaderBlock {
|
|
1237
1089
|
couldBeCtxOwner: boolean;
|
|
1238
1090
|
activityType: "cloud-image-edit";
|
|
1239
1091
|
private _entry?;
|
|
1240
|
-
private
|
|
1092
|
+
private editorConfig;
|
|
1241
1093
|
get activityParams(): ActivityParams$1;
|
|
1242
1094
|
initCallback(): void;
|
|
1243
1095
|
handleApply(e: CustomEvent<ApplyResult>): void;
|
|
1244
|
-
handleCancel(): void;
|
|
1096
|
+
handleCancel(event?: Event): void;
|
|
1097
|
+
handleChange(event: CustomEvent<ChangeResult>): void;
|
|
1245
1098
|
mountEditor(): void;
|
|
1246
1099
|
unmountEditor(): void;
|
|
1100
|
+
render(): lit_html.TemplateResult<1> | typeof nothing;
|
|
1101
|
+
private _createEditorConfig;
|
|
1247
1102
|
}
|
|
1248
1103
|
|
|
1249
1104
|
type ActivityParams = {
|
|
1250
1105
|
externalSourceType: string;
|
|
1251
1106
|
};
|
|
1252
|
-
declare class ExternalSource extends
|
|
1107
|
+
declare class ExternalSource extends LitUploaderBlock {
|
|
1253
1108
|
couldBeCtxOwner: boolean;
|
|
1254
1109
|
activityType: "external";
|
|
1255
1110
|
private _messageBridge?;
|
|
1256
|
-
|
|
1111
|
+
private iframeRef;
|
|
1112
|
+
private _latestSelectionSummary;
|
|
1113
|
+
private selectedList;
|
|
1114
|
+
private isSelectionReady;
|
|
1115
|
+
private isDoneBtnEnabled;
|
|
1116
|
+
private couldSelectAll;
|
|
1117
|
+
private couldDeselectAll;
|
|
1118
|
+
private showSelectionStatus;
|
|
1119
|
+
private showDoneBtn;
|
|
1120
|
+
private doneBtnTextClass;
|
|
1121
|
+
private toolbarVisible;
|
|
1122
|
+
private get counterText();
|
|
1257
1123
|
get activityParams(): ActivityParams;
|
|
1258
1124
|
initCallback(): void;
|
|
1259
1125
|
private extractUrlFromSelectedFile;
|
|
@@ -1264,9 +1130,15 @@ declare class ExternalSource extends UploaderBlock {
|
|
|
1264
1130
|
private applyEmbedCss;
|
|
1265
1131
|
private setupL10n;
|
|
1266
1132
|
private remoteUrl;
|
|
1133
|
+
private _handleDone;
|
|
1134
|
+
private _handleCancel;
|
|
1135
|
+
private _handleSelectAll;
|
|
1136
|
+
private _handleDeselectAll;
|
|
1137
|
+
private _setSelectionSummary;
|
|
1267
1138
|
private mountIframe;
|
|
1268
1139
|
private unmountIframe;
|
|
1269
1140
|
private resetSelectionStatus;
|
|
1141
|
+
render(): lit_html.TemplateResult<1>;
|
|
1270
1142
|
}
|
|
1271
1143
|
|
|
1272
1144
|
declare const ACTIVE_PROP = "___ACTIVITY_IS_ACTIVE___";
|
|
@@ -1274,7 +1146,7 @@ type ActivityParamsMap = {
|
|
|
1274
1146
|
'cloud-image-edit': ActivityParams$1;
|
|
1275
1147
|
external: ActivityParams;
|
|
1276
1148
|
};
|
|
1277
|
-
declare class
|
|
1149
|
+
declare class LitActivityBlock extends LitBlock {
|
|
1278
1150
|
protected historyTracked: boolean;
|
|
1279
1151
|
private [ACTIVE_PROP]?;
|
|
1280
1152
|
init$: {
|
|
@@ -1310,79 +1182,331 @@ declare class ActivityBlock extends Block {
|
|
|
1310
1182
|
onDeactivate?: () => void;
|
|
1311
1183
|
}): void;
|
|
1312
1184
|
unregisterActivity(): void;
|
|
1313
|
-
|
|
1185
|
+
disconnectedCallback(): void;
|
|
1314
1186
|
get activityKey(): string;
|
|
1315
1187
|
get activityParams(): ActivityParamsMap[keyof ActivityParamsMap];
|
|
1316
|
-
get initActivity(): string;
|
|
1317
|
-
get doneActivity(): string;
|
|
1188
|
+
get initActivity(): string | null;
|
|
1189
|
+
get doneActivity(): string | null;
|
|
1318
1190
|
historyBack(): void;
|
|
1319
1191
|
}
|
|
1320
|
-
type RegisteredActivityType = (typeof
|
|
1192
|
+
type RegisteredActivityType = (typeof LitActivityBlock)['activities'][keyof (typeof LitActivityBlock)['activities']];
|
|
1321
1193
|
type ActivityType = RegisteredActivityType | (string & {}) | null;
|
|
1322
1194
|
|
|
1323
|
-
declare
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1195
|
+
declare const InternalEventType: Readonly<{
|
|
1196
|
+
readonly INIT_SOLUTION: "init-solution";
|
|
1197
|
+
readonly CHANGE_CONFIG: "change-config";
|
|
1198
|
+
readonly ACTION_EVENT: "action-event";
|
|
1199
|
+
readonly ERROR_EVENT: "error-event";
|
|
1200
|
+
}>;
|
|
1201
|
+
declare const EventType: Readonly<{
|
|
1202
|
+
readonly FILE_ADDED: "file-added";
|
|
1203
|
+
readonly FILE_REMOVED: "file-removed";
|
|
1204
|
+
readonly FILE_UPLOAD_START: "file-upload-start";
|
|
1205
|
+
readonly FILE_UPLOAD_PROGRESS: "file-upload-progress";
|
|
1206
|
+
readonly FILE_UPLOAD_SUCCESS: "file-upload-success";
|
|
1207
|
+
readonly FILE_UPLOAD_FAILED: "file-upload-failed";
|
|
1208
|
+
readonly FILE_URL_CHANGED: "file-url-changed";
|
|
1209
|
+
readonly MODAL_OPEN: "modal-open";
|
|
1210
|
+
readonly MODAL_CLOSE: "modal-close";
|
|
1211
|
+
readonly DONE_CLICK: "done-click";
|
|
1212
|
+
readonly UPLOAD_CLICK: "upload-click";
|
|
1213
|
+
readonly ACTIVITY_CHANGE: "activity-change";
|
|
1214
|
+
readonly COMMON_UPLOAD_START: "common-upload-start";
|
|
1215
|
+
readonly COMMON_UPLOAD_PROGRESS: "common-upload-progress";
|
|
1216
|
+
readonly COMMON_UPLOAD_SUCCESS: "common-upload-success";
|
|
1217
|
+
readonly COMMON_UPLOAD_FAILED: "common-upload-failed";
|
|
1218
|
+
readonly CHANGE: "change";
|
|
1219
|
+
readonly GROUP_CREATED: "group-created";
|
|
1220
|
+
}>;
|
|
1221
|
+
type EventKey = (typeof EventType)[keyof typeof EventType];
|
|
1222
|
+
type InternalEventKey = (typeof InternalEventType)[keyof typeof InternalEventType];
|
|
1223
|
+
type EventPayload = {
|
|
1224
|
+
[EventType.FILE_ADDED]: OutputFileEntry<'idle'>;
|
|
1225
|
+
[EventType.FILE_REMOVED]: OutputFileEntry<'removed'>;
|
|
1226
|
+
[EventType.FILE_UPLOAD_START]: OutputFileEntry<'uploading'>;
|
|
1227
|
+
[EventType.FILE_UPLOAD_PROGRESS]: OutputFileEntry<'uploading'>;
|
|
1228
|
+
[EventType.FILE_UPLOAD_SUCCESS]: OutputFileEntry<'success'>;
|
|
1229
|
+
[EventType.FILE_UPLOAD_FAILED]: OutputFileEntry<'failed'>;
|
|
1230
|
+
[EventType.FILE_URL_CHANGED]: OutputFileEntry<'success'>;
|
|
1231
|
+
[EventType.MODAL_OPEN]: {
|
|
1232
|
+
modalId: ModalId;
|
|
1233
|
+
};
|
|
1234
|
+
[EventType.MODAL_CLOSE]: {
|
|
1235
|
+
modalId: ModalId;
|
|
1236
|
+
hasActiveModals: boolean;
|
|
1237
|
+
};
|
|
1238
|
+
[EventType.ACTIVITY_CHANGE]: {
|
|
1239
|
+
activity: ActivityType;
|
|
1240
|
+
};
|
|
1241
|
+
[EventType.UPLOAD_CLICK]: void;
|
|
1242
|
+
[EventType.DONE_CLICK]: OutputCollectionState;
|
|
1243
|
+
[EventType.COMMON_UPLOAD_START]: OutputCollectionState<'uploading'>;
|
|
1244
|
+
[EventType.COMMON_UPLOAD_PROGRESS]: OutputCollectionState<'uploading'>;
|
|
1245
|
+
[EventType.COMMON_UPLOAD_SUCCESS]: OutputCollectionState<'success'>;
|
|
1246
|
+
[EventType.COMMON_UPLOAD_FAILED]: OutputCollectionState<'failed'>;
|
|
1247
|
+
[EventType.CHANGE]: OutputCollectionState;
|
|
1248
|
+
[EventType.GROUP_CREATED]: OutputCollectionState<'success', 'has-group'>;
|
|
1249
|
+
};
|
|
1250
|
+
declare class EventEmitter {
|
|
1251
|
+
private _timeoutStore;
|
|
1252
|
+
private _targets;
|
|
1253
|
+
private _debugPrint;
|
|
1254
|
+
constructor(debugPrint: (...args: unknown[]) => void);
|
|
1255
|
+
bindTarget(target: LitBlock): void;
|
|
1256
|
+
unbindTarget(target: LitBlock): void;
|
|
1257
|
+
private _dispatch;
|
|
1258
|
+
emit<T extends EventKey, TDebounce extends boolean | number | undefined = undefined>(type: T, payload?: TDebounce extends false | undefined ? EventPayload[T] : () => EventPayload[T], options?: {
|
|
1259
|
+
debounce?: TDebounce;
|
|
1260
|
+
}): void;
|
|
1261
|
+
}
|
|
1337
1262
|
|
|
1338
|
-
|
|
1263
|
+
type CommonEventType = InternalEventKey | EventKey;
|
|
1264
|
+
type TelemetryState = TelemetryRequest & {
|
|
1265
|
+
eventTimestamp: number;
|
|
1266
|
+
location: string;
|
|
1267
|
+
};
|
|
1268
|
+
type TelemetryEventBody = Partial<Pick<TelemetryState, 'payload' | 'config'>> & {
|
|
1269
|
+
modalId?: string;
|
|
1270
|
+
eventType?: CommonEventType;
|
|
1271
|
+
};
|
|
1272
|
+
declare class TelemetryManager {
|
|
1273
|
+
private readonly _sessionId;
|
|
1274
|
+
private readonly _telemetryInstance;
|
|
1275
|
+
private readonly _block;
|
|
1276
|
+
private _config;
|
|
1277
|
+
private _initialized;
|
|
1278
|
+
private _lastPayload;
|
|
1279
|
+
private readonly _queue;
|
|
1280
|
+
constructor(block: LitBlock);
|
|
1281
|
+
private _init;
|
|
1282
|
+
private _setConfig;
|
|
1283
|
+
private _formattingPayload;
|
|
1284
|
+
private _excludedEvents;
|
|
1285
|
+
sendEvent(body: TelemetryEventBody): void;
|
|
1286
|
+
sendEventError(error: unknown, context?: string): void;
|
|
1287
|
+
/**
|
|
1288
|
+
* Method to send telemetry event for Cloud Image Editor.
|
|
1289
|
+
*/
|
|
1290
|
+
sendEventCloudImageEditor(e: MouseEvent, tabId: string, options?: Record<string, unknown>): void;
|
|
1291
|
+
/**
|
|
1292
|
+
* Deeply compares two objects and returns true if they are equal, false otherwise.
|
|
1293
|
+
*/
|
|
1294
|
+
private _checkObj;
|
|
1295
|
+
private get _timestamp();
|
|
1296
|
+
private get _solution();
|
|
1297
|
+
private get _activity();
|
|
1298
|
+
private get _location();
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
declare const LitBlockBase: typeof LitElement & Constructor$1<{
|
|
1302
|
+
yield(slot: string, defaultContent?: unknown): unknown;
|
|
1303
|
+
}> & Constructor$1<{
|
|
1304
|
+
getCssData(propName: string, silentCheck?: boolean): string | number | boolean | null | undefined;
|
|
1305
|
+
}> & Constructor$1<{
|
|
1306
|
+
$: {
|
|
1307
|
+
[x: string]: any;
|
|
1308
|
+
};
|
|
1309
|
+
sub<T = unknown>(key: string, callback: (value: T) => void, init?: boolean): () => void;
|
|
1310
|
+
pub(key: string, value: unknown): void;
|
|
1311
|
+
set$(obj: {
|
|
1312
|
+
[x: string]: any;
|
|
1313
|
+
}): void;
|
|
1314
|
+
has(key: string): boolean;
|
|
1315
|
+
add(key: string, val: unknown, rewrite?: boolean): void;
|
|
1316
|
+
add$(obj: {
|
|
1317
|
+
[x: string]: any;
|
|
1318
|
+
}, rewrite?: boolean): void;
|
|
1319
|
+
initCallback(): void;
|
|
1320
|
+
sharedCtx: PubSub<Record<string, unknown>>;
|
|
1321
|
+
ctxName: string;
|
|
1322
|
+
}> & Constructor$1<LitElement> & {
|
|
1323
|
+
reg(tagName: string): void;
|
|
1324
|
+
};
|
|
1325
|
+
declare class LitBlock extends LitBlockBase {
|
|
1326
|
+
private __cfgProxy;
|
|
1339
1327
|
static styleAttrs: string[];
|
|
1340
|
-
|
|
1341
|
-
init$: {
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1328
|
+
activityType: ActivityType;
|
|
1329
|
+
init$: {};
|
|
1330
|
+
constructor();
|
|
1331
|
+
l10n(str: string, variables?: Record<string, string | number>): string;
|
|
1332
|
+
private pluralize;
|
|
1333
|
+
emit(type: Parameters<EventEmitter['emit']>[0], payload?: Parameters<EventEmitter['emit']>[1], options?: Parameters<EventEmitter['emit']>[2]): void;
|
|
1334
|
+
hasBlockInCtx(callback: (block: LitBlock) => boolean): boolean;
|
|
1335
|
+
setOrAddState(prop: string, newVal: unknown): void;
|
|
1336
|
+
connectedCallback(): void;
|
|
1337
|
+
initCallback(): void;
|
|
1338
|
+
get testId(): string;
|
|
1339
|
+
get modalManager(): ModalManager | undefined;
|
|
1340
|
+
get telemetryManager(): TelemetryManager | {
|
|
1341
|
+
sendEvent: () => void;
|
|
1342
|
+
sendEventCloudImageEditor: () => void;
|
|
1343
|
+
sendEventError: () => void;
|
|
1356
1344
|
};
|
|
1357
|
-
|
|
1345
|
+
protected get localeManager(): LocaleManager | null;
|
|
1346
|
+
protected get a11y(): A11y | null;
|
|
1347
|
+
protected get blocksRegistry(): Set<LitBlock>;
|
|
1348
|
+
disconnectedCallback(): void;
|
|
1349
|
+
/**
|
|
1350
|
+
* Called when the last block is removed from the context. Note that inheritors must run their callback before that.
|
|
1351
|
+
*/
|
|
1352
|
+
protected destroyCtxCallback(): void;
|
|
1353
|
+
protected proxyUrl(url: string): Promise<string>;
|
|
1354
|
+
get cfg(): ConfigType;
|
|
1355
|
+
subConfigValue<T extends keyof ConfigType>(key: T, callback: (value: ConfigType[T]) => void): () => void;
|
|
1356
|
+
debugPrint(...args: unknown[]): void;
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
declare class Modal extends LitBlock {
|
|
1360
|
+
static styleAttrs: string[];
|
|
1361
|
+
private _mouseDownTarget;
|
|
1362
|
+
private dialogEl;
|
|
1363
|
+
handleModalOpen: ModalCb;
|
|
1364
|
+
handleModalClose: ModalCb;
|
|
1365
|
+
handleModalCloseAll: ModalCb;
|
|
1366
|
+
_handleBackdropClick: () => void;
|
|
1367
|
+
_closeDialog: () => void;
|
|
1368
|
+
_handleDialogClose: () => void;
|
|
1369
|
+
_handleDialogMouseDown: (e: MouseEvent) => void;
|
|
1370
|
+
_handleDialogMouseUp: (e: MouseEvent) => void;
|
|
1371
|
+
show(): void;
|
|
1372
|
+
hide(): void;
|
|
1373
|
+
private _handleModalOpen;
|
|
1374
|
+
private _handleModalClose;
|
|
1375
|
+
private _handleModalCloseAll;
|
|
1358
1376
|
initCallback(): void;
|
|
1359
|
-
|
|
1360
|
-
|
|
1377
|
+
disconnectedCallback(): void;
|
|
1378
|
+
private handleDialogRef;
|
|
1379
|
+
render(): lit_html.TemplateResult<1>;
|
|
1361
1380
|
}
|
|
1362
1381
|
|
|
1363
|
-
declare
|
|
1382
|
+
declare const ModalEvents: Readonly<{
|
|
1383
|
+
readonly ADD: "modal:add";
|
|
1384
|
+
readonly DELETE: "modal:delete";
|
|
1385
|
+
readonly OPEN: "modal:open";
|
|
1386
|
+
readonly CLOSE: "modal:close";
|
|
1387
|
+
readonly CLOSE_ALL: "modal:closeAll";
|
|
1388
|
+
readonly DESTROY: "modal:destroy";
|
|
1389
|
+
}>;
|
|
1390
|
+
type ModalId = ActivityType;
|
|
1391
|
+
type ModalCb = (data: {
|
|
1392
|
+
id: ModalId;
|
|
1393
|
+
modal: Modal;
|
|
1394
|
+
}) => void;
|
|
1395
|
+
type ModalEventType = (typeof ModalEvents)[keyof typeof ModalEvents];
|
|
1396
|
+
declare class ModalManager {
|
|
1397
|
+
private _modals;
|
|
1398
|
+
private _activeModals;
|
|
1399
|
+
private _subscribers;
|
|
1400
|
+
private _block;
|
|
1401
|
+
constructor(block: LitBlock);
|
|
1402
|
+
private _debugPrint;
|
|
1403
|
+
/**
|
|
1404
|
+
* Register a modal with the manager
|
|
1405
|
+
* @param id Unique identifier for the modal
|
|
1406
|
+
* @param modal Modal component instance
|
|
1407
|
+
*/
|
|
1408
|
+
registerModal(id: ModalId, modal: Modal): void;
|
|
1409
|
+
/** Remove a modal by ID. */
|
|
1410
|
+
deleteModal(id: ModalId): boolean;
|
|
1411
|
+
/** Open a modal by its ID. */
|
|
1412
|
+
open(id: ModalId): boolean;
|
|
1413
|
+
/** Close a specific modal by ID. */
|
|
1414
|
+
close(id: ModalId): boolean;
|
|
1415
|
+
/** Toggle a modal - open if closed, close if open. */
|
|
1416
|
+
toggle(id: ModalId): boolean;
|
|
1417
|
+
/** True if there are any active modals. */
|
|
1418
|
+
get hasActiveModals(): boolean;
|
|
1419
|
+
/** Close the most recently opened modal and return to the previous one. */
|
|
1420
|
+
back(): boolean;
|
|
1421
|
+
/** Close all open modals. */
|
|
1422
|
+
closeAll(): number;
|
|
1423
|
+
/**
|
|
1424
|
+
* Subscribe to modal events
|
|
1425
|
+
* @returns Unsubscribe function
|
|
1426
|
+
*/
|
|
1427
|
+
subscribe(event: ModalEventType, callback: ModalCb): () => void;
|
|
1428
|
+
/** Unsubscribe from modal events */
|
|
1429
|
+
unsubscribe(event: ModalEventType, callback: ModalCb | undefined): void;
|
|
1430
|
+
/** Notify all subscribers of a modal event. */
|
|
1431
|
+
private _notify;
|
|
1432
|
+
/** Destroy the modal manager, clean up resources */
|
|
1433
|
+
destroy(): void;
|
|
1364
1434
|
}
|
|
1365
1435
|
|
|
1366
|
-
declare class
|
|
1436
|
+
declare class ActivityHeader extends LitActivityBlock {
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
declare function initState(fnCtx: CloudImageEditorBlock): {
|
|
1440
|
+
'*originalUrl': null;
|
|
1441
|
+
'*loadingOperations': LoadingOperations;
|
|
1442
|
+
'*faderEl': null;
|
|
1443
|
+
'*cropperEl': null;
|
|
1444
|
+
'*imgEl': null;
|
|
1445
|
+
'*imgContainerEl': null;
|
|
1446
|
+
'*networkProblems': boolean;
|
|
1447
|
+
'*imageSize': null;
|
|
1448
|
+
'*editorTransformations': {};
|
|
1449
|
+
'*cropPresetList': never[];
|
|
1450
|
+
'*currentAspectRatio': null;
|
|
1451
|
+
'*tabList': readonly ["crop", "tuning", "filters"];
|
|
1452
|
+
'*tabId': "crop";
|
|
1453
|
+
'*on.retryNetwork': () => void;
|
|
1454
|
+
'*on.apply': (transformations: Transformations) => void;
|
|
1455
|
+
'*on.cancel': () => void;
|
|
1456
|
+
};
|
|
1457
|
+
|
|
1458
|
+
declare class CloudImageEditorBlock extends LitBlock {
|
|
1367
1459
|
ctxOwner: boolean;
|
|
1368
1460
|
static styleAttrs: string[];
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1461
|
+
entry: unknown;
|
|
1462
|
+
extension: string | null;
|
|
1463
|
+
editorMode: boolean;
|
|
1464
|
+
modalCaption: string;
|
|
1465
|
+
isImage: boolean;
|
|
1466
|
+
msg: string;
|
|
1467
|
+
src: string;
|
|
1468
|
+
fileType: string;
|
|
1469
|
+
showLoader: boolean;
|
|
1470
|
+
uuid: string | null;
|
|
1471
|
+
cdnUrl: string | null;
|
|
1472
|
+
cropPreset: string;
|
|
1473
|
+
tabs: string | null;
|
|
1474
|
+
presenceNetworkProblems: boolean;
|
|
1475
|
+
presenceModalCaption: boolean;
|
|
1476
|
+
presenceEditorToolbar: boolean;
|
|
1477
|
+
presenceViewerToolbar: boolean;
|
|
1478
|
+
private isInitialized;
|
|
1479
|
+
private pendingInitUpdate;
|
|
1480
|
+
private readonly _debouncedShowLoader;
|
|
1481
|
+
private readonly imgRef;
|
|
1482
|
+
private readonly cropperRef;
|
|
1483
|
+
private readonly faderRef;
|
|
1484
|
+
private readonly imgContainerRef;
|
|
1485
|
+
private readonly handleImageLoad;
|
|
1486
|
+
private readonly handleImageError;
|
|
1487
|
+
private readonly handleRetryNetwork;
|
|
1488
|
+
private scheduleInitialization;
|
|
1489
|
+
init$: ReturnType<typeof initState>;
|
|
1490
|
+
initCallback(): void;
|
|
1491
|
+
private assignSharedElements;
|
|
1492
|
+
private attachImageListeners;
|
|
1493
|
+
private detachImageListeners;
|
|
1494
|
+
private get imageClassName();
|
|
1372
1495
|
/**
|
|
1373
1496
|
* To proper work, we need non-zero size the element. So, we'll wait for it.
|
|
1374
1497
|
*/
|
|
1375
1498
|
private _waitForSize;
|
|
1376
|
-
|
|
1499
|
+
firstUpdated(_changedProperties: Map<PropertyKey, unknown>): void;
|
|
1500
|
+
disconnectedCallback(): void;
|
|
1501
|
+
render(): lit_html.TemplateResult<1>;
|
|
1502
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
1503
|
+
private syncTabListFromProp;
|
|
1504
|
+
private syncCropPresetState;
|
|
1377
1505
|
updateImage(): Promise<void>;
|
|
1378
1506
|
initEditor(): Promise<void>;
|
|
1379
1507
|
}
|
|
1380
1508
|
|
|
1381
|
-
declare class CropFrame extends
|
|
1382
|
-
private readonly _handlePointerUp;
|
|
1383
|
-
private readonly _handlePointerMove;
|
|
1384
|
-
private readonly _handleSvgPointerMove;
|
|
1385
|
-
private readonly _backdropMaskId;
|
|
1509
|
+
declare class CropFrame extends LitBlock {
|
|
1386
1510
|
private _backdropMask?;
|
|
1387
1511
|
private _backdropMaskInner?;
|
|
1388
1512
|
private _frameThumbs?;
|
|
@@ -1393,7 +1517,14 @@ declare class CropFrame extends Block {
|
|
|
1393
1517
|
private _dragStartCrop?;
|
|
1394
1518
|
private _frameImage?;
|
|
1395
1519
|
private _guidesHidden;
|
|
1396
|
-
|
|
1520
|
+
private _dragging;
|
|
1521
|
+
private readonly svgRef;
|
|
1522
|
+
private _svgReady;
|
|
1523
|
+
private _pendingMaskHref;
|
|
1524
|
+
private get _svgElement();
|
|
1525
|
+
private get dragging();
|
|
1526
|
+
private set dragging(value);
|
|
1527
|
+
private _applyGuidesDragState;
|
|
1397
1528
|
private _shouldThumbBeDisabled;
|
|
1398
1529
|
private _createBackdrop;
|
|
1399
1530
|
/**
|
|
@@ -1408,41 +1539,57 @@ declare class CropFrame extends Block {
|
|
|
1408
1539
|
private _createGuides;
|
|
1409
1540
|
private _createFrame;
|
|
1410
1541
|
private _handlePointerDown;
|
|
1411
|
-
private
|
|
1412
|
-
private
|
|
1542
|
+
private readonly _handlePointerUp;
|
|
1543
|
+
private readonly _handlePointerMove;
|
|
1413
1544
|
private _calcCropBox;
|
|
1414
|
-
private
|
|
1545
|
+
private readonly _handleSvgPointerMove;
|
|
1415
1546
|
private _updateCursor;
|
|
1416
1547
|
private _createMask;
|
|
1417
1548
|
private _updateMask;
|
|
1418
1549
|
private _render;
|
|
1419
1550
|
toggleThumbs(visible: boolean): void;
|
|
1420
1551
|
initCallback(): void;
|
|
1421
|
-
|
|
1552
|
+
protected firstUpdated(_changedProperties: PropertyValues<this>): void;
|
|
1553
|
+
private _initializeSvg;
|
|
1554
|
+
disconnectedCallback(): void;
|
|
1555
|
+
render(): TemplateResult;
|
|
1422
1556
|
}
|
|
1423
1557
|
|
|
1424
|
-
declare class EditorButtonControl extends
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1558
|
+
declare class EditorButtonControl extends LitBlock {
|
|
1559
|
+
active: boolean;
|
|
1560
|
+
title: string;
|
|
1561
|
+
icon: string;
|
|
1562
|
+
titleProp: string;
|
|
1563
|
+
protected get buttonClasses(): Record<string, boolean>;
|
|
1564
|
+
private updateHostStateClasses;
|
|
1565
|
+
protected onClick(_event: MouseEvent): void;
|
|
1566
|
+
connectedCallback(): void;
|
|
1567
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
1568
|
+
render(): lit_html.TemplateResult<1>;
|
|
1428
1569
|
}
|
|
1429
1570
|
|
|
1430
1571
|
declare class EditorFreeformButtonControl extends EditorButtonControl {
|
|
1431
1572
|
initCallback(): void;
|
|
1432
|
-
|
|
1573
|
+
onClick(): void;
|
|
1574
|
+
private computeTitle;
|
|
1575
|
+
render(): lit_html.TemplateResult<1>;
|
|
1433
1576
|
}
|
|
1434
|
-
|
|
1577
|
+
declare class EditorAspectRatioButtonControl extends EditorButtonControl {
|
|
1578
|
+
private _aspectRatio?;
|
|
1435
1579
|
get aspectRatio(): CropAspectRatio | undefined;
|
|
1436
1580
|
set aspectRatio(value: CropAspectRatio | undefined);
|
|
1437
|
-
}
|
|
1438
|
-
declare class EditorAspectRatioButtonControl extends EditorButtonControl {
|
|
1439
|
-
constructor();
|
|
1440
1581
|
initCallback(): void;
|
|
1441
|
-
|
|
1442
|
-
private
|
|
1443
|
-
private
|
|
1582
|
+
onClick(): void;
|
|
1583
|
+
private updateAspectRatioPresentation;
|
|
1584
|
+
private renderIcon;
|
|
1585
|
+
render(): lit_html.TemplateResult<1>;
|
|
1444
1586
|
}
|
|
1445
1587
|
|
|
1588
|
+
declare const TabId: Readonly<{
|
|
1589
|
+
readonly CROP: "crop";
|
|
1590
|
+
readonly TUNING: "tuning";
|
|
1591
|
+
readonly FILTERS: "filters";
|
|
1592
|
+
}>;
|
|
1446
1593
|
declare const ALL_COLOR_OPERATIONS: readonly ["brightness", "exposure", "gamma", "contrast", "saturation", "vibrance", "warmth", "enhance"];
|
|
1447
1594
|
type ColorOperation = (typeof ALL_COLOR_OPERATIONS)[number];
|
|
1448
1595
|
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"];
|
|
@@ -1498,13 +1645,10 @@ declare const COLOR_OPERATIONS_CONFIG: Readonly<{
|
|
|
1498
1645
|
};
|
|
1499
1646
|
}>;
|
|
1500
1647
|
|
|
1501
|
-
interface EditorCropButtonControl {
|
|
1502
|
-
get operation(): CropOperation | undefined;
|
|
1503
|
-
set operation(value: CropOperation | undefined);
|
|
1504
|
-
}
|
|
1505
1648
|
declare class EditorCropButtonControl extends EditorButtonControl {
|
|
1506
|
-
|
|
1507
|
-
|
|
1649
|
+
operation: CropOperation | undefined;
|
|
1650
|
+
protected willUpdate(_changedProperties: PropertyValues): void;
|
|
1651
|
+
onClick(e: MouseEvent): void;
|
|
1508
1652
|
}
|
|
1509
1653
|
|
|
1510
1654
|
declare class EditorFilterControl extends EditorButtonControl {
|
|
@@ -1513,11 +1657,27 @@ declare class EditorFilterControl extends EditorButtonControl {
|
|
|
1513
1657
|
private _originalUrl;
|
|
1514
1658
|
private _observer?;
|
|
1515
1659
|
private _cancelPreload?;
|
|
1516
|
-
|
|
1660
|
+
private _lastPreviewRequestId;
|
|
1661
|
+
private previewVisibilityCheckRaf?;
|
|
1662
|
+
private previewVisibilityCheckTimeout?;
|
|
1663
|
+
private previewImage;
|
|
1664
|
+
private previewLoaded;
|
|
1665
|
+
isOriginal: boolean;
|
|
1666
|
+
iconSize: number;
|
|
1667
|
+
get filter(): string;
|
|
1668
|
+
set filter(value: string);
|
|
1669
|
+
onClick(e: MouseEvent): void;
|
|
1517
1670
|
private _previewSrc;
|
|
1518
1671
|
private _observerCallback;
|
|
1519
1672
|
initCallback(): void;
|
|
1520
|
-
|
|
1673
|
+
disconnectedCallback(): void;
|
|
1674
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
1675
|
+
private updateFilterLabels;
|
|
1676
|
+
private loadPreview;
|
|
1677
|
+
private schedulePreviewVisibilityCheck;
|
|
1678
|
+
private clearPreviewVisibilityChecks;
|
|
1679
|
+
private get shouldShowPreview();
|
|
1680
|
+
render(): lit_html.TemplateResult<1>;
|
|
1521
1681
|
}
|
|
1522
1682
|
|
|
1523
1683
|
type Operations = {
|
|
@@ -1525,7 +1685,7 @@ type Operations = {
|
|
|
1525
1685
|
mirror: boolean;
|
|
1526
1686
|
rotate: number;
|
|
1527
1687
|
};
|
|
1528
|
-
declare class EditorImageCropper extends
|
|
1688
|
+
declare class EditorImageCropper extends LitBlock {
|
|
1529
1689
|
ctxOwner: boolean;
|
|
1530
1690
|
private _commitDebounced;
|
|
1531
1691
|
private _handleResizeThrottled;
|
|
@@ -1534,9 +1694,12 @@ declare class EditorImageCropper extends Block {
|
|
|
1534
1694
|
private _ctx;
|
|
1535
1695
|
private _isActive;
|
|
1536
1696
|
private _observer?;
|
|
1697
|
+
private _image;
|
|
1537
1698
|
private _cancelPreload?;
|
|
1699
|
+
private readonly canvasRef;
|
|
1700
|
+
private readonly frameRef;
|
|
1538
1701
|
constructor();
|
|
1539
|
-
|
|
1702
|
+
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
1540
1703
|
private _syncTransformations;
|
|
1541
1704
|
private _initCanvas;
|
|
1542
1705
|
private _alignImage;
|
|
@@ -1561,11 +1724,12 @@ declare class EditorImageCropper extends Block {
|
|
|
1561
1724
|
private _waitForImage;
|
|
1562
1725
|
private _handleImageLoading;
|
|
1563
1726
|
initCallback(): void;
|
|
1564
|
-
|
|
1727
|
+
disconnectedCallback(): void;
|
|
1728
|
+
render(): TemplateResult;
|
|
1565
1729
|
}
|
|
1566
1730
|
|
|
1567
1731
|
type OperationKey = keyof typeof COLOR_OPERATIONS_CONFIG;
|
|
1568
|
-
declare class EditorImageFader extends
|
|
1732
|
+
declare class EditorImageFader extends LitBlock {
|
|
1569
1733
|
private _isActive;
|
|
1570
1734
|
private _hidden;
|
|
1571
1735
|
private _operation;
|
|
@@ -1573,7 +1737,6 @@ declare class EditorImageFader extends Block {
|
|
|
1573
1737
|
private _value?;
|
|
1574
1738
|
private _transformations;
|
|
1575
1739
|
private _keypoints;
|
|
1576
|
-
private _container?;
|
|
1577
1740
|
private _previewImage?;
|
|
1578
1741
|
private _cancelLastImages?;
|
|
1579
1742
|
private _cancelBatchPreload?;
|
|
@@ -1581,6 +1744,8 @@ declare class EditorImageFader extends Block {
|
|
|
1581
1744
|
private _fromViewer?;
|
|
1582
1745
|
private _raf;
|
|
1583
1746
|
private _addKeypointDebounced;
|
|
1747
|
+
private readonly _previewHostRef;
|
|
1748
|
+
private readonly _layersHostRef;
|
|
1584
1749
|
constructor();
|
|
1585
1750
|
private _handleImageLoading;
|
|
1586
1751
|
private _flush;
|
|
@@ -1590,7 +1755,6 @@ declare class EditorImageFader extends Block {
|
|
|
1590
1755
|
* Check if current operation and filter equals passed ones
|
|
1591
1756
|
*/
|
|
1592
1757
|
private _isSame;
|
|
1593
|
-
private _addKeypoint;
|
|
1594
1758
|
set(value: string | number): void;
|
|
1595
1759
|
private _update;
|
|
1596
1760
|
private _createPreviewImage;
|
|
@@ -1613,121 +1777,228 @@ declare class EditorImageFader extends Block {
|
|
|
1613
1777
|
deactivate({ hide }?: {
|
|
1614
1778
|
hide?: boolean;
|
|
1615
1779
|
}): void;
|
|
1780
|
+
private _ensurePreviewAttached;
|
|
1781
|
+
private _clearLayersHost;
|
|
1782
|
+
render(): TemplateResult;
|
|
1616
1783
|
}
|
|
1617
1784
|
|
|
1618
1785
|
declare class EditorOperationControl extends EditorButtonControl {
|
|
1619
1786
|
private _operation;
|
|
1787
|
+
get operation(): ColorOperation | '';
|
|
1788
|
+
set operation(value: ColorOperation | '');
|
|
1789
|
+
private updateOperationMetadata;
|
|
1620
1790
|
initCallback(): void;
|
|
1791
|
+
onClick(e: MouseEvent): void;
|
|
1621
1792
|
}
|
|
1622
1793
|
|
|
1623
|
-
declare class EditorScroller extends
|
|
1624
|
-
|
|
1794
|
+
declare class EditorScroller extends LitBlock {
|
|
1795
|
+
private readonly handleWheel;
|
|
1796
|
+
connectedCallback(): void;
|
|
1797
|
+
disconnectedCallback(): void;
|
|
1625
1798
|
}
|
|
1626
1799
|
|
|
1627
1800
|
type SliderOperation = ColorOperation | 'filter';
|
|
1628
1801
|
type SliderFilter = FilterId | typeof FAKE_ORIGINAL_FILTER;
|
|
1629
1802
|
declare const FAKE_ORIGINAL_FILTER = "original";
|
|
1630
|
-
declare class EditorSlider extends
|
|
1631
|
-
private
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1803
|
+
declare class EditorSlider extends LitBlock {
|
|
1804
|
+
private state;
|
|
1805
|
+
handleInput: (e: CustomEvent<{
|
|
1806
|
+
value: number;
|
|
1807
|
+
}>) => void;
|
|
1635
1808
|
setOperation(operation: SliderOperation, filter?: SliderFilter): void;
|
|
1636
1809
|
private _initializeValues;
|
|
1637
1810
|
apply(): void;
|
|
1638
1811
|
cancel(): void;
|
|
1639
1812
|
initCallback(): void;
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1813
|
+
protected updated(changedProperties: Map<PropertyKey, unknown>): void;
|
|
1814
|
+
render(): lit_html.TemplateResult<1>;
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
type TabIdValue = (typeof TabId)[keyof typeof TabId];
|
|
1818
|
+
declare class EditorToolbar extends LitBlock {
|
|
1819
|
+
private showLoader;
|
|
1820
|
+
private showMainToolbar;
|
|
1821
|
+
private showSubToolbar;
|
|
1822
|
+
private showTabToggles;
|
|
1823
|
+
private tabList;
|
|
1824
|
+
private activeTab;
|
|
1825
|
+
private useSliderPanel;
|
|
1826
|
+
private tooltipVisible;
|
|
1827
|
+
private operationTooltip;
|
|
1828
|
+
private tabIndicatorOffset;
|
|
1829
|
+
private tabIndicatorWidth;
|
|
1830
|
+
private readonly sliderRef;
|
|
1831
|
+
private readonly tabIndicatorRef;
|
|
1832
|
+
protected readonly tabToggleRefs: Record<TabIdValue, Ref<HTMLElement>>;
|
|
1833
|
+
private readonly handleWindowResize;
|
|
1834
|
+
private cropPresets;
|
|
1644
1835
|
private _cancelPreload?;
|
|
1645
|
-
private
|
|
1646
|
-
|
|
1836
|
+
private readonly _debouncedShowLoader;
|
|
1837
|
+
private readonly _updateInfoTooltip;
|
|
1838
|
+
private readonly subTopToolbarStyles;
|
|
1839
|
+
private readonly subBottomToolbarStyles;
|
|
1840
|
+
private readonly tabContentStyles;
|
|
1841
|
+
private readonly tabToggleStyles;
|
|
1842
|
+
private readonly tabTogglesStyles;
|
|
1843
|
+
init$: Record<string, unknown>;
|
|
1647
1844
|
private _onSliderClose;
|
|
1648
|
-
private _createOperationControl;
|
|
1649
|
-
private _createFilterControl;
|
|
1650
|
-
private _createToggleControl;
|
|
1651
|
-
private _createAspectRatioControl;
|
|
1652
|
-
private _createFreeformControl;
|
|
1653
|
-
private _clearListAspectRatio;
|
|
1654
|
-
private _renderControlsList;
|
|
1655
1845
|
private _activateTab;
|
|
1656
|
-
private
|
|
1846
|
+
private applyTabState;
|
|
1657
1847
|
private _syncTabIndicator;
|
|
1848
|
+
private get hasAspectRatioPicker();
|
|
1849
|
+
private renderControlsByTab;
|
|
1850
|
+
private renderCropTabControls;
|
|
1851
|
+
private renderFilterTabControls;
|
|
1852
|
+
private renderTuningTabControls;
|
|
1853
|
+
private renderControlGroup;
|
|
1854
|
+
private renderFreeformControl;
|
|
1855
|
+
private renderAspectRatioControl;
|
|
1856
|
+
private renderCropOperationControl;
|
|
1857
|
+
private renderFilterControl;
|
|
1858
|
+
private renderOperationControl;
|
|
1859
|
+
private renderAspectRatioList;
|
|
1658
1860
|
private _preloadEditedImage;
|
|
1659
|
-
private _showLoader;
|
|
1660
|
-
private _updateInfoTooltipHandler;
|
|
1661
1861
|
initCallback(): void;
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
private
|
|
1667
|
-
private
|
|
1668
|
-
private
|
|
1669
|
-
|
|
1670
|
-
private
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1862
|
+
connectedCallback(): void;
|
|
1863
|
+
firstUpdated(_changedProperties: PropertyValues): void;
|
|
1864
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
1865
|
+
disconnectedCallback(): void;
|
|
1866
|
+
private assignSharedElements;
|
|
1867
|
+
private handleCancel;
|
|
1868
|
+
private handleApply;
|
|
1869
|
+
private handleApplySlider;
|
|
1870
|
+
private handleCancelSlider;
|
|
1871
|
+
private handleTabClick;
|
|
1872
|
+
private renderTabToggle;
|
|
1873
|
+
private renderTabContent;
|
|
1874
|
+
render(): TemplateResult<1>;
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1877
|
+
type Theme = string | null;
|
|
1878
|
+
declare class BtnUi extends LitBlock {
|
|
1879
|
+
text: string;
|
|
1880
|
+
icon: string;
|
|
1881
|
+
active: boolean;
|
|
1882
|
+
reverse: boolean;
|
|
1883
|
+
theme: Theme;
|
|
1884
|
+
ariaRole: string;
|
|
1885
|
+
ariaControls: string;
|
|
1886
|
+
titleProp: string;
|
|
1887
|
+
protected firstUpdated(_changed: PropertyValues<this>): void;
|
|
1888
|
+
protected updated(changed: PropertyValues<this>): void;
|
|
1889
|
+
private applyReverse;
|
|
1890
|
+
private applyThemeClass;
|
|
1891
|
+
private get iconClassMap();
|
|
1892
|
+
private get computedIconHidden();
|
|
1893
|
+
private get computedIconSingle();
|
|
1894
|
+
render(): lit_html.TemplateResult<1>;
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
declare class LineLoaderUi extends LitBlock {
|
|
1898
|
+
active: boolean;
|
|
1899
|
+
private readonly lineRef;
|
|
1900
|
+
private _isAnimating;
|
|
1901
|
+
private readonly handleTransitionEndRight;
|
|
1902
|
+
protected firstUpdated(_changedProperties: PropertyValues<this>): void;
|
|
1903
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
1904
|
+
private start;
|
|
1905
|
+
private stop;
|
|
1906
|
+
private resetLine;
|
|
1907
|
+
render(): lit_html.TemplateResult<1>;
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
type PresenceToggleStyle = {
|
|
1911
|
+
transition?: string;
|
|
1912
|
+
visible?: string;
|
|
1913
|
+
hidden?: string;
|
|
1914
|
+
};
|
|
1915
|
+
declare class PresenceToggle extends LitBlock {
|
|
1684
1916
|
private _visible;
|
|
1917
|
+
private _styles;
|
|
1685
1918
|
private _visibleStyle;
|
|
1686
1919
|
private _hiddenStyle;
|
|
1687
1920
|
private _externalTransitions;
|
|
1688
|
-
|
|
1921
|
+
private initialRenderComplete;
|
|
1922
|
+
set visible(value: boolean);
|
|
1923
|
+
get visible(): boolean;
|
|
1924
|
+
set styles(styles: PresenceToggleStyle);
|
|
1925
|
+
get styles(): PresenceToggleStyle;
|
|
1689
1926
|
private _handleVisible;
|
|
1927
|
+
private dispatchInitialRenderEvent;
|
|
1690
1928
|
initCallback(): void;
|
|
1691
1929
|
}
|
|
1692
1930
|
|
|
1693
|
-
declare class SliderUi extends
|
|
1931
|
+
declare class SliderUi extends LitBlock {
|
|
1694
1932
|
private _observer?;
|
|
1695
1933
|
private _thumbSize;
|
|
1696
|
-
private _zero;
|
|
1697
1934
|
private _zeroDotEl?;
|
|
1698
1935
|
private _stepsCount?;
|
|
1936
|
+
private readonly inputRef;
|
|
1937
|
+
private readonly thumbRef;
|
|
1938
|
+
private readonly stepsRef;
|
|
1939
|
+
disabled: boolean;
|
|
1940
|
+
min: number;
|
|
1941
|
+
max: number;
|
|
1942
|
+
defaultValue: number;
|
|
1943
|
+
zero: number;
|
|
1944
|
+
private _currentValue;
|
|
1699
1945
|
constructor();
|
|
1700
|
-
|
|
1701
|
-
private
|
|
1702
|
-
private
|
|
1703
|
-
private
|
|
1946
|
+
private emitSliderEvent;
|
|
1947
|
+
private readonly handleSliderInput;
|
|
1948
|
+
private readonly handleSliderChange;
|
|
1949
|
+
private readonly handleInputFocus;
|
|
1950
|
+
private readonly handleInputBlur;
|
|
1951
|
+
protected firstUpdated(changedProperties: Map<PropertyKey, unknown>): void;
|
|
1952
|
+
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
1704
1953
|
private _updateValue;
|
|
1705
1954
|
private _updateZeroDot;
|
|
1706
1955
|
private _updateSteps;
|
|
1707
|
-
|
|
1956
|
+
disconnectedCallback(): void;
|
|
1957
|
+
private _setCurrentValue;
|
|
1958
|
+
private _syncInputValue;
|
|
1959
|
+
private _extractEventValue;
|
|
1960
|
+
render(): lit_html.TemplateResult<1>;
|
|
1708
1961
|
}
|
|
1709
1962
|
|
|
1710
|
-
declare class Copyright extends
|
|
1963
|
+
declare class Copyright extends LitBlock {
|
|
1711
1964
|
initCallback(): void;
|
|
1712
|
-
|
|
1965
|
+
render(): lit_html.TemplateResult<1>;
|
|
1713
1966
|
}
|
|
1714
1967
|
|
|
1715
|
-
declare class DropArea extends
|
|
1968
|
+
declare class DropArea extends LitUploaderBlock {
|
|
1716
1969
|
static styleAttrs: string[];
|
|
1970
|
+
disabled: boolean;
|
|
1971
|
+
clickable: boolean;
|
|
1972
|
+
withIcon: boolean;
|
|
1973
|
+
fullscreen: boolean;
|
|
1974
|
+
initflow: boolean;
|
|
1975
|
+
text?: string;
|
|
1976
|
+
private isEnabled;
|
|
1977
|
+
private isVisible;
|
|
1978
|
+
private get localizedText();
|
|
1717
1979
|
private _destroyDropzone;
|
|
1718
1980
|
private _destroyContentWrapperDropzone;
|
|
1719
|
-
private
|
|
1720
|
-
|
|
1981
|
+
private contentWrapperRef;
|
|
1982
|
+
private readonly handleAreaInteraction;
|
|
1983
|
+
private sourceListAllowsLocal;
|
|
1984
|
+
private clickableListenersAttached;
|
|
1721
1985
|
isActive(): boolean;
|
|
1722
1986
|
initCallback(): void;
|
|
1987
|
+
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
1988
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
1723
1989
|
/** Ignore drop events if there are other visible drop areas on the page. */
|
|
1724
1990
|
private _shouldIgnore;
|
|
1725
1991
|
private _couldHandleFiles;
|
|
1726
|
-
|
|
1992
|
+
private updateIsEnabled;
|
|
1993
|
+
private updateVisibility;
|
|
1994
|
+
private updateDragStateAttribute;
|
|
1995
|
+
private updateClickableListeners;
|
|
1996
|
+
disconnectedCallback(): void;
|
|
1997
|
+
render(): lit_html.TemplateResult<1>;
|
|
1727
1998
|
}
|
|
1728
1999
|
|
|
1729
2000
|
type EntrySubscription = ReturnType<UploadEntryTypedData['subscribe']>;
|
|
1730
|
-
declare class FileItemConfig extends
|
|
2001
|
+
declare class FileItemConfig extends LitUploaderBlock {
|
|
1731
2002
|
protected _entrySubs: Set<EntrySubscription>;
|
|
1732
2003
|
protected _entry: UploadEntryTypedData | null;
|
|
1733
2004
|
protected _withEntry<A extends unknown[], R>(fn: (entry: UploadEntryTypedData, ...args: A) => R): (...args: A) => R | undefined;
|
|
@@ -1739,11 +2010,27 @@ declare class FileItemConfig extends UploaderBlock {
|
|
|
1739
2010
|
declare class FileItem extends FileItemConfig {
|
|
1740
2011
|
couldBeCtxOwner: boolean;
|
|
1741
2012
|
pauseRender: boolean;
|
|
2013
|
+
uid: string;
|
|
2014
|
+
protected itemName: string;
|
|
2015
|
+
protected errorText: string;
|
|
2016
|
+
protected hint: string;
|
|
2017
|
+
protected progressValue: number;
|
|
2018
|
+
protected progressVisible: boolean;
|
|
2019
|
+
protected badgeIcon: string;
|
|
2020
|
+
protected isFinished: boolean;
|
|
2021
|
+
protected isFailed: boolean;
|
|
2022
|
+
protected isUploading: boolean;
|
|
2023
|
+
protected isFocused: boolean;
|
|
2024
|
+
protected isEditable: boolean;
|
|
2025
|
+
protected showFileNames: boolean;
|
|
2026
|
+
protected ariaLabelStatusFile: string;
|
|
1742
2027
|
private _renderedOnce;
|
|
1743
2028
|
private _observer?;
|
|
1744
2029
|
protected _isIntersecting: boolean;
|
|
1745
2030
|
protected _thumbRect?: DOMRectReadOnly;
|
|
1746
|
-
|
|
2031
|
+
private _handleEdit;
|
|
2032
|
+
private _handleRemove;
|
|
2033
|
+
private _handleUploadClick;
|
|
1747
2034
|
private _calculateState;
|
|
1748
2035
|
private _debouncedCalculateState;
|
|
1749
2036
|
private _updateHintAndProgress;
|
|
@@ -1752,170 +2039,153 @@ declare class FileItem extends FileItemConfig {
|
|
|
1752
2039
|
private _observerCallback;
|
|
1753
2040
|
private _handleEntryId;
|
|
1754
2041
|
private _updateShowFileNames;
|
|
2042
|
+
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
1755
2043
|
initCallback(): void;
|
|
1756
|
-
destroyCallback(): void;
|
|
1757
2044
|
connectedCallback(): void;
|
|
1758
2045
|
disconnectedCallback(): void;
|
|
1759
|
-
private _settingsOfShrink;
|
|
1760
|
-
private _processShrink;
|
|
1761
2046
|
upload: () => Promise<void> | undefined;
|
|
1762
|
-
static template: string;
|
|
1763
2047
|
static activeInstances: Set<FileItem>;
|
|
2048
|
+
protected shouldUpdate(_changedProperties: PropertyValues): boolean;
|
|
2049
|
+
render(): lit_html.TemplateResult<1>;
|
|
1764
2050
|
}
|
|
1765
2051
|
|
|
1766
|
-
declare class FormInput extends
|
|
1767
|
-
requireCtxName: boolean;
|
|
2052
|
+
declare class FormInput extends LitUploaderBlock {
|
|
1768
2053
|
_validationInputElement: HTMLInputElement | null;
|
|
1769
2054
|
_dynamicInputsContainer: HTMLDivElement | null;
|
|
1770
2055
|
_createValidationInput(): HTMLInputElement;
|
|
1771
2056
|
initCallback(): void;
|
|
1772
2057
|
}
|
|
1773
2058
|
|
|
1774
|
-
declare class Icon extends
|
|
1775
|
-
|
|
2059
|
+
declare class Icon extends LitBlock {
|
|
2060
|
+
name: string;
|
|
2061
|
+
private resolvedHref;
|
|
2062
|
+
private iconHrefResolver;
|
|
1776
2063
|
initCallback(): void;
|
|
2064
|
+
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
2065
|
+
private updateResolvedHref;
|
|
2066
|
+
render(): lit_html.TemplateResult<1>;
|
|
1777
2067
|
}
|
|
1778
2068
|
|
|
1779
|
-
declare
|
|
1780
|
-
|
|
2069
|
+
declare const ImgTypeEnum: Readonly<{
|
|
2070
|
+
PREVIEW: "PREVIEW";
|
|
2071
|
+
MAIN: "MAIN";
|
|
2072
|
+
}>;
|
|
2073
|
+
|
|
2074
|
+
type CssPropValue = string | number | undefined | null;
|
|
2075
|
+
declare const ImgConfig_base: typeof LitElement & Constructor$1<LitElement> & {
|
|
2076
|
+
reg(tagName: string): void;
|
|
2077
|
+
} & Constructor$1<{
|
|
2078
|
+
getCssData(propName: string, silentCheck?: boolean): string | number | boolean | null | undefined;
|
|
2079
|
+
}>;
|
|
2080
|
+
declare class ImgConfig extends ImgConfig_base {
|
|
2081
|
+
private _state;
|
|
2082
|
+
private _subscribers;
|
|
2083
|
+
private _isnObserver;
|
|
2084
|
+
private _observed;
|
|
2085
|
+
createRenderRoot(): HTMLElement | ShadowRoot;
|
|
1781
2086
|
constructor();
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
*/
|
|
1787
|
-
$$(key: string): any;
|
|
1788
|
-
/** @param {Object<String, String | Number>} kvObj */
|
|
1789
|
-
set$$(kvObj: any): void;
|
|
1790
|
-
/**
|
|
1791
|
-
* @param {String} key
|
|
1792
|
-
* @param {(val: any) => void} kbFn
|
|
1793
|
-
*/
|
|
1794
|
-
sub$$(key: string, kbFn: (val: any) => void): void;
|
|
2087
|
+
$$(key: string): unknown;
|
|
2088
|
+
set$$(kvObj: Record<string, CssPropValue>): void;
|
|
2089
|
+
sub$$<T = unknown>(key: string, kbFn: (val: T) => void): void;
|
|
2090
|
+
private _notify;
|
|
1795
2091
|
analyticsParams(): string;
|
|
1796
|
-
initAttributes(el:
|
|
1797
|
-
/**
|
|
1798
|
-
* @param {HTMLElement} el
|
|
1799
|
-
* @param {() => void} cbkFn
|
|
1800
|
-
*/
|
|
2092
|
+
initAttributes(el: HTMLElement): void;
|
|
1801
2093
|
initIntersection(el: HTMLElement, cbkFn: () => void): void;
|
|
1802
|
-
|
|
1803
|
-
private
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
attributeChangedCallback(name:
|
|
2094
|
+
connectedCallback(): void;
|
|
2095
|
+
private _initCssProperties;
|
|
2096
|
+
disconnectedCallback(): void;
|
|
2097
|
+
static get observedAttributes(): string[];
|
|
2098
|
+
attributeChangedCallback(name: string, _oldVal: string | null, newVal: string | null): void;
|
|
1807
2099
|
}
|
|
1808
2100
|
|
|
2101
|
+
type ImgType = (typeof ImgTypeEnum)[keyof typeof ImgTypeEnum];
|
|
2102
|
+
type LoaderParams = {
|
|
2103
|
+
src?: string;
|
|
2104
|
+
srcset?: string;
|
|
2105
|
+
elNode: HTMLImageElement;
|
|
2106
|
+
};
|
|
2107
|
+
type CurrentImg = {
|
|
2108
|
+
type: ImgType;
|
|
2109
|
+
img: HTMLImageElement;
|
|
2110
|
+
};
|
|
1809
2111
|
declare class ImgBase extends ImgConfig {
|
|
1810
|
-
_img: HTMLImageElement;
|
|
1811
|
-
_imgPreview: HTMLImageElement;
|
|
1812
|
-
/**
|
|
1813
|
-
* @private
|
|
1814
|
-
* @param {String} src
|
|
1815
|
-
*/
|
|
2112
|
+
protected _img: HTMLImageElement;
|
|
2113
|
+
protected _imgPreview: HTMLImageElement;
|
|
1816
2114
|
private _fmtAbs;
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
* @param {String} [size]
|
|
1821
|
-
* @returns {String | Number}
|
|
1822
|
-
*/
|
|
1823
|
-
_validateSize(size?: string): string | number;
|
|
1824
|
-
/**
|
|
1825
|
-
* Image operations
|
|
1826
|
-
*
|
|
1827
|
-
* @param {String} [size]
|
|
1828
|
-
* @param {String} [blur]
|
|
1829
|
-
*/
|
|
1830
|
-
_getCdnModifiers(size?: string, blur?: string): string;
|
|
1831
|
-
/**
|
|
1832
|
-
* @private
|
|
1833
|
-
* @param {String} [size]
|
|
1834
|
-
* @param {String} [blur]
|
|
1835
|
-
* @returns {any}
|
|
1836
|
-
*/
|
|
2115
|
+
private _validateSize;
|
|
2116
|
+
private _getCdnModifiers;
|
|
2117
|
+
private _getTypedCssValue;
|
|
1837
2118
|
private _getUrlBase;
|
|
1838
|
-
/**
|
|
1839
|
-
* @private
|
|
1840
|
-
* @param {String} url
|
|
1841
|
-
* @returns {String}
|
|
1842
|
-
*/
|
|
1843
2119
|
private _proxyUrl;
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
* @param {Number} [k]
|
|
1847
|
-
* @param {Boolean} [wOnly]
|
|
1848
|
-
*/
|
|
1849
|
-
_getElSize(el: HTMLElement, k?: number, wOnly?: boolean): string | null;
|
|
1850
|
-
/** @param {HTMLImageElement} img */
|
|
1851
|
-
_setupEventProxy(img: HTMLImageElement): void;
|
|
1852
|
-
/** @type {HTMLImageElement} */
|
|
2120
|
+
protected _getElSize(el: HTMLElement, k?: number, wOnly?: boolean): string | null;
|
|
2121
|
+
private _setupEventProxy;
|
|
1853
2122
|
get img(): HTMLImageElement;
|
|
1854
|
-
get currentImg():
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
} | {
|
|
1858
|
-
type: "MAIN";
|
|
1859
|
-
img: HTMLImageElement;
|
|
1860
|
-
};
|
|
1861
|
-
get hasPreviewImage(): any;
|
|
1862
|
-
get bgSelector(): any;
|
|
2123
|
+
get currentImg(): CurrentImg;
|
|
2124
|
+
get hasPreviewImage(): string | number | boolean | undefined;
|
|
2125
|
+
get bgSelector(): string | undefined;
|
|
1863
2126
|
get breakpoints(): number[] | null;
|
|
1864
2127
|
get hasFormatJPG(): boolean;
|
|
1865
|
-
/** @param {HTMLElement} el */
|
|
1866
2128
|
renderBg(el: HTMLElement): void;
|
|
1867
2129
|
getSrcset(): string;
|
|
1868
|
-
getSrc():
|
|
1869
|
-
get srcUrlPreview():
|
|
2130
|
+
getSrc(): string | undefined;
|
|
2131
|
+
get srcUrlPreview(): string | undefined;
|
|
1870
2132
|
renderBackground(): void;
|
|
1871
|
-
_appendURL
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
srcset: any;
|
|
1875
|
-
}): void;
|
|
1876
|
-
_setupConfigForImage({ elNode }: {
|
|
1877
|
-
elNode: any;
|
|
1878
|
-
}): void;
|
|
1879
|
-
loaderImage({ src, srcset, elNode }: {
|
|
1880
|
-
src: any;
|
|
1881
|
-
srcset: any;
|
|
1882
|
-
elNode: any;
|
|
1883
|
-
}): Promise<any>;
|
|
2133
|
+
private _appendURL;
|
|
2134
|
+
private _setupConfigForImage;
|
|
2135
|
+
loaderImage({ src, srcset, elNode }: LoaderParams): Promise<HTMLImageElement>;
|
|
1884
2136
|
renderImage(): Promise<void>;
|
|
1885
2137
|
init(): void;
|
|
1886
2138
|
}
|
|
1887
2139
|
|
|
1888
2140
|
declare class Img extends ImgBase {
|
|
2141
|
+
connectedCallback(): void;
|
|
1889
2142
|
}
|
|
1890
2143
|
|
|
1891
|
-
declare class ProgressBar extends
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
2144
|
+
declare class ProgressBar extends LitBlock {
|
|
2145
|
+
value: number;
|
|
2146
|
+
visible: boolean;
|
|
2147
|
+
private _progressValue;
|
|
2148
|
+
private readonly fakeProgressLineRef;
|
|
2149
|
+
private readonly handleFakeProgressAnimation;
|
|
2150
|
+
protected firstUpdated(changedProperties: PropertyValues<this>): void;
|
|
2151
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
2152
|
+
disconnectedCallback(): void;
|
|
2153
|
+
private normalizeProgressValue;
|
|
2154
|
+
private updateProgressValueStyle;
|
|
2155
|
+
render(): lit_html.TemplateResult<1>;
|
|
1896
2156
|
}
|
|
1897
2157
|
|
|
1898
|
-
declare class ProgressBarCommon extends
|
|
2158
|
+
declare class ProgressBarCommon extends LitUploaderBlock {
|
|
1899
2159
|
private _unobserveCollectionCb?;
|
|
2160
|
+
protected visible: boolean;
|
|
2161
|
+
protected value: number;
|
|
1900
2162
|
constructor();
|
|
1901
2163
|
initCallback(): void;
|
|
1902
|
-
|
|
2164
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
2165
|
+
disconnectedCallback(): void;
|
|
2166
|
+
render(): lit_html.TemplateResult<1>;
|
|
1903
2167
|
}
|
|
1904
2168
|
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
select: HTMLSelectElement;
|
|
1908
|
-
} & Record<string, HTMLElement>;
|
|
2169
|
+
type SelectOption = {
|
|
2170
|
+
text: string;
|
|
1909
2171
|
value: string;
|
|
1910
|
-
|
|
1911
|
-
|
|
2172
|
+
};
|
|
2173
|
+
declare class Select extends LitBlock {
|
|
2174
|
+
value: string;
|
|
2175
|
+
disabled: boolean;
|
|
2176
|
+
options: SelectOption[];
|
|
2177
|
+
render(): lit_html.TemplateResult<1>;
|
|
2178
|
+
private _handleChange;
|
|
1912
2179
|
}
|
|
1913
2180
|
|
|
1914
|
-
declare class SimpleBtn extends
|
|
2181
|
+
declare class SimpleBtn extends LitUploaderBlock {
|
|
1915
2182
|
static styleAttrs: string[];
|
|
1916
2183
|
couldBeCtxOwner: boolean;
|
|
1917
|
-
|
|
2184
|
+
dropzone: boolean;
|
|
2185
|
+
private buttonTextKey;
|
|
2186
|
+
private readonly handleClick;
|
|
1918
2187
|
initCallback(): void;
|
|
2188
|
+
render(): lit_html.TemplateResult<1>;
|
|
1919
2189
|
}
|
|
1920
2190
|
|
|
1921
2191
|
type SourceTypeConfig = {
|
|
@@ -1926,54 +2196,76 @@ type SourceTypeConfig = {
|
|
|
1926
2196
|
activate?: () => boolean;
|
|
1927
2197
|
activityParams?: Record<string, unknown>;
|
|
1928
2198
|
};
|
|
1929
|
-
declare class SourceBtn extends
|
|
2199
|
+
declare class SourceBtn extends LitUploaderBlock {
|
|
1930
2200
|
couldBeCtxOwner: boolean;
|
|
1931
|
-
private type;
|
|
1932
2201
|
private _registeredTypes;
|
|
1933
|
-
|
|
2202
|
+
type?: string;
|
|
2203
|
+
private iconName;
|
|
2204
|
+
private srcTypeKey;
|
|
1934
2205
|
initTypes(): void;
|
|
1935
2206
|
initCallback(): void;
|
|
1936
2207
|
registerType(typeConfig: SourceTypeConfig): void;
|
|
1937
2208
|
getType(type: string): SourceTypeConfig | undefined;
|
|
1938
2209
|
activate(): void;
|
|
1939
2210
|
applyType(type: string): void;
|
|
2211
|
+
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
2212
|
+
render(): lit_html.TemplateResult<1>;
|
|
1940
2213
|
}
|
|
1941
2214
|
|
|
1942
|
-
declare class SourceList extends
|
|
2215
|
+
declare class SourceList extends LitBlock {
|
|
2216
|
+
private _rawSourceList;
|
|
2217
|
+
private _cameraModes;
|
|
2218
|
+
private _resolvedSources;
|
|
1943
2219
|
initCallback(): void;
|
|
2220
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
2221
|
+
private _updateSources;
|
|
2222
|
+
sources: string[];
|
|
2223
|
+
render(): lit_html.TemplateResult<1>;
|
|
1944
2224
|
}
|
|
1945
2225
|
|
|
1946
|
-
declare class Spinner extends
|
|
2226
|
+
declare class Spinner extends LitBlock {
|
|
2227
|
+
render(): lit_html.TemplateResult<1>;
|
|
1947
2228
|
}
|
|
1948
2229
|
|
|
1949
|
-
declare class StartFrom extends
|
|
2230
|
+
declare class StartFrom extends LitActivityBlock {
|
|
1950
2231
|
historyTracked: boolean;
|
|
1951
2232
|
activityType: ActivityType;
|
|
1952
2233
|
initCallback(): void;
|
|
2234
|
+
render(): lit_html.TemplateResult<1>;
|
|
1953
2235
|
}
|
|
1954
2236
|
|
|
1955
2237
|
declare class Thumb extends FileItemConfig {
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
private
|
|
1959
|
-
private
|
|
1960
|
-
private
|
|
1961
|
-
|
|
1962
|
-
private
|
|
1963
|
-
private
|
|
1964
|
-
private
|
|
2238
|
+
badgeIcon: string;
|
|
2239
|
+
uid: string;
|
|
2240
|
+
private thumbUrl;
|
|
2241
|
+
private renderedGridOnce;
|
|
2242
|
+
private thumbRect;
|
|
2243
|
+
private isIntersecting;
|
|
2244
|
+
private firstViewMode;
|
|
2245
|
+
private observer?;
|
|
2246
|
+
private pendingThumbUpdate?;
|
|
2247
|
+
private calculateThumbSize;
|
|
2248
|
+
private generateThumbnail;
|
|
2249
|
+
private debouncedGenerateThumb;
|
|
2250
|
+
private decodeImage;
|
|
2251
|
+
private cancelPendingThumbUpdate;
|
|
2252
|
+
private scheduleThumbUpdate;
|
|
2253
|
+
private requestThumbGeneration;
|
|
2254
|
+
protected firstUpdated(changedProperties: PropertyValues<this>): void;
|
|
2255
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
1965
2256
|
private _observerCallback;
|
|
1966
2257
|
protected _reset(): void;
|
|
1967
|
-
private
|
|
2258
|
+
private bindToEntry;
|
|
1968
2259
|
initCallback(): void;
|
|
1969
2260
|
connectedCallback(): void;
|
|
1970
2261
|
disconnectedCallback(): void;
|
|
2262
|
+
render(): lit_html.TemplateResult<1>;
|
|
1971
2263
|
}
|
|
1972
2264
|
|
|
1973
2265
|
type EventListenerMap = {
|
|
1974
2266
|
[K in (typeof EventType)[keyof typeof EventType]]: (e: CustomEvent<EventPayload[K]>) => void;
|
|
1975
2267
|
};
|
|
1976
|
-
declare class UploadCtxProvider extends
|
|
2268
|
+
declare class UploadCtxProvider extends LitUploaderBlock {
|
|
1977
2269
|
static styleAttrs: string[];
|
|
1978
2270
|
static EventType: Readonly<{
|
|
1979
2271
|
readonly FILE_ADDED: "file-added";
|
|
@@ -1995,57 +2287,94 @@ declare class UploadCtxProvider extends UploaderBlock {
|
|
|
1995
2287
|
readonly CHANGE: "change";
|
|
1996
2288
|
readonly GROUP_CREATED: "group-created";
|
|
1997
2289
|
}>;
|
|
1998
|
-
requireCtxName: boolean;
|
|
1999
2290
|
initCallback(): void;
|
|
2000
|
-
|
|
2291
|
+
disconnectedCallback(): void;
|
|
2001
2292
|
}
|
|
2002
|
-
interface UploadCtxProvider extends
|
|
2293
|
+
interface UploadCtxProvider extends LitUploaderBlock {
|
|
2003
2294
|
addEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | AddEventListenerOptions): void;
|
|
2004
2295
|
removeEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | EventListenerOptions): void;
|
|
2005
2296
|
}
|
|
2006
2297
|
|
|
2007
|
-
declare class UrlSource extends
|
|
2298
|
+
declare class UrlSource extends LitUploaderBlock {
|
|
2008
2299
|
couldBeCtxOwner: boolean;
|
|
2009
2300
|
activityType: ActivityType;
|
|
2010
|
-
|
|
2301
|
+
private formState;
|
|
2011
2302
|
initCallback(): void;
|
|
2303
|
+
private inputRef;
|
|
2304
|
+
private handleInput;
|
|
2305
|
+
private handleUpload;
|
|
2306
|
+
render(): lit_html.TemplateResult<1>;
|
|
2012
2307
|
}
|
|
2013
2308
|
|
|
2014
2309
|
declare const PACKAGE_NAME = "blocks";
|
|
2015
2310
|
declare const PACKAGE_VERSION: string;
|
|
2016
2311
|
|
|
2312
|
+
declare class LitSolutionBlock extends LitBlock {
|
|
2313
|
+
static styleAttrs: string[];
|
|
2314
|
+
init$: {
|
|
2315
|
+
'*solution': string | null;
|
|
2316
|
+
'*commonProgress': number;
|
|
2317
|
+
'*uploadList': never[];
|
|
2318
|
+
'*uploadQueue': _uploadcare_upload_client.Queue;
|
|
2319
|
+
'*collectionErrors': OutputErrorCollection[];
|
|
2320
|
+
'*collectionState': OutputCollectionState | null;
|
|
2321
|
+
'*groupInfo': _uploadcare_upload_client.UploadcareGroup | null;
|
|
2322
|
+
'*uploadTrigger': Set<string>;
|
|
2323
|
+
'*secureUploadsManager': SecureUploadsManager | null;
|
|
2324
|
+
'*currentActivity': null;
|
|
2325
|
+
'*currentActivityParams': {};
|
|
2326
|
+
'*history': never[];
|
|
2327
|
+
'*historyBack': null;
|
|
2328
|
+
'*closeModal': () => void;
|
|
2329
|
+
};
|
|
2330
|
+
initCallback(): void;
|
|
2331
|
+
render(): lit_html.TemplateResult<1>;
|
|
2332
|
+
}
|
|
2333
|
+
|
|
2017
2334
|
declare class CloudImageEditor extends CloudImageEditorBlock {
|
|
2018
2335
|
static styleAttrs: string[];
|
|
2019
2336
|
constructor();
|
|
2020
2337
|
initCallback(): void;
|
|
2021
2338
|
}
|
|
2022
2339
|
|
|
2023
|
-
declare class FileUploaderInline extends
|
|
2340
|
+
declare class FileUploaderInline extends LitSolutionBlock {
|
|
2024
2341
|
static styleAttrs: string[];
|
|
2342
|
+
private couldCancel;
|
|
2025
2343
|
constructor();
|
|
2344
|
+
private _handleCancel;
|
|
2026
2345
|
get couldHistoryBack(): boolean;
|
|
2027
2346
|
get couldShowList(): boolean;
|
|
2347
|
+
private _getInitActivity;
|
|
2028
2348
|
initCallback(): void;
|
|
2349
|
+
render(): lit_html.TemplateResult<1>;
|
|
2029
2350
|
}
|
|
2030
2351
|
|
|
2031
|
-
declare class FileUploaderMinimal extends
|
|
2352
|
+
declare class FileUploaderMinimal extends LitSolutionBlock {
|
|
2032
2353
|
static styleAttrs: string[];
|
|
2354
|
+
protected singleUpload: boolean;
|
|
2355
|
+
protected isHiddenStartFrom: boolean;
|
|
2356
|
+
protected classUploadList: string;
|
|
2357
|
+
protected classStartFrom: string;
|
|
2033
2358
|
private handleModalOpen?;
|
|
2034
2359
|
private handleModalClose?;
|
|
2360
|
+
private _getInitActivity;
|
|
2035
2361
|
constructor();
|
|
2036
2362
|
private _handleModalOpen;
|
|
2037
2363
|
private _handleModalClose;
|
|
2038
2364
|
initCallback(): void;
|
|
2039
|
-
|
|
2365
|
+
disconnectedCallback(): void;
|
|
2366
|
+
render(): lit_html.TemplateResult<1>;
|
|
2040
2367
|
}
|
|
2041
2368
|
|
|
2042
|
-
declare class FileUploaderRegular extends
|
|
2369
|
+
declare class FileUploaderRegular extends LitSolutionBlock {
|
|
2043
2370
|
static styleAttrs: string[];
|
|
2371
|
+
headless: boolean;
|
|
2044
2372
|
constructor();
|
|
2045
2373
|
initCallback(): void;
|
|
2374
|
+
render(): lit_html.TemplateResult<1>;
|
|
2046
2375
|
}
|
|
2047
2376
|
|
|
2048
2377
|
type KebabCase<T extends string> = T extends `${infer Head} ${infer Tail}` ? `${Lowercase<Head>}-${KebabCase<Tail>}` : Lowercase<T>;
|
|
2049
2378
|
declare const toKebabCase: <T extends string>(str: T) => KebabCase<T>;
|
|
2050
2379
|
|
|
2051
|
-
export { ActivityBlock, ActivityHeader, type ApiAddFileCommonOptions, Block, BtnUi, CameraSource, CloudImageEditor, CloudImageEditorActivity, CloudImageEditorBlock, type CollectionValidators, Config, type ConfigAttributesType, type ConfigComplexType, type ConfigPlainType, type ConfigType, Copyright, CropFrame, DropArea, EditorAspectRatioButtonControl, EditorCropButtonControl, EditorFilterControl, EditorFreeformButtonControl, EditorImageCropper, EditorImageFader, EditorOperationControl, EditorScroller, EditorSlider, EditorToolbar, type EventMap, type EventPayload, EventType, ExternalSource, ExternalUploadSource, FileItem, FileUploaderInline, FileUploaderMinimal, FileUploaderRegular, type FileValidator, type FileValidatorDescriptor, type FileValidators, FormInput, type FuncCollectionValidator, type FuncFileValidator, type GroupFlag, Icon, type IconHrefResolver, Img, type KebabCase$1 as KebabCase, type KebabCaseKeys, LineLoaderUi, type LocaleDefinitionOverride, type LowerCase, type LowerCaseKeys, type MetadataCallback, Modal, ModalEvents, type ModalId, type OutputCollectionErrorType, type OutputCollectionState, type OutputCollectionStatus, type OutputCustomErrorType, type OutputError, type OutputErrorCollection, type OutputErrorFile, type OutputErrorTypePayload, type OutputFileEntry, type OutputFileErrorPayload, type OutputFileErrorType, type OutputFileStatus, PACKAGE_NAME, PACKAGE_VERSION, PresenceToggle, ProgressBar, ProgressBarCommon, type SecureDeliveryProxyUrlResolver, type SecureUploadsSignatureAndExpire, type SecureUploadsSignatureResolver, Select, SimpleBtn, SliderUi, SolutionBlock, SourceBtn, SourceList, type SourceTypes, Spinner, StartFrom, Thumb, UploadCtxProvider, UploadList, UploadSource, UploaderBlock, UploaderPublicApi, UrlSource, defineComponents, defineLocale, loadFileUploaderFrom, toKebabCase };
|
|
2380
|
+
export { LitActivityBlock as ActivityBlock, ActivityHeader, type ApiAddFileCommonOptions, LitBlock as Block, BtnUi, CameraSource, CloudImageEditor, CloudImageEditorActivity, CloudImageEditorBlock, type CollectionValidators, Config, type ConfigAttributesType, type ConfigComplexType, type ConfigPlainType, type ConfigType, Copyright, CropFrame, DropArea, EditorAspectRatioButtonControl, EditorCropButtonControl, EditorFilterControl, EditorFreeformButtonControl, EditorImageCropper, EditorImageFader, EditorOperationControl, EditorScroller, EditorSlider, EditorToolbar, type EventMap, type EventPayload, EventType, ExternalSource, ExternalUploadSource, FileItem, FileUploaderInline, FileUploaderMinimal, FileUploaderRegular, type FileValidator, type FileValidatorDescriptor, type FileValidators, FormInput, type FuncCollectionValidator, type FuncFileValidator, type GroupFlag, Icon, type IconHrefResolver, Img, type KebabCase$1 as KebabCase, type KebabCaseKeys, LineLoaderUi, type LocaleDefinitionOverride, type LowerCase, type LowerCaseKeys, type MetadataCallback, Modal, ModalEvents, type ModalId, type OutputCollectionErrorType, type OutputCollectionState, type OutputCollectionStatus, type OutputCustomErrorType, type OutputError, type OutputErrorCollection, type OutputErrorFile, type OutputErrorTypePayload, type OutputFileEntry, type OutputFileErrorPayload, type OutputFileErrorType, type OutputFileStatus, PACKAGE_NAME, PACKAGE_VERSION, PresenceToggle, ProgressBar, ProgressBarCommon, type SecureDeliveryProxyUrlResolver, type SecureUploadsSignatureAndExpire, type SecureUploadsSignatureResolver, Select, SimpleBtn, SliderUi, LitSolutionBlock as SolutionBlock, SourceBtn, SourceList, type SourceTypes, Spinner, StartFrom, Thumb, UploadCtxProvider, UploadList, UploadSource, LitUploaderBlock as UploaderBlock, UploaderPublicApi, UrlSource, defineComponents, defineLocale, loadFileUploaderFrom, toKebabCase };
|