@uploadcare/file-uploader 1.24.5 → 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 +16 -6
- package/dist/index.d.ts +866 -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 +872 -545
- package/web/file-uploader.iife.min.js +8 -4
- package/web/file-uploader.min.d.ts +872 -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 +438 -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 +872 -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 +872 -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 +872 -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,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
|
-
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;
|
|
43
|
+
constructor(blockInstance: LitBlock);
|
|
251
44
|
}
|
|
252
45
|
|
|
253
46
|
type EventMap = {
|
|
254
47
|
[T in keyof EventPayload]: CustomEvent<EventPayload[T]>;
|
|
255
48
|
};
|
|
256
49
|
|
|
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>;
|
|
50
|
+
declare function buildOutputCollectionState<TCollectionStatus extends OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'>(uploaderBlock: LitUploaderBlock): OutputCollectionState<TCollectionStatus, TGroupFlag>;
|
|
262
51
|
|
|
263
52
|
type TypedSchema = Record<string, {
|
|
264
53
|
type: unknown;
|
|
@@ -283,7 +72,7 @@ declare class TypedData<T extends TypedSchema> {
|
|
|
283
72
|
getValue<K extends ExtractKeysFromSchema<T>>(prop: K): ExtractDataFromSchema<T>[K];
|
|
284
73
|
subscribe<K extends ExtractKeysFromSchema<T>>(prop: K, handler: (newVal: ExtractDataFromSchema<T>[K]) => void): {
|
|
285
74
|
remove: () => void;
|
|
286
|
-
callback:
|
|
75
|
+
callback: (val: unknown) => void;
|
|
287
76
|
};
|
|
288
77
|
remove(): void;
|
|
289
78
|
}
|
|
@@ -437,7 +226,7 @@ declare class ValidationManager {
|
|
|
437
226
|
private _queue;
|
|
438
227
|
private _runQueueDebounced;
|
|
439
228
|
private _entryValidationState;
|
|
440
|
-
constructor(blockInstance:
|
|
229
|
+
constructor(blockInstance: LitUploaderBlock);
|
|
441
230
|
runFileValidators(runOn: FileValidatorDescriptor['runOn'], entryIds?: string[]): void;
|
|
442
231
|
runCollectionValidators(): void;
|
|
443
232
|
cleanupValidationForEntry(entry: TypedData<typeof uploadEntrySchema>): void;
|
|
@@ -448,9 +237,17 @@ declare class ValidationManager {
|
|
|
448
237
|
private _getValidatorDescriptorsForEntry;
|
|
449
238
|
}
|
|
450
239
|
|
|
240
|
+
type CameraDeviceOption = {
|
|
241
|
+
text: string;
|
|
242
|
+
value: string;
|
|
243
|
+
};
|
|
244
|
+
type AudioDeviceOption = {
|
|
245
|
+
text: string;
|
|
246
|
+
value: string;
|
|
247
|
+
};
|
|
451
248
|
type CameraMode = 'photo' | 'video';
|
|
452
249
|
type CameraStatus = 'shot' | 'retake' | 'accept' | 'play' | 'stop' | 'pause' | 'resume';
|
|
453
|
-
declare class CameraSource extends
|
|
250
|
+
declare class CameraSource extends LitUploaderBlock {
|
|
454
251
|
couldBeCtxOwner: boolean;
|
|
455
252
|
activityType: "camera";
|
|
456
253
|
private _unsubPermissions;
|
|
@@ -467,8 +264,43 @@ declare class CameraSource extends UploaderBlock {
|
|
|
467
264
|
private _cameraDevices;
|
|
468
265
|
private _audioDevices;
|
|
469
266
|
private _permissionResponses;
|
|
470
|
-
|
|
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;
|
|
471
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;
|
|
472
304
|
_updateTimer: () => void;
|
|
473
305
|
_startTimer: () => void;
|
|
474
306
|
_stopTimer: () => void;
|
|
@@ -512,7 +344,8 @@ declare class CameraSource extends UploaderBlock {
|
|
|
512
344
|
_handleCameraModes: (cameraModes: CameraMode[]) => void;
|
|
513
345
|
initCallback(): void;
|
|
514
346
|
_destroy(): void;
|
|
515
|
-
|
|
347
|
+
disconnectedCallback(): void;
|
|
348
|
+
render(): lit_html.TemplateResult<1>;
|
|
516
349
|
}
|
|
517
350
|
|
|
518
351
|
/**
|
|
@@ -521,9 +354,9 @@ declare class CameraSource extends UploaderBlock {
|
|
|
521
354
|
declare const complexConfigKeys: readonly ["metadata", "localeDefinitionOverride", "secureUploadsSignatureResolver", "secureDeliveryProxyUrlResolver", "iconHrefResolver", "fileValidators", "collectionValidators", "mediaRecorderOptions"];
|
|
522
355
|
/** Mapping of attribute names to state */
|
|
523
356
|
declare const attrStateMapping: Record<string, string>;
|
|
524
|
-
declare class Config extends
|
|
525
|
-
|
|
526
|
-
|
|
357
|
+
declare class Config extends LitBlock {
|
|
358
|
+
init$: LitBlock["init$"] & ConfigType;
|
|
359
|
+
private computationControllers;
|
|
527
360
|
private _flushValueToAttribute;
|
|
528
361
|
private _flushValueToState;
|
|
529
362
|
private _setValue;
|
|
@@ -531,23 +364,36 @@ declare class Config extends Block {
|
|
|
531
364
|
_assertSameValueDifferentReference(key: string, previousValue: unknown, nextValue: unknown): void;
|
|
532
365
|
initCallback(): void;
|
|
533
366
|
attributeChangedCallback(name: keyof typeof attrStateMapping, oldVal: string, newVal: string): void;
|
|
534
|
-
get
|
|
367
|
+
static get observedAttributes(): string[];
|
|
535
368
|
}
|
|
536
369
|
interface Config extends ConfigType {
|
|
537
370
|
}
|
|
538
371
|
|
|
539
372
|
type FilesViewMode = 'grid' | 'list';
|
|
540
|
-
declare class UploadList extends
|
|
373
|
+
declare class UploadList extends LitUploaderBlock {
|
|
541
374
|
couldBeCtxOwner: boolean;
|
|
542
375
|
historyTracked: boolean;
|
|
543
376
|
activityType: "upload-list";
|
|
544
|
-
|
|
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;
|
|
545
390
|
private _throttledHandleCollectionUpdate;
|
|
546
|
-
|
|
391
|
+
protected _updateUploadsState(): void;
|
|
547
392
|
private _getHeaderText;
|
|
548
393
|
get couldOpenActivity(): boolean;
|
|
549
394
|
initCallback(): void;
|
|
550
|
-
|
|
395
|
+
disconnectedCallback(): void;
|
|
396
|
+
render(): lit_html.TemplateResult<1>;
|
|
551
397
|
}
|
|
552
398
|
|
|
553
399
|
declare const ExternalUploadSource: Readonly<{
|
|
@@ -598,7 +444,7 @@ type ApiAddFileCommonOptions = {
|
|
|
598
444
|
};
|
|
599
445
|
declare class UploaderPublicApi {
|
|
600
446
|
private _ctx;
|
|
601
|
-
constructor(ctx:
|
|
447
|
+
constructor(ctx: LitUploaderBlock);
|
|
602
448
|
private get _uploadCollection();
|
|
603
449
|
get cfg(): ConfigType;
|
|
604
450
|
get l10n(): (str: string, variables?: Record<string, string | number>) => string;
|
|
@@ -1097,7 +943,7 @@ type OutputCollectionState<TStatus extends OutputCollectionStatus = OutputCollec
|
|
|
1097
943
|
declare class SecureUploadsManager {
|
|
1098
944
|
private readonly _block;
|
|
1099
945
|
private _secureToken;
|
|
1100
|
-
constructor(block:
|
|
946
|
+
constructor(block: LitUploaderBlock);
|
|
1101
947
|
private _debugPrint;
|
|
1102
948
|
getSecureToken(): Promise<SecureUploadsSignatureAndExpire | null>;
|
|
1103
949
|
}
|
|
@@ -1143,7 +989,7 @@ declare class TypedCollection<T extends TypedSchema> {
|
|
|
1143
989
|
destroy(): void;
|
|
1144
990
|
}
|
|
1145
991
|
|
|
1146
|
-
declare class
|
|
992
|
+
declare class LitUploaderBlock extends LitActivityBlock {
|
|
1147
993
|
static extSrcList: Readonly<typeof ExternalUploadSource>;
|
|
1148
994
|
static sourceTypes: Readonly<typeof UploadSource>;
|
|
1149
995
|
protected couldBeCtxOwner: boolean;
|
|
@@ -1174,7 +1020,6 @@ declare class UploaderBlock extends ActivityBlock {
|
|
|
1174
1020
|
destroyCtxCallback(): void;
|
|
1175
1021
|
disconnectedCallback(): void;
|
|
1176
1022
|
connectedCallback(): void;
|
|
1177
|
-
destroyCallback(): void;
|
|
1178
1023
|
private _initCtxOwner;
|
|
1179
1024
|
private _observeUploadCollection;
|
|
1180
1025
|
private _unobserveUploadCollection;
|
|
@@ -1190,6 +1035,10 @@ declare class UploaderBlock extends ActivityBlock {
|
|
|
1190
1035
|
getOutputData(): OutputFileEntry[];
|
|
1191
1036
|
}
|
|
1192
1037
|
|
|
1038
|
+
/**
|
|
1039
|
+
* Mapping of loading resources per operation
|
|
1040
|
+
*/
|
|
1041
|
+
type LoadingOperations = Map<string, Map<string, boolean>>;
|
|
1193
1042
|
/**
|
|
1194
1043
|
* Image size
|
|
1195
1044
|
*/
|
|
@@ -1224,6 +1073,7 @@ interface ApplyResult {
|
|
|
1224
1073
|
cdnUrl: string;
|
|
1225
1074
|
transformations: Transformations;
|
|
1226
1075
|
}
|
|
1076
|
+
type ChangeResult = ApplyResult;
|
|
1227
1077
|
interface CropAspectRatio {
|
|
1228
1078
|
type: 'aspect-ratio';
|
|
1229
1079
|
width: number;
|
|
@@ -1235,27 +1085,41 @@ interface CropAspectRatio {
|
|
|
1235
1085
|
type ActivityParams$1 = {
|
|
1236
1086
|
internalId: string;
|
|
1237
1087
|
};
|
|
1238
|
-
declare class CloudImageEditorActivity extends
|
|
1088
|
+
declare class CloudImageEditorActivity extends LitUploaderBlock {
|
|
1239
1089
|
couldBeCtxOwner: boolean;
|
|
1240
1090
|
activityType: "cloud-image-edit";
|
|
1241
1091
|
private _entry?;
|
|
1242
|
-
private
|
|
1092
|
+
private editorConfig;
|
|
1243
1093
|
get activityParams(): ActivityParams$1;
|
|
1244
1094
|
initCallback(): void;
|
|
1245
1095
|
handleApply(e: CustomEvent<ApplyResult>): void;
|
|
1246
|
-
handleCancel(): void;
|
|
1096
|
+
handleCancel(event?: Event): void;
|
|
1097
|
+
handleChange(event: CustomEvent<ChangeResult>): void;
|
|
1247
1098
|
mountEditor(): void;
|
|
1248
1099
|
unmountEditor(): void;
|
|
1100
|
+
render(): lit_html.TemplateResult<1> | typeof nothing;
|
|
1101
|
+
private _createEditorConfig;
|
|
1249
1102
|
}
|
|
1250
1103
|
|
|
1251
1104
|
type ActivityParams = {
|
|
1252
1105
|
externalSourceType: string;
|
|
1253
1106
|
};
|
|
1254
|
-
declare class ExternalSource extends
|
|
1107
|
+
declare class ExternalSource extends LitUploaderBlock {
|
|
1255
1108
|
couldBeCtxOwner: boolean;
|
|
1256
1109
|
activityType: "external";
|
|
1257
1110
|
private _messageBridge?;
|
|
1258
|
-
|
|
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();
|
|
1259
1123
|
get activityParams(): ActivityParams;
|
|
1260
1124
|
initCallback(): void;
|
|
1261
1125
|
private extractUrlFromSelectedFile;
|
|
@@ -1266,9 +1130,15 @@ declare class ExternalSource extends UploaderBlock {
|
|
|
1266
1130
|
private applyEmbedCss;
|
|
1267
1131
|
private setupL10n;
|
|
1268
1132
|
private remoteUrl;
|
|
1133
|
+
private _handleDone;
|
|
1134
|
+
private _handleCancel;
|
|
1135
|
+
private _handleSelectAll;
|
|
1136
|
+
private _handleDeselectAll;
|
|
1137
|
+
private _setSelectionSummary;
|
|
1269
1138
|
private mountIframe;
|
|
1270
1139
|
private unmountIframe;
|
|
1271
1140
|
private resetSelectionStatus;
|
|
1141
|
+
render(): lit_html.TemplateResult<1>;
|
|
1272
1142
|
}
|
|
1273
1143
|
|
|
1274
1144
|
declare const ACTIVE_PROP = "___ACTIVITY_IS_ACTIVE___";
|
|
@@ -1276,7 +1146,7 @@ type ActivityParamsMap = {
|
|
|
1276
1146
|
'cloud-image-edit': ActivityParams$1;
|
|
1277
1147
|
external: ActivityParams;
|
|
1278
1148
|
};
|
|
1279
|
-
declare class
|
|
1149
|
+
declare class LitActivityBlock extends LitBlock {
|
|
1280
1150
|
protected historyTracked: boolean;
|
|
1281
1151
|
private [ACTIVE_PROP]?;
|
|
1282
1152
|
init$: {
|
|
@@ -1312,79 +1182,331 @@ declare class ActivityBlock extends Block {
|
|
|
1312
1182
|
onDeactivate?: () => void;
|
|
1313
1183
|
}): void;
|
|
1314
1184
|
unregisterActivity(): void;
|
|
1315
|
-
|
|
1185
|
+
disconnectedCallback(): void;
|
|
1316
1186
|
get activityKey(): string;
|
|
1317
1187
|
get activityParams(): ActivityParamsMap[keyof ActivityParamsMap];
|
|
1318
|
-
get initActivity(): string;
|
|
1319
|
-
get doneActivity(): string;
|
|
1188
|
+
get initActivity(): string | null;
|
|
1189
|
+
get doneActivity(): string | null;
|
|
1320
1190
|
historyBack(): void;
|
|
1321
1191
|
}
|
|
1322
|
-
type RegisteredActivityType = (typeof
|
|
1192
|
+
type RegisteredActivityType = (typeof LitActivityBlock)['activities'][keyof (typeof LitActivityBlock)['activities']];
|
|
1323
1193
|
type ActivityType = RegisteredActivityType | (string & {}) | null;
|
|
1324
1194
|
|
|
1325
|
-
declare
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
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
|
+
}
|
|
1339
1262
|
|
|
1340
|
-
|
|
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;
|
|
1341
1327
|
static styleAttrs: string[];
|
|
1342
|
-
|
|
1343
|
-
init$: {
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
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;
|
|
1358
1344
|
};
|
|
1359
|
-
|
|
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;
|
|
1360
1376
|
initCallback(): void;
|
|
1361
|
-
|
|
1362
|
-
|
|
1377
|
+
disconnectedCallback(): void;
|
|
1378
|
+
private handleDialogRef;
|
|
1379
|
+
render(): lit_html.TemplateResult<1>;
|
|
1363
1380
|
}
|
|
1364
1381
|
|
|
1365
|
-
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;
|
|
1366
1434
|
}
|
|
1367
1435
|
|
|
1368
|
-
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 {
|
|
1369
1459
|
ctxOwner: boolean;
|
|
1370
1460
|
static styleAttrs: string[];
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
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();
|
|
1374
1495
|
/**
|
|
1375
1496
|
* To proper work, we need non-zero size the element. So, we'll wait for it.
|
|
1376
1497
|
*/
|
|
1377
1498
|
private _waitForSize;
|
|
1378
|
-
|
|
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;
|
|
1379
1505
|
updateImage(): Promise<void>;
|
|
1380
1506
|
initEditor(): Promise<void>;
|
|
1381
1507
|
}
|
|
1382
1508
|
|
|
1383
|
-
declare class CropFrame extends
|
|
1384
|
-
private readonly _handlePointerUp;
|
|
1385
|
-
private readonly _handlePointerMove;
|
|
1386
|
-
private readonly _handleSvgPointerMove;
|
|
1387
|
-
private readonly _backdropMaskId;
|
|
1509
|
+
declare class CropFrame extends LitBlock {
|
|
1388
1510
|
private _backdropMask?;
|
|
1389
1511
|
private _backdropMaskInner?;
|
|
1390
1512
|
private _frameThumbs?;
|
|
@@ -1395,7 +1517,14 @@ declare class CropFrame extends Block {
|
|
|
1395
1517
|
private _dragStartCrop?;
|
|
1396
1518
|
private _frameImage?;
|
|
1397
1519
|
private _guidesHidden;
|
|
1398
|
-
|
|
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;
|
|
1399
1528
|
private _shouldThumbBeDisabled;
|
|
1400
1529
|
private _createBackdrop;
|
|
1401
1530
|
/**
|
|
@@ -1410,41 +1539,57 @@ declare class CropFrame extends Block {
|
|
|
1410
1539
|
private _createGuides;
|
|
1411
1540
|
private _createFrame;
|
|
1412
1541
|
private _handlePointerDown;
|
|
1413
|
-
private
|
|
1414
|
-
private
|
|
1542
|
+
private readonly _handlePointerUp;
|
|
1543
|
+
private readonly _handlePointerMove;
|
|
1415
1544
|
private _calcCropBox;
|
|
1416
|
-
private
|
|
1545
|
+
private readonly _handleSvgPointerMove;
|
|
1417
1546
|
private _updateCursor;
|
|
1418
1547
|
private _createMask;
|
|
1419
1548
|
private _updateMask;
|
|
1420
1549
|
private _render;
|
|
1421
1550
|
toggleThumbs(visible: boolean): void;
|
|
1422
1551
|
initCallback(): void;
|
|
1423
|
-
|
|
1552
|
+
protected firstUpdated(_changedProperties: PropertyValues<this>): void;
|
|
1553
|
+
private _initializeSvg;
|
|
1554
|
+
disconnectedCallback(): void;
|
|
1555
|
+
render(): TemplateResult;
|
|
1424
1556
|
}
|
|
1425
1557
|
|
|
1426
|
-
declare class EditorButtonControl extends
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
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>;
|
|
1430
1569
|
}
|
|
1431
1570
|
|
|
1432
1571
|
declare class EditorFreeformButtonControl extends EditorButtonControl {
|
|
1433
1572
|
initCallback(): void;
|
|
1434
|
-
|
|
1573
|
+
onClick(): void;
|
|
1574
|
+
private computeTitle;
|
|
1575
|
+
render(): lit_html.TemplateResult<1>;
|
|
1435
1576
|
}
|
|
1436
|
-
|
|
1577
|
+
declare class EditorAspectRatioButtonControl extends EditorButtonControl {
|
|
1578
|
+
private _aspectRatio?;
|
|
1437
1579
|
get aspectRatio(): CropAspectRatio | undefined;
|
|
1438
1580
|
set aspectRatio(value: CropAspectRatio | undefined);
|
|
1439
|
-
}
|
|
1440
|
-
declare class EditorAspectRatioButtonControl extends EditorButtonControl {
|
|
1441
|
-
constructor();
|
|
1442
1581
|
initCallback(): void;
|
|
1443
|
-
|
|
1444
|
-
private
|
|
1445
|
-
private
|
|
1582
|
+
onClick(): void;
|
|
1583
|
+
private updateAspectRatioPresentation;
|
|
1584
|
+
private renderIcon;
|
|
1585
|
+
render(): lit_html.TemplateResult<1>;
|
|
1446
1586
|
}
|
|
1447
1587
|
|
|
1588
|
+
declare const TabId: Readonly<{
|
|
1589
|
+
readonly CROP: "crop";
|
|
1590
|
+
readonly TUNING: "tuning";
|
|
1591
|
+
readonly FILTERS: "filters";
|
|
1592
|
+
}>;
|
|
1448
1593
|
declare const ALL_COLOR_OPERATIONS: readonly ["brightness", "exposure", "gamma", "contrast", "saturation", "vibrance", "warmth", "enhance"];
|
|
1449
1594
|
type ColorOperation = (typeof ALL_COLOR_OPERATIONS)[number];
|
|
1450
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"];
|
|
@@ -1500,13 +1645,10 @@ declare const COLOR_OPERATIONS_CONFIG: Readonly<{
|
|
|
1500
1645
|
};
|
|
1501
1646
|
}>;
|
|
1502
1647
|
|
|
1503
|
-
interface EditorCropButtonControl {
|
|
1504
|
-
get operation(): CropOperation | undefined;
|
|
1505
|
-
set operation(value: CropOperation | undefined);
|
|
1506
|
-
}
|
|
1507
1648
|
declare class EditorCropButtonControl extends EditorButtonControl {
|
|
1508
|
-
|
|
1509
|
-
|
|
1649
|
+
operation: CropOperation | undefined;
|
|
1650
|
+
protected willUpdate(_changedProperties: PropertyValues): void;
|
|
1651
|
+
onClick(e: MouseEvent): void;
|
|
1510
1652
|
}
|
|
1511
1653
|
|
|
1512
1654
|
declare class EditorFilterControl extends EditorButtonControl {
|
|
@@ -1515,11 +1657,27 @@ declare class EditorFilterControl extends EditorButtonControl {
|
|
|
1515
1657
|
private _originalUrl;
|
|
1516
1658
|
private _observer?;
|
|
1517
1659
|
private _cancelPreload?;
|
|
1518
|
-
|
|
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;
|
|
1519
1670
|
private _previewSrc;
|
|
1520
1671
|
private _observerCallback;
|
|
1521
1672
|
initCallback(): void;
|
|
1522
|
-
|
|
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>;
|
|
1523
1681
|
}
|
|
1524
1682
|
|
|
1525
1683
|
type Operations = {
|
|
@@ -1527,7 +1685,7 @@ type Operations = {
|
|
|
1527
1685
|
mirror: boolean;
|
|
1528
1686
|
rotate: number;
|
|
1529
1687
|
};
|
|
1530
|
-
declare class EditorImageCropper extends
|
|
1688
|
+
declare class EditorImageCropper extends LitBlock {
|
|
1531
1689
|
ctxOwner: boolean;
|
|
1532
1690
|
private _commitDebounced;
|
|
1533
1691
|
private _handleResizeThrottled;
|
|
@@ -1536,9 +1694,12 @@ declare class EditorImageCropper extends Block {
|
|
|
1536
1694
|
private _ctx;
|
|
1537
1695
|
private _isActive;
|
|
1538
1696
|
private _observer?;
|
|
1697
|
+
private _image;
|
|
1539
1698
|
private _cancelPreload?;
|
|
1699
|
+
private readonly canvasRef;
|
|
1700
|
+
private readonly frameRef;
|
|
1540
1701
|
constructor();
|
|
1541
|
-
|
|
1702
|
+
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
1542
1703
|
private _syncTransformations;
|
|
1543
1704
|
private _initCanvas;
|
|
1544
1705
|
private _alignImage;
|
|
@@ -1563,11 +1724,12 @@ declare class EditorImageCropper extends Block {
|
|
|
1563
1724
|
private _waitForImage;
|
|
1564
1725
|
private _handleImageLoading;
|
|
1565
1726
|
initCallback(): void;
|
|
1566
|
-
|
|
1727
|
+
disconnectedCallback(): void;
|
|
1728
|
+
render(): TemplateResult;
|
|
1567
1729
|
}
|
|
1568
1730
|
|
|
1569
1731
|
type OperationKey = keyof typeof COLOR_OPERATIONS_CONFIG;
|
|
1570
|
-
declare class EditorImageFader extends
|
|
1732
|
+
declare class EditorImageFader extends LitBlock {
|
|
1571
1733
|
private _isActive;
|
|
1572
1734
|
private _hidden;
|
|
1573
1735
|
private _operation;
|
|
@@ -1575,7 +1737,6 @@ declare class EditorImageFader extends Block {
|
|
|
1575
1737
|
private _value?;
|
|
1576
1738
|
private _transformations;
|
|
1577
1739
|
private _keypoints;
|
|
1578
|
-
private _container?;
|
|
1579
1740
|
private _previewImage?;
|
|
1580
1741
|
private _cancelLastImages?;
|
|
1581
1742
|
private _cancelBatchPreload?;
|
|
@@ -1583,6 +1744,8 @@ declare class EditorImageFader extends Block {
|
|
|
1583
1744
|
private _fromViewer?;
|
|
1584
1745
|
private _raf;
|
|
1585
1746
|
private _addKeypointDebounced;
|
|
1747
|
+
private readonly _previewHostRef;
|
|
1748
|
+
private readonly _layersHostRef;
|
|
1586
1749
|
constructor();
|
|
1587
1750
|
private _handleImageLoading;
|
|
1588
1751
|
private _flush;
|
|
@@ -1592,7 +1755,6 @@ declare class EditorImageFader extends Block {
|
|
|
1592
1755
|
* Check if current operation and filter equals passed ones
|
|
1593
1756
|
*/
|
|
1594
1757
|
private _isSame;
|
|
1595
|
-
private _addKeypoint;
|
|
1596
1758
|
set(value: string | number): void;
|
|
1597
1759
|
private _update;
|
|
1598
1760
|
private _createPreviewImage;
|
|
@@ -1615,121 +1777,228 @@ declare class EditorImageFader extends Block {
|
|
|
1615
1777
|
deactivate({ hide }?: {
|
|
1616
1778
|
hide?: boolean;
|
|
1617
1779
|
}): void;
|
|
1780
|
+
private _ensurePreviewAttached;
|
|
1781
|
+
private _clearLayersHost;
|
|
1782
|
+
render(): TemplateResult;
|
|
1618
1783
|
}
|
|
1619
1784
|
|
|
1620
1785
|
declare class EditorOperationControl extends EditorButtonControl {
|
|
1621
1786
|
private _operation;
|
|
1787
|
+
get operation(): ColorOperation | '';
|
|
1788
|
+
set operation(value: ColorOperation | '');
|
|
1789
|
+
private updateOperationMetadata;
|
|
1622
1790
|
initCallback(): void;
|
|
1791
|
+
onClick(e: MouseEvent): void;
|
|
1623
1792
|
}
|
|
1624
1793
|
|
|
1625
|
-
declare class EditorScroller extends
|
|
1626
|
-
|
|
1794
|
+
declare class EditorScroller extends LitBlock {
|
|
1795
|
+
private readonly handleWheel;
|
|
1796
|
+
connectedCallback(): void;
|
|
1797
|
+
disconnectedCallback(): void;
|
|
1627
1798
|
}
|
|
1628
1799
|
|
|
1629
1800
|
type SliderOperation = ColorOperation | 'filter';
|
|
1630
1801
|
type SliderFilter = FilterId | typeof FAKE_ORIGINAL_FILTER;
|
|
1631
1802
|
declare const FAKE_ORIGINAL_FILTER = "original";
|
|
1632
|
-
declare class EditorSlider extends
|
|
1633
|
-
private
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1803
|
+
declare class EditorSlider extends LitBlock {
|
|
1804
|
+
private state;
|
|
1805
|
+
handleInput: (e: CustomEvent<{
|
|
1806
|
+
value: number;
|
|
1807
|
+
}>) => void;
|
|
1637
1808
|
setOperation(operation: SliderOperation, filter?: SliderFilter): void;
|
|
1638
1809
|
private _initializeValues;
|
|
1639
1810
|
apply(): void;
|
|
1640
1811
|
cancel(): void;
|
|
1641
1812
|
initCallback(): void;
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
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;
|
|
1646
1835
|
private _cancelPreload?;
|
|
1647
|
-
private
|
|
1648
|
-
|
|
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>;
|
|
1649
1844
|
private _onSliderClose;
|
|
1650
|
-
private _createOperationControl;
|
|
1651
|
-
private _createFilterControl;
|
|
1652
|
-
private _createToggleControl;
|
|
1653
|
-
private _createAspectRatioControl;
|
|
1654
|
-
private _createFreeformControl;
|
|
1655
|
-
private _clearListAspectRatio;
|
|
1656
|
-
private _renderControlsList;
|
|
1657
1845
|
private _activateTab;
|
|
1658
|
-
private
|
|
1846
|
+
private applyTabState;
|
|
1659
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;
|
|
1660
1860
|
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
1861
|
initCallback(): void;
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
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 {
|
|
1686
1916
|
private _visible;
|
|
1917
|
+
private _styles;
|
|
1687
1918
|
private _visibleStyle;
|
|
1688
1919
|
private _hiddenStyle;
|
|
1689
1920
|
private _externalTransitions;
|
|
1690
|
-
|
|
1921
|
+
private initialRenderComplete;
|
|
1922
|
+
set visible(value: boolean);
|
|
1923
|
+
get visible(): boolean;
|
|
1924
|
+
set styles(styles: PresenceToggleStyle);
|
|
1925
|
+
get styles(): PresenceToggleStyle;
|
|
1691
1926
|
private _handleVisible;
|
|
1927
|
+
private dispatchInitialRenderEvent;
|
|
1692
1928
|
initCallback(): void;
|
|
1693
1929
|
}
|
|
1694
1930
|
|
|
1695
|
-
declare class SliderUi extends
|
|
1931
|
+
declare class SliderUi extends LitBlock {
|
|
1696
1932
|
private _observer?;
|
|
1697
1933
|
private _thumbSize;
|
|
1698
|
-
private _zero;
|
|
1699
1934
|
private _zeroDotEl?;
|
|
1700
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;
|
|
1701
1945
|
constructor();
|
|
1702
|
-
|
|
1703
|
-
private
|
|
1704
|
-
private
|
|
1705
|
-
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;
|
|
1706
1953
|
private _updateValue;
|
|
1707
1954
|
private _updateZeroDot;
|
|
1708
1955
|
private _updateSteps;
|
|
1709
|
-
|
|
1956
|
+
disconnectedCallback(): void;
|
|
1957
|
+
private _setCurrentValue;
|
|
1958
|
+
private _syncInputValue;
|
|
1959
|
+
private _extractEventValue;
|
|
1960
|
+
render(): lit_html.TemplateResult<1>;
|
|
1710
1961
|
}
|
|
1711
1962
|
|
|
1712
|
-
declare class Copyright extends
|
|
1963
|
+
declare class Copyright extends LitBlock {
|
|
1713
1964
|
initCallback(): void;
|
|
1714
|
-
|
|
1965
|
+
render(): lit_html.TemplateResult<1>;
|
|
1715
1966
|
}
|
|
1716
1967
|
|
|
1717
|
-
declare class DropArea extends
|
|
1968
|
+
declare class DropArea extends LitUploaderBlock {
|
|
1718
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();
|
|
1719
1979
|
private _destroyDropzone;
|
|
1720
1980
|
private _destroyContentWrapperDropzone;
|
|
1721
|
-
private
|
|
1722
|
-
|
|
1981
|
+
private contentWrapperRef;
|
|
1982
|
+
private readonly handleAreaInteraction;
|
|
1983
|
+
private sourceListAllowsLocal;
|
|
1984
|
+
private clickableListenersAttached;
|
|
1723
1985
|
isActive(): boolean;
|
|
1724
1986
|
initCallback(): void;
|
|
1987
|
+
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
1988
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
1725
1989
|
/** Ignore drop events if there are other visible drop areas on the page. */
|
|
1726
1990
|
private _shouldIgnore;
|
|
1727
1991
|
private _couldHandleFiles;
|
|
1728
|
-
|
|
1992
|
+
private updateIsEnabled;
|
|
1993
|
+
private updateVisibility;
|
|
1994
|
+
private updateDragStateAttribute;
|
|
1995
|
+
private updateClickableListeners;
|
|
1996
|
+
disconnectedCallback(): void;
|
|
1997
|
+
render(): lit_html.TemplateResult<1>;
|
|
1729
1998
|
}
|
|
1730
1999
|
|
|
1731
2000
|
type EntrySubscription = ReturnType<UploadEntryTypedData['subscribe']>;
|
|
1732
|
-
declare class FileItemConfig extends
|
|
2001
|
+
declare class FileItemConfig extends LitUploaderBlock {
|
|
1733
2002
|
protected _entrySubs: Set<EntrySubscription>;
|
|
1734
2003
|
protected _entry: UploadEntryTypedData | null;
|
|
1735
2004
|
protected _withEntry<A extends unknown[], R>(fn: (entry: UploadEntryTypedData, ...args: A) => R): (...args: A) => R | undefined;
|
|
@@ -1741,11 +2010,27 @@ declare class FileItemConfig extends UploaderBlock {
|
|
|
1741
2010
|
declare class FileItem extends FileItemConfig {
|
|
1742
2011
|
couldBeCtxOwner: boolean;
|
|
1743
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;
|
|
1744
2027
|
private _renderedOnce;
|
|
1745
2028
|
private _observer?;
|
|
1746
2029
|
protected _isIntersecting: boolean;
|
|
1747
2030
|
protected _thumbRect?: DOMRectReadOnly;
|
|
1748
|
-
|
|
2031
|
+
private _handleEdit;
|
|
2032
|
+
private _handleRemove;
|
|
2033
|
+
private _handleUploadClick;
|
|
1749
2034
|
private _calculateState;
|
|
1750
2035
|
private _debouncedCalculateState;
|
|
1751
2036
|
private _updateHintAndProgress;
|
|
@@ -1754,170 +2039,153 @@ declare class FileItem extends FileItemConfig {
|
|
|
1754
2039
|
private _observerCallback;
|
|
1755
2040
|
private _handleEntryId;
|
|
1756
2041
|
private _updateShowFileNames;
|
|
2042
|
+
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
1757
2043
|
initCallback(): void;
|
|
1758
|
-
destroyCallback(): void;
|
|
1759
2044
|
connectedCallback(): void;
|
|
1760
2045
|
disconnectedCallback(): void;
|
|
1761
|
-
private _settingsOfShrink;
|
|
1762
|
-
private _processShrink;
|
|
1763
2046
|
upload: () => Promise<void> | undefined;
|
|
1764
|
-
static template: string;
|
|
1765
2047
|
static activeInstances: Set<FileItem>;
|
|
2048
|
+
protected shouldUpdate(_changedProperties: PropertyValues): boolean;
|
|
2049
|
+
render(): lit_html.TemplateResult<1>;
|
|
1766
2050
|
}
|
|
1767
2051
|
|
|
1768
|
-
declare class FormInput extends
|
|
1769
|
-
requireCtxName: boolean;
|
|
2052
|
+
declare class FormInput extends LitUploaderBlock {
|
|
1770
2053
|
_validationInputElement: HTMLInputElement | null;
|
|
1771
2054
|
_dynamicInputsContainer: HTMLDivElement | null;
|
|
1772
2055
|
_createValidationInput(): HTMLInputElement;
|
|
1773
2056
|
initCallback(): void;
|
|
1774
2057
|
}
|
|
1775
2058
|
|
|
1776
|
-
declare class Icon extends
|
|
1777
|
-
|
|
2059
|
+
declare class Icon extends LitBlock {
|
|
2060
|
+
name: string;
|
|
2061
|
+
private resolvedHref;
|
|
2062
|
+
private iconHrefResolver;
|
|
1778
2063
|
initCallback(): void;
|
|
2064
|
+
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
2065
|
+
private updateResolvedHref;
|
|
2066
|
+
render(): lit_html.TemplateResult<1>;
|
|
1779
2067
|
}
|
|
1780
2068
|
|
|
1781
|
-
declare
|
|
1782
|
-
|
|
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;
|
|
1783
2086
|
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;
|
|
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;
|
|
1797
2091
|
analyticsParams(): string;
|
|
1798
|
-
initAttributes(el:
|
|
1799
|
-
/**
|
|
1800
|
-
* @param {HTMLElement} el
|
|
1801
|
-
* @param {() => void} cbkFn
|
|
1802
|
-
*/
|
|
2092
|
+
initAttributes(el: HTMLElement): void;
|
|
1803
2093
|
initIntersection(el: HTMLElement, cbkFn: () => void): void;
|
|
1804
|
-
|
|
1805
|
-
private
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
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;
|
|
1809
2099
|
}
|
|
1810
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
|
+
};
|
|
1811
2111
|
declare class ImgBase extends ImgConfig {
|
|
1812
|
-
_img: HTMLImageElement;
|
|
1813
|
-
_imgPreview: HTMLImageElement;
|
|
1814
|
-
/**
|
|
1815
|
-
* @private
|
|
1816
|
-
* @param {String} src
|
|
1817
|
-
*/
|
|
2112
|
+
protected _img: HTMLImageElement;
|
|
2113
|
+
protected _imgPreview: HTMLImageElement;
|
|
1818
2114
|
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
|
-
*/
|
|
2115
|
+
private _validateSize;
|
|
2116
|
+
private _getCdnModifiers;
|
|
2117
|
+
private _getTypedCssValue;
|
|
1839
2118
|
private _getUrlBase;
|
|
1840
|
-
/**
|
|
1841
|
-
* @private
|
|
1842
|
-
* @param {String} url
|
|
1843
|
-
* @returns {String}
|
|
1844
|
-
*/
|
|
1845
2119
|
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} */
|
|
2120
|
+
protected _getElSize(el: HTMLElement, k?: number, wOnly?: boolean): string | null;
|
|
2121
|
+
private _setupEventProxy;
|
|
1855
2122
|
get img(): HTMLImageElement;
|
|
1856
|
-
get currentImg():
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
} | {
|
|
1860
|
-
type: "MAIN";
|
|
1861
|
-
img: HTMLImageElement;
|
|
1862
|
-
};
|
|
1863
|
-
get hasPreviewImage(): any;
|
|
1864
|
-
get bgSelector(): any;
|
|
2123
|
+
get currentImg(): CurrentImg;
|
|
2124
|
+
get hasPreviewImage(): string | number | boolean | undefined;
|
|
2125
|
+
get bgSelector(): string | undefined;
|
|
1865
2126
|
get breakpoints(): number[] | null;
|
|
1866
2127
|
get hasFormatJPG(): boolean;
|
|
1867
|
-
/** @param {HTMLElement} el */
|
|
1868
2128
|
renderBg(el: HTMLElement): void;
|
|
1869
2129
|
getSrcset(): string;
|
|
1870
|
-
getSrc():
|
|
1871
|
-
get srcUrlPreview():
|
|
2130
|
+
getSrc(): string | undefined;
|
|
2131
|
+
get srcUrlPreview(): string | undefined;
|
|
1872
2132
|
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>;
|
|
2133
|
+
private _appendURL;
|
|
2134
|
+
private _setupConfigForImage;
|
|
2135
|
+
loaderImage({ src, srcset, elNode }: LoaderParams): Promise<HTMLImageElement>;
|
|
1886
2136
|
renderImage(): Promise<void>;
|
|
1887
2137
|
init(): void;
|
|
1888
2138
|
}
|
|
1889
2139
|
|
|
1890
2140
|
declare class Img extends ImgBase {
|
|
2141
|
+
connectedCallback(): void;
|
|
1891
2142
|
}
|
|
1892
2143
|
|
|
1893
|
-
declare class ProgressBar extends
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
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>;
|
|
1898
2156
|
}
|
|
1899
2157
|
|
|
1900
|
-
declare class ProgressBarCommon extends
|
|
2158
|
+
declare class ProgressBarCommon extends LitUploaderBlock {
|
|
1901
2159
|
private _unobserveCollectionCb?;
|
|
2160
|
+
protected visible: boolean;
|
|
2161
|
+
protected value: number;
|
|
1902
2162
|
constructor();
|
|
1903
2163
|
initCallback(): void;
|
|
1904
|
-
|
|
2164
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
2165
|
+
disconnectedCallback(): void;
|
|
2166
|
+
render(): lit_html.TemplateResult<1>;
|
|
1905
2167
|
}
|
|
1906
2168
|
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
select: HTMLSelectElement;
|
|
1910
|
-
} & Record<string, HTMLElement>;
|
|
2169
|
+
type SelectOption = {
|
|
2170
|
+
text: string;
|
|
1911
2171
|
value: string;
|
|
1912
|
-
|
|
1913
|
-
|
|
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;
|
|
1914
2179
|
}
|
|
1915
2180
|
|
|
1916
|
-
declare class SimpleBtn extends
|
|
2181
|
+
declare class SimpleBtn extends LitUploaderBlock {
|
|
1917
2182
|
static styleAttrs: string[];
|
|
1918
2183
|
couldBeCtxOwner: boolean;
|
|
1919
|
-
|
|
2184
|
+
dropzone: boolean;
|
|
2185
|
+
private buttonTextKey;
|
|
2186
|
+
private readonly handleClick;
|
|
1920
2187
|
initCallback(): void;
|
|
2188
|
+
render(): lit_html.TemplateResult<1>;
|
|
1921
2189
|
}
|
|
1922
2190
|
|
|
1923
2191
|
type SourceTypeConfig = {
|
|
@@ -1928,54 +2196,76 @@ type SourceTypeConfig = {
|
|
|
1928
2196
|
activate?: () => boolean;
|
|
1929
2197
|
activityParams?: Record<string, unknown>;
|
|
1930
2198
|
};
|
|
1931
|
-
declare class SourceBtn extends
|
|
2199
|
+
declare class SourceBtn extends LitUploaderBlock {
|
|
1932
2200
|
couldBeCtxOwner: boolean;
|
|
1933
|
-
private type;
|
|
1934
2201
|
private _registeredTypes;
|
|
1935
|
-
|
|
2202
|
+
type?: string;
|
|
2203
|
+
private iconName;
|
|
2204
|
+
private srcTypeKey;
|
|
1936
2205
|
initTypes(): void;
|
|
1937
2206
|
initCallback(): void;
|
|
1938
2207
|
registerType(typeConfig: SourceTypeConfig): void;
|
|
1939
2208
|
getType(type: string): SourceTypeConfig | undefined;
|
|
1940
2209
|
activate(): void;
|
|
1941
2210
|
applyType(type: string): void;
|
|
2211
|
+
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
2212
|
+
render(): lit_html.TemplateResult<1>;
|
|
1942
2213
|
}
|
|
1943
2214
|
|
|
1944
|
-
declare class SourceList extends
|
|
2215
|
+
declare class SourceList extends LitBlock {
|
|
2216
|
+
private _rawSourceList;
|
|
2217
|
+
private _cameraModes;
|
|
2218
|
+
private _resolvedSources;
|
|
1945
2219
|
initCallback(): void;
|
|
2220
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
2221
|
+
private _updateSources;
|
|
2222
|
+
sources: string[];
|
|
2223
|
+
render(): lit_html.TemplateResult<1>;
|
|
1946
2224
|
}
|
|
1947
2225
|
|
|
1948
|
-
declare class Spinner extends
|
|
2226
|
+
declare class Spinner extends LitBlock {
|
|
2227
|
+
render(): lit_html.TemplateResult<1>;
|
|
1949
2228
|
}
|
|
1950
2229
|
|
|
1951
|
-
declare class StartFrom extends
|
|
2230
|
+
declare class StartFrom extends LitActivityBlock {
|
|
1952
2231
|
historyTracked: boolean;
|
|
1953
2232
|
activityType: ActivityType;
|
|
1954
2233
|
initCallback(): void;
|
|
2234
|
+
render(): lit_html.TemplateResult<1>;
|
|
1955
2235
|
}
|
|
1956
2236
|
|
|
1957
2237
|
declare class Thumb extends FileItemConfig {
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
private
|
|
1961
|
-
private
|
|
1962
|
-
private
|
|
1963
|
-
|
|
1964
|
-
private
|
|
1965
|
-
private
|
|
1966
|
-
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;
|
|
1967
2256
|
private _observerCallback;
|
|
1968
2257
|
protected _reset(): void;
|
|
1969
|
-
private
|
|
2258
|
+
private bindToEntry;
|
|
1970
2259
|
initCallback(): void;
|
|
1971
2260
|
connectedCallback(): void;
|
|
1972
2261
|
disconnectedCallback(): void;
|
|
2262
|
+
render(): lit_html.TemplateResult<1>;
|
|
1973
2263
|
}
|
|
1974
2264
|
|
|
1975
2265
|
type EventListenerMap = {
|
|
1976
2266
|
[K in (typeof EventType)[keyof typeof EventType]]: (e: CustomEvent<EventPayload[K]>) => void;
|
|
1977
2267
|
};
|
|
1978
|
-
declare class UploadCtxProvider extends
|
|
2268
|
+
declare class UploadCtxProvider extends LitUploaderBlock {
|
|
1979
2269
|
static styleAttrs: string[];
|
|
1980
2270
|
static EventType: Readonly<{
|
|
1981
2271
|
readonly FILE_ADDED: "file-added";
|
|
@@ -1997,57 +2287,94 @@ declare class UploadCtxProvider extends UploaderBlock {
|
|
|
1997
2287
|
readonly CHANGE: "change";
|
|
1998
2288
|
readonly GROUP_CREATED: "group-created";
|
|
1999
2289
|
}>;
|
|
2000
|
-
requireCtxName: boolean;
|
|
2001
2290
|
initCallback(): void;
|
|
2002
|
-
|
|
2291
|
+
disconnectedCallback(): void;
|
|
2003
2292
|
}
|
|
2004
|
-
interface UploadCtxProvider extends
|
|
2293
|
+
interface UploadCtxProvider extends LitUploaderBlock {
|
|
2005
2294
|
addEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | AddEventListenerOptions): void;
|
|
2006
2295
|
removeEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | EventListenerOptions): void;
|
|
2007
2296
|
}
|
|
2008
2297
|
|
|
2009
|
-
declare class UrlSource extends
|
|
2298
|
+
declare class UrlSource extends LitUploaderBlock {
|
|
2010
2299
|
couldBeCtxOwner: boolean;
|
|
2011
2300
|
activityType: ActivityType;
|
|
2012
|
-
|
|
2301
|
+
private formState;
|
|
2013
2302
|
initCallback(): void;
|
|
2303
|
+
private inputRef;
|
|
2304
|
+
private handleInput;
|
|
2305
|
+
private handleUpload;
|
|
2306
|
+
render(): lit_html.TemplateResult<1>;
|
|
2014
2307
|
}
|
|
2015
2308
|
|
|
2016
2309
|
declare const PACKAGE_NAME = "blocks";
|
|
2017
2310
|
declare const PACKAGE_VERSION: string;
|
|
2018
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
|
+
|
|
2019
2334
|
declare class CloudImageEditor extends CloudImageEditorBlock {
|
|
2020
2335
|
static styleAttrs: string[];
|
|
2021
2336
|
constructor();
|
|
2022
2337
|
initCallback(): void;
|
|
2023
2338
|
}
|
|
2024
2339
|
|
|
2025
|
-
declare class FileUploaderInline extends
|
|
2340
|
+
declare class FileUploaderInline extends LitSolutionBlock {
|
|
2026
2341
|
static styleAttrs: string[];
|
|
2342
|
+
private couldCancel;
|
|
2027
2343
|
constructor();
|
|
2344
|
+
private _handleCancel;
|
|
2028
2345
|
get couldHistoryBack(): boolean;
|
|
2029
2346
|
get couldShowList(): boolean;
|
|
2347
|
+
private _getInitActivity;
|
|
2030
2348
|
initCallback(): void;
|
|
2349
|
+
render(): lit_html.TemplateResult<1>;
|
|
2031
2350
|
}
|
|
2032
2351
|
|
|
2033
|
-
declare class FileUploaderMinimal extends
|
|
2352
|
+
declare class FileUploaderMinimal extends LitSolutionBlock {
|
|
2034
2353
|
static styleAttrs: string[];
|
|
2354
|
+
protected singleUpload: boolean;
|
|
2355
|
+
protected isHiddenStartFrom: boolean;
|
|
2356
|
+
protected classUploadList: string;
|
|
2357
|
+
protected classStartFrom: string;
|
|
2035
2358
|
private handleModalOpen?;
|
|
2036
2359
|
private handleModalClose?;
|
|
2360
|
+
private _getInitActivity;
|
|
2037
2361
|
constructor();
|
|
2038
2362
|
private _handleModalOpen;
|
|
2039
2363
|
private _handleModalClose;
|
|
2040
2364
|
initCallback(): void;
|
|
2041
|
-
|
|
2365
|
+
disconnectedCallback(): void;
|
|
2366
|
+
render(): lit_html.TemplateResult<1>;
|
|
2042
2367
|
}
|
|
2043
2368
|
|
|
2044
|
-
declare class FileUploaderRegular extends
|
|
2369
|
+
declare class FileUploaderRegular extends LitSolutionBlock {
|
|
2045
2370
|
static styleAttrs: string[];
|
|
2371
|
+
headless: boolean;
|
|
2046
2372
|
constructor();
|
|
2047
2373
|
initCallback(): void;
|
|
2374
|
+
render(): lit_html.TemplateResult<1>;
|
|
2048
2375
|
}
|
|
2049
2376
|
|
|
2050
2377
|
type KebabCase<T extends string> = T extends `${infer Head} ${infer Tail}` ? `${Lowercase<Head>}-${KebabCase<Tail>}` : Lowercase<T>;
|
|
2051
2378
|
declare const toKebabCase: <T extends string>(str: T) => KebabCase<T>;
|
|
2052
2379
|
|
|
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 };
|
|
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 };
|