@uploadcare/file-uploader 1.28.0-alpha.1 → 1.28.0-alpha.666
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abstract/loadFileUploaderFrom.d.ts +4 -3
- package/dist/abstract/loadFileUploaderFrom.js +6 -7
- package/dist/env.d.ts +4 -2
- package/dist/env.js +6 -7
- package/dist/index.css +6 -9
- package/dist/index.d.ts +3099 -42
- package/dist/index.js +8 -1796
- package/dist/index.layered.css +7 -9
- package/dist/index.ssr.js +1609 -0
- package/dist/locales/file-uploader/ar.d.ts +2 -1
- package/dist/locales/file-uploader/ar.js +6 -142
- package/dist/locales/file-uploader/az.d.ts +2 -1
- package/dist/locales/file-uploader/az.js +6 -134
- package/dist/locales/file-uploader/ca.d.ts +2 -1
- package/dist/locales/file-uploader/ca.js +6 -136
- package/dist/locales/file-uploader/cs.d.ts +2 -1
- package/dist/locales/file-uploader/cs.js +6 -138
- package/dist/locales/file-uploader/da.d.ts +2 -1
- package/dist/locales/file-uploader/da.js +6 -134
- package/dist/locales/file-uploader/de.d.ts +2 -1
- package/dist/locales/file-uploader/de.js +6 -134
- package/dist/locales/file-uploader/el.d.ts +2 -1
- package/dist/locales/file-uploader/el.js +6 -134
- package/dist/locales/file-uploader/en.d.ts +2 -1
- package/dist/locales/file-uploader/en.js +6 -7
- package/dist/locales/file-uploader/es.d.ts +2 -1
- package/dist/locales/file-uploader/es.js +6 -136
- package/dist/locales/file-uploader/et.d.ts +2 -1
- package/dist/locales/file-uploader/et.js +6 -134
- package/dist/locales/file-uploader/fi.d.ts +2 -1
- package/dist/locales/file-uploader/fi.js +6 -134
- package/dist/locales/file-uploader/fr.d.ts +2 -1
- package/dist/locales/file-uploader/fr.js +6 -136
- package/dist/locales/file-uploader/he.d.ts +2 -1
- package/dist/locales/file-uploader/he.js +6 -136
- package/dist/locales/file-uploader/hy.d.ts +2 -1
- package/dist/locales/file-uploader/hy.js +6 -134
- package/dist/locales/file-uploader/is.d.ts +2 -1
- package/dist/locales/file-uploader/is.js +6 -134
- package/dist/locales/file-uploader/it.d.ts +2 -1
- package/dist/locales/file-uploader/it.js +6 -136
- package/dist/locales/file-uploader/ja.d.ts +2 -1
- package/dist/locales/file-uploader/ja.js +6 -134
- package/dist/locales/file-uploader/ka.d.ts +2 -1
- package/dist/locales/file-uploader/ka.js +6 -134
- package/dist/locales/file-uploader/kk.d.ts +2 -1
- package/dist/locales/file-uploader/kk.js +6 -134
- package/dist/locales/file-uploader/ko.d.ts +2 -1
- package/dist/locales/file-uploader/ko.js +6 -134
- package/dist/locales/file-uploader/lv.d.ts +2 -1
- package/dist/locales/file-uploader/lv.js +6 -136
- package/dist/locales/file-uploader/nb.d.ts +2 -1
- package/dist/locales/file-uploader/nb.js +6 -134
- package/dist/locales/file-uploader/nl.d.ts +2 -1
- package/dist/locales/file-uploader/nl.js +6 -134
- package/dist/locales/file-uploader/pl.d.ts +2 -1
- package/dist/locales/file-uploader/pl.js +6 -138
- package/dist/locales/file-uploader/pt.d.ts +2 -1
- package/dist/locales/file-uploader/pt.js +6 -136
- package/dist/locales/file-uploader/ro.d.ts +2 -1
- package/dist/locales/file-uploader/ro.js +6 -136
- package/dist/locales/file-uploader/ru.d.ts +2 -1
- package/dist/locales/file-uploader/ru.js +6 -138
- package/dist/locales/file-uploader/sk.d.ts +2 -1
- package/dist/locales/file-uploader/sk.js +6 -138
- package/dist/locales/file-uploader/sr.d.ts +2 -1
- package/dist/locales/file-uploader/sr.js +6 -136
- package/dist/locales/file-uploader/sv.d.ts +2 -1
- package/dist/locales/file-uploader/sv.js +6 -134
- package/dist/locales/file-uploader/tr.d.ts +2 -1
- package/dist/locales/file-uploader/tr.js +6 -134
- package/dist/locales/file-uploader/uk.d.ts +2 -1
- package/dist/locales/file-uploader/uk.js +6 -138
- package/dist/locales/file-uploader/vi.d.ts +2 -1
- package/dist/locales/file-uploader/vi.js +6 -134
- package/dist/locales/file-uploader/zh-TW.d.ts +2 -1
- package/dist/locales/file-uploader/zh-TW.js +6 -134
- package/dist/locales/file-uploader/zh.d.ts +2 -1
- package/dist/locales/file-uploader/zh.js +6 -134
- package/package.json +34 -40
- package/web/file-uploader.iife.min.d.ts +3241 -0
- package/web/file-uploader.iife.min.js +8 -697
- package/web/file-uploader.iife.min.js.LEGAL.txt +71 -0
- package/web/file-uploader.min.d.ts +3241 -0
- package/web/file-uploader.min.js +7 -1858
- package/web/file-uploader.min.js.LEGAL.txt +71 -0
- package/web/uc-basic.layered.min.css +7 -6046
- package/web/uc-basic.min.css +6 -5487
- package/web/uc-cloud-image-editor.layered.min.css +7 -1884
- package/web/uc-cloud-image-editor.min.css +6 -1675
- package/web/uc-cloud-image-editor.min.d.ts +3198 -0
- package/web/uc-cloud-image-editor.min.js +7 -456
- package/web/uc-cloud-image-editor.min.js.LEGAL.txt +70 -0
- package/web/uc-file-uploader-inline.layered.min.css +7 -4352
- package/web/uc-file-uploader-inline.min.css +6 -3836
- package/web/uc-file-uploader-inline.min.d.ts +3241 -0
- package/web/uc-file-uploader-inline.min.js +7 -1858
- package/web/uc-file-uploader-inline.min.js.LEGAL.txt +71 -0
- package/web/uc-file-uploader-minimal.layered.min.css +7 -4352
- package/web/uc-file-uploader-minimal.min.css +6 -3836
- package/web/uc-file-uploader-minimal.min.d.ts +3241 -0
- package/web/uc-file-uploader-minimal.min.js +7 -1858
- package/web/uc-file-uploader-minimal.min.js.LEGAL.txt +71 -0
- package/web/uc-file-uploader-regular.layered.min.css +7 -4352
- package/web/uc-file-uploader-regular.min.css +6 -3836
- package/web/uc-file-uploader-regular.min.d.ts +3241 -0
- package/web/uc-file-uploader-regular.min.js +7 -1858
- package/web/uc-file-uploader-regular.min.js.LEGAL.txt +71 -0
- package/web/uc-img.min.d.ts +75 -0
- package/web/uc-img.min.js +7 -894
- package/web/uc-img.min.js.LEGAL.txt +24 -0
- package/dist/ActivityHeader-R6Mlx-dA.js +0 -9
- package/dist/ActivityHeader.css +0 -23
- package/dist/ActivityHeader.layered.css +0 -24
- package/dist/CameraSource-DDwj1jCV.js +0 -511
- package/dist/CameraSource-n1tun2Df.js +0 -10
- package/dist/CameraSource.css +0 -180
- package/dist/CameraSource.layered.css +0 -209
- package/dist/CloudImageEditor-DcVoIRb3.js +0 -2163
- package/dist/CloudImageEditorActivity-Csij4nlC.js +0 -87
- package/dist/CloudImageEditorActivity-DD4NdU0P.js +0 -9
- package/dist/CloudImageEditorActivity.css +0 -14
- package/dist/CloudImageEditorActivity.layered.css +0 -15
- package/dist/Config-DKOromHY.js +0 -433
- package/dist/Config.css +0 -4
- package/dist/Config.layered.css +0 -5
- package/dist/ExternalSource-6MSUgxqy.js +0 -10
- package/dist/ExternalSource-DVEjSkPB.js +0 -253
- package/dist/ExternalSource.css +0 -98
- package/dist/ExternalSource.layered.css +0 -116
- package/dist/Icon-tXRTvEF2.js +0 -1810
- package/dist/Icon.css +0 -14
- package/dist/Icon.layered.css +0 -15
- package/dist/LitUploaderBlock-LxeOZ0ya.js +0 -998
- package/dist/UrlSource-BkyX00I2.js +0 -73
- package/dist/UrlSource-RI8TSD48.js +0 -10
- package/dist/UrlSource.css +0 -17
- package/dist/UrlSource.layered.css +0 -18
- package/dist/abstract/CTX.d.ts +0 -40
- package/dist/abstract/TypedCollection.d.ts +0 -47
- package/dist/abstract/TypedCollection.test.d.ts +0 -1
- package/dist/abstract/TypedData.d.ts +0 -12
- package/dist/abstract/TypedData.test.d.ts +0 -1
- package/dist/abstract/UploaderPublicApi.d.ts +0 -41
- package/dist/abstract/buildOutputCollectionState.d.ts +0 -3
- package/dist/abstract/customConfigOptions.d.ts +0 -65
- package/dist/abstract/defineComponents.d.ts +0 -1
- package/dist/abstract/features/ClipboardLayer.d.ts +0 -12
- package/dist/abstract/localeRegistry.d.ts +0 -5
- package/dist/abstract/managers/LocaleManager.d.ts +0 -10
- package/dist/abstract/managers/ModalManager.d.ts +0 -53
- package/dist/abstract/managers/SecureUploadsManager.d.ts +0 -7
- package/dist/abstract/managers/TelemetryManager.d.ts +0 -41
- package/dist/abstract/managers/ValidationManager.d.ts +0 -34
- package/dist/abstract/managers/__tests__/ModalManager.test.d.ts +0 -13
- package/dist/abstract/managers/__tests__/SecureUploadsManager.test.d.ts +0 -1
- package/dist/abstract/managers/a11y.d.ts +0 -9
- package/dist/abstract/managers/plugin/PluginManager.d.ts +0 -25
- package/dist/abstract/managers/plugin/PluginTypes.d.ts +0 -146
- package/dist/abstract/managers/plugin/index.d.ts +0 -2
- package/dist/abstract/sharedConfigKey.d.ts +0 -2
- package/dist/abstract/uploadEntrySchema.d.ts +0 -34
- package/dist/blocks/ActivityHeader/ActivityHeader.d.ts +0 -8
- package/dist/blocks/CameraSource/CameraSource.d.ts +0 -121
- package/dist/blocks/CameraSource/__tests__/calcCameraModes.test.d.ts +0 -1
- package/dist/blocks/CameraSource/calcCameraModes.d.ts +0 -5
- package/dist/blocks/CameraSource/constants.d.ts +0 -15
- package/dist/blocks/CloudImageEditor/index.d.ts +0 -1
- package/dist/blocks/CloudImageEditor/src/CloudImageEditorBlock.d.ts +0 -60
- package/dist/blocks/CloudImageEditor/src/CropFrame.d.ts +0 -56
- package/dist/blocks/CloudImageEditor/src/EditorAspectRatioButtonControl.d.ts +0 -24
- package/dist/blocks/CloudImageEditor/src/EditorButtonControl.d.ts +0 -14
- package/dist/blocks/CloudImageEditor/src/EditorCropButtonControl.d.ts +0 -13
- package/dist/blocks/CloudImageEditor/src/EditorFilterControl.d.ts +0 -35
- package/dist/blocks/CloudImageEditor/src/EditorImageCropper.d.ts +0 -56
- package/dist/blocks/CloudImageEditor/src/EditorImageFader.d.ts +0 -63
- package/dist/blocks/CloudImageEditor/src/EditorOperationControl.d.ts +0 -15
- package/dist/blocks/CloudImageEditor/src/EditorScroller.d.ts +0 -15
- package/dist/blocks/CloudImageEditor/src/EditorSlider.d.ts +0 -33
- package/dist/blocks/CloudImageEditor/src/EditorToolbar.d.ts +0 -68
- package/dist/blocks/CloudImageEditor/src/crop-utils.d.ts +0 -36
- package/dist/blocks/CloudImageEditor/src/crop-utils.test.d.ts +0 -1
- package/dist/blocks/CloudImageEditor/src/cropper-constants.d.ts +0 -10
- package/dist/blocks/CloudImageEditor/src/elements/button/BtnUi.d.ts +0 -31
- package/dist/blocks/CloudImageEditor/src/elements/line-loader/LineLoaderUi.d.ts +0 -19
- package/dist/blocks/CloudImageEditor/src/elements/presence-toggle/PresenceToggle.d.ts +0 -27
- package/dist/blocks/CloudImageEditor/src/elements/slider/SliderUi.d.ts +0 -38
- package/dist/blocks/CloudImageEditor/src/index.d.ts +0 -15
- package/dist/blocks/CloudImageEditor/src/lib/classNames.d.ts +0 -5
- package/dist/blocks/CloudImageEditor/src/lib/classNames.test.d.ts +0 -1
- package/dist/blocks/CloudImageEditor/src/lib/linspace.d.ts +0 -1
- package/dist/blocks/CloudImageEditor/src/lib/linspace.test.d.ts +0 -1
- package/dist/blocks/CloudImageEditor/src/lib/parseCropPreset.d.ts +0 -4
- package/dist/blocks/CloudImageEditor/src/lib/parseCropPreset.test.d.ts +0 -1
- package/dist/blocks/CloudImageEditor/src/lib/parseTabs.d.ts +0 -2
- package/dist/blocks/CloudImageEditor/src/lib/pick.d.ts +0 -1
- package/dist/blocks/CloudImageEditor/src/lib/pick.test.d.ts +0 -1
- package/dist/blocks/CloudImageEditor/src/lib/transformationUtils.d.ts +0 -7
- package/dist/blocks/CloudImageEditor/src/state.d.ts +0 -20
- package/dist/blocks/CloudImageEditor/src/svg-sprite.d.ts +0 -2
- package/dist/blocks/CloudImageEditor/src/toolbar-constants.d.ts +0 -61
- package/dist/blocks/CloudImageEditor/src/types.d.ts +0 -60
- package/dist/blocks/CloudImageEditor/src/util.d.ts +0 -2
- package/dist/blocks/CloudImageEditor/src/utils/parseFilterValue.d.ts +0 -7
- package/dist/blocks/CloudImageEditor/src/utils/parseFilterValue.test.d.ts +0 -1
- package/dist/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts +0 -25
- package/dist/blocks/Config/Config.d.ts +0 -60
- package/dist/blocks/Config/assertions.d.ts +0 -5
- package/dist/blocks/Config/computed-properties.d.ts +0 -24
- package/dist/blocks/Config/computed-properties.test.d.ts +0 -1
- package/dist/blocks/Config/initialConfig.d.ts +0 -6
- package/dist/blocks/Config/normalizeConfigValue.d.ts +0 -2
- package/dist/blocks/Config/validatorsType.d.ts +0 -18
- package/dist/blocks/Copyright/Copyright.d.ts +0 -10
- package/dist/blocks/DropArea/DropArea.d.ts +0 -47
- package/dist/blocks/DropArea/addDropzone.d.ts +0 -17
- package/dist/blocks/DropArea/getDropItems.d.ts +0 -12
- package/dist/blocks/ExternalSource/ExternalSource.d.ts +0 -45
- package/dist/blocks/ExternalSource/MessageBridge.d.ts +0 -11
- package/dist/blocks/ExternalSource/buildThemeDefinition.d.ts +0 -4
- package/dist/blocks/ExternalSource/query-string.d.ts +0 -1
- package/dist/blocks/ExternalSource/types.d.ts +0 -105
- package/dist/blocks/FileItem/FileItem.d.ts +0 -50
- package/dist/blocks/FileItem/FileItemConfig.d.ts +0 -10
- package/dist/blocks/FormInput/FormInput.d.ts +0 -18
- package/dist/blocks/Icon/Icon.d.ts +0 -19
- package/dist/blocks/Img/Img.d.ts +0 -14
- package/dist/blocks/Img/ImgBase.d.ts +0 -29
- package/dist/blocks/Img/ImgConfig.d.ts +0 -28
- package/dist/blocks/Img/configurations.d.ts +0 -11
- package/dist/blocks/Img/props-map.d.ts +0 -28
- package/dist/blocks/Img/utils/parseObjectToString.d.ts +0 -2
- package/dist/blocks/Modal/Modal.d.ts +0 -34
- package/dist/blocks/PluginActivityRenderer/PluginActivityRenderer.d.ts +0 -32
- package/dist/blocks/PluginActivityRenderer/index.d.ts +0 -1
- package/dist/blocks/ProgressBar/ProgressBar.d.ts +0 -21
- package/dist/blocks/ProgressBarCommon/ProgressBarCommon.d.ts +0 -17
- package/dist/blocks/Select/Select.d.ts +0 -18
- package/dist/blocks/SimpleBtn/SimpleBtn.d.ts +0 -15
- package/dist/blocks/SourceBtn/SourceBtn.d.ts +0 -23
- package/dist/blocks/SourceList/SourceList.d.ts +0 -24
- package/dist/blocks/Spinner/Spinner.d.ts +0 -9
- package/dist/blocks/StartFrom/StartFrom.d.ts +0 -12
- package/dist/blocks/Thumb/Thumb.d.ts +0 -35
- package/dist/blocks/UploadCtxProvider/EventEmitter.d.ts +0 -70
- package/dist/blocks/UploadCtxProvider/UploadCtxProvider.d.ts +0 -44
- package/dist/blocks/UploadList/UploadList.d.ts +0 -39
- package/dist/blocks/UrlSource/UrlSource.d.ts +0 -14
- package/dist/blocks/svg-backgrounds/svg-backgrounds.d.ts +0 -3
- package/dist/blocks/themes/uc-basic/svg-sprite.d.ts +0 -2
- package/dist/cameraPlugin-weRKO7eG.js +0 -8
- package/dist/cloud-image-editor-hhbyNWLG.js +0 -11
- package/dist/cloud-image-editor.css +0 -1380
- package/dist/cloud-image-editor.layered.css +0 -1549
- package/dist/cloudImageEditorPlugin-FjUgbMK3.js +0 -8
- package/dist/core.d.ts +0 -42
- package/dist/en-8OWEmZim.js +0 -135
- package/dist/env-mM-ksNPq.js +0 -8
- package/dist/externalSourcesPlugin-CMBmLT8S.js +0 -8
- package/dist/imageShrinkPlugin-BN6loiP2.js +0 -8
- package/dist/index-base.css +0 -2497
- package/dist/index-base.layered.css +0 -2837
- package/dist/instagramPlugin-CXRm8MGL.js +0 -8
- package/dist/lit/BaseComponent.d.ts +0 -12
- package/dist/lit/Constructor.d.ts +0 -1
- package/dist/lit/CssDataMixin.d.ts +0 -7
- package/dist/lit/LightDomMixin.d.ts +0 -8
- package/dist/lit/LitActivityBlock.d.ts +0 -53
- package/dist/lit/LitBlock.d.ts +0 -83
- package/dist/lit/LitSolutionBlock.d.ts +0 -21
- package/dist/lit/LitUploaderBlock.d.ts +0 -53
- package/dist/lit/PubSubCompat.d.ts +0 -18
- package/dist/lit/RegisterableElementMixin.d.ts +0 -7
- package/dist/lit/SharedState.d.ts +0 -119
- package/dist/lit/SymbioteCompatMixin.d.ts +0 -40
- package/dist/lit/TestModeController.d.ts +0 -16
- package/dist/lit/Uid.d.ts +0 -3
- package/dist/lit/activity-constants.d.ts +0 -11
- package/dist/lit/createDebugPrinter.d.ts +0 -3
- package/dist/lit/findBlockInCtx.d.ts +0 -3
- package/dist/lit/getOutputData.d.ts +0 -2
- package/dist/lit/hasBlockInCtx.d.ts +0 -3
- package/dist/lit/l10n.d.ts +0 -5
- package/dist/lit/parseCssPropertyValue.d.ts +0 -1
- package/dist/lit/shared-instances.d.ts +0 -65
- package/dist/loadFileUploaderFrom-Bfz8L3VB.js +0 -28
- package/dist/plugins/cameraPlugin.d.ts +0 -2
- package/dist/plugins/cloudImageEditorPlugin.d.ts +0 -2
- package/dist/plugins/externalSourcesPlugin.d.ts +0 -2
- package/dist/plugins/imageShrinkPlugin.d.ts +0 -2
- package/dist/plugins/instagramPlugin.d.ts +0 -2
- package/dist/plugins/unsplashPlugin.d.ts +0 -16
- package/dist/plugins/urlSourcePlugin.d.ts +0 -2
- package/dist/plugins-CGUls7EV.js +0 -278
- package/dist/solutions/adaptive-image/index.d.ts +0 -2
- package/dist/solutions/cloud-image-editor/CloudImageEditor.d.ts +0 -11
- package/dist/solutions/cloud-image-editor/index.d.ts +0 -5
- package/dist/solutions/file-uploader/inline/FileUploaderInline.d.ts +0 -20
- package/dist/solutions/file-uploader/inline/index.d.ts +0 -1
- package/dist/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts +0 -23
- package/dist/solutions/file-uploader/minimal/index.d.ts +0 -1
- package/dist/solutions/file-uploader/regular/FileUploaderRegular.d.ts +0 -17
- package/dist/solutions/file-uploader/regular/index.d.ts +0 -1
- package/dist/types/dom.d.ts +0 -1
- package/dist/types/events.d.ts +0 -4
- package/dist/types/exported.d.ts +0 -492
- package/dist/types/index.d.ts +0 -5
- package/dist/urlSourcePlugin-_WdbEhq2.js +0 -8
- package/dist/utils/UID.d.ts +0 -5
- package/dist/utils/UID.test.d.ts +0 -1
- package/dist/utils/UploadSource.d.ts +0 -37
- package/dist/utils/WindowHeightTracker.d.ts +0 -9
- package/dist/utils/abilities.d.ts +0 -1
- package/dist/utils/applyStyles.d.ts +0 -1
- package/dist/utils/browser-info.d.ts +0 -12
- package/dist/utils/browser-info.test.d.ts +0 -1
- package/dist/utils/cdn-utils.d.ts +0 -53
- package/dist/utils/cdn-utils.test.d.ts +0 -1
- package/dist/utils/comma-separated.d.ts +0 -2
- package/dist/utils/debounce.d.ts +0 -3
- package/dist/utils/delay.d.ts +0 -1
- package/dist/utils/fileTypes.d.ts +0 -11
- package/dist/utils/fileTypes.test.d.ts +0 -1
- package/dist/utils/get-top-level-origin.d.ts +0 -1
- package/dist/utils/get-top-level-origin.test.d.ts +0 -1
- package/dist/utils/getLocaleDirection.d.ts +0 -1
- package/dist/utils/getPluralForm.d.ts +0 -1
- package/dist/utils/getPluralForm.test.d.ts +0 -1
- package/dist/utils/isPromiseLike.d.ts +0 -1
- package/dist/utils/isPromiseLike.test.d.ts +0 -1
- package/dist/utils/isSecureTokenExpired.d.ts +0 -8
- package/dist/utils/isSecureTokenExpired.test.d.ts +0 -1
- package/dist/utils/memoize.d.ts +0 -1
- package/dist/utils/memoize.test.d.ts +0 -1
- package/dist/utils/mixinClass.d.ts +0 -8
- package/dist/utils/parseCdnUrl.d.ts +0 -11
- package/dist/utils/parseCdnUrl.test.d.ts +0 -1
- package/dist/utils/parseShrink.d.ts +0 -7
- package/dist/utils/parseShrink.test.d.ts +0 -1
- package/dist/utils/preloadImage.d.ts +0 -10
- package/dist/utils/prettyBytes.d.ts +0 -11
- package/dist/utils/prettyBytes.test.d.ts +0 -1
- package/dist/utils/resizeImage.d.ts +0 -1
- package/dist/utils/stringToArray.d.ts +0 -1
- package/dist/utils/stringToArray.test.d.ts +0 -1
- package/dist/utils/template-utils.d.ts +0 -16
- package/dist/utils/template-utils.test.d.ts +0 -1
- package/dist/utils/throttle.d.ts +0 -3
- package/dist/utils/toKebabCase.d.ts +0 -2
- package/dist/utils/toKebabCase.test.d.ts +0 -1
- package/dist/utils/transparentPixelSrc.d.ts +0 -1
- package/dist/utils/uniqueArray.d.ts +0 -1
- package/dist/utils/uniqueArray.test.d.ts +0 -1
- package/dist/utils/userAgent.d.ts +0 -2
- package/dist/utils/validators/collection/index.d.ts +0 -2
- package/dist/utils/validators/collection/validateCollectionUploadError.d.ts +0 -2
- package/dist/utils/validators/collection/validateMultiple.d.ts +0 -2
- package/dist/utils/validators/file/index.d.ts +0 -4
- package/dist/utils/validators/file/validateFileType.d.ts +0 -2
- package/dist/utils/validators/file/validateIsImage.d.ts +0 -2
- package/dist/utils/validators/file/validateMaxSizeLimit.d.ts +0 -2
- package/dist/utils/validators/file/validateUploadError.d.ts +0 -2
- package/dist/utils/warnOnce.d.ts +0 -1
- package/dist/utils/wildcardRegexp.d.ts +0 -1
- package/dist/utils/wildcardRegexp.test.d.ts +0 -1
- package/dist/utils/withResolvers.d.ts +0 -5
- package/dist/utils/withResolvers.test.d.ts +0 -1
- package/web/ActivityHeader-BFdTdVfD.js +0 -9
- package/web/ActivityHeader-DQy6rII1.js +0 -9
- package/web/ActivityHeader-DvzMl0uj.js +0 -9
- package/web/ActivityHeader-i4x6_Fne.js +0 -9
- package/web/CameraSource-BAWIA4Wm.js +0 -508
- package/web/CameraSource-BqZCQcij.js +0 -11
- package/web/CameraSource-Brxr4tz4.js +0 -508
- package/web/CameraSource-BvBJ5Uzy.js +0 -508
- package/web/CameraSource-CkHzIE-h.js +0 -11
- package/web/CameraSource-D964yPLu.js +0 -508
- package/web/CameraSource-DE48Az-f.js +0 -11
- package/web/CameraSource-DyPebtRF.js +0 -478
- package/web/CameraSource-pj7Xo81m.js +0 -11
- package/web/CloudImageEditor-CTgUWB07.js +0 -2192
- package/web/CloudImageEditor-CxqV9Lwm.js +0 -2192
- package/web/CloudImageEditor-DoLWHpqV.js +0 -2192
- package/web/CloudImageEditor-Drywn265.js +0 -2192
- package/web/CloudImageEditor-MXcaDtMx.js +0 -2187
- package/web/CloudImageEditorActivity-BPzmfaJV.js +0 -85
- package/web/CloudImageEditorActivity-Br8pU5gd.js +0 -11
- package/web/CloudImageEditorActivity-Cw8b2CEz.js +0 -11
- package/web/CloudImageEditorActivity-Df1ySGq0.js +0 -86
- package/web/CloudImageEditorActivity-DinG5r0y.js +0 -11
- package/web/CloudImageEditorActivity-DmnLLINR.js +0 -85
- package/web/CloudImageEditorActivity-U90BGCek.js +0 -85
- package/web/CloudImageEditorActivity-dNLQZRZI.js +0 -11
- package/web/CloudImageEditorActivity-ur-hQ-6p.js +0 -85
- package/web/Config-8hlBNhvs.js +0 -455
- package/web/Config-BDZhPIyz.js +0 -455
- package/web/Config-CJVNrrjj.js +0 -455
- package/web/Config-DvkVtlQ7.js +0 -455
- package/web/ExternalSource-B9ycBFiD.js +0 -10
- package/web/ExternalSource-BE7HX47E.js +0 -250
- package/web/ExternalSource-BL5GSlol.js +0 -250
- package/web/ExternalSource-BXQY6Dlc.js +0 -10
- package/web/ExternalSource-BXxH3JCD.js +0 -250
- package/web/ExternalSource-BYSS-PPV.js +0 -245
- package/web/ExternalSource-C57a61QN.js +0 -10
- package/web/ExternalSource-CKfMtOgU.js +0 -250
- package/web/ExternalSource-DP6q8ylB.js +0 -10
- package/web/LitUploaderBlock-AX6jOdAS.js +0 -996
- package/web/LitUploaderBlock-BjAaoLl2.js +0 -996
- package/web/LitUploaderBlock-D8E5HuwH.js +0 -996
- package/web/LitUploaderBlock-Dl3ce0Tc.js +0 -996
- package/web/LitUploaderBlock-Oi33U0uf.js +0 -996
- package/web/UrlSource-B9SX3K0L.js +0 -10
- package/web/UrlSource-C3zB1rCb.js +0 -70
- package/web/UrlSource-C7bEU6Xv.js +0 -10
- package/web/UrlSource-CE389CBz.js +0 -70
- package/web/UrlSource-CnvAJ58Y.js +0 -10
- package/web/UrlSource-CqF0h6B-.js +0 -10
- package/web/UrlSource-D-971Nut.js +0 -70
- package/web/UrlSource-DhI3YCt5.js +0 -70
- package/web/UrlSource-hWV7jtB2.js +0 -70
- package/web/abstract/CTX.d.ts +0 -40
- package/web/abstract/TypedCollection.d.ts +0 -47
- package/web/abstract/TypedCollection.test.d.ts +0 -1
- package/web/abstract/TypedData.d.ts +0 -12
- package/web/abstract/TypedData.test.d.ts +0 -1
- package/web/abstract/UploaderPublicApi.d.ts +0 -41
- package/web/abstract/buildOutputCollectionState.d.ts +0 -3
- package/web/abstract/customConfigOptions.d.ts +0 -65
- package/web/abstract/defineComponents.d.ts +0 -1
- package/web/abstract/features/ClipboardLayer.d.ts +0 -12
- package/web/abstract/loadFileUploaderFrom.d.ts +0 -13
- package/web/abstract/localeRegistry.d.ts +0 -5
- package/web/abstract/managers/LocaleManager.d.ts +0 -10
- package/web/abstract/managers/ModalManager.d.ts +0 -53
- package/web/abstract/managers/SecureUploadsManager.d.ts +0 -7
- package/web/abstract/managers/TelemetryManager.d.ts +0 -41
- package/web/abstract/managers/ValidationManager.d.ts +0 -34
- package/web/abstract/managers/__tests__/ModalManager.test.d.ts +0 -13
- package/web/abstract/managers/__tests__/SecureUploadsManager.test.d.ts +0 -1
- package/web/abstract/managers/a11y.d.ts +0 -9
- package/web/abstract/managers/plugin/PluginManager.d.ts +0 -25
- package/web/abstract/managers/plugin/PluginTypes.d.ts +0 -146
- package/web/abstract/managers/plugin/index.d.ts +0 -2
- package/web/abstract/sharedConfigKey.d.ts +0 -2
- package/web/abstract/uploadEntrySchema.d.ts +0 -34
- package/web/blocks/ActivityHeader/ActivityHeader.d.ts +0 -8
- package/web/blocks/CameraSource/CameraSource.d.ts +0 -121
- package/web/blocks/CameraSource/__tests__/calcCameraModes.test.d.ts +0 -1
- package/web/blocks/CameraSource/calcCameraModes.d.ts +0 -5
- package/web/blocks/CameraSource/constants.d.ts +0 -15
- package/web/blocks/CloudImageEditor/index.d.ts +0 -1
- package/web/blocks/CloudImageEditor/src/CloudImageEditorBlock.d.ts +0 -60
- package/web/blocks/CloudImageEditor/src/CropFrame.d.ts +0 -56
- package/web/blocks/CloudImageEditor/src/EditorAspectRatioButtonControl.d.ts +0 -24
- package/web/blocks/CloudImageEditor/src/EditorButtonControl.d.ts +0 -14
- package/web/blocks/CloudImageEditor/src/EditorCropButtonControl.d.ts +0 -13
- package/web/blocks/CloudImageEditor/src/EditorFilterControl.d.ts +0 -35
- package/web/blocks/CloudImageEditor/src/EditorImageCropper.d.ts +0 -56
- package/web/blocks/CloudImageEditor/src/EditorImageFader.d.ts +0 -63
- package/web/blocks/CloudImageEditor/src/EditorOperationControl.d.ts +0 -15
- package/web/blocks/CloudImageEditor/src/EditorScroller.d.ts +0 -15
- package/web/blocks/CloudImageEditor/src/EditorSlider.d.ts +0 -33
- package/web/blocks/CloudImageEditor/src/EditorToolbar.d.ts +0 -68
- package/web/blocks/CloudImageEditor/src/crop-utils.d.ts +0 -36
- package/web/blocks/CloudImageEditor/src/crop-utils.test.d.ts +0 -1
- package/web/blocks/CloudImageEditor/src/cropper-constants.d.ts +0 -10
- package/web/blocks/CloudImageEditor/src/elements/button/BtnUi.d.ts +0 -31
- package/web/blocks/CloudImageEditor/src/elements/line-loader/LineLoaderUi.d.ts +0 -19
- package/web/blocks/CloudImageEditor/src/elements/presence-toggle/PresenceToggle.d.ts +0 -27
- package/web/blocks/CloudImageEditor/src/elements/slider/SliderUi.d.ts +0 -38
- package/web/blocks/CloudImageEditor/src/index.d.ts +0 -15
- package/web/blocks/CloudImageEditor/src/lib/classNames.d.ts +0 -5
- package/web/blocks/CloudImageEditor/src/lib/classNames.test.d.ts +0 -1
- package/web/blocks/CloudImageEditor/src/lib/linspace.d.ts +0 -1
- package/web/blocks/CloudImageEditor/src/lib/linspace.test.d.ts +0 -1
- package/web/blocks/CloudImageEditor/src/lib/parseCropPreset.d.ts +0 -4
- package/web/blocks/CloudImageEditor/src/lib/parseCropPreset.test.d.ts +0 -1
- package/web/blocks/CloudImageEditor/src/lib/parseTabs.d.ts +0 -2
- package/web/blocks/CloudImageEditor/src/lib/pick.d.ts +0 -1
- package/web/blocks/CloudImageEditor/src/lib/pick.test.d.ts +0 -1
- package/web/blocks/CloudImageEditor/src/lib/transformationUtils.d.ts +0 -7
- package/web/blocks/CloudImageEditor/src/state.d.ts +0 -20
- package/web/blocks/CloudImageEditor/src/svg-sprite.d.ts +0 -2
- package/web/blocks/CloudImageEditor/src/toolbar-constants.d.ts +0 -61
- package/web/blocks/CloudImageEditor/src/types.d.ts +0 -60
- package/web/blocks/CloudImageEditor/src/util.d.ts +0 -2
- package/web/blocks/CloudImageEditor/src/utils/parseFilterValue.d.ts +0 -7
- package/web/blocks/CloudImageEditor/src/utils/parseFilterValue.test.d.ts +0 -1
- package/web/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts +0 -25
- package/web/blocks/Config/Config.d.ts +0 -60
- package/web/blocks/Config/assertions.d.ts +0 -5
- package/web/blocks/Config/computed-properties.d.ts +0 -24
- package/web/blocks/Config/computed-properties.test.d.ts +0 -1
- package/web/blocks/Config/initialConfig.d.ts +0 -6
- package/web/blocks/Config/normalizeConfigValue.d.ts +0 -2
- package/web/blocks/Config/validatorsType.d.ts +0 -18
- package/web/blocks/Copyright/Copyright.d.ts +0 -10
- package/web/blocks/DropArea/DropArea.d.ts +0 -47
- package/web/blocks/DropArea/addDropzone.d.ts +0 -17
- package/web/blocks/DropArea/getDropItems.d.ts +0 -12
- package/web/blocks/ExternalSource/ExternalSource.d.ts +0 -45
- package/web/blocks/ExternalSource/MessageBridge.d.ts +0 -11
- package/web/blocks/ExternalSource/buildThemeDefinition.d.ts +0 -4
- package/web/blocks/ExternalSource/query-string.d.ts +0 -1
- package/web/blocks/ExternalSource/types.d.ts +0 -105
- package/web/blocks/FileItem/FileItem.d.ts +0 -50
- package/web/blocks/FileItem/FileItemConfig.d.ts +0 -10
- package/web/blocks/FormInput/FormInput.d.ts +0 -18
- package/web/blocks/Icon/Icon.d.ts +0 -19
- package/web/blocks/Img/Img.d.ts +0 -14
- package/web/blocks/Img/ImgBase.d.ts +0 -29
- package/web/blocks/Img/ImgConfig.d.ts +0 -28
- package/web/blocks/Img/configurations.d.ts +0 -11
- package/web/blocks/Img/props-map.d.ts +0 -28
- package/web/blocks/Img/utils/parseObjectToString.d.ts +0 -2
- package/web/blocks/Modal/Modal.d.ts +0 -34
- package/web/blocks/PluginActivityRenderer/PluginActivityRenderer.d.ts +0 -32
- package/web/blocks/PluginActivityRenderer/index.d.ts +0 -1
- package/web/blocks/ProgressBar/ProgressBar.d.ts +0 -21
- package/web/blocks/ProgressBarCommon/ProgressBarCommon.d.ts +0 -17
- package/web/blocks/Select/Select.d.ts +0 -18
- package/web/blocks/SimpleBtn/SimpleBtn.d.ts +0 -15
- package/web/blocks/SourceBtn/SourceBtn.d.ts +0 -23
- package/web/blocks/SourceList/SourceList.d.ts +0 -24
- package/web/blocks/Spinner/Spinner.d.ts +0 -9
- package/web/blocks/StartFrom/StartFrom.d.ts +0 -12
- package/web/blocks/Thumb/Thumb.d.ts +0 -35
- package/web/blocks/UploadCtxProvider/EventEmitter.d.ts +0 -70
- package/web/blocks/UploadCtxProvider/UploadCtxProvider.d.ts +0 -44
- package/web/blocks/UploadList/UploadList.d.ts +0 -39
- package/web/blocks/UrlSource/UrlSource.d.ts +0 -14
- package/web/blocks/svg-backgrounds/svg-backgrounds.d.ts +0 -3
- package/web/blocks/themes/uc-basic/svg-sprite.d.ts +0 -2
- package/web/cameraPlugin-DeedXMWV.js +0 -8
- package/web/cameraPlugin-Duy1QwjB.js +0 -8
- package/web/cameraPlugin-QS9SUOtO.js +0 -8
- package/web/cameraPlugin-bq8ggY04.js +0 -8
- package/web/cameraPlugin-cel9YgP_.js +0 -8
- package/web/cloud-image-editor-8DrVRZ7E.js +0 -12
- package/web/cloud-image-editor-BX50EK1U.js +0 -12
- package/web/cloud-image-editor-DSW3oWq-.js +0 -12
- package/web/cloud-image-editor-DuI2Lx4M.js +0 -12
- package/web/cloudImageEditorPlugin-5my6aD36.js +0 -8
- package/web/cloudImageEditorPlugin-Bk19DmJv.js +0 -8
- package/web/cloudImageEditorPlugin-CcdnmtBW.js +0 -8
- package/web/cloudImageEditorPlugin-DQJmDl03.js +0 -8
- package/web/cloudImageEditorPlugin-kojghfqw.js +0 -8
- package/web/constants-BCfCF0cJ.js +0 -4025
- package/web/core.d.ts +0 -42
- package/web/env.d.ts +0 -2
- package/web/externalSourcesPlugin-BTeRm5C0.js +0 -8
- package/web/externalSourcesPlugin-BXgVeojg.js +0 -8
- package/web/externalSourcesPlugin-BgLpuIK9.js +0 -8
- package/web/externalSourcesPlugin-DMc9zs4T.js +0 -8
- package/web/externalSourcesPlugin-Dm9vnTBv.js +0 -8
- package/web/imageShrinkPlugin-BdHgEGZH.js +0 -8
- package/web/imageShrinkPlugin-BjkMGfvT.js +0 -8
- package/web/imageShrinkPlugin-CCkGHL2w.js +0 -8
- package/web/imageShrinkPlugin-D4WjaRGo.js +0 -8
- package/web/imageShrinkPlugin-DqYGutVx.js +0 -8
- package/web/index.d.ts +0 -42
- package/web/instagramPlugin-BTMz0K2a.js +0 -8
- package/web/instagramPlugin-BbIKgTH7.js +0 -8
- package/web/instagramPlugin-CQQhsEJa.js +0 -8
- package/web/instagramPlugin-Cm7lWKae.js +0 -8
- package/web/instagramPlugin-DcclxM_d.js +0 -8
- package/web/lit/BaseComponent.d.ts +0 -12
- package/web/lit/Constructor.d.ts +0 -1
- package/web/lit/CssDataMixin.d.ts +0 -7
- package/web/lit/LightDomMixin.d.ts +0 -8
- package/web/lit/LitActivityBlock.d.ts +0 -53
- package/web/lit/LitBlock.d.ts +0 -83
- package/web/lit/LitSolutionBlock.d.ts +0 -21
- package/web/lit/LitUploaderBlock.d.ts +0 -53
- package/web/lit/PubSubCompat.d.ts +0 -18
- package/web/lit/RegisterableElementMixin.d.ts +0 -7
- package/web/lit/SharedState.d.ts +0 -119
- package/web/lit/SymbioteCompatMixin.d.ts +0 -40
- package/web/lit/TestModeController.d.ts +0 -16
- package/web/lit/Uid.d.ts +0 -3
- package/web/lit/activity-constants.d.ts +0 -11
- package/web/lit/createDebugPrinter.d.ts +0 -3
- package/web/lit/findBlockInCtx.d.ts +0 -3
- package/web/lit/getOutputData.d.ts +0 -2
- package/web/lit/hasBlockInCtx.d.ts +0 -3
- package/web/lit/l10n.d.ts +0 -5
- package/web/lit/parseCssPropertyValue.d.ts +0 -1
- package/web/lit/shared-instances.d.ts +0 -65
- package/web/locales/file-uploader/ar.d.ts +0 -137
- package/web/locales/file-uploader/az.d.ts +0 -129
- package/web/locales/file-uploader/ca.d.ts +0 -131
- package/web/locales/file-uploader/cs.d.ts +0 -133
- package/web/locales/file-uploader/da.d.ts +0 -129
- package/web/locales/file-uploader/de.d.ts +0 -129
- package/web/locales/file-uploader/el.d.ts +0 -129
- package/web/locales/file-uploader/en.d.ts +0 -129
- package/web/locales/file-uploader/es.d.ts +0 -131
- package/web/locales/file-uploader/et.d.ts +0 -129
- package/web/locales/file-uploader/fi.d.ts +0 -129
- package/web/locales/file-uploader/fr.d.ts +0 -131
- package/web/locales/file-uploader/he.d.ts +0 -131
- package/web/locales/file-uploader/hy.d.ts +0 -129
- package/web/locales/file-uploader/is.d.ts +0 -129
- package/web/locales/file-uploader/it.d.ts +0 -131
- package/web/locales/file-uploader/ja.d.ts +0 -129
- package/web/locales/file-uploader/ka.d.ts +0 -129
- package/web/locales/file-uploader/kk.d.ts +0 -129
- package/web/locales/file-uploader/ko.d.ts +0 -129
- package/web/locales/file-uploader/lv.d.ts +0 -131
- package/web/locales/file-uploader/nb.d.ts +0 -129
- package/web/locales/file-uploader/nl.d.ts +0 -129
- package/web/locales/file-uploader/pl.d.ts +0 -133
- package/web/locales/file-uploader/pt.d.ts +0 -131
- package/web/locales/file-uploader/ro.d.ts +0 -131
- package/web/locales/file-uploader/ru.d.ts +0 -133
- package/web/locales/file-uploader/sk.d.ts +0 -133
- package/web/locales/file-uploader/sr.d.ts +0 -131
- package/web/locales/file-uploader/sv.d.ts +0 -129
- package/web/locales/file-uploader/tr.d.ts +0 -129
- package/web/locales/file-uploader/uk.d.ts +0 -133
- package/web/locales/file-uploader/vi.d.ts +0 -129
- package/web/locales/file-uploader/zh-TW.d.ts +0 -129
- package/web/locales/file-uploader/zh.d.ts +0 -129
- package/web/plugins/cameraPlugin.d.ts +0 -2
- package/web/plugins/cloudImageEditorPlugin.d.ts +0 -2
- package/web/plugins/externalSourcesPlugin.d.ts +0 -2
- package/web/plugins/imageShrinkPlugin.d.ts +0 -2
- package/web/plugins/instagramPlugin.d.ts +0 -2
- package/web/plugins/unsplashPlugin.d.ts +0 -16
- package/web/plugins/urlSourcePlugin.d.ts +0 -2
- package/web/plugins-Bt7FXHKx.js +0 -562
- package/web/plugins-CaaolyMk.js +0 -562
- package/web/plugins-Cjgw5oWg.js +0 -562
- package/web/plugins-CzNtrVQB.js +0 -562
- package/web/plugins-DS0hIs2V.js +0 -563
- package/web/ref-BOnG19ns.js +0 -4040
- package/web/ref-BejJFG7m.js +0 -4040
- package/web/ref-DcRg7zo9.js +0 -4040
- package/web/ref-ZWPcLQB9.js +0 -4040
- package/web/solutions/adaptive-image/index.d.ts +0 -2
- package/web/solutions/cloud-image-editor/CloudImageEditor.d.ts +0 -11
- package/web/solutions/cloud-image-editor/index.d.ts +0 -5
- package/web/solutions/file-uploader/inline/FileUploaderInline.d.ts +0 -20
- package/web/solutions/file-uploader/inline/index.d.ts +0 -1
- package/web/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts +0 -23
- package/web/solutions/file-uploader/minimal/index.d.ts +0 -1
- package/web/solutions/file-uploader/regular/FileUploaderRegular.d.ts +0 -17
- package/web/solutions/file-uploader/regular/index.d.ts +0 -1
- package/web/style-map-BmZdux7T.js +0 -37
- package/web/style-map-CZ6fSV6e.js +0 -37
- package/web/style-map-Dk7mLCrB.js +0 -37
- package/web/style-map-HkHnu9oA.js +0 -37
- package/web/style-map-tw1yUEaj.js +0 -37
- package/web/types/dom.d.ts +0 -1
- package/web/types/events.d.ts +0 -4
- package/web/types/exported.d.ts +0 -492
- package/web/types/index.d.ts +0 -5
- package/web/urlSourcePlugin-9lhcr02f.js +0 -8
- package/web/urlSourcePlugin-C-sLGhGb.js +0 -8
- package/web/urlSourcePlugin-DNXDpnRD.js +0 -8
- package/web/urlSourcePlugin-JnD0cnxb.js +0 -8
- package/web/urlSourcePlugin-hcMU2K6T.js +0 -8
- package/web/utils/UID.d.ts +0 -5
- package/web/utils/UID.test.d.ts +0 -1
- package/web/utils/UploadSource.d.ts +0 -37
- package/web/utils/WindowHeightTracker.d.ts +0 -9
- package/web/utils/abilities.d.ts +0 -1
- package/web/utils/applyStyles.d.ts +0 -1
- package/web/utils/browser-info.d.ts +0 -12
- package/web/utils/browser-info.test.d.ts +0 -1
- package/web/utils/cdn-utils.d.ts +0 -53
- package/web/utils/cdn-utils.test.d.ts +0 -1
- package/web/utils/comma-separated.d.ts +0 -2
- package/web/utils/debounce.d.ts +0 -3
- package/web/utils/delay.d.ts +0 -1
- package/web/utils/fileTypes.d.ts +0 -11
- package/web/utils/fileTypes.test.d.ts +0 -1
- package/web/utils/get-top-level-origin.d.ts +0 -1
- package/web/utils/get-top-level-origin.test.d.ts +0 -1
- package/web/utils/getLocaleDirection.d.ts +0 -1
- package/web/utils/getPluralForm.d.ts +0 -1
- package/web/utils/getPluralForm.test.d.ts +0 -1
- package/web/utils/isPromiseLike.d.ts +0 -1
- package/web/utils/isPromiseLike.test.d.ts +0 -1
- package/web/utils/isSecureTokenExpired.d.ts +0 -8
- package/web/utils/isSecureTokenExpired.test.d.ts +0 -1
- package/web/utils/memoize.d.ts +0 -1
- package/web/utils/memoize.test.d.ts +0 -1
- package/web/utils/mixinClass.d.ts +0 -8
- package/web/utils/parseCdnUrl.d.ts +0 -11
- package/web/utils/parseCdnUrl.test.d.ts +0 -1
- package/web/utils/parseShrink.d.ts +0 -7
- package/web/utils/parseShrink.test.d.ts +0 -1
- package/web/utils/preloadImage.d.ts +0 -10
- package/web/utils/prettyBytes.d.ts +0 -11
- package/web/utils/prettyBytes.test.d.ts +0 -1
- package/web/utils/resizeImage.d.ts +0 -1
- package/web/utils/stringToArray.d.ts +0 -1
- package/web/utils/stringToArray.test.d.ts +0 -1
- package/web/utils/template-utils.d.ts +0 -16
- package/web/utils/template-utils.test.d.ts +0 -1
- package/web/utils/throttle.d.ts +0 -3
- package/web/utils/toKebabCase.d.ts +0 -2
- package/web/utils/toKebabCase.test.d.ts +0 -1
- package/web/utils/transparentPixelSrc.d.ts +0 -1
- package/web/utils/uniqueArray.d.ts +0 -1
- package/web/utils/uniqueArray.test.d.ts +0 -1
- package/web/utils/userAgent.d.ts +0 -2
- package/web/utils/validators/collection/index.d.ts +0 -2
- package/web/utils/validators/collection/validateCollectionUploadError.d.ts +0 -2
- package/web/utils/validators/collection/validateMultiple.d.ts +0 -2
- package/web/utils/validators/file/index.d.ts +0 -4
- package/web/utils/validators/file/validateFileType.d.ts +0 -2
- package/web/utils/validators/file/validateIsImage.d.ts +0 -2
- package/web/utils/validators/file/validateMaxSizeLimit.d.ts +0 -2
- package/web/utils/validators/file/validateUploadError.d.ts +0 -2
- package/web/utils/warnOnce.d.ts +0 -1
- package/web/utils/wildcardRegexp.d.ts +0 -1
- package/web/utils/wildcardRegexp.test.d.ts +0 -1
- package/web/utils/withResolvers.d.ts +0 -5
- package/web/utils/withResolvers.test.d.ts +0 -1
|
@@ -1,996 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Package: @uploadcare/file-uploader@1.28.0-alpha.1 (MIT)
|
|
4
|
-
* License: https://github.com/uploadcare/blob/main/LICENSE
|
|
5
|
-
* Built: 2026-03-02T20:26:12.501Z
|
|
6
|
-
*/
|
|
7
|
-
import { A as parseCropPreset, B as EventType, F as debounce, H as SharedInstance, I as PubSub, L as UID, N as createL10n, P as getPluralForm, R as PACKAGE_NAME, U as DEFAULT_CDN_CNAME, ct as uploaderBlockCtx, dt as UploadError, et as stringToArray, ft as getUserAgent$1, i as calculateMaxCenteredCropFrame, j as LitBlock, lt as NetworkError, n as CameraSourceTypes, nt as createCdnUrlModifiers, ot as sharedConfigKey, pt as uploadFileGroup, r as warnOnce, st as activityBlockCtx, tt as createCdnUrl, ut as Queue, z as PACKAGE_VERSION } from "./constants-BCfCF0cJ.js";
|
|
8
|
-
import { c as browserInfo, f as deserializeCsv, l as ExternalUploadSource, m as ACTIVITY_TYPES, p as serializeCsv, s as browserFeatures, u as UploadSource } from "./plugins-DS0hIs2V.js";
|
|
9
|
-
var ACTIVE_ATTR = "active", ACTIVE_PROP = "___ACTIVITY_IS_ACTIVE___", LitActivityBlock = class p extends LitBlock {
|
|
10
|
-
constructor(...p) {
|
|
11
|
-
super(...p), this.historyTracked = !1, this.init$ = activityBlockCtx(this), this._debouncedHistoryFlush = debounce(this._historyFlush.bind(this), 10);
|
|
12
|
-
}
|
|
13
|
-
_deactivate() {
|
|
14
|
-
let H = p._activityCallbacks.get(this);
|
|
15
|
-
this[ACTIVE_PROP] = !1, this.removeAttribute(ACTIVE_ATTR), H?.deactivateCallback?.();
|
|
16
|
-
}
|
|
17
|
-
_activate() {
|
|
18
|
-
let U = p._activityCallbacks.get(this);
|
|
19
|
-
this.$["*historyBack"] = this.historyBack.bind(this), this[ACTIVE_PROP] = !0, this.setAttribute(ACTIVE_ATTR, ""), U?.activateCallback?.(), this._debouncedHistoryFlush(), this.emit(EventType.ACTIVITY_CHANGE, { activity: this.activityType });
|
|
20
|
-
}
|
|
21
|
-
initCallback() {
|
|
22
|
-
super.initCallback(), this.activityType && (this.hasAttribute("activity") || this.setAttribute("activity", this.activityType), this.sub("*currentActivity", (p) => {
|
|
23
|
-
try {
|
|
24
|
-
this.activityType !== p && this[ACTIVE_PROP] ? this._deactivate() : this.activityType === p && !this[ACTIVE_PROP] && this._activate();
|
|
25
|
-
} catch (p) {
|
|
26
|
-
this.telemetryManager.sendEventError(p, `activity "${this.activityType}"`), console.error(`Error in activity "${this.activityType}". `, p);
|
|
27
|
-
let H = this.$["*history"][this.$["*history"].length - 1];
|
|
28
|
-
this.$["*currentActivity"] = H ?? null;
|
|
29
|
-
}
|
|
30
|
-
p || (this.$["*history"] = []);
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
_historyFlush() {
|
|
34
|
-
let p = this.$["*history"];
|
|
35
|
-
p && (p.length > 10 && (p = p.slice(p.length - 11, p.length - 1)), this.historyTracked && p[p.length - 1] !== this.activityType && p.push(this.activityType), this.$["*history"] = p);
|
|
36
|
-
}
|
|
37
|
-
_isActivityRegistered() {
|
|
38
|
-
return !!this.activityType && p._activityCallbacks.has(this);
|
|
39
|
-
}
|
|
40
|
-
static {
|
|
41
|
-
this._activityCallbacks = /* @__PURE__ */ new Map();
|
|
42
|
-
}
|
|
43
|
-
get isActivityActive() {
|
|
44
|
-
return !!this[ACTIVE_PROP];
|
|
45
|
-
}
|
|
46
|
-
get couldOpenActivity() {
|
|
47
|
-
return !0;
|
|
48
|
-
}
|
|
49
|
-
registerActivity(H, U = {}) {
|
|
50
|
-
let { onActivate: W, onDeactivate: G } = U;
|
|
51
|
-
p._activityCallbacks.set(this, {
|
|
52
|
-
activateCallback: W,
|
|
53
|
-
deactivateCallback: G
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
_unregisterActivity() {
|
|
57
|
-
this.isActivityActive && this._deactivate(), p._activityCallbacks.delete(this);
|
|
58
|
-
}
|
|
59
|
-
disconnectedCallback() {
|
|
60
|
-
super.disconnectedCallback(), this._isActivityRegistered() && this._unregisterActivity();
|
|
61
|
-
let H = this.$["*currentActivity"];
|
|
62
|
-
this.blocksRegistry && ([...this.blocksRegistry].find((U) => U instanceof p && U.activityType === H) || (this.$["*currentActivity"] = null, this.modalManager?.closeAll()));
|
|
63
|
-
}
|
|
64
|
-
get activityParams() {
|
|
65
|
-
return this.$["*currentActivityParams"];
|
|
66
|
-
}
|
|
67
|
-
get initActivity() {
|
|
68
|
-
return this.getCssData("--cfg-init-activity") ?? null;
|
|
69
|
-
}
|
|
70
|
-
get doneActivity() {
|
|
71
|
-
return this.getCssData("--cfg-done-activity") ?? null;
|
|
72
|
-
}
|
|
73
|
-
historyBack() {
|
|
74
|
-
let p = this.$["*history"];
|
|
75
|
-
if (p) {
|
|
76
|
-
let H = p.pop();
|
|
77
|
-
for (; H === this.activityType;) H = p.pop();
|
|
78
|
-
let U = !!H;
|
|
79
|
-
H && (U = [...this.blocksRegistry].find((p) => p.activityType === H)?.couldOpenActivity ?? !1), H = U ? H : null, this.$["*currentActivity"] = H ?? null, H && this.modalManager?.open(H), this.$["*history"] = p, H || this.modalManager?.closeAll();
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
LitActivityBlock.activities = ACTIVITY_TYPES;
|
|
84
|
-
var msToUnixTimestamp = (p) => typeof p == "number" ? Math.floor(p / 1e3) : 0;
|
|
85
|
-
const isSecureTokenExpired = (p, { threshold: H }) => {
|
|
86
|
-
let { secureExpire: U } = p, W = msToUnixTimestamp(Date.now()), G = Number(U);
|
|
87
|
-
return W + msToUnixTimestamp(H) >= G;
|
|
88
|
-
};
|
|
89
|
-
var SecureUploadsManager = class extends SharedInstance {
|
|
90
|
-
constructor(...p) {
|
|
91
|
-
super(...p), this._secureToken = null;
|
|
92
|
-
}
|
|
93
|
-
async getSecureToken() {
|
|
94
|
-
let { secureSignature: p, secureExpire: H, secureUploadsSignatureResolver: U, secureUploadsExpireThreshold: W } = this._cfg;
|
|
95
|
-
if ((p || H) && U && console.warn("Both secureSignature/secureExpire and secureUploadsSignatureResolver are set. secureUploadsSignatureResolver will be used."), U) {
|
|
96
|
-
if (!this._secureToken || isSecureTokenExpired(this._secureToken, { threshold: W })) {
|
|
97
|
-
this._secureToken ? this._debugPrint("Secure signature is expired. Resolving a new one...") : this._debugPrint("Secure signature is not set yet.");
|
|
98
|
-
try {
|
|
99
|
-
let p = await U();
|
|
100
|
-
p ? !p.secureSignature || !p.secureExpire ? console.error("Secure signature resolver returned an invalid result:", p) : (this._debugPrint("Secure signature resolved:", p), this._debugPrint("Secure signature will expire in", (/* @__PURE__ */ new Date(Number(p.secureExpire) * 1e3)).toISOString()), this._secureToken = p) : (this._debugPrint("Secure signature resolver returned nothing."), this._secureToken = null);
|
|
101
|
-
} catch (p) {
|
|
102
|
-
console.error("Secure signature resolving failed. Falling back to the previous one.", p), this._sharedInstancesBag.telemetryManager.sendEventError(p, "secureUploadsSignatureResolver. Secure signature resolving failed. Falling back to the previous one.");
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return this._secureToken;
|
|
106
|
-
}
|
|
107
|
-
return p && H ? (this._debugPrint("Secure signature and expire are set. Using them...", {
|
|
108
|
-
secureSignature: p,
|
|
109
|
-
secureExpire: H
|
|
110
|
-
}), {
|
|
111
|
-
secureSignature: p,
|
|
112
|
-
secureExpire: H
|
|
113
|
-
}) : null;
|
|
114
|
-
}
|
|
115
|
-
destroy() {
|
|
116
|
-
super.destroy(), this._secureToken = null;
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
const validateCollectionUploadError = (p, H) => {
|
|
120
|
-
if (p.failedCount > 0) return {
|
|
121
|
-
type: "SOME_FILES_HAS_ERRORS",
|
|
122
|
-
message: H.l10n("some-files-were-not-uploaded")
|
|
123
|
-
};
|
|
124
|
-
}, validateMultiple = (p, H) => {
|
|
125
|
-
let U = p.totalCount, W = H.cfg.multiple ? H.cfg.multipleMin : 0, G = H.cfg.multiple ? H.cfg.multipleMax : 1;
|
|
126
|
-
if (W && U < W) return {
|
|
127
|
-
type: "TOO_FEW_FILES",
|
|
128
|
-
message: H.l10n("files-count-limit-error-too-few", {
|
|
129
|
-
min: W,
|
|
130
|
-
max: G,
|
|
131
|
-
total: U
|
|
132
|
-
}),
|
|
133
|
-
payload: {
|
|
134
|
-
total: U,
|
|
135
|
-
min: W,
|
|
136
|
-
max: G
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
if (G && U > G) return {
|
|
140
|
-
type: "TOO_MANY_FILES",
|
|
141
|
-
message: H.l10n("files-count-limit-error-too-many", {
|
|
142
|
-
min: W,
|
|
143
|
-
max: G,
|
|
144
|
-
total: U
|
|
145
|
-
}),
|
|
146
|
-
payload: {
|
|
147
|
-
total: U,
|
|
148
|
-
min: W,
|
|
149
|
-
max: G
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
}, BASIC_IMAGE_WILDCARD = "image/*", HEIC_IMAGE_MIME_LIST = [
|
|
153
|
-
"image/heif",
|
|
154
|
-
"image/heif-sequence",
|
|
155
|
-
"image/heic",
|
|
156
|
-
"image/heic-sequence",
|
|
157
|
-
"image/avif",
|
|
158
|
-
"image/avif-sequence",
|
|
159
|
-
".heif",
|
|
160
|
-
".heifs",
|
|
161
|
-
".heic",
|
|
162
|
-
".heics",
|
|
163
|
-
".avif",
|
|
164
|
-
".avifs"
|
|
165
|
-
], IMAGE_ACCEPT_LIST = (() => browserInfo.safariDesktop ? [BASIC_IMAGE_WILDCARD] : [BASIC_IMAGE_WILDCARD, ...HEIC_IMAGE_MIME_LIST])(), mergeFileTypes = (p) => p ? p.filter((p) => typeof p == "string").flatMap((p) => stringToArray(p)) : [], matchMimeType = (p, H) => H.some((H) => {
|
|
166
|
-
if (H.endsWith("*")) {
|
|
167
|
-
let U = H.replace("*", "");
|
|
168
|
-
return p.startsWith(U);
|
|
169
|
-
}
|
|
170
|
-
return p === H;
|
|
171
|
-
}), matchExtension = (p, H) => H.some((H) => H.startsWith(".") ? p.toLowerCase().endsWith(H.toLowerCase()) : !1), fileIsImage = (p) => {
|
|
172
|
-
let H = p?.type;
|
|
173
|
-
return H ? matchMimeType(H, IMAGE_ACCEPT_LIST) : !1;
|
|
174
|
-
}, validateFileType = (p, H) => {
|
|
175
|
-
let U = H.cfg.imgOnly, W = H.cfg.accept, G = mergeFileTypes([...U ? IMAGE_ACCEPT_LIST : [], W]);
|
|
176
|
-
if (!G.length) return;
|
|
177
|
-
let K = p.mimeType, q = p.name;
|
|
178
|
-
if (!K || !q) return;
|
|
179
|
-
let J = matchMimeType(K, G), Y = matchExtension(q, G);
|
|
180
|
-
if (!J && !Y) return {
|
|
181
|
-
type: "FORBIDDEN_FILE_TYPE",
|
|
182
|
-
message: H.l10n("file-type-not-allowed"),
|
|
183
|
-
payload: { entry: p }
|
|
184
|
-
};
|
|
185
|
-
}, validateIsImage = (p, H) => {
|
|
186
|
-
let U = H.cfg.imgOnly, W = p.isImage;
|
|
187
|
-
if (!(!U || W) && !(!p.fileInfo && p.externalUrl) && !(!p.fileInfo && !p.mimeType)) return {
|
|
188
|
-
type: "NOT_AN_IMAGE",
|
|
189
|
-
message: H.l10n("images-only-accepted"),
|
|
190
|
-
payload: { entry: p }
|
|
191
|
-
};
|
|
192
|
-
};
|
|
193
|
-
var BASE = 1e3;
|
|
194
|
-
const ByteUnitEnum = Object.freeze({
|
|
195
|
-
AUTO: "auto",
|
|
196
|
-
BYTE: "byte",
|
|
197
|
-
KB: "kb",
|
|
198
|
-
MB: "mb",
|
|
199
|
-
GB: "gb",
|
|
200
|
-
TB: "tb",
|
|
201
|
-
PB: "pb"
|
|
202
|
-
});
|
|
203
|
-
var round = (p) => Math.ceil(p * 100) / 100;
|
|
204
|
-
const prettyBytes = (p, H = ByteUnitEnum.AUTO) => {
|
|
205
|
-
let U = H === ByteUnitEnum.AUTO;
|
|
206
|
-
return H === ByteUnitEnum.BYTE || U && p < BASE ** 1 ? `${p} ${getPluralForm("en-US", p) === "one" ? "byte" : "bytes"}` : H === ByteUnitEnum.KB || U && p < BASE ** 2 ? `${round(p / BASE ** 1)} KB` : H === ByteUnitEnum.MB || U && p < BASE ** 3 ? `${round(p / BASE ** 2)} MB` : H === ByteUnitEnum.GB || U && p < BASE ** 4 ? `${round(p / BASE ** 3)} GB` : H === ByteUnitEnum.TB || U && p < BASE ** 5 ? `${round(p / BASE ** 4)} TB` : `${round(p / BASE ** 5)} PB`;
|
|
207
|
-
}, validateMaxSizeLimit = (p, H) => {
|
|
208
|
-
let U = H.cfg.maxLocalFileSizeBytes, W = p.size;
|
|
209
|
-
if (U && W && W > U) return {
|
|
210
|
-
type: "FILE_SIZE_EXCEEDED",
|
|
211
|
-
message: H.l10n("files-max-size-limit-error", { maxFileSize: prettyBytes(U) }),
|
|
212
|
-
payload: { entry: p }
|
|
213
|
-
};
|
|
214
|
-
}, validateUploadError = (p, H) => {
|
|
215
|
-
let { internalId: U } = p;
|
|
216
|
-
if (!H._uploadCollection.hasItem(U)) return;
|
|
217
|
-
let W = H._uploadCollection.read(U)?.getValue("uploadError");
|
|
218
|
-
if (!W) return;
|
|
219
|
-
if (W instanceof UploadError) return {
|
|
220
|
-
type: "UPLOAD_ERROR",
|
|
221
|
-
message: W.message,
|
|
222
|
-
payload: {
|
|
223
|
-
entry: p,
|
|
224
|
-
error: W
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
if (W instanceof NetworkError) return {
|
|
228
|
-
type: "NETWORK_ERROR",
|
|
229
|
-
message: W.message,
|
|
230
|
-
payload: {
|
|
231
|
-
entry: p,
|
|
232
|
-
error: W
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
let G = W instanceof Error ? W : Error("Unknown error", { cause: W });
|
|
236
|
-
return {
|
|
237
|
-
type: "UNKNOWN_ERROR",
|
|
238
|
-
message: G.message,
|
|
239
|
-
payload: {
|
|
240
|
-
entry: p,
|
|
241
|
-
error: G
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
};
|
|
245
|
-
var LOG_TEXT = {
|
|
246
|
-
FILE_VALIDATION_FAILED: "File validator execution has failed",
|
|
247
|
-
FILE_VALIDATION_TIMEOUT: "File validator execution has timed out",
|
|
248
|
-
COLLECTION_VALIDATION_FAILED: "Collection validator execution has failed",
|
|
249
|
-
MISSING_ERROR_MESSAGE: "Missing message. We recommend adding message: value."
|
|
250
|
-
}, getValidatorDescriptor = (p) => typeof p == "function" ? {
|
|
251
|
-
runOn: "change",
|
|
252
|
-
validator: p
|
|
253
|
-
} : p, ValidationManager = class extends SharedInstance {
|
|
254
|
-
get _uploadCollection() {
|
|
255
|
-
return this._sharedInstancesBag.uploadCollection;
|
|
256
|
-
}
|
|
257
|
-
constructor(p) {
|
|
258
|
-
super(p), this._commonFileValidators = [
|
|
259
|
-
validateIsImage,
|
|
260
|
-
validateFileType,
|
|
261
|
-
validateMaxSizeLimit,
|
|
262
|
-
validateUploadError
|
|
263
|
-
], this._commonCollectionValidators = [validateMultiple, validateCollectionUploadError], this._queue = new Queue(20), this._runQueueDebounced = debounce(() => {
|
|
264
|
-
this._queue.run();
|
|
265
|
-
}, 500), this._isDestroyed = !1, this._entryValidationState = /* @__PURE__ */ new Map();
|
|
266
|
-
let H = debounce(() => {
|
|
267
|
-
this.runFileValidators("change"), this.runCollectionValidators();
|
|
268
|
-
}, 0);
|
|
269
|
-
this.addSub(this._ctx.sub(sharedConfigKey("maxLocalFileSizeBytes"), H)), this.addSub(this._ctx.sub(sharedConfigKey("multipleMin"), H)), this.addSub(this._ctx.sub(sharedConfigKey("multipleMax"), H)), this.addSub(this._ctx.sub(sharedConfigKey("multiple"), H)), this.addSub(this._ctx.sub(sharedConfigKey("imgOnly"), H)), this.addSub(this._ctx.sub(sharedConfigKey("accept"), H)), this.addSub(this._ctx.sub(sharedConfigKey("validationConcurrency"), (p) => {
|
|
270
|
-
this._queue.concurrency = p;
|
|
271
|
-
}));
|
|
272
|
-
}
|
|
273
|
-
runFileValidators(p, H) {
|
|
274
|
-
if (this._isDestroyed) return;
|
|
275
|
-
let U = H ?? this._uploadCollection.items();
|
|
276
|
-
for (let H of U) {
|
|
277
|
-
let U = this._uploadCollection.read(H);
|
|
278
|
-
U && this._runFileValidatorsForEntry(U, p);
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
runCollectionValidators() {
|
|
282
|
-
if (this._isDestroyed) return;
|
|
283
|
-
let p = this._sharedInstancesBag.api, U = p.getOutputCollectionState(), W = [], G = this._cfg.collectionValidators;
|
|
284
|
-
for (let H of [...this._commonCollectionValidators, ...G]) try {
|
|
285
|
-
let G = H(U, p);
|
|
286
|
-
if (!G) continue;
|
|
287
|
-
G && (W.push(this._addCustomTypeToValidationError(G)), G.message || console.warn(LOG_TEXT.MISSING_ERROR_MESSAGE));
|
|
288
|
-
} catch (p) {
|
|
289
|
-
console.warn(LOG_TEXT.COLLECTION_VALIDATION_FAILED, p);
|
|
290
|
-
}
|
|
291
|
-
this._ctx.pub("*collectionErrors", W), W.length > 0 && this._sharedInstancesBag.eventEmitter.emit(EventType.COMMON_UPLOAD_FAILED, () => p.getOutputCollectionState(), { debounce: !0 });
|
|
292
|
-
}
|
|
293
|
-
cleanupValidationForEntry(p) {
|
|
294
|
-
let H = this._entryValidationState.get(p.uid);
|
|
295
|
-
H && (H.abortController?.abort(), this._entryValidationState.delete(p.uid));
|
|
296
|
-
}
|
|
297
|
-
async _runFileValidatorsForEntry(p, H) {
|
|
298
|
-
if (this._isDestroyed) return;
|
|
299
|
-
let U = this._sharedInstancesBag.api, W = this._getEntryValidationState(p), G = W.promise ?? Promise.resolve(), K = (async () => {
|
|
300
|
-
if (this._isDestroyed || (await G, this._isDestroyed)) return;
|
|
301
|
-
let K = this._getValidatorDescriptorsForEntry(p, H);
|
|
302
|
-
if (K.length === 0 || !this._uploadCollection.hasItem(p.uid)) return;
|
|
303
|
-
p.setMultipleValues({
|
|
304
|
-
isQueuedForValidation: !0,
|
|
305
|
-
isValidationPending: !0
|
|
306
|
-
});
|
|
307
|
-
let q = U.getOutputItem(p.uid), J = new AbortController();
|
|
308
|
-
W.abortController = J;
|
|
309
|
-
let Y = this._cfg.validationTimeout, X = this._getValidatorDescriptors(), Z = new Set(K.map((p) => p.validator)), Q = [];
|
|
310
|
-
for (let p of X) if (!Z.has(p.validator)) {
|
|
311
|
-
let H = W.lastErrorThrownByValidator.get(p.validator);
|
|
312
|
-
H && Q.push(H);
|
|
313
|
-
}
|
|
314
|
-
let $ = K.map((p) => async () => {
|
|
315
|
-
if (this._isDestroyed) return;
|
|
316
|
-
let H = setTimeout(() => {
|
|
317
|
-
W.skippedValidators.add(p.validator), J.abort(), console.warn(LOG_TEXT.FILE_VALIDATION_TIMEOUT);
|
|
318
|
-
}, Y);
|
|
319
|
-
try {
|
|
320
|
-
let H = await p.validator(q, U, { signal: J.signal });
|
|
321
|
-
if (!H || J.signal.aborted) {
|
|
322
|
-
W.lastErrorThrownByValidator.set(p.validator, void 0);
|
|
323
|
-
return;
|
|
324
|
-
}
|
|
325
|
-
let G = this._addCustomTypeToValidationError(H);
|
|
326
|
-
W.lastErrorThrownByValidator.set(p.validator, G), Q.push(G), H.message || console.warn(LOG_TEXT.MISSING_ERROR_MESSAGE);
|
|
327
|
-
} catch (H) {
|
|
328
|
-
J.signal.aborted || (W.skippedValidators.add(p.validator), console.warn(LOG_TEXT.FILE_VALIDATION_FAILED, H), this._sharedInstancesBag.telemetryManager.sendEventError(H, `file validator. ${LOG_TEXT.FILE_VALIDATION_FAILED}`));
|
|
329
|
-
} finally {
|
|
330
|
-
clearTimeout(H), p.runOn !== "change" && W.skippedValidators.add(p.validator);
|
|
331
|
-
}
|
|
332
|
-
});
|
|
333
|
-
if (this._runQueueDebounced(), await this._queue.add(async () => {
|
|
334
|
-
this._isDestroyed || (p.setValue("isQueuedForValidation", !1), await Promise.all($.map((p) => p())).catch(() => {}));
|
|
335
|
-
}, { autoRun: !1 }), J.signal.aborted) {
|
|
336
|
-
p.setMultipleValues({
|
|
337
|
-
isQueuedForValidation: !1,
|
|
338
|
-
isValidationPending: !1
|
|
339
|
-
});
|
|
340
|
-
return;
|
|
341
|
-
}
|
|
342
|
-
p.setMultipleValues({
|
|
343
|
-
isValidationPending: !1,
|
|
344
|
-
isQueuedForValidation: !1,
|
|
345
|
-
errors: Q
|
|
346
|
-
});
|
|
347
|
-
})();
|
|
348
|
-
W.promise = K;
|
|
349
|
-
try {
|
|
350
|
-
await K;
|
|
351
|
-
} finally {
|
|
352
|
-
W.promise === K && (W.promise = void 0);
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
_addCustomTypeToValidationError(p) {
|
|
356
|
-
return {
|
|
357
|
-
...p,
|
|
358
|
-
type: p.type ?? "CUSTOM_ERROR"
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
_getEntryValidationState(p) {
|
|
362
|
-
let H = this._entryValidationState.get(p.uid);
|
|
363
|
-
if (H) return H;
|
|
364
|
-
let U = {
|
|
365
|
-
abortController: void 0,
|
|
366
|
-
skippedValidators: /* @__PURE__ */ new WeakSet(),
|
|
367
|
-
promise: void 0,
|
|
368
|
-
lastErrorThrownByValidator: /* @__PURE__ */ new WeakMap()
|
|
369
|
-
};
|
|
370
|
-
return this._entryValidationState.set(p.uid, U), U;
|
|
371
|
-
}
|
|
372
|
-
_getValidatorDescriptors() {
|
|
373
|
-
let p = this._cfg.fileValidators;
|
|
374
|
-
return [...this._commonFileValidators, ...p].map(getValidatorDescriptor);
|
|
375
|
-
}
|
|
376
|
-
_getValidatorDescriptorsForEntry(p, H) {
|
|
377
|
-
let U = this._getEntryValidationState(p);
|
|
378
|
-
return this._getValidatorDescriptors().filter((p) => !U.skippedValidators.has(p.validator)).filter((p) => p.runOn === H);
|
|
379
|
-
}
|
|
380
|
-
destroy() {
|
|
381
|
-
this._isDestroyed = !0, this._runQueueDebounced.cancel();
|
|
382
|
-
for (let p of this._entryValidationState.values()) p.abortController?.abort(), p.promise = void 0;
|
|
383
|
-
this._entryValidationState.clear();
|
|
384
|
-
}
|
|
385
|
-
}, MSG_NAME = "[Typed State] Wrong property name: ", TypedData = class {
|
|
386
|
-
constructor(p) {
|
|
387
|
-
this._ctxId = UID.generateFastUid(), this._data = PubSub.registerCtx(p, this._ctxId);
|
|
388
|
-
}
|
|
389
|
-
get uid() {
|
|
390
|
-
return this._ctxId;
|
|
391
|
-
}
|
|
392
|
-
setValue(p, H) {
|
|
393
|
-
if (!this._data.has(p)) {
|
|
394
|
-
console.warn(`${MSG_NAME}${String(p)}`);
|
|
395
|
-
return;
|
|
396
|
-
}
|
|
397
|
-
this._data.read(p) !== H && this._data.pub(p, H);
|
|
398
|
-
}
|
|
399
|
-
setMultipleValues(p) {
|
|
400
|
-
for (let [H, U] of Object.entries(p)) this.setValue(H, U);
|
|
401
|
-
}
|
|
402
|
-
getValue(p) {
|
|
403
|
-
return this._data.has(p) || console.warn(`${MSG_NAME}${String(p)}`), this._data.read(p);
|
|
404
|
-
}
|
|
405
|
-
subscribe(p, H) {
|
|
406
|
-
return this._data.sub(p, H);
|
|
407
|
-
}
|
|
408
|
-
destroy() {
|
|
409
|
-
PubSub.deleteCtx(this._ctxId);
|
|
410
|
-
}
|
|
411
|
-
}, TypedCollection = class p {
|
|
412
|
-
static {
|
|
413
|
-
this._destroyDelayMs = 1e4;
|
|
414
|
-
}
|
|
415
|
-
constructor(p) {
|
|
416
|
-
this._subsMap = Object.create(null), this._propertyObservers = /* @__PURE__ */ new Set(), this._collectionObservers = /* @__PURE__ */ new Set(), this._items = /* @__PURE__ */ new Set(), this._removed = /* @__PURE__ */ new Set(), this._added = /* @__PURE__ */ new Set(), this._markedToDestroy = /* @__PURE__ */ new Set(), this._initialValue = p.initialValue, this._ctxId = UID.generateFastUid(), this._data = PubSub.registerCtx({}, this._ctxId), this._watchList = p.watchList || [];
|
|
417
|
-
let H = Object.create(null);
|
|
418
|
-
this._notifyObservers = (p, U) => {
|
|
419
|
-
this._observeTimeout && window.clearTimeout(this._observeTimeout), H[p] || (H[p] = /* @__PURE__ */ new Set()), H[p].add(U), this._observeTimeout = window.setTimeout(() => {
|
|
420
|
-
Object.keys(H).length !== 0 && (this._propertyObservers.forEach((p) => {
|
|
421
|
-
p({ ...H });
|
|
422
|
-
}), H = Object.create(null));
|
|
423
|
-
}), this._scheduleDestroyMarkedItems();
|
|
424
|
-
}, p.handler && this.observeCollection(p.handler);
|
|
425
|
-
}
|
|
426
|
-
_notify() {
|
|
427
|
-
this._notifyTimeout && window.clearTimeout(this._notifyTimeout), this._notifyTimeout = window.setTimeout(() => {
|
|
428
|
-
let p = new Set(this._added), H = new Set(this._removed);
|
|
429
|
-
this._added.clear(), this._removed.clear();
|
|
430
|
-
for (let U of this._collectionObservers) U?.([...this._items], p, H);
|
|
431
|
-
this._scheduleDestroyMarkedItems();
|
|
432
|
-
});
|
|
433
|
-
}
|
|
434
|
-
_scheduleDestroyMarkedItems() {
|
|
435
|
-
this._markedToDestroy.size !== 0 && (this._destroyTimeout && window.clearTimeout(this._destroyTimeout), this._destroyTimeout = window.setTimeout(() => {
|
|
436
|
-
let p = [...this._markedToDestroy];
|
|
437
|
-
this._markedToDestroy.clear();
|
|
438
|
-
for (let H of p) H.destroy();
|
|
439
|
-
}, p._destroyDelayMs));
|
|
440
|
-
}
|
|
441
|
-
observeCollection(p) {
|
|
442
|
-
return this._collectionObservers.add(p), this._items.size > 0 && this._notify(), () => {
|
|
443
|
-
this.unobserveCollection(p);
|
|
444
|
-
};
|
|
445
|
-
}
|
|
446
|
-
unobserveCollection(p) {
|
|
447
|
-
this._collectionObservers.delete(p);
|
|
448
|
-
}
|
|
449
|
-
add(p) {
|
|
450
|
-
let H = new TypedData(this._initialValue);
|
|
451
|
-
for (let [U, W] of Object.entries(p)) H.setValue(U, W);
|
|
452
|
-
return this._items.add(H.uid), this._notify(), this._data.add(H.uid, H), this._added.add(H), this._watchList.forEach((p) => {
|
|
453
|
-
this._subsMap[H.uid] || (this._subsMap[H.uid] = []), this._subsMap[H.uid]?.push(H.subscribe(p, () => {
|
|
454
|
-
this._notifyObservers(p, H.uid);
|
|
455
|
-
}));
|
|
456
|
-
}), H.uid;
|
|
457
|
-
}
|
|
458
|
-
hasItem(p) {
|
|
459
|
-
return this._items.has(p);
|
|
460
|
-
}
|
|
461
|
-
read(p) {
|
|
462
|
-
return this._data.read(p) ?? null;
|
|
463
|
-
}
|
|
464
|
-
readProp(p, H) {
|
|
465
|
-
let U = this.read(p);
|
|
466
|
-
if (!U) throw Error(`TypedCollection#readProp: Item with id ${p} not found`);
|
|
467
|
-
return U.getValue(H);
|
|
468
|
-
}
|
|
469
|
-
publishProp(p, H, U) {
|
|
470
|
-
let W = this.read(p);
|
|
471
|
-
if (!W) throw Error(`TypedCollection#publishProp: Item with id ${p} not found`);
|
|
472
|
-
W.setValue(H, U);
|
|
473
|
-
}
|
|
474
|
-
remove(p) {
|
|
475
|
-
let H = this.read(p);
|
|
476
|
-
H && (this._removed.add(H), this._markedToDestroy.add(H)), this._items.delete(p), this._notify(), this._data.pub(p, void 0), this._subsMap[p]?.forEach((p) => {
|
|
477
|
-
p();
|
|
478
|
-
}), delete this._subsMap[p];
|
|
479
|
-
}
|
|
480
|
-
clearAll() {
|
|
481
|
-
this._items.forEach((p) => {
|
|
482
|
-
this.remove(p);
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
observeProperties(p) {
|
|
486
|
-
return this._propertyObservers.add(p), () => {
|
|
487
|
-
this.unobserveProperties(p);
|
|
488
|
-
};
|
|
489
|
-
}
|
|
490
|
-
unobserveProperties(p) {
|
|
491
|
-
this._propertyObservers.delete(p);
|
|
492
|
-
}
|
|
493
|
-
findItems(p) {
|
|
494
|
-
let H = [];
|
|
495
|
-
return this._items.forEach((U) => {
|
|
496
|
-
let W = this.read(U);
|
|
497
|
-
W && p(W) && H.push(U);
|
|
498
|
-
}), H;
|
|
499
|
-
}
|
|
500
|
-
items() {
|
|
501
|
-
return [...this._items];
|
|
502
|
-
}
|
|
503
|
-
get size() {
|
|
504
|
-
return this._items.size;
|
|
505
|
-
}
|
|
506
|
-
destroy() {
|
|
507
|
-
this._observeTimeout && window.clearTimeout(this._observeTimeout), this._notifyTimeout && window.clearTimeout(this._notifyTimeout), this._destroyTimeout && window.clearTimeout(this._destroyTimeout);
|
|
508
|
-
for (let p of this._markedToDestroy) p.destroy();
|
|
509
|
-
this._markedToDestroy.clear(), PubSub.deleteCtx(this._ctxId), this._propertyObservers = /* @__PURE__ */ new Set(), this._collectionObservers = /* @__PURE__ */ new Set();
|
|
510
|
-
for (let p of Object.keys(this._subsMap)) this._subsMap[p]?.forEach((p) => {
|
|
511
|
-
p();
|
|
512
|
-
}), delete this._subsMap[p];
|
|
513
|
-
}
|
|
514
|
-
};
|
|
515
|
-
const calcCameraModes = (p) => ({
|
|
516
|
-
isVideoRecordingEnabled: deserializeCsv(p.cameraModes).includes(CameraSourceTypes.VIDEO),
|
|
517
|
-
isPhotoEnabled: deserializeCsv(p.cameraModes).includes(CameraSourceTypes.PHOTO)
|
|
518
|
-
}), findBlockInCtx = (p, H) => {
|
|
519
|
-
for (let U of p) if (H(U)) return U;
|
|
520
|
-
}, hasBlockInCtx = (p, H) => {
|
|
521
|
-
for (let U of p) if (H(U)) return !0;
|
|
522
|
-
return !1;
|
|
523
|
-
};
|
|
524
|
-
function applyStyles(p, H) {
|
|
525
|
-
for (let U in H) U.includes("-") ? p.style.setProperty(U, String(H[U])) : p.style[U] = String(H[U]);
|
|
526
|
-
}
|
|
527
|
-
var cdnUrlRegex = RegExp("^/?([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})(?:/(-/(?:[^/]+/)+)?([^/]*))?$", "i");
|
|
528
|
-
const parseCdnUrl = ({ url: p, cdnBase: H }) => {
|
|
529
|
-
let U = new URL(H), W = new URL(DEFAULT_CDN_CNAME), G = new URL(p);
|
|
530
|
-
if (U.host !== G.host && W.host !== G.host) return null;
|
|
531
|
-
let K = cdnUrlRegex.exec(G.pathname);
|
|
532
|
-
if (!K) return null;
|
|
533
|
-
let [, q, J, Y] = K;
|
|
534
|
-
return q ? {
|
|
535
|
-
uuid: q,
|
|
536
|
-
cdnUrlModifiers: J || "",
|
|
537
|
-
filename: Y || null
|
|
538
|
-
} : null;
|
|
539
|
-
}, getOutputData = (p) => p.uploadCollection.items().map((H) => p.api.getOutputItem(H));
|
|
540
|
-
function memoize(p) {
|
|
541
|
-
let H = /* @__PURE__ */ new Map();
|
|
542
|
-
return (...U) => {
|
|
543
|
-
let W = JSON.stringify(U);
|
|
544
|
-
if (H.has(W)) return H.get(W);
|
|
545
|
-
let G = p(...U);
|
|
546
|
-
return H.set(W, G), G;
|
|
547
|
-
};
|
|
548
|
-
}
|
|
549
|
-
function createAsyncAssertWrapper(p) {
|
|
550
|
-
let H = !1;
|
|
551
|
-
return setTimeout(() => {
|
|
552
|
-
H = !0;
|
|
553
|
-
}, 0), (U) => ((...W) => (H && warnOnce(p), U(...W)));
|
|
554
|
-
}
|
|
555
|
-
function buildOutputCollectionState(p) {
|
|
556
|
-
let H = {}, U = p.ctx, W = {
|
|
557
|
-
progress: () => U.read("*commonProgress"),
|
|
558
|
-
errors: () => U.read("*collectionErrors"),
|
|
559
|
-
group: () => U.read("*groupInfo"),
|
|
560
|
-
totalCount: () => p.uploadCollection.size,
|
|
561
|
-
failedCount: () => H.failedEntries.length,
|
|
562
|
-
successCount: () => H.successEntries.length,
|
|
563
|
-
uploadingCount: () => H.uploadingEntries.length,
|
|
564
|
-
status: () => H.isFailed ? "failed" : H.isUploading ? "uploading" : H.isSuccess ? "success" : "idle",
|
|
565
|
-
isSuccess: () => H.allEntries.length > 0 && H.errors.length === 0 && H.successEntries.length === H.allEntries.length,
|
|
566
|
-
isUploading: () => H.allEntries.some((p) => p.status === "uploading"),
|
|
567
|
-
isFailed: () => H.errors.length > 0 || H.failedEntries.length > 0,
|
|
568
|
-
allEntries: () => getOutputData(p),
|
|
569
|
-
successEntries: () => H.allEntries.filter((p) => p.status === "success"),
|
|
570
|
-
failedEntries: () => H.allEntries.filter((p) => p.status === "failed"),
|
|
571
|
-
uploadingEntries: () => H.allEntries.filter((p) => p.status === "uploading"),
|
|
572
|
-
idleEntries: () => H.allEntries.filter((p) => p.status === "idle")
|
|
573
|
-
}, G = createAsyncAssertWrapper("You're trying to access the OutputCollectionState asynchronously. In this case, the data you retrieve will be newer than it was when the OutputCollectionState was created or when the event was dispatched. If you want to retain the state at a specific moment in time, you should use the spread operator like this: `{...outputCollectionState}` or `{...e.detail}`");
|
|
574
|
-
for (let [p, U] of Object.entries(W)) {
|
|
575
|
-
let W = p, K = memoize(G(U));
|
|
576
|
-
Object.defineProperty(H, W, {
|
|
577
|
-
get: K,
|
|
578
|
-
enumerable: !0
|
|
579
|
-
});
|
|
580
|
-
}
|
|
581
|
-
return H;
|
|
582
|
-
}
|
|
583
|
-
var UploaderPublicApi = class extends SharedInstance {
|
|
584
|
-
constructor(...p) {
|
|
585
|
-
super(...p), this._l10n = createL10n(() => this._ctx), this.addFileFromUrl = (p, { silent: H, fileName: U, source: W } = {}) => {
|
|
586
|
-
let G = this._uploadCollection.add({
|
|
587
|
-
externalUrl: p,
|
|
588
|
-
fileName: U ?? null,
|
|
589
|
-
silent: H ?? !1,
|
|
590
|
-
source: W ?? UploadSource.API
|
|
591
|
-
});
|
|
592
|
-
return this.getOutputItem(G);
|
|
593
|
-
}, this.addFileFromUuid = (p, { silent: H, fileName: U, source: W } = {}) => {
|
|
594
|
-
let G = this._uploadCollection.add({
|
|
595
|
-
uuid: p,
|
|
596
|
-
fileName: U ?? null,
|
|
597
|
-
silent: H ?? !1,
|
|
598
|
-
source: W ?? UploadSource.API
|
|
599
|
-
});
|
|
600
|
-
return this.getOutputItem(G);
|
|
601
|
-
}, this.addFileFromCdnUrl = (p, { silent: H, fileName: U, source: W } = {}) => {
|
|
602
|
-
let G = parseCdnUrl({
|
|
603
|
-
url: p,
|
|
604
|
-
cdnBase: this.cfg.cdnCname
|
|
605
|
-
});
|
|
606
|
-
if (!G) throw Error("Invalid CDN URL");
|
|
607
|
-
let K = this._uploadCollection.add({
|
|
608
|
-
uuid: G.uuid,
|
|
609
|
-
cdnUrl: p,
|
|
610
|
-
cdnUrlModifiers: G.cdnUrlModifiers,
|
|
611
|
-
fileName: U ?? G.filename ?? null,
|
|
612
|
-
silent: H ?? !1,
|
|
613
|
-
source: W ?? UploadSource.API
|
|
614
|
-
});
|
|
615
|
-
return this.getOutputItem(K);
|
|
616
|
-
}, this.addFileFromObject = (p, { silent: H, fileName: U, source: W, fullPath: G } = {}) => {
|
|
617
|
-
let K = this._uploadCollection.add({
|
|
618
|
-
file: p,
|
|
619
|
-
isImage: fileIsImage(p),
|
|
620
|
-
mimeType: p.type,
|
|
621
|
-
fileName: U ?? p.name,
|
|
622
|
-
fileSize: p.size,
|
|
623
|
-
silent: H ?? !1,
|
|
624
|
-
source: W ?? UploadSource.API,
|
|
625
|
-
fullPath: G ?? null
|
|
626
|
-
});
|
|
627
|
-
return this.getOutputItem(K);
|
|
628
|
-
}, this.removeFileByInternalId = (p) => {
|
|
629
|
-
if (!this._uploadCollection.read(p)) throw Error(`File with internalId ${p} not found`);
|
|
630
|
-
this._uploadCollection.remove(p);
|
|
631
|
-
}, this.uploadAll = () => {
|
|
632
|
-
let p = this._uploadCollection.items().filter((p) => {
|
|
633
|
-
let H = this._uploadCollection.read(p);
|
|
634
|
-
return H ? !H.getValue("isRemoved") && !H.getValue("isUploading") && !H.getValue("fileInfo") && H.getValue("errors").length === 0 && !H.getValue("isValidationPending") && !H.getValue("isQueuedForValidation") : !1;
|
|
635
|
-
});
|
|
636
|
-
p.length !== 0 && (this._ctx.pub("*uploadTrigger", new Set(p)), this._sharedInstancesBag.eventEmitter.emit(EventType.COMMON_UPLOAD_START, this.getOutputCollectionState()));
|
|
637
|
-
}, this.openSystemDialog = (p = {}) => {
|
|
638
|
-
let H = serializeCsv(mergeFileTypes([this.cfg.accept ?? "", ...this.cfg.imgOnly ? IMAGE_ACCEPT_LIST : []])), U = "uploadcare-file-input", W = document.createElement("input");
|
|
639
|
-
if (W.setAttribute(U, ""), applyStyles(W, {
|
|
640
|
-
opacity: 0,
|
|
641
|
-
height: 0,
|
|
642
|
-
width: 0,
|
|
643
|
-
visibility: "hidden",
|
|
644
|
-
position: "absolute",
|
|
645
|
-
top: 0,
|
|
646
|
-
left: 0
|
|
647
|
-
}), W.type = "file", W.multiple = this.cfg.multiple, p.captureCamera) {
|
|
648
|
-
W.capture = this.cfg.cameraCapture;
|
|
649
|
-
let { isPhotoEnabled: H, isVideoRecordingEnabled: U } = calcCameraModes(this.cfg);
|
|
650
|
-
p.modeCamera === CameraSourceTypes.PHOTO && H ? W.accept = BASIC_IMAGE_WILDCARD : p.modeCamera === CameraSourceTypes.VIDEO && U ? W.accept = "video/*" : W.accept = [BASIC_IMAGE_WILDCARD, U && "video/*"].filter(Boolean).join(",");
|
|
651
|
-
} else W.accept = H;
|
|
652
|
-
W.addEventListener("change", () => {
|
|
653
|
-
W.files && ([...W.files].forEach((H) => {
|
|
654
|
-
this.addFileFromObject(H, { source: p.captureCamera ? UploadSource.CAMERA : UploadSource.LOCAL });
|
|
655
|
-
}), this._ctx.pub("*currentActivity", ACTIVITY_TYPES.UPLOAD_LIST), this._sharedInstancesBag.modalManager?.open(ACTIVITY_TYPES.UPLOAD_LIST), W.remove());
|
|
656
|
-
}, { once: !0 }), document.querySelectorAll(`[${U}]`).forEach((p) => {
|
|
657
|
-
p.remove();
|
|
658
|
-
}), document.body.appendChild(W), W.dispatchEvent(new MouseEvent("click"));
|
|
659
|
-
}, this.initFlow = (p = !1) => {
|
|
660
|
-
if (this._uploadCollection.size > 0 && !p) this._ctx.pub("*currentActivity", ACTIVITY_TYPES.UPLOAD_LIST), this._sharedInstancesBag.modalManager?.open(ACTIVITY_TYPES.UPLOAD_LIST);
|
|
661
|
-
else if (this._sourceList?.length === 1) {
|
|
662
|
-
let p = this._sourceList[0];
|
|
663
|
-
if (p === "local") {
|
|
664
|
-
this._ctx.pub("*currentActivity", ACTIVITY_TYPES.UPLOAD_LIST), this.openSystemDialog();
|
|
665
|
-
return;
|
|
666
|
-
}
|
|
667
|
-
if (p === "camera" && browserFeatures.htmlMediaCapture) {
|
|
668
|
-
let { isPhotoEnabled: p, isVideoRecordingEnabled: H } = calcCameraModes(this.cfg);
|
|
669
|
-
if (p && H) {
|
|
670
|
-
this._ctx.pub("*currentActivity", ACTIVITY_TYPES.START_FROM);
|
|
671
|
-
return;
|
|
672
|
-
} else if (p || H) {
|
|
673
|
-
this.openSystemDialog({
|
|
674
|
-
captureCamera: !0,
|
|
675
|
-
modeCamera: p ? CameraSourceTypes.PHOTO : CameraSourceTypes.VIDEO
|
|
676
|
-
});
|
|
677
|
-
return;
|
|
678
|
-
} else this.openSystemDialog({
|
|
679
|
-
captureCamera: !0,
|
|
680
|
-
modeCamera: CameraSourceTypes.PHOTO
|
|
681
|
-
});
|
|
682
|
-
}
|
|
683
|
-
setTimeout(() => {
|
|
684
|
-
if (p !== this._sourceList[0]) return;
|
|
685
|
-
let H = this._sharedInstancesBag.blocksRegistry;
|
|
686
|
-
findBlockInCtx(H, (H) => "type" in H && H.type === p)?.activate();
|
|
687
|
-
}, 0), this._ctx.read("*currentActivity") && this._sharedInstancesBag.modalManager?.open(this._ctx.read("*currentActivity"));
|
|
688
|
-
} else this._ctx.pub("*currentActivity", ACTIVITY_TYPES.START_FROM), this._sharedInstancesBag.modalManager?.open(ACTIVITY_TYPES.START_FROM);
|
|
689
|
-
}, this.doneFlow = () => {
|
|
690
|
-
let p = findBlockInCtx(this._sharedInstancesBag.blocksRegistry, (p) => "doneActivity" in p);
|
|
691
|
-
p && (this._ctx.pub("*currentActivity", p.doneActivity), this._ctx.pub("*history", p.doneActivity ? [p.doneActivity] : []), this._ctx.read("*currentActivity") || this._sharedInstancesBag.modalManager?.closeAll());
|
|
692
|
-
}, this.setCurrentActivity = (p, ...H) => {
|
|
693
|
-
setTimeout(() => {
|
|
694
|
-
if (hasBlockInCtx(this._sharedInstancesBag.blocksRegistry, (H) => H.activityType === p)) {
|
|
695
|
-
this._ctx.pub("*currentActivityParams", H[0] ?? {}), this._ctx.pub("*currentActivity", p);
|
|
696
|
-
return;
|
|
697
|
-
}
|
|
698
|
-
console.warn(`Activity type "${p}" not found in the context`);
|
|
699
|
-
});
|
|
700
|
-
}, this.getCurrentActivity = () => this._ctx.read("*currentActivity"), this.setModalState = (p) => {
|
|
701
|
-
setTimeout(() => {
|
|
702
|
-
if (p && !this._ctx.read("*currentActivity")) {
|
|
703
|
-
console.warn("Can't open modal without current activity. Please use \"setCurrentActivity\" method first.");
|
|
704
|
-
return;
|
|
705
|
-
}
|
|
706
|
-
p ? this._sharedInstancesBag.modalManager?.open(this._ctx.read("*currentActivity")) : (this._sharedInstancesBag.modalManager?.close(this._ctx.read("*currentActivity")), this._ctx.pub("*currentActivity", null));
|
|
707
|
-
});
|
|
708
|
-
};
|
|
709
|
-
}
|
|
710
|
-
get _uploadCollection() {
|
|
711
|
-
return this._sharedInstancesBag.uploadCollection;
|
|
712
|
-
}
|
|
713
|
-
get cfg() {
|
|
714
|
-
return this._cfg;
|
|
715
|
-
}
|
|
716
|
-
get l10n() {
|
|
717
|
-
return this._l10n;
|
|
718
|
-
}
|
|
719
|
-
removeAllFiles() {
|
|
720
|
-
this._uploadCollection.clearAll();
|
|
721
|
-
}
|
|
722
|
-
getOutputItem(p) {
|
|
723
|
-
let H = PubSub.getCtx(p);
|
|
724
|
-
if (!H) throw Error(`UploaderPublicApi#getOutputItem: Entry with ID "${p}" not found in the upload collection`);
|
|
725
|
-
let U = H.store, W = U.fileInfo, K = U.isRemoved ? "removed" : U.errors.length > 0 ? "failed" : U.fileInfo ? "success" : U.isUploading ? "uploading" : "idle";
|
|
726
|
-
return {
|
|
727
|
-
uuid: W?.uuid ?? U.uuid ?? null,
|
|
728
|
-
internalId: p,
|
|
729
|
-
name: W?.originalFilename ?? U.fileName,
|
|
730
|
-
size: W?.size ?? U.fileSize,
|
|
731
|
-
isImage: W?.isImage ?? U.isImage,
|
|
732
|
-
mimeType: W?.mimeType ?? U.mimeType,
|
|
733
|
-
file: U.file,
|
|
734
|
-
externalUrl: U.externalUrl,
|
|
735
|
-
cdnUrlModifiers: U.cdnUrlModifiers,
|
|
736
|
-
cdnUrl: U.cdnUrl ?? W?.cdnUrl ?? null,
|
|
737
|
-
fullPath: U.fullPath,
|
|
738
|
-
uploadProgress: U.uploadProgress,
|
|
739
|
-
fileInfo: W ?? null,
|
|
740
|
-
metadata: U.metadata ?? W?.metadata ?? null,
|
|
741
|
-
isSuccess: K === "success",
|
|
742
|
-
isUploading: K === "uploading",
|
|
743
|
-
isFailed: K === "failed",
|
|
744
|
-
isRemoved: K === "removed",
|
|
745
|
-
isValidationPending: U.isValidationPending,
|
|
746
|
-
errors: U.errors,
|
|
747
|
-
status: K,
|
|
748
|
-
source: U?.source
|
|
749
|
-
};
|
|
750
|
-
}
|
|
751
|
-
getOutputCollectionState() {
|
|
752
|
-
return buildOutputCollectionState(this._sharedInstancesBag);
|
|
753
|
-
}
|
|
754
|
-
get _sourceList() {
|
|
755
|
-
let p = [];
|
|
756
|
-
return this.cfg.sourceList && (p = stringToArray(this.cfg.sourceList)), p;
|
|
757
|
-
}
|
|
758
|
-
};
|
|
759
|
-
const initialUploadEntryData = {
|
|
760
|
-
file: null,
|
|
761
|
-
externalUrl: null,
|
|
762
|
-
fileName: null,
|
|
763
|
-
fileSize: null,
|
|
764
|
-
lastModified: Date.now(),
|
|
765
|
-
uploadProgress: 0,
|
|
766
|
-
uuid: null,
|
|
767
|
-
isImage: !1,
|
|
768
|
-
mimeType: null,
|
|
769
|
-
ctxName: null,
|
|
770
|
-
cdnUrl: null,
|
|
771
|
-
cdnUrlModifiers: null,
|
|
772
|
-
fileInfo: null,
|
|
773
|
-
isUploading: !1,
|
|
774
|
-
abortController: null,
|
|
775
|
-
thumbUrl: null,
|
|
776
|
-
silent: !1,
|
|
777
|
-
source: null,
|
|
778
|
-
fullPath: null,
|
|
779
|
-
metadata: null,
|
|
780
|
-
errors: [],
|
|
781
|
-
uploadError: null,
|
|
782
|
-
isRemoved: !1,
|
|
783
|
-
isQueuedForUploading: !1,
|
|
784
|
-
isValidationPending: !1,
|
|
785
|
-
isQueuedForValidation: !1
|
|
786
|
-
};
|
|
787
|
-
function customUserAgent(p) {
|
|
788
|
-
return getUserAgent$1({
|
|
789
|
-
...p,
|
|
790
|
-
libraryName: PACKAGE_NAME,
|
|
791
|
-
libraryVersion: PACKAGE_VERSION
|
|
792
|
-
});
|
|
793
|
-
}
|
|
794
|
-
var LitUploaderBlock = class W extends LitActivityBlock {
|
|
795
|
-
constructor(...p) {
|
|
796
|
-
super(...p), this.couldBeCtxOwner = !1, this._isCtxOwner = !1, this.init$ = uploaderBlockCtx(this), this._flushOutputItems = debounce(async () => {
|
|
797
|
-
if (this.getOutputData().length !== this.uploadCollection.size) return;
|
|
798
|
-
let p = this.api.getOutputCollectionState();
|
|
799
|
-
this.$["*collectionState"] = p, this.emit(EventType.CHANGE, () => this.api.getOutputCollectionState(), { debounce: !0 }), this.cfg.groupOutput && p.totalCount > 0 && p.status === "success" && this._createGroup(p);
|
|
800
|
-
}, 300), this._handleCollectionUpdate = (p, U, W) => {
|
|
801
|
-
if (this.isConnected) {
|
|
802
|
-
(U.size || W.size) && (this.$["*groupInfo"] = null), this.validationManager.runFileValidators("add", [...U].map((p) => p.uid));
|
|
803
|
-
for (let p of U) p.getValue("silent") || this.emit(EventType.FILE_ADDED, this.api.getOutputItem(p.uid));
|
|
804
|
-
this.validationManager.runCollectionValidators();
|
|
805
|
-
for (let p of W) {
|
|
806
|
-
this.$["*uploadTrigger"].delete(p.uid), this.validationManager.cleanupValidationForEntry(p), p.getValue("abortController")?.abort(), p.setMultipleValues({
|
|
807
|
-
isRemoved: !0,
|
|
808
|
-
abortController: null,
|
|
809
|
-
isUploading: !1,
|
|
810
|
-
uploadProgress: 0
|
|
811
|
-
});
|
|
812
|
-
let U = p?.getValue("thumbUrl");
|
|
813
|
-
U && URL.revokeObjectURL(U), this.emit(EventType.FILE_REMOVED, this.api.getOutputItem(p.uid));
|
|
814
|
-
}
|
|
815
|
-
this.$["*uploadList"] = p.map((p) => ({ uid: p })), this._flushCommonUploadProgress(), this._flushOutputItems();
|
|
816
|
-
}
|
|
817
|
-
}, this._handleCollectionPropertiesUpdate = (p) => {
|
|
818
|
-
if (!this.isConnected) return;
|
|
819
|
-
this._flushOutputItems();
|
|
820
|
-
let U = this.uploadCollection, W = [...new Set(Object.entries(p).filter(([p]) => [
|
|
821
|
-
"uploadError",
|
|
822
|
-
"fileInfo",
|
|
823
|
-
"cdnUrl",
|
|
824
|
-
"cdnUrlModifiers"
|
|
825
|
-
].includes(p)).flatMap(([, p]) => [...p]))];
|
|
826
|
-
if (W.length > 0 && setTimeout(() => {
|
|
827
|
-
if (!this.isConnected) return;
|
|
828
|
-
let H = W.filter((H) => p.fileInfo?.has(H) && !!PubSub.getCtx(H)?.store.fileInfo);
|
|
829
|
-
H.length > 0 && this.validationManager.runFileValidators("upload", H), this.validationManager.runFileValidators("change", W);
|
|
830
|
-
}), p.uploadProgress) {
|
|
831
|
-
for (let U of p.uploadProgress) {
|
|
832
|
-
let p = PubSub.getCtx(U);
|
|
833
|
-
if (!p) continue;
|
|
834
|
-
let { isUploading: W, silent: K } = p.store;
|
|
835
|
-
W && !K && this.emit(EventType.FILE_UPLOAD_PROGRESS, this.api.getOutputItem(U));
|
|
836
|
-
}
|
|
837
|
-
this._flushCommonUploadProgress();
|
|
838
|
-
}
|
|
839
|
-
if (p.isUploading) for (let U of p.isUploading) {
|
|
840
|
-
let p = PubSub.getCtx(U);
|
|
841
|
-
if (!p) continue;
|
|
842
|
-
let { isUploading: W, silent: K } = p.store;
|
|
843
|
-
W && !K && this.emit(EventType.FILE_UPLOAD_START, this.api.getOutputItem(U));
|
|
844
|
-
}
|
|
845
|
-
if (p.fileInfo) {
|
|
846
|
-
for (let U of p.fileInfo) {
|
|
847
|
-
let p = PubSub.getCtx(U);
|
|
848
|
-
if (!p) continue;
|
|
849
|
-
let { fileInfo: W, silent: K } = p.store;
|
|
850
|
-
W && !K && this.emit(EventType.FILE_UPLOAD_SUCCESS, this.api.getOutputItem(U));
|
|
851
|
-
}
|
|
852
|
-
this.cfg.cropPreset && this._setInitialCrop(), this.cfg.cloudImageEditorAutoOpen && this._openCloudImageEditor();
|
|
853
|
-
}
|
|
854
|
-
if (p.errors) {
|
|
855
|
-
this.validationManager.runCollectionValidators();
|
|
856
|
-
for (let U of p.errors) {
|
|
857
|
-
let p = PubSub.getCtx(U);
|
|
858
|
-
if (!p) continue;
|
|
859
|
-
let { errors: W } = p.store;
|
|
860
|
-
W.length > 0 && (this.emit(EventType.FILE_UPLOAD_FAILED, this.api.getOutputItem(U)), this.emit(EventType.COMMON_UPLOAD_FAILED, () => this.api.getOutputCollectionState(), { debounce: !0 }));
|
|
861
|
-
}
|
|
862
|
-
let W = U.findItems((p) => !!p.getValue("fileInfo")), K = U.findItems((p) => p.getValue("errors").length > 0);
|
|
863
|
-
U.size > 0 && K.length === 0 && U.size === W.length && this.$["*collectionErrors"].length === 0 && this.emit(EventType.COMMON_UPLOAD_SUCCESS, this.api.getOutputCollectionState());
|
|
864
|
-
}
|
|
865
|
-
p.cdnUrl && ([...p.cdnUrl].filter((p) => !!this.uploadCollection.read(p)?.getValue("cdnUrl")).forEach((p) => {
|
|
866
|
-
this.emit(EventType.FILE_URL_CHANGED, this.api.getOutputItem(p));
|
|
867
|
-
}), this.$["*groupInfo"] = null);
|
|
868
|
-
}, this._flushCommonUploadProgress = () => {
|
|
869
|
-
let p = 0, U = [...this.$["*uploadTrigger"]].filter((p) => !!this.uploadCollection.read(p));
|
|
870
|
-
U.forEach((H) => {
|
|
871
|
-
let U = this.uploadCollection.readProp(H, "uploadProgress");
|
|
872
|
-
typeof U == "number" && (p += U);
|
|
873
|
-
});
|
|
874
|
-
let W = U.length ? Math.round(p / U.length) : 0;
|
|
875
|
-
this.$["*commonProgress"] !== W && (this.$["*commonProgress"] = W, this.emit(EventType.COMMON_UPLOAD_PROGRESS, this.api.getOutputCollectionState()));
|
|
876
|
-
};
|
|
877
|
-
}
|
|
878
|
-
get _hasCtxOwner() {
|
|
879
|
-
return this.hasBlockInCtx((p) => p instanceof W ? p._isCtxOwner && p.isConnected && p !== this : !1);
|
|
880
|
-
}
|
|
881
|
-
initCallback() {
|
|
882
|
-
super.initCallback(), this._addSharedContextInstance("*uploadCollection", () => new TypedCollection({
|
|
883
|
-
initialValue: initialUploadEntryData,
|
|
884
|
-
watchList: [
|
|
885
|
-
"uploadProgress",
|
|
886
|
-
"uploadError",
|
|
887
|
-
"fileInfo",
|
|
888
|
-
"errors",
|
|
889
|
-
"cdnUrl",
|
|
890
|
-
"isUploading",
|
|
891
|
-
"isValidationPending"
|
|
892
|
-
]
|
|
893
|
-
})), this._addSharedContextInstance("*secureUploadsManager", (p) => new SecureUploadsManager(p)), this._addSharedContextInstance("*validationManager", (p) => new ValidationManager(p)), this._addSharedContextInstance("*publicApi", (p) => new UploaderPublicApi(p)), !this._hasCtxOwner && this.couldBeCtxOwner && this._initCtxOwner();
|
|
894
|
-
}
|
|
895
|
-
getAPI() {
|
|
896
|
-
return this.api;
|
|
897
|
-
}
|
|
898
|
-
get validationManager() {
|
|
899
|
-
return this._getSharedContextInstance("*validationManager");
|
|
900
|
-
}
|
|
901
|
-
get api() {
|
|
902
|
-
return this._getSharedContextInstance("*publicApi");
|
|
903
|
-
}
|
|
904
|
-
get uploadCollection() {
|
|
905
|
-
return this._getSharedContextInstance("*uploadCollection");
|
|
906
|
-
}
|
|
907
|
-
get secureUploadsManager() {
|
|
908
|
-
return this._getSharedContextInstance("*secureUploadsManager");
|
|
909
|
-
}
|
|
910
|
-
disconnectedCallback() {
|
|
911
|
-
super.disconnectedCallback(), this._isCtxOwner && this._unobserveUploadCollection(), this._flushOutputItems.cancel();
|
|
912
|
-
}
|
|
913
|
-
connectedCallback() {
|
|
914
|
-
super.connectedCallback(), this._isCtxOwner && this._observeUploadCollection();
|
|
915
|
-
}
|
|
916
|
-
_initCtxOwner() {
|
|
917
|
-
this._isCtxOwner = !0, this._observeUploadCollection(), this.subConfigValue("maxConcurrentRequests", (p) => {
|
|
918
|
-
this.$["*uploadQueue"].concurrency = Number(p) || 1;
|
|
919
|
-
});
|
|
920
|
-
}
|
|
921
|
-
_observeUploadCollection() {
|
|
922
|
-
this._unobserveUploadCollection(), this._unobserveCollection = this.uploadCollection.observeCollection(this._handleCollectionUpdate), this._unobserveCollectionProperties = this.uploadCollection.observeProperties(this._handleCollectionPropertiesUpdate);
|
|
923
|
-
}
|
|
924
|
-
_unobserveUploadCollection() {
|
|
925
|
-
this._unobserveCollectionProperties?.(), this._unobserveCollection?.(), this._unobserveCollectionProperties = void 0, this._unobserveCollection = void 0;
|
|
926
|
-
}
|
|
927
|
-
async _createGroup(p) {
|
|
928
|
-
let U = await this.getUploadClientOptions(), W = p.allEntries.map((p) => p.uuid + (p.cdnUrlModifiers ? `/${p.cdnUrlModifiers}` : "")), G = new AbortController(), K = await uploadFileGroup(W, {
|
|
929
|
-
...U,
|
|
930
|
-
signal: G.signal
|
|
931
|
-
});
|
|
932
|
-
if (this.$["*collectionState"] !== p) {
|
|
933
|
-
G.abort();
|
|
934
|
-
return;
|
|
935
|
-
}
|
|
936
|
-
this.$["*groupInfo"] = K;
|
|
937
|
-
let q = this.api.getOutputCollectionState();
|
|
938
|
-
this.emit(EventType.GROUP_CREATED, q), this.emit(EventType.CHANGE, () => this.api.getOutputCollectionState(), { debounce: !0 }), this.$["*collectionState"] = q;
|
|
939
|
-
}
|
|
940
|
-
_openCloudImageEditor() {
|
|
941
|
-
let [p] = this.uploadCollection.findItems((p) => !!p.getValue("fileInfo") && p.getValue("isImage")).map((p) => this.uploadCollection.read(p));
|
|
942
|
-
p && this.uploadCollection.size === 1 && this.cfg.useCloudImageEditor && this.hasBlockInCtx((p) => p.activityType === LitActivityBlock.activities.CLOUD_IMG_EDIT) && (this.$["*currentActivityParams"] = { internalId: p.uid }, this.$["*currentActivity"] = LitActivityBlock.activities.CLOUD_IMG_EDIT, this.modalManager?.open(LitActivityBlock.activities.CLOUD_IMG_EDIT));
|
|
943
|
-
}
|
|
944
|
-
_setInitialCrop() {
|
|
945
|
-
let H = parseCropPreset(this.cfg.cropPreset);
|
|
946
|
-
if (H) {
|
|
947
|
-
let [p] = H, U = this.uploadCollection.findItems((p) => !!p.getValue("fileInfo") && p.getValue("isImage") && !p.getValue("cdnUrlModifiers")?.includes("/crop/")).map((p) => this.uploadCollection.read(p)).filter(Boolean);
|
|
948
|
-
for (let H of U) {
|
|
949
|
-
let U = H.getValue("fileInfo");
|
|
950
|
-
if (!U || !U.imageInfo) {
|
|
951
|
-
console.warn("Failed to get image info for entry", H.uid);
|
|
952
|
-
continue;
|
|
953
|
-
}
|
|
954
|
-
let { width: W, height: G } = U.imageInfo, K = calculateMaxCenteredCropFrame(W, G, typeof p?.width == "number" && typeof p?.height == "number" && p.width > 0 && p.height > 0 ? p.width / p.height : 1), q = createCdnUrlModifiers(`crop/${K.width}x${K.height}/${K.x},${K.y}`, "preview"), J = H.getValue("cdnUrl");
|
|
955
|
-
if (!J) {
|
|
956
|
-
console.warn("Failed to get cdnUrl for entry", H.uid);
|
|
957
|
-
continue;
|
|
958
|
-
}
|
|
959
|
-
H.setMultipleValues({
|
|
960
|
-
cdnUrlModifiers: q,
|
|
961
|
-
cdnUrl: createCdnUrl(J, q)
|
|
962
|
-
}), this.uploadCollection.size === 1 && this.cfg.useCloudImageEditor && this.hasBlockInCtx((p) => p.activityType === LitActivityBlock.activities.CLOUD_IMG_EDIT) && (this.$["*currentActivityParams"] = { internalId: H.uid }, this.$["*currentActivity"] = LitActivityBlock.activities.CLOUD_IMG_EDIT, this.modalManager?.open(LitActivityBlock.activities.CLOUD_IMG_EDIT));
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
async getMetadataFor(p) {
|
|
967
|
-
let H = this.cfg.metadata || void 0;
|
|
968
|
-
return typeof H == "function" ? await H(this.api.getOutputItem(p)) : H;
|
|
969
|
-
}
|
|
970
|
-
async getUploadClientOptions() {
|
|
971
|
-
let p = await this.secureUploadsManager.getSecureToken().catch(() => null);
|
|
972
|
-
return {
|
|
973
|
-
store: this.cfg.store,
|
|
974
|
-
publicKey: this.cfg.pubkey,
|
|
975
|
-
baseCDN: this.cfg.cdnCname,
|
|
976
|
-
baseURL: this.cfg.baseUrl,
|
|
977
|
-
userAgent: customUserAgent,
|
|
978
|
-
integration: this.cfg.userAgentIntegration,
|
|
979
|
-
secureSignature: p?.secureSignature,
|
|
980
|
-
secureExpire: p?.secureExpire,
|
|
981
|
-
retryThrottledRequestMaxTimes: this.cfg.retryThrottledRequestMaxTimes,
|
|
982
|
-
retryNetworkErrorMaxTimes: this.cfg.retryNetworkErrorMaxTimes,
|
|
983
|
-
multipartMinFileSize: this.cfg.multipartMinFileSize,
|
|
984
|
-
multipartChunkSize: this.cfg.multipartChunkSize,
|
|
985
|
-
maxConcurrentRequests: this.cfg.multipartMaxConcurrentRequests,
|
|
986
|
-
multipartMaxAttempts: this.cfg.multipartMaxAttempts,
|
|
987
|
-
checkForUrlDuplicates: !!this.cfg.checkForUrlDuplicates,
|
|
988
|
-
saveUrlForRecurrentUploads: !!this.cfg.saveUrlForRecurrentUploads
|
|
989
|
-
};
|
|
990
|
-
}
|
|
991
|
-
getOutputData() {
|
|
992
|
-
return getOutputData(this._sharedInstancesBag);
|
|
993
|
-
}
|
|
994
|
-
};
|
|
995
|
-
LitUploaderBlock.extSrcList = Object.freeze({ ...ExternalUploadSource }), LitUploaderBlock.sourceTypes = Object.freeze({ ...UploadSource });
|
|
996
|
-
export { LitActivityBlock as n, LitUploaderBlock as t };
|