@uploadcare/file-uploader 1.25.0-alpha.9 → 1.25.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 +75 -4
- package/dist/env.js +33 -4
- package/dist/index.css +2660 -5
- package/dist/index.d.ts +976 -1316
- package/dist/index.js +12012 -6
- package/dist/index.layered.css +2716 -4
- package/dist/index.ssr.js +768 -549
- package/dist/locales/file-uploader/ar.js +165 -4
- package/dist/locales/file-uploader/az.js +157 -4
- package/dist/locales/file-uploader/ca.js +159 -4
- package/dist/locales/file-uploader/cs.js +161 -4
- package/dist/locales/file-uploader/da.js +157 -4
- package/dist/locales/file-uploader/de.js +157 -4
- package/dist/locales/file-uploader/el.js +157 -4
- package/dist/locales/file-uploader/en.js +157 -4
- package/dist/locales/file-uploader/es.js +159 -4
- package/dist/locales/file-uploader/et.js +157 -4
- package/dist/locales/file-uploader/fi.js +157 -4
- package/dist/locales/file-uploader/fr.js +159 -4
- package/dist/locales/file-uploader/he.js +159 -4
- package/dist/locales/file-uploader/hy.js +157 -4
- package/dist/locales/file-uploader/is.js +157 -4
- package/dist/locales/file-uploader/it.js +159 -4
- package/dist/locales/file-uploader/ja.js +157 -4
- package/dist/locales/file-uploader/ka.js +157 -4
- package/dist/locales/file-uploader/kk.js +157 -4
- package/dist/locales/file-uploader/ko.js +157 -4
- package/dist/locales/file-uploader/lv.js +159 -4
- package/dist/locales/file-uploader/nb.js +157 -4
- package/dist/locales/file-uploader/nl.js +157 -4
- package/dist/locales/file-uploader/pl.js +161 -4
- package/dist/locales/file-uploader/pt.js +159 -4
- package/dist/locales/file-uploader/ro.js +159 -4
- package/dist/locales/file-uploader/ru.js +161 -4
- package/dist/locales/file-uploader/sk.js +161 -4
- package/dist/locales/file-uploader/sr.js +159 -4
- package/dist/locales/file-uploader/sv.js +157 -4
- package/dist/locales/file-uploader/tr.js +157 -4
- package/dist/locales/file-uploader/uk.js +161 -4
- package/dist/locales/file-uploader/vi.js +157 -4
- package/dist/locales/file-uploader/zh-TW.js +157 -4
- package/dist/locales/file-uploader/zh.js +157 -4
- package/package.json +31 -36
- package/types/jsx.d.ts +48 -75
- package/web/file-uploader.iife.min.d.ts +987 -1327
- package/web/file-uploader.iife.min.js +27 -6
- package/web/file-uploader.min.d.ts +987 -1327
- package/web/file-uploader.min.js +26 -5
- package/web/uc-basic.layered.min.css +23 -4
- package/web/uc-basic.min.css +23 -4
- package/web/uc-cloud-image-editor.layered.min.css +23 -4
- package/web/uc-cloud-image-editor.min.css +23 -4
- package/web/uc-cloud-image-editor.min.d.ts +550 -756
- package/web/uc-cloud-image-editor.min.js +26 -5
- package/web/uc-file-uploader-inline.layered.min.css +23 -4
- package/web/uc-file-uploader-inline.min.css +23 -4
- package/web/uc-file-uploader-inline.min.d.ts +987 -1327
- package/web/uc-file-uploader-inline.min.js +26 -5
- package/web/uc-file-uploader-minimal.layered.min.css +23 -4
- package/web/uc-file-uploader-minimal.min.css +23 -4
- package/web/uc-file-uploader-minimal.min.d.ts +987 -1327
- package/web/uc-file-uploader-minimal.min.js +26 -5
- package/web/uc-file-uploader-regular.layered.min.css +23 -4
- package/web/uc-file-uploader-regular.min.css +23 -4
- package/web/uc-file-uploader-regular.min.d.ts +987 -1327
- package/web/uc-file-uploader-regular.min.js +26 -5
- package/web/uc-img.min.d.ts +100 -55
- package/web/uc-img.min.js +25 -5
- package/web/file-uploader.iife.min.js.LEGAL.txt +0 -71
- package/web/file-uploader.min.js.LEGAL.txt +0 -71
- package/web/uc-cloud-image-editor.min.js.LEGAL.txt +0 -70
- package/web/uc-file-uploader-inline.min.js.LEGAL.txt +0 -71
- package/web/uc-file-uploader-minimal.min.js.LEGAL.txt +0 -71
- package/web/uc-file-uploader-regular.min.js.LEGAL.txt +0 -71
- package/web/uc-img.min.js.LEGAL.txt +0 -24
package/dist/index.d.ts
CHANGED
|
@@ -1,144 +1,426 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import * as lit_html from 'lit-html';
|
|
4
|
-
import * as lit_html_directives_ref_js from 'lit-html/directives/ref.js';
|
|
5
|
-
import { TelemetryRequest } from '@uploadcare/quality-insights';
|
|
1
|
+
import { BaseComponent } from '@symbiotejs/symbiote';
|
|
2
|
+
export { BaseComponent, Data, UID } from '@symbiotejs/symbiote';
|
|
6
3
|
import * as _uploadcare_upload_client from '@uploadcare/upload-client';
|
|
7
|
-
import { UploadcareFile, Metadata, UploadError, NetworkError, UploadcareGroup, FileFromOptions
|
|
4
|
+
import { UploadcareFile, Metadata, UploadError, NetworkError, UploadcareGroup, FileFromOptions } from '@uploadcare/upload-client';
|
|
8
5
|
export { Metadata, NetworkError, UploadError, UploadcareError, UploadcareFile, UploadcareGroup } from '@uploadcare/upload-client';
|
|
9
|
-
|
|
6
|
+
export { loadFileUploaderFrom } from './abstract/loadFileUploaderFrom.js';
|
|
7
|
+
import { TelemetryRequest } from '@uploadcare/quality-insights';
|
|
10
8
|
export { PACKAGE_NAME, PACKAGE_VERSION } from './env.js';
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
private constructor();
|
|
19
|
-
pub<K extends keyof T>(key: K, value: T[K]): void;
|
|
20
|
-
sub<K extends keyof T>(key: K, callback: (value: T[K]) => void, init?: boolean): Subscription;
|
|
21
|
-
read<K extends keyof T>(key: K): T[K];
|
|
22
|
-
add<K extends keyof T>(key: K, value: T[K], rewrite?: boolean): void;
|
|
23
|
-
has(key: keyof T): boolean;
|
|
24
|
-
get store(): T;
|
|
25
|
-
static registerCtx<T extends Record<string, unknown>>(initialValue: T, ctxId: string): PubSub<T>;
|
|
26
|
-
static deleteCtx(ctxId: string): void;
|
|
27
|
-
static getCtx<T extends Record<string, unknown> = Record<string, unknown>>(ctxId: string): PubSub<T> | null;
|
|
28
|
-
static hasCtx(ctxId: string): boolean;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
type Constructor<T = unknown> = new (...args: any[]) => T;
|
|
32
|
-
|
|
33
|
-
type SymbioteStateBag<T extends Record<string, unknown>> = T;
|
|
34
|
-
/**
|
|
35
|
-
* Interface for components using SymbioteMixin
|
|
36
|
-
*/
|
|
37
|
-
declare class SymbioteComponent<TState extends Record<string, unknown> = Record<string, unknown>> {
|
|
38
|
-
$: SymbioteStateBag<TState>;
|
|
39
|
-
sub<TKey extends keyof TState>(key: TKey, callback: (value: TState[TKey]) => void, init?: boolean): () => void;
|
|
40
|
-
pub<TKey extends keyof TState>(key: TKey, value: TState[TKey]): void;
|
|
41
|
-
set$<T extends {
|
|
42
|
-
[K in keyof T]: K extends keyof TState ? TState[K] : never;
|
|
43
|
-
}>(obj: T): void;
|
|
44
|
-
has<TKey extends keyof TState>(key: TKey): boolean;
|
|
45
|
-
add<TKey extends keyof TState>(key: TKey, val: TState[TKey], rewrite?: boolean): void;
|
|
46
|
-
add$<T extends {
|
|
47
|
-
[K in keyof T]: K extends keyof TState ? TState[K] : never;
|
|
48
|
-
}>(obj: T, rewrite?: boolean): void;
|
|
49
|
-
initCallback(): void;
|
|
50
|
-
ctxName: string;
|
|
51
|
-
ctxOwner: boolean;
|
|
10
|
+
declare class A11y {
|
|
11
|
+
private _destroyKeyUX;
|
|
12
|
+
private readonly _scopedWindow;
|
|
13
|
+
constructor();
|
|
14
|
+
registerBlock(scope: Block): void;
|
|
15
|
+
destroy(): void;
|
|
52
16
|
}
|
|
53
17
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
18
|
+
type LocaleChangeCallback = () => void;
|
|
19
|
+
declare class LocaleManager {
|
|
20
|
+
private _blockInstance;
|
|
21
|
+
private _localeName;
|
|
22
|
+
private _callbacks;
|
|
23
|
+
private _boundBlocks;
|
|
24
|
+
constructor(blockInstance: Block);
|
|
25
|
+
onLocaleChange(callback: LocaleChangeCallback): () => void;
|
|
26
|
+
bindL10n(block: Block, key: string, resolver: LocaleChangeCallback): void;
|
|
27
|
+
destroyL10nBindings(block: Block): void;
|
|
28
|
+
destroy(): void;
|
|
63
29
|
}
|
|
64
30
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
31
|
+
declare class Modal extends Block {
|
|
32
|
+
static styleAttrs: string[];
|
|
33
|
+
static StateConsumerScope: string;
|
|
34
|
+
private _mouseDownTarget;
|
|
35
|
+
handleModalOpen: ModalCb;
|
|
36
|
+
handleModalClose: ModalCb;
|
|
37
|
+
handleModalCloseAll: ModalCb;
|
|
38
|
+
constructor();
|
|
39
|
+
_handleBackdropClick: () => void;
|
|
40
|
+
_closeDialog: () => void;
|
|
41
|
+
_handleDialogClose: () => void;
|
|
42
|
+
_handleDialogMouseDown: (e: MouseEvent) => void;
|
|
43
|
+
_handleDialogMouseUp: (e: MouseEvent) => void;
|
|
44
|
+
show(): void;
|
|
45
|
+
hide(): void;
|
|
46
|
+
private _handleModalOpen;
|
|
47
|
+
private _handleModalClose;
|
|
48
|
+
private _handleModalCloseAll;
|
|
49
|
+
initCallback(): void;
|
|
50
|
+
destroyCallback(): void;
|
|
72
51
|
}
|
|
73
52
|
|
|
74
|
-
declare
|
|
53
|
+
declare const ModalEvents: Readonly<{
|
|
54
|
+
readonly ADD: "modal:add";
|
|
55
|
+
readonly DELETE: "modal:delete";
|
|
56
|
+
readonly OPEN: "modal:open";
|
|
57
|
+
readonly CLOSE: "modal:close";
|
|
58
|
+
readonly CLOSE_ALL: "modal:closeAll";
|
|
59
|
+
readonly DESTROY: "modal:destroy";
|
|
60
|
+
}>;
|
|
61
|
+
type ModalId = ActivityType;
|
|
62
|
+
type ModalCb = (data: {
|
|
63
|
+
id: ModalId;
|
|
64
|
+
modal: Modal;
|
|
65
|
+
}) => void;
|
|
66
|
+
type ModalEventType = (typeof ModalEvents)[keyof typeof ModalEvents];
|
|
67
|
+
declare class ModalManager {
|
|
68
|
+
private _modals;
|
|
69
|
+
private _activeModals;
|
|
70
|
+
private _subscribers;
|
|
71
|
+
private _block;
|
|
72
|
+
constructor(block: Block);
|
|
73
|
+
private _debugPrint;
|
|
74
|
+
/**
|
|
75
|
+
* Register a modal with the manager
|
|
76
|
+
* @param id Unique identifier for the modal
|
|
77
|
+
* @param modal Modal component instance
|
|
78
|
+
*/
|
|
79
|
+
registerModal(id: ModalId, modal: Modal): void;
|
|
80
|
+
/** Remove a modal by ID. */
|
|
81
|
+
deleteModal(id: ModalId): boolean;
|
|
82
|
+
/** Open a modal by its ID. */
|
|
83
|
+
open(id: ModalId): boolean;
|
|
84
|
+
/** Close a specific modal by ID. */
|
|
85
|
+
close(id: ModalId): boolean;
|
|
86
|
+
/** Toggle a modal - open if closed, close if open. */
|
|
87
|
+
toggle(id: ModalId): boolean;
|
|
88
|
+
/** True if there are any active modals. */
|
|
89
|
+
get hasActiveModals(): boolean;
|
|
90
|
+
/** Close the most recently opened modal and return to the previous one. */
|
|
91
|
+
back(): boolean;
|
|
92
|
+
/** Close all open modals. */
|
|
93
|
+
closeAll(): number;
|
|
94
|
+
/**
|
|
95
|
+
* Subscribe to modal events
|
|
96
|
+
* @returns Unsubscribe function
|
|
97
|
+
*/
|
|
98
|
+
subscribe(event: ModalEventType, callback: ModalCb): () => void;
|
|
99
|
+
/** Unsubscribe from modal events */
|
|
100
|
+
unsubscribe(event: ModalEventType, callback: ModalCb | undefined): void;
|
|
101
|
+
/** Notify all subscribers of a modal event. */
|
|
102
|
+
private _notify;
|
|
103
|
+
/** Destroy the modal manager, clean up resources */
|
|
104
|
+
destroy(): void;
|
|
105
|
+
}
|
|
75
106
|
|
|
76
|
-
type
|
|
77
|
-
type
|
|
78
|
-
|
|
107
|
+
type CommonEventType = InternalEventKey | EventKey;
|
|
108
|
+
type TelemetryState = TelemetryRequest & {
|
|
109
|
+
eventTimestamp: number;
|
|
110
|
+
location: string;
|
|
111
|
+
};
|
|
112
|
+
type TelemetryEventBody = Partial<Pick<TelemetryState, 'payload' | 'config'>> & {
|
|
113
|
+
modalId?: string;
|
|
114
|
+
eventType?: CommonEventType;
|
|
115
|
+
};
|
|
116
|
+
declare class TelemetryManager {
|
|
117
|
+
private readonly _sessionId;
|
|
118
|
+
private readonly _telemetryInstance;
|
|
119
|
+
private readonly _block;
|
|
120
|
+
private _config;
|
|
121
|
+
private _initialized;
|
|
122
|
+
private _lastPayload;
|
|
123
|
+
private readonly _queue;
|
|
124
|
+
constructor(block: Block);
|
|
125
|
+
private _init;
|
|
126
|
+
private _setConfig;
|
|
127
|
+
private _formattingPayload;
|
|
128
|
+
private _excludedEvents;
|
|
129
|
+
sendEvent(body: TelemetryEventBody): void;
|
|
130
|
+
sendEventError(error: unknown, context?: string): void;
|
|
131
|
+
/**
|
|
132
|
+
* Method to send telemetry event for Cloud Image Editor.
|
|
133
|
+
*/
|
|
134
|
+
sendEventCloudImageEditor(e: MouseEvent, tabId: string, options?: Record<string, unknown>): void;
|
|
135
|
+
/**
|
|
136
|
+
* Deeply compares two objects and returns true if they are equal, false otherwise.
|
|
137
|
+
*/
|
|
138
|
+
private _checkObj;
|
|
139
|
+
private get _timestamp();
|
|
140
|
+
private get _solution();
|
|
141
|
+
private get _activity();
|
|
142
|
+
private get _location();
|
|
143
|
+
}
|
|
79
144
|
|
|
80
|
-
declare class
|
|
81
|
-
private
|
|
82
|
-
|
|
145
|
+
declare class Block extends BaseComponent<any> {
|
|
146
|
+
private __cfgProxy?;
|
|
147
|
+
protected l10nProcessorSubs: Map<string, Set<{
|
|
148
|
+
remove: () => void;
|
|
149
|
+
}>>;
|
|
150
|
+
static StateConsumerScope: string | null;
|
|
151
|
+
static styleAttrs: string[];
|
|
152
|
+
protected requireCtxName: boolean;
|
|
153
|
+
activityType: ActivityType;
|
|
154
|
+
init$: {};
|
|
155
|
+
l10n(str: string, variables?: Record<string, string | number>): string;
|
|
156
|
+
private pluralize;
|
|
157
|
+
protected bindL10n(key: string, resolver: () => void): void;
|
|
83
158
|
constructor();
|
|
84
|
-
|
|
85
|
-
|
|
159
|
+
emit(type: Parameters<EventEmitter['emit']>[0], payload?: Parameters<EventEmitter['emit']>[1], options?: Parameters<EventEmitter['emit']>[2]): void;
|
|
160
|
+
hasBlockInCtx(callback: (block: Block) => boolean): boolean;
|
|
161
|
+
setOrAddState(prop: string, newVal: any): void;
|
|
162
|
+
connectedCallback(): void;
|
|
163
|
+
disconnectedCallback(): void;
|
|
164
|
+
initCallback(): void;
|
|
165
|
+
get testId(): string;
|
|
166
|
+
get modalManager(): ModalManager | undefined;
|
|
167
|
+
get telemetryManager(): TelemetryManager | {
|
|
168
|
+
sendEvent: () => void;
|
|
169
|
+
sendEventCloudImageEditor: () => void;
|
|
170
|
+
sendEventError: () => void;
|
|
171
|
+
};
|
|
172
|
+
protected get localeManager(): LocaleManager | null;
|
|
173
|
+
protected get a11y(): A11y | null;
|
|
174
|
+
protected get blocksRegistry(): Set<Block>;
|
|
175
|
+
destroyCallback(): void;
|
|
176
|
+
/**
|
|
177
|
+
* Called when the last block is removed from the context. Note that inheritors must run their callback before that.
|
|
178
|
+
*/
|
|
179
|
+
protected destroyCtxCallback(): void;
|
|
180
|
+
protected proxyUrl(url: string): Promise<string>;
|
|
181
|
+
get cfg(): ConfigType;
|
|
182
|
+
subConfigValue<T extends keyof ConfigType>(key: T, callback: (value: ConfigType[T]) => void): void;
|
|
183
|
+
debugPrint(...args: unknown[]): void;
|
|
184
|
+
static reg(name?: string): void;
|
|
86
185
|
}
|
|
87
186
|
|
|
88
|
-
declare
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
187
|
+
declare const InternalEventType: Readonly<{
|
|
188
|
+
readonly INIT_SOLUTION: "init-solution";
|
|
189
|
+
readonly CHANGE_CONFIG: "change-config";
|
|
190
|
+
readonly ACTION_EVENT: "action-event";
|
|
191
|
+
readonly ERROR_EVENT: "error-event";
|
|
192
|
+
}>;
|
|
193
|
+
declare const EventType: Readonly<{
|
|
194
|
+
readonly FILE_ADDED: "file-added";
|
|
195
|
+
readonly FILE_REMOVED: "file-removed";
|
|
196
|
+
readonly FILE_UPLOAD_START: "file-upload-start";
|
|
197
|
+
readonly FILE_UPLOAD_PROGRESS: "file-upload-progress";
|
|
198
|
+
readonly FILE_UPLOAD_SUCCESS: "file-upload-success";
|
|
199
|
+
readonly FILE_UPLOAD_FAILED: "file-upload-failed";
|
|
200
|
+
readonly FILE_URL_CHANGED: "file-url-changed";
|
|
201
|
+
readonly MODAL_OPEN: "modal-open";
|
|
202
|
+
readonly MODAL_CLOSE: "modal-close";
|
|
203
|
+
readonly DONE_CLICK: "done-click";
|
|
204
|
+
readonly UPLOAD_CLICK: "upload-click";
|
|
205
|
+
readonly ACTIVITY_CHANGE: "activity-change";
|
|
206
|
+
readonly COMMON_UPLOAD_START: "common-upload-start";
|
|
207
|
+
readonly COMMON_UPLOAD_PROGRESS: "common-upload-progress";
|
|
208
|
+
readonly COMMON_UPLOAD_SUCCESS: "common-upload-success";
|
|
209
|
+
readonly COMMON_UPLOAD_FAILED: "common-upload-failed";
|
|
210
|
+
readonly CHANGE: "change";
|
|
211
|
+
readonly GROUP_CREATED: "group-created";
|
|
212
|
+
}>;
|
|
213
|
+
type EventKey = (typeof EventType)[keyof typeof EventType];
|
|
214
|
+
type InternalEventKey = (typeof InternalEventType)[keyof typeof InternalEventType];
|
|
215
|
+
type EventPayload = {
|
|
216
|
+
[EventType.FILE_ADDED]: OutputFileEntry<'idle'>;
|
|
217
|
+
[EventType.FILE_REMOVED]: OutputFileEntry<'removed'>;
|
|
218
|
+
[EventType.FILE_UPLOAD_START]: OutputFileEntry<'uploading'>;
|
|
219
|
+
[EventType.FILE_UPLOAD_PROGRESS]: OutputFileEntry<'uploading'>;
|
|
220
|
+
[EventType.FILE_UPLOAD_SUCCESS]: OutputFileEntry<'success'>;
|
|
221
|
+
[EventType.FILE_UPLOAD_FAILED]: OutputFileEntry<'failed'>;
|
|
222
|
+
[EventType.FILE_URL_CHANGED]: OutputFileEntry<'success'>;
|
|
223
|
+
[EventType.MODAL_OPEN]: {
|
|
224
|
+
modalId: ModalId;
|
|
225
|
+
};
|
|
226
|
+
[EventType.MODAL_CLOSE]: {
|
|
227
|
+
modalId: ModalId;
|
|
228
|
+
hasActiveModals: boolean;
|
|
229
|
+
};
|
|
230
|
+
[EventType.ACTIVITY_CHANGE]: {
|
|
231
|
+
activity: ActivityType;
|
|
232
|
+
};
|
|
233
|
+
[EventType.UPLOAD_CLICK]: void;
|
|
234
|
+
[EventType.DONE_CLICK]: OutputCollectionState;
|
|
235
|
+
[EventType.COMMON_UPLOAD_START]: OutputCollectionState<'uploading'>;
|
|
236
|
+
[EventType.COMMON_UPLOAD_PROGRESS]: OutputCollectionState<'uploading'>;
|
|
237
|
+
[EventType.COMMON_UPLOAD_SUCCESS]: OutputCollectionState<'success'>;
|
|
238
|
+
[EventType.COMMON_UPLOAD_FAILED]: OutputCollectionState<'failed'>;
|
|
239
|
+
[EventType.CHANGE]: OutputCollectionState;
|
|
240
|
+
[EventType.GROUP_CREATED]: OutputCollectionState<'success', 'has-group'>;
|
|
241
|
+
};
|
|
242
|
+
declare class EventEmitter {
|
|
243
|
+
private _timeoutStore;
|
|
244
|
+
private _targets;
|
|
245
|
+
private _debugPrint;
|
|
246
|
+
constructor(debugPrint: (...args: unknown[]) => void);
|
|
247
|
+
bindTarget(target: Block): void;
|
|
248
|
+
unbindTarget(target: Block): void;
|
|
249
|
+
private _dispatch;
|
|
250
|
+
emit<T extends EventKey, TDebounce extends boolean | number | undefined = undefined>(type: T, payload?: TDebounce extends false | undefined ? EventPayload[T] : () => EventPayload[T], options?: {
|
|
251
|
+
debounce?: TDebounce;
|
|
252
|
+
}): void;
|
|
92
253
|
}
|
|
93
254
|
|
|
94
255
|
type EventMap = {
|
|
95
256
|
[T in keyof EventPayload]: CustomEvent<EventPayload[T]>;
|
|
96
257
|
};
|
|
97
258
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
declare
|
|
101
|
-
private _ctxId;
|
|
102
|
-
private _data;
|
|
103
|
-
constructor(initialValue: T);
|
|
104
|
-
get uid(): Uid;
|
|
105
|
-
setValue<K extends keyof T>(prop: K, value: T[K]): void;
|
|
106
|
-
setMultipleValues(updObj: Partial<T>): void;
|
|
107
|
-
getValue<K extends keyof T>(prop: K): T[K];
|
|
108
|
-
subscribe<K extends keyof T>(prop: K, handler: (newVal: T[K]) => void): Subscription;
|
|
109
|
-
destroy(): void;
|
|
110
|
-
}
|
|
259
|
+
type LocaleDefinition = Record<string, string>;
|
|
260
|
+
type LocaleDefinitionResolver = () => Promise<LocaleDefinition>;
|
|
261
|
+
declare const defineLocale: (localeName: string, definitionOrResolver: LocaleDefinition | LocaleDefinitionResolver) => void;
|
|
111
262
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
263
|
+
declare function buildOutputCollectionState<TCollectionStatus extends OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'>(uploaderBlock: UploaderBlock): OutputCollectionState<TCollectionStatus, TGroupFlag>;
|
|
264
|
+
|
|
265
|
+
type TypedSchema = Record<string, {
|
|
266
|
+
type: unknown;
|
|
267
|
+
value: unknown;
|
|
268
|
+
nullable?: boolean;
|
|
269
|
+
}>;
|
|
270
|
+
type Constructor<T = any> = new (...args: any[]) => T;
|
|
271
|
+
type ExtractType<T, V> = T extends StringConstructor ? string : T extends BooleanConstructor ? boolean : T extends NumberConstructor ? number : T extends ArrayConstructor ? V : T extends Constructor ? InstanceType<T> : T;
|
|
272
|
+
type ExtractDataFromSchema<T extends TypedSchema> = {
|
|
273
|
+
[K in keyof T]: ExtractType<T[K]['type'], T[K]['value']> | (T[K]['nullable'] extends true ? null : never);
|
|
274
|
+
};
|
|
275
|
+
type ExtractKeysFromSchema<T extends TypedSchema> = Extract<keyof T, string>;
|
|
276
|
+
declare class TypedData<T extends TypedSchema> {
|
|
277
|
+
private __typedSchema;
|
|
278
|
+
private __ctxId;
|
|
279
|
+
private __schema;
|
|
280
|
+
private __data;
|
|
281
|
+
constructor(typedSchema: T, ctxName?: string);
|
|
282
|
+
get uid(): string;
|
|
283
|
+
setValue<K extends ExtractKeysFromSchema<T>>(prop: K, value: ExtractDataFromSchema<T>[K]): void;
|
|
284
|
+
setMultipleValues(updObj: Partial<ExtractDataFromSchema<T>>): void;
|
|
285
|
+
getValue<K extends ExtractKeysFromSchema<T>>(prop: K): ExtractDataFromSchema<T>[K];
|
|
286
|
+
subscribe<K extends ExtractKeysFromSchema<T>>(prop: K, handler: (newVal: ExtractDataFromSchema<T>[K]) => void): {
|
|
287
|
+
remove: () => void;
|
|
288
|
+
callback: Function;
|
|
289
|
+
};
|
|
290
|
+
remove(): void;
|
|
139
291
|
}
|
|
140
|
-
|
|
141
|
-
|
|
292
|
+
|
|
293
|
+
declare const uploadEntrySchema: Readonly<{
|
|
294
|
+
file: Readonly<{
|
|
295
|
+
type: {
|
|
296
|
+
new (fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;
|
|
297
|
+
prototype: File;
|
|
298
|
+
};
|
|
299
|
+
value: null;
|
|
300
|
+
nullable: true;
|
|
301
|
+
}>;
|
|
302
|
+
externalUrl: Readonly<{
|
|
303
|
+
type: StringConstructor;
|
|
304
|
+
value: null;
|
|
305
|
+
nullable: true;
|
|
306
|
+
}>;
|
|
307
|
+
fileName: Readonly<{
|
|
308
|
+
type: StringConstructor;
|
|
309
|
+
value: null;
|
|
310
|
+
nullable: true;
|
|
311
|
+
}>;
|
|
312
|
+
fileSize: Readonly<{
|
|
313
|
+
type: NumberConstructor;
|
|
314
|
+
value: null;
|
|
315
|
+
nullable: true;
|
|
316
|
+
}>;
|
|
317
|
+
lastModified: Readonly<{
|
|
318
|
+
type: NumberConstructor;
|
|
319
|
+
value: number;
|
|
320
|
+
}>;
|
|
321
|
+
uploadProgress: Readonly<{
|
|
322
|
+
type: NumberConstructor;
|
|
323
|
+
value: 0;
|
|
324
|
+
}>;
|
|
325
|
+
uuid: Readonly<{
|
|
326
|
+
type: StringConstructor;
|
|
327
|
+
value: null;
|
|
328
|
+
nullable: true;
|
|
329
|
+
}>;
|
|
330
|
+
isImage: Readonly<{
|
|
331
|
+
type: BooleanConstructor;
|
|
332
|
+
value: false;
|
|
333
|
+
}>;
|
|
334
|
+
mimeType: Readonly<{
|
|
335
|
+
type: StringConstructor;
|
|
336
|
+
value: null;
|
|
337
|
+
nullable: true;
|
|
338
|
+
}>;
|
|
339
|
+
ctxName: Readonly<{
|
|
340
|
+
type: StringConstructor;
|
|
341
|
+
value: null;
|
|
342
|
+
nullable: true;
|
|
343
|
+
}>;
|
|
344
|
+
cdnUrl: Readonly<{
|
|
345
|
+
type: StringConstructor;
|
|
346
|
+
value: null;
|
|
347
|
+
nullable: true;
|
|
348
|
+
}>;
|
|
349
|
+
cdnUrlModifiers: Readonly<{
|
|
350
|
+
type: StringConstructor;
|
|
351
|
+
value: null;
|
|
352
|
+
nullable: true;
|
|
353
|
+
}>;
|
|
354
|
+
fileInfo: Readonly<{
|
|
355
|
+
type: typeof UploadcareFile;
|
|
356
|
+
value: null;
|
|
357
|
+
nullable: true;
|
|
358
|
+
}>;
|
|
359
|
+
isUploading: Readonly<{
|
|
360
|
+
type: BooleanConstructor;
|
|
361
|
+
value: false;
|
|
362
|
+
}>;
|
|
363
|
+
abortController: Readonly<{
|
|
364
|
+
type: {
|
|
365
|
+
new (): AbortController;
|
|
366
|
+
prototype: AbortController;
|
|
367
|
+
};
|
|
368
|
+
value: null;
|
|
369
|
+
nullable: true;
|
|
370
|
+
}>;
|
|
371
|
+
thumbUrl: Readonly<{
|
|
372
|
+
type: StringConstructor;
|
|
373
|
+
value: null;
|
|
374
|
+
nullable: true;
|
|
375
|
+
}>;
|
|
376
|
+
silent: Readonly<{
|
|
377
|
+
type: BooleanConstructor;
|
|
378
|
+
value: false;
|
|
379
|
+
}>;
|
|
380
|
+
source: Readonly<{
|
|
381
|
+
type: StringConstructor;
|
|
382
|
+
value: null;
|
|
383
|
+
nullable: true;
|
|
384
|
+
}>;
|
|
385
|
+
fullPath: Readonly<{
|
|
386
|
+
type: StringConstructor;
|
|
387
|
+
value: null;
|
|
388
|
+
nullable: true;
|
|
389
|
+
}>;
|
|
390
|
+
metadata: Readonly<{
|
|
391
|
+
type: ObjectConstructor;
|
|
392
|
+
value: null;
|
|
393
|
+
nullable: true;
|
|
394
|
+
}>;
|
|
395
|
+
errors: Readonly<{
|
|
396
|
+
type: ArrayConstructor;
|
|
397
|
+
value: OutputErrorFile[];
|
|
398
|
+
}>;
|
|
399
|
+
uploadError: Readonly<{
|
|
400
|
+
type: ErrorConstructor;
|
|
401
|
+
value: null;
|
|
402
|
+
nullable: true;
|
|
403
|
+
}>;
|
|
404
|
+
isRemoved: Readonly<{
|
|
405
|
+
type: BooleanConstructor;
|
|
406
|
+
value: false;
|
|
407
|
+
}>;
|
|
408
|
+
isQueuedForUploading: Readonly<{
|
|
409
|
+
type: BooleanConstructor;
|
|
410
|
+
value: false;
|
|
411
|
+
}>;
|
|
412
|
+
isValidationPending: Readonly<{
|
|
413
|
+
type: BooleanConstructor;
|
|
414
|
+
value: false;
|
|
415
|
+
}>;
|
|
416
|
+
isQueuedForValidation: Readonly<{
|
|
417
|
+
type: BooleanConstructor;
|
|
418
|
+
value: false;
|
|
419
|
+
}>;
|
|
420
|
+
}>;
|
|
421
|
+
type UploadEntryData = ExtractDataFromSchema<typeof uploadEntrySchema>;
|
|
422
|
+
type UploadEntryTypedData = TypedData<typeof uploadEntrySchema>;
|
|
423
|
+
type UploadEntryKeys = ExtractKeysFromSchema<typeof uploadEntrySchema>;
|
|
142
424
|
|
|
143
425
|
type FuncFileValidator = (outputEntry: OutputFileEntry, api: UploaderPublicApi, options?: {
|
|
144
426
|
signal?: AbortSignal;
|
|
@@ -157,10 +439,10 @@ declare class ValidationManager {
|
|
|
157
439
|
private _queue;
|
|
158
440
|
private _runQueueDebounced;
|
|
159
441
|
private _entryValidationState;
|
|
160
|
-
constructor(blockInstance:
|
|
161
|
-
runFileValidators(runOn: FileValidatorDescriptor['runOn'], entryIds?:
|
|
442
|
+
constructor(blockInstance: UploaderBlock);
|
|
443
|
+
runFileValidators(runOn: FileValidatorDescriptor['runOn'], entryIds?: string[]): void;
|
|
162
444
|
runCollectionValidators(): void;
|
|
163
|
-
cleanupValidationForEntry(entry: TypedData<
|
|
445
|
+
cleanupValidationForEntry(entry: TypedData<typeof uploadEntrySchema>): void;
|
|
164
446
|
private _runFileValidatorsForEntry;
|
|
165
447
|
private _addCustomTypeToValidationError;
|
|
166
448
|
private _getEntryValidationState;
|
|
@@ -169,7 +451,8 @@ declare class ValidationManager {
|
|
|
169
451
|
}
|
|
170
452
|
|
|
171
453
|
type CameraMode = 'photo' | 'video';
|
|
172
|
-
|
|
454
|
+
type CameraStatus = 'shot' | 'retake' | 'accept' | 'play' | 'stop' | 'pause' | 'resume';
|
|
455
|
+
declare class CameraSource extends UploaderBlock {
|
|
173
456
|
couldBeCtxOwner: boolean;
|
|
174
457
|
activityType: "camera";
|
|
175
458
|
private _unsubPermissions;
|
|
@@ -186,101 +469,52 @@ declare class CameraSource extends LitUploaderBlock {
|
|
|
186
469
|
private _cameraDevices;
|
|
187
470
|
private _audioDevices;
|
|
188
471
|
private _permissionResponses;
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
private _elapsedTime;
|
|
199
|
-
private _videoTransformCss;
|
|
200
|
-
private _videoHidden;
|
|
201
|
-
private _messageHidden;
|
|
202
|
-
private _requestBtnHidden;
|
|
203
|
-
private _cameraSelectOptions;
|
|
204
|
-
private _cameraSelectHidden;
|
|
205
|
-
private _l10nMessage;
|
|
206
|
-
private _timerHidden;
|
|
207
|
-
private _cameraHidden;
|
|
208
|
-
private _cameraActionsHidden;
|
|
209
|
-
private _audioSelectOptions;
|
|
210
|
-
private _audioSelectHidden;
|
|
211
|
-
private _audioSelectDisabled;
|
|
212
|
-
private _audioToggleMicrophoneHidden;
|
|
213
|
-
private _tabCameraHidden;
|
|
214
|
-
private _tabVideoHidden;
|
|
215
|
-
private _currentIcon;
|
|
216
|
-
private _currentTimelineIcon;
|
|
217
|
-
private _toggleMicrophoneIcon;
|
|
218
|
-
private _mutableClassButton;
|
|
219
|
-
private _chooseActionWithCamera;
|
|
220
|
-
private _handleCameraSelectChange;
|
|
221
|
-
private _handleAudioSelectChange;
|
|
222
|
-
private _handleRequestPermissions;
|
|
223
|
-
private _handleStartCamera;
|
|
224
|
-
private _handleToggleRecording;
|
|
225
|
-
private _handleToggleAudio;
|
|
226
|
-
private _handleRetake;
|
|
227
|
-
private _handleAccept;
|
|
228
|
-
private _handleClickTab;
|
|
229
|
-
private _updateTimer;
|
|
230
|
-
private _startTimer;
|
|
231
|
-
private _stopTimer;
|
|
232
|
-
private _startTimeline;
|
|
233
|
-
private _stopTimeline;
|
|
234
|
-
private _animationFrameId;
|
|
235
|
-
private _startRecording;
|
|
472
|
+
constructor();
|
|
473
|
+
_chooseActionWithCamera: () => void;
|
|
474
|
+
_updateTimer: () => void;
|
|
475
|
+
_startTimer: () => void;
|
|
476
|
+
_stopTimer: () => void;
|
|
477
|
+
_startTimeline: () => void;
|
|
478
|
+
_stopTimeline: () => void;
|
|
479
|
+
_animationFrameId: number | null;
|
|
480
|
+
_startRecording: () => void;
|
|
236
481
|
private _stopRecording;
|
|
237
482
|
/** This method is used to toggle recording pause/resume */
|
|
238
|
-
|
|
239
|
-
|
|
483
|
+
_toggleRecording: () => void;
|
|
484
|
+
_toggleEnableAudio: () => void;
|
|
240
485
|
/**
|
|
241
486
|
* Previewing the video that was recorded on the camera
|
|
242
487
|
*/
|
|
243
488
|
private _previewVideo;
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
* Do not bind srcObject directly in the template, because it stops video pausing on shot.
|
|
249
|
-
* I really don'y know why but that's how it is. Assigning srcObject manually fixes the issue.
|
|
250
|
-
*/
|
|
251
|
-
private _applyVideoSource;
|
|
252
|
-
private _retake;
|
|
253
|
-
private _accept;
|
|
254
|
-
private _handlePhoto;
|
|
255
|
-
private _handleVideo;
|
|
489
|
+
_retake: () => void;
|
|
490
|
+
_accept: () => void;
|
|
491
|
+
_handlePhoto: (status: CameraStatus) => void;
|
|
492
|
+
_handleVideo: (status: CameraStatus) => void;
|
|
256
493
|
private _setCameraState;
|
|
257
494
|
private _shot;
|
|
258
495
|
private _handleActiveTab;
|
|
259
496
|
private _createFile;
|
|
260
|
-
|
|
497
|
+
_guessExtensionByMime(mime: string | undefined): string;
|
|
261
498
|
/**
|
|
262
499
|
* The send file to the server
|
|
263
500
|
*/
|
|
264
|
-
|
|
501
|
+
_toSend: (file: File) => void;
|
|
265
502
|
private get _cameraModes();
|
|
266
503
|
private _setPermissionsState;
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
504
|
+
_makeStreamInactive: () => boolean;
|
|
505
|
+
_stopCapture: () => void;
|
|
506
|
+
_capture: () => Promise<void>;
|
|
507
|
+
_handlePermissionsChange: () => void;
|
|
508
|
+
_permissionAccess: () => Promise<void>;
|
|
509
|
+
_getPermission: () => void;
|
|
510
|
+
_requestDeviceAccess: () => Promise<void>;
|
|
511
|
+
_getDevices: () => Promise<void>;
|
|
512
|
+
_onActivate: () => Promise<void>;
|
|
513
|
+
_onDeactivate: () => Promise<void>;
|
|
514
|
+
_handleCameraModes: (cameraModes: CameraMode[]) => void;
|
|
278
515
|
initCallback(): void;
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
private _destroy;
|
|
282
|
-
disconnectedCallback(): void;
|
|
283
|
-
render(): lit_html.TemplateResult<1>;
|
|
516
|
+
_destroy(): void;
|
|
517
|
+
destroyCallback(): Promise<void>;
|
|
284
518
|
}
|
|
285
519
|
|
|
286
520
|
/**
|
|
@@ -289,49 +523,33 @@ declare class CameraSource extends LitUploaderBlock {
|
|
|
289
523
|
declare const complexConfigKeys: readonly ["metadata", "localeDefinitionOverride", "secureUploadsSignatureResolver", "secureDeliveryProxyUrlResolver", "iconHrefResolver", "fileValidators", "collectionValidators", "mediaRecorderOptions"];
|
|
290
524
|
/** Mapping of attribute names to state */
|
|
291
525
|
declare const attrStateMapping: Record<string, string>;
|
|
292
|
-
declare class Config extends
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
};
|
|
296
|
-
init$: LitBlock["init$"] & ConfigType;
|
|
297
|
-
private _computationControllers;
|
|
526
|
+
declare class Config extends Block {
|
|
527
|
+
requireCtxName: boolean;
|
|
528
|
+
constructor();
|
|
298
529
|
private _flushValueToAttribute;
|
|
299
530
|
private _flushValueToState;
|
|
300
531
|
private _setValue;
|
|
301
532
|
private _getValue;
|
|
302
|
-
|
|
533
|
+
_assertSameValueDifferentReference(key: string, previousValue: unknown, nextValue: unknown): void;
|
|
303
534
|
initCallback(): void;
|
|
304
535
|
attributeChangedCallback(name: keyof typeof attrStateMapping, oldVal: string, newVal: string): void;
|
|
305
|
-
|
|
536
|
+
get computationControllers(): any;
|
|
306
537
|
}
|
|
307
538
|
interface Config extends ConfigType {
|
|
308
539
|
}
|
|
309
540
|
|
|
310
541
|
type FilesViewMode = 'grid' | 'list';
|
|
311
|
-
declare class UploadList extends
|
|
542
|
+
declare class UploadList extends UploaderBlock {
|
|
312
543
|
couldBeCtxOwner: boolean;
|
|
313
|
-
|
|
544
|
+
historyTracked: boolean;
|
|
314
545
|
activityType: "upload-list";
|
|
315
|
-
|
|
316
|
-
private _doneBtnEnabled;
|
|
317
|
-
private _uploadBtnVisible;
|
|
318
|
-
private _addMoreBtnVisible;
|
|
319
|
-
private _addMoreBtnEnabled;
|
|
320
|
-
private _commonErrorMessage;
|
|
321
|
-
private _hasFiles;
|
|
322
|
-
private _latestSummary;
|
|
323
|
-
private get _headerText();
|
|
324
|
-
private _handleAdd;
|
|
325
|
-
private _handleUpload;
|
|
326
|
-
private _handleDone;
|
|
327
|
-
private _handleCancel;
|
|
546
|
+
constructor();
|
|
328
547
|
private _throttledHandleCollectionUpdate;
|
|
329
548
|
private _updateUploadsState;
|
|
330
549
|
private _getHeaderText;
|
|
331
550
|
get couldOpenActivity(): boolean;
|
|
332
551
|
initCallback(): void;
|
|
333
|
-
|
|
334
|
-
render(): lit_html.TemplateResult<1>;
|
|
552
|
+
destroyCallback(): void;
|
|
335
553
|
}
|
|
336
554
|
|
|
337
555
|
declare const ExternalUploadSource: Readonly<{
|
|
@@ -369,51 +587,6 @@ declare const UploadSource: Readonly<{
|
|
|
369
587
|
}>;
|
|
370
588
|
type SourceTypes = (typeof UploadSource)[keyof typeof UploadSource];
|
|
371
589
|
|
|
372
|
-
type ChangeMap<T extends Record<string, unknown>> = Record<keyof T, Set<Uid>>;
|
|
373
|
-
type TypedCollectionPropertyObserver<T extends Record<string, unknown>> = (changeMap: ChangeMap<T>) => void;
|
|
374
|
-
type TypedCollectionObserverHandler<T extends Record<string, unknown>> = (list: Uid[], added: Set<TypedData<T>>, removed: Set<TypedData<T>>) => void;
|
|
375
|
-
type TypedCollectionOptions<T extends Record<string, unknown>> = {
|
|
376
|
-
initialValue: T;
|
|
377
|
-
watchList?: (keyof T)[];
|
|
378
|
-
handler?: TypedCollectionObserverHandler<T>;
|
|
379
|
-
};
|
|
380
|
-
declare class TypedCollection<T extends Record<string, unknown>> {
|
|
381
|
-
private static readonly _destroyDelayMs;
|
|
382
|
-
private _ctxId;
|
|
383
|
-
private _data;
|
|
384
|
-
private _watchList;
|
|
385
|
-
private _subsMap;
|
|
386
|
-
private _propertyObservers;
|
|
387
|
-
private _collectionObservers;
|
|
388
|
-
private _items;
|
|
389
|
-
private _removed;
|
|
390
|
-
private _added;
|
|
391
|
-
private _markedToDestroy;
|
|
392
|
-
private _observeTimeout?;
|
|
393
|
-
private _notifyTimeout?;
|
|
394
|
-
private _destroyTimeout?;
|
|
395
|
-
private _notifyObservers;
|
|
396
|
-
private _initialValue;
|
|
397
|
-
constructor(options: TypedCollectionOptions<T>);
|
|
398
|
-
private _notify;
|
|
399
|
-
private _scheduleDestroyMarkedItems;
|
|
400
|
-
observeCollection(handler: TypedCollectionObserverHandler<T>): () => void;
|
|
401
|
-
unobserveCollection(handler: TypedCollectionObserverHandler<T>): void;
|
|
402
|
-
add(init: Partial<T>): Uid;
|
|
403
|
-
hasItem(id: Uid): boolean;
|
|
404
|
-
read(id: Uid): TypedData<T> | null;
|
|
405
|
-
readProp<K extends keyof T>(id: Uid, propName: K): T[K];
|
|
406
|
-
publishProp<K extends keyof T>(id: Uid, propName: K, value: T[K]): void;
|
|
407
|
-
remove(id: Uid): void;
|
|
408
|
-
clearAll(): void;
|
|
409
|
-
observeProperties(handler: TypedCollectionPropertyObserver<T>): () => void;
|
|
410
|
-
unobserveProperties(handler: TypedCollectionPropertyObserver<T>): void;
|
|
411
|
-
findItems(checkFn: (item: TypedData<T>) => boolean): Uid[];
|
|
412
|
-
items(): Uid[];
|
|
413
|
-
get size(): number;
|
|
414
|
-
destroy(): void;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
590
|
declare const CameraSourceTypes: Readonly<{
|
|
418
591
|
PHOTO: "photo";
|
|
419
592
|
VIDEO: "video";
|
|
@@ -427,8 +600,8 @@ type ApiAddFileCommonOptions = {
|
|
|
427
600
|
};
|
|
428
601
|
declare class UploaderPublicApi {
|
|
429
602
|
private _ctx;
|
|
430
|
-
constructor(ctx:
|
|
431
|
-
get _uploadCollection()
|
|
603
|
+
constructor(ctx: UploaderBlock);
|
|
604
|
+
private get _uploadCollection();
|
|
432
605
|
get cfg(): ConfigType;
|
|
433
606
|
get l10n(): (str: string, variables?: Record<string, string | number>) => string;
|
|
434
607
|
/**
|
|
@@ -451,7 +624,7 @@ declare class UploaderPublicApi {
|
|
|
451
624
|
getOutputCollectionState<TStatus extends OutputCollectionStatus>(): ReturnType<typeof buildOutputCollectionState<TStatus>>;
|
|
452
625
|
initFlow: (force?: boolean) => void;
|
|
453
626
|
doneFlow: () => void;
|
|
454
|
-
setCurrentActivity: <T extends
|
|
627
|
+
setCurrentActivity: <T extends ActivityType>(activityType: T, ...[params]: T extends keyof ActivityParamsMap ? [ActivityParamsMap[T]] : T extends RegisteredActivityType ? [undefined?] : [unknown?]) => void;
|
|
455
628
|
getCurrentActivity: () => ActivityType;
|
|
456
629
|
setModalState: (opened: boolean) => void;
|
|
457
630
|
private get _sourceList();
|
|
@@ -773,9 +946,7 @@ type OutputErrorTypePayload = {
|
|
|
773
946
|
NOT_AN_IMAGE: OutputFileErrorPayload;
|
|
774
947
|
FORBIDDEN_FILE_TYPE: OutputFileErrorPayload;
|
|
775
948
|
FILE_SIZE_EXCEEDED: OutputFileErrorPayload;
|
|
776
|
-
SOME_FILES_HAS_ERRORS: {
|
|
777
|
-
[k: string]: never;
|
|
778
|
-
};
|
|
949
|
+
SOME_FILES_HAS_ERRORS: {};
|
|
779
950
|
TOO_MANY_FILES: {
|
|
780
951
|
min: number;
|
|
781
952
|
max: number;
|
|
@@ -928,16 +1099,57 @@ type OutputCollectionState<TStatus extends OutputCollectionStatus = OutputCollec
|
|
|
928
1099
|
declare class SecureUploadsManager {
|
|
929
1100
|
private readonly _block;
|
|
930
1101
|
private _secureToken;
|
|
931
|
-
constructor(block:
|
|
1102
|
+
constructor(block: UploaderBlock);
|
|
932
1103
|
private _debugPrint;
|
|
933
1104
|
getSecureToken(): Promise<SecureUploadsSignatureAndExpire | null>;
|
|
934
1105
|
}
|
|
935
1106
|
|
|
936
|
-
|
|
1107
|
+
type ChangeMap<T extends TypedSchema> = Record<keyof T, Set<string>>;
|
|
1108
|
+
type TypedCollectionPropertyObserver<T extends TypedSchema> = (changeMap: ChangeMap<T>) => void;
|
|
1109
|
+
type TypedCollectionObserverHandler<T extends TypedSchema> = (list: string[], added: Set<TypedData<T>>, removed: Set<TypedData<T>>) => void;
|
|
1110
|
+
type TypedCollectionOptions<T extends TypedSchema> = {
|
|
1111
|
+
typedSchema: T;
|
|
1112
|
+
watchList?: ExtractKeysFromSchema<T>[];
|
|
1113
|
+
handler?: TypedCollectionObserverHandler<T>;
|
|
1114
|
+
ctxName?: string;
|
|
1115
|
+
};
|
|
1116
|
+
declare class TypedCollection<T extends TypedSchema> {
|
|
1117
|
+
private __typedSchema;
|
|
1118
|
+
private __ctxId;
|
|
1119
|
+
private __data;
|
|
1120
|
+
private __watchList;
|
|
1121
|
+
private __subsMap;
|
|
1122
|
+
private __propertyObservers;
|
|
1123
|
+
private __collectionObservers;
|
|
1124
|
+
private __items;
|
|
1125
|
+
private __removed;
|
|
1126
|
+
private __added;
|
|
1127
|
+
private __observeTimeout?;
|
|
1128
|
+
private __notifyTimeout?;
|
|
1129
|
+
private __notifyObservers;
|
|
1130
|
+
constructor(options: TypedCollectionOptions<T>);
|
|
1131
|
+
notify(): void;
|
|
1132
|
+
observeCollection(handler: TypedCollectionObserverHandler<T>): () => void;
|
|
1133
|
+
unobserveCollection(handler: TypedCollectionObserverHandler<T>): void;
|
|
1134
|
+
add(init: Partial<ExtractDataFromSchema<T>>): string;
|
|
1135
|
+
read(id: string): TypedData<T> | null;
|
|
1136
|
+
readProp<K extends ExtractKeysFromSchema<T>>(id: string, propName: K): ExtractDataFromSchema<T>[K] | null;
|
|
1137
|
+
publishProp<K extends ExtractKeysFromSchema<T>>(id: string, propName: K, value: ExtractDataFromSchema<T>[K]): void;
|
|
1138
|
+
remove(id: string): void;
|
|
1139
|
+
clearAll(): void;
|
|
1140
|
+
observeProperties(handler: TypedCollectionPropertyObserver<T>): () => void;
|
|
1141
|
+
unobserveProperties(handler: TypedCollectionPropertyObserver<T>): void;
|
|
1142
|
+
findItems(checkFn: (item: TypedData<T>) => boolean): string[];
|
|
1143
|
+
items(): string[];
|
|
1144
|
+
get size(): number;
|
|
1145
|
+
destroy(): void;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
declare class UploaderBlock extends ActivityBlock {
|
|
937
1149
|
static extSrcList: Readonly<typeof ExternalUploadSource>;
|
|
938
1150
|
static sourceTypes: Readonly<typeof UploadSource>;
|
|
939
1151
|
protected couldBeCtxOwner: boolean;
|
|
940
|
-
private
|
|
1152
|
+
private isCtxOwner;
|
|
941
1153
|
private _unobserveCollection?;
|
|
942
1154
|
private _unobserveCollectionProperties?;
|
|
943
1155
|
init$: {
|
|
@@ -948,21 +1160,23 @@ declare class LitUploaderBlock extends LitActivityBlock {
|
|
|
948
1160
|
'*collectionState': OutputCollectionState | null;
|
|
949
1161
|
'*groupInfo': _uploadcare_upload_client.UploadcareGroup | null;
|
|
950
1162
|
'*uploadTrigger': Set<string>;
|
|
1163
|
+
'*secureUploadsManager': SecureUploadsManager | null;
|
|
951
1164
|
'*currentActivity': null;
|
|
952
1165
|
'*currentActivityParams': {};
|
|
953
1166
|
'*history': never[];
|
|
954
1167
|
'*historyBack': null;
|
|
955
1168
|
'*closeModal': () => void;
|
|
956
1169
|
};
|
|
957
|
-
private get
|
|
1170
|
+
private get hasCtxOwner();
|
|
958
1171
|
initCallback(): void;
|
|
959
1172
|
protected get validationManager(): ValidationManager;
|
|
960
1173
|
get api(): UploaderPublicApi;
|
|
961
1174
|
getAPI(): UploaderPublicApi;
|
|
962
|
-
get uploadCollection(): TypedCollection<
|
|
963
|
-
|
|
1175
|
+
get uploadCollection(): TypedCollection<typeof uploadEntrySchema>;
|
|
1176
|
+
destroyCtxCallback(): void;
|
|
964
1177
|
disconnectedCallback(): void;
|
|
965
1178
|
connectedCallback(): void;
|
|
1179
|
+
destroyCallback(): void;
|
|
966
1180
|
private _initCtxOwner;
|
|
967
1181
|
private _observeUploadCollection;
|
|
968
1182
|
private _unobserveUploadCollection;
|
|
@@ -971,17 +1185,13 @@ declare class LitUploaderBlock extends LitActivityBlock {
|
|
|
971
1185
|
private _handleCollectionUpdate;
|
|
972
1186
|
private _handleCollectionPropertiesUpdate;
|
|
973
1187
|
private _flushCommonUploadProgress;
|
|
974
|
-
|
|
975
|
-
private
|
|
1188
|
+
openCloudImageEditor(): void;
|
|
1189
|
+
private setInitialCrop;
|
|
976
1190
|
protected getMetadataFor(entryId: string): Promise<_uploadcare_upload_client.Metadata | undefined>;
|
|
977
1191
|
protected getUploadClientOptions(): Promise<FileFromOptions>;
|
|
978
1192
|
getOutputData(): OutputFileEntry[];
|
|
979
1193
|
}
|
|
980
1194
|
|
|
981
|
-
/**
|
|
982
|
-
* Mapping of loading resources per operation
|
|
983
|
-
*/
|
|
984
|
-
type LoadingOperations = Map<string, Map<string, boolean>>;
|
|
985
1195
|
/**
|
|
986
1196
|
* Image size
|
|
987
1197
|
*/
|
|
@@ -1016,7 +1226,6 @@ interface ApplyResult {
|
|
|
1016
1226
|
cdnUrl: string;
|
|
1017
1227
|
transformations: Transformations;
|
|
1018
1228
|
}
|
|
1019
|
-
type ChangeResult = ApplyResult;
|
|
1020
1229
|
interface CropAspectRatio {
|
|
1021
1230
|
type: 'aspect-ratio';
|
|
1022
1231
|
width: number;
|
|
@@ -1024,66 +1233,44 @@ interface CropAspectRatio {
|
|
|
1024
1233
|
id: string;
|
|
1025
1234
|
hasFreeform?: boolean;
|
|
1026
1235
|
}
|
|
1027
|
-
type CropPresetList = CropAspectRatio[];
|
|
1028
1236
|
|
|
1029
1237
|
type ActivityParams$1 = {
|
|
1030
1238
|
internalId: string;
|
|
1031
1239
|
};
|
|
1032
|
-
declare class CloudImageEditorActivity extends
|
|
1240
|
+
declare class CloudImageEditorActivity extends UploaderBlock {
|
|
1033
1241
|
couldBeCtxOwner: boolean;
|
|
1034
1242
|
activityType: "cloud-image-edit";
|
|
1035
1243
|
private _entry?;
|
|
1036
|
-
private
|
|
1244
|
+
private _instance?;
|
|
1037
1245
|
get activityParams(): ActivityParams$1;
|
|
1038
1246
|
initCallback(): void;
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
private _unmountEditor;
|
|
1044
|
-
render(): lit_html.TemplateResult<1> | typeof nothing;
|
|
1045
|
-
private _createEditorConfig;
|
|
1247
|
+
handleApply(e: CustomEvent<ApplyResult>): void;
|
|
1248
|
+
handleCancel(): void;
|
|
1249
|
+
mountEditor(): void;
|
|
1250
|
+
unmountEditor(): void;
|
|
1046
1251
|
}
|
|
1047
1252
|
|
|
1048
1253
|
type ActivityParams = {
|
|
1049
1254
|
externalSourceType: string;
|
|
1050
1255
|
};
|
|
1051
|
-
declare class ExternalSource extends
|
|
1256
|
+
declare class ExternalSource extends UploaderBlock {
|
|
1052
1257
|
couldBeCtxOwner: boolean;
|
|
1053
1258
|
activityType: "external";
|
|
1054
1259
|
private _messageBridge?;
|
|
1055
|
-
|
|
1056
|
-
private _latestSelectionSummary;
|
|
1057
|
-
private _selectedList;
|
|
1058
|
-
private _isSelectionReady;
|
|
1059
|
-
private _isDoneBtnEnabled;
|
|
1060
|
-
private _couldSelectAll;
|
|
1061
|
-
private _couldDeselectAll;
|
|
1062
|
-
private _showSelectionStatus;
|
|
1063
|
-
private _showDoneBtn;
|
|
1064
|
-
private _doneBtnTextClass;
|
|
1065
|
-
private _toolbarVisible;
|
|
1066
|
-
private get _counterText();
|
|
1260
|
+
constructor();
|
|
1067
1261
|
get activityParams(): ActivityParams;
|
|
1068
1262
|
initCallback(): void;
|
|
1069
|
-
private
|
|
1070
|
-
private
|
|
1071
|
-
private
|
|
1072
|
-
private
|
|
1073
|
-
private
|
|
1074
|
-
private
|
|
1075
|
-
private
|
|
1076
|
-
private
|
|
1077
|
-
private
|
|
1078
|
-
private
|
|
1079
|
-
private
|
|
1080
|
-
private _handleDeselectAll;
|
|
1081
|
-
private _setSelectionSummary;
|
|
1082
|
-
private _mountIframe;
|
|
1083
|
-
private _unmountIframe;
|
|
1084
|
-
private _resetSelectionStatus;
|
|
1085
|
-
disconnectedCallback(): void;
|
|
1086
|
-
render(): lit_html.TemplateResult<1>;
|
|
1263
|
+
private extractUrlFromSelectedFile;
|
|
1264
|
+
private handleToolbarStateChange;
|
|
1265
|
+
private handleSelectedFilesChange;
|
|
1266
|
+
private handleIframeLoad;
|
|
1267
|
+
private applyTheme;
|
|
1268
|
+
private applyEmbedCss;
|
|
1269
|
+
private setupL10n;
|
|
1270
|
+
private remoteUrl;
|
|
1271
|
+
private mountIframe;
|
|
1272
|
+
private unmountIframe;
|
|
1273
|
+
private resetSelectionStatus;
|
|
1087
1274
|
}
|
|
1088
1275
|
|
|
1089
1276
|
declare const ACTIVE_PROP = "___ACTIVITY_IS_ACTIVE___";
|
|
@@ -1091,7 +1278,7 @@ type ActivityParamsMap = {
|
|
|
1091
1278
|
'cloud-image-edit': ActivityParams$1;
|
|
1092
1279
|
external: ActivityParams;
|
|
1093
1280
|
};
|
|
1094
|
-
declare class
|
|
1281
|
+
declare class ActivityBlock extends Block {
|
|
1095
1282
|
protected historyTracked: boolean;
|
|
1096
1283
|
private [ACTIVE_PROP]?;
|
|
1097
1284
|
init$: {
|
|
@@ -1101,7 +1288,9 @@ declare class LitActivityBlock extends LitBlock {
|
|
|
1101
1288
|
'*historyBack': null;
|
|
1102
1289
|
'*closeModal': () => void;
|
|
1103
1290
|
};
|
|
1104
|
-
|
|
1291
|
+
_debouncedHistoryFlush: (() => void) & {
|
|
1292
|
+
cancel: () => void;
|
|
1293
|
+
};
|
|
1105
1294
|
private _deactivate;
|
|
1106
1295
|
private _activate;
|
|
1107
1296
|
initCallback(): void;
|
|
@@ -1117,714 +1306,76 @@ declare class LitActivityBlock extends LitBlock {
|
|
|
1117
1306
|
CLOUD_IMG_EDIT: 'cloud-image-edit';
|
|
1118
1307
|
EXTERNAL: 'external';
|
|
1119
1308
|
}>;
|
|
1120
|
-
|
|
1309
|
+
get isActivityActive(): boolean;
|
|
1121
1310
|
get couldOpenActivity(): boolean;
|
|
1122
1311
|
/** TODO: remove name argument */
|
|
1123
|
-
|
|
1312
|
+
registerActivity(_name: string, options?: {
|
|
1124
1313
|
onActivate?: () => void;
|
|
1125
1314
|
onDeactivate?: () => void;
|
|
1126
1315
|
}): void;
|
|
1127
|
-
|
|
1128
|
-
|
|
1316
|
+
unregisterActivity(): void;
|
|
1317
|
+
destroyCallback(): void;
|
|
1318
|
+
get activityKey(): string;
|
|
1129
1319
|
get activityParams(): ActivityParamsMap[keyof ActivityParamsMap];
|
|
1130
|
-
get initActivity(): string
|
|
1131
|
-
get doneActivity(): string
|
|
1320
|
+
get initActivity(): string;
|
|
1321
|
+
get doneActivity(): string;
|
|
1132
1322
|
historyBack(): void;
|
|
1133
1323
|
}
|
|
1134
|
-
type RegisteredActivityType = (typeof
|
|
1324
|
+
type RegisteredActivityType = (typeof ActivityBlock)['activities'][keyof (typeof ActivityBlock)['activities']];
|
|
1135
1325
|
type ActivityType = RegisteredActivityType | (string & {}) | null;
|
|
1136
1326
|
|
|
1137
|
-
declare
|
|
1138
|
-
readonly INIT_SOLUTION: "init-solution";
|
|
1139
|
-
readonly CHANGE_CONFIG: "change-config";
|
|
1140
|
-
readonly ACTION_EVENT: "action-event";
|
|
1141
|
-
readonly ERROR_EVENT: "error-event";
|
|
1142
|
-
}>;
|
|
1143
|
-
declare const EventType: Readonly<{
|
|
1144
|
-
readonly FILE_ADDED: "file-added";
|
|
1145
|
-
readonly FILE_REMOVED: "file-removed";
|
|
1146
|
-
readonly FILE_UPLOAD_START: "file-upload-start";
|
|
1147
|
-
readonly FILE_UPLOAD_PROGRESS: "file-upload-progress";
|
|
1148
|
-
readonly FILE_UPLOAD_SUCCESS: "file-upload-success";
|
|
1149
|
-
readonly FILE_UPLOAD_FAILED: "file-upload-failed";
|
|
1150
|
-
readonly FILE_URL_CHANGED: "file-url-changed";
|
|
1151
|
-
readonly MODAL_OPEN: "modal-open";
|
|
1152
|
-
readonly MODAL_CLOSE: "modal-close";
|
|
1153
|
-
readonly DONE_CLICK: "done-click";
|
|
1154
|
-
readonly UPLOAD_CLICK: "upload-click";
|
|
1155
|
-
readonly ACTIVITY_CHANGE: "activity-change";
|
|
1156
|
-
readonly COMMON_UPLOAD_START: "common-upload-start";
|
|
1157
|
-
readonly COMMON_UPLOAD_PROGRESS: "common-upload-progress";
|
|
1158
|
-
readonly COMMON_UPLOAD_SUCCESS: "common-upload-success";
|
|
1159
|
-
readonly COMMON_UPLOAD_FAILED: "common-upload-failed";
|
|
1160
|
-
readonly CHANGE: "change";
|
|
1161
|
-
readonly GROUP_CREATED: "group-created";
|
|
1162
|
-
}>;
|
|
1163
|
-
type EventKey = (typeof EventType)[keyof typeof EventType];
|
|
1164
|
-
type InternalEventKey = (typeof InternalEventType)[keyof typeof InternalEventType];
|
|
1165
|
-
type EventPayload = {
|
|
1166
|
-
[EventType.FILE_ADDED]: OutputFileEntry<'idle'>;
|
|
1167
|
-
[EventType.FILE_REMOVED]: OutputFileEntry<'removed'>;
|
|
1168
|
-
[EventType.FILE_UPLOAD_START]: OutputFileEntry<'uploading'>;
|
|
1169
|
-
[EventType.FILE_UPLOAD_PROGRESS]: OutputFileEntry<'uploading'>;
|
|
1170
|
-
[EventType.FILE_UPLOAD_SUCCESS]: OutputFileEntry<'success'>;
|
|
1171
|
-
[EventType.FILE_UPLOAD_FAILED]: OutputFileEntry<'failed'>;
|
|
1172
|
-
[EventType.FILE_URL_CHANGED]: OutputFileEntry<'success'>;
|
|
1173
|
-
[EventType.MODAL_OPEN]: {
|
|
1174
|
-
modalId: ModalId;
|
|
1175
|
-
};
|
|
1176
|
-
[EventType.MODAL_CLOSE]: {
|
|
1177
|
-
modalId: ModalId;
|
|
1178
|
-
hasActiveModals: boolean;
|
|
1179
|
-
};
|
|
1180
|
-
[EventType.ACTIVITY_CHANGE]: {
|
|
1181
|
-
activity: ActivityType;
|
|
1182
|
-
};
|
|
1183
|
-
[EventType.UPLOAD_CLICK]: void;
|
|
1184
|
-
[EventType.DONE_CLICK]: OutputCollectionState;
|
|
1185
|
-
[EventType.COMMON_UPLOAD_START]: OutputCollectionState<'uploading'>;
|
|
1186
|
-
[EventType.COMMON_UPLOAD_PROGRESS]: OutputCollectionState<'uploading'>;
|
|
1187
|
-
[EventType.COMMON_UPLOAD_SUCCESS]: OutputCollectionState<'success'>;
|
|
1188
|
-
[EventType.COMMON_UPLOAD_FAILED]: OutputCollectionState<'failed'>;
|
|
1189
|
-
[EventType.CHANGE]: OutputCollectionState;
|
|
1190
|
-
[EventType.GROUP_CREATED]: OutputCollectionState<'success', 'has-group'>;
|
|
1191
|
-
};
|
|
1192
|
-
declare class EventEmitter {
|
|
1193
|
-
private _timeoutStore;
|
|
1194
|
-
private _targets;
|
|
1195
|
-
private _debugPrint;
|
|
1196
|
-
constructor(debugPrint: (...args: unknown[]) => void);
|
|
1197
|
-
bindTarget(target: LitBlock): () => void;
|
|
1198
|
-
private _dispatch;
|
|
1199
|
-
emit<T extends EventKey, TDebounce extends boolean | number | undefined = undefined>(type: T, payload?: TDebounce extends false | undefined ? EventPayload[T] : () => EventPayload[T], options?: {
|
|
1200
|
-
debounce?: TDebounce;
|
|
1201
|
-
}): void;
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
|
-
type CommonEventType = InternalEventKey | EventKey;
|
|
1205
|
-
type TelemetryState = TelemetryRequest & {
|
|
1206
|
-
eventTimestamp: number;
|
|
1207
|
-
location: string;
|
|
1208
|
-
};
|
|
1209
|
-
type TelemetryEventBody = Partial<Pick<TelemetryState, 'payload' | 'config'>> & {
|
|
1210
|
-
modalId?: string;
|
|
1211
|
-
eventType?: CommonEventType;
|
|
1212
|
-
};
|
|
1213
|
-
interface ITelemetryManager {
|
|
1214
|
-
sendEvent(body: TelemetryEventBody): void;
|
|
1215
|
-
sendEventError(error: unknown, context?: string): void;
|
|
1216
|
-
sendEventCloudImageEditor(e: MouseEvent, tabId: string, options?: Record<string, unknown>): void;
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
declare const TabId: Readonly<{
|
|
1220
|
-
readonly CROP: "crop";
|
|
1221
|
-
readonly TUNING: "tuning";
|
|
1222
|
-
readonly FILTERS: "filters";
|
|
1223
|
-
}>;
|
|
1224
|
-
type TabIdValue$1 = (typeof TabId)[keyof typeof TabId];
|
|
1225
|
-
declare const ALL_COLOR_OPERATIONS: readonly ["brightness", "exposure", "gamma", "contrast", "saturation", "vibrance", "warmth", "enhance"];
|
|
1226
|
-
type ColorOperation = (typeof ALL_COLOR_OPERATIONS)[number];
|
|
1227
|
-
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"];
|
|
1228
|
-
type FilterId = (typeof ALL_FILTERS)[number];
|
|
1229
|
-
declare const ALL_CROP_OPERATIONS: readonly ["rotate", "mirror", "flip"];
|
|
1230
|
-
type CropOperation = (typeof ALL_CROP_OPERATIONS)[number];
|
|
1231
|
-
/** KeypointsNumber is the number of keypoints loaded from each side of zero, not total number */
|
|
1232
|
-
declare const COLOR_OPERATIONS_CONFIG: Readonly<{
|
|
1233
|
-
brightness: {
|
|
1234
|
-
zero: number;
|
|
1235
|
-
range: readonly [-100, 100];
|
|
1236
|
-
keypointsNumber: number;
|
|
1237
|
-
};
|
|
1238
|
-
exposure: {
|
|
1239
|
-
zero: number;
|
|
1240
|
-
range: readonly [-500, 500];
|
|
1241
|
-
keypointsNumber: number;
|
|
1242
|
-
};
|
|
1243
|
-
gamma: {
|
|
1244
|
-
zero: number;
|
|
1245
|
-
range: readonly [0, 1000];
|
|
1246
|
-
keypointsNumber: number;
|
|
1247
|
-
};
|
|
1248
|
-
contrast: {
|
|
1249
|
-
zero: number;
|
|
1250
|
-
range: readonly [-100, 500];
|
|
1251
|
-
keypointsNumber: number;
|
|
1252
|
-
};
|
|
1253
|
-
saturation: {
|
|
1254
|
-
zero: number;
|
|
1255
|
-
range: readonly [-100, 500];
|
|
1256
|
-
keypointsNumber: number;
|
|
1257
|
-
};
|
|
1258
|
-
vibrance: {
|
|
1259
|
-
zero: number;
|
|
1260
|
-
range: readonly [-100, 500];
|
|
1261
|
-
keypointsNumber: number;
|
|
1262
|
-
};
|
|
1263
|
-
warmth: {
|
|
1264
|
-
zero: number;
|
|
1265
|
-
range: readonly [-100, 100];
|
|
1266
|
-
keypointsNumber: number;
|
|
1267
|
-
};
|
|
1268
|
-
enhance: {
|
|
1269
|
-
zero: number;
|
|
1270
|
-
range: readonly [0, 100];
|
|
1271
|
-
keypointsNumber: number;
|
|
1272
|
-
};
|
|
1273
|
-
filter: {
|
|
1274
|
-
zero: number;
|
|
1275
|
-
range: readonly [0, 100];
|
|
1276
|
-
keypointsNumber: number;
|
|
1277
|
-
};
|
|
1278
|
-
}>;
|
|
1279
|
-
|
|
1280
|
-
type SharedConfigState = {
|
|
1281
|
-
[K in keyof ConfigType as `*cfg/${K}`]: ConfigType[K];
|
|
1282
|
-
};
|
|
1283
|
-
type BlocksRegistry = Set<LitBlock>;
|
|
1284
|
-
type ActivityBlockCtxState = {
|
|
1285
|
-
'*currentActivity': string | null;
|
|
1286
|
-
'*currentActivityParams': Record<string, unknown>;
|
|
1287
|
-
'*history': (string | null)[];
|
|
1288
|
-
'*historyBack': (() => void) | null;
|
|
1289
|
-
'*closeModal': () => void;
|
|
1290
|
-
};
|
|
1291
|
-
type UploaderBlockCtxState = ActivityBlockCtxState & {
|
|
1292
|
-
'*commonProgress': number;
|
|
1293
|
-
'*uploadList': {
|
|
1294
|
-
uid: Uid;
|
|
1295
|
-
}[];
|
|
1296
|
-
'*uploadQueue': Queue;
|
|
1297
|
-
'*collectionErrors': OutputErrorCollection[];
|
|
1298
|
-
'*collectionState': OutputCollectionState | null;
|
|
1299
|
-
'*groupInfo': UploadcareGroup | null;
|
|
1300
|
-
'*uploadTrigger': Set<Uid>;
|
|
1301
|
-
};
|
|
1302
|
-
type SolutionBlockCtxState = UploaderBlockCtxState & {
|
|
1303
|
-
'*solution': string | null;
|
|
1304
|
-
};
|
|
1305
|
-
type CloudImageEditorState = {
|
|
1306
|
-
'*originalUrl': string | null;
|
|
1307
|
-
'*loadingOperations': LoadingOperations;
|
|
1308
|
-
'*faderEl': EditorImageFader | null;
|
|
1309
|
-
'*cropperEl': EditorImageCropper | null;
|
|
1310
|
-
'*imgEl': HTMLImageElement | null;
|
|
1311
|
-
'*imgContainerEl': HTMLElement | null;
|
|
1312
|
-
'*networkProblems': boolean;
|
|
1313
|
-
'*imageSize': {
|
|
1314
|
-
width: number;
|
|
1315
|
-
height: number;
|
|
1316
|
-
} | null;
|
|
1317
|
-
'*editorTransformations': Transformations;
|
|
1318
|
-
'*cropPresetList': CropPresetList;
|
|
1319
|
-
'*currentAspectRatio': CropAspectRatio | null;
|
|
1320
|
-
'*tabList': readonly TabIdValue$1[];
|
|
1321
|
-
'*tabId': TabIdValue$1;
|
|
1322
|
-
'*on.retryNetwork': () => void;
|
|
1323
|
-
'*on.apply': (transformations: Transformations) => void;
|
|
1324
|
-
'*on.cancel': () => void;
|
|
1325
|
-
};
|
|
1326
|
-
type EditorImageCropperState = {
|
|
1327
|
-
'*padding': number;
|
|
1328
|
-
'*operations': {
|
|
1329
|
-
rotate: number;
|
|
1330
|
-
mirror: boolean;
|
|
1331
|
-
flip: boolean;
|
|
1332
|
-
};
|
|
1333
|
-
'*imageBox': {
|
|
1334
|
-
x: number;
|
|
1335
|
-
y: number;
|
|
1336
|
-
width: number;
|
|
1337
|
-
height: number;
|
|
1338
|
-
};
|
|
1339
|
-
'*cropBox': {
|
|
1340
|
-
x: number;
|
|
1341
|
-
y: number;
|
|
1342
|
-
width: number;
|
|
1343
|
-
height: number;
|
|
1344
|
-
};
|
|
1345
|
-
};
|
|
1346
|
-
type EditorToolbarState = {
|
|
1347
|
-
'*showListAspectRatio': boolean;
|
|
1348
|
-
'*sliderEl': EditorSlider | null;
|
|
1349
|
-
'*showSlider': boolean;
|
|
1350
|
-
'*currentFilter': string;
|
|
1351
|
-
'*currentOperation': string | null;
|
|
1352
|
-
'*operationTooltip': string | null;
|
|
1353
|
-
};
|
|
1354
|
-
type DynamicBlockState = {
|
|
1355
|
-
'*blocksRegistry': BlocksRegistry;
|
|
1356
|
-
'*eventEmitter': EventEmitter;
|
|
1357
|
-
'*localeManager': LocaleManager;
|
|
1358
|
-
'*telemetryManager': ITelemetryManager;
|
|
1359
|
-
'*a11y': A11y;
|
|
1360
|
-
'*modalManager': ModalManager | null;
|
|
1361
|
-
};
|
|
1362
|
-
type DynamicUploaderBlockState = {
|
|
1363
|
-
'*uploadCollection': TypedCollection<UploadEntryData>;
|
|
1364
|
-
'*publicApi': UploaderPublicApi;
|
|
1365
|
-
'*validationManager': ValidationManager;
|
|
1366
|
-
'*secureUploadsManager': SecureUploadsManager;
|
|
1367
|
-
};
|
|
1368
|
-
type LocaleState = {
|
|
1369
|
-
[K in keyof LocaleDefinition as `*l10n/${K}`]: string;
|
|
1370
|
-
};
|
|
1371
|
-
type SharedState = SolutionBlockCtxState & SharedConfigState & CloudImageEditorState & EditorImageCropperState & EditorToolbarState & DynamicBlockState & DynamicUploaderBlockState & LocaleState;
|
|
1372
|
-
|
|
1373
|
-
declare const LitBlockBase: typeof LitElement & Constructor<{
|
|
1374
|
-
willYield: boolean;
|
|
1375
|
-
yield(slot: string, defaultContent?: unknown): unknown;
|
|
1376
|
-
}> & Constructor<{
|
|
1377
|
-
getCssData(propName: string, silentCheck?: boolean): string | number | boolean | null | undefined;
|
|
1378
|
-
}> & Constructor<SymbioteComponent<SharedState>> & Constructor<LitElement> & {
|
|
1379
|
-
reg(tagName: string): void;
|
|
1380
|
-
};
|
|
1381
|
-
declare class LitBlock extends LitBlockBase {
|
|
1382
|
-
private _cfgProxy;
|
|
1383
|
-
private _sharedContextInstances;
|
|
1384
|
-
static styleAttrs: string[];
|
|
1385
|
-
activityType: ActivityType;
|
|
1386
|
-
init$: {};
|
|
1387
|
-
constructor();
|
|
1388
|
-
l10n(str: string, variables?: Record<string, string | number>): string;
|
|
1389
|
-
private _pluralize;
|
|
1390
|
-
emit(type: Parameters<EventEmitter['emit']>[0], payload?: Parameters<EventEmitter['emit']>[1], options?: Parameters<EventEmitter['emit']>[2]): void;
|
|
1391
|
-
hasBlockInCtx(callback: (block: LitBlock) => boolean): boolean;
|
|
1392
|
-
connectedCallback(): void;
|
|
1393
|
-
initCallback(): void;
|
|
1394
|
-
get testId(): string;
|
|
1395
|
-
get modalManager(): ModalManager | null;
|
|
1396
|
-
get telemetryManager(): ITelemetryManager;
|
|
1397
|
-
get localeManager(): LocaleManager;
|
|
1398
|
-
get a11y(): A11y;
|
|
1399
|
-
get blocksRegistry(): Set<LitBlock>;
|
|
1400
|
-
get eventEmitter(): EventEmitter;
|
|
1401
|
-
disconnectedCallback(): void;
|
|
1402
|
-
/**
|
|
1403
|
-
* Called when the last block is removed from the context. Note that inheritors must run their callback before that.
|
|
1404
|
-
*/
|
|
1405
|
-
protected destroyCtxCallback(): void;
|
|
1406
|
-
/**
|
|
1407
|
-
* Adds a shared context instance if it does not exist yet.
|
|
1408
|
-
* @param key The shared state key.
|
|
1409
|
-
* @param resolver The resolver function that creates the instance.
|
|
1410
|
-
* @param persist Whether to persist the instance in the context if the creator block is removed. It's usually needed for those instances that depends on the current block. Defaults to false.
|
|
1411
|
-
*/
|
|
1412
|
-
protected addSharedContextInstance<TKey extends keyof SharedState>(key: TKey, resolver: () => SharedState[TKey], { persist }?: {
|
|
1413
|
-
persist?: boolean | undefined;
|
|
1414
|
-
}): void;
|
|
1415
|
-
private _destroySharedContextInstances;
|
|
1416
|
-
protected getSharedContextInstance<TKey extends keyof SharedState, TRequired extends boolean = true>(key: TKey, isRequired?: TRequired): TRequired extends true ? NonNullable<SharedState[TKey]> : SharedState[TKey];
|
|
1417
|
-
protected proxyUrl(url: string): Promise<string>;
|
|
1418
|
-
get cfg(): ConfigType;
|
|
1419
|
-
subConfigValue<T extends keyof ConfigType>(key: T, callback: (value: ConfigType[T]) => void): () => void;
|
|
1420
|
-
debugPrint(...args: unknown[]): void;
|
|
1421
|
-
}
|
|
1327
|
+
declare function defineComponents(blockExports: Record<string, any>): void;
|
|
1422
1328
|
|
|
1423
|
-
declare class
|
|
1329
|
+
declare class SolutionBlock extends Block {
|
|
1424
1330
|
static styleAttrs: string[];
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
render(): lit_html.TemplateResult<1>;
|
|
1442
|
-
}
|
|
1443
|
-
|
|
1444
|
-
declare const ModalEvents: Readonly<{
|
|
1445
|
-
readonly ADD: "modal:add";
|
|
1446
|
-
readonly DELETE: "modal:delete";
|
|
1447
|
-
readonly OPEN: "modal:open";
|
|
1448
|
-
readonly CLOSE: "modal:close";
|
|
1449
|
-
readonly CLOSE_ALL: "modal:closeAll";
|
|
1450
|
-
readonly DESTROY: "modal:destroy";
|
|
1451
|
-
}>;
|
|
1452
|
-
type ModalId = ActivityType;
|
|
1453
|
-
type ModalCb = (data: {
|
|
1454
|
-
id: ModalId;
|
|
1455
|
-
modal: Modal;
|
|
1456
|
-
}) => void;
|
|
1457
|
-
type ModalEventType = (typeof ModalEvents)[keyof typeof ModalEvents];
|
|
1458
|
-
declare class ModalManager {
|
|
1459
|
-
private _modals;
|
|
1460
|
-
private _activeModals;
|
|
1461
|
-
private _subscribers;
|
|
1462
|
-
private _block;
|
|
1463
|
-
constructor(block: LitBlock);
|
|
1464
|
-
private _debugPrint;
|
|
1465
|
-
/**
|
|
1466
|
-
* Register a modal with the manager
|
|
1467
|
-
* @param id Unique identifier for the modal
|
|
1468
|
-
* @param modal Modal component instance
|
|
1469
|
-
*/
|
|
1470
|
-
registerModal(id: ModalId, modal: Modal): void;
|
|
1471
|
-
/** Remove a modal by ID. */
|
|
1472
|
-
deleteModal(id: ModalId): boolean;
|
|
1473
|
-
/** Open a modal by its ID. */
|
|
1474
|
-
open(id: ModalId): boolean;
|
|
1475
|
-
/** Close a specific modal by ID. */
|
|
1476
|
-
close(id: ModalId): boolean;
|
|
1477
|
-
/** Toggle a modal - open if closed, close if open. */
|
|
1478
|
-
toggle(id: ModalId): boolean;
|
|
1479
|
-
/** True if there are any active modals. */
|
|
1480
|
-
get hasActiveModals(): boolean;
|
|
1481
|
-
/** Close the most recently opened modal and return to the previous one. */
|
|
1482
|
-
back(): boolean;
|
|
1483
|
-
/** Close all open modals. */
|
|
1484
|
-
closeAll(): number;
|
|
1485
|
-
/**
|
|
1486
|
-
* Subscribe to modal events
|
|
1487
|
-
* @returns Unsubscribe function
|
|
1488
|
-
*/
|
|
1489
|
-
subscribe(event: ModalEventType, callback: ModalCb): () => void;
|
|
1490
|
-
/** Unsubscribe from modal events */
|
|
1491
|
-
unsubscribe(event: ModalEventType, callback: ModalCb | undefined): void;
|
|
1492
|
-
/** Notify all subscribers of a modal event. */
|
|
1493
|
-
private _notify;
|
|
1494
|
-
/** Destroy the modal manager, clean up resources */
|
|
1495
|
-
destroy(): void;
|
|
1496
|
-
}
|
|
1497
|
-
|
|
1498
|
-
type KebabCase<T extends string> = T extends `${infer Head} ${infer Tail}` ? `${Lowercase<Head>}-${KebabCase<Tail>}` : Lowercase<T>;
|
|
1499
|
-
declare const toKebabCase: <T extends string>(str: T) => KebabCase<T>;
|
|
1500
|
-
|
|
1501
|
-
declare class Icon extends LitBlock {
|
|
1502
|
-
name: string;
|
|
1503
|
-
private _resolvedHref;
|
|
1504
|
-
private _iconHrefResolver;
|
|
1505
|
-
initCallback(): void;
|
|
1506
|
-
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
1507
|
-
private _updateResolvedHref;
|
|
1508
|
-
render(): lit_html.TemplateResult<1>;
|
|
1509
|
-
}
|
|
1510
|
-
|
|
1511
|
-
type CssPropValue = string | number | undefined | null;
|
|
1512
|
-
declare const ImgConfig_base: typeof LitElement & Constructor<LitElement> & {
|
|
1513
|
-
reg(tagName: string): void;
|
|
1514
|
-
} & Constructor<{
|
|
1515
|
-
getCssData(propName: string, silentCheck?: boolean): string | number | boolean | null | undefined;
|
|
1516
|
-
}>;
|
|
1517
|
-
declare class ImgConfig extends ImgConfig_base {
|
|
1518
|
-
private _state;
|
|
1519
|
-
private _subscribers;
|
|
1520
|
-
private _isnObserver;
|
|
1521
|
-
private _observed;
|
|
1522
|
-
createRenderRoot(): HTMLElement | ShadowRoot;
|
|
1523
|
-
constructor();
|
|
1524
|
-
protected $$(key: string): unknown;
|
|
1525
|
-
protected set$$(kvObj: Record<string, CssPropValue>): void;
|
|
1526
|
-
protected sub$$<T = unknown>(key: string, kbFn: (val: T) => void): void;
|
|
1527
|
-
private _notify;
|
|
1528
|
-
protected analyticsParams(): string;
|
|
1529
|
-
protected initAttributes(el: HTMLElement): void;
|
|
1530
|
-
protected initIntersection(el: HTMLElement, cbkFn: () => void): void;
|
|
1531
|
-
connectedCallback(): void;
|
|
1532
|
-
private _initCssProperties;
|
|
1533
|
-
disconnectedCallback(): void;
|
|
1534
|
-
static get observedAttributes(): string[];
|
|
1535
|
-
attributeChangedCallback(name: string, _oldVal: string | null, newVal: string | null): void;
|
|
1536
|
-
}
|
|
1537
|
-
|
|
1538
|
-
declare class ImgBase extends ImgConfig {
|
|
1539
|
-
private _img;
|
|
1540
|
-
private _imgPreview;
|
|
1541
|
-
private _fmtAbs;
|
|
1542
|
-
private _validateSize;
|
|
1543
|
-
private _getCdnModifiers;
|
|
1544
|
-
private _getTypedCssValue;
|
|
1545
|
-
private _getUrlBase;
|
|
1546
|
-
private _proxyUrl;
|
|
1547
|
-
protected _getElSize(el: HTMLElement, k?: number, wOnly?: boolean): string | null;
|
|
1548
|
-
private _setupEventProxy;
|
|
1549
|
-
protected get img(): HTMLImageElement;
|
|
1550
|
-
private get _currentImg();
|
|
1551
|
-
private get _hasPreviewImage();
|
|
1552
|
-
private get _bgSelector();
|
|
1553
|
-
private get _breakpoints();
|
|
1554
|
-
private get _hasFormatJPG();
|
|
1555
|
-
private _renderBg;
|
|
1556
|
-
private _getSrcset;
|
|
1557
|
-
private _getSrc;
|
|
1558
|
-
private get _srcUrlPreview();
|
|
1559
|
-
private _renderBackground;
|
|
1560
|
-
private _appendURL;
|
|
1561
|
-
private _setupConfigForImage;
|
|
1562
|
-
private _loaderImage;
|
|
1563
|
-
private _renderImage;
|
|
1564
|
-
protected init(): void;
|
|
1565
|
-
}
|
|
1566
|
-
|
|
1567
|
-
declare class Img extends ImgBase {
|
|
1568
|
-
attributesMeta: {
|
|
1569
|
-
src: string;
|
|
1570
|
-
} | {
|
|
1571
|
-
uuid: string;
|
|
1572
|
-
};
|
|
1573
|
-
connectedCallback(): void;
|
|
1574
|
-
}
|
|
1575
|
-
|
|
1576
|
-
declare class FormInput extends LitUploaderBlock {
|
|
1577
|
-
propertiesMeta: {
|
|
1578
|
-
'ctx-name': string;
|
|
1331
|
+
protected requireCtxName: boolean;
|
|
1332
|
+
init$: {
|
|
1333
|
+
'*solution': string | null;
|
|
1334
|
+
'*commonProgress': number;
|
|
1335
|
+
'*uploadList': never[];
|
|
1336
|
+
'*uploadQueue': _uploadcare_upload_client.Queue;
|
|
1337
|
+
'*collectionErrors': OutputErrorCollection[];
|
|
1338
|
+
'*collectionState': OutputCollectionState | null;
|
|
1339
|
+
'*groupInfo': _uploadcare_upload_client.UploadcareGroup | null;
|
|
1340
|
+
'*uploadTrigger': Set<string>;
|
|
1341
|
+
'*secureUploadsManager': SecureUploadsManager | null;
|
|
1342
|
+
'*currentActivity': null;
|
|
1343
|
+
'*currentActivityParams': {};
|
|
1344
|
+
'*history': never[];
|
|
1345
|
+
'*historyBack': null;
|
|
1346
|
+
'*closeModal': () => void;
|
|
1579
1347
|
};
|
|
1580
|
-
private
|
|
1581
|
-
private _dynamicInputsContainer;
|
|
1582
|
-
private _createValidationInput;
|
|
1348
|
+
private static _template;
|
|
1583
1349
|
initCallback(): void;
|
|
1350
|
+
static set template(value: string);
|
|
1351
|
+
static get template(): string;
|
|
1584
1352
|
}
|
|
1585
1353
|
|
|
1586
|
-
declare class
|
|
1587
|
-
initCallback(): void;
|
|
1588
|
-
render(): lit_html.TemplateResult<1>;
|
|
1589
|
-
}
|
|
1590
|
-
|
|
1591
|
-
declare class ProgressBar extends LitBlock {
|
|
1592
|
-
value: number;
|
|
1593
|
-
visible: boolean;
|
|
1594
|
-
private _progressValue;
|
|
1595
|
-
private readonly _fakeProgressLineRef;
|
|
1596
|
-
private readonly _handleFakeProgressAnimation;
|
|
1597
|
-
protected firstUpdated(changedProperties: PropertyValues<this>): void;
|
|
1598
|
-
protected updated(changedProperties: PropertyValues<this>): void;
|
|
1599
|
-
disconnectedCallback(): void;
|
|
1600
|
-
private _normalizeProgressValue;
|
|
1601
|
-
private _updateProgressValueStyle;
|
|
1602
|
-
render(): lit_html.TemplateResult<1>;
|
|
1354
|
+
declare class ActivityHeader extends ActivityBlock {
|
|
1603
1355
|
}
|
|
1604
1356
|
|
|
1605
|
-
declare class
|
|
1606
|
-
private _unobserveCollectionCb?;
|
|
1607
|
-
private _visible;
|
|
1608
|
-
private _value;
|
|
1609
|
-
constructor();
|
|
1610
|
-
initCallback(): void;
|
|
1611
|
-
protected updated(changedProperties: PropertyValues<this>): void;
|
|
1612
|
-
disconnectedCallback(): void;
|
|
1613
|
-
render(): lit_html.TemplateResult<1>;
|
|
1614
|
-
}
|
|
1615
|
-
|
|
1616
|
-
type SelectOption = {
|
|
1617
|
-
text: string;
|
|
1618
|
-
value: string;
|
|
1619
|
-
};
|
|
1620
|
-
declare class Select extends LitBlock {
|
|
1621
|
-
value: string;
|
|
1622
|
-
disabled: boolean;
|
|
1623
|
-
options: SelectOption[];
|
|
1624
|
-
render(): lit_html.TemplateResult<1>;
|
|
1625
|
-
private _handleChange;
|
|
1626
|
-
}
|
|
1627
|
-
|
|
1628
|
-
declare class SourceBtn extends LitUploaderBlock {
|
|
1629
|
-
couldBeCtxOwner: boolean;
|
|
1630
|
-
private _registeredTypes;
|
|
1631
|
-
type?: string;
|
|
1632
|
-
private _iconName;
|
|
1633
|
-
private _srcTypeKey;
|
|
1634
|
-
private _initTypes;
|
|
1635
|
-
initCallback(): void;
|
|
1636
|
-
private _registerType;
|
|
1637
|
-
activate(): void;
|
|
1638
|
-
private _applyType;
|
|
1639
|
-
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
1640
|
-
render(): lit_html.TemplateResult<1>;
|
|
1641
|
-
}
|
|
1642
|
-
|
|
1643
|
-
declare class SourceList extends LitBlock {
|
|
1644
|
-
private _rawSourceList;
|
|
1645
|
-
private _cameraModes;
|
|
1646
|
-
initCallback(): void;
|
|
1647
|
-
protected updated(changedProperties: PropertyValues<this>): void;
|
|
1648
|
-
private _updateSources;
|
|
1649
|
-
private _sources;
|
|
1650
|
-
render(): lit_html.TemplateResult<1>;
|
|
1651
|
-
}
|
|
1652
|
-
|
|
1653
|
-
declare class Spinner extends LitBlock {
|
|
1654
|
-
render(): lit_html.TemplateResult<1>;
|
|
1655
|
-
}
|
|
1656
|
-
|
|
1657
|
-
declare class FileItemConfig extends LitUploaderBlock {
|
|
1658
|
-
private _entrySubs;
|
|
1659
|
-
protected entry: UploadEntryTypedData | null;
|
|
1660
|
-
protected withEntry<A extends unknown[], R>(fn: (entry: UploadEntryTypedData, ...args: A) => R): (...args: A) => R | undefined;
|
|
1661
|
-
protected subEntry<K extends UploadEntryKeys>(prop: K, handler: (value: UploadEntryData[K]) => void): void;
|
|
1662
|
-
protected reset(): void;
|
|
1663
|
-
disconnectedCallback(): void;
|
|
1664
|
-
}
|
|
1665
|
-
|
|
1666
|
-
declare class Thumb extends FileItemConfig {
|
|
1667
|
-
badgeIcon: string;
|
|
1668
|
-
uid: Uid;
|
|
1669
|
-
private _thumbUrl;
|
|
1670
|
-
private _renderedGridOnce;
|
|
1671
|
-
private _thumbRect;
|
|
1672
|
-
private _isIntersecting;
|
|
1673
|
-
private _firstViewMode;
|
|
1674
|
-
private _observer?;
|
|
1675
|
-
private _pendingThumbUpdate?;
|
|
1676
|
-
private _calculateThumbSize;
|
|
1677
|
-
private _generateThumbnail;
|
|
1678
|
-
private _debouncedGenerateThumb;
|
|
1679
|
-
private _decodeImage;
|
|
1680
|
-
private _cancelPendingThumbUpdate;
|
|
1681
|
-
private _scheduleThumbUpdate;
|
|
1682
|
-
private _requestThumbGeneration;
|
|
1683
|
-
protected firstUpdated(changedProperties: PropertyValues<this>): void;
|
|
1684
|
-
protected updated(changedProperties: PropertyValues<this>): void;
|
|
1685
|
-
private _observerCallback;
|
|
1686
|
-
protected reset(): void;
|
|
1687
|
-
private _bindToEntry;
|
|
1688
|
-
initCallback(): void;
|
|
1689
|
-
connectedCallback(): void;
|
|
1690
|
-
disconnectedCallback(): void;
|
|
1691
|
-
render(): lit_html.TemplateResult<1>;
|
|
1692
|
-
}
|
|
1693
|
-
|
|
1694
|
-
declare class ActivityHeader extends LitActivityBlock {
|
|
1695
|
-
}
|
|
1696
|
-
|
|
1697
|
-
declare class StartFrom extends LitActivityBlock {
|
|
1698
|
-
protected historyTracked: boolean;
|
|
1699
|
-
activityType: ActivityType;
|
|
1700
|
-
initCallback(): void;
|
|
1701
|
-
render(): lit_html.TemplateResult<1>;
|
|
1702
|
-
}
|
|
1703
|
-
|
|
1704
|
-
type EventListenerMap = {
|
|
1705
|
-
[K in (typeof EventType)[keyof typeof EventType]]: (e: CustomEvent<EventPayload[K]>) => void;
|
|
1706
|
-
};
|
|
1707
|
-
declare class UploadCtxProvider extends LitUploaderBlock {
|
|
1708
|
-
propertiesMeta: {
|
|
1709
|
-
'ctx-name': string;
|
|
1710
|
-
};
|
|
1711
|
-
static styleAttrs: string[];
|
|
1712
|
-
static EventType: Readonly<{
|
|
1713
|
-
readonly FILE_ADDED: "file-added";
|
|
1714
|
-
readonly FILE_REMOVED: "file-removed";
|
|
1715
|
-
readonly FILE_UPLOAD_START: "file-upload-start";
|
|
1716
|
-
readonly FILE_UPLOAD_PROGRESS: "file-upload-progress";
|
|
1717
|
-
readonly FILE_UPLOAD_SUCCESS: "file-upload-success";
|
|
1718
|
-
readonly FILE_UPLOAD_FAILED: "file-upload-failed";
|
|
1719
|
-
readonly FILE_URL_CHANGED: "file-url-changed";
|
|
1720
|
-
readonly MODAL_OPEN: "modal-open";
|
|
1721
|
-
readonly MODAL_CLOSE: "modal-close";
|
|
1722
|
-
readonly DONE_CLICK: "done-click";
|
|
1723
|
-
readonly UPLOAD_CLICK: "upload-click";
|
|
1724
|
-
readonly ACTIVITY_CHANGE: "activity-change";
|
|
1725
|
-
readonly COMMON_UPLOAD_START: "common-upload-start";
|
|
1726
|
-
readonly COMMON_UPLOAD_PROGRESS: "common-upload-progress";
|
|
1727
|
-
readonly COMMON_UPLOAD_SUCCESS: "common-upload-success";
|
|
1728
|
-
readonly COMMON_UPLOAD_FAILED: "common-upload-failed";
|
|
1729
|
-
readonly CHANGE: "change";
|
|
1730
|
-
readonly GROUP_CREATED: "group-created";
|
|
1731
|
-
}>;
|
|
1732
|
-
private _unbindEventEmitter;
|
|
1733
|
-
initCallback(): void;
|
|
1734
|
-
disconnectedCallback(): void;
|
|
1735
|
-
}
|
|
1736
|
-
interface UploadCtxProvider extends LitUploaderBlock {
|
|
1737
|
-
addEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | AddEventListenerOptions): void;
|
|
1738
|
-
removeEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | EventListenerOptions): void;
|
|
1739
|
-
}
|
|
1740
|
-
|
|
1741
|
-
declare class UrlSource extends LitUploaderBlock {
|
|
1742
|
-
couldBeCtxOwner: boolean;
|
|
1743
|
-
activityType: ActivityType;
|
|
1744
|
-
private _formState;
|
|
1745
|
-
initCallback(): void;
|
|
1746
|
-
private _inputRef;
|
|
1747
|
-
private _handleInput;
|
|
1748
|
-
private _handleUpload;
|
|
1749
|
-
render(): lit_html.TemplateResult<1>;
|
|
1750
|
-
}
|
|
1751
|
-
|
|
1752
|
-
declare function initState(fnCtx: CloudImageEditorBlock): {
|
|
1753
|
-
'*originalUrl': null;
|
|
1754
|
-
'*loadingOperations': LoadingOperations;
|
|
1755
|
-
'*faderEl': null;
|
|
1756
|
-
'*cropperEl': null;
|
|
1757
|
-
'*imgEl': null;
|
|
1758
|
-
'*imgContainerEl': null;
|
|
1759
|
-
'*networkProblems': boolean;
|
|
1760
|
-
'*imageSize': null;
|
|
1761
|
-
'*editorTransformations': {};
|
|
1762
|
-
'*cropPresetList': never[];
|
|
1763
|
-
'*currentAspectRatio': null;
|
|
1764
|
-
'*tabList': readonly ["crop", "tuning", "filters"];
|
|
1765
|
-
'*tabId': "crop";
|
|
1766
|
-
'*on.retryNetwork': () => void;
|
|
1767
|
-
'*on.apply': (transformations: Transformations) => void;
|
|
1768
|
-
'*on.cancel': () => void;
|
|
1769
|
-
};
|
|
1770
|
-
|
|
1771
|
-
declare class CloudImageEditorBlock extends LitBlock {
|
|
1772
|
-
attributesMeta: ({
|
|
1773
|
-
uuid: string;
|
|
1774
|
-
} | {
|
|
1775
|
-
'cdn-url': string;
|
|
1776
|
-
}) & Partial<{
|
|
1777
|
-
tabs: string;
|
|
1778
|
-
'crop-preset': string;
|
|
1779
|
-
}> & {
|
|
1780
|
-
'ctx-name': string;
|
|
1781
|
-
};
|
|
1357
|
+
declare class CloudImageEditorBlock extends Block {
|
|
1782
1358
|
ctxOwner: boolean;
|
|
1783
1359
|
static styleAttrs: string[];
|
|
1784
|
-
private
|
|
1785
|
-
|
|
1786
|
-
private _fileType;
|
|
1360
|
+
private _debouncedShowLoader;
|
|
1361
|
+
constructor();
|
|
1787
1362
|
private _showLoader;
|
|
1788
|
-
uuid: string | null;
|
|
1789
|
-
cdnUrl: string | null;
|
|
1790
|
-
cropPreset: string;
|
|
1791
|
-
tabs: string | null;
|
|
1792
|
-
private _hasNetworkProblems;
|
|
1793
|
-
private _isInitialized;
|
|
1794
|
-
private _pendingInitUpdate;
|
|
1795
|
-
private readonly _debouncedShowLoader;
|
|
1796
|
-
private readonly _imgRef;
|
|
1797
|
-
private readonly _cropperRef;
|
|
1798
|
-
private readonly _faderRef;
|
|
1799
|
-
private readonly _imgContainerRef;
|
|
1800
|
-
private readonly _handleImageLoad;
|
|
1801
|
-
private readonly _handleImageError;
|
|
1802
|
-
private readonly _handleRetryNetwork;
|
|
1803
|
-
private _scheduleInitialization;
|
|
1804
|
-
init$: ReturnType<typeof initState>;
|
|
1805
|
-
initCallback(): void;
|
|
1806
|
-
private _assignSharedElements;
|
|
1807
|
-
private _attachImageListeners;
|
|
1808
|
-
private _detachImageListeners;
|
|
1809
|
-
private get _imageClassName();
|
|
1810
1363
|
/**
|
|
1811
1364
|
* To proper work, we need non-zero size the element. So, we'll wait for it.
|
|
1812
1365
|
*/
|
|
1813
1366
|
private _waitForSize;
|
|
1814
|
-
|
|
1815
|
-
disconnectedCallback(): void;
|
|
1816
|
-
render(): lit_html.TemplateResult<1>;
|
|
1817
|
-
protected updated(changedProperties: PropertyValues<this>): void;
|
|
1818
|
-
private _syncTabListFromProp;
|
|
1819
|
-
private _syncCropPresetState;
|
|
1367
|
+
initCallback(): void;
|
|
1820
1368
|
updateImage(): Promise<void>;
|
|
1821
1369
|
initEditor(): Promise<void>;
|
|
1822
1370
|
}
|
|
1823
1371
|
|
|
1824
|
-
declare class CropFrame extends
|
|
1372
|
+
declare class CropFrame extends Block {
|
|
1373
|
+
private readonly _handlePointerUp;
|
|
1374
|
+
private readonly _handlePointerMove;
|
|
1375
|
+
private readonly _handleSvgPointerMove;
|
|
1376
|
+
private readonly _backdropMaskId;
|
|
1825
1377
|
private _backdropMask?;
|
|
1826
1378
|
private _backdropMaskInner?;
|
|
1827
|
-
private readonly _backdropMaskId;
|
|
1828
1379
|
private _frameThumbs?;
|
|
1829
1380
|
private _frameGuides?;
|
|
1830
1381
|
private _draggingThumb?;
|
|
@@ -1833,14 +1384,7 @@ declare class CropFrame extends LitBlock {
|
|
|
1833
1384
|
private _dragStartCrop?;
|
|
1834
1385
|
private _frameImage?;
|
|
1835
1386
|
private _guidesHidden;
|
|
1836
|
-
|
|
1837
|
-
private readonly _svgRef;
|
|
1838
|
-
private _svgReady;
|
|
1839
|
-
private _pendingMaskHref;
|
|
1840
|
-
private get _svgElement();
|
|
1841
|
-
private get _dragging();
|
|
1842
|
-
private set _dragging(value);
|
|
1843
|
-
private _applyGuidesDragState;
|
|
1387
|
+
constructor();
|
|
1844
1388
|
private _shouldThumbBeDisabled;
|
|
1845
1389
|
private _createBackdrop;
|
|
1846
1390
|
/**
|
|
@@ -1855,56 +1399,103 @@ declare class CropFrame extends LitBlock {
|
|
|
1855
1399
|
private _createGuides;
|
|
1856
1400
|
private _createFrame;
|
|
1857
1401
|
private _handlePointerDown;
|
|
1858
|
-
private
|
|
1859
|
-
private
|
|
1402
|
+
private _handlePointerUp_;
|
|
1403
|
+
private _handlePointerMove_;
|
|
1860
1404
|
private _calcCropBox;
|
|
1861
|
-
private
|
|
1405
|
+
private _handleSvgPointerMove_;
|
|
1862
1406
|
private _updateCursor;
|
|
1863
1407
|
private _createMask;
|
|
1864
1408
|
private _updateMask;
|
|
1865
1409
|
private _render;
|
|
1866
1410
|
toggleThumbs(visible: boolean): void;
|
|
1867
1411
|
initCallback(): void;
|
|
1868
|
-
|
|
1869
|
-
private _initializeSvg;
|
|
1870
|
-
disconnectedCallback(): void;
|
|
1871
|
-
render(): TemplateResult;
|
|
1412
|
+
destroyCallback(): void;
|
|
1872
1413
|
}
|
|
1873
1414
|
|
|
1874
|
-
declare class EditorButtonControl extends
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
protected titleProp: string;
|
|
1879
|
-
protected get buttonClasses(): Record<string, boolean>;
|
|
1880
|
-
private _updateHostStateClasses;
|
|
1881
|
-
protected onClick(_event: MouseEvent): void;
|
|
1882
|
-
connectedCallback(): void;
|
|
1883
|
-
protected updated(changedProperties: PropertyValues<this>): void;
|
|
1884
|
-
render(): lit_html.TemplateResult<1>;
|
|
1415
|
+
declare class EditorButtonControl extends Block {
|
|
1416
|
+
private _titleEl?;
|
|
1417
|
+
constructor();
|
|
1418
|
+
initCallback(): void;
|
|
1885
1419
|
}
|
|
1886
1420
|
|
|
1887
1421
|
declare class EditorFreeformButtonControl extends EditorButtonControl {
|
|
1888
1422
|
initCallback(): void;
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1423
|
+
handleClick(): void;
|
|
1424
|
+
}
|
|
1425
|
+
interface EditorAspectRatioButtonControl {
|
|
1426
|
+
get aspectRatio(): CropAspectRatio | undefined;
|
|
1427
|
+
set aspectRatio(value: CropAspectRatio | undefined);
|
|
1892
1428
|
}
|
|
1893
1429
|
declare class EditorAspectRatioButtonControl extends EditorButtonControl {
|
|
1894
|
-
|
|
1895
|
-
get aspectRatio(): CropAspectRatio | null;
|
|
1896
|
-
set aspectRatio(value: CropAspectRatio | null);
|
|
1430
|
+
constructor();
|
|
1897
1431
|
initCallback(): void;
|
|
1898
|
-
|
|
1899
|
-
private
|
|
1900
|
-
private
|
|
1901
|
-
render(): lit_html.TemplateResult<1>;
|
|
1432
|
+
handleClick(): void;
|
|
1433
|
+
private _renderRectBasedOnAspectRatio;
|
|
1434
|
+
private _aspectRatio?;
|
|
1902
1435
|
}
|
|
1903
1436
|
|
|
1437
|
+
declare const ALL_COLOR_OPERATIONS: readonly ["brightness", "exposure", "gamma", "contrast", "saturation", "vibrance", "warmth", "enhance"];
|
|
1438
|
+
type ColorOperation = (typeof ALL_COLOR_OPERATIONS)[number];
|
|
1439
|
+
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"];
|
|
1440
|
+
type FilterId = (typeof ALL_FILTERS)[number];
|
|
1441
|
+
declare const ALL_CROP_OPERATIONS: readonly ["rotate", "mirror", "flip"];
|
|
1442
|
+
type CropOperation = (typeof ALL_CROP_OPERATIONS)[number];
|
|
1443
|
+
/** KeypointsNumber is the number of keypoints loaded from each side of zero, not total number */
|
|
1444
|
+
declare const COLOR_OPERATIONS_CONFIG: Readonly<{
|
|
1445
|
+
brightness: {
|
|
1446
|
+
zero: number;
|
|
1447
|
+
range: readonly [-100, 100];
|
|
1448
|
+
keypointsNumber: number;
|
|
1449
|
+
};
|
|
1450
|
+
exposure: {
|
|
1451
|
+
zero: number;
|
|
1452
|
+
range: readonly [-500, 500];
|
|
1453
|
+
keypointsNumber: number;
|
|
1454
|
+
};
|
|
1455
|
+
gamma: {
|
|
1456
|
+
zero: number;
|
|
1457
|
+
range: readonly [0, 1000];
|
|
1458
|
+
keypointsNumber: number;
|
|
1459
|
+
};
|
|
1460
|
+
contrast: {
|
|
1461
|
+
zero: number;
|
|
1462
|
+
range: readonly [-100, 500];
|
|
1463
|
+
keypointsNumber: number;
|
|
1464
|
+
};
|
|
1465
|
+
saturation: {
|
|
1466
|
+
zero: number;
|
|
1467
|
+
range: readonly [-100, 500];
|
|
1468
|
+
keypointsNumber: number;
|
|
1469
|
+
};
|
|
1470
|
+
vibrance: {
|
|
1471
|
+
zero: number;
|
|
1472
|
+
range: readonly [-100, 500];
|
|
1473
|
+
keypointsNumber: number;
|
|
1474
|
+
};
|
|
1475
|
+
warmth: {
|
|
1476
|
+
zero: number;
|
|
1477
|
+
range: readonly [-100, 100];
|
|
1478
|
+
keypointsNumber: number;
|
|
1479
|
+
};
|
|
1480
|
+
enhance: {
|
|
1481
|
+
zero: number;
|
|
1482
|
+
range: readonly [0, 100];
|
|
1483
|
+
keypointsNumber: number;
|
|
1484
|
+
};
|
|
1485
|
+
filter: {
|
|
1486
|
+
zero: number;
|
|
1487
|
+
range: readonly [0, 100];
|
|
1488
|
+
keypointsNumber: number;
|
|
1489
|
+
};
|
|
1490
|
+
}>;
|
|
1491
|
+
|
|
1492
|
+
interface EditorCropButtonControl {
|
|
1493
|
+
get operation(): CropOperation | undefined;
|
|
1494
|
+
set operation(value: CropOperation | undefined);
|
|
1495
|
+
}
|
|
1904
1496
|
declare class EditorCropButtonControl extends EditorButtonControl {
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
protected onClick(e: MouseEvent): void;
|
|
1497
|
+
private _operation;
|
|
1498
|
+
initCallback(): void;
|
|
1908
1499
|
}
|
|
1909
1500
|
|
|
1910
1501
|
declare class EditorFilterControl extends EditorButtonControl {
|
|
@@ -1913,27 +1504,11 @@ declare class EditorFilterControl extends EditorButtonControl {
|
|
|
1913
1504
|
private _originalUrl;
|
|
1914
1505
|
private _observer?;
|
|
1915
1506
|
private _cancelPreload?;
|
|
1916
|
-
|
|
1917
|
-
private _previewVisibilityCheckRaf?;
|
|
1918
|
-
private _previewVisibilityCheckTimeout?;
|
|
1919
|
-
private _previewImage;
|
|
1920
|
-
private _previewLoaded;
|
|
1921
|
-
isOriginal: boolean;
|
|
1922
|
-
private _iconSize;
|
|
1923
|
-
get filter(): string;
|
|
1924
|
-
set filter(value: string);
|
|
1925
|
-
onClick(e: MouseEvent): void;
|
|
1507
|
+
constructor();
|
|
1926
1508
|
private _previewSrc;
|
|
1927
1509
|
private _observerCallback;
|
|
1928
1510
|
initCallback(): void;
|
|
1929
|
-
|
|
1930
|
-
protected updated(changedProperties: PropertyValues<this>): void;
|
|
1931
|
-
private _updateFilterLabels;
|
|
1932
|
-
private _loadPreview;
|
|
1933
|
-
private _schedulePreviewVisibilityCheck;
|
|
1934
|
-
private _clearPreviewVisibilityChecks;
|
|
1935
|
-
private get _shouldShowPreview();
|
|
1936
|
-
render(): lit_html.TemplateResult<1>;
|
|
1511
|
+
destroyCallback(): void;
|
|
1937
1512
|
}
|
|
1938
1513
|
|
|
1939
1514
|
type Operations = {
|
|
@@ -1941,7 +1516,7 @@ type Operations = {
|
|
|
1941
1516
|
mirror: boolean;
|
|
1942
1517
|
rotate: number;
|
|
1943
1518
|
};
|
|
1944
|
-
declare class EditorImageCropper extends
|
|
1519
|
+
declare class EditorImageCropper extends Block {
|
|
1945
1520
|
ctxOwner: boolean;
|
|
1946
1521
|
private _commitDebounced;
|
|
1947
1522
|
private _handleResizeThrottled;
|
|
@@ -1950,12 +1525,9 @@ declare class EditorImageCropper extends LitBlock {
|
|
|
1950
1525
|
private _ctx;
|
|
1951
1526
|
private _isActive;
|
|
1952
1527
|
private _observer?;
|
|
1953
|
-
private _image;
|
|
1954
1528
|
private _cancelPreload?;
|
|
1955
|
-
private readonly _canvasRef;
|
|
1956
|
-
private readonly _frameRef;
|
|
1957
1529
|
constructor();
|
|
1958
|
-
|
|
1530
|
+
private _handleResize;
|
|
1959
1531
|
private _syncTransformations;
|
|
1960
1532
|
private _initCanvas;
|
|
1961
1533
|
private _alignImage;
|
|
@@ -1980,12 +1552,11 @@ declare class EditorImageCropper extends LitBlock {
|
|
|
1980
1552
|
private _waitForImage;
|
|
1981
1553
|
private _handleImageLoading;
|
|
1982
1554
|
initCallback(): void;
|
|
1983
|
-
|
|
1984
|
-
render(): TemplateResult;
|
|
1555
|
+
destroyCallback(): void;
|
|
1985
1556
|
}
|
|
1986
1557
|
|
|
1987
1558
|
type OperationKey = keyof typeof COLOR_OPERATIONS_CONFIG;
|
|
1988
|
-
declare class EditorImageFader extends
|
|
1559
|
+
declare class EditorImageFader extends Block {
|
|
1989
1560
|
private _isActive;
|
|
1990
1561
|
private _hidden;
|
|
1991
1562
|
private _operation;
|
|
@@ -1993,6 +1564,7 @@ declare class EditorImageFader extends LitBlock {
|
|
|
1993
1564
|
private _value?;
|
|
1994
1565
|
private _transformations;
|
|
1995
1566
|
private _keypoints;
|
|
1567
|
+
private _container?;
|
|
1996
1568
|
private _previewImage?;
|
|
1997
1569
|
private _cancelLastImages?;
|
|
1998
1570
|
private _cancelBatchPreload?;
|
|
@@ -2000,8 +1572,6 @@ declare class EditorImageFader extends LitBlock {
|
|
|
2000
1572
|
private _fromViewer?;
|
|
2001
1573
|
private _raf;
|
|
2002
1574
|
private _addKeypointDebounced;
|
|
2003
|
-
private readonly _previewHostRef;
|
|
2004
|
-
private readonly _layersHostRef;
|
|
2005
1575
|
constructor();
|
|
2006
1576
|
private _handleImageLoading;
|
|
2007
1577
|
private _flush;
|
|
@@ -2011,6 +1581,7 @@ declare class EditorImageFader extends LitBlock {
|
|
|
2011
1581
|
* Check if current operation and filter equals passed ones
|
|
2012
1582
|
*/
|
|
2013
1583
|
private _isSame;
|
|
1584
|
+
private _addKeypoint;
|
|
2014
1585
|
set(value: string | number): void;
|
|
2015
1586
|
private _update;
|
|
2016
1587
|
private _createPreviewImage;
|
|
@@ -2033,309 +1604,403 @@ declare class EditorImageFader extends LitBlock {
|
|
|
2033
1604
|
deactivate({ hide }?: {
|
|
2034
1605
|
hide?: boolean;
|
|
2035
1606
|
}): void;
|
|
2036
|
-
private _ensurePreviewAttached;
|
|
2037
|
-
private _clearLayersHost;
|
|
2038
|
-
render(): TemplateResult;
|
|
2039
1607
|
}
|
|
2040
1608
|
|
|
2041
1609
|
declare class EditorOperationControl extends EditorButtonControl {
|
|
2042
1610
|
private _operation;
|
|
2043
|
-
get operation(): ColorOperation | '';
|
|
2044
|
-
set operation(value: ColorOperation | '');
|
|
2045
|
-
private _updateOperationMetadata;
|
|
2046
1611
|
initCallback(): void;
|
|
2047
|
-
protected onClick(e: MouseEvent): void;
|
|
2048
1612
|
}
|
|
2049
1613
|
|
|
2050
|
-
declare class EditorScroller extends
|
|
2051
|
-
|
|
2052
|
-
connectedCallback(): void;
|
|
2053
|
-
disconnectedCallback(): void;
|
|
1614
|
+
declare class EditorScroller extends Block {
|
|
1615
|
+
initCallback(): void;
|
|
2054
1616
|
}
|
|
2055
1617
|
|
|
2056
1618
|
type SliderOperation = ColorOperation | 'filter';
|
|
2057
1619
|
type SliderFilter = FilterId | typeof FAKE_ORIGINAL_FILTER;
|
|
2058
1620
|
declare const FAKE_ORIGINAL_FILTER = "original";
|
|
2059
|
-
declare class EditorSlider extends
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
disabled: boolean;
|
|
2065
|
-
min: number;
|
|
2066
|
-
max: number;
|
|
2067
|
-
value: number;
|
|
2068
|
-
defaultValue: number;
|
|
2069
|
-
zero: number;
|
|
2070
|
-
};
|
|
2071
|
-
private _handleInput;
|
|
1621
|
+
declare class EditorSlider extends Block {
|
|
1622
|
+
private _operation;
|
|
1623
|
+
private _filter?;
|
|
1624
|
+
private _originalUrl;
|
|
1625
|
+
constructor();
|
|
2072
1626
|
setOperation(operation: SliderOperation, filter?: SliderFilter): void;
|
|
2073
1627
|
private _initializeValues;
|
|
2074
1628
|
apply(): void;
|
|
2075
1629
|
cancel(): void;
|
|
2076
1630
|
initCallback(): void;
|
|
2077
|
-
protected updated(changedProperties: PropertyValues<this>): void;
|
|
2078
|
-
render(): lit_html.TemplateResult<1>;
|
|
2079
1631
|
}
|
|
2080
1632
|
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
private _showLoader;
|
|
2084
|
-
showMainToolbar: boolean;
|
|
2085
|
-
showSubToolbar: boolean;
|
|
2086
|
-
private _showTabToggles;
|
|
2087
|
-
tabList: readonly TabIdValue[];
|
|
2088
|
-
activeTab: TabIdValue;
|
|
2089
|
-
private _useSliderPanel;
|
|
2090
|
-
private _tooltipVisible;
|
|
2091
|
-
private _operationTooltip;
|
|
2092
|
-
private _tabIndicatorOffset;
|
|
2093
|
-
private _tabIndicatorWidth;
|
|
2094
|
-
private readonly _sliderRef;
|
|
2095
|
-
private readonly _tabIndicatorRef;
|
|
2096
|
-
protected readonly tabToggleRefs: Record<TabIdValue, Ref<HTMLElement>>;
|
|
2097
|
-
private readonly _handleWindowResize;
|
|
2098
|
-
private _cropPresets;
|
|
1633
|
+
declare class EditorToolbar extends Block {
|
|
1634
|
+
private _debouncedShowLoader;
|
|
2099
1635
|
private _cancelPreload?;
|
|
2100
|
-
private
|
|
2101
|
-
|
|
2102
|
-
private readonly _subTopToolbarStyles;
|
|
2103
|
-
private readonly _subBottomToolbarStyles;
|
|
2104
|
-
private readonly _tabContentStyles;
|
|
2105
|
-
private readonly _tabToggleStyles;
|
|
2106
|
-
private readonly _tabTogglesStyles;
|
|
2107
|
-
init$: Record<string, unknown>;
|
|
1636
|
+
private _updateInfoTooltip;
|
|
1637
|
+
constructor();
|
|
2108
1638
|
private _onSliderClose;
|
|
1639
|
+
private _createOperationControl;
|
|
1640
|
+
private _createFilterControl;
|
|
1641
|
+
private _createToggleControl;
|
|
1642
|
+
private _createAspectRatioControl;
|
|
1643
|
+
private _createFreeformControl;
|
|
1644
|
+
private _clearListAspectRatio;
|
|
1645
|
+
private _renderControlsList;
|
|
2109
1646
|
private _activateTab;
|
|
2110
|
-
private
|
|
1647
|
+
private _unmountTabControls;
|
|
2111
1648
|
private _syncTabIndicator;
|
|
2112
|
-
private get _hasAspectRatioPicker();
|
|
2113
|
-
private _renderControlsByTab;
|
|
2114
|
-
private _renderCropTabControls;
|
|
2115
|
-
private _renderFilterTabControls;
|
|
2116
|
-
private _renderTuningTabControls;
|
|
2117
|
-
private _renderControlGroup;
|
|
2118
|
-
private _renderFreeformControl;
|
|
2119
|
-
private _renderAspectRatioControl;
|
|
2120
|
-
private _renderCropOperationControl;
|
|
2121
|
-
private _renderFilterControl;
|
|
2122
|
-
private _renderOperationControl;
|
|
2123
|
-
private _renderAspectRatioList;
|
|
2124
1649
|
private _preloadEditedImage;
|
|
1650
|
+
private _showLoader;
|
|
1651
|
+
private _updateInfoTooltipHandler;
|
|
2125
1652
|
initCallback(): void;
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
private
|
|
2131
|
-
private
|
|
2132
|
-
private
|
|
2133
|
-
|
|
2134
|
-
private
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
type Theme = string | null;
|
|
2142
|
-
declare class BtnUi extends LitBlock {
|
|
2143
|
-
text: string;
|
|
2144
|
-
icon: string;
|
|
2145
|
-
reverse: boolean;
|
|
2146
|
-
theme: Theme;
|
|
2147
|
-
ariaRole: string;
|
|
2148
|
-
ariaControls: string;
|
|
2149
|
-
titleProp: string;
|
|
2150
|
-
protected firstUpdated(changed: PropertyValues<this>): void;
|
|
2151
|
-
protected updated(changed: PropertyValues<this>): void;
|
|
2152
|
-
private _applyReverse;
|
|
2153
|
-
private _applyThemeClass;
|
|
2154
|
-
private get _iconClassMap();
|
|
2155
|
-
private get _computedIconHidden();
|
|
2156
|
-
private get _computedIconSingle();
|
|
2157
|
-
render(): lit_html.TemplateResult<1>;
|
|
2158
|
-
}
|
|
2159
|
-
|
|
2160
|
-
declare class LineLoaderUi extends LitBlock {
|
|
2161
|
-
active: boolean;
|
|
2162
|
-
private readonly _lineRef;
|
|
2163
|
-
private _isAnimating;
|
|
1653
|
+
destroyCallback(): void;
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
declare class BtnUi extends Block {
|
|
1657
|
+
private _iconReversed;
|
|
1658
|
+
private _iconSingle;
|
|
1659
|
+
private _iconHidden;
|
|
1660
|
+
constructor();
|
|
1661
|
+
private _iconCss;
|
|
1662
|
+
initCallback(): void;
|
|
1663
|
+
set reverse(_value: boolean);
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
declare class LineLoaderUi extends Block {
|
|
1667
|
+
private _active;
|
|
2164
1668
|
private readonly _handleTransitionEndRight;
|
|
2165
|
-
|
|
2166
|
-
protected updated(changedProperties: PropertyValues<this>): void;
|
|
1669
|
+
initCallback(): void;
|
|
2167
1670
|
private _start;
|
|
2168
1671
|
private _stop;
|
|
2169
|
-
private _resetLine;
|
|
2170
|
-
render(): lit_html.TemplateResult<1>;
|
|
2171
1672
|
}
|
|
2172
1673
|
|
|
2173
|
-
|
|
2174
|
-
transition?: string;
|
|
2175
|
-
visible?: string;
|
|
2176
|
-
hidden?: string;
|
|
2177
|
-
};
|
|
2178
|
-
declare class PresenceToggle extends LitBlock {
|
|
1674
|
+
declare class PresenceToggle extends Block {
|
|
2179
1675
|
private _visible;
|
|
2180
|
-
private _styles;
|
|
2181
1676
|
private _visibleStyle;
|
|
2182
1677
|
private _hiddenStyle;
|
|
2183
1678
|
private _externalTransitions;
|
|
2184
|
-
|
|
2185
|
-
set visible(value: boolean);
|
|
2186
|
-
get visible(): boolean;
|
|
2187
|
-
set styles(styles: PresenceToggleStyle);
|
|
2188
|
-
get styles(): PresenceToggleStyle;
|
|
1679
|
+
constructor();
|
|
2189
1680
|
private _handleVisible;
|
|
2190
|
-
private _dispatchInitialRenderEvent;
|
|
2191
1681
|
initCallback(): void;
|
|
2192
1682
|
}
|
|
2193
1683
|
|
|
2194
|
-
declare class SliderUi extends
|
|
1684
|
+
declare class SliderUi extends Block {
|
|
2195
1685
|
private _observer?;
|
|
2196
1686
|
private _thumbSize;
|
|
1687
|
+
private _zero;
|
|
2197
1688
|
private _zeroDotEl?;
|
|
2198
1689
|
private _stepsCount?;
|
|
2199
|
-
private readonly _inputRef;
|
|
2200
|
-
private readonly _thumbRef;
|
|
2201
|
-
private readonly _stepsRef;
|
|
2202
|
-
disabled: boolean;
|
|
2203
|
-
min: number;
|
|
2204
|
-
max: number;
|
|
2205
|
-
defaultValue: number;
|
|
2206
|
-
zero: number;
|
|
2207
|
-
private _currentValue;
|
|
2208
1690
|
constructor();
|
|
2209
|
-
|
|
2210
|
-
private
|
|
2211
|
-
private
|
|
2212
|
-
private
|
|
2213
|
-
private readonly _handleInputBlur;
|
|
2214
|
-
protected firstUpdated(changedProperties: PropertyValues<this>): void;
|
|
2215
|
-
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
1691
|
+
initCallback(): void;
|
|
1692
|
+
private _inputEl;
|
|
1693
|
+
private _thumbEl;
|
|
1694
|
+
private _stepsEl;
|
|
2216
1695
|
private _updateValue;
|
|
2217
1696
|
private _updateZeroDot;
|
|
2218
1697
|
private _updateSteps;
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
1698
|
+
destroyCallback(): void;
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
declare class Copyright extends Block {
|
|
1702
|
+
initCallback(): void;
|
|
1703
|
+
static template: string;
|
|
2224
1704
|
}
|
|
2225
1705
|
|
|
2226
|
-
declare class DropArea extends
|
|
1706
|
+
declare class DropArea extends UploaderBlock {
|
|
2227
1707
|
static styleAttrs: string[];
|
|
2228
|
-
disabled: boolean;
|
|
2229
|
-
clickable: boolean;
|
|
2230
|
-
withIcon: boolean;
|
|
2231
|
-
fullscreen: boolean;
|
|
2232
|
-
initflow: boolean;
|
|
2233
|
-
text?: string;
|
|
2234
|
-
private _isEnabled;
|
|
2235
|
-
private _isVisible;
|
|
2236
|
-
private get _localizedText();
|
|
2237
1708
|
private _destroyDropzone;
|
|
2238
1709
|
private _destroyContentWrapperDropzone;
|
|
2239
|
-
private
|
|
2240
|
-
|
|
2241
|
-
private _sourceListAllowsLocal;
|
|
2242
|
-
private _clickableListenersAttached;
|
|
1710
|
+
private _onAreaClicked;
|
|
1711
|
+
constructor();
|
|
2243
1712
|
isActive(): boolean;
|
|
2244
1713
|
initCallback(): void;
|
|
2245
|
-
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
2246
|
-
protected updated(changedProperties: PropertyValues<this>): void;
|
|
2247
1714
|
/** Ignore drop events if there are other visible drop areas on the page. */
|
|
2248
1715
|
private _shouldIgnore;
|
|
2249
1716
|
private _couldHandleFiles;
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
1717
|
+
destroyCallback(): void;
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
type EntrySubscription = ReturnType<UploadEntryTypedData['subscribe']>;
|
|
1721
|
+
declare class FileItemConfig extends UploaderBlock {
|
|
1722
|
+
protected _entrySubs: Set<EntrySubscription>;
|
|
1723
|
+
protected _entry: UploadEntryTypedData | null;
|
|
1724
|
+
protected _withEntry<A extends unknown[], R>(fn: (entry: UploadEntryTypedData, ...args: A) => R): (...args: A) => R | undefined;
|
|
1725
|
+
protected _subEntry<K extends UploadEntryKeys>(prop: K, handler: (value: UploadEntryData[K]) => void): void;
|
|
1726
|
+
protected _reset(): void;
|
|
2254
1727
|
disconnectedCallback(): void;
|
|
2255
|
-
render(): lit_html.TemplateResult<1>;
|
|
2256
1728
|
}
|
|
2257
1729
|
|
|
2258
1730
|
declare class FileItem extends FileItemConfig {
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
uid: Uid;
|
|
2262
|
-
private _itemName;
|
|
2263
|
-
private _errorText;
|
|
2264
|
-
private _hint;
|
|
2265
|
-
private _progressValue;
|
|
2266
|
-
private _progressVisible;
|
|
2267
|
-
private _badgeIcon;
|
|
2268
|
-
private _isFinished;
|
|
2269
|
-
private _isFailed;
|
|
2270
|
-
private _isUploading;
|
|
2271
|
-
private _isFocused;
|
|
2272
|
-
private _isEditable;
|
|
2273
|
-
private _showFileNames;
|
|
2274
|
-
private _ariaLabelStatusFile;
|
|
1731
|
+
couldBeCtxOwner: boolean;
|
|
1732
|
+
pauseRender: boolean;
|
|
2275
1733
|
private _renderedOnce;
|
|
2276
1734
|
private _observer?;
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
1735
|
+
protected _isIntersecting: boolean;
|
|
1736
|
+
protected _thumbRect?: DOMRectReadOnly;
|
|
1737
|
+
constructor();
|
|
2280
1738
|
private _calculateState;
|
|
2281
1739
|
private _debouncedCalculateState;
|
|
2282
1740
|
private _updateHintAndProgress;
|
|
2283
1741
|
private _handleState;
|
|
2284
|
-
|
|
1742
|
+
_reset(): void;
|
|
2285
1743
|
private _observerCallback;
|
|
2286
1744
|
private _handleEntryId;
|
|
2287
1745
|
private _updateShowFileNames;
|
|
2288
|
-
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
2289
1746
|
initCallback(): void;
|
|
1747
|
+
destroyCallback(): void;
|
|
2290
1748
|
connectedCallback(): void;
|
|
2291
1749
|
disconnectedCallback(): void;
|
|
2292
|
-
private
|
|
1750
|
+
private _settingsOfShrink;
|
|
1751
|
+
private _processShrink;
|
|
1752
|
+
upload: () => Promise<void> | undefined;
|
|
1753
|
+
static template: string;
|
|
2293
1754
|
static activeInstances: Set<FileItem>;
|
|
2294
|
-
protected shouldUpdate(changedProperties: PropertyValues<this>): boolean;
|
|
2295
|
-
render(): lit_html.TemplateResult<1>;
|
|
2296
1755
|
}
|
|
2297
1756
|
|
|
2298
|
-
declare class
|
|
1757
|
+
declare class FormInput extends UploaderBlock {
|
|
1758
|
+
requireCtxName: boolean;
|
|
1759
|
+
_validationInputElement: HTMLInputElement | null;
|
|
1760
|
+
_dynamicInputsContainer: HTMLDivElement | null;
|
|
1761
|
+
private get _inputName();
|
|
1762
|
+
_createValidationInput(): HTMLInputElement;
|
|
1763
|
+
initCallback(): void;
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
declare class Icon extends Block {
|
|
1767
|
+
constructor();
|
|
1768
|
+
initCallback(): void;
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
declare class ImgConfig extends BaseComponent<any> {
|
|
1772
|
+
static get observedAttributes(): string[];
|
|
1773
|
+
constructor();
|
|
1774
|
+
cssInit$: any;
|
|
1775
|
+
/**
|
|
1776
|
+
* @param {String} key
|
|
1777
|
+
* @returns {any}
|
|
1778
|
+
*/
|
|
1779
|
+
$$(key: string): any;
|
|
1780
|
+
/** @param {Object<String, String | Number>} kvObj */
|
|
1781
|
+
set$$(kvObj: any): void;
|
|
1782
|
+
/**
|
|
1783
|
+
* @param {String} key
|
|
1784
|
+
* @param {(val: any) => void} kbFn
|
|
1785
|
+
*/
|
|
1786
|
+
sub$$(key: string, kbFn: (val: any) => void): void;
|
|
1787
|
+
analyticsParams(): string;
|
|
1788
|
+
initAttributes(el: any): void;
|
|
1789
|
+
/**
|
|
1790
|
+
* @param {HTMLElement} el
|
|
1791
|
+
* @param {() => void} cbkFn
|
|
1792
|
+
*/
|
|
1793
|
+
initIntersection(el: HTMLElement, cbkFn: () => void): void;
|
|
1794
|
+
/** @private */
|
|
1795
|
+
private _isnObserver;
|
|
1796
|
+
/** @private */
|
|
1797
|
+
private _observed;
|
|
1798
|
+
attributeChangedCallback(name: any, oldVal: any, newVal: any): void;
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
declare class ImgBase extends ImgConfig {
|
|
1802
|
+
_img: HTMLImageElement;
|
|
1803
|
+
_imgPreview: HTMLImageElement;
|
|
1804
|
+
/**
|
|
1805
|
+
* @private
|
|
1806
|
+
* @param {String} src
|
|
1807
|
+
*/
|
|
1808
|
+
private _fmtAbs;
|
|
1809
|
+
/**
|
|
1810
|
+
* Validate size
|
|
1811
|
+
*
|
|
1812
|
+
* @param {String} [size]
|
|
1813
|
+
* @returns {String | Number}
|
|
1814
|
+
*/
|
|
1815
|
+
_validateSize(size?: string): string | number;
|
|
1816
|
+
/**
|
|
1817
|
+
* Image operations
|
|
1818
|
+
*
|
|
1819
|
+
* @param {String} [size]
|
|
1820
|
+
* @param {String} [blur]
|
|
1821
|
+
*/
|
|
1822
|
+
_getCdnModifiers(size?: string, blur?: string): string;
|
|
1823
|
+
/**
|
|
1824
|
+
* @private
|
|
1825
|
+
* @param {String} [size]
|
|
1826
|
+
* @param {String} [blur]
|
|
1827
|
+
* @returns {any}
|
|
1828
|
+
*/
|
|
1829
|
+
private _getUrlBase;
|
|
1830
|
+
/**
|
|
1831
|
+
* @private
|
|
1832
|
+
* @param {String} url
|
|
1833
|
+
* @returns {String}
|
|
1834
|
+
*/
|
|
1835
|
+
private _proxyUrl;
|
|
1836
|
+
/**
|
|
1837
|
+
* @param {HTMLElement} el
|
|
1838
|
+
* @param {Number} [k]
|
|
1839
|
+
* @param {Boolean} [wOnly]
|
|
1840
|
+
*/
|
|
1841
|
+
_getElSize(el: HTMLElement, k?: number, wOnly?: boolean): string | null;
|
|
1842
|
+
/** @param {HTMLImageElement} img */
|
|
1843
|
+
_setupEventProxy(img: HTMLImageElement): void;
|
|
1844
|
+
/** @type {HTMLImageElement} */
|
|
1845
|
+
get img(): HTMLImageElement;
|
|
1846
|
+
get currentImg(): {
|
|
1847
|
+
type: "PREVIEW";
|
|
1848
|
+
img: HTMLImageElement;
|
|
1849
|
+
} | {
|
|
1850
|
+
type: "MAIN";
|
|
1851
|
+
img: HTMLImageElement;
|
|
1852
|
+
};
|
|
1853
|
+
get hasPreviewImage(): any;
|
|
1854
|
+
get bgSelector(): any;
|
|
1855
|
+
get breakpoints(): number[] | null;
|
|
1856
|
+
get hasFormatJPG(): boolean;
|
|
1857
|
+
/** @param {HTMLElement} el */
|
|
1858
|
+
renderBg(el: HTMLElement): void;
|
|
1859
|
+
getSrcset(): string;
|
|
1860
|
+
getSrc(): any;
|
|
1861
|
+
get srcUrlPreview(): any;
|
|
1862
|
+
renderBackground(): void;
|
|
1863
|
+
_appendURL({ elNode, src, srcset }: {
|
|
1864
|
+
elNode: any;
|
|
1865
|
+
src: any;
|
|
1866
|
+
srcset: any;
|
|
1867
|
+
}): void;
|
|
1868
|
+
_setupConfigForImage({ elNode }: {
|
|
1869
|
+
elNode: any;
|
|
1870
|
+
}): void;
|
|
1871
|
+
loaderImage({ src, srcset, elNode }: {
|
|
1872
|
+
src: any;
|
|
1873
|
+
srcset: any;
|
|
1874
|
+
elNode: any;
|
|
1875
|
+
}): Promise<any>;
|
|
1876
|
+
renderImage(): Promise<void>;
|
|
1877
|
+
init(): void;
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
declare class Img extends ImgBase {
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
declare class ProgressBar extends Block {
|
|
1884
|
+
private _value;
|
|
1885
|
+
private _visible;
|
|
1886
|
+
constructor();
|
|
1887
|
+
initCallback(): void;
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
declare class ProgressBarCommon extends UploaderBlock {
|
|
1891
|
+
private _unobserveCollectionCb?;
|
|
1892
|
+
constructor();
|
|
1893
|
+
initCallback(): void;
|
|
1894
|
+
destroyCallback(): void;
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
declare class Select extends Block {
|
|
1898
|
+
ref: {
|
|
1899
|
+
select: HTMLSelectElement;
|
|
1900
|
+
} & Record<string, HTMLElement>;
|
|
1901
|
+
value: string;
|
|
1902
|
+
constructor();
|
|
1903
|
+
initCallback(): void;
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
declare class SimpleBtn extends UploaderBlock {
|
|
2299
1907
|
static styleAttrs: string[];
|
|
2300
1908
|
couldBeCtxOwner: boolean;
|
|
2301
|
-
|
|
2302
|
-
private _buttonTextKey;
|
|
2303
|
-
private readonly _handleClick;
|
|
1909
|
+
constructor();
|
|
2304
1910
|
initCallback(): void;
|
|
2305
|
-
render(): lit_html.TemplateResult<1>;
|
|
2306
1911
|
}
|
|
2307
1912
|
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
'*historyBack': null;
|
|
2323
|
-
'*closeModal': () => void;
|
|
2324
|
-
};
|
|
1913
|
+
type SourceTypeConfig = {
|
|
1914
|
+
type: string;
|
|
1915
|
+
activity?: ActivityType | null;
|
|
1916
|
+
textKey?: string;
|
|
1917
|
+
icon?: string;
|
|
1918
|
+
activate?: () => boolean;
|
|
1919
|
+
activityParams?: Record<string, unknown>;
|
|
1920
|
+
};
|
|
1921
|
+
declare class SourceBtn extends UploaderBlock {
|
|
1922
|
+
couldBeCtxOwner: boolean;
|
|
1923
|
+
private type;
|
|
1924
|
+
private _registeredTypes;
|
|
1925
|
+
constructor();
|
|
1926
|
+
initTypes(): void;
|
|
2325
1927
|
initCallback(): void;
|
|
2326
|
-
|
|
1928
|
+
registerType(typeConfig: SourceTypeConfig): void;
|
|
1929
|
+
getType(type: string): SourceTypeConfig | undefined;
|
|
1930
|
+
activate(): void;
|
|
1931
|
+
applyType(type: string): void;
|
|
2327
1932
|
}
|
|
2328
1933
|
|
|
2329
|
-
declare class
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
1934
|
+
declare class SourceList extends Block {
|
|
1935
|
+
initCallback(): void;
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
declare class Spinner extends BaseComponent<void> {
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1941
|
+
declare class StartFrom extends ActivityBlock {
|
|
1942
|
+
historyTracked: boolean;
|
|
1943
|
+
activityType: ActivityType;
|
|
1944
|
+
initCallback(): void;
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1947
|
+
declare class Thumb extends FileItemConfig {
|
|
1948
|
+
private _renderedGridOnce;
|
|
1949
|
+
private _thumbRect;
|
|
1950
|
+
private _isIntersecting;
|
|
1951
|
+
private _firstViewMode;
|
|
1952
|
+
private _observer?;
|
|
1953
|
+
constructor();
|
|
1954
|
+
private _calculateThumbSize;
|
|
1955
|
+
private _generateThumbnail;
|
|
1956
|
+
private _debouncedGenerateThumb;
|
|
1957
|
+
private _observerCallback;
|
|
1958
|
+
protected _reset(): void;
|
|
1959
|
+
private _handleEntryId;
|
|
1960
|
+
initCallback(): void;
|
|
1961
|
+
connectedCallback(): void;
|
|
1962
|
+
disconnectedCallback(): void;
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
type EventListenerMap = {
|
|
1966
|
+
[K in (typeof EventType)[keyof typeof EventType]]: (e: CustomEvent<EventPayload[K]>) => void;
|
|
1967
|
+
};
|
|
1968
|
+
declare class UploadCtxProvider extends UploaderBlock {
|
|
2334
1969
|
static styleAttrs: string[];
|
|
2335
|
-
|
|
1970
|
+
static EventType: Readonly<{
|
|
1971
|
+
readonly FILE_ADDED: "file-added";
|
|
1972
|
+
readonly FILE_REMOVED: "file-removed";
|
|
1973
|
+
readonly FILE_UPLOAD_START: "file-upload-start";
|
|
1974
|
+
readonly FILE_UPLOAD_PROGRESS: "file-upload-progress";
|
|
1975
|
+
readonly FILE_UPLOAD_SUCCESS: "file-upload-success";
|
|
1976
|
+
readonly FILE_UPLOAD_FAILED: "file-upload-failed";
|
|
1977
|
+
readonly FILE_URL_CHANGED: "file-url-changed";
|
|
1978
|
+
readonly MODAL_OPEN: "modal-open";
|
|
1979
|
+
readonly MODAL_CLOSE: "modal-close";
|
|
1980
|
+
readonly DONE_CLICK: "done-click";
|
|
1981
|
+
readonly UPLOAD_CLICK: "upload-click";
|
|
1982
|
+
readonly ACTIVITY_CHANGE: "activity-change";
|
|
1983
|
+
readonly COMMON_UPLOAD_START: "common-upload-start";
|
|
1984
|
+
readonly COMMON_UPLOAD_PROGRESS: "common-upload-progress";
|
|
1985
|
+
readonly COMMON_UPLOAD_SUCCESS: "common-upload-success";
|
|
1986
|
+
readonly COMMON_UPLOAD_FAILED: "common-upload-failed";
|
|
1987
|
+
readonly CHANGE: "change";
|
|
1988
|
+
readonly GROUP_CREATED: "group-created";
|
|
1989
|
+
}>;
|
|
1990
|
+
requireCtxName: boolean;
|
|
1991
|
+
initCallback(): void;
|
|
1992
|
+
destroyCallback(): void;
|
|
1993
|
+
}
|
|
1994
|
+
interface UploadCtxProvider extends UploaderBlock {
|
|
1995
|
+
addEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | AddEventListenerOptions): void;
|
|
1996
|
+
removeEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | EventListenerOptions): void;
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
declare class UrlSource extends UploaderBlock {
|
|
2000
|
+
couldBeCtxOwner: boolean;
|
|
2001
|
+
activityType: ActivityType;
|
|
2336
2002
|
constructor();
|
|
2337
2003
|
initCallback(): void;
|
|
2338
|
-
render(): lit_html.TemplateResult<1>;
|
|
2339
2004
|
}
|
|
2340
2005
|
|
|
2341
2006
|
declare class CloudImageEditor extends CloudImageEditorBlock {
|
|
@@ -2344,37 +2009,32 @@ declare class CloudImageEditor extends CloudImageEditorBlock {
|
|
|
2344
2009
|
initCallback(): void;
|
|
2345
2010
|
}
|
|
2346
2011
|
|
|
2347
|
-
declare class FileUploaderInline extends
|
|
2348
|
-
propertiesMeta: {
|
|
2349
|
-
'ctx-name': string;
|
|
2350
|
-
};
|
|
2012
|
+
declare class FileUploaderInline extends SolutionBlock {
|
|
2351
2013
|
static styleAttrs: string[];
|
|
2352
|
-
private _couldCancel;
|
|
2353
2014
|
constructor();
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
private get _couldShowList();
|
|
2357
|
-
private _getInitActivity;
|
|
2015
|
+
get couldHistoryBack(): boolean;
|
|
2016
|
+
get couldShowList(): boolean;
|
|
2358
2017
|
initCallback(): void;
|
|
2359
|
-
render(): lit_html.TemplateResult<1>;
|
|
2360
2018
|
}
|
|
2361
2019
|
|
|
2362
|
-
declare class FileUploaderMinimal extends
|
|
2363
|
-
propertiesMeta: {
|
|
2364
|
-
'ctx-name': string;
|
|
2365
|
-
};
|
|
2020
|
+
declare class FileUploaderMinimal extends SolutionBlock {
|
|
2366
2021
|
static styleAttrs: string[];
|
|
2367
|
-
private
|
|
2368
|
-
private
|
|
2369
|
-
private _classUploadList;
|
|
2370
|
-
private _classStartFrom;
|
|
2371
|
-
private _getInitActivity;
|
|
2022
|
+
private handleModalOpen?;
|
|
2023
|
+
private handleModalClose?;
|
|
2372
2024
|
constructor();
|
|
2373
2025
|
private _handleModalOpen;
|
|
2374
2026
|
private _handleModalClose;
|
|
2375
2027
|
initCallback(): void;
|
|
2376
|
-
|
|
2377
|
-
render(): lit_html.TemplateResult<1>;
|
|
2028
|
+
destroyCallback(): void;
|
|
2378
2029
|
}
|
|
2379
2030
|
|
|
2380
|
-
|
|
2031
|
+
declare class FileUploaderRegular extends SolutionBlock {
|
|
2032
|
+
static styleAttrs: string[];
|
|
2033
|
+
constructor();
|
|
2034
|
+
initCallback(): void;
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
type KebabCase<T extends string> = T extends `${infer Head} ${infer Tail}` ? `${Lowercase<Head>}-${KebabCase<Tail>}` : Lowercase<T>;
|
|
2038
|
+
declare const toKebabCase: <T extends string>(str: T) => KebabCase<T>;
|
|
2039
|
+
|
|
2040
|
+
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, 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, toKebabCase };
|