@uploadcare/file-uploader 1.30.0-alpha.5 → 1.30.0-alpha.7
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/README.md +2 -0
- package/dist/abstract/loadFileUploaderFrom.js +2 -2
- package/dist/env.js +3 -3
- package/dist/index.css +4 -4
- package/dist/index.d.ts +789 -308
- package/dist/index.js +5 -5
- package/dist/index.layered.css +3 -3
- package/dist/index.ssr.js +324 -42
- package/dist/locales/file-uploader/ar.d.ts +7 -2
- package/dist/locales/file-uploader/ar.js +3 -3
- package/dist/locales/file-uploader/az.d.ts +7 -2
- package/dist/locales/file-uploader/az.js +3 -3
- package/dist/locales/file-uploader/ca.d.ts +7 -2
- package/dist/locales/file-uploader/ca.js +3 -3
- package/dist/locales/file-uploader/cs.d.ts +7 -2
- package/dist/locales/file-uploader/cs.js +3 -3
- package/dist/locales/file-uploader/da.d.ts +7 -2
- package/dist/locales/file-uploader/da.js +3 -3
- package/dist/locales/file-uploader/de.d.ts +7 -2
- package/dist/locales/file-uploader/de.js +3 -3
- package/dist/locales/file-uploader/el.d.ts +7 -2
- package/dist/locales/file-uploader/el.js +3 -3
- package/dist/locales/file-uploader/en.d.ts +7 -2
- package/dist/locales/file-uploader/en.js +3 -3
- package/dist/locales/file-uploader/es.d.ts +7 -2
- package/dist/locales/file-uploader/es.js +3 -3
- package/dist/locales/file-uploader/et.d.ts +7 -2
- package/dist/locales/file-uploader/et.js +3 -3
- package/dist/locales/file-uploader/fi.d.ts +7 -2
- package/dist/locales/file-uploader/fi.js +3 -3
- package/dist/locales/file-uploader/fr.d.ts +7 -2
- package/dist/locales/file-uploader/fr.js +3 -3
- package/dist/locales/file-uploader/he.d.ts +7 -2
- package/dist/locales/file-uploader/he.js +3 -3
- package/dist/locales/file-uploader/hy.d.ts +7 -2
- package/dist/locales/file-uploader/hy.js +3 -3
- package/dist/locales/file-uploader/is.d.ts +7 -2
- package/dist/locales/file-uploader/is.js +3 -3
- package/dist/locales/file-uploader/it.d.ts +7 -2
- package/dist/locales/file-uploader/it.js +3 -3
- package/dist/locales/file-uploader/ja.d.ts +7 -2
- package/dist/locales/file-uploader/ja.js +3 -3
- package/dist/locales/file-uploader/ka.d.ts +7 -2
- package/dist/locales/file-uploader/ka.js +3 -3
- package/dist/locales/file-uploader/kk.d.ts +7 -2
- package/dist/locales/file-uploader/kk.js +3 -3
- package/dist/locales/file-uploader/ko.d.ts +7 -2
- package/dist/locales/file-uploader/ko.js +3 -3
- package/dist/locales/file-uploader/lv.d.ts +7 -2
- package/dist/locales/file-uploader/lv.js +3 -3
- package/dist/locales/file-uploader/nb.d.ts +7 -2
- package/dist/locales/file-uploader/nb.js +3 -3
- package/dist/locales/file-uploader/nl.d.ts +7 -2
- package/dist/locales/file-uploader/nl.js +3 -3
- package/dist/locales/file-uploader/pl.d.ts +7 -2
- package/dist/locales/file-uploader/pl.js +3 -3
- package/dist/locales/file-uploader/pt.d.ts +7 -2
- package/dist/locales/file-uploader/pt.js +3 -3
- package/dist/locales/file-uploader/ro.d.ts +7 -2
- package/dist/locales/file-uploader/ro.js +3 -3
- package/dist/locales/file-uploader/ru.d.ts +7 -2
- package/dist/locales/file-uploader/ru.js +3 -3
- package/dist/locales/file-uploader/sk.d.ts +7 -2
- package/dist/locales/file-uploader/sk.js +3 -3
- package/dist/locales/file-uploader/sr.d.ts +7 -2
- package/dist/locales/file-uploader/sr.js +3 -3
- package/dist/locales/file-uploader/sv.d.ts +7 -2
- package/dist/locales/file-uploader/sv.js +3 -3
- package/dist/locales/file-uploader/tr.d.ts +7 -2
- package/dist/locales/file-uploader/tr.js +3 -3
- package/dist/locales/file-uploader/uk.d.ts +7 -2
- package/dist/locales/file-uploader/uk.js +3 -3
- package/dist/locales/file-uploader/vi.d.ts +7 -2
- package/dist/locales/file-uploader/vi.js +3 -3
- package/dist/locales/file-uploader/zh-TW.d.ts +7 -2
- package/dist/locales/file-uploader/zh-TW.js +3 -3
- package/dist/locales/file-uploader/zh.d.ts +7 -2
- package/dist/locales/file-uploader/zh.js +3 -3
- package/package.json +29 -29
- package/web/file-uploader.iife.min.d.ts +796 -310
- package/web/file-uploader.iife.min.js +4 -4
- package/web/file-uploader.iife.min.js.LEGAL.txt +2 -1
- package/web/file-uploader.min.d.ts +796 -310
- package/web/file-uploader.min.js +4 -4
- package/web/file-uploader.min.js.LEGAL.txt +2 -1
- package/web/uc-basic.layered.min.css +3 -3
- package/web/uc-basic.min.css +4 -4
- package/web/uc-cloud-image-editor.layered.min.css +3 -3
- package/web/uc-cloud-image-editor.min.css +3 -3
- package/web/uc-cloud-image-editor.min.d.ts +754 -268
- package/web/uc-cloud-image-editor.min.js +4 -4
- package/web/uc-file-uploader-inline.layered.min.css +3 -3
- package/web/uc-file-uploader-inline.min.css +4 -4
- package/web/uc-file-uploader-inline.min.d.ts +796 -310
- package/web/uc-file-uploader-inline.min.js +4 -4
- package/web/uc-file-uploader-inline.min.js.LEGAL.txt +2 -1
- package/web/uc-file-uploader-minimal.layered.min.css +3 -3
- package/web/uc-file-uploader-minimal.min.css +4 -4
- package/web/uc-file-uploader-minimal.min.d.ts +796 -310
- package/web/uc-file-uploader-minimal.min.js +4 -4
- package/web/uc-file-uploader-minimal.min.js.LEGAL.txt +2 -1
- package/web/uc-file-uploader-regular.layered.min.css +3 -3
- package/web/uc-file-uploader-regular.min.css +4 -4
- package/web/uc-file-uploader-regular.min.d.ts +796 -310
- package/web/uc-file-uploader-regular.min.js +4 -4
- package/web/uc-file-uploader-regular.min.js.LEGAL.txt +2 -1
- package/web/uc-img.min.js +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import _default from './locales/file-uploader/en.js';
|
|
|
4
4
|
import * as lit_html from 'lit-html';
|
|
5
5
|
import * as lit_html_directives_ref_js from 'lit-html/directives/ref.js';
|
|
6
6
|
import * as _uploadcare_upload_client from '@uploadcare/upload-client';
|
|
7
|
-
import {
|
|
7
|
+
import { FileFromOptions, Metadata, UploadcareFile, UploadError, NetworkError, UploadcareGroup, Queue } from '@uploadcare/upload-client';
|
|
8
8
|
export { Metadata, NetworkError, UploadError, UploadcareError, UploadcareFile, UploadcareGroup } from '@uploadcare/upload-client';
|
|
9
9
|
import { Ref } from 'lit/directives/ref.js';
|
|
10
10
|
import { TelemetryRequest } from '@uploadcare/quality-insights';
|
|
@@ -79,6 +79,16 @@ type LocaleDefinition = typeof _default;
|
|
|
79
79
|
type LocaleDefinitionResolver = () => Promise<LocaleDefinition>;
|
|
80
80
|
declare const defineLocale: (localeName: string, definitionOrResolver: LocaleDefinition | LocaleDefinitionResolver) => void;
|
|
81
81
|
|
|
82
|
+
type AfterFileAddContext = {
|
|
83
|
+
historyLength: number;
|
|
84
|
+
};
|
|
85
|
+
type AfterFileAddHook = (ctx: AfterFileAddContext) => boolean;
|
|
86
|
+
declare class RouterHooksLayer extends SharedInstance {
|
|
87
|
+
private _afterFileAddHooks;
|
|
88
|
+
registerAfterFileAddHook(hook: AfterFileAddHook): () => void;
|
|
89
|
+
navigateAfterFileAdd(): void;
|
|
90
|
+
}
|
|
91
|
+
|
|
82
92
|
declare class A11y implements ISharedInstance {
|
|
83
93
|
private _destroyKeyUX;
|
|
84
94
|
private readonly _scopedWindow;
|
|
@@ -90,8 +100,72 @@ declare class A11y implements ISharedInstance {
|
|
|
90
100
|
declare class LocaleManager extends SharedInstance {
|
|
91
101
|
private _localeName;
|
|
92
102
|
constructor(sharedInstancesBag: SharedInstancesBag);
|
|
103
|
+
private _applyOverrides;
|
|
104
|
+
private _applyPluginLocales;
|
|
93
105
|
}
|
|
94
106
|
|
|
107
|
+
/**
|
|
108
|
+
* Custom configuration options registration system for plugins
|
|
109
|
+
*/
|
|
110
|
+
type CustomConfigDefinition<T = unknown> = {
|
|
111
|
+
/**
|
|
112
|
+
* Config option name (will be used as property and optionally as attribute)
|
|
113
|
+
*/
|
|
114
|
+
name: string;
|
|
115
|
+
/**
|
|
116
|
+
* Default value for the config option
|
|
117
|
+
*/
|
|
118
|
+
defaultValue: T;
|
|
119
|
+
/**
|
|
120
|
+
* Whether this config can be set via HTML attribute
|
|
121
|
+
* @default true
|
|
122
|
+
*/
|
|
123
|
+
attribute?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Convert attribute string to config value
|
|
126
|
+
* Only used if attribute is true
|
|
127
|
+
*/
|
|
128
|
+
fromAttribute?: (value: string | null) => T;
|
|
129
|
+
/**
|
|
130
|
+
* Convert config value to attribute string
|
|
131
|
+
* Only used if attribute is true
|
|
132
|
+
*/
|
|
133
|
+
toAttribute?: (value: T) => string | null;
|
|
134
|
+
/**
|
|
135
|
+
* Normalize/validate the config value
|
|
136
|
+
*/
|
|
137
|
+
normalize?: (value: unknown) => T;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Registry for custom config options defined by plugins
|
|
141
|
+
* This is managed by the PluginManager as a shared instance property
|
|
142
|
+
*/
|
|
143
|
+
declare class CustomConfigRegistry {
|
|
144
|
+
private _definitions;
|
|
145
|
+
register<T = unknown>(pluginId: string, definition: CustomConfigDefinition<T>): void;
|
|
146
|
+
unregister(name: string): void;
|
|
147
|
+
unregisterByPlugin(pluginId: string): void;
|
|
148
|
+
get(name: string): CustomConfigDefinition<any> | undefined;
|
|
149
|
+
getAll(): Map<string, CustomConfigDefinition<any>>;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Interface for TypeScript module augmentation
|
|
153
|
+
* Plugins should extend this interface to add their custom config types
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```typescript
|
|
157
|
+
* declare module '@uploadcare/file-uploader' {
|
|
158
|
+
* interface CustomConfig {
|
|
159
|
+
* 'my-custom-option': string;
|
|
160
|
+
* }
|
|
161
|
+
* }
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
interface CustomConfig {
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
declare function buildOutputCollectionState<TCollectionStatus extends OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'>(bag: SharedInstancesBag): OutputCollectionState<TCollectionStatus, TGroupFlag>;
|
|
168
|
+
|
|
95
169
|
declare class TypedData<T extends Record<string, unknown>> {
|
|
96
170
|
private _ctxId;
|
|
97
171
|
private _data;
|
|
@@ -104,6 +178,41 @@ declare class TypedData<T extends Record<string, unknown>> {
|
|
|
104
178
|
destroy(): void;
|
|
105
179
|
}
|
|
106
180
|
|
|
181
|
+
type FuncFileValidator = (outputEntry: OutputFileEntry, api: UploaderPublicApi, options?: {
|
|
182
|
+
signal?: AbortSignal;
|
|
183
|
+
}) => undefined | OutputErrorFile | Promise<undefined | OutputErrorFile>;
|
|
184
|
+
type FileValidatorDescriptor = {
|
|
185
|
+
runOn: 'add' | 'upload' | 'change';
|
|
186
|
+
validator: FuncFileValidator;
|
|
187
|
+
};
|
|
188
|
+
type FileValidator = FileValidatorDescriptor | FuncFileValidator;
|
|
189
|
+
type FuncCollectionValidator = (collection: ReturnType<typeof buildOutputCollectionState<OutputCollectionStatus>>, api: UploaderPublicApi) => undefined | OutputErrorCollection;
|
|
190
|
+
declare class ValidationManager extends SharedInstance {
|
|
191
|
+
private get _uploadCollection();
|
|
192
|
+
private _commonFileValidators;
|
|
193
|
+
private _commonCollectionValidators;
|
|
194
|
+
private _queue;
|
|
195
|
+
private _runQueueDebounced;
|
|
196
|
+
private _isDestroyed;
|
|
197
|
+
private _entryValidationState;
|
|
198
|
+
constructor(sharedInstancesBag: SharedInstancesBag);
|
|
199
|
+
runFileValidators(runOn: FileValidatorDescriptor['runOn'], entryIds?: Uid[]): void;
|
|
200
|
+
runCollectionValidators(): void;
|
|
201
|
+
cleanupValidationForEntry(entry: TypedData<UploadEntryData>): void;
|
|
202
|
+
private _runFileValidatorsForEntry;
|
|
203
|
+
private _addCustomTypeToValidationError;
|
|
204
|
+
private _getEntryValidationState;
|
|
205
|
+
private _getValidatorDescriptors;
|
|
206
|
+
private _getValidatorDescriptorsForEntry;
|
|
207
|
+
destroy(): void;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
declare class SecureUploadsManager extends SharedInstance {
|
|
211
|
+
private _secureToken;
|
|
212
|
+
getSecureToken(): Promise<SecureUploadsSignatureAndExpire | null>;
|
|
213
|
+
destroy(): void;
|
|
214
|
+
}
|
|
215
|
+
|
|
107
216
|
type ChangeMap<T extends Record<string, unknown>> = Record<keyof T, Set<Uid>>;
|
|
108
217
|
type TypedCollectionPropertyObserver<T extends Record<string, unknown>> = (changeMap: ChangeMap<T>) => void;
|
|
109
218
|
type TypedCollectionObserverHandler<T extends Record<string, unknown>> = (list: Uid[], added: Set<TypedData<T>>, removed: Set<TypedData<T>>) => void;
|
|
@@ -140,6 +249,8 @@ declare class TypedCollection<T extends Record<string, unknown>> {
|
|
|
140
249
|
readProp<K extends keyof T>(id: Uid, propName: K): T[K];
|
|
141
250
|
publishProp<K extends keyof T>(id: Uid, propName: K, value: T[K]): void;
|
|
142
251
|
remove(id: Uid): void;
|
|
252
|
+
abort(id: Uid): void;
|
|
253
|
+
abortAll(): void;
|
|
143
254
|
clearAll(): void;
|
|
144
255
|
observeProperties(handler: TypedCollectionPropertyObserver<T>): () => void;
|
|
145
256
|
unobserveProperties(handler: TypedCollectionPropertyObserver<T>): void;
|
|
@@ -155,155 +266,6 @@ declare const CameraSourceTypes: Readonly<{
|
|
|
155
266
|
}>;
|
|
156
267
|
type ModeCameraType = (typeof CameraSourceTypes)[keyof typeof CameraSourceTypes];
|
|
157
268
|
|
|
158
|
-
declare function buildOutputCollectionState<TCollectionStatus extends OutputCollectionStatus, TGroupFlag extends GroupFlag = 'maybe-has-group'>(bag: SharedInstancesBag): OutputCollectionState<TCollectionStatus, TGroupFlag>;
|
|
159
|
-
|
|
160
|
-
interface UploadEntryData extends Record<string, unknown> {
|
|
161
|
-
file: File | null;
|
|
162
|
-
externalUrl: string | null;
|
|
163
|
-
fileName: string | null;
|
|
164
|
-
fileSize: number | null;
|
|
165
|
-
lastModified: number;
|
|
166
|
-
uploadProgress: number;
|
|
167
|
-
uuid: string | null;
|
|
168
|
-
isImage: boolean;
|
|
169
|
-
mimeType: string | null;
|
|
170
|
-
ctxName: string | null;
|
|
171
|
-
cdnUrl: string | null;
|
|
172
|
-
cdnUrlModifiers: string | null;
|
|
173
|
-
fileInfo: UploadcareFile | null;
|
|
174
|
-
isUploading: boolean;
|
|
175
|
-
abortController: AbortController | null;
|
|
176
|
-
thumbUrl: string | null;
|
|
177
|
-
silent: boolean;
|
|
178
|
-
source: string | null;
|
|
179
|
-
fullPath: string | null;
|
|
180
|
-
metadata: Metadata | null;
|
|
181
|
-
errors: OutputErrorFile[];
|
|
182
|
-
uploadError: Error | null;
|
|
183
|
-
isRemoved: boolean;
|
|
184
|
-
isQueuedForUploading: boolean;
|
|
185
|
-
isValidationPending: boolean;
|
|
186
|
-
isQueuedForValidation: boolean;
|
|
187
|
-
}
|
|
188
|
-
type UploadEntryTypedData = TypedData<UploadEntryData>;
|
|
189
|
-
type UploadEntryKeys = keyof UploadEntryData;
|
|
190
|
-
|
|
191
|
-
type ApiAddFileCommonOptions = {
|
|
192
|
-
silent?: boolean;
|
|
193
|
-
fileName?: string;
|
|
194
|
-
source?: string;
|
|
195
|
-
};
|
|
196
|
-
declare class UploaderPublicApi extends SharedInstance {
|
|
197
|
-
private _l10n;
|
|
198
|
-
get _uploadCollection(): TypedCollection<UploadEntryData>;
|
|
199
|
-
get cfg(): Readonly<ConfigType>;
|
|
200
|
-
get l10n(): (str: string, variables?: Record<string, string | number>) => string;
|
|
201
|
-
/**
|
|
202
|
-
* TODO: Probably we should not allow user to override `source` property
|
|
203
|
-
*/
|
|
204
|
-
addFileFromUrl: (url: string, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"idle">;
|
|
205
|
-
addFileFromUuid: (uuid: string, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"idle">;
|
|
206
|
-
addFileFromCdnUrl: (cdnUrl: string, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"idle">;
|
|
207
|
-
addFileFromObject: (file: File, { silent, fileName, source, fullPath, }?: ApiAddFileCommonOptions & {
|
|
208
|
-
fullPath?: string;
|
|
209
|
-
}) => OutputFileEntry<"idle">;
|
|
210
|
-
removeFileByInternalId: (internalId: string) => void;
|
|
211
|
-
removeAllFiles(): void;
|
|
212
|
-
uploadAll: () => void;
|
|
213
|
-
openSystemDialog: (options?: {
|
|
214
|
-
captureCamera?: boolean;
|
|
215
|
-
modeCamera?: ModeCameraType;
|
|
216
|
-
}) => void;
|
|
217
|
-
getOutputItem<TStatus extends OutputFileStatus>(entryId: string): OutputFileEntry<TStatus>;
|
|
218
|
-
getOutputCollectionState<TStatus extends OutputCollectionStatus>(): ReturnType<typeof buildOutputCollectionState<TStatus>>;
|
|
219
|
-
initFlow: (force?: boolean) => void;
|
|
220
|
-
doneFlow: () => void;
|
|
221
|
-
setCurrentActivity: <T extends RegisteredActivityType>(activityType: T, ...params: T extends keyof ActivityParamsMap ? [ActivityParamsMap[T]] : T extends RegisteredActivityType ? [undefined?] : [never]) => void;
|
|
222
|
-
getCurrentActivity: () => ActivityType;
|
|
223
|
-
setModalState: (opened: boolean) => void;
|
|
224
|
-
private get _sourceList();
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
declare const ExternalUploadSource: Readonly<{
|
|
228
|
-
readonly FACEBOOK: "facebook";
|
|
229
|
-
readonly DROPBOX: "dropbox";
|
|
230
|
-
readonly GDRIVE: "gdrive";
|
|
231
|
-
readonly GPHOTOS: "gphotos";
|
|
232
|
-
readonly FLICKR: "flickr";
|
|
233
|
-
readonly VK: "vk";
|
|
234
|
-
readonly EVERNOTE: "evernote";
|
|
235
|
-
readonly BOX: "box";
|
|
236
|
-
readonly ONEDRIVE: "onedrive";
|
|
237
|
-
readonly HUDDLE: "huddle";
|
|
238
|
-
}>;
|
|
239
|
-
declare const UploadSource: Readonly<{
|
|
240
|
-
readonly FACEBOOK: "facebook";
|
|
241
|
-
readonly DROPBOX: "dropbox";
|
|
242
|
-
readonly GDRIVE: "gdrive";
|
|
243
|
-
readonly GPHOTOS: "gphotos";
|
|
244
|
-
readonly FLICKR: "flickr";
|
|
245
|
-
readonly VK: "vk";
|
|
246
|
-
readonly EVERNOTE: "evernote";
|
|
247
|
-
readonly BOX: "box";
|
|
248
|
-
readonly ONEDRIVE: "onedrive";
|
|
249
|
-
readonly HUDDLE: "huddle";
|
|
250
|
-
readonly MOBILE_VIDEO_CAMERA: "mobile-video-camera";
|
|
251
|
-
readonly MOBILE_PHOTO_CAMERA: "mobile-photo-camera";
|
|
252
|
-
readonly LOCAL: "local";
|
|
253
|
-
readonly DROP_AREA: "drop-area";
|
|
254
|
-
readonly CAMERA: "camera";
|
|
255
|
-
readonly EXTERNAL: "external";
|
|
256
|
-
readonly API: "js-api";
|
|
257
|
-
readonly URL: "url";
|
|
258
|
-
readonly DRAW: "draw";
|
|
259
|
-
}>;
|
|
260
|
-
type SourceTypes = (typeof UploadSource)[keyof typeof UploadSource];
|
|
261
|
-
|
|
262
|
-
declare class LitUploaderBlock extends LitActivityBlock {
|
|
263
|
-
static extSrcList: Readonly<typeof ExternalUploadSource>;
|
|
264
|
-
static sourceTypes: Readonly<typeof UploadSource>;
|
|
265
|
-
protected couldBeCtxOwner: boolean;
|
|
266
|
-
private _isCtxOwner;
|
|
267
|
-
private _unobserveCollection?;
|
|
268
|
-
private _unobserveCollectionProperties?;
|
|
269
|
-
init$: {
|
|
270
|
-
'*commonProgress': number;
|
|
271
|
-
'*uploadList': never[];
|
|
272
|
-
'*uploadQueue': _uploadcare_upload_client.Queue;
|
|
273
|
-
'*collectionErrors': OutputErrorCollection[];
|
|
274
|
-
'*collectionState': OutputCollectionState | null;
|
|
275
|
-
'*groupInfo': _uploadcare_upload_client.UploadcareGroup | null;
|
|
276
|
-
'*uploadTrigger': Set<string>;
|
|
277
|
-
'*currentActivity': null;
|
|
278
|
-
'*currentActivityParams': {};
|
|
279
|
-
'*history': never[];
|
|
280
|
-
'*historyBack': null;
|
|
281
|
-
'*closeModal': () => void;
|
|
282
|
-
};
|
|
283
|
-
private get _hasCtxOwner();
|
|
284
|
-
initCallback(): void;
|
|
285
|
-
getAPI(): UploaderPublicApi;
|
|
286
|
-
get validationManager(): ValidationManager;
|
|
287
|
-
get api(): UploaderPublicApi;
|
|
288
|
-
get uploadCollection(): TypedCollection<UploadEntryData>;
|
|
289
|
-
get secureUploadsManager(): SecureUploadsManager;
|
|
290
|
-
disconnectedCallback(): void;
|
|
291
|
-
connectedCallback(): void;
|
|
292
|
-
private _initCtxOwner;
|
|
293
|
-
private _observeUploadCollection;
|
|
294
|
-
private _unobserveUploadCollection;
|
|
295
|
-
private _createGroup;
|
|
296
|
-
private _flushOutputItems;
|
|
297
|
-
private _handleCollectionUpdate;
|
|
298
|
-
private _handleCollectionPropertiesUpdate;
|
|
299
|
-
private _flushCommonUploadProgress;
|
|
300
|
-
private _openCloudImageEditor;
|
|
301
|
-
private _setInitialCrop;
|
|
302
|
-
protected getMetadataFor(entryId: string): Promise<_uploadcare_upload_client.Metadata | undefined>;
|
|
303
|
-
protected getUploadClientOptions(): Promise<FileFromOptions>;
|
|
304
|
-
getOutputData(): OutputFileEntry[];
|
|
305
|
-
}
|
|
306
|
-
|
|
307
269
|
/**
|
|
308
270
|
* Mapping of loading resources per operation
|
|
309
271
|
*/
|
|
@@ -418,11 +380,14 @@ declare global {
|
|
|
418
380
|
declare class Icon extends LitBlock {
|
|
419
381
|
name: string;
|
|
420
382
|
private _resolvedHref;
|
|
383
|
+
private _pluginSvg;
|
|
421
384
|
private _iconHrefResolver;
|
|
385
|
+
private _unsubscribePlugins?;
|
|
422
386
|
initCallback(): void;
|
|
423
387
|
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
424
388
|
private _updateResolvedHref;
|
|
425
389
|
render(): lit_html.TemplateResult<1>;
|
|
390
|
+
disconnectedCallback(): void;
|
|
426
391
|
}
|
|
427
392
|
declare global {
|
|
428
393
|
interface HTMLElementTagNameMap {
|
|
@@ -953,6 +918,7 @@ declare class CloudImageEditorBlock extends LitBlock {
|
|
|
953
918
|
private _hasNetworkProblems;
|
|
954
919
|
private _isInitialized;
|
|
955
920
|
private _pendingInitUpdate;
|
|
921
|
+
private _pendingSizeWait;
|
|
956
922
|
private readonly _debouncedShowLoader;
|
|
957
923
|
private readonly _imgRef;
|
|
958
924
|
private readonly _cropperRef;
|
|
@@ -1002,12 +968,11 @@ type ActivityParams$1 = {
|
|
|
1002
968
|
internalId: string;
|
|
1003
969
|
};
|
|
1004
970
|
declare class CloudImageEditorActivity extends LitUploaderBlock {
|
|
1005
|
-
couldBeCtxOwner: boolean;
|
|
1006
|
-
activityType: "cloud-image-edit";
|
|
1007
971
|
private _entry?;
|
|
1008
972
|
private _editorConfig;
|
|
1009
973
|
get activityParams(): ActivityParams$1;
|
|
1010
974
|
initCallback(): void;
|
|
975
|
+
disconnectedCallback(): void;
|
|
1011
976
|
private _handleApply;
|
|
1012
977
|
private _handleCancel;
|
|
1013
978
|
handleChange(event: CustomEvent<ChangeResult>): void;
|
|
@@ -1044,7 +1009,6 @@ type ActivityParams = {
|
|
|
1044
1009
|
};
|
|
1045
1010
|
declare class ExternalSource extends LitUploaderBlock {
|
|
1046
1011
|
couldBeCtxOwner: boolean;
|
|
1047
|
-
activityType: "external";
|
|
1048
1012
|
private _messageBridge?;
|
|
1049
1013
|
private _iframeRef;
|
|
1050
1014
|
private _latestSelectionSummary;
|
|
@@ -1088,22 +1052,26 @@ declare global {
|
|
|
1088
1052
|
declare const ACTIVITY_TYPES: Readonly<{
|
|
1089
1053
|
START_FROM: "start-from";
|
|
1090
1054
|
CAMERA: "camera";
|
|
1091
|
-
DRAW: "draw";
|
|
1092
1055
|
UPLOAD_LIST: "upload-list";
|
|
1093
1056
|
URL: "url";
|
|
1094
1057
|
CLOUD_IMG_EDIT: "cloud-image-edit";
|
|
1095
1058
|
EXTERNAL: "external";
|
|
1096
1059
|
}>;
|
|
1097
|
-
type RegisteredActivityType = (typeof ACTIVITY_TYPES)[keyof typeof ACTIVITY_TYPES];
|
|
1098
|
-
type ActivityType = RegisteredActivityType |
|
|
1060
|
+
type RegisteredActivityType = (typeof ACTIVITY_TYPES)[keyof typeof ACTIVITY_TYPES] | keyof CustomActivities;
|
|
1061
|
+
type ActivityType = RegisteredActivityType | null;
|
|
1099
1062
|
|
|
1100
1063
|
declare const ACTIVE_PROP = "___ACTIVITY_IS_ACTIVE___";
|
|
1064
|
+
interface CustomActivities {
|
|
1065
|
+
}
|
|
1101
1066
|
type ActivityParamsMap = {
|
|
1102
1067
|
'cloud-image-edit': ActivityParams$1;
|
|
1103
1068
|
external: ActivityParams;
|
|
1069
|
+
} & {
|
|
1070
|
+
[Key in keyof CustomActivities]: CustomActivities[Key]['params'];
|
|
1104
1071
|
};
|
|
1105
1072
|
declare class LitActivityBlock extends LitBlock {
|
|
1106
1073
|
protected historyTracked: boolean;
|
|
1074
|
+
activityType: ActivityType;
|
|
1107
1075
|
private [ACTIVE_PROP]?;
|
|
1108
1076
|
init$: {
|
|
1109
1077
|
'*currentActivity': null;
|
|
@@ -1117,12 +1085,11 @@ declare class LitActivityBlock extends LitBlock {
|
|
|
1117
1085
|
private _activate;
|
|
1118
1086
|
initCallback(): void;
|
|
1119
1087
|
private _historyFlush;
|
|
1120
|
-
|
|
1088
|
+
protected _isActivityRegistered(): boolean;
|
|
1121
1089
|
private static _activityCallbacks;
|
|
1122
1090
|
static activities: Readonly<{
|
|
1123
1091
|
START_FROM: 'start-from';
|
|
1124
1092
|
CAMERA: 'camera';
|
|
1125
|
-
DRAW: 'draw';
|
|
1126
1093
|
UPLOAD_LIST: 'upload-list';
|
|
1127
1094
|
URL: 'url';
|
|
1128
1095
|
CLOUD_IMG_EDIT: 'cloud-image-edit';
|
|
@@ -1138,8 +1105,8 @@ declare class LitActivityBlock extends LitBlock {
|
|
|
1138
1105
|
private _unregisterActivity;
|
|
1139
1106
|
disconnectedCallback(): void;
|
|
1140
1107
|
get activityParams(): ActivityParamsMap[keyof ActivityParamsMap];
|
|
1141
|
-
get initActivity():
|
|
1142
|
-
get doneActivity():
|
|
1108
|
+
get initActivity(): RegisteredActivityType | null;
|
|
1109
|
+
get doneActivity(): RegisteredActivityType | null;
|
|
1143
1110
|
historyBack(): void;
|
|
1144
1111
|
}
|
|
1145
1112
|
|
|
@@ -1201,7 +1168,9 @@ type EventPayload = {
|
|
|
1201
1168
|
declare class EventEmitter extends SharedInstance {
|
|
1202
1169
|
private _timeoutStore;
|
|
1203
1170
|
private _targets;
|
|
1171
|
+
private _listeners;
|
|
1204
1172
|
bindTarget(target: LitBlock): () => void;
|
|
1173
|
+
on<T extends EventKey>(type: T, handler: (payload: EventPayload[T]) => void): () => void;
|
|
1205
1174
|
private _dispatch;
|
|
1206
1175
|
emit<T extends EventKey, TDebounce extends boolean | number | undefined = undefined>(type: T, payload?: TDebounce extends false | undefined ? EventPayload[T] : () => EventPayload[T], options?: {
|
|
1207
1176
|
debounce?: TDebounce;
|
|
@@ -1209,20 +1178,123 @@ declare class EventEmitter extends SharedInstance {
|
|
|
1209
1178
|
destroy(): void;
|
|
1210
1179
|
}
|
|
1211
1180
|
|
|
1212
|
-
type
|
|
1213
|
-
|
|
1181
|
+
type ApiAddFileCommonOptions = {
|
|
1182
|
+
silent?: boolean;
|
|
1183
|
+
fileName?: string;
|
|
1184
|
+
source?: string;
|
|
1214
1185
|
};
|
|
1186
|
+
declare class UploaderPublicApi extends SharedInstance {
|
|
1187
|
+
private _l10n;
|
|
1188
|
+
get _uploadCollection(): TypedCollection<UploadEntryData>;
|
|
1189
|
+
get cfg(): Readonly<ConfigType>;
|
|
1190
|
+
get l10n(): (str: string, variables?: Record<string, string | number>) => string;
|
|
1191
|
+
/**
|
|
1192
|
+
* TODO: Probably we should not allow user to override `source` property
|
|
1193
|
+
*/
|
|
1194
|
+
addFileFromUrl: (url: string, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"idle">;
|
|
1195
|
+
addFileFromUuid: (uuid: string, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"idle">;
|
|
1196
|
+
addFileFromCdnUrl: (cdnUrl: string, { silent, fileName, source }?: ApiAddFileCommonOptions) => OutputFileEntry<"idle">;
|
|
1197
|
+
addFileFromObject: (file: File, { silent, fileName, source, fullPath, }?: ApiAddFileCommonOptions & {
|
|
1198
|
+
fullPath?: string;
|
|
1199
|
+
}) => OutputFileEntry<"idle">;
|
|
1200
|
+
removeFileByInternalId: (internalId: string) => void;
|
|
1201
|
+
removeAllFiles(): void;
|
|
1202
|
+
uploadAll: () => void;
|
|
1203
|
+
openSystemDialog: (options?: {
|
|
1204
|
+
captureCamera?: boolean;
|
|
1205
|
+
modeCamera?: ModeCameraType;
|
|
1206
|
+
}) => void;
|
|
1207
|
+
getOutputItem<TStatus extends OutputFileStatus>(entryId: string): OutputFileEntry<TStatus>;
|
|
1208
|
+
getOutputCollectionState<TStatus extends OutputCollectionStatus>(): ReturnType<typeof buildOutputCollectionState<TStatus>>;
|
|
1209
|
+
initFlow: (force?: boolean) => void;
|
|
1210
|
+
doneFlow: () => void;
|
|
1211
|
+
private _pluginsReady;
|
|
1212
|
+
setCurrentActivity: <T extends ActivityType>(activityType: T, ...params: T extends keyof ActivityParamsMap ? [ActivityParamsMap[T]] extends [never] ? [] : [ActivityParamsMap[T]] : []) => void;
|
|
1213
|
+
on: <T extends EventKey>(type: T, handler: (payload: EventPayload[T]) => void) => (() => void);
|
|
1214
|
+
getCurrentActivity: () => ActivityType;
|
|
1215
|
+
historyBack: () => void;
|
|
1216
|
+
setModalState: (opened: boolean) => void;
|
|
1217
|
+
private get _sourceList();
|
|
1218
|
+
}
|
|
1215
1219
|
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1220
|
+
declare const ExternalUploadSource: Readonly<{
|
|
1221
|
+
readonly FACEBOOK: "facebook";
|
|
1222
|
+
readonly DROPBOX: "dropbox";
|
|
1223
|
+
readonly DROPBOX_CHOOSER: "dropboxchooser";
|
|
1224
|
+
readonly GDRIVE: "gdrive";
|
|
1225
|
+
readonly GPHOTOS: "gphotos";
|
|
1226
|
+
readonly FLICKR: "flickr";
|
|
1227
|
+
readonly VK: "vk";
|
|
1228
|
+
readonly EVERNOTE: "evernote";
|
|
1229
|
+
readonly BOX: "box";
|
|
1230
|
+
readonly ONEDRIVE: "onedrive";
|
|
1231
|
+
readonly HUDDLE: "huddle";
|
|
1232
|
+
}>;
|
|
1233
|
+
declare const UploadSource: Readonly<{
|
|
1234
|
+
readonly FACEBOOK: "facebook";
|
|
1235
|
+
readonly DROPBOX: "dropbox";
|
|
1236
|
+
readonly DROPBOX_CHOOSER: "dropboxchooser";
|
|
1237
|
+
readonly GDRIVE: "gdrive";
|
|
1238
|
+
readonly GPHOTOS: "gphotos";
|
|
1239
|
+
readonly FLICKR: "flickr";
|
|
1240
|
+
readonly VK: "vk";
|
|
1241
|
+
readonly EVERNOTE: "evernote";
|
|
1242
|
+
readonly BOX: "box";
|
|
1243
|
+
readonly ONEDRIVE: "onedrive";
|
|
1244
|
+
readonly HUDDLE: "huddle";
|
|
1245
|
+
readonly MOBILE_VIDEO_CAMERA: "mobile-video-camera";
|
|
1246
|
+
readonly MOBILE_PHOTO_CAMERA: "mobile-photo-camera";
|
|
1247
|
+
readonly LOCAL: "local";
|
|
1248
|
+
readonly DROP_AREA: "drop-area";
|
|
1249
|
+
readonly CAMERA: "camera";
|
|
1250
|
+
readonly EXTERNAL: "external";
|
|
1251
|
+
readonly API: "js-api";
|
|
1252
|
+
readonly URL: "url";
|
|
1253
|
+
}>;
|
|
1254
|
+
type SourceTypes = (typeof UploadSource)[keyof typeof UploadSource];
|
|
1255
|
+
|
|
1256
|
+
declare class LitUploaderBlock extends LitActivityBlock {
|
|
1257
|
+
static extSrcList: Readonly<typeof ExternalUploadSource>;
|
|
1258
|
+
static sourceTypes: Readonly<typeof UploadSource>;
|
|
1259
|
+
protected couldBeCtxOwner: boolean;
|
|
1260
|
+
private _isCtxOwner;
|
|
1261
|
+
private _unobserveCollection?;
|
|
1262
|
+
private _unobserveCollectionProperties?;
|
|
1263
|
+
init$: {
|
|
1264
|
+
'*commonProgress': number;
|
|
1265
|
+
'*uploadList': never[];
|
|
1266
|
+
'*uploadQueue': _uploadcare_upload_client.Queue;
|
|
1267
|
+
'*collectionErrors': OutputErrorCollection[];
|
|
1268
|
+
'*collectionState': OutputCollectionState | null;
|
|
1269
|
+
'*groupInfo': _uploadcare_upload_client.UploadcareGroup | null;
|
|
1270
|
+
'*uploadTrigger': Set<string>;
|
|
1271
|
+
'*currentActivity': null;
|
|
1272
|
+
'*currentActivityParams': {};
|
|
1273
|
+
'*history': never[];
|
|
1274
|
+
'*historyBack': null;
|
|
1275
|
+
'*closeModal': () => void;
|
|
1276
|
+
};
|
|
1277
|
+
private get _hasCtxOwner();
|
|
1278
|
+
initCallback(): void;
|
|
1279
|
+
getAPI(): UploaderPublicApi;
|
|
1280
|
+
get validationManager(): ValidationManager;
|
|
1281
|
+
get api(): UploaderPublicApi;
|
|
1282
|
+
get uploadCollection(): TypedCollection<UploadEntryData>;
|
|
1283
|
+
get secureUploadsManager(): SecureUploadsManager;
|
|
1284
|
+
disconnectedCallback(): void;
|
|
1285
|
+
connectedCallback(): void;
|
|
1286
|
+
private _initCtxOwner;
|
|
1287
|
+
private _observeUploadCollection;
|
|
1288
|
+
private _unobserveUploadCollection;
|
|
1289
|
+
private _createGroup;
|
|
1290
|
+
private _flushOutputItems;
|
|
1291
|
+
private _handleCollectionUpdate;
|
|
1292
|
+
private _handleCollectionPropertiesUpdate;
|
|
1293
|
+
private _flushCommonUploadProgress;
|
|
1294
|
+
private _setInitialCrop;
|
|
1295
|
+
protected getMetadataFor(entryId: string): Promise<_uploadcare_upload_client.Metadata | undefined>;
|
|
1296
|
+
protected getUploadClientOptions(): Promise<FileFromOptions>;
|
|
1297
|
+
getOutputData(): OutputFileEntry[];
|
|
1226
1298
|
}
|
|
1227
1299
|
|
|
1228
1300
|
type SelectOption = {
|
|
@@ -1245,7 +1317,6 @@ declare global {
|
|
|
1245
1317
|
type CameraMode = 'photo' | 'video';
|
|
1246
1318
|
declare class CameraSource extends LitUploaderBlock {
|
|
1247
1319
|
couldBeCtxOwner: boolean;
|
|
1248
|
-
activityType: "camera";
|
|
1249
1320
|
private _unsubPermissions;
|
|
1250
1321
|
private _capturing;
|
|
1251
1322
|
private _chunks;
|
|
@@ -1267,7 +1338,6 @@ declare class CameraSource extends LitUploaderBlock {
|
|
|
1267
1338
|
private _timerRef;
|
|
1268
1339
|
private _lineRef;
|
|
1269
1340
|
private _videoRef;
|
|
1270
|
-
private _switcherRef;
|
|
1271
1341
|
private _startTime;
|
|
1272
1342
|
private _elapsedTime;
|
|
1273
1343
|
private _videoTransformCss;
|
|
@@ -1365,25 +1435,54 @@ declare global {
|
|
|
1365
1435
|
/**
|
|
1366
1436
|
* Config keys that can't be passed as attribute (because they are object or function)
|
|
1367
1437
|
*/
|
|
1368
|
-
declare const complexConfigKeys: readonly ["metadata", "localeDefinitionOverride", "secureUploadsSignatureResolver", "secureDeliveryProxyUrlResolver", "iconHrefResolver", "fileValidators", "collectionValidators", "mediaRecorderOptions"
|
|
1369
|
-
/** Mapping of attribute names to state */
|
|
1370
|
-
declare const attrStateMapping: Record<string, string>;
|
|
1438
|
+
declare const complexConfigKeys: readonly ["metadata", "plugins", "localeDefinitionOverride", "secureUploadsSignatureResolver", "secureDeliveryProxyUrlResolver", "iconHrefResolver", "fileValidators", "collectionValidators", "mediaRecorderOptions"];
|
|
1371
1439
|
declare class Config extends LitBlock {
|
|
1372
1440
|
attributesMeta: Partial<ConfigPlainType> & {
|
|
1373
1441
|
'ctx-name': string;
|
|
1374
1442
|
};
|
|
1375
1443
|
init$: LitBlock["init$"] & ConfigType;
|
|
1376
1444
|
private _computationControllers;
|
|
1445
|
+
private _pluginChangeUnsubscribe?;
|
|
1446
|
+
private _mutationObserver?;
|
|
1447
|
+
/**
|
|
1448
|
+
* Mapping of attribute names to custom config keys for plugin-registered configs.
|
|
1449
|
+
* Updated dynamically when plugins are registered or changed.
|
|
1450
|
+
* Similar to builtinAttrKeyMapping but for custom configs.
|
|
1451
|
+
*/
|
|
1452
|
+
private _customAttrKeyMapping;
|
|
1453
|
+
/** Set of all custom config names registered by plugins */
|
|
1454
|
+
private _customConfigKeys;
|
|
1455
|
+
/**
|
|
1456
|
+
* Map of custom config subscriptions (config name -> unsubscribe function)
|
|
1457
|
+
* Used to track and clean up subscriptions when plugins change
|
|
1458
|
+
*/
|
|
1459
|
+
private _customConfigSubscriptions;
|
|
1460
|
+
/**
|
|
1461
|
+
* Check if a key is a custom config (registered by plugins)
|
|
1462
|
+
*/
|
|
1463
|
+
private _isCustomConfig;
|
|
1464
|
+
/**
|
|
1465
|
+
* Get the custom config definition for a key
|
|
1466
|
+
*/
|
|
1467
|
+
private _getCustomConfigDefinition;
|
|
1468
|
+
/**
|
|
1469
|
+
* Get attribute names for a config key (kebab-case and lowercase)
|
|
1470
|
+
*/
|
|
1471
|
+
private _getAttributeNames;
|
|
1377
1472
|
private _flushValueToAttribute;
|
|
1378
1473
|
private _flushValueToState;
|
|
1379
1474
|
private _setValue;
|
|
1380
1475
|
private _getValue;
|
|
1381
1476
|
private _assertSameValueDifferentReference;
|
|
1477
|
+
private _processCustomConfigs;
|
|
1478
|
+
private _setupCustomConfigs;
|
|
1479
|
+
private _setupMutationObserver;
|
|
1382
1480
|
initCallback(): void;
|
|
1383
|
-
attributeChangedCallback(name:
|
|
1481
|
+
attributeChangedCallback(name: string, oldVal: string, newVal: string): void;
|
|
1482
|
+
disconnectedCallback(): void;
|
|
1384
1483
|
static get observedAttributes(): string[];
|
|
1385
1484
|
}
|
|
1386
|
-
interface Config extends ConfigType {
|
|
1485
|
+
interface Config extends ConfigType, CustomConfig {
|
|
1387
1486
|
}
|
|
1388
1487
|
declare global {
|
|
1389
1488
|
interface HTMLElementTagNameMap {
|
|
@@ -1453,6 +1552,21 @@ declare global {
|
|
|
1453
1552
|
}
|
|
1454
1553
|
}
|
|
1455
1554
|
|
|
1555
|
+
declare class FileActionButton extends LitUploaderBlock {
|
|
1556
|
+
static styleAttrs: string[];
|
|
1557
|
+
uploading: boolean;
|
|
1558
|
+
failed: boolean;
|
|
1559
|
+
success: boolean;
|
|
1560
|
+
idle: boolean;
|
|
1561
|
+
private _handleRemove;
|
|
1562
|
+
render(): lit_html.TemplateResult<1>;
|
|
1563
|
+
}
|
|
1564
|
+
declare global {
|
|
1565
|
+
interface HTMLElementTagNameMap {
|
|
1566
|
+
'uc-file-action-button': FileActionButton;
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1456
1570
|
declare class FileItem extends FileItemConfig {
|
|
1457
1571
|
protected couldBeCtxOwner: boolean;
|
|
1458
1572
|
private _pauseRender;
|
|
@@ -1467,12 +1581,12 @@ declare class FileItem extends FileItemConfig {
|
|
|
1467
1581
|
private _isFailed;
|
|
1468
1582
|
private _isUploading;
|
|
1469
1583
|
private _isFocused;
|
|
1470
|
-
private _isEditable;
|
|
1471
1584
|
private _showFileNames;
|
|
1472
1585
|
private _ariaLabelStatusFile;
|
|
1586
|
+
private _pluginFileActions;
|
|
1473
1587
|
private _renderedOnce;
|
|
1474
1588
|
private _observer?;
|
|
1475
|
-
private
|
|
1589
|
+
private _unsubscribePlugins?;
|
|
1476
1590
|
private _handleRemove;
|
|
1477
1591
|
private _handleUploadClick;
|
|
1478
1592
|
private _calculateState;
|
|
@@ -1484,6 +1598,8 @@ declare class FileItem extends FileItemConfig {
|
|
|
1484
1598
|
private _handleEntryId;
|
|
1485
1599
|
private _updateShowFileNames;
|
|
1486
1600
|
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
1601
|
+
private _updatePluginFileActions;
|
|
1602
|
+
private _handlePluginFileAction;
|
|
1487
1603
|
initCallback(): void;
|
|
1488
1604
|
connectedCallback(): void;
|
|
1489
1605
|
disconnectedCallback(): void;
|
|
@@ -1580,67 +1696,115 @@ declare global {
|
|
|
1580
1696
|
}
|
|
1581
1697
|
}
|
|
1582
1698
|
|
|
1699
|
+
type SourceButtonConfig = {
|
|
1700
|
+
id: string;
|
|
1701
|
+
label: string;
|
|
1702
|
+
icon?: string;
|
|
1703
|
+
onClick: () => void | Promise<void>;
|
|
1704
|
+
};
|
|
1583
1705
|
declare class SourceBtn extends LitUploaderBlock {
|
|
1584
1706
|
couldBeCtxOwner: boolean;
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1707
|
+
source?: SourceButtonConfig;
|
|
1708
|
+
textOnly: boolean;
|
|
1709
|
+
iconOnly: boolean;
|
|
1588
1710
|
private _iconName;
|
|
1589
1711
|
private _srcTypeKey;
|
|
1590
|
-
private _initTypes;
|
|
1591
|
-
initCallback(): void;
|
|
1592
|
-
private _registerType;
|
|
1593
|
-
activate(): void;
|
|
1594
|
-
private _applyType;
|
|
1595
1712
|
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
1713
|
+
private _applySource;
|
|
1714
|
+
activate(): void;
|
|
1596
1715
|
render(): lit_html.TemplateResult<1>;
|
|
1597
1716
|
}
|
|
1598
1717
|
declare global {
|
|
1599
1718
|
interface HTMLElementTagNameMap {
|
|
1600
|
-
'uc-source-btn': SourceBtn;
|
|
1719
|
+
'uc-source-btn': SourceBtn;
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
declare class PrimaryAction extends LitUploaderBlock {
|
|
1724
|
+
static styleAttrs: string[];
|
|
1725
|
+
private static readonly SOURCE_TEXT_CONFIG;
|
|
1726
|
+
source: SourceButtonConfig | null;
|
|
1727
|
+
entries: OutputCollectionState<OutputCollectionStatus, 'maybe-has-group'>;
|
|
1728
|
+
private showIcon;
|
|
1729
|
+
private _isMultiple;
|
|
1730
|
+
initCallback(): void;
|
|
1731
|
+
private get hasEntries();
|
|
1732
|
+
private get hasSingleSuccessImage();
|
|
1733
|
+
private get hasMultipleEntries();
|
|
1734
|
+
private get localizedSourceLabel();
|
|
1735
|
+
private _translate;
|
|
1736
|
+
private get textBasedOnLocale();
|
|
1737
|
+
private _headerTextDependentOnEntries;
|
|
1738
|
+
private _getSourceLabelText;
|
|
1739
|
+
private _handleClick;
|
|
1740
|
+
private _renderThumbnail;
|
|
1741
|
+
protected render(): lit_html.TemplateResult<1>;
|
|
1742
|
+
}
|
|
1743
|
+
declare global {
|
|
1744
|
+
interface HTMLElementTagNameMap {
|
|
1745
|
+
'uc-primary-action': PrimaryAction;
|
|
1601
1746
|
}
|
|
1602
1747
|
}
|
|
1603
1748
|
|
|
1604
|
-
declare class
|
|
1749
|
+
declare class DropDown extends LitBlock {
|
|
1750
|
+
static styleAttrs: string[];
|
|
1605
1751
|
private _id;
|
|
1606
1752
|
private readonly _handleContentClick;
|
|
1607
|
-
|
|
1753
|
+
render(): lit_html.TemplateResult<1>;
|
|
1608
1754
|
}
|
|
1609
1755
|
declare global {
|
|
1610
1756
|
interface HTMLElementTagNameMap {
|
|
1611
|
-
'uc-
|
|
1757
|
+
'uc-drop-down': DropDown;
|
|
1612
1758
|
}
|
|
1613
1759
|
}
|
|
1614
1760
|
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1761
|
+
declare class NoWrapModeSmartBtn extends LitUploaderBlock {
|
|
1762
|
+
static styleAttrs: string[];
|
|
1763
|
+
}
|
|
1764
|
+
declare global {
|
|
1765
|
+
interface HTMLElementTagNameMap {
|
|
1766
|
+
'uc-no-wrap-mode-smart-btn': NoWrapModeSmartBtn;
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
type SmartButtonMode = 'auto' | 'menu' | 'toolbar' | 'compact';
|
|
1620
1771
|
declare class SmartBtn extends LitUploaderBlock {
|
|
1621
1772
|
static styleAttrs: string[];
|
|
1622
1773
|
couldBeCtxOwner: boolean;
|
|
1774
|
+
private _unregisterAfterFileAddHook?;
|
|
1623
1775
|
dropzone: boolean;
|
|
1624
|
-
private
|
|
1776
|
+
private _mode;
|
|
1777
|
+
private _sources;
|
|
1625
1778
|
private _status;
|
|
1626
|
-
private
|
|
1627
|
-
private
|
|
1628
|
-
private
|
|
1629
|
-
private _progressPercent;
|
|
1630
|
-
private _progressFading;
|
|
1631
|
-
private _progressFadeTimer;
|
|
1632
|
-
private _showDropdown;
|
|
1779
|
+
private _mainAndRemainSources;
|
|
1780
|
+
private _collection;
|
|
1781
|
+
private _progress;
|
|
1633
1782
|
private get isIdle();
|
|
1634
|
-
private get
|
|
1783
|
+
private get isSuccess();
|
|
1784
|
+
private get isFailed();
|
|
1785
|
+
private get isUploading();
|
|
1786
|
+
private get isCollapsedMode();
|
|
1787
|
+
private get shouldShowPrimaryAction();
|
|
1788
|
+
private get shouldShowInline();
|
|
1789
|
+
private get shouldShowDropdown();
|
|
1790
|
+
private get hasCollectionEntries();
|
|
1791
|
+
private get shouldShowAbortAction();
|
|
1635
1792
|
private _throttledHandleCollectionUpdate;
|
|
1636
1793
|
private _updateButtonBasedOnCollectionState;
|
|
1637
|
-
private
|
|
1638
|
-
private _startProgressFade;
|
|
1639
|
-
disconnectedCallback(): void;
|
|
1640
|
-
private _removeEntries;
|
|
1794
|
+
private _updateSourceSplit;
|
|
1641
1795
|
initCallback(): void;
|
|
1642
|
-
|
|
1643
|
-
private
|
|
1796
|
+
disconnectedCallback(): void;
|
|
1797
|
+
private _renderInline;
|
|
1798
|
+
private _getDropdownIconName;
|
|
1799
|
+
private _clearAllEntries;
|
|
1800
|
+
private _clearAllFailedEntries;
|
|
1801
|
+
private _abortAllEntries;
|
|
1802
|
+
private _handleRemove;
|
|
1803
|
+
private _renderDropdown;
|
|
1804
|
+
private _renderPrimaryAction;
|
|
1805
|
+
private _renderAbortAction;
|
|
1806
|
+
private _getInnerClassMap;
|
|
1807
|
+
private _renderVisualDropArea;
|
|
1644
1808
|
render(): lit_html.TemplateResult<1>;
|
|
1645
1809
|
}
|
|
1646
1810
|
declare global {
|
|
@@ -1861,6 +2025,10 @@ type ConfigType = {
|
|
|
1861
2025
|
* Expiry threshold for secure uploads.
|
|
1862
2026
|
*/
|
|
1863
2027
|
secureUploadsExpireThreshold: number;
|
|
2028
|
+
/**
|
|
2029
|
+
* Array of plugins to register with the uploader instance.
|
|
2030
|
+
*/
|
|
2031
|
+
plugins: UploaderPlugin[];
|
|
1864
2032
|
/**
|
|
1865
2033
|
* Metadata for the file.
|
|
1866
2034
|
*/
|
|
@@ -1946,7 +2114,8 @@ type ConfigType = {
|
|
|
1946
2114
|
* Define the clipboard paste scope.
|
|
1947
2115
|
*/
|
|
1948
2116
|
pasteScope: PasteScope;
|
|
1949
|
-
|
|
2117
|
+
smartButtonViewMode: SmartButtonMode;
|
|
2118
|
+
smartButtonShowFirstIcon: boolean;
|
|
1950
2119
|
};
|
|
1951
2120
|
type ConfigComplexType = Pick<ConfigType, (typeof complexConfigKeys)[number]>;
|
|
1952
2121
|
type ConfigPlainType = Omit<ConfigType, keyof ConfigComplexType>;
|
|
@@ -2122,10 +2291,237 @@ type OutputCollectionState<TStatus extends OutputCollectionStatus = OutputCollec
|
|
|
2122
2291
|
allEntries: OutputFileEntry[];
|
|
2123
2292
|
});
|
|
2124
2293
|
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2294
|
+
type PluginIconRegistration = {
|
|
2295
|
+
name: string;
|
|
2296
|
+
svg: string;
|
|
2297
|
+
};
|
|
2298
|
+
type PluginL10nRegistration = Record<string, Record<string, string>>;
|
|
2299
|
+
type PluginSourceRegistration = {
|
|
2300
|
+
id: string;
|
|
2301
|
+
label: string;
|
|
2302
|
+
icon?: string;
|
|
2303
|
+
/**
|
|
2304
|
+
* @internal
|
|
2305
|
+
*
|
|
2306
|
+
* Optional expansion function. When present, SourceList calls this to determine
|
|
2307
|
+
* which source IDs should actually be rendered in place of this source.
|
|
2308
|
+
* Useful for sources that map to multiple device-specific variants (e.g. camera
|
|
2309
|
+
* expanding to separate photo/video buttons on mobile).
|
|
2310
|
+
* Return `[id]` (the source's own id) to render it as-is.
|
|
2311
|
+
*/
|
|
2312
|
+
expand?: () => string[];
|
|
2313
|
+
onSelect: () => Promise<void> | void;
|
|
2314
|
+
};
|
|
2315
|
+
type PluginRenderDispose = () => void;
|
|
2316
|
+
type PluginRender = (el: HTMLElement, activityParams: Record<string, unknown>) => PluginRenderDispose | undefined;
|
|
2317
|
+
type PluginActivityRegistration = {
|
|
2318
|
+
id: string;
|
|
2319
|
+
render: PluginRender;
|
|
2320
|
+
};
|
|
2321
|
+
type PluginFileActionRegistration = {
|
|
2322
|
+
/** Unique action identifier. */
|
|
2323
|
+
id: string;
|
|
2324
|
+
/** Icon name to display in the action button. */
|
|
2325
|
+
icon: string;
|
|
2326
|
+
/** Label shown next to the icon in the action button. Accepts a plain string or an l10n key registered via `registerL10n`. */
|
|
2327
|
+
label: string;
|
|
2328
|
+
/** Return `true` to show the action button for the given file entry. */
|
|
2329
|
+
shouldRender: (fileEntry: OutputFileEntry) => boolean;
|
|
2330
|
+
onClick: (fileEntry: OutputFileEntry) => void | Promise<void>;
|
|
2331
|
+
};
|
|
2332
|
+
type PluginFileHookResult = {
|
|
2333
|
+
/** The (optionally transformed) file */
|
|
2334
|
+
file: File | Blob;
|
|
2335
|
+
};
|
|
2336
|
+
type PluginFileHookContext = PluginFileHookResult & {
|
|
2337
|
+
/**
|
|
2338
|
+
* An AbortSignal that fires when the operation is cancelled (e.g. upload aborted or file removed).
|
|
2339
|
+
* Hooks should respect this signal to avoid doing unnecessary work.
|
|
2340
|
+
*/
|
|
2341
|
+
signal: AbortSignal;
|
|
2342
|
+
};
|
|
2343
|
+
type PluginFileHookRegistration = {
|
|
2344
|
+
/**
|
|
2345
|
+
* When the hook is called:
|
|
2346
|
+
* - `'beforeUpload'`: called right before the file is uploaded.
|
|
2347
|
+
* - `'onAdd'`: called after the file is added to the upload list.
|
|
2348
|
+
*
|
|
2349
|
+
* Return the (optionally transformed) file. After the hook runs, `mimeType`,
|
|
2350
|
+
* `isImage`, `fileSize`, and `fileName` are all re-derived from the returned file.
|
|
2351
|
+
*/
|
|
2352
|
+
type: 'beforeUpload' | 'onAdd';
|
|
2353
|
+
handler: (context: PluginFileHookContext) => PluginFileHookResult | Promise<PluginFileHookResult>;
|
|
2354
|
+
/**
|
|
2355
|
+
* Maximum time in milliseconds to wait for the hook to complete before skipping it.
|
|
2356
|
+
* @default 30000
|
|
2357
|
+
*/
|
|
2358
|
+
timeout?: number;
|
|
2359
|
+
};
|
|
2360
|
+
type PluginRegistryApi = {
|
|
2361
|
+
registerSource: (source: PluginSourceRegistration) => void;
|
|
2362
|
+
registerActivity: (activity: PluginActivityRegistration) => void;
|
|
2363
|
+
registerFileAction: (fileAction: PluginFileActionRegistration) => void;
|
|
2364
|
+
registerFileHook: (hook: PluginFileHookRegistration) => void;
|
|
2365
|
+
registerIcon: (icon: PluginIconRegistration) => void;
|
|
2366
|
+
registerL10n: (l10n: PluginL10nRegistration) => void;
|
|
2367
|
+
registerConfig: <T = unknown>(definition: CustomConfigDefinition<T>) => void;
|
|
2368
|
+
};
|
|
2369
|
+
/**
|
|
2370
|
+
* API for managing plugin config subscriptions
|
|
2371
|
+
*/
|
|
2372
|
+
type PluginConfigApi = {
|
|
2373
|
+
get: <TKey extends keyof (ConfigType & CustomConfig)>(configName: TKey) => (ConfigType & CustomConfig)[TKey];
|
|
2374
|
+
subscribe: <TKey extends keyof (ConfigType & CustomConfig)>(configName: TKey, callback: (value: (ConfigType & CustomConfig)[TKey]) => void) => () => void;
|
|
2375
|
+
};
|
|
2376
|
+
/**
|
|
2377
|
+
* API for managing plugin activity interactions
|
|
2378
|
+
*/
|
|
2379
|
+
type PluginActivityApi = {
|
|
2380
|
+
/**
|
|
2381
|
+
* Get the current activity parameters.
|
|
2382
|
+
*
|
|
2383
|
+
* @returns The current activity parameters object
|
|
2384
|
+
*
|
|
2385
|
+
* @example
|
|
2386
|
+
* ```typescript
|
|
2387
|
+
* const params = pluginApi.activity.getParams();
|
|
2388
|
+
* console.log('Current params:', params);
|
|
2389
|
+
* ```
|
|
2390
|
+
*/
|
|
2391
|
+
getParams: () => Record<string, unknown>;
|
|
2392
|
+
/**
|
|
2393
|
+
* Subscribe to changes in activity parameters.
|
|
2394
|
+
* The callback will be called immediately with the current params,
|
|
2395
|
+
* and then whenever the params change.
|
|
2396
|
+
*
|
|
2397
|
+
* Subscriptions are automatically cleaned up when the plugin is disposed.
|
|
2398
|
+
*
|
|
2399
|
+
* @param callback - Function to call with the new params
|
|
2400
|
+
* @returns Unsubscribe function
|
|
2401
|
+
*
|
|
2402
|
+
* @example
|
|
2403
|
+
* ```typescript
|
|
2404
|
+
* pluginApi.activity.subscribeToParams((params) => {
|
|
2405
|
+
* console.log('Activity params changed:', params);
|
|
2406
|
+
* });
|
|
2407
|
+
* // Cleanup happens automatically on plugin disposal
|
|
2408
|
+
* ```
|
|
2409
|
+
*/
|
|
2410
|
+
subscribeToParams: (callback: (params: Record<string, unknown>) => void) => () => void;
|
|
2411
|
+
};
|
|
2412
|
+
type PluginFileEntryUpdate = {
|
|
2413
|
+
file?: File | Blob;
|
|
2414
|
+
cdnUrl?: string | null;
|
|
2415
|
+
cdnUrlModifiers?: string | null;
|
|
2416
|
+
mimeType?: string | null;
|
|
2417
|
+
};
|
|
2418
|
+
type PluginFilesApi = {
|
|
2419
|
+
/**
|
|
2420
|
+
* Update mutable properties of a file entry by its internalId.
|
|
2421
|
+
* `fileSize` is recalculated automatically when `file` is provided.
|
|
2422
|
+
*/
|
|
2423
|
+
update: (internalId: string, changes: PluginFileEntryUpdate) => void;
|
|
2424
|
+
};
|
|
2425
|
+
type PluginApi = {
|
|
2426
|
+
registry: PluginRegistryApi;
|
|
2427
|
+
config: PluginConfigApi;
|
|
2428
|
+
activity: PluginActivityApi;
|
|
2429
|
+
files: PluginFilesApi;
|
|
2430
|
+
};
|
|
2431
|
+
type PluginUploaderApi = UploaderPublicApi;
|
|
2432
|
+
type PluginSetupResult = (() => void) | void | Promise<(() => void) | void>;
|
|
2433
|
+
type PluginSetupParams = {
|
|
2434
|
+
pluginApi: PluginApi;
|
|
2435
|
+
uploaderApi: PluginUploaderApi;
|
|
2436
|
+
};
|
|
2437
|
+
type UploaderPlugin = {
|
|
2438
|
+
id: string;
|
|
2439
|
+
setup: (params: PluginSetupParams) => PluginSetupResult;
|
|
2440
|
+
};
|
|
2441
|
+
type Owned<T> = T & {
|
|
2442
|
+
pluginId: string;
|
|
2443
|
+
};
|
|
2444
|
+
type PluginRegistrySnapshot = {
|
|
2445
|
+
sources: Owned<PluginSourceRegistration>[];
|
|
2446
|
+
activities: Owned<PluginActivityRegistration>[];
|
|
2447
|
+
fileActions: Owned<PluginFileActionRegistration>[];
|
|
2448
|
+
fileHooks: Owned<PluginFileHookRegistration>[];
|
|
2449
|
+
icons: Owned<PluginIconRegistration>[];
|
|
2450
|
+
l10n: Owned<PluginL10nRegistration>[];
|
|
2451
|
+
};
|
|
2452
|
+
|
|
2453
|
+
type EventMap = {
|
|
2454
|
+
[T in keyof EventPayload]: CustomEvent<EventPayload[T]>;
|
|
2455
|
+
};
|
|
2456
|
+
|
|
2457
|
+
interface UploadEntryData extends Record<string, unknown> {
|
|
2458
|
+
file: File | null;
|
|
2459
|
+
externalUrl: string | null;
|
|
2460
|
+
fileName: string | null;
|
|
2461
|
+
fileSize: number | null;
|
|
2462
|
+
lastModified: number;
|
|
2463
|
+
uploadProgress: number;
|
|
2464
|
+
uuid: string | null;
|
|
2465
|
+
isImage: boolean;
|
|
2466
|
+
mimeType: string | null;
|
|
2467
|
+
ctxName: string | null;
|
|
2468
|
+
cdnUrl: string | null;
|
|
2469
|
+
cdnUrlModifiers: string | null;
|
|
2470
|
+
fileInfo: UploadcareFile | null;
|
|
2471
|
+
isUploading: boolean;
|
|
2472
|
+
abortController: AbortController | null;
|
|
2473
|
+
thumbUrl: string | null;
|
|
2474
|
+
silent: boolean;
|
|
2475
|
+
source: string | null;
|
|
2476
|
+
fullPath: string | null;
|
|
2477
|
+
metadata: Metadata | null;
|
|
2478
|
+
errors: OutputErrorFile[];
|
|
2479
|
+
uploadError: Error | null;
|
|
2480
|
+
isRemoved: boolean;
|
|
2481
|
+
isQueuedForUploading: boolean;
|
|
2482
|
+
isValidationPending: boolean;
|
|
2483
|
+
isQueuedForValidation: boolean;
|
|
2484
|
+
}
|
|
2485
|
+
type UploadEntryTypedData = TypedData<UploadEntryData>;
|
|
2486
|
+
type UploadEntryKeys = keyof UploadEntryData;
|
|
2487
|
+
|
|
2488
|
+
declare class PluginRegistry {
|
|
2489
|
+
private _sources;
|
|
2490
|
+
private _activities;
|
|
2491
|
+
private _fileActions;
|
|
2492
|
+
private _fileHooks;
|
|
2493
|
+
private _icons;
|
|
2494
|
+
private _l10n;
|
|
2495
|
+
readonly config: CustomConfigRegistry;
|
|
2496
|
+
private _own;
|
|
2497
|
+
addSource(pluginId: string, item: PluginSourceRegistration): void;
|
|
2498
|
+
addActivity(pluginId: string, item: PluginActivityRegistration): void;
|
|
2499
|
+
addFileAction(pluginId: string, item: PluginFileActionRegistration): void;
|
|
2500
|
+
addFileHook(pluginId: string, item: PluginFileHookRegistration): void;
|
|
2501
|
+
addIcon(pluginId: string, item: PluginIconRegistration): void;
|
|
2502
|
+
addL10n(pluginId: string, item: PluginL10nRegistration): void;
|
|
2503
|
+
addConfig<T>(pluginId: string, definition: CustomConfigDefinition<T>): void;
|
|
2504
|
+
purge(pluginId: string): void;
|
|
2505
|
+
snapshot(): PluginRegistrySnapshot;
|
|
2506
|
+
}
|
|
2507
|
+
|
|
2508
|
+
declare class PluginManager extends SharedInstance {
|
|
2509
|
+
private _plugins;
|
|
2510
|
+
private _subscribers;
|
|
2511
|
+
private _pluginsUpdate;
|
|
2512
|
+
private _lazyPluginLoader;
|
|
2513
|
+
readonly registry: PluginRegistry;
|
|
2514
|
+
get configRegistry(): CustomConfigRegistry;
|
|
2515
|
+
constructor(sharedInstancesBag: SharedInstancesBag);
|
|
2516
|
+
pluginsReady(): Promise<void>;
|
|
2517
|
+
onPluginsChange(callback: Unsubscriber): Unsubscriber;
|
|
2518
|
+
private _syncPlugins;
|
|
2519
|
+
private _registerPlugin;
|
|
2520
|
+
private _unregisterPlugin;
|
|
2521
|
+
snapshot(): PluginRegistrySnapshot;
|
|
2522
|
+
runOnAddHooks(entry: UploadEntryTypedData): Promise<void>;
|
|
2128
2523
|
destroy(): void;
|
|
2524
|
+
private _notifySubscribers;
|
|
2129
2525
|
}
|
|
2130
2526
|
|
|
2131
2527
|
type CommonEventType = InternalEventKey | EventKey;
|
|
@@ -2166,14 +2562,90 @@ declare class TelemetryManager extends SharedInstance {
|
|
|
2166
2562
|
private get _location();
|
|
2167
2563
|
}
|
|
2168
2564
|
|
|
2565
|
+
interface ISharedInstance {
|
|
2566
|
+
destroy?(): void;
|
|
2567
|
+
}
|
|
2568
|
+
declare class SharedInstance {
|
|
2569
|
+
protected _ctx: PubSub<SharedState>;
|
|
2570
|
+
protected _sharedInstancesBag: SharedInstancesBag;
|
|
2571
|
+
private _subscriptions;
|
|
2572
|
+
private _cfgProxy;
|
|
2573
|
+
protected _debugPrint: (...args: unknown[]) => void;
|
|
2574
|
+
constructor(sharedInstancesBag: SharedInstancesBag);
|
|
2575
|
+
protected addSub(unsub: () => void): void;
|
|
2576
|
+
protected get _cfg(): Readonly<ConfigType>;
|
|
2577
|
+
destroy(): void;
|
|
2578
|
+
}
|
|
2579
|
+
declare const instanceKeyMap: {
|
|
2580
|
+
modalManager: "*modalManager";
|
|
2581
|
+
pluginManager: "*pluginManager";
|
|
2582
|
+
telemetryManager: "*telemetryManager";
|
|
2583
|
+
localeManager: "*localeManager";
|
|
2584
|
+
a11y: "*a11y";
|
|
2585
|
+
clipboard: "*clipboard";
|
|
2586
|
+
routerLayer: "*routerLayer";
|
|
2587
|
+
blocksRegistry: "*blocksRegistry";
|
|
2588
|
+
eventEmitter: "*eventEmitter";
|
|
2589
|
+
uploadCollection: "*uploadCollection";
|
|
2590
|
+
secureUploadsManager: "*secureUploadsManager";
|
|
2591
|
+
api: "*publicApi";
|
|
2592
|
+
validationManager: "*validationManager";
|
|
2593
|
+
};
|
|
2594
|
+
type InstanceTypeMap = {
|
|
2595
|
+
[key in keyof typeof instanceKeyMap]: SharedState[(typeof instanceKeyMap)[key]];
|
|
2596
|
+
};
|
|
2597
|
+
type InstanceName = keyof typeof instanceKeyMap;
|
|
2598
|
+
type SharedInstancesState = Pick<SharedState, (typeof instanceKeyMap)[keyof typeof instanceKeyMap]>;
|
|
2599
|
+
type SharedInstancesBag = ReturnType<typeof createSharedInstancesBag>;
|
|
2600
|
+
declare const createSharedInstancesBag: (getCtx: () => PubSub<SharedState>) => {
|
|
2601
|
+
readonly ctx: PubSub<SharedState>;
|
|
2602
|
+
readonly modalManager: ModalManager | null;
|
|
2603
|
+
readonly pluginManager: PluginManager;
|
|
2604
|
+
readonly telemetryManager: TelemetryManager;
|
|
2605
|
+
readonly localeManager: LocaleManager;
|
|
2606
|
+
readonly a11y: A11y;
|
|
2607
|
+
readonly routerLayer: RouterHooksLayer;
|
|
2608
|
+
readonly blocksRegistry: Set<LitBlock>;
|
|
2609
|
+
readonly eventEmitter: EventEmitter;
|
|
2610
|
+
readonly uploadCollection: TypedCollection<UploadEntryData>;
|
|
2611
|
+
readonly secureUploadsManager: SecureUploadsManager;
|
|
2612
|
+
readonly api: UploaderPublicApi;
|
|
2613
|
+
readonly validationManager: ValidationManager;
|
|
2614
|
+
when<TName extends InstanceName>(name: TName, callback: (instance: NonNullable<InstanceTypeMap[TName]>) => void): () => void;
|
|
2615
|
+
wait<TName extends InstanceName>(name: TName): Promise<NonNullable<InstanceTypeMap[TName]>>;
|
|
2616
|
+
};
|
|
2617
|
+
|
|
2618
|
+
type PasteScope = 'local' | 'global' | false;
|
|
2619
|
+
declare class ClipboardLayer extends SharedInstance {
|
|
2620
|
+
private scopes;
|
|
2621
|
+
private listener;
|
|
2622
|
+
constructor(sharedInstancesBag: SharedInstancesBag);
|
|
2623
|
+
private _excludingNodes;
|
|
2624
|
+
private openUploadList;
|
|
2625
|
+
private _listener;
|
|
2626
|
+
private handlePaste;
|
|
2627
|
+
registerBlock(scope: Node): () => void;
|
|
2628
|
+
destroy(): void;
|
|
2629
|
+
}
|
|
2630
|
+
|
|
2631
|
+
type ConfigGetter = <K extends keyof ConfigType>(key: K) => ConfigType[K];
|
|
2632
|
+
type LazyPluginEntry = {
|
|
2633
|
+
configDeps: readonly (keyof ConfigType)[];
|
|
2634
|
+
isEnabled: (get: ConfigGetter) => boolean;
|
|
2635
|
+
load: () => UploaderPlugin | undefined | Promise<UploaderPlugin | undefined>;
|
|
2636
|
+
};
|
|
2637
|
+
|
|
2169
2638
|
type SharedConfigState = {
|
|
2170
2639
|
[K in keyof ConfigType as `*cfg/${K}`]: ConfigType[K];
|
|
2171
2640
|
};
|
|
2641
|
+
type SharedCustomConfigState = {
|
|
2642
|
+
[K in keyof CustomConfig as `*cfg/${K}`]: CustomConfig[K];
|
|
2643
|
+
};
|
|
2172
2644
|
type BlocksRegistry = Set<LitBlock>;
|
|
2173
2645
|
type ActivityBlockCtxState = {
|
|
2174
|
-
'*currentActivity':
|
|
2646
|
+
'*currentActivity': RegisteredActivityType | null;
|
|
2175
2647
|
'*currentActivityParams': Record<string, unknown>;
|
|
2176
|
-
'*history': (
|
|
2648
|
+
'*history': (RegisteredActivityType | null)[];
|
|
2177
2649
|
'*historyBack': (() => void) | null;
|
|
2178
2650
|
'*closeModal': () => void;
|
|
2179
2651
|
};
|
|
@@ -2190,6 +2662,7 @@ type UploaderBlockCtxState = ActivityBlockCtxState & {
|
|
|
2190
2662
|
};
|
|
2191
2663
|
type SolutionBlockCtxState = UploaderBlockCtxState & {
|
|
2192
2664
|
'*solution': string | null;
|
|
2665
|
+
'*lazyPlugins': LazyPluginEntry[] | null;
|
|
2193
2666
|
};
|
|
2194
2667
|
type CloudImageEditorState = {
|
|
2195
2668
|
'*originalUrl': string | null;
|
|
@@ -2240,7 +2713,9 @@ type EditorToolbarState = {
|
|
|
2240
2713
|
'*currentOperation': string | null;
|
|
2241
2714
|
'*operationTooltip': string | null;
|
|
2242
2715
|
};
|
|
2716
|
+
type SharedContextInstances = Map<string, ISharedInstance>;
|
|
2243
2717
|
type DynamicBlockState = {
|
|
2718
|
+
'*sharedContextInstances': SharedContextInstances;
|
|
2244
2719
|
'*blocksRegistry': BlocksRegistry;
|
|
2245
2720
|
'*eventEmitter': EventEmitter;
|
|
2246
2721
|
'*localeManager': LocaleManager;
|
|
@@ -2248,6 +2723,8 @@ type DynamicBlockState = {
|
|
|
2248
2723
|
'*a11y': A11y;
|
|
2249
2724
|
'*modalManager': ModalManager | null;
|
|
2250
2725
|
'*clipboard': ClipboardLayer;
|
|
2726
|
+
'*routerLayer': RouterHooksLayer;
|
|
2727
|
+
'*pluginManager': PluginManager;
|
|
2251
2728
|
};
|
|
2252
2729
|
type DynamicUploaderBlockState = {
|
|
2253
2730
|
'*uploadCollection': TypedCollection<UploadEntryData>;
|
|
@@ -2258,66 +2735,7 @@ type DynamicUploaderBlockState = {
|
|
|
2258
2735
|
type LocaleState = {
|
|
2259
2736
|
[K in keyof LocaleDefinition as `*l10n/${K}`]: string;
|
|
2260
2737
|
};
|
|
2261
|
-
type SharedState = SolutionBlockCtxState & SharedConfigState & CloudImageEditorState & EditorImageCropperState & EditorToolbarState & DynamicBlockState & DynamicUploaderBlockState & LocaleState;
|
|
2262
|
-
|
|
2263
|
-
interface ISharedInstance {
|
|
2264
|
-
destroy?(): void;
|
|
2265
|
-
}
|
|
2266
|
-
declare class SharedInstance {
|
|
2267
|
-
protected _ctx: PubSub<SharedState>;
|
|
2268
|
-
protected _sharedInstancesBag: SharedInstancesBag;
|
|
2269
|
-
private _subscriptions;
|
|
2270
|
-
private _cfgProxy;
|
|
2271
|
-
protected _debugPrint: (...args: unknown[]) => void;
|
|
2272
|
-
constructor(sharedInstancesBag: SharedInstancesBag);
|
|
2273
|
-
protected addSub(unsub: () => void): void;
|
|
2274
|
-
protected get _cfg(): Readonly<ConfigType>;
|
|
2275
|
-
destroy(): void;
|
|
2276
|
-
}
|
|
2277
|
-
type SharedInstancesState = Pick<SharedState, '*blocksRegistry' | '*eventEmitter' | '*localeManager' | '*telemetryManager' | '*a11y' | '*clipboard' | '*modalManager' | '*uploadCollection' | '*publicApi' | '*validationManager' | '*secureUploadsManager'>;
|
|
2278
|
-
type SharedInstancesBag = ReturnType<typeof createSharedInstancesBag>;
|
|
2279
|
-
declare const createSharedInstancesBag: (getCtx: () => PubSub<SharedState>) => {
|
|
2280
|
-
readonly ctx: PubSub<SharedState>;
|
|
2281
|
-
readonly modalManager: ModalManager | null;
|
|
2282
|
-
readonly telemetryManager: TelemetryManager;
|
|
2283
|
-
readonly localeManager: LocaleManager;
|
|
2284
|
-
readonly a11y: A11y;
|
|
2285
|
-
readonly blocksRegistry: Set<LitBlock>;
|
|
2286
|
-
readonly eventEmitter: EventEmitter;
|
|
2287
|
-
readonly uploadCollection: TypedCollection<UploadEntryData>;
|
|
2288
|
-
readonly secureUploadsManager: SecureUploadsManager;
|
|
2289
|
-
readonly api: UploaderPublicApi;
|
|
2290
|
-
readonly validationManager: ValidationManager;
|
|
2291
|
-
};
|
|
2292
|
-
|
|
2293
|
-
type FuncFileValidator = (outputEntry: OutputFileEntry, api: UploaderPublicApi, options?: {
|
|
2294
|
-
signal?: AbortSignal;
|
|
2295
|
-
}) => undefined | OutputErrorFile | Promise<undefined | OutputErrorFile>;
|
|
2296
|
-
type FileValidatorDescriptor = {
|
|
2297
|
-
runOn: 'add' | 'upload' | 'change';
|
|
2298
|
-
validator: FuncFileValidator;
|
|
2299
|
-
};
|
|
2300
|
-
type FileValidator = FileValidatorDescriptor | FuncFileValidator;
|
|
2301
|
-
type FuncCollectionValidator = (collection: ReturnType<typeof buildOutputCollectionState<OutputCollectionStatus>>, api: UploaderPublicApi) => undefined | OutputErrorCollection;
|
|
2302
|
-
declare class ValidationManager extends SharedInstance {
|
|
2303
|
-
private get _uploadCollection();
|
|
2304
|
-
private _commonFileValidators;
|
|
2305
|
-
private _commonCollectionValidators;
|
|
2306
|
-
private _queue;
|
|
2307
|
-
private _runQueueDebounced;
|
|
2308
|
-
private _isDestroyed;
|
|
2309
|
-
private _entryValidationState;
|
|
2310
|
-
constructor(sharedInstancesBag: SharedInstancesBag);
|
|
2311
|
-
runFileValidators(runOn: FileValidatorDescriptor['runOn'], entryIds?: Uid[]): void;
|
|
2312
|
-
runCollectionValidators(): void;
|
|
2313
|
-
cleanupValidationForEntry(entry: TypedData<UploadEntryData>): void;
|
|
2314
|
-
private _runFileValidatorsForEntry;
|
|
2315
|
-
private _addCustomTypeToValidationError;
|
|
2316
|
-
private _getEntryValidationState;
|
|
2317
|
-
private _getValidatorDescriptors;
|
|
2318
|
-
private _getValidatorDescriptorsForEntry;
|
|
2319
|
-
destroy(): void;
|
|
2320
|
-
}
|
|
2738
|
+
type SharedState = SolutionBlockCtxState & SharedConfigState & SharedCustomConfigState & CloudImageEditorState & EditorImageCropperState & EditorToolbarState & DynamicBlockState & DynamicUploaderBlockState & LocaleState;
|
|
2321
2739
|
|
|
2322
2740
|
declare const LitBlockBase: typeof LitElement & Constructor<{
|
|
2323
2741
|
willYield: boolean;
|
|
@@ -2329,9 +2747,7 @@ declare const LitBlockBase: typeof LitElement & Constructor<{
|
|
|
2329
2747
|
};
|
|
2330
2748
|
declare class LitBlock extends LitBlockBase {
|
|
2331
2749
|
private _cfgProxy;
|
|
2332
|
-
protected _sharedContextInstances: Map<keyof SharedInstancesState, ISharedInstance>;
|
|
2333
2750
|
static styleAttrs: string[];
|
|
2334
|
-
activityType: ActivityType;
|
|
2335
2751
|
init$: {};
|
|
2336
2752
|
constructor();
|
|
2337
2753
|
l10n: (str: string, variables?: Record<string, string | number>) => string;
|
|
@@ -2339,15 +2755,47 @@ declare class LitBlock extends LitBlockBase {
|
|
|
2339
2755
|
protected _sharedInstancesBag: {
|
|
2340
2756
|
readonly ctx: PubSub<SharedState>;
|
|
2341
2757
|
readonly modalManager: ModalManager | null;
|
|
2758
|
+
readonly pluginManager: PluginManager;
|
|
2342
2759
|
readonly telemetryManager: TelemetryManager;
|
|
2343
2760
|
readonly localeManager: LocaleManager;
|
|
2344
2761
|
readonly a11y: A11y;
|
|
2762
|
+
readonly routerLayer: RouterHooksLayer;
|
|
2345
2763
|
readonly blocksRegistry: Set<LitBlock>;
|
|
2346
2764
|
readonly eventEmitter: EventEmitter;
|
|
2347
2765
|
readonly uploadCollection: TypedCollection<UploadEntryData>;
|
|
2348
2766
|
readonly secureUploadsManager: SecureUploadsManager;
|
|
2349
2767
|
readonly api: UploaderPublicApi;
|
|
2350
2768
|
readonly validationManager: ValidationManager;
|
|
2769
|
+
when<TName extends "modalManager" | "pluginManager" | "telemetryManager" | "localeManager" | "a11y" | "clipboard" | "routerLayer" | "blocksRegistry" | "eventEmitter" | "uploadCollection" | "secureUploadsManager" | "api" | "validationManager">(name: TName, callback: (instance: NonNullable<{
|
|
2770
|
+
modalManager: ModalManager | null;
|
|
2771
|
+
pluginManager: PluginManager;
|
|
2772
|
+
telemetryManager: TelemetryManager;
|
|
2773
|
+
localeManager: LocaleManager;
|
|
2774
|
+
a11y: A11y;
|
|
2775
|
+
clipboard: ClipboardLayer;
|
|
2776
|
+
routerLayer: RouterHooksLayer;
|
|
2777
|
+
blocksRegistry: BlocksRegistry;
|
|
2778
|
+
eventEmitter: EventEmitter;
|
|
2779
|
+
uploadCollection: TypedCollection<UploadEntryData>;
|
|
2780
|
+
secureUploadsManager: SecureUploadsManager;
|
|
2781
|
+
api: UploaderPublicApi;
|
|
2782
|
+
validationManager: ValidationManager;
|
|
2783
|
+
}[TName]>) => void): () => void;
|
|
2784
|
+
wait<TName extends "modalManager" | "pluginManager" | "telemetryManager" | "localeManager" | "a11y" | "clipboard" | "routerLayer" | "blocksRegistry" | "eventEmitter" | "uploadCollection" | "secureUploadsManager" | "api" | "validationManager">(name: TName): Promise<NonNullable<{
|
|
2785
|
+
modalManager: ModalManager | null;
|
|
2786
|
+
pluginManager: PluginManager;
|
|
2787
|
+
telemetryManager: TelemetryManager;
|
|
2788
|
+
localeManager: LocaleManager;
|
|
2789
|
+
a11y: A11y;
|
|
2790
|
+
clipboard: ClipboardLayer;
|
|
2791
|
+
routerLayer: RouterHooksLayer;
|
|
2792
|
+
blocksRegistry: BlocksRegistry;
|
|
2793
|
+
eventEmitter: EventEmitter;
|
|
2794
|
+
uploadCollection: TypedCollection<UploadEntryData>;
|
|
2795
|
+
secureUploadsManager: SecureUploadsManager;
|
|
2796
|
+
api: UploaderPublicApi;
|
|
2797
|
+
validationManager: ValidationManager;
|
|
2798
|
+
}[TName]>>;
|
|
2351
2799
|
};
|
|
2352
2800
|
emit(type: Parameters<EventEmitter['emit']>[0], payload?: Parameters<EventEmitter['emit']>[1], options?: Parameters<EventEmitter['emit']>[2]): void;
|
|
2353
2801
|
hasBlockInCtx(callback: (block: LitBlock) => boolean): boolean;
|
|
@@ -2359,6 +2807,7 @@ declare class LitBlock extends LitBlockBase {
|
|
|
2359
2807
|
get localeManager(): LocaleManager;
|
|
2360
2808
|
get a11y(): A11y;
|
|
2361
2809
|
get clipboardLayer(): ClipboardLayer;
|
|
2810
|
+
get routerLayer(): RouterHooksLayer;
|
|
2362
2811
|
get blocksRegistry(): Set<LitBlock>;
|
|
2363
2812
|
get eventEmitter(): EventEmitter;
|
|
2364
2813
|
disconnectedCallback(): void;
|
|
@@ -2366,11 +2815,7 @@ declare class LitBlock extends LitBlockBase {
|
|
|
2366
2815
|
* Called when the last block is removed from the context. Note that inheritors must run their callback before that.
|
|
2367
2816
|
*/
|
|
2368
2817
|
private destroyCtxCallback;
|
|
2369
|
-
|
|
2370
|
-
* Adds a shared context instance if it does not exist yet.
|
|
2371
|
-
* @param key The shared state key.
|
|
2372
|
-
* @param resolver The resolver function that creates the instance.
|
|
2373
|
-
*/
|
|
2818
|
+
private _getSharedContextInstances;
|
|
2374
2819
|
protected _addSharedContextInstance<TKey extends keyof SharedInstancesState>(key: TKey, resolver: (sharedInstancesBag: SharedInstancesBag) => NonNullable<SharedInstancesState[TKey]>): void;
|
|
2375
2820
|
private _destroySharedContextInstances;
|
|
2376
2821
|
protected _getSharedContextInstance<TKey extends keyof SharedState, TRequired extends boolean = true>(key: TKey, isRequired?: TRequired): TRequired extends true ? NonNullable<SharedState[TKey]> : SharedState[TKey];
|
|
@@ -2397,7 +2842,7 @@ declare class Modal extends LitBlock {
|
|
|
2397
2842
|
private _handleDialogClose;
|
|
2398
2843
|
private _handleDialogMouseDown;
|
|
2399
2844
|
private _handleDialogMouseUp;
|
|
2400
|
-
show(): void
|
|
2845
|
+
show(): Promise<void>;
|
|
2401
2846
|
hide(): void;
|
|
2402
2847
|
private _handleModalOpen;
|
|
2403
2848
|
private _handleModalClose;
|
|
@@ -2469,8 +2914,10 @@ declare const toKebabCase: <T extends string>(str: T) => KebabCase<T>;
|
|
|
2469
2914
|
|
|
2470
2915
|
declare class LitSolutionBlock extends LitBlock {
|
|
2471
2916
|
static styleAttrs: string[];
|
|
2917
|
+
static lazyPlugins: LazyPluginEntry[] | null;
|
|
2472
2918
|
init$: {
|
|
2473
2919
|
'*solution': string | null;
|
|
2920
|
+
'*lazyPlugins': LazyPluginEntry[] | null;
|
|
2474
2921
|
'*commonProgress': number;
|
|
2475
2922
|
'*uploadList': never[];
|
|
2476
2923
|
'*uploadQueue': _uploadcare_upload_client.Queue;
|
|
@@ -2602,17 +3049,14 @@ declare global {
|
|
|
2602
3049
|
}
|
|
2603
3050
|
}
|
|
2604
3051
|
|
|
2605
|
-
declare class SourceList extends
|
|
2606
|
-
private
|
|
2607
|
-
private _cameraModes;
|
|
3052
|
+
declare class SourceList extends LitUploaderBlock {
|
|
3053
|
+
private _sources;
|
|
2608
3054
|
/**
|
|
2609
3055
|
* CSS-only attribute
|
|
2610
3056
|
*/
|
|
2611
3057
|
wrap: boolean;
|
|
2612
3058
|
initCallback(): void;
|
|
2613
3059
|
protected updated(changedProperties: PropertyValues<this>): void;
|
|
2614
|
-
private _updateSources;
|
|
2615
|
-
private _sources;
|
|
2616
3060
|
render(): lit_html.TemplateResult<1>;
|
|
2617
3061
|
}
|
|
2618
3062
|
declare global {
|
|
@@ -2667,7 +3111,9 @@ declare class UploadCtxProvider extends LitUploaderBlock {
|
|
|
2667
3111
|
}
|
|
2668
3112
|
interface UploadCtxProvider extends LitUploaderBlock {
|
|
2669
3113
|
addEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | AddEventListenerOptions): void;
|
|
3114
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;
|
|
2670
3115
|
removeEventListener<T extends keyof EventListenerMap>(type: T, listener: EventListenerMap[T], options?: boolean | EventListenerOptions): void;
|
|
3116
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions): void;
|
|
2671
3117
|
}
|
|
2672
3118
|
declare global {
|
|
2673
3119
|
interface HTMLElementTagNameMap {
|
|
@@ -2675,47 +3121,80 @@ declare global {
|
|
|
2675
3121
|
}
|
|
2676
3122
|
}
|
|
2677
3123
|
|
|
2678
|
-
declare class
|
|
3124
|
+
declare class SimpleBtn extends LitUploaderBlock {
|
|
3125
|
+
static styleAttrs: string[];
|
|
2679
3126
|
couldBeCtxOwner: boolean;
|
|
2680
|
-
|
|
2681
|
-
private
|
|
3127
|
+
dropzone: boolean;
|
|
3128
|
+
private _buttonTextKey;
|
|
3129
|
+
private readonly _handleClick;
|
|
2682
3130
|
initCallback(): void;
|
|
2683
|
-
private _inputRef;
|
|
2684
|
-
private _handleInput;
|
|
2685
|
-
private _handleUpload;
|
|
2686
3131
|
render(): lit_html.TemplateResult<1>;
|
|
2687
3132
|
}
|
|
2688
3133
|
declare global {
|
|
2689
3134
|
interface HTMLElementTagNameMap {
|
|
2690
|
-
'uc-
|
|
3135
|
+
'uc-simple-btn': SimpleBtn;
|
|
2691
3136
|
}
|
|
2692
3137
|
}
|
|
2693
3138
|
|
|
2694
|
-
declare class
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
3139
|
+
declare class PluginActivityHost extends LitActivityBlock {
|
|
3140
|
+
registration: Owned<PluginActivityRegistration>;
|
|
3141
|
+
private _dispose?;
|
|
3142
|
+
private _containerRef;
|
|
3143
|
+
initCallback(): void;
|
|
3144
|
+
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
3145
|
+
private _ensureRegistered;
|
|
3146
|
+
private _renderActivity;
|
|
3147
|
+
private _disposeActivity;
|
|
3148
|
+
disconnectedCallback(): void;
|
|
3149
|
+
render(): lit_html.TemplateResult<1>;
|
|
3150
|
+
}
|
|
3151
|
+
declare class PluginActivityRenderer extends LitBlock {
|
|
3152
|
+
mode: 'modal' | 'inline';
|
|
3153
|
+
private _activities;
|
|
3154
|
+
private _unsubscribePlugins?;
|
|
2700
3155
|
initCallback(): void;
|
|
3156
|
+
private _syncActivities;
|
|
3157
|
+
disconnectedCallback(): void;
|
|
2701
3158
|
render(): lit_html.TemplateResult<1>;
|
|
2702
3159
|
}
|
|
2703
3160
|
declare global {
|
|
2704
3161
|
interface HTMLElementTagNameMap {
|
|
2705
|
-
'uc-
|
|
3162
|
+
'uc-plugin-activity-host': PluginActivityHost;
|
|
3163
|
+
'uc-plugin-activity-renderer': PluginActivityRenderer;
|
|
3164
|
+
}
|
|
3165
|
+
}
|
|
3166
|
+
|
|
3167
|
+
declare class UrlSource extends LitUploaderBlock {
|
|
3168
|
+
private _url;
|
|
3169
|
+
private _handleInput;
|
|
3170
|
+
private _handleUpload;
|
|
3171
|
+
render(): lit_html.TemplateResult<1>;
|
|
3172
|
+
}
|
|
3173
|
+
declare global {
|
|
3174
|
+
interface HTMLElementTagNameMap {
|
|
3175
|
+
'uc-url-source': UrlSource;
|
|
2706
3176
|
}
|
|
2707
3177
|
}
|
|
2708
3178
|
|
|
2709
3179
|
declare class FileUploaderRegular extends LitSolutionBlock {
|
|
3180
|
+
static lazyPlugins: LazyPluginEntry[];
|
|
2710
3181
|
attributesMeta: {
|
|
2711
3182
|
headless?: boolean;
|
|
3183
|
+
'smart-button'?: boolean;
|
|
2712
3184
|
'ctx-name': string;
|
|
2713
3185
|
};
|
|
2714
3186
|
static styleAttrs: string[];
|
|
2715
3187
|
headless: boolean;
|
|
2716
|
-
|
|
3188
|
+
smartButton: boolean;
|
|
2717
3189
|
constructor();
|
|
2718
3190
|
initCallback(): void;
|
|
3191
|
+
/**
|
|
3192
|
+
* Exposes whether SmartBtn is active for non-Lit classes that can't use context
|
|
3193
|
+
*/
|
|
3194
|
+
get isSmartBtnActive(): boolean;
|
|
3195
|
+
private _renderSmartButton;
|
|
3196
|
+
private _renderStaticButton;
|
|
3197
|
+
private _renderButton;
|
|
2719
3198
|
render(): lit_html.TemplateResult<1>;
|
|
2720
3199
|
}
|
|
2721
3200
|
declare global {
|
|
@@ -2725,6 +3204,7 @@ declare global {
|
|
|
2725
3204
|
}
|
|
2726
3205
|
|
|
2727
3206
|
declare class FileUploaderInline extends LitSolutionBlock {
|
|
3207
|
+
static lazyPlugins: LazyPluginEntry[];
|
|
2728
3208
|
attributesMeta: {
|
|
2729
3209
|
'ctx-name': string;
|
|
2730
3210
|
};
|
|
@@ -2745,6 +3225,7 @@ declare global {
|
|
|
2745
3225
|
}
|
|
2746
3226
|
|
|
2747
3227
|
declare class FileUploaderMinimal extends LitSolutionBlock {
|
|
3228
|
+
static lazyPlugins: LazyPluginEntry[];
|
|
2748
3229
|
attributesMeta: {
|
|
2749
3230
|
'ctx-name': string;
|
|
2750
3231
|
};
|
|
@@ -2768,4 +3249,4 @@ declare global {
|
|
|
2768
3249
|
}
|
|
2769
3250
|
}
|
|
2770
3251
|
|
|
2771
|
-
export { LitActivityBlock as ActivityBlock, ActivityHeader, type ApiAddFileCommonOptions, BaseComponent, LitBlock as Block, BtnUi, CameraSource, CloudImageEditor, CloudImageEditorActivity, CloudImageEditorBlock, type CollectionValidators, Config, type ConfigAttributesType, type ConfigComplexType, type ConfigPlainType, type ConfigType, Copyright, CropFrame, PubSub as Data, DropArea,
|
|
3252
|
+
export { LitActivityBlock as ActivityBlock, ActivityHeader, type ActivityType, type ApiAddFileCommonOptions, BaseComponent, LitBlock as Block, BtnUi, CameraSource, CloudImageEditor, CloudImageEditorActivity, CloudImageEditorBlock, type CollectionValidators, Config, type ConfigAttributesType, type ConfigComplexType, type ConfigPlainType, type ConfigType, Copyright, CropFrame, type CustomActivities, type CustomConfig, type CustomConfigDefinition, PubSub as Data, DropArea, DropDown, EditorAspectRatioButtonControl, EditorCropButtonControl, EditorFilterControl, EditorFreeformButtonControl, EditorImageCropper, EditorImageFader, EditorOperationControl, EditorScroller, EditorSlider, EditorToolbar, type EventMap, type EventPayload, EventType, ExternalSource, ExternalUploadSource, FileActionButton, 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, NoWrapModeSmartBtn, type OutputCollectionErrorType, type OutputCollectionState, type OutputCollectionStatus, type OutputCustomErrorType, type OutputError, type OutputErrorCollection, type OutputErrorFile, type OutputErrorTypePayload, type OutputFileEntry, type OutputFileErrorPayload, type OutputFileErrorType, type OutputFileStatus, type Owned, type PluginActivityApi, PluginActivityHost, type PluginActivityRegistration, PluginActivityRenderer, type PluginApi, type PluginConfigApi, type PluginFileActionRegistration, type PluginFileEntryUpdate, type PluginFileHookContext, type PluginFileHookRegistration, type PluginFileHookResult, type PluginFilesApi, type PluginIconRegistration, type PluginL10nRegistration, type PluginRegistryApi, type PluginRegistrySnapshot, type PluginRender, type PluginRenderDispose, type PluginSetupParams, type PluginSetupResult, type PluginSourceRegistration, type PluginUploaderApi, PresenceToggle, PrimaryAction, ProgressBar, ProgressBarCommon, type SecureDeliveryProxyUrlResolver, type SecureUploadsSignatureAndExpire, type SecureUploadsSignatureResolver, Select, SimpleBtn, SliderUi, SmartBtn, LitSolutionBlock as SolutionBlock, SourceBtn, SourceList, type SourceTypes, Spinner, StartFrom, Thumb, UID, UploadCtxProvider, UploadList, UploadSource, LitUploaderBlock as UploaderBlock, type UploaderPlugin, UploaderPublicApi, UrlSource, defineComponents, defineLocale, toKebabCase };
|