@uploadcare/file-uploader 1.15.0-alpha.12 → 1.15.0-alpha.13
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/abstract/ActivityBlock.d.ts +5 -5
- package/abstract/ActivityBlock.d.ts.map +1 -1
- package/abstract/Block.d.ts +3 -9
- package/abstract/Block.d.ts.map +1 -1
- package/abstract/CTX.d.ts +6 -6
- package/abstract/CTX.d.ts.map +1 -1
- package/abstract/LocaleManager.d.ts +3 -3
- package/abstract/LocaleManager.d.ts.map +1 -1
- package/abstract/ModalManager.d.ts +13 -18
- package/abstract/ModalManager.d.ts.map +1 -1
- package/abstract/ModalManager.js +19 -10
- package/abstract/SecureUploadsManager.d.ts +2 -2
- package/abstract/SecureUploadsManager.d.ts.map +1 -1
- package/abstract/SolutionBlock.d.ts +2 -2
- package/abstract/SolutionBlock.d.ts.map +1 -1
- package/abstract/TypedCollection.d.ts +44 -44
- package/abstract/TypedCollection.d.ts.map +1 -1
- package/abstract/TypedCollection.js +53 -33
- package/abstract/TypedData.d.ts +71 -25
- package/abstract/TypedData.d.ts.map +1 -1
- package/abstract/TypedData.js +74 -17
- package/abstract/UploaderBlock.d.ts +10 -10
- package/abstract/UploaderBlock.d.ts.map +1 -1
- package/abstract/UploaderBlock.js +22 -10
- package/abstract/UploaderPublicApi.d.ts +24 -23
- package/abstract/UploaderPublicApi.d.ts.map +1 -1
- package/abstract/UploaderPublicApi.js +21 -10
- package/abstract/ValidationManager.d.ts +121 -6
- package/abstract/ValidationManager.d.ts.map +1 -1
- package/abstract/ValidationManager.js +1 -1
- package/abstract/a11y.d.ts +2 -2
- package/abstract/a11y.d.ts.map +1 -1
- package/abstract/buildOutputCollectionState.d.ts +1 -1
- package/abstract/buildOutputCollectionState.d.ts.map +1 -1
- package/abstract/defineComponents.d.ts.map +1 -1
- package/abstract/l10nProcessor.d.ts.map +1 -1
- package/abstract/loadFileUploaderFrom.d.ts +1 -1
- package/abstract/loadFileUploaderFrom.d.ts.map +1 -1
- package/abstract/localeRegistry.d.ts.map +1 -1
- package/abstract/sharedConfigKey.d.ts.map +1 -1
- package/abstract/uploadEntrySchema.d.ts +119 -63
- package/abstract/uploadEntrySchema.d.ts.map +1 -1
- package/abstract/uploadEntrySchema.js +62 -81
- package/blocks/CameraSource/CameraSource.d.ts +9 -9
- package/blocks/CameraSource/CameraSource.d.ts.map +1 -1
- package/blocks/CameraSource/calcCameraModes.d.ts +1 -1
- package/blocks/CameraSource/constants.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/CloudImageEditorBlock.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/CropFrame.d.ts +1 -1
- package/blocks/CloudImageEditor/src/EditorImageCropper.d.ts +3 -3
- package/blocks/CloudImageEditor/src/EditorImageFader.d.ts +1 -1
- package/blocks/CloudImageEditor/src/EditorImageFader.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/EditorSlider.d.ts +1 -1
- package/blocks/CloudImageEditor/src/EditorSlider.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/EditorToolbar.d.ts +1 -1
- package/blocks/CloudImageEditor/src/crop-utils.d.ts +14 -14
- package/blocks/CloudImageEditor/src/crop-utils.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/cropper-constants.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/lib/applyFocusVisiblePolyfill.d.ts +1 -1
- package/blocks/CloudImageEditor/src/lib/applyFocusVisiblePolyfill.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/lib/parseCropPreset.d.ts +1 -1
- package/blocks/CloudImageEditor/src/lib/transformationUtils.d.ts +3 -3
- package/blocks/CloudImageEditor/src/lib/transformationUtils.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/state.d.ts +4 -4
- package/blocks/CloudImageEditor/src/svg-sprite.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/types.d.ts +8 -58
- package/blocks/CloudImageEditor/src/types.d.ts.map +1 -1
- package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts +5 -2
- package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts.map +1 -1
- package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.js +7 -3
- package/blocks/Config/Config.d.ts +3 -12
- package/blocks/Config/Config.d.ts.map +1 -1
- package/blocks/Config/assertions.d.ts +1 -1
- package/blocks/Config/initialConfig.d.ts +1 -1
- package/blocks/Config/initialConfig.d.ts.map +1 -1
- package/blocks/Config/initialConfig.js +1 -1
- package/blocks/Config/normalizeConfigValue.d.ts.map +1 -1
- package/blocks/Config/side-effects.d.ts.map +1 -1
- package/blocks/Config/validatorsType.d.ts +1 -1
- package/blocks/Config/validatorsType.d.ts.map +1 -1
- package/blocks/DropArea/DropArea.d.ts +2 -2
- package/blocks/DropArea/DropArea.d.ts.map +1 -1
- package/blocks/DropArea/addDropzone.d.ts.map +1 -1
- package/blocks/DropArea/drop-area.css +4 -2
- package/blocks/DropArea/getDropItems.d.ts +2 -2
- package/blocks/DropArea/getDropItems.d.ts.map +1 -1
- package/blocks/ExternalSource/ExternalSource.d.ts +3 -3
- package/blocks/ExternalSource/ExternalSource.d.ts.map +1 -1
- package/blocks/ExternalSource/MessageBridge.d.ts +3 -3
- package/blocks/ExternalSource/MessageBridge.d.ts.map +1 -1
- package/blocks/ExternalSource/query-string.d.ts.map +1 -1
- package/blocks/ExternalSource/types.d.ts +64 -64
- package/blocks/ExternalSource/types.d.ts.map +1 -1
- package/blocks/FileItem/FileItem.d.ts +20 -24
- package/blocks/FileItem/FileItem.d.ts.map +1 -1
- package/blocks/FileItem/FileItem.js +120 -121
- package/blocks/FileItem/file-item.css +29 -6
- package/blocks/Img/ImgBase.d.ts +3 -3
- package/blocks/Img/ImgBase.d.ts.map +1 -1
- package/blocks/Img/ImgBase.js +9 -9
- package/blocks/Img/ImgConfig.d.ts.map +1 -1
- package/blocks/Img/configurations.d.ts.map +1 -1
- package/blocks/Modal/Modal.d.ts +4 -4
- package/blocks/Modal/Modal.d.ts.map +1 -1
- package/blocks/ProgressBar/ProgressBar.d.ts +6 -1
- package/blocks/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/blocks/ProgressBar/ProgressBar.js +44 -42
- package/blocks/Range/Range.d.ts.map +1 -1
- package/blocks/SimpleBtn/SimpleBtn.d.ts +2 -2
- package/blocks/SimpleBtn/SimpleBtn.d.ts.map +1 -1
- package/blocks/SourceBtn/SourceBtn.d.ts +2 -5
- package/blocks/SourceBtn/SourceBtn.d.ts.map +1 -1
- package/blocks/SourceBtn/SourceBtn.js +5 -5
- package/blocks/SourceList/SourceList.js +2 -2
- package/blocks/Spinner/Spinner.d.ts.map +1 -1
- package/blocks/Thumb/Thumb.d.ts +22 -6
- package/blocks/Thumb/Thumb.d.ts.map +1 -1
- package/blocks/Thumb/Thumb.js +73 -21
- package/blocks/UploadCtxProvider/EventEmitter.d.ts +20 -20
- package/blocks/UploadCtxProvider/EventEmitter.d.ts.map +1 -1
- package/blocks/UploadCtxProvider/UploadCtxProvider.d.ts +4 -4
- package/blocks/UploadCtxProvider/UploadCtxProvider.d.ts.map +1 -1
- package/blocks/UploadList/UploadList.d.ts +3 -3
- package/blocks/UploadList/UploadList.d.ts.map +1 -1
- package/blocks/svg-backgrounds/svg-backgrounds.d.ts +3 -3
- package/blocks/svg-backgrounds/svg-backgrounds.d.ts.map +1 -1
- package/blocks/themes/uc-basic/svg-sprite.d.ts.map +1 -1
- package/blocks/utils/UploadSource.d.ts.map +1 -1
- package/blocks/utils/debounce.d.ts +3 -1
- package/blocks/utils/debounce.d.ts.map +1 -1
- package/blocks/utils/resizeImage.d.ts +1 -1
- package/blocks/utils/resizeImage.d.ts.map +1 -1
- package/blocks/utils/throttle.d.ts +3 -1
- package/blocks/utils/throttle.d.ts.map +1 -1
- package/blocks/utils/userAgent.d.ts +1 -1
- package/blocks/utils/userAgent.d.ts.map +1 -1
- package/env.d.ts.map +1 -1
- package/index.ssr.js +1 -1
- package/package.json +6 -5
- package/solutions/file-uploader/inline/FileUploaderInline.d.ts +2 -2
- package/solutions/file-uploader/inline/FileUploaderInline.d.ts.map +1 -1
- package/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts +10 -10
- package/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts.map +1 -1
- package/solutions/file-uploader/minimal/index.css +5 -0
- package/solutions/file-uploader/regular/FileUploaderRegular.d.ts +2 -2
- package/solutions/file-uploader/regular/FileUploaderRegular.d.ts.map +1 -1
- package/types/jsx.d.ts +1 -1
- package/utils/browser-info.d.ts +13 -0
- package/utils/browser-info.d.ts.map +1 -0
- package/utils/browser-info.js +22 -0
- package/utils/browser-info.test.d.ts +2 -0
- package/utils/browser-info.test.d.ts.map +1 -0
- package/utils/browser-info.test.js +109 -0
- package/utils/cdn-utils.d.ts +3 -3
- package/utils/cdn-utils.d.ts.map +1 -1
- package/utils/fileTypes.d.ts +5 -1
- package/utils/fileTypes.d.ts.map +1 -1
- package/utils/fileTypes.js +18 -2
- package/utils/getPluralForm.d.ts.map +1 -1
- package/utils/isSecureTokenExpired.d.ts +1 -1
- package/utils/memoize.d.ts.map +1 -1
- package/utils/mixinClass.d.ts +3 -1
- package/utils/mixinClass.d.ts.map +1 -1
- package/utils/prettyBytes.d.ts.map +1 -1
- package/utils/template-utils.d.ts +1 -1
- package/utils/template-utils.d.ts.map +1 -1
- package/utils/toKebabCase.d.ts.map +1 -1
- package/utils/transparentPixelSrc.d.ts.map +1 -1
- package/utils/uniqueArray.d.ts.map +1 -1
- package/utils/validators/collection/validateCollectionUploadError.d.ts +1 -1
- package/utils/validators/collection/validateMultiple.d.ts +1 -1
- package/utils/validators/file/validateFileType.d.ts +1 -1
- package/utils/validators/file/validateIsImage.d.ts +1 -1
- package/utils/validators/file/validateMaxSizeLimit.d.ts +1 -1
- package/utils/validators/file/validateUploadError.d.ts +1 -1
- package/utils/waitForAttribute.d.ts +1 -1
- package/utils/waitForAttribute.d.ts.map +1 -1
- package/web/file-uploader.iife.min.js +4 -4
- package/web/file-uploader.min.js +4 -4
- package/web/uc-basic.min.css +1 -1
- package/web/uc-cloud-image-editor.min.js +2 -2
- package/web/uc-file-uploader-inline.min.css +1 -1
- package/web/uc-file-uploader-inline.min.js +4 -4
- package/web/uc-file-uploader-minimal.min.css +1 -1
- package/web/uc-file-uploader-minimal.min.js +4 -4
- package/web/uc-file-uploader-regular.min.css +1 -1
- package/web/uc-file-uploader-regular.min.js +4 -4
- package/web/uc-img.min.js +1 -1
- package/blocks/utils/supportCapture.d.ts +0 -2
- package/blocks/utils/supportCapture.d.ts.map +0 -1
- package/blocks/utils/supportCapture.js +0 -3
|
@@ -1,63 +1,65 @@
|
|
|
1
|
+
// @ts-check
|
|
1
2
|
import { Block } from '../../abstract/Block.js';
|
|
2
3
|
|
|
3
4
|
export class ProgressBar extends Block {
|
|
4
5
|
/** @type {Number} */
|
|
5
6
|
_value = 0;
|
|
6
7
|
|
|
8
|
+
/** @type {Number} */
|
|
9
|
+
_prevValue = 0;
|
|
10
|
+
|
|
7
11
|
/** @type {Boolean} */
|
|
8
12
|
_visible = true;
|
|
9
13
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
this.init$ = {
|
|
17
|
+
...this.init$,
|
|
18
|
+
width: 0,
|
|
19
|
+
opacity: 0,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
15
22
|
|
|
16
23
|
initCallback() {
|
|
17
24
|
super.initCallback();
|
|
18
|
-
this.defineAccessor('value', (value) => {
|
|
19
|
-
if (value === undefined || value === null) return;
|
|
20
|
-
const prevValue = this._value;
|
|
21
|
-
this._value = value;
|
|
22
|
-
if (!this._visible) return;
|
|
23
|
-
if (value === 100) {
|
|
24
|
-
this.ref.realProgressLine.addEventListener(
|
|
25
|
-
'transitionend',
|
|
26
|
-
() => {
|
|
27
|
-
this.classList.add('uc-progress-bar--hidden');
|
|
28
|
-
this.ref.realProgressLine.classList.toggle('uc-progress--hidden', true);
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
once: true,
|
|
32
|
-
},
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
25
|
|
|
36
|
-
|
|
26
|
+
this.ref.fakeProgressLine.addEventListener('animationiteration', () => {
|
|
27
|
+
if (this._value === 0) return;
|
|
28
|
+
this.ref.fakeProgressLine.classList.toggle('uc-fake-progress--hidden', true);
|
|
29
|
+
});
|
|
37
30
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
once: true,
|
|
46
|
-
},
|
|
47
|
-
);
|
|
48
|
-
return;
|
|
31
|
+
this.ref.realProgressLine.addEventListener('transitionend', () => {
|
|
32
|
+
if (this._value === 100) {
|
|
33
|
+
this.classList.add('uc-progress-bar--hidden');
|
|
34
|
+
this.ref.realProgressLine.classList.toggle('uc-progress--hidden', true);
|
|
35
|
+
}
|
|
36
|
+
if (this._value === 0 && this._prevValue > 0) {
|
|
37
|
+
this.style.setProperty('--l-progress-value', this._value.toString());
|
|
49
38
|
}
|
|
50
|
-
|
|
51
|
-
this.style.setProperty('--l-progress-value', this._value.toString());
|
|
52
39
|
});
|
|
53
40
|
|
|
54
|
-
this.defineAccessor(
|
|
55
|
-
|
|
41
|
+
this.defineAccessor(
|
|
42
|
+
'value',
|
|
43
|
+
/** @param {number} value */ (value) => {
|
|
44
|
+
if (value === undefined || value === null) return;
|
|
45
|
+
this._prevValue = this._value;
|
|
46
|
+
this._value = value;
|
|
56
47
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
if (!this._visible) return;
|
|
49
|
+
this.style.setProperty('--l-progress-value', this._value.toString());
|
|
50
|
+
},
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
this.defineAccessor(
|
|
54
|
+
'visible',
|
|
55
|
+
/** @param {boolean} visible */ (visible) => {
|
|
56
|
+
this._visible = visible;
|
|
57
|
+
|
|
58
|
+
this.classList.toggle('uc-progress-bar--hidden', !visible);
|
|
59
|
+
this.ref.realProgressLine.classList.toggle('uc-progress--hidden', !visible);
|
|
60
|
+
this.ref.fakeProgressLine.classList.toggle('uc-fake-progress--hidden', !visible);
|
|
61
|
+
},
|
|
62
|
+
);
|
|
61
63
|
}
|
|
62
64
|
}
|
|
63
65
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Range.d.ts","sourceRoot":"","sources":["Range.js"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"Range.d.ts","sourceRoot":"","sources":["Range.js"],"names":[],"mappings":"AAEA;;IACE;;;;;MAUE;IAIA,+BAA+B;IAC/B,qCAA4B;CAe/B;;;;8BAjC6B,sBAAsB"}
|
|
@@ -6,8 +6,8 @@ export class SimpleBtn extends UploaderBlock {
|
|
|
6
6
|
'*commonProgress': number;
|
|
7
7
|
'*uploadList': never[];
|
|
8
8
|
'*uploadQueue': import("@uploadcare/upload-client").Queue;
|
|
9
|
-
'*collectionErrors':
|
|
10
|
-
'*collectionState': import("../../index.js").OutputCollectionState
|
|
9
|
+
'*collectionErrors': ReturnType<import("../../index.js").OutputErrorCollection>[];
|
|
10
|
+
'*collectionState': import("../../index.js").OutputCollectionState | null;
|
|
11
11
|
'*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
|
|
12
12
|
'*uploadTrigger': Set<string>;
|
|
13
13
|
'*secureUploadsManager': import("../../abstract/SecureUploadsManager.js").SecureUploadsManager | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleBtn.d.ts","sourceRoot":"","sources":["SimpleBtn.js"],"names":[],"mappings":"AAIA;IAMI
|
|
1
|
+
{"version":3,"file":"SimpleBtn.d.ts","sourceRoot":"","sources":["SimpleBtn.js"],"names":[],"mappings":"AAIA;IAMI;;;;;;;+CAmBI,gBACH;mCAGgB,gBAAU;6BAE3B,2BAIO;;wCAGD,wCAA2B;;;;;;MAzBhC;CAoBJ;;;;8BApC6B,iCAAiC"}
|
|
@@ -22,11 +22,8 @@ export class SourceBtn extends UploaderBlock {
|
|
|
22
22
|
'*commonProgress': number;
|
|
23
23
|
'*uploadList': never[];
|
|
24
24
|
'*uploadQueue': import("@uploadcare/upload-client").Queue;
|
|
25
|
-
'*collectionErrors':
|
|
26
|
-
|
|
27
|
-
* @type {Record<string, TConfig>}
|
|
28
|
-
*/
|
|
29
|
-
'*collectionState': import("../../index.js").OutputCollectionState<import("../../index.js").OutputCollectionStatus, "maybe-has-group"> | null;
|
|
25
|
+
'*collectionErrors': ReturnType<import("../../index.js" /** @type {string | undefined} */).OutputErrorCollection>[];
|
|
26
|
+
'*collectionState': import("../../index.js").OutputCollectionState | null;
|
|
30
27
|
'*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
|
|
31
28
|
'*uploadTrigger': Set<string>;
|
|
32
29
|
'*secureUploadsManager': import("../../abstract/SecureUploadsManager.js").SecureUploadsManager | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceBtn.d.ts","sourceRoot":"","sources":["SourceBtn.js"],"names":[],"mappings":"AASA;;;;;;;;;GASG;AAEH;IAEE,iCAAiC;IACjC,MADW,MAAM,GAAG,SAAS,CACZ;IACjB;;;OAGG;IACH,yBAAsB;IAKpB;;;;;;
|
|
1
|
+
{"version":3,"file":"SourceBtn.d.ts","sourceRoot":"","sources":["SourceBtn.js"],"names":[],"mappings":"AASA;;;;;;;;;GASG;AAEH;IAEE,iCAAiC;IACjC,MADW,MAAM,GAAG,SAAS,CACZ;IACjB;;;OAGG;IACH,yBAAsB;IAKpB;;;;;;+CAZc,gBACjB,CAAC,iCAAiC;mCAIhC,gBAAU;6BAKJ,2BAGN;;wCAQS,wCACL;;;;;;MANF;IAGH,kBA2DC;IAkBD,kCAAkC;IAClC,yBADY,OAAO,QAGlB;IAED,2BAA2B;IAC3B,cADY,MAAM,WAGjB;IAED,iBAgBC;IAED,2BAA2B;IAC3B,gBADY,MAAM,QAcjB;CACF;;;;sBAtJY;IACR,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;8BAf0B,iCAAiC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
-
import { UploaderBlock } from '../../abstract/UploaderBlock.js';
|
|
3
2
|
import { ActivityBlock } from '../../abstract/ActivityBlock.js';
|
|
4
|
-
import {
|
|
3
|
+
import { UploaderBlock } from '../../abstract/UploaderBlock.js';
|
|
4
|
+
import { browserFeatures } from '../../utils/browser-info.js';
|
|
5
5
|
import { CameraSourceTypes } from '../CameraSource/constants.js';
|
|
6
|
-
import {
|
|
6
|
+
import { ExternalUploadSource, UploadSource, UploadSourceMobile } from '../utils/UploadSource.js';
|
|
7
7
|
|
|
8
8
|
const L10N_PREFIX = 'src-type-';
|
|
9
9
|
|
|
@@ -55,7 +55,7 @@ export class SourceBtn extends UploaderBlock {
|
|
|
55
55
|
type: UploadSource.CAMERA,
|
|
56
56
|
activity: ActivityBlock.activities.CAMERA,
|
|
57
57
|
activate: () => {
|
|
58
|
-
const supportsCapture =
|
|
58
|
+
const supportsCapture = browserFeatures.htmlMediaCapture;
|
|
59
59
|
|
|
60
60
|
if (supportsCapture) {
|
|
61
61
|
this.api.openSystemDialog({ captureCamera: true });
|
|
@@ -75,7 +75,7 @@ export class SourceBtn extends UploaderBlock {
|
|
|
75
75
|
type: mobileSourceType,
|
|
76
76
|
activity: ActivityBlock.activities.CAMERA,
|
|
77
77
|
activate: () => {
|
|
78
|
-
const supportsCapture =
|
|
78
|
+
const supportsCapture = browserFeatures.htmlMediaCapture;
|
|
79
79
|
if (supportsCapture) {
|
|
80
80
|
this.api.openSystemDialog({
|
|
81
81
|
captureCamera: true,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
import { Block } from '../../abstract/Block.js';
|
|
3
|
+
import { browserFeatures } from '../../utils/browser-info.js';
|
|
3
4
|
import { stringToArray } from '../../utils/stringToArray.js';
|
|
4
5
|
import { deserializeCsv } from '../utils/comma-separated.js';
|
|
5
|
-
import { isSupportCapture } from '../utils/supportCapture.js';
|
|
6
6
|
|
|
7
7
|
export class SourceList extends Block {
|
|
8
8
|
initCallback() {
|
|
@@ -22,7 +22,7 @@ export class SourceList extends Block {
|
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
if (srcName === 'camera' &&
|
|
25
|
+
if (srcName === 'camera' && browserFeatures.htmlMediaCapture) {
|
|
26
26
|
this.subConfigValue('cameraModes', (/** @type {String} */ val) => {
|
|
27
27
|
const cameraModes = deserializeCsv(val);
|
|
28
28
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["Spinner.js"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["Spinner.js"],"names":[],"mappings":"AAEA;;CAA6C;;;;8BAFf,sBAAsB"}
|
package/blocks/Thumb/Thumb.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export class Thumb extends UploaderBlock {
|
|
2
|
+
/** @private */
|
|
3
|
+
private _entrySubs;
|
|
2
4
|
/**
|
|
3
5
|
* @private
|
|
4
|
-
* @type {
|
|
6
|
+
* @type {import('../../abstract/uploadEntrySchema.js').UploadEntryTypedData | null}
|
|
5
7
|
*/
|
|
6
8
|
private _entry;
|
|
7
9
|
/**
|
|
@@ -9,10 +11,21 @@ export class Thumb extends UploaderBlock {
|
|
|
9
11
|
* @type {IntersectionObserverEntry['boundingClientRect'] | null}
|
|
10
12
|
*/
|
|
11
13
|
private _thumbRect;
|
|
12
|
-
_debouncedGenerateThumb: (() => Promise<void>) & {
|
|
13
|
-
cancel: () => void;
|
|
14
|
-
};
|
|
15
14
|
_isIntersecting: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* @private
|
|
17
|
+
* @template {any[]} A
|
|
18
|
+
* @template {(entry: import('../../abstract/uploadEntrySchema.js').UploadEntryTypedData, ...args: A) => any} T
|
|
19
|
+
* @param {T} fn
|
|
20
|
+
* @returns {(...args: A) => ReturnType<T>}
|
|
21
|
+
*/
|
|
22
|
+
private _withEntry;
|
|
23
|
+
/**
|
|
24
|
+
* @template {import('../../abstract/uploadEntrySchema.js').UploadEntryKeys} K
|
|
25
|
+
* @param {K} prop_
|
|
26
|
+
* @param {(value: import('../../abstract/uploadEntrySchema.js').UploadEntryData[K]) => void} handler_
|
|
27
|
+
*/
|
|
28
|
+
_subEntry: (prop_: K, handler_: (value: import("../../abstract/uploadEntrySchema.js").UploadEntryData[K]) => void) => void;
|
|
16
29
|
init$: {
|
|
17
30
|
thumbUrl: string;
|
|
18
31
|
badgeIcon: string;
|
|
@@ -20,8 +33,8 @@ export class Thumb extends UploaderBlock {
|
|
|
20
33
|
'*commonProgress': number;
|
|
21
34
|
'*uploadList': never[];
|
|
22
35
|
'*uploadQueue': import("@uploadcare/upload-client").Queue;
|
|
23
|
-
'*collectionErrors':
|
|
24
|
-
'*collectionState': import("../../index.js").OutputCollectionState
|
|
36
|
+
'*collectionErrors': ReturnType<import("../../index.js").OutputErrorCollection>[];
|
|
37
|
+
'*collectionState': import("../../index.js").OutputCollectionState | null;
|
|
25
38
|
'*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
|
|
26
39
|
'*uploadTrigger': Set<string>;
|
|
27
40
|
'*secureUploadsManager': import("../../abstract/SecureUploadsManager.js").SecureUploadsManager | null;
|
|
@@ -34,6 +47,9 @@ export class Thumb extends UploaderBlock {
|
|
|
34
47
|
_calculateThumbSize(): number;
|
|
35
48
|
/** @private */
|
|
36
49
|
private _generateThumbnail;
|
|
50
|
+
_debouncedGenerateThumb: ((...args: any[]) => Promise<void>) & {
|
|
51
|
+
cancel: () => void;
|
|
52
|
+
};
|
|
37
53
|
/**
|
|
38
54
|
* @private
|
|
39
55
|
* @param {IntersectionObserverEntry[]} entries
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Thumb.d.ts","sourceRoot":"","sources":["Thumb.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Thumb.d.ts","sourceRoot":"","sources":["Thumb.js"],"names":[],"mappings":"AAQA;IACE,eAAe;IACf,mBAAuB;IAEvB;;;OAGG;IACH,eAAc;IAEd;;;OAGG;IACH,mBAAkB;IAElB,yBAAwB;IAExB;;;;;;OAMG;IACH,mBAYC;IAED;;;;OAIG;IACH,YAAa,OAHF,CAGO,EAAE,UAFT,CAAC,KAAK,EAAE,OAAO,qCAAqC,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,IAE5D,UAgBP;IAKnB;;;;;;;+CAnDI,gBAAU;mCAOf,gBAAQ;6BAAmF,2BACvF;;wCAI0C,wCAC3C;;;;;;MA2CD;IAGH,8BAYC;IAED,eAAe;IACf,2BAuCG;IAEH;;MAA4E;IAE5E;;;OAGG;IACH,0BAaC;IAqCC,4CAAuG;CAY1G;;;;8BA3M6B,iCAAiC"}
|
package/blocks/Thumb/Thumb.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
//@ts-check
|
|
2
|
+
|
|
1
3
|
import { UploaderBlock } from '../../abstract/UploaderBlock.js';
|
|
2
4
|
import { createCdnUrl, createCdnUrlModifiers, createOriginalUrl } from '../../utils/cdn-utils.js';
|
|
3
5
|
import { fileCssBg } from '../svg-backgrounds/svg-backgrounds.js';
|
|
@@ -5,9 +7,12 @@ import { debounce } from '../utils/debounce.js';
|
|
|
5
7
|
import { generateThumb } from '../utils/resizeImage.js';
|
|
6
8
|
|
|
7
9
|
export class Thumb extends UploaderBlock {
|
|
10
|
+
/** @private */
|
|
11
|
+
_entrySubs = new Set();
|
|
12
|
+
|
|
8
13
|
/**
|
|
9
14
|
* @private
|
|
10
|
-
* @type {
|
|
15
|
+
* @type {import('../../abstract/uploadEntrySchema.js').UploadEntryTypedData | null}
|
|
11
16
|
*/
|
|
12
17
|
_entry = null;
|
|
13
18
|
|
|
@@ -17,10 +22,52 @@ export class Thumb extends UploaderBlock {
|
|
|
17
22
|
*/
|
|
18
23
|
_thumbRect = null;
|
|
19
24
|
|
|
20
|
-
_debouncedGenerateThumb = debounce(this._generateThumbnail.bind(this), 100);
|
|
21
|
-
|
|
22
25
|
_isIntersecting = false;
|
|
23
26
|
|
|
27
|
+
/**
|
|
28
|
+
* @private
|
|
29
|
+
* @template {any[]} A
|
|
30
|
+
* @template {(entry: import('../../abstract/uploadEntrySchema.js').UploadEntryTypedData, ...args: A) => any} T
|
|
31
|
+
* @param {T} fn
|
|
32
|
+
* @returns {(...args: A) => ReturnType<T>}
|
|
33
|
+
*/
|
|
34
|
+
_withEntry(fn) {
|
|
35
|
+
const wrapperFn = /** @type {(...args: A) => ReturnType<T>} */ (
|
|
36
|
+
(...args) => {
|
|
37
|
+
const entry = this._entry;
|
|
38
|
+
if (!entry) {
|
|
39
|
+
console.warn('No entry found');
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
return fn(entry, ...args);
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
return wrapperFn;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @template {import('../../abstract/uploadEntrySchema.js').UploadEntryKeys} K
|
|
50
|
+
* @param {K} prop_
|
|
51
|
+
* @param {(value: import('../../abstract/uploadEntrySchema.js').UploadEntryData[K]) => void} handler_
|
|
52
|
+
*/
|
|
53
|
+
_subEntry = (prop_, handler_) =>
|
|
54
|
+
this._withEntry(
|
|
55
|
+
/**
|
|
56
|
+
* @template {import('../../abstract/uploadEntrySchema.js').UploadEntryKeys} K
|
|
57
|
+
* @param {import('../../abstract/uploadEntrySchema.js').UploadEntryTypedData} entry
|
|
58
|
+
* @param {K} prop
|
|
59
|
+
* @param {(value: import('../../abstract/uploadEntrySchema.js').UploadEntryData[K]) => void} handler
|
|
60
|
+
*/
|
|
61
|
+
(entry, prop, handler) => {
|
|
62
|
+
let sub = entry.subscribe(prop, (value) => {
|
|
63
|
+
if (this.isConnected) {
|
|
64
|
+
handler(value);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
this._entrySubs.add(sub);
|
|
68
|
+
},
|
|
69
|
+
)(prop_, handler_);
|
|
70
|
+
|
|
24
71
|
constructor() {
|
|
25
72
|
super();
|
|
26
73
|
|
|
@@ -47,19 +94,17 @@ export class Thumb extends UploaderBlock {
|
|
|
47
94
|
}
|
|
48
95
|
|
|
49
96
|
/** @private */
|
|
50
|
-
async
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
let
|
|
55
|
-
|
|
56
|
-
if (entry.getValue('fileInfo') && entry.getValue('isImage')) {
|
|
57
|
-
let size = this._calculateThumbSize();
|
|
97
|
+
_generateThumbnail = this._withEntry(async (entry) => {
|
|
98
|
+
const fileInfo = entry.getValue('fileInfo');
|
|
99
|
+
const isImage = entry.getValue('isImage');
|
|
100
|
+
const uuid = entry.getValue('uuid');
|
|
101
|
+
let size = this._calculateThumbSize();
|
|
58
102
|
|
|
103
|
+
if (fileInfo && isImage && uuid) {
|
|
59
104
|
let thumbUrl = await this.proxyUrl(
|
|
60
105
|
createCdnUrl(
|
|
61
|
-
createOriginalUrl(this.cfg.cdnCname,
|
|
62
|
-
createCdnUrlModifiers(entry.getValue('cdnUrlModifiers'), `scale_crop/${size}x${size}/center
|
|
106
|
+
createOriginalUrl(this.cfg.cdnCname, uuid),
|
|
107
|
+
createCdnUrlModifiers(entry.getValue('cdnUrlModifiers'), `scale_crop/${size}x${size}/center`),
|
|
63
108
|
),
|
|
64
109
|
);
|
|
65
110
|
let currentThumbUrl = entry.getValue('thumbUrl');
|
|
@@ -70,11 +115,15 @@ export class Thumb extends UploaderBlock {
|
|
|
70
115
|
return;
|
|
71
116
|
}
|
|
72
117
|
|
|
73
|
-
if (entry.getValue('
|
|
74
|
-
|
|
75
|
-
|
|
118
|
+
if (entry.getValue('thumbUrl')) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const file = entry.getValue('file');
|
|
76
123
|
|
|
77
|
-
|
|
124
|
+
if (file?.type.includes('image')) {
|
|
125
|
+
try {
|
|
126
|
+
let thumbUrl = await generateThumb(file, size);
|
|
78
127
|
entry.setValue('thumbUrl', thumbUrl);
|
|
79
128
|
} catch (err) {
|
|
80
129
|
let color = window.getComputedStyle(this).getPropertyValue('--uc-muted-foreground');
|
|
@@ -84,7 +133,9 @@ export class Thumb extends UploaderBlock {
|
|
|
84
133
|
let color = window.getComputedStyle(this).getPropertyValue('--uc-muted-foreground');
|
|
85
134
|
entry.setValue('thumbUrl', fileCssBg(color));
|
|
86
135
|
}
|
|
87
|
-
}
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
_debouncedGenerateThumb = debounce(this._generateThumbnail.bind(this), 100);
|
|
88
139
|
|
|
89
140
|
/**
|
|
90
141
|
* @private
|
|
@@ -118,17 +169,17 @@ export class Thumb extends UploaderBlock {
|
|
|
118
169
|
this._entry = this.uploadCollection.read(value);
|
|
119
170
|
});
|
|
120
171
|
|
|
121
|
-
this.
|
|
172
|
+
this._subEntry('fileInfo', (fileInfo) => {
|
|
122
173
|
if (fileInfo?.isImage && this._isIntersecting) {
|
|
123
174
|
this._debouncedGenerateThumb();
|
|
124
175
|
}
|
|
125
176
|
});
|
|
126
177
|
|
|
127
|
-
this.
|
|
178
|
+
this._subEntry('thumbUrl', (thumbUrl) => {
|
|
128
179
|
this.$.thumbUrl = thumbUrl ? `url(${thumbUrl})` : '';
|
|
129
180
|
});
|
|
130
181
|
|
|
131
|
-
this.
|
|
182
|
+
this._subEntry('cdnUrlModifiers', () => {
|
|
132
183
|
if (this._isIntersecting) {
|
|
133
184
|
this._debouncedGenerateThumb();
|
|
134
185
|
}
|
|
@@ -148,6 +199,7 @@ export class Thumb extends UploaderBlock {
|
|
|
148
199
|
disconnectedCallback() {
|
|
149
200
|
super.disconnectedCallback();
|
|
150
201
|
|
|
202
|
+
this._entrySubs = new Set();
|
|
151
203
|
this._debouncedGenerateThumb.cancel();
|
|
152
204
|
this._observer?.disconnect();
|
|
153
205
|
}
|
|
@@ -61,9 +61,9 @@ export class EventEmitter {
|
|
|
61
61
|
*/
|
|
62
62
|
private _debugPrint;
|
|
63
63
|
/** @param {import('../../abstract/Block.js').Block} target */
|
|
64
|
-
bindTarget(target: import(
|
|
64
|
+
bindTarget(target: import("../../abstract/Block.js").Block): void;
|
|
65
65
|
/** @param {import('../../abstract/Block.js').Block} target */
|
|
66
|
-
unbindTarget(target: import(
|
|
66
|
+
unbindTarget(target: import("../../abstract/Block.js").Block): void;
|
|
67
67
|
/**
|
|
68
68
|
* @private
|
|
69
69
|
* @template {(typeof EventType)[keyof typeof EventType]} T
|
|
@@ -78,30 +78,30 @@ export class EventEmitter {
|
|
|
78
78
|
* @param {TDebounce extends false | undefined ? unknown : () => unknown} [payload]
|
|
79
79
|
* @param {{ debounce?: TDebounce }} [options]
|
|
80
80
|
*/
|
|
81
|
-
emit<T extends
|
|
82
|
-
debounce?: TDebounce
|
|
83
|
-
}
|
|
81
|
+
emit<T extends (typeof EventType)[keyof typeof EventType], TDebounce extends boolean | number | undefined>(type: T, payload?: TDebounce extends false | undefined ? unknown : () => unknown, { debounce }?: {
|
|
82
|
+
debounce?: TDebounce;
|
|
83
|
+
}): void;
|
|
84
84
|
}
|
|
85
85
|
export type EventPayload = {
|
|
86
|
-
[EventType.FILE_ADDED]: import(
|
|
87
|
-
[EventType.FILE_REMOVED]: import(
|
|
88
|
-
[EventType.FILE_UPLOAD_START]: import(
|
|
89
|
-
[EventType.FILE_UPLOAD_PROGRESS]: import(
|
|
90
|
-
[EventType.FILE_UPLOAD_SUCCESS]: import(
|
|
91
|
-
[EventType.FILE_UPLOAD_FAILED]: import(
|
|
92
|
-
[EventType.FILE_URL_CHANGED]: import(
|
|
86
|
+
[EventType.FILE_ADDED]: import("../../index.js").OutputFileEntry<"idle">;
|
|
87
|
+
[EventType.FILE_REMOVED]: import("../../index.js").OutputFileEntry<"removed">;
|
|
88
|
+
[EventType.FILE_UPLOAD_START]: import("../../index.js").OutputFileEntry<"uploading">;
|
|
89
|
+
[EventType.FILE_UPLOAD_PROGRESS]: import("../../index.js").OutputFileEntry<"uploading">;
|
|
90
|
+
[EventType.FILE_UPLOAD_SUCCESS]: import("../../index.js").OutputFileEntry<"success">;
|
|
91
|
+
[EventType.FILE_UPLOAD_FAILED]: import("../../index.js").OutputFileEntry<"failed">;
|
|
92
|
+
[EventType.FILE_URL_CHANGED]: import("../../index.js").OutputFileEntry<"success">;
|
|
93
93
|
[EventType.MODAL_OPEN]: void;
|
|
94
94
|
[EventType.MODAL_CLOSE]: void;
|
|
95
95
|
[EventType.ACTIVITY_CHANGE]: {
|
|
96
|
-
activity: import(
|
|
96
|
+
activity: import("../../abstract/ActivityBlock.js").ActivityType;
|
|
97
97
|
};
|
|
98
98
|
[EventType.UPLOAD_CLICK]: void;
|
|
99
|
-
[EventType.DONE_CLICK]: import(
|
|
100
|
-
[EventType.COMMON_UPLOAD_START]: import(
|
|
101
|
-
[EventType.COMMON_UPLOAD_PROGRESS]: import(
|
|
102
|
-
[EventType.COMMON_UPLOAD_SUCCESS]: import(
|
|
103
|
-
[EventType.COMMON_UPLOAD_FAILED]: import(
|
|
104
|
-
[EventType.CHANGE]: import(
|
|
105
|
-
[EventType.GROUP_CREATED]: import(
|
|
99
|
+
[EventType.DONE_CLICK]: import("../../index.js").OutputCollectionState;
|
|
100
|
+
[EventType.COMMON_UPLOAD_START]: import("../../index.js").OutputCollectionState<"uploading">;
|
|
101
|
+
[EventType.COMMON_UPLOAD_PROGRESS]: import("../../index.js").OutputCollectionState<"uploading">;
|
|
102
|
+
[EventType.COMMON_UPLOAD_SUCCESS]: import("../../index.js").OutputCollectionState<"success">;
|
|
103
|
+
[EventType.COMMON_UPLOAD_FAILED]: import("../../index.js").OutputCollectionState<"failed">;
|
|
104
|
+
[EventType.CHANGE]: import("../../index.js").OutputCollectionState;
|
|
105
|
+
[EventType.GROUP_CREATED]: import("../../index.js").OutputCollectionState<"success", "has-group">;
|
|
106
106
|
};
|
|
107
107
|
//# sourceMappingURL=EventEmitter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventEmitter.d.ts","sourceRoot":"","sources":["EventEmitter.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;IAmBE,uDAAuD;IACvD,
|
|
1
|
+
{"version":3,"file":"EventEmitter.d.ts","sourceRoot":"","sources":["EventEmitter.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;IAmBE,uDAAuD;IACvD,wBADY,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,EAGvC;IArBD;;;OAGG;IACH,sBAA0B;IAE1B;;;OAGG;IACH,iBAAqB;IAErB;;;OAGG;IACH,oBAAmB;IAOnB,8DAA8D;IAC9D,mBADY,OAAO,yBAAyB,EAAE,KAAK,QAGlD;IAED,8DAA8D;IAC9D,qBADY,OAAO,yBAAyB,EAAE,KAAK,QAGlD;IAED;;;;;OAKG;IACH,kBAaC;IAED;;;;;;OAMG;IACH,KAN0D,CAAC,SAA9C,CAAE,OAAO,SAAS,EAAE,MAAM,OAAO,SAAS,CAAE,EACb,SAAS,SAAvC,OAAO,GAAG,MAAM,GAAG,SAAU,QAChC,CAAC,YACD,SAAS,SAAS,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,OAAO,iBAC7D;QAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;KAAE,QAiBlC;CACF;2BAtGY;IACZ,CAAK,SAAS,CAAC,UAAU,CAAC,EAAE,OAAO,gBAAgB,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC7E,CAAK,SAAS,CAAC,YAAY,CAAC,EAAE,OAAO,gBAAgB,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IAClF,CAAK,SAAS,CAAC,iBAAiB,CAAC,EAAE,OAAO,gBAAgB,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;IACzF,CAAK,SAAS,CAAC,oBAAoB,CAAC,EAAE,OAAO,gBAAgB,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;IAC5F,CAAK,SAAS,CAAC,mBAAmB,CAAC,EAAE,OAAO,gBAAgB,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACzF,CAAK,SAAS,CAAC,kBAAkB,CAAC,EAAE,OAAO,gBAAgB,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;IACvF,CAAK,SAAS,CAAC,gBAAgB,CAAC,EAAE,OAAO,gBAAgB,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACtF,CAAK,SAAS,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC;IACjC,CAAK,SAAS,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC;IAClC,CAAK,SAAS,CAAC,eAAe,CAAC,EAAE;QAC3B,QAAQ,EAAE,OAAO,iCAAiC,EAAE,YAAY,CAAC;KAClE,CAAC;IACN,CAAK,SAAS,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC;IACnC,CAAK,SAAS,CAAC,UAAU,CAAC,EAAE,OAAO,gBAAgB,EAAE,qBAAqB,CAAC;IAC3E,CAAK,SAAS,CAAC,mBAAmB,CAAC,EAAE,OAAO,gBAAgB,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAC;IACjG,CAAK,SAAS,CAAC,sBAAsB,CAAC,EAAE,OAAO,gBAAgB,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAC;IACpG,CAAK,SAAS,CAAC,qBAAqB,CAAC,EAAE,OAAO,gBAAgB,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;IACjG,CAAK,SAAS,CAAC,oBAAoB,CAAC,EAAE,OAAO,gBAAgB,EAAE,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IAC/F,CAAK,SAAS,CAAC,MAAM,CAAC,EAAE,OAAO,gBAAgB,EAAE,qBAAqB,CAAC;IACvE,CAAK,SAAS,CAAC,aAAa,CAAC,EAAE,OAAO,gBAAgB,EAAE,qBAAqB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;CACnG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export type UploadCtxProvider = (
|
|
2
|
-
addEventListener<T extends
|
|
3
|
-
removeEventListener<
|
|
4
|
-
}
|
|
1
|
+
export type UploadCtxProvider = import("../../utils/mixinClass.js").MixinClass<typeof UploadCtxProviderClass, {
|
|
2
|
+
addEventListener<T extends (typeof import("./EventEmitter.js").EventType)[keyof typeof import("./EventEmitter.js").EventType]>(type: T, listener: (e: CustomEvent<import("./EventEmitter.js").EventPayload[T]>) => void, options?: boolean | AddEventListenerOptions): void;
|
|
3
|
+
removeEventListener<T extends (typeof import("./EventEmitter.js").EventType)[keyof typeof import("./EventEmitter.js").EventType]>(type: T, listener: (e: CustomEvent<import("./EventEmitter.js").EventPayload[T]>) => void, options?: boolean | EventListenerOptions): void;
|
|
4
|
+
}>;
|
|
5
5
|
/**
|
|
6
6
|
* @typedef {import('../../utils/mixinClass.js').MixinClass<
|
|
7
7
|
* typeof UploadCtxProviderClass,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadCtxProvider.d.ts","sourceRoot":"","sources":["UploadCtxProvider.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"UploadCtxProvider.d.ts","sourceRoot":"","sources":["UploadCtxProvider.js"],"names":[],"mappings":"gCAuBa,OAAO,2BAA2B,EAAE,UAAU,CAC1D,OAAW,sBAAsB,EACjC;IACM,gBAAgB,CACd,CAAC,SAAS,CAAC,cAAc,mBAAmB,EAAE,SAAS,CAAC,CAAC,MAAM,cAAc,mBAAmB,EAAE,SAAS,CAAC,EAE5G,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,OAAO,mBAAmB,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAC/E,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC1C,IAAI,CAAC;IACR,mBAAmB,CACjB,CAAC,SAAS,CAAC,cAAc,mBAAmB,EAAE,SAAS,CAAC,CAAC,MAAM,cAAc,mBAAmB,EAAE,SAAS,CAAC,EAE5G,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,OAAO,mBAAmB,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAC/E,OAAO,CAAC,EAAE,OAAO,GAAG,oBAAoB,GACvC,IAAI,CAAC;CACT,CACF;AAnBJ;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,gCAA4C,iBAAiB,CAAuD;AAxCpH;CAcC;;;;8BAhB6B,iCAAiC;0BACrC,mBAAmB"}
|
|
@@ -25,8 +25,8 @@ export class UploadList extends UploaderBlock {
|
|
|
25
25
|
'*commonProgress': number;
|
|
26
26
|
'*uploadList': never[];
|
|
27
27
|
'*uploadQueue': import("@uploadcare/upload-client").Queue;
|
|
28
|
-
'*collectionErrors':
|
|
29
|
-
'*collectionState': import("../../types").OutputCollectionState
|
|
28
|
+
'*collectionErrors': ReturnType<import("../../types").OutputErrorCollection>[];
|
|
29
|
+
'*collectionState': import("../../types").OutputCollectionState | null;
|
|
30
30
|
'*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
|
|
31
31
|
'*uploadTrigger': Set<string>;
|
|
32
32
|
'*secureUploadsManager': import("../../abstract/SecureUploadsManager.js").SecureUploadsManager | null;
|
|
@@ -49,7 +49,7 @@ export class UploadList extends UploaderBlock {
|
|
|
49
49
|
export namespace UploadList {
|
|
50
50
|
let template: string;
|
|
51
51
|
}
|
|
52
|
-
export type FilesViewMode =
|
|
52
|
+
export type FilesViewMode = "grid" | "list";
|
|
53
53
|
export type Summary = {
|
|
54
54
|
total: number;
|
|
55
55
|
succeed: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadList.d.ts","sourceRoot":"","sources":["UploadList.js"],"names":[],"mappings":"AAMA,+CAA+C;AAE/C;;;;;;;GAOG;AAEH;IAKE,4BAAoD;IAKlD
|
|
1
|
+
{"version":3,"file":"UploadList.d.ts","sourceRoot":"","sources":["UploadList.js"],"names":[],"mappings":"AAMA,+CAA+C;AAE/C;;;;;;;GAOG;AAEH;IAKE,4BAAoD;IAKlD;;;;;;;;;;;;;;;;+CALwC,aAAU;mCAOhD,aAAQ;6BAGN,2BACL;;wCAMK,wCAAwB;;;;;;MAc3B;IAGH,eAAe;IACf,yCASQ;IAER,eAAe;IACf,4BAuCC;IAED;;;OAGG;IACH,uBAmBC;CAwEF;;;;4BAvMa,MAAM,GAAG,MAAM;sBAGhB;IACR,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;8BAZ0B,iCAAiC"}
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
* @param {String} [color2]
|
|
4
4
|
* @returns {String}
|
|
5
5
|
*/
|
|
6
|
-
export function checkerboardCssBg(color1?: string
|
|
6
|
+
export function checkerboardCssBg(color1?: string, color2?: string): string;
|
|
7
7
|
/**
|
|
8
8
|
* @param {String} [color]
|
|
9
9
|
* @returns {String}
|
|
10
10
|
*/
|
|
11
|
-
export function strokesCssBg(color?: string
|
|
11
|
+
export function strokesCssBg(color?: string): string;
|
|
12
12
|
/**
|
|
13
13
|
* @param {String} [color]
|
|
14
14
|
* @returns {String}
|
|
15
15
|
*/
|
|
16
|
-
export function fileCssBg(color?: string
|
|
16
|
+
export function fileCssBg(color?: string, width?: number, height?: number): string;
|
|
17
17
|
//# sourceMappingURL=svg-backgrounds.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svg-backgrounds.d.ts","sourceRoot":"","sources":["svg-backgrounds.js"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"svg-backgrounds.d.ts","sourceRoot":"","sources":["svg-backgrounds.js"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,4EAMC;AAED;;;GAGG;AACH,qDAIC;AAED;;;GAGG;AACH,mFAMC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svg-sprite.d.ts","sourceRoot":"","sources":["svg-sprite.js"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"svg-sprite.d.ts","sourceRoot":"","sources":["svg-sprite.js"],"names":[],"mappings":"wBAAe,kztBAAkztB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadSource.d.ts","sourceRoot":"","sources":["UploadSource.js"],"names":[],"mappings":"AACA;;;;;;;;;;;GAWG;AAEH;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;GAWG;0BAEW,CAAC,
|
|
1
|
+
{"version":3,"file":"UploadSource.d.ts","sourceRoot":"","sources":["UploadSource.js"],"names":[],"mappings":"AACA;;;;;;;;;;;GAWG;AAEH;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;GAWG;0BAEW,CAAC,OAAO,YAAY,EAAE,MAAM,OAAO,YAAY,CAAC"}
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
* @param {number} wait
|
|
5
5
|
* @returns {T & { cancel: () => void }} }
|
|
6
6
|
*/
|
|
7
|
-
export function debounce<T extends
|
|
7
|
+
export function debounce<T extends {
|
|
8
|
+
(...args: any[]): any;
|
|
9
|
+
}>(callback: T, wait: number): T & {
|
|
8
10
|
cancel: () => void;
|
|
9
11
|
};
|
|
10
12
|
//# sourceMappingURL=debounce.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["debounce.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,
|
|
1
|
+
{"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["debounce.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,yBALyC,CAAC,SAA7B;IAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAA;CAAG,YAC7B,CAAC,QACD,MAAM,GACJ,CAAC,GAAG;IAAE,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,CAetC"}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* @param {File} imgFile
|
|
3
3
|
* @param {Number} [size]
|
|
4
4
|
*/
|
|
5
|
-
export function generateThumb(imgFile: File, size?: number
|
|
5
|
+
export function generateThumb(imgFile: File, size?: number): string | Promise<any>;
|
|
6
6
|
//# sourceMappingURL=resizeImage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resizeImage.d.ts","sourceRoot":"","sources":["resizeImage.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,uCAHW,IAAI,
|
|
1
|
+
{"version":3,"file":"resizeImage.d.ts","sourceRoot":"","sources":["resizeImage.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,uCAHW,IAAI,wCAsCd"}
|