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