@uploadcare/file-uploader 1.15.0-alpha.9 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +125 -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 +123 -63
- package/abstract/uploadEntrySchema.d.ts.map +1 -1
- package/abstract/uploadEntrySchema.js +66 -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 +8 -1
- package/blocks/CloudImageEditor/src/CropFrame.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/CropFrame.js +50 -0
- package/blocks/CloudImageEditor/src/EditorFilterControl.js +1 -1
- package/blocks/CloudImageEditor/src/EditorImageCropper.d.ts +3 -3
- package/blocks/CloudImageEditor/src/EditorImageCropper.js +1 -1
- package/blocks/CloudImageEditor/src/EditorImageFader.d.ts +1 -1
- package/blocks/CloudImageEditor/src/EditorImageFader.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/EditorImageFader.js +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/EditorToolbar.js +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/css/common.css +4 -0
- 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 +3 -1
- package/blocks/Config/normalizeConfigValue.d.ts.map +1 -1
- package/blocks/Config/normalizeConfigValue.js +1 -0
- 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 +12 -39
- package/blocks/FileItem/FileItem.d.ts.map +1 -1
- package/blocks/FileItem/FileItem.js +114 -178
- package/blocks/FileItem/FileItemConfig.d.ts +28 -0
- package/blocks/FileItem/FileItemConfig.d.ts.map +1 -0
- package/blocks/FileItem/FileItemConfig.js +74 -0
- package/blocks/FileItem/file-item.css +21 -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 +41 -44
- package/blocks/ProgressBar/progress-bar.css +8 -6
- 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 +30 -5
- package/blocks/Thumb/Thumb.d.ts.map +1 -1
- package/blocks/Thumb/Thumb.js +188 -22
- 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/{CloudImageEditor/src/lib → utils}/preloadImage.js +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 +1 -1
- package/env.d.ts.map +1 -1
- package/env.js +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.ssr.d.ts +9 -1
- package/index.ssr.d.ts.map +1 -1
- package/index.ssr.js +18 -10
- package/locales/file-uploader/ar.d.ts +1 -0
- package/locales/file-uploader/ar.js +1 -0
- package/locales/file-uploader/az.d.ts +1 -0
- package/locales/file-uploader/az.js +1 -0
- package/locales/file-uploader/ca.d.ts +1 -0
- package/locales/file-uploader/ca.js +1 -0
- package/locales/file-uploader/cs.d.ts +1 -0
- package/locales/file-uploader/cs.js +1 -0
- package/locales/file-uploader/da.d.ts +1 -0
- package/locales/file-uploader/da.js +1 -0
- package/locales/file-uploader/de.d.ts +1 -0
- package/locales/file-uploader/de.js +1 -0
- package/locales/file-uploader/el.d.ts +1 -0
- package/locales/file-uploader/el.js +1 -0
- package/locales/file-uploader/en.d.ts +1 -0
- package/locales/file-uploader/en.js +1 -0
- package/locales/file-uploader/es.d.ts +1 -0
- package/locales/file-uploader/es.js +1 -0
- package/locales/file-uploader/et.d.ts +1 -0
- package/locales/file-uploader/et.js +1 -0
- package/locales/file-uploader/fi.d.ts +1 -0
- package/locales/file-uploader/fi.js +1 -0
- package/locales/file-uploader/fr.d.ts +1 -0
- package/locales/file-uploader/fr.js +1 -0
- package/locales/file-uploader/he.d.ts +1 -0
- package/locales/file-uploader/he.js +1 -0
- package/locales/file-uploader/hy.d.ts +1 -0
- package/locales/file-uploader/hy.js +1 -0
- package/locales/file-uploader/is.d.ts +1 -0
- package/locales/file-uploader/is.js +1 -0
- package/locales/file-uploader/it.d.ts +1 -0
- package/locales/file-uploader/it.js +1 -0
- package/locales/file-uploader/ja.d.ts +1 -0
- package/locales/file-uploader/ja.js +1 -0
- package/locales/file-uploader/ka.d.ts +1 -0
- package/locales/file-uploader/ka.js +1 -0
- package/locales/file-uploader/kk.d.ts +1 -0
- package/locales/file-uploader/kk.js +1 -0
- package/locales/file-uploader/ko.d.ts +1 -0
- package/locales/file-uploader/ko.js +1 -0
- package/locales/file-uploader/lv.d.ts +1 -0
- package/locales/file-uploader/lv.js +1 -0
- package/locales/file-uploader/nb.d.ts +1 -0
- package/locales/file-uploader/nb.js +1 -0
- package/locales/file-uploader/nl.d.ts +1 -0
- package/locales/file-uploader/nl.js +1 -0
- package/locales/file-uploader/pl.d.ts +1 -0
- package/locales/file-uploader/pl.js +1 -0
- package/locales/file-uploader/pt.d.ts +1 -0
- package/locales/file-uploader/pt.js +1 -0
- package/locales/file-uploader/ro.d.ts +1 -0
- package/locales/file-uploader/ro.js +1 -0
- package/locales/file-uploader/ru.d.ts +1 -0
- package/locales/file-uploader/ru.js +1 -0
- package/locales/file-uploader/sk.d.ts +1 -0
- package/locales/file-uploader/sk.js +1 -0
- package/locales/file-uploader/sr.d.ts +1 -0
- package/locales/file-uploader/sr.js +1 -0
- package/locales/file-uploader/sv.d.ts +1 -0
- package/locales/file-uploader/sv.js +1 -0
- package/locales/file-uploader/tr.d.ts +1 -0
- package/locales/file-uploader/tr.js +1 -0
- package/locales/file-uploader/uk.d.ts +1 -0
- package/locales/file-uploader/uk.js +1 -0
- package/locales/file-uploader/vi.d.ts +1 -0
- package/locales/file-uploader/vi.js +1 -0
- package/locales/file-uploader/zh-TW.d.ts +1 -0
- package/locales/file-uploader/zh-TW.js +1 -0
- package/locales/file-uploader/zh.d.ts +1 -0
- package/locales/file-uploader/zh.js +1 -0
- package/package.json +7 -8
- 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/FileUploaderMinimal.js +8 -1
- package/solutions/file-uploader/minimal/index.css +5 -23
- package/solutions/file-uploader/regular/FileUploaderRegular.d.ts +2 -2
- package/solutions/file-uploader/regular/FileUploaderRegular.d.ts.map +1 -1
- package/types/exported.d.ts +51 -49
- 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.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 +2 -2
- package/blocks/utils/supportCapture.d.ts +0 -2
- package/blocks/utils/supportCapture.d.ts.map +0 -1
- package/blocks/utils/supportCapture.js +0 -3
- /package/blocks/{CloudImageEditor/src/lib → utils}/preloadImage.d.ts +0 -0
- /package/blocks/{CloudImageEditor/src/lib → utils}/preloadImage.d.ts.map +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uploadcare/file-uploader",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"description": "Building blocks for Uploadcare products integration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web components",
|
|
@@ -35,9 +35,7 @@
|
|
|
35
35
|
"MIT"
|
|
36
36
|
],
|
|
37
37
|
"type": "module",
|
|
38
|
-
"sideEffects": [
|
|
39
|
-
"*.css"
|
|
40
|
-
],
|
|
38
|
+
"sideEffects": ["*.css"],
|
|
41
39
|
"module": "./index.js",
|
|
42
40
|
"exports": {
|
|
43
41
|
".": {
|
|
@@ -100,13 +98,14 @@
|
|
|
100
98
|
"@babel/preset-env": "^7.21.4",
|
|
101
99
|
"@esm-bundle/chai": "^4.3.4-fix.0",
|
|
102
100
|
"@happy-dom/global-registrator": "^16.8.1",
|
|
103
|
-
"@total-typescript/ts-reset": "^0.
|
|
101
|
+
"@total-typescript/ts-reset": "^0.6.1",
|
|
104
102
|
"@types/chai": "^4.3.4",
|
|
105
103
|
"@types/mocha": "^10.0.1",
|
|
106
104
|
"@types/node": "^18.15.11",
|
|
107
105
|
"@types/react": "^18.2.34",
|
|
106
|
+
"@types/sinon": "^17.0.4",
|
|
108
107
|
"@web/test-runner": "^0.19.0",
|
|
109
|
-
"esbuild": "^0.
|
|
108
|
+
"esbuild": "^0.25.1",
|
|
110
109
|
"eslint": "^8.56.0",
|
|
111
110
|
"eslint-config-prettier": "^9.1.0",
|
|
112
111
|
"eslint-plugin-import": "^2.29.1",
|
|
@@ -126,8 +125,8 @@
|
|
|
126
125
|
"stylelint-declaration-block-no-ignored-properties": "^2.7.0",
|
|
127
126
|
"stylelint-order": "^6.0.3",
|
|
128
127
|
"svg-sprite": "^2.0.4",
|
|
129
|
-
"tsd": "^0.
|
|
130
|
-
"typescript": "^5.
|
|
128
|
+
"tsd": "^0.31.2",
|
|
129
|
+
"typescript": "^5.8.2"
|
|
131
130
|
},
|
|
132
131
|
"author": "Uploadcare Inc.",
|
|
133
132
|
"license": "MIT",
|
|
@@ -5,8 +5,8 @@ export class FileUploaderInline extends SolutionBlock {
|
|
|
5
5
|
'*commonProgress': number;
|
|
6
6
|
'*uploadList': never[];
|
|
7
7
|
'*uploadQueue': import("@uploadcare/upload-client").Queue;
|
|
8
|
-
'*collectionErrors':
|
|
9
|
-
'*collectionState': import("./index.js").OutputCollectionState
|
|
8
|
+
'*collectionErrors': ReturnType<import("./index.js").OutputErrorCollection>[];
|
|
9
|
+
'*collectionState': import("./index.js").OutputCollectionState | null;
|
|
10
10
|
'*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
|
|
11
11
|
'*uploadTrigger': Set<string>;
|
|
12
12
|
'*secureUploadsManager': import("../../../abstract/SecureUploadsManager.js").SecureUploadsManager | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUploaderInline.d.ts","sourceRoot":"","sources":["FileUploaderInline.js"],"names":[],"mappings":"AAIA;IAMI
|
|
1
|
+
{"version":3,"file":"FileUploaderInline.d.ts","sourceRoot":"","sources":["FileUploaderInline.js"],"names":[],"mappings":"AAIA;IAMI;;;;;;+CAcoB,YAAU;mCACsC,YAAU;6BAIhD,2BAA2B;;wCAMS,2CACnD;;;;;;MAhBd;IAGH,gCAGC;IAED,6BAEC;CA0BF;;;;8BAtD6B,oCAAoC"}
|
|
@@ -7,8 +7,8 @@ export class FileUploaderMinimal extends SolutionBlock {
|
|
|
7
7
|
'*commonProgress': number;
|
|
8
8
|
'*uploadList': never[];
|
|
9
9
|
'*uploadQueue': import("@uploadcare/upload-client").Queue;
|
|
10
|
-
'*collectionErrors':
|
|
11
|
-
'*collectionState': import("./index.js").OutputCollectionState
|
|
10
|
+
'*collectionErrors': ReturnType<import("./index.js").OutputErrorCollection>[];
|
|
11
|
+
'*collectionState': import("./index.js").OutputCollectionState | null;
|
|
12
12
|
'*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
|
|
13
13
|
'*uploadTrigger': Set<string>;
|
|
14
14
|
'*secureUploadsManager': import("../../../abstract/SecureUploadsManager.js").SecureUploadsManager | null;
|
|
@@ -19,20 +19,20 @@ export class FileUploaderMinimal extends SolutionBlock {
|
|
|
19
19
|
'*closeModal': () => void;
|
|
20
20
|
};
|
|
21
21
|
_handleModalOpen(data: {
|
|
22
|
-
id:
|
|
23
|
-
modal
|
|
22
|
+
id: import("../../../abstract/ModalManager.js").ModalId;
|
|
23
|
+
modal: import("../../../abstract/ModalManager.js").ModalNode;
|
|
24
24
|
}): void;
|
|
25
25
|
_handleModalClose(data: {
|
|
26
|
-
id:
|
|
27
|
-
modal
|
|
26
|
+
id: import("../../../abstract/ModalManager.js").ModalId;
|
|
27
|
+
modal: import("../../../abstract/ModalManager.js").ModalNode;
|
|
28
28
|
}): void;
|
|
29
29
|
handleModalOpen: ((data: {
|
|
30
|
-
id:
|
|
31
|
-
modal
|
|
30
|
+
id: import("../../../abstract/ModalManager.js").ModalId;
|
|
31
|
+
modal: import("../../../abstract/ModalManager.js").ModalNode;
|
|
32
32
|
}) => void) | undefined;
|
|
33
33
|
handleModalClose: ((data: {
|
|
34
|
-
id:
|
|
35
|
-
modal
|
|
34
|
+
id: import("../../../abstract/ModalManager.js").ModalId;
|
|
35
|
+
modal: import("../../../abstract/ModalManager.js").ModalNode;
|
|
36
36
|
}) => void) | undefined;
|
|
37
37
|
}
|
|
38
38
|
export namespace FileUploaderMinimal {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUploaderMinimal.d.ts","sourceRoot":"","sources":["FileUploaderMinimal.js"],"names":[],"mappings":"AAQA;IAMI
|
|
1
|
+
{"version":3,"file":"FileUploaderMinimal.d.ts","sourceRoot":"","sources":["FileUploaderMinimal.js"],"names":[],"mappings":"AAQA;IAMI;;;;;;;;+CASqD,YAAU;mCAEf,YAClD;6BAKS,2BAA2B;;wCAIhC,2CAGI;;;;;;MAlBL;;;;;;;;;IA8FD;;;4BAAuD;IACvD;;;4BAAyD;CAW5D;;;;8BA5H6B,oCAAoC"}
|
|
@@ -22,7 +22,13 @@ export class FileUploaderMinimal extends SolutionBlock {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/** @type {import('../../../abstract/ModalManager.js').ModalCb} */
|
|
25
|
-
_handleModalOpen() {
|
|
25
|
+
_handleModalOpen(e) {
|
|
26
|
+
if (e.id === ActivityBlock.activities.CLOUD_IMG_EDIT) {
|
|
27
|
+
this.set$({
|
|
28
|
+
classUploadList: ACTIVE_CLASS,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
26
32
|
if (this.$['*currentActivity'] === ActivityBlock.activities.UPLOAD_LIST) {
|
|
27
33
|
this.set$({
|
|
28
34
|
classUploadList: ACTIVE_CLASS,
|
|
@@ -75,6 +81,7 @@ export class FileUploaderMinimal extends SolutionBlock {
|
|
|
75
81
|
} else {
|
|
76
82
|
this.set$({
|
|
77
83
|
classUploadList: EMPTY_CLASS,
|
|
84
|
+
isHiddenStartFrom: false,
|
|
78
85
|
});
|
|
79
86
|
this.$['*currentActivity'] = uBlock.initActivity || ActivityBlock.activities.START_FROM;
|
|
80
87
|
}
|
|
@@ -1,28 +1,5 @@
|
|
|
1
1
|
@import url('../../../blocks/themes/uc-basic/index.css');
|
|
2
2
|
|
|
3
|
-
/* @import url('../../../blocks/themes/uc-basic/config.css'); */
|
|
4
|
-
|
|
5
|
-
/* COMMON STYLES */
|
|
6
|
-
|
|
7
|
-
/* @import url('../../../blocks/themes/uc-basic/common.css'); */
|
|
8
|
-
|
|
9
|
-
/* THEME */
|
|
10
|
-
|
|
11
|
-
/* @import url('../../../blocks/themes/uc-basic/theme.css'); */
|
|
12
|
-
|
|
13
|
-
/* BLOCKS: */
|
|
14
|
-
|
|
15
|
-
/* @import url('../../../blocks/StartFrom/start-from.css');
|
|
16
|
-
@import url('../../../blocks/DropArea/drop-area.css');
|
|
17
|
-
@import url('../../../blocks/UploadList/upload-list.css');
|
|
18
|
-
@import url('../../../blocks/FileItem/file-item.css');
|
|
19
|
-
@import url('../../../blocks/Icon/icon.css');
|
|
20
|
-
@import url('../../../blocks/ProgressBar/progress-bar.css');
|
|
21
|
-
@import url('../../../blocks/Copyright/copyright.css');
|
|
22
|
-
@import url('../../../blocks/Modal/modal.css');
|
|
23
|
-
@import url('../../../blocks/CloudImageEditor/index.css');
|
|
24
|
-
@import url('../../../blocks/CloudImageEditorActivity/index.css'); */
|
|
25
|
-
|
|
26
3
|
/* ICONS: */
|
|
27
4
|
:where([uc-file-uploader-minimal]) {
|
|
28
5
|
--cfg-init-activity: 'start-from';
|
|
@@ -133,6 +110,11 @@
|
|
|
133
110
|
border-radius: var(--uc-radius);
|
|
134
111
|
}
|
|
135
112
|
|
|
113
|
+
[uc-file-uploader-minimal] uc-file-item uc-progress-bar .uc-fake-progress {
|
|
114
|
+
background-color: var(--uc-primary-transparent);
|
|
115
|
+
border-radius: var(--uc-radius);
|
|
116
|
+
}
|
|
117
|
+
|
|
136
118
|
[uc-file-uploader-minimal] uc-upload-list uc-drop-area {
|
|
137
119
|
width: 100%;
|
|
138
120
|
height: 100%;
|
|
@@ -4,8 +4,8 @@ export class FileUploaderRegular extends SolutionBlock {
|
|
|
4
4
|
'*commonProgress': number;
|
|
5
5
|
'*uploadList': never[];
|
|
6
6
|
'*uploadQueue': import("@uploadcare/upload-client").Queue;
|
|
7
|
-
'*collectionErrors':
|
|
8
|
-
'*collectionState': import("./index.js").OutputCollectionState
|
|
7
|
+
'*collectionErrors': ReturnType<import("./index.js").OutputErrorCollection>[];
|
|
8
|
+
'*collectionState': import("./index.js").OutputCollectionState | null;
|
|
9
9
|
'*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
|
|
10
10
|
'*uploadTrigger': Set<string>;
|
|
11
11
|
'*secureUploadsManager': import("../../../abstract/SecureUploadsManager.js").SecureUploadsManager | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUploaderRegular.d.ts","sourceRoot":"","sources":["FileUploaderRegular.js"],"names":[],"mappings":"AAIA;IAMI
|
|
1
|
+
{"version":3,"file":"FileUploaderRegular.d.ts","sourceRoot":"","sources":["FileUploaderRegular.js"],"names":[],"mappings":"AAIA;IAMI;;;;;+CAmBsB,YAAU;mCAEmB,YAChD;6BAEO,2BAA2B;;wCAEnC,2CAAoB;;;;;;MAvBrB;CAaJ;;;;8BAzB6B,oCAAoC"}
|
package/types/exported.d.ts
CHANGED
|
@@ -285,6 +285,8 @@ export type ConfigType = {
|
|
|
285
285
|
gridShowFileNames: boolean;
|
|
286
286
|
|
|
287
287
|
cloudImageEditorAutoOpen: boolean;
|
|
288
|
+
|
|
289
|
+
cloudImageEditorMaskHref: string | null;
|
|
288
290
|
};
|
|
289
291
|
export type ConfigComplexType = Pick<ConfigType, (typeof complexConfigKeys)[number]>;
|
|
290
292
|
export type ConfigPlainType = Omit<ConfigType, keyof ConfigComplexType>;
|
|
@@ -292,8 +294,8 @@ export type ConfigAttributesType = KebabCaseKeys<ConfigPlainType> & LowerCaseKey
|
|
|
292
294
|
|
|
293
295
|
export type KebabCase<S extends string> = S extends `${infer C}${infer T}`
|
|
294
296
|
? T extends Uncapitalize<T>
|
|
295
|
-
|
|
296
|
-
|
|
297
|
+
? `${Uncapitalize<C>}${KebabCase<T>}`
|
|
298
|
+
: `${Uncapitalize<C>}-${KebabCase<T>}`
|
|
297
299
|
: S;
|
|
298
300
|
export type KebabCaseKeys<T extends Record<string, unknown>> = { [Key in keyof T as KebabCase<Key & string>]: T[Key] };
|
|
299
301
|
export type LowerCase<S extends string> = Lowercase<S>;
|
|
@@ -352,17 +354,17 @@ export type OutputErrorTypePayload = {
|
|
|
352
354
|
|
|
353
355
|
export type OutputError<T extends OutputFileErrorType | OutputCollectionErrorType> = T extends OutputCustomErrorType
|
|
354
356
|
? {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
357
|
+
type?: T;
|
|
358
|
+
message: string;
|
|
359
|
+
payload?: OutputErrorTypePayload[T];
|
|
360
|
+
}
|
|
359
361
|
: T extends keyof OutputErrorTypePayload
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
362
|
+
? {
|
|
363
|
+
type: T;
|
|
364
|
+
message: string;
|
|
365
|
+
payload?: OutputErrorTypePayload[T];
|
|
366
|
+
}
|
|
367
|
+
: never;
|
|
366
368
|
|
|
367
369
|
export type OutputErrorFile = OutputError<OutputFileErrorType>;
|
|
368
370
|
|
|
@@ -384,7 +386,7 @@ export type OutputFileEntry<TStatus extends OutputFileStatus = OutputFileStatus>
|
|
|
384
386
|
fullPath: string | null;
|
|
385
387
|
source: SourceTypes | null;
|
|
386
388
|
} & (
|
|
387
|
-
|
|
389
|
+
| {
|
|
388
390
|
status: 'success';
|
|
389
391
|
fileInfo: UploadcareFile;
|
|
390
392
|
uuid: string;
|
|
@@ -396,7 +398,7 @@ export type OutputFileEntry<TStatus extends OutputFileStatus = OutputFileStatus>
|
|
|
396
398
|
isRemoved: false;
|
|
397
399
|
errors: [];
|
|
398
400
|
}
|
|
399
|
-
|
|
401
|
+
| {
|
|
400
402
|
status: 'failed';
|
|
401
403
|
fileInfo: UploadcareFile | null;
|
|
402
404
|
uuid: string | null;
|
|
@@ -408,7 +410,7 @@ export type OutputFileEntry<TStatus extends OutputFileStatus = OutputFileStatus>
|
|
|
408
410
|
isRemoved: false;
|
|
409
411
|
errors: OutputError<OutputFileErrorType>[];
|
|
410
412
|
}
|
|
411
|
-
|
|
413
|
+
| {
|
|
412
414
|
status: 'uploading';
|
|
413
415
|
fileInfo: null;
|
|
414
416
|
uuid: null;
|
|
@@ -420,7 +422,7 @@ export type OutputFileEntry<TStatus extends OutputFileStatus = OutputFileStatus>
|
|
|
420
422
|
isRemoved: false;
|
|
421
423
|
errors: [];
|
|
422
424
|
}
|
|
423
|
-
|
|
425
|
+
| {
|
|
424
426
|
status: 'removed';
|
|
425
427
|
fileInfo: UploadcareFile | null;
|
|
426
428
|
uuid: string | null;
|
|
@@ -432,7 +434,7 @@ export type OutputFileEntry<TStatus extends OutputFileStatus = OutputFileStatus>
|
|
|
432
434
|
isRemoved: true;
|
|
433
435
|
errors: OutputError<OutputFileErrorType>[];
|
|
434
436
|
}
|
|
435
|
-
|
|
437
|
+
| {
|
|
436
438
|
status: 'idle';
|
|
437
439
|
fileInfo: null;
|
|
438
440
|
uuid: null;
|
|
@@ -444,7 +446,7 @@ export type OutputFileEntry<TStatus extends OutputFileStatus = OutputFileStatus>
|
|
|
444
446
|
isRemoved: false;
|
|
445
447
|
errors: [];
|
|
446
448
|
}
|
|
447
|
-
);
|
|
449
|
+
);
|
|
448
450
|
|
|
449
451
|
export type OutputCollectionStatus = 'idle' | 'uploading' | 'success' | 'failed';
|
|
450
452
|
|
|
@@ -468,43 +470,43 @@ export type OutputCollectionState<
|
|
|
468
470
|
} & (TGroupFlag extends 'has-group'
|
|
469
471
|
? { group: UploadcareGroup }
|
|
470
472
|
: TGroupFlag extends 'maybe-has-group'
|
|
471
|
-
|
|
472
|
-
|
|
473
|
+
? { group: UploadcareGroup | null }
|
|
474
|
+
: never) &
|
|
473
475
|
(
|
|
474
476
|
| {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
477
|
+
status: 'idle';
|
|
478
|
+
isFailed: false;
|
|
479
|
+
isUploading: false;
|
|
480
|
+
isSuccess: false;
|
|
481
|
+
errors: [];
|
|
482
|
+
allEntries: OutputFileEntry<'idle' | 'success'>[];
|
|
483
|
+
}
|
|
482
484
|
| {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
485
|
+
status: 'uploading';
|
|
486
|
+
isFailed: false;
|
|
487
|
+
isUploading: true;
|
|
488
|
+
isSuccess: false;
|
|
489
|
+
errors: [];
|
|
490
|
+
allEntries: OutputFileEntry[];
|
|
491
|
+
}
|
|
490
492
|
| {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
493
|
+
status: 'success';
|
|
494
|
+
isFailed: false;
|
|
495
|
+
isUploading: false;
|
|
496
|
+
isSuccess: true;
|
|
497
|
+
errors: [];
|
|
498
|
+
allEntries: OutputFileEntry<'success'>[];
|
|
499
|
+
}
|
|
498
500
|
| {
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
501
|
+
status: 'failed';
|
|
502
|
+
isFailed: true;
|
|
503
|
+
isUploading: false;
|
|
504
|
+
isSuccess: false;
|
|
505
|
+
errors: OutputError<OutputCollectionErrorType>[];
|
|
506
|
+
allEntries: OutputFileEntry[];
|
|
507
|
+
}
|
|
506
508
|
);
|
|
507
509
|
|
|
508
510
|
export { EventType, EventPayload } from '../blocks/UploadCtxProvider/EventEmitter';
|
|
509
511
|
|
|
510
|
-
export {};
|
|
512
|
+
export { };
|
package/types/jsx.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ declare namespace JSX {
|
|
|
54
54
|
>;
|
|
55
55
|
'uc-cloud-image-editor': CustomElement<CloudImageEditorBlock, JSX.IntrinsicElements['uc-cloud-image-editor-block']>;
|
|
56
56
|
'uc-form-input': CustomElement<FormInput, CtxAttributes>;
|
|
57
|
-
'uc-file-uploader-regular': CustomElement<FileUploaderRegular, CtxAttributes
|
|
57
|
+
'uc-file-uploader-regular': CustomElement<FileUploaderRegular, CtxAttributes & Partial<{ headless: boolean }>>;
|
|
58
58
|
'uc-file-uploader-minimal': CustomElement<FileUploaderMinimal, CtxAttributes>;
|
|
59
59
|
'uc-file-uploader-inline': CustomElement<FileUploaderInline, CtxAttributes>;
|
|
60
60
|
'uc-upload-ctx-provider': CustomElement<InstanceType<UploadCtxProvider>, CtxAttributes>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function calcBrowserInfo(): {
|
|
2
|
+
safariDesktop: boolean;
|
|
3
|
+
};
|
|
4
|
+
export function calcBrowserFeatures(): {
|
|
5
|
+
htmlMediaCapture: boolean;
|
|
6
|
+
};
|
|
7
|
+
export namespace browserInfo {
|
|
8
|
+
let safariDesktop: boolean;
|
|
9
|
+
}
|
|
10
|
+
export namespace browserFeatures {
|
|
11
|
+
let htmlMediaCapture: boolean;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=browser-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-info.d.ts","sourceRoot":"","sources":["browser-info.js"],"names":[],"mappings":"AAWO;;EAEL;AAEK;;EAEL"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
const calcIsDesktopSafari = () => {
|
|
4
|
+
const ua = navigator.userAgent;
|
|
5
|
+
return /Macintosh|Windows/.test(ua) && /Version\/[\d\.]+.*Safari/.test(ua) && !/Chrome|Chromium|Edg|OPR/.test(ua);
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const calcHtmlMediaCaptureSupport = () => {
|
|
9
|
+
return 'capture' in document.createElement('input');
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const calcBrowserInfo = () => ({
|
|
13
|
+
safariDesktop: calcIsDesktopSafari(),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const calcBrowserFeatures = () => ({
|
|
17
|
+
htmlMediaCapture: calcHtmlMediaCaptureSupport(),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const browserInfo = calcBrowserInfo();
|
|
21
|
+
|
|
22
|
+
export const browserFeatures = calcBrowserFeatures();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-info.test.d.ts","sourceRoot":"","sources":["browser-info.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { expect } from '@esm-bundle/chai';
|
|
3
|
+
import { calcBrowserFeatures, calcBrowserInfo } from './browser-info';
|
|
4
|
+
import * as sinon from 'sinon';
|
|
5
|
+
|
|
6
|
+
const DESKTOP_SAFARI_USER_AGENTS = [
|
|
7
|
+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15',
|
|
8
|
+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15',
|
|
9
|
+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15',
|
|
10
|
+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_0) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15',
|
|
11
|
+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 13_0) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15',
|
|
12
|
+
'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6; en-US) AppleWebKit/533.18.1 (KHTML, like Gecko) Version/5.0.4 Safari/533.18.5',
|
|
13
|
+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/601.7.8 (KHTML, like Gecko) Version/9.1.2 Safari/601.7.8',
|
|
14
|
+
'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_7_5; en-US) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.10 Safari/534.57.2',
|
|
15
|
+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/602.3.12 (KHTML, like Gecko) Version/10.0.3 Safari/602.4.8',
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
const MOBILE_SAFARI_USER_AGENTS = [
|
|
19
|
+
'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15A5365e Safari/604.1',
|
|
20
|
+
'Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/604.1',
|
|
21
|
+
'Mozilla/5.0 (iPad; CPU OS 15_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Mobile/15E148 Safari/604.1',
|
|
22
|
+
'Mozilla/5.0 (iPod touch; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Mobile/15E148 Safari/604.1',
|
|
23
|
+
'Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Mobile/15E148 Safari/604.1',
|
|
24
|
+
'Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1',
|
|
25
|
+
'Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/16A366 Safari/602.1',
|
|
26
|
+
'Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15G77 Safari/604.1',
|
|
27
|
+
'Mozilla/5.0 (iPad; CPU OS 13_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Mobile/15E148 Safari/604.1',
|
|
28
|
+
'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/14E5239e Safari/602.1',
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
const OTHER_DESKTOP_USER_AGENTS = [
|
|
32
|
+
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36',
|
|
33
|
+
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.64',
|
|
34
|
+
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:112.0) Gecko/20100101 Firefox/112.0',
|
|
35
|
+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36',
|
|
36
|
+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:112.0) Gecko/20100101 Firefox/112.0',
|
|
37
|
+
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36',
|
|
38
|
+
'Mozilla/5.0 (X11; Linux x86_64; rv:112.0) Gecko/20100101 Firefox/112.0',
|
|
39
|
+
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.5615.49 Safari/537.36 OPR/98.0.4759.82',
|
|
40
|
+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 OPR/98.0.4759.82',
|
|
41
|
+
'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko',
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
const OTHER_MOBILE_USER_AGENTS = [
|
|
45
|
+
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36',
|
|
46
|
+
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:115.0) Gecko/20100101 Firefox/115.0',
|
|
47
|
+
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.0.0',
|
|
48
|
+
'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko',
|
|
49
|
+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36',
|
|
50
|
+
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36',
|
|
51
|
+
'Mozilla/5.0 (X11; Linux x86_64; rv:115.0) Gecko/20100101 Firefox/115.0',
|
|
52
|
+
'Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Mobile Safari/537.36',
|
|
53
|
+
'Mozilla/5.0 (Android 11; Mobile; rv:115.0) Gecko/115.0 Firefox/115.0',
|
|
54
|
+
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 OPR/100.0.0.0',
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
describe('browser-info', () => {
|
|
58
|
+
describe('safariDesktop flag', () => {
|
|
59
|
+
it('should be true for desktop safari', () => {
|
|
60
|
+
const sandbox = sinon.createSandbox();
|
|
61
|
+
for (const ua of DESKTOP_SAFARI_USER_AGENTS) {
|
|
62
|
+
sandbox.replaceGetter(window.navigator, 'userAgent', () => ua);
|
|
63
|
+
const browserInfo = calcBrowserInfo();
|
|
64
|
+
expect(browserInfo.safariDesktop).to.be.true;
|
|
65
|
+
sandbox.restore();
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('should be false for other browsers', () => {
|
|
70
|
+
const sandbox = sinon.createSandbox();
|
|
71
|
+
for (const ua of [...OTHER_DESKTOP_USER_AGENTS, ...OTHER_MOBILE_USER_AGENTS, ...MOBILE_SAFARI_USER_AGENTS]) {
|
|
72
|
+
sandbox.replaceGetter(window.navigator, 'userAgent', () => ua);
|
|
73
|
+
const browserInfo = calcBrowserInfo();
|
|
74
|
+
expect(browserInfo.safariDesktop).to.be.false;
|
|
75
|
+
sandbox.restore();
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
describe('browser-features', () => {
|
|
82
|
+
describe('htmlMediaCapture', () => {
|
|
83
|
+
it('should be true if capture is supported', () => {
|
|
84
|
+
const sandbox = sinon.createSandbox();
|
|
85
|
+
const originalDocumentCreateElement = document.createElement.bind(document);
|
|
86
|
+
sandbox.replace(document, 'createElement', () => {
|
|
87
|
+
const input = originalDocumentCreateElement('input');
|
|
88
|
+
input.capture = '';
|
|
89
|
+
return input;
|
|
90
|
+
});
|
|
91
|
+
const browserFeatures = calcBrowserFeatures();
|
|
92
|
+
expect(browserFeatures.htmlMediaCapture).to.be.true;
|
|
93
|
+
sandbox.restore();
|
|
94
|
+
});
|
|
95
|
+
it('should be false if capture is not supported', () => {
|
|
96
|
+
const sandbox = sinon.createSandbox();
|
|
97
|
+
const originalDocumentCreateElement = document.createElement.bind(document);
|
|
98
|
+
sandbox.replace(document, 'createElement', () => {
|
|
99
|
+
const input = originalDocumentCreateElement('input');
|
|
100
|
+
// @ts-ignore
|
|
101
|
+
delete input.capture;
|
|
102
|
+
return input;
|
|
103
|
+
});
|
|
104
|
+
const browserFeatures = calcBrowserFeatures();
|
|
105
|
+
expect(browserFeatures.htmlMediaCapture).to.be.false;
|
|
106
|
+
sandbox.restore();
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
});
|
package/utils/cdn-utils.d.ts
CHANGED
|
@@ -52,8 +52,8 @@ export function splitFileUrl(fileUrl: string): {
|
|
|
52
52
|
hash: string;
|
|
53
53
|
};
|
|
54
54
|
export function normalizeCdnOperation(operation?: string | unknown): string;
|
|
55
|
-
export function joinCdnOperations(...operations?:
|
|
56
|
-
export function createCdnUrlModifiers(...cdnOperations?:
|
|
57
|
-
export function createCdnUrl(baseCdnUrl: string, cdnModifiers?: string
|
|
55
|
+
export function joinCdnOperations(...operations?: (string | unknown)[]): string;
|
|
56
|
+
export function createCdnUrlModifiers(...cdnOperations?: (string | unknown)[]): string;
|
|
57
|
+
export function createCdnUrl(baseCdnUrl: string, cdnModifiers?: string, filename?: string): string;
|
|
58
58
|
export function createOriginalUrl(cdnUrl: string, uuid: string): string;
|
|
59
59
|
//# sourceMappingURL=cdn-utils.d.ts.map
|
package/utils/cdn-utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdn-utils.d.ts","sourceRoot":"","sources":["cdn-utils.js"],"names":[],"mappings":"AAgDA;;;;;GAKG;AACH,wDAcC;AAED;;;;;GAKG;AACH,oCAHW,MAAM,GACJ,MAAM,CAQlB;AAED;;;;;GAKG;AACH,+CAHW,MAAM,GACJ,MAAM,CAYlB;AAED;;;;;GAKG;AACH,0CAHW,MAAM,GACJ,MAAM,EAAE,CASpB;AAED;;;;;GAKG;AACH,qDASC;AAED;;;;;GAKG;AACH,qDAEC;AAED;;;;;GAKG;AACH,+CAFa;IAAE,QAAQ,SAAS;IAAC,MAAM,SAAS;IAAC,IAAI,SAAQ;CAAE,CAS9D;AAvJM,kDAHI,SAAS,OAAO,UAkB1B;AAQM,
|
|
1
|
+
{"version":3,"file":"cdn-utils.d.ts","sourceRoot":"","sources":["cdn-utils.js"],"names":[],"mappings":"AAgDA;;;;;GAKG;AACH,wDAcC;AAED;;;;;GAKG;AACH,oCAHW,MAAM,GACJ,MAAM,CAQlB;AAED;;;;;GAKG;AACH,+CAHW,MAAM,GACJ,MAAM,CAYlB;AAED;;;;;GAKG;AACH,0CAHW,MAAM,GACJ,MAAM,EAAE,CASpB;AAED;;;;;GAKG;AACH,qDASC;AAED;;;;;GAKG;AACH,qDAEC;AAED;;;;;GAKG;AACH,+CAFa;IAAE,QAAQ,SAAS;IAAC,MAAM,SAAS;IAAC,IAAI,SAAQ;CAAE,CAS9D;AAvJM,kDAHI,SAAS,OAAO,UAkB1B;AAQM,kDAHO,CAAC,SAAS,OAAO,CAAC,EAAA,UAQ/B;AASM,yDAHO,CAAC,SAAS,OAAO,CAAC,EAAA,UAM/B;AA2HM,mGAgBN;AASM,wEAIN"}
|
package/utils/fileTypes.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
export const BASIC_IMAGE_WILDCARD: "image/*";
|
|
2
|
+
export const BASIC_VIDEO_WILDCARD: "video/*";
|
|
3
|
+
export const HEIC_IMAGE_MIME_LIST: string[];
|
|
4
|
+
export function calcImageAcceptList(): string[];
|
|
1
5
|
export const IMAGE_ACCEPT_LIST: string[];
|
|
2
|
-
export function mergeFileTypes(fileTypes?: string[]
|
|
6
|
+
export function mergeFileTypes(fileTypes?: string[]): string[];
|
|
3
7
|
export function matchMimeType(mimeType: string, allowedFileTypes: string[]): boolean;
|
|
4
8
|
export function matchExtension(fileName: string, allowedFileTypes: string[]): boolean;
|
|
5
9
|
export function fileIsImage(file: File | Blob): boolean;
|
package/utils/fileTypes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileTypes.d.ts","sourceRoot":"","sources":["fileTypes.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fileTypes.d.ts","sourceRoot":"","sources":["fileTypes.js"],"names":[],"mappings":"AAIA,mCAAoC,SAAS,CAAC;AAC9C,mCAAoC,SAAS,CAAC;AAC9C,4CAaE;AAEK,gDAUN;AAED,yCAAuD;AAMhD,2CAHI,MAAM,EAAE,GACN,MAAM,EAAE,CAUpB;AAOM,kEAHI,QAAQ,WAYlB;AAOM,mEAHI,QAAQ,WAWlB;AAMM,kCAHI,IAAI,GAAG,IAAI,WASrB;AAQM,6BAHI,OAAO,GACL,OAAO,CAInB;AAQM,6BAHI,OAAO,GACL,OAAO,CAInB"}
|
package/utils/fileTypes.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
+
import { browserInfo } from './browser-info.js';
|
|
2
3
|
import { stringToArray } from './stringToArray.js';
|
|
3
4
|
|
|
4
|
-
export const
|
|
5
|
-
|
|
5
|
+
export const BASIC_IMAGE_WILDCARD = 'image/*';
|
|
6
|
+
export const BASIC_VIDEO_WILDCARD = 'video/*';
|
|
7
|
+
export const HEIC_IMAGE_MIME_LIST = [
|
|
6
8
|
'image/heif',
|
|
7
9
|
'image/heif-sequence',
|
|
8
10
|
'image/heic',
|
|
@@ -17,6 +19,20 @@ export const IMAGE_ACCEPT_LIST = [
|
|
|
17
19
|
'.avifs',
|
|
18
20
|
];
|
|
19
21
|
|
|
22
|
+
export const calcImageAcceptList = () => {
|
|
23
|
+
// Desktop Safari allows selecting HEIC images with simple image/* wildcard
|
|
24
|
+
// But if we provide a more specific HEIC types - safari starts to convert any images to HEIC
|
|
25
|
+
if (browserInfo.safariDesktop) {
|
|
26
|
+
return [BASIC_IMAGE_WILDCARD];
|
|
27
|
+
}
|
|
28
|
+
// Other browsers allows to select HEIC images with more specific HEIC types only
|
|
29
|
+
// Mobile Safari will allow to select HEIC images even with simple image/* wildcard and it will convert them to JPEG by default (behaviour could be changed in file picker UI)
|
|
30
|
+
// Hope it will be fixed in the future so we'll add specific types so that Mobile Safari will know that we're supporting HEIC images
|
|
31
|
+
return [BASIC_IMAGE_WILDCARD, ...HEIC_IMAGE_MIME_LIST];
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const IMAGE_ACCEPT_LIST = calcImageAcceptList();
|
|
35
|
+
|
|
20
36
|
/**
|
|
21
37
|
* @param {string[]} [fileTypes]
|
|
22
38
|
* @returns {string[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPluralForm.d.ts","sourceRoot":"","sources":["getPluralForm.js"],"names":[],"mappings":"AASO,sCAJI,MAAM,SACN,MAAM,GACJ,UAAU,CAKtB;yBAVa,
|
|
1
|
+
{"version":3,"file":"getPluralForm.d.ts","sourceRoot":"","sources":["getPluralForm.js"],"names":[],"mappings":"AASO,sCAJI,MAAM,SACN,MAAM,GACJ,UAAU,CAKtB;yBAVa,IAAI,CAAC,cAAc"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function isSecureTokenExpired(secureToken: import(
|
|
1
|
+
export function isSecureTokenExpired(secureToken: import("../types").SecureUploadsSignatureAndExpire, { threshold }: {
|
|
2
2
|
threshold?: number;
|
|
3
3
|
}): boolean;
|
|
4
4
|
//# sourceMappingURL=isSecureTokenExpired.d.ts.map
|
package/utils/memoize.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memoize.d.ts","sourceRoot":"","sources":["memoize.js"],"names":[],"mappings":"AASO,
|
|
1
|
+
{"version":3,"file":"memoize.d.ts","sourceRoot":"","sources":["memoize.js"],"names":[],"mappings":"AASO,wBANc,KAAK,SAAZ,GAAG,EAAG,EACD,OAAO,kBACiB,CAAC,SAA/B,CAAE,GAAG,IAAI,EAAE,KAAK,KAAK,OAAQ,MAC/B,CAAC,GACC,CAAC,CAeb"}
|
package/utils/mixinClass.d.ts
CHANGED
|
@@ -4,5 +4,7 @@ export type GConstructor<T> = new (...args: any[]) => T;
|
|
|
4
4
|
* are some dynamic generated properties or native overrides in the class. We're use it to define dynamic access
|
|
5
5
|
* properties and events to subscribe to.
|
|
6
6
|
*/
|
|
7
|
-
export type MixinClass<Base extends GConstructor<HTMLElement>, InstanceProperties extends Record<string, any> = {}> =
|
|
7
|
+
export type MixinClass<Base extends GConstructor<HTMLElement>, InstanceProperties extends Record<string, any> = {}> = {
|
|
8
|
+
new (...args: ConstructorParameters<Base>): InstanceProperties & InstanceType<Base>;
|
|
9
|
+
} & Omit<Base, "new">;
|
|
8
10
|
//# sourceMappingURL=mixinClass.d.ts.map
|