@uploadcare/file-uploader 0.50.1-alpha.2
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/LICENSE +21 -0
- package/README.md +165 -0
- package/abstract/ActivityBlock.d.ts +68 -0
- package/abstract/ActivityBlock.d.ts.map +1 -0
- package/abstract/ActivityBlock.js +207 -0
- package/abstract/Block.d.ts +99 -0
- package/abstract/Block.d.ts.map +1 -0
- package/abstract/Block.js +349 -0
- package/abstract/CTX.d.ts +31 -0
- package/abstract/CTX.d.ts.map +1 -0
- package/abstract/CTX.js +38 -0
- package/abstract/LocaleManager.d.ts +38 -0
- package/abstract/LocaleManager.d.ts.map +1 -0
- package/abstract/LocaleManager.js +127 -0
- package/abstract/SecureUploadsManager.d.ts +22 -0
- package/abstract/SecureUploadsManager.d.ts.map +1 -0
- package/abstract/SecureUploadsManager.js +87 -0
- package/abstract/SolutionBlock.d.ts +23 -0
- package/abstract/SolutionBlock.d.ts.map +1 -0
- package/abstract/SolutionBlock.js +23 -0
- package/abstract/TypedCollection.d.ts +127 -0
- package/abstract/TypedCollection.d.ts.map +1 -0
- package/abstract/TypedCollection.js +245 -0
- package/abstract/TypedData.d.ts +47 -0
- package/abstract/TypedData.d.ts.map +1 -0
- package/abstract/TypedData.js +77 -0
- package/abstract/UploaderBlock.d.ts +114 -0
- package/abstract/UploaderBlock.d.ts.map +1 -0
- package/abstract/UploaderBlock.js +444 -0
- package/abstract/UploaderPublicApi.d.ts +90 -0
- package/abstract/UploaderPublicApi.d.ts.map +1 -0
- package/abstract/UploaderPublicApi.js +316 -0
- package/abstract/ValidationManager.d.ts +31 -0
- package/abstract/ValidationManager.d.ts.map +1 -0
- package/abstract/ValidationManager.js +162 -0
- package/abstract/a11y.d.ts +20 -0
- package/abstract/a11y.d.ts.map +1 -0
- package/abstract/a11y.js +118 -0
- package/abstract/buildOutputCollectionState.d.ts +8 -0
- package/abstract/buildOutputCollectionState.d.ts.map +1 -0
- package/abstract/buildOutputCollectionState.js +136 -0
- package/abstract/connectBlocksFrom.d.ts +8 -0
- package/abstract/connectBlocksFrom.d.ts.map +1 -0
- package/abstract/connectBlocksFrom.js +34 -0
- package/abstract/l10nProcessor.d.ts +7 -0
- package/abstract/l10nProcessor.d.ts.map +1 -0
- package/abstract/l10nProcessor.js +80 -0
- package/abstract/localeRegistry.d.ts +5 -0
- package/abstract/localeRegistry.d.ts.map +1 -0
- package/abstract/localeRegistry.js +63 -0
- package/abstract/registerBlocks.d.ts +5 -0
- package/abstract/registerBlocks.d.ts.map +1 -0
- package/abstract/registerBlocks.js +31 -0
- package/abstract/sharedConfigKey.d.ts +2 -0
- package/abstract/sharedConfigKey.d.ts.map +1 -0
- package/abstract/sharedConfigKey.js +8 -0
- package/abstract/uploadEntrySchema.d.ts +64 -0
- package/abstract/uploadEntrySchema.d.ts.map +1 -0
- package/abstract/uploadEntrySchema.js +138 -0
- package/blocks/ActivityHeader/ActivityHeader.d.ts +4 -0
- package/blocks/ActivityHeader/ActivityHeader.d.ts.map +1 -0
- package/blocks/ActivityHeader/ActivityHeader.js +3 -0
- package/blocks/ActivityHeader/activity-header.css +14 -0
- package/blocks/CameraSource/CameraSource.d.ts +39 -0
- package/blocks/CameraSource/CameraSource.d.ts.map +1 -0
- package/blocks/CameraSource/CameraSource.js +253 -0
- package/blocks/CameraSource/camera-source.css +107 -0
- package/blocks/CloudImageEditor/index.css +1 -0
- package/blocks/CloudImageEditor/index.d.ts +2 -0
- package/blocks/CloudImageEditor/index.d.ts.map +1 -0
- package/blocks/CloudImageEditor/index.js +1 -0
- package/blocks/CloudImageEditor/src/CloudImageEditorBlock.d.ts +58 -0
- package/blocks/CloudImageEditor/src/CloudImageEditorBlock.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/CloudImageEditorBlock.js +228 -0
- package/blocks/CloudImageEditor/src/CropFrame.d.ts +146 -0
- package/blocks/CloudImageEditor/src/CropFrame.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/CropFrame.js +511 -0
- package/blocks/CloudImageEditor/src/EditorButtonControl.d.ts +10 -0
- package/blocks/CloudImageEditor/src/EditorButtonControl.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/EditorButtonControl.js +44 -0
- package/blocks/CloudImageEditor/src/EditorCropButtonControl.d.ts +6 -0
- package/blocks/CloudImageEditor/src/EditorCropButtonControl.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/EditorCropButtonControl.js +39 -0
- package/blocks/CloudImageEditor/src/EditorFilterControl.d.ts +18 -0
- package/blocks/CloudImageEditor/src/EditorFilterControl.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/EditorFilterControl.js +155 -0
- package/blocks/CloudImageEditor/src/EditorImageCropper.d.ts +106 -0
- package/blocks/CloudImageEditor/src/EditorImageCropper.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/EditorImageCropper.js +551 -0
- package/blocks/CloudImageEditor/src/EditorImageFader.d.ts +132 -0
- package/blocks/CloudImageEditor/src/EditorImageFader.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/EditorImageFader.js +454 -0
- package/blocks/CloudImageEditor/src/EditorOperationControl.d.ts +9 -0
- package/blocks/CloudImageEditor/src/EditorOperationControl.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/EditorOperationControl.js +39 -0
- package/blocks/CloudImageEditor/src/EditorScroller.d.ts +7 -0
- package/blocks/CloudImageEditor/src/EditorScroller.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/EditorScroller.js +33 -0
- package/blocks/CloudImageEditor/src/EditorSlider.d.ts +24 -0
- package/blocks/CloudImageEditor/src/EditorSlider.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/EditorSlider.js +118 -0
- package/blocks/CloudImageEditor/src/EditorToolbar.d.ts +104 -0
- package/blocks/CloudImageEditor/src/EditorToolbar.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/EditorToolbar.js +441 -0
- package/blocks/CloudImageEditor/src/crop-utils.d.ts +123 -0
- package/blocks/CloudImageEditor/src/crop-utils.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/crop-utils.js +729 -0
- package/blocks/CloudImageEditor/src/cropper-constants.d.ts +11 -0
- package/blocks/CloudImageEditor/src/cropper-constants.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/cropper-constants.js +11 -0
- package/blocks/CloudImageEditor/src/css/common.css +1157 -0
- package/blocks/CloudImageEditor/src/css/icons.css +12 -0
- package/blocks/CloudImageEditor/src/css/index.css +2 -0
- package/blocks/CloudImageEditor/src/elements/button/BtnUi.d.ts +20 -0
- package/blocks/CloudImageEditor/src/elements/button/BtnUi.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/elements/button/BtnUi.js +90 -0
- package/blocks/CloudImageEditor/src/elements/line-loader/LineLoaderUi.d.ts +11 -0
- package/blocks/CloudImageEditor/src/elements/line-loader/LineLoaderUi.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/elements/line-loader/LineLoaderUi.js +52 -0
- package/blocks/CloudImageEditor/src/elements/presence-toggle/PresenceToggle.d.ts +17 -0
- package/blocks/CloudImageEditor/src/elements/presence-toggle/PresenceToggle.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/elements/presence-toggle/PresenceToggle.js +71 -0
- package/blocks/CloudImageEditor/src/elements/slider/SliderUi.d.ts +16 -0
- package/blocks/CloudImageEditor/src/elements/slider/SliderUi.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/elements/slider/SliderUi.js +178 -0
- package/blocks/CloudImageEditor/src/index.d.ts +15 -0
- package/blocks/CloudImageEditor/src/index.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/index.js +14 -0
- package/blocks/CloudImageEditor/src/lib/FocusVisible.d.ts +15 -0
- package/blocks/CloudImageEditor/src/lib/FocusVisible.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/lib/FocusVisible.js +33 -0
- package/blocks/CloudImageEditor/src/lib/applyFocusVisiblePolyfill.d.ts +10 -0
- package/blocks/CloudImageEditor/src/lib/applyFocusVisiblePolyfill.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/lib/applyFocusVisiblePolyfill.js +256 -0
- package/blocks/CloudImageEditor/src/lib/classNames.d.ts +3 -0
- package/blocks/CloudImageEditor/src/lib/classNames.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/lib/classNames.js +34 -0
- package/blocks/CloudImageEditor/src/lib/linspace.d.ts +8 -0
- package/blocks/CloudImageEditor/src/lib/linspace.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/lib/linspace.js +14 -0
- package/blocks/CloudImageEditor/src/lib/parseCropPreset.d.ts +2 -0
- package/blocks/CloudImageEditor/src/lib/parseCropPreset.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/lib/parseCropPreset.js +14 -0
- package/blocks/CloudImageEditor/src/lib/parseTabs.d.ts +2 -0
- package/blocks/CloudImageEditor/src/lib/parseTabs.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/lib/parseTabs.js +14 -0
- package/blocks/CloudImageEditor/src/lib/pick.d.ts +7 -0
- package/blocks/CloudImageEditor/src/lib/pick.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/lib/pick.js +15 -0
- package/blocks/CloudImageEditor/src/lib/preloadImage.d.ts +11 -0
- package/blocks/CloudImageEditor/src/lib/preloadImage.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/lib/preloadImage.js +38 -0
- package/blocks/CloudImageEditor/src/lib/transformationUtils.d.ts +14 -0
- package/blocks/CloudImageEditor/src/lib/transformationUtils.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/lib/transformationUtils.js +167 -0
- package/blocks/CloudImageEditor/src/state.d.ts +38 -0
- package/blocks/CloudImageEditor/src/state.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/state.js +92 -0
- package/blocks/CloudImageEditor/src/svg-sprite.d.ts +3 -0
- package/blocks/CloudImageEditor/src/svg-sprite.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/svg-sprite.js +1 -0
- package/blocks/CloudImageEditor/src/template.d.ts +2 -0
- package/blocks/CloudImageEditor/src/template.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/template.js +36 -0
- package/blocks/CloudImageEditor/src/toolbar-constants.d.ts +58 -0
- package/blocks/CloudImageEditor/src/toolbar-constants.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/toolbar-constants.js +114 -0
- package/blocks/CloudImageEditor/src/types.d.ts +58 -0
- package/blocks/CloudImageEditor/src/types.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/types.js +61 -0
- package/blocks/CloudImageEditor/src/util.d.ts +2 -0
- package/blocks/CloudImageEditor/src/util.d.ts.map +1 -0
- package/blocks/CloudImageEditor/src/util.js +19 -0
- package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts +31 -0
- package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts.map +1 -0
- package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.js +113 -0
- package/blocks/CloudImageEditorActivity/index.css +13 -0
- package/blocks/CloudImageEditorActivity/test.d.ts +2 -0
- package/blocks/CloudImageEditorActivity/test.d.ts.map +1 -0
- package/blocks/CloudImageEditorActivity/test.js +9 -0
- package/blocks/Config/Config.d.ts +67 -0
- package/blocks/Config/Config.d.ts.map +1 -0
- package/blocks/Config/Config.js +246 -0
- package/blocks/Config/config.css +3 -0
- package/blocks/Config/initialConfig.d.ts +6 -0
- package/blocks/Config/initialConfig.d.ts.map +1 -0
- package/blocks/Config/initialConfig.js +69 -0
- package/blocks/Config/normalizeConfigValue.d.ts +3 -0
- package/blocks/Config/normalizeConfigValue.d.ts.map +1 -0
- package/blocks/Config/normalizeConfigValue.js +177 -0
- package/blocks/Copyright/Copyright.d.ts +4 -0
- package/blocks/Copyright/Copyright.d.ts.map +1 -0
- package/blocks/Copyright/Copyright.js +24 -0
- package/blocks/Copyright/copyright.css +31 -0
- package/blocks/DropArea/DropArea.d.ts +49 -0
- package/blocks/DropArea/DropArea.d.ts.map +1 -0
- package/blocks/DropArea/DropArea.js +273 -0
- package/blocks/DropArea/addDropzone.d.ts +21 -0
- package/blocks/DropArea/addDropzone.d.ts.map +1 -0
- package/blocks/DropArea/addDropzone.js +137 -0
- package/blocks/DropArea/drop-area.css +188 -0
- package/blocks/DropArea/getDropItems.d.ts +16 -0
- package/blocks/DropArea/getDropItems.d.ts.map +1 -0
- package/blocks/DropArea/getDropItems.js +167 -0
- package/blocks/ExternalSource/ExternalSource.d.ts +98 -0
- package/blocks/ExternalSource/ExternalSource.d.ts.map +1 -0
- package/blocks/ExternalSource/ExternalSource.js +268 -0
- package/blocks/ExternalSource/buildStyles.d.ts +27 -0
- package/blocks/ExternalSource/buildStyles.d.ts.map +1 -0
- package/blocks/ExternalSource/buildStyles.js +133 -0
- package/blocks/ExternalSource/external-source.css +65 -0
- package/blocks/ExternalSource/messages.d.ts +3 -0
- package/blocks/ExternalSource/messages.d.ts.map +1 -0
- package/blocks/ExternalSource/messages.js +35 -0
- package/blocks/ExternalSource/query-string.d.ts +8 -0
- package/blocks/ExternalSource/query-string.d.ts.map +1 -0
- package/blocks/ExternalSource/query-string.js +14 -0
- package/blocks/FileItem/FileItem.d.ts +97 -0
- package/blocks/FileItem/FileItem.d.ts.map +1 -0
- package/blocks/FileItem/FileItem.js +460 -0
- package/blocks/FileItem/file-item.css +140 -0
- package/blocks/FormInput/FormInput.d.ts +7 -0
- package/blocks/FormInput/FormInput.d.ts.map +1 -0
- package/blocks/FormInput/FormInput.js +92 -0
- package/blocks/Icon/Icon.d.ts +12 -0
- package/blocks/Icon/Icon.d.ts.map +1 -0
- package/blocks/Icon/Icon.js +44 -0
- package/blocks/Icon/icon.css +12 -0
- package/blocks/Img/Img.d.ts +4 -0
- package/blocks/Img/Img.d.ts.map +1 -0
- package/blocks/Img/Img.js +21 -0
- package/blocks/Img/ImgBase.d.ts +80 -0
- package/blocks/Img/ImgBase.d.ts.map +1 -0
- package/blocks/Img/ImgBase.js +408 -0
- package/blocks/Img/ImgConfig.d.ts +31 -0
- package/blocks/Img/ImgConfig.d.ts.map +1 -0
- package/blocks/Img/ImgConfig.js +102 -0
- package/blocks/Img/configurations.d.ts +12 -0
- package/blocks/Img/configurations.d.ts.map +1 -0
- package/blocks/Img/configurations.js +14 -0
- package/blocks/Img/props-map.d.ts +29 -0
- package/blocks/Img/props-map.d.ts.map +1 -0
- package/blocks/Img/props-map.js +34 -0
- package/blocks/Img/test.css +16 -0
- package/blocks/Img/utils/parseObjectToString.d.ts +2 -0
- package/blocks/Img/utils/parseObjectToString.d.ts.map +1 -0
- package/blocks/Img/utils/parseObjectToString.js +13 -0
- package/blocks/Modal/Modal.d.ts +24 -0
- package/blocks/Modal/Modal.d.ts.map +1 -0
- package/blocks/Modal/Modal.js +116 -0
- package/blocks/Modal/modal.css +92 -0
- package/blocks/ProgressBar/ProgressBar.d.ts +10 -0
- package/blocks/ProgressBar/ProgressBar.d.ts.map +1 -0
- package/blocks/ProgressBar/ProgressBar.js +38 -0
- package/blocks/ProgressBar/progress-bar.css +25 -0
- package/blocks/ProgressBarCommon/ProgressBarCommon.d.ts +8 -0
- package/blocks/ProgressBarCommon/ProgressBarCommon.d.ts.map +1 -0
- package/blocks/ProgressBarCommon/ProgressBarCommon.js +44 -0
- package/blocks/ProgressBarCommon/progress-bar-common.css +16 -0
- package/blocks/Range/Range.d.ts +16 -0
- package/blocks/Range/Range.d.ts.map +1 -0
- package/blocks/Range/Range.js +44 -0
- package/blocks/Range/range.css +65 -0
- package/blocks/Select/Select.d.ts +9 -0
- package/blocks/Select/Select.d.ts.map +1 -0
- package/blocks/Select/Select.js +35 -0
- package/blocks/Select/select.css +22 -0
- package/blocks/SimpleBtn/SimpleBtn.d.ts +26 -0
- package/blocks/SimpleBtn/SimpleBtn.d.ts.map +1 -0
- package/blocks/SimpleBtn/SimpleBtn.js +54 -0
- package/blocks/SimpleBtn/simple-btn.css +64 -0
- package/blocks/SourceBtn/SourceBtn.d.ts +58 -0
- package/blocks/SourceBtn/SourceBtn.d.ts.map +1 -0
- package/blocks/SourceBtn/SourceBtn.js +145 -0
- package/blocks/SourceBtn/source-btn.css +45 -0
- package/blocks/SourceList/SourceList.d.ts +4 -0
- package/blocks/SourceList/SourceList.d.ts.map +1 -0
- package/blocks/SourceList/SourceList.js +20 -0
- package/blocks/StartFrom/StartFrom.d.ts +7 -0
- package/blocks/StartFrom/StartFrom.d.ts.map +1 -0
- package/blocks/StartFrom/StartFrom.js +14 -0
- package/blocks/StartFrom/start-from.css +32 -0
- package/blocks/UploadCtxProvider/EventEmitter.d.ts +107 -0
- package/blocks/UploadCtxProvider/EventEmitter.d.ts.map +1 -0
- package/blocks/UploadCtxProvider/EventEmitter.js +132 -0
- package/blocks/UploadCtxProvider/UploadCtxProvider.d.ts +35 -0
- package/blocks/UploadCtxProvider/UploadCtxProvider.d.ts.map +1 -0
- package/blocks/UploadCtxProvider/UploadCtxProvider.js +45 -0
- package/blocks/UploadList/UploadList.d.ts +59 -0
- package/blocks/UploadList/UploadList.d.ts.map +1 -0
- package/blocks/UploadList/UploadList.js +237 -0
- package/blocks/UploadList/upload-list.css +74 -0
- package/blocks/UrlSource/UrlSource.d.ts +9 -0
- package/blocks/UrlSource/UrlSource.d.ts.map +1 -0
- package/blocks/UrlSource/UrlSource.js +61 -0
- package/blocks/UrlSource/url-source.css +24 -0
- package/blocks/svg-backgrounds/svg-backgrounds.d.ts +17 -0
- package/blocks/svg-backgrounds/svg-backgrounds.d.ts.map +1 -0
- package/blocks/svg-backgrounds/svg-backgrounds.js +45 -0
- package/blocks/themes/uc-basic/common.css +116 -0
- package/blocks/themes/uc-basic/config.css +4 -0
- package/blocks/themes/uc-basic/index.css +32 -0
- package/blocks/themes/uc-basic/svg-sprite.d.ts +3 -0
- package/blocks/themes/uc-basic/svg-sprite.d.ts.map +1 -0
- package/blocks/themes/uc-basic/svg-sprite.js +1 -0
- package/blocks/themes/uc-basic/theme.css +232 -0
- package/blocks/utils/UploadSource.d.ts +9 -0
- package/blocks/utils/UploadSource.d.ts.map +1 -0
- package/blocks/utils/UploadSource.js +8 -0
- package/blocks/utils/abilities.d.ts +2 -0
- package/blocks/utils/abilities.d.ts.map +1 -0
- package/blocks/utils/abilities.js +3 -0
- package/blocks/utils/comma-separated.d.ts +3 -0
- package/blocks/utils/comma-separated.d.ts.map +1 -0
- package/blocks/utils/comma-separated.js +19 -0
- package/blocks/utils/debounce.d.ts +10 -0
- package/blocks/utils/debounce.d.ts.map +1 -0
- package/blocks/utils/debounce.js +22 -0
- package/blocks/utils/resizeImage.d.ts +6 -0
- package/blocks/utils/resizeImage.d.ts.map +1 -0
- package/blocks/utils/resizeImage.js +40 -0
- package/blocks/utils/throttle.d.ts +4 -0
- package/blocks/utils/throttle.d.ts.map +1 -0
- package/blocks/utils/throttle.js +45 -0
- package/blocks/utils/userAgent.d.ts +6 -0
- package/blocks/utils/userAgent.d.ts.map +1 -0
- package/blocks/utils/userAgent.js +14 -0
- package/env.d.ts +4 -0
- package/env.d.ts.map +1 -0
- package/env.js +3 -0
- package/index.d.ts +39 -0
- package/index.d.ts.map +1 -0
- package/index.js +51 -0
- package/index.ssr.d.ts +961 -0
- package/index.ssr.d.ts.map +1 -0
- package/index.ssr.js +1461 -0
- package/locales/file-uploader/ar.d.ts +114 -0
- package/locales/file-uploader/ar.d.ts.map +1 -0
- package/locales/file-uploader/ar.js +113 -0
- package/locales/file-uploader/az.d.ts +106 -0
- package/locales/file-uploader/az.d.ts.map +1 -0
- package/locales/file-uploader/az.js +105 -0
- package/locales/file-uploader/ca.d.ts +108 -0
- package/locales/file-uploader/ca.d.ts.map +1 -0
- package/locales/file-uploader/ca.js +108 -0
- package/locales/file-uploader/cs.d.ts +110 -0
- package/locales/file-uploader/cs.d.ts.map +1 -0
- package/locales/file-uploader/cs.js +110 -0
- package/locales/file-uploader/da.d.ts +106 -0
- package/locales/file-uploader/da.d.ts.map +1 -0
- package/locales/file-uploader/da.js +106 -0
- package/locales/file-uploader/de.d.ts +106 -0
- package/locales/file-uploader/de.d.ts.map +1 -0
- package/locales/file-uploader/de.js +107 -0
- package/locales/file-uploader/el.d.ts +106 -0
- package/locales/file-uploader/el.d.ts.map +1 -0
- package/locales/file-uploader/el.js +107 -0
- package/locales/file-uploader/en.d.ts +106 -0
- package/locales/file-uploader/en.d.ts.map +1 -0
- package/locales/file-uploader/en.js +105 -0
- package/locales/file-uploader/es.d.ts +108 -0
- package/locales/file-uploader/es.d.ts.map +1 -0
- package/locales/file-uploader/es.js +108 -0
- package/locales/file-uploader/et.d.ts +106 -0
- package/locales/file-uploader/et.d.ts.map +1 -0
- package/locales/file-uploader/et.js +105 -0
- package/locales/file-uploader/fr.d.ts +108 -0
- package/locales/file-uploader/fr.d.ts.map +1 -0
- package/locales/file-uploader/fr.js +108 -0
- package/locales/file-uploader/he.d.ts +108 -0
- package/locales/file-uploader/he.d.ts.map +1 -0
- package/locales/file-uploader/he.js +107 -0
- package/locales/file-uploader/hy.d.ts +106 -0
- package/locales/file-uploader/hy.d.ts.map +1 -0
- package/locales/file-uploader/hy.js +105 -0
- package/locales/file-uploader/is.d.ts +106 -0
- package/locales/file-uploader/is.d.ts.map +1 -0
- package/locales/file-uploader/is.js +105 -0
- package/locales/file-uploader/it.d.ts +108 -0
- package/locales/file-uploader/it.d.ts.map +1 -0
- package/locales/file-uploader/it.js +108 -0
- package/locales/file-uploader/ja.d.ts +106 -0
- package/locales/file-uploader/ja.d.ts.map +1 -0
- package/locales/file-uploader/ja.js +105 -0
- package/locales/file-uploader/ka.d.ts +106 -0
- package/locales/file-uploader/ka.d.ts.map +1 -0
- package/locales/file-uploader/ka.js +105 -0
- package/locales/file-uploader/kk.d.ts +106 -0
- package/locales/file-uploader/kk.d.ts.map +1 -0
- package/locales/file-uploader/kk.js +105 -0
- package/locales/file-uploader/ko.d.ts +106 -0
- package/locales/file-uploader/ko.d.ts.map +1 -0
- package/locales/file-uploader/ko.js +104 -0
- package/locales/file-uploader/lv.d.ts +108 -0
- package/locales/file-uploader/lv.d.ts.map +1 -0
- package/locales/file-uploader/lv.js +107 -0
- package/locales/file-uploader/nb.d.ts +106 -0
- package/locales/file-uploader/nb.d.ts.map +1 -0
- package/locales/file-uploader/nb.js +105 -0
- package/locales/file-uploader/nl.d.ts +106 -0
- package/locales/file-uploader/nl.d.ts.map +1 -0
- package/locales/file-uploader/nl.js +106 -0
- package/locales/file-uploader/pl.d.ts +110 -0
- package/locales/file-uploader/pl.d.ts.map +1 -0
- package/locales/file-uploader/pl.js +109 -0
- package/locales/file-uploader/pt.d.ts +108 -0
- package/locales/file-uploader/pt.d.ts.map +1 -0
- package/locales/file-uploader/pt.js +108 -0
- package/locales/file-uploader/ro.d.ts +108 -0
- package/locales/file-uploader/ro.d.ts.map +1 -0
- package/locales/file-uploader/ro.js +108 -0
- package/locales/file-uploader/ru.d.ts +110 -0
- package/locales/file-uploader/ru.d.ts.map +1 -0
- package/locales/file-uploader/ru.js +109 -0
- package/locales/file-uploader/sk.d.ts +110 -0
- package/locales/file-uploader/sk.d.ts.map +1 -0
- package/locales/file-uploader/sk.js +109 -0
- package/locales/file-uploader/sr.d.ts +108 -0
- package/locales/file-uploader/sr.d.ts.map +1 -0
- package/locales/file-uploader/sr.js +107 -0
- package/locales/file-uploader/sv.d.ts +106 -0
- package/locales/file-uploader/sv.d.ts.map +1 -0
- package/locales/file-uploader/sv.js +105 -0
- package/locales/file-uploader/tr.d.ts +106 -0
- package/locales/file-uploader/tr.d.ts.map +1 -0
- package/locales/file-uploader/tr.js +105 -0
- package/locales/file-uploader/uk.d.ts +110 -0
- package/locales/file-uploader/uk.d.ts.map +1 -0
- package/locales/file-uploader/uk.js +109 -0
- package/locales/file-uploader/vi.d.ts +106 -0
- package/locales/file-uploader/vi.d.ts.map +1 -0
- package/locales/file-uploader/vi.js +105 -0
- package/locales/file-uploader/zh-TW.d.ts +106 -0
- package/locales/file-uploader/zh-TW.d.ts.map +1 -0
- package/locales/file-uploader/zh-TW.js +105 -0
- package/locales/file-uploader/zh.d.ts +106 -0
- package/locales/file-uploader/zh.d.ts.map +1 -0
- package/locales/file-uploader/zh.js +105 -0
- package/package.json +142 -0
- package/solutions/adaptive-image/index.d.ts +3 -0
- package/solutions/adaptive-image/index.d.ts.map +1 -0
- package/solutions/adaptive-image/index.js +5 -0
- package/solutions/cloud-image-editor/CloudImageEditor.d.ts +4 -0
- package/solutions/cloud-image-editor/CloudImageEditor.d.ts.map +1 -0
- package/solutions/cloud-image-editor/CloudImageEditor.js +12 -0
- package/solutions/cloud-image-editor/index.css +2 -0
- package/solutions/cloud-image-editor/index.d.ts +6 -0
- package/solutions/cloud-image-editor/index.d.ts.map +1 -0
- package/solutions/cloud-image-editor/index.js +11 -0
- package/solutions/file-uploader/inline/FileUploaderInline.d.ts +27 -0
- package/solutions/file-uploader/inline/FileUploaderInline.d.ts.map +1 -0
- package/solutions/file-uploader/inline/FileUploaderInline.js +75 -0
- package/solutions/file-uploader/inline/index.css +54 -0
- package/solutions/file-uploader/inline/index.d.ts +2 -0
- package/solutions/file-uploader/inline/index.d.ts.map +1 -0
- package/solutions/file-uploader/inline/index.js +1 -0
- package/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts +7 -0
- package/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts.map +1 -0
- package/solutions/file-uploader/minimal/FileUploaderMinimal.js +46 -0
- package/solutions/file-uploader/minimal/index.css +137 -0
- package/solutions/file-uploader/minimal/index.d.ts +14 -0
- package/solutions/file-uploader/minimal/index.d.ts.map +1 -0
- package/solutions/file-uploader/minimal/index.js +13 -0
- package/solutions/file-uploader/regular/FileUploaderRegular.d.ts +26 -0
- package/solutions/file-uploader/regular/FileUploaderRegular.d.ts.map +1 -0
- package/solutions/file-uploader/regular/FileUploaderRegular.js +66 -0
- package/solutions/file-uploader/regular/index.css +1 -0
- package/solutions/file-uploader/regular/index.d.ts +2 -0
- package/solutions/file-uploader/regular/index.d.ts.map +1 -0
- package/solutions/file-uploader/regular/index.js +1 -0
- package/types/events.d.ts +5 -0
- package/types/events.js +1 -0
- package/types/exported.d.ts +295 -0
- package/types/exported.js +1 -0
- package/types/global.d.ts +8 -0
- package/types/https.d.ts +1 -0
- package/types/index.d.ts +2 -0
- package/types/index.js +3 -0
- package/types/jsx.d.ts +63 -0
- package/types/jsx.js +1 -0
- package/utils/WindowHeightTracker.d.ts +24 -0
- package/utils/WindowHeightTracker.d.ts.map +1 -0
- package/utils/WindowHeightTracker.js +51 -0
- package/utils/cdn-utils.d.ts +59 -0
- package/utils/cdn-utils.d.ts.map +1 -0
- package/utils/cdn-utils.js +201 -0
- package/utils/cdn-utils.test.d.ts +2 -0
- package/utils/cdn-utils.test.d.ts.map +1 -0
- package/utils/cdn-utils.test.js +227 -0
- package/utils/delay.d.ts +2 -0
- package/utils/delay.d.ts.map +1 -0
- package/utils/delay.js +4 -0
- package/utils/fileTypes.d.ts +8 -0
- package/utils/fileTypes.d.ts.map +1 -0
- package/utils/fileTypes.js +95 -0
- package/utils/fileTypes.test.d.ts +2 -0
- package/utils/fileTypes.test.d.ts.map +1 -0
- package/utils/fileTypes.test.js +89 -0
- package/utils/getLocaleDirection.d.ts +2 -0
- package/utils/getLocaleDirection.d.ts.map +1 -0
- package/utils/getLocaleDirection.js +18 -0
- package/utils/getPluralForm.d.ts +3 -0
- package/utils/getPluralForm.d.ts.map +1 -0
- package/utils/getPluralForm.js +13 -0
- package/utils/getPluralForm.test.d.ts +2 -0
- package/utils/getPluralForm.test.d.ts.map +1 -0
- package/utils/getPluralForm.test.js +16 -0
- package/utils/ifRef.d.ts +7 -0
- package/utils/ifRef.d.ts.map +1 -0
- package/utils/ifRef.js +9 -0
- package/utils/isSecureTokenExpired.d.ts +4 -0
- package/utils/isSecureTokenExpired.d.ts.map +1 -0
- package/utils/isSecureTokenExpired.js +17 -0
- package/utils/isSecureTokenExpired.test.d.ts +2 -0
- package/utils/isSecureTokenExpired.test.d.ts.map +1 -0
- package/utils/isSecureTokenExpired.test.js +33 -0
- package/utils/memoize.d.ts +2 -0
- package/utils/memoize.d.ts.map +1 -0
- package/utils/memoize.js +23 -0
- package/utils/memoize.test.d.ts +2 -0
- package/utils/memoize.test.d.ts.map +1 -0
- package/utils/memoize.test.js +38 -0
- package/utils/mixinClass.d.ts +8 -0
- package/utils/mixinClass.d.ts.map +1 -0
- package/utils/mixinClass.js +18 -0
- package/utils/parseCdnUrl.d.ts +9 -0
- package/utils/parseCdnUrl.d.ts.map +1 -0
- package/utils/parseCdnUrl.js +20 -0
- package/utils/parseCdnUrl.test.d.ts +2 -0
- package/utils/parseCdnUrl.test.d.ts.map +1 -0
- package/utils/parseCdnUrl.test.js +78 -0
- package/utils/parseShrink.d.ts +5 -0
- package/utils/parseShrink.d.ts.map +1 -0
- package/utils/parseShrink.js +34 -0
- package/utils/parseShrink.test.d.ts +2 -0
- package/utils/parseShrink.test.d.ts.map +1 -0
- package/utils/parseShrink.test.js +26 -0
- package/utils/prettyBytes.d.ts +11 -0
- package/utils/prettyBytes.d.ts.map +1 -0
- package/utils/prettyBytes.js +64 -0
- package/utils/prettyBytes.test.d.ts +2 -0
- package/utils/prettyBytes.test.d.ts.map +1 -0
- package/utils/prettyBytes.test.js +99 -0
- package/utils/stringToArray.d.ts +2 -0
- package/utils/stringToArray.d.ts.map +1 -0
- package/utils/stringToArray.js +11 -0
- package/utils/stringToArray.test.d.ts +2 -0
- package/utils/stringToArray.test.d.ts.map +1 -0
- package/utils/stringToArray.test.js +20 -0
- package/utils/template-utils.d.ts +40 -0
- package/utils/template-utils.d.ts.map +1 -0
- package/utils/template-utils.js +50 -0
- package/utils/template-utils.test.d.ts +2 -0
- package/utils/template-utils.test.d.ts.map +1 -0
- package/utils/template-utils.test.js +56 -0
- package/utils/toKebabCase.d.ts +3 -0
- package/utils/toKebabCase.d.ts.map +1 -0
- package/utils/toKebabCase.js +15 -0
- package/utils/toKebabCase.test.d.ts +2 -0
- package/utils/toKebabCase.test.d.ts.map +1 -0
- package/utils/toKebabCase.test.js +11 -0
- package/utils/transparentPixelSrc.d.ts +2 -0
- package/utils/transparentPixelSrc.d.ts.map +1 -0
- package/utils/transparentPixelSrc.js +2 -0
- package/utils/uniqueArray.d.ts +2 -0
- package/utils/uniqueArray.d.ts.map +1 -0
- package/utils/uniqueArray.js +8 -0
- package/utils/uniqueArray.test.d.ts +2 -0
- package/utils/uniqueArray.test.d.ts.map +1 -0
- package/utils/uniqueArray.test.js +8 -0
- package/utils/validators/collection/index.d.ts +3 -0
- package/utils/validators/collection/index.d.ts.map +1 -0
- package/utils/validators/collection/index.js +2 -0
- package/utils/validators/collection/validateCollectionUploadError.d.ts +3 -0
- package/utils/validators/collection/validateCollectionUploadError.d.ts.map +1 -0
- package/utils/validators/collection/validateCollectionUploadError.js +11 -0
- package/utils/validators/collection/validateMultiple.d.ts +3 -0
- package/utils/validators/collection/validateMultiple.d.ts.map +1 -0
- package/utils/validators/collection/validateMultiple.js +43 -0
- package/utils/validators/file/index.d.ts +5 -0
- package/utils/validators/file/index.d.ts.map +1 -0
- package/utils/validators/file/index.js +4 -0
- package/utils/validators/file/validateFileType.d.ts +3 -0
- package/utils/validators/file/validateFileType.d.ts.map +1 -0
- package/utils/validators/file/validateFileType.js +30 -0
- package/utils/validators/file/validateIsImage.d.ts +3 -0
- package/utils/validators/file/validateIsImage.d.ts.map +1 -0
- package/utils/validators/file/validateIsImage.js +25 -0
- package/utils/validators/file/validateMaxSizeLimit.d.ts +3 -0
- package/utils/validators/file/validateMaxSizeLimit.d.ts.map +1 -0
- package/utils/validators/file/validateMaxSizeLimit.js +15 -0
- package/utils/validators/file/validateUploadError.d.ts +3 -0
- package/utils/validators/file/validateUploadError.d.ts.map +1 -0
- package/utils/validators/file/validateUploadError.js +48 -0
- package/utils/waitForAttribute.d.ts +8 -0
- package/utils/waitForAttribute.d.ts.map +1 -0
- package/utils/waitForAttribute.js +43 -0
- package/utils/waitForAttribute.test.d.ts +2 -0
- package/utils/waitForAttribute.test.d.ts.map +1 -0
- package/utils/waitForAttribute.test.js +78 -0
- package/utils/warnOnce.d.ts +3 -0
- package/utils/warnOnce.d.ts.map +1 -0
- package/utils/warnOnce.js +11 -0
- package/utils/wildcardRegexp.d.ts +2 -0
- package/utils/wildcardRegexp.d.ts.map +1 -0
- package/utils/wildcardRegexp.js +17 -0
- package/utils/wildcardRegexp.test.d.ts +2 -0
- package/utils/wildcardRegexp.test.d.ts.map +1 -0
- package/utils/wildcardRegexp.test.js +19 -0
- package/web/blocks.iife.min.js +29 -0
- package/web/blocks.min.js +29 -0
- package/web/lr-basic.min.css +1 -0
- package/web/lr-cloud-image-editor.min.css +1 -0
- package/web/lr-cloud-image-editor.min.js +29 -0
- package/web/lr-file-uploader-inline.min.css +1 -0
- package/web/lr-file-uploader-inline.min.js +29 -0
- package/web/lr-file-uploader-minimal.min.css +1 -0
- package/web/lr-file-uploader-minimal.min.js +28 -0
- package/web/lr-file-uploader-regular.min.css +1 -0
- package/web/lr-file-uploader-regular.min.js +29 -0
- package/web/lr-img.min.js +28 -0
- package/web/uc-basic.min.css +1 -0
- package/web/uc-cloud-image-editor.min.css +1 -0
- package/web/uc-cloud-image-editor.min.js +29 -0
- package/web/uc-file-uploader-inline.min.css +1 -0
- package/web/uc-file-uploader-inline.min.js +29 -0
- package/web/uc-file-uploader-minimal.min.css +1 -0
- package/web/uc-file-uploader-minimal.min.js +28 -0
- package/web/uc-file-uploader-regular.min.css +1 -0
- package/web/uc-file-uploader-regular.min.js +29 -0
- package/web/uc-img.min.js +28 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
export class UploaderBlock extends ActivityBlock {
|
|
2
|
+
/** @protected */
|
|
3
|
+
protected couldBeCtxOwner: boolean;
|
|
4
|
+
/** @private */
|
|
5
|
+
private isCtxOwner;
|
|
6
|
+
init$: {
|
|
7
|
+
'*commonProgress': number;
|
|
8
|
+
'*uploadList': never[];
|
|
9
|
+
'*focusedEntry': null;
|
|
10
|
+
'*uploadQueue': import("@uploadcare/upload-client").Queue;
|
|
11
|
+
'*collectionErrors': any[];
|
|
12
|
+
'*collectionState': import("../types").OutputCollectionState<import("../types").OutputCollectionStatus, "maybe-has-group"> | null;
|
|
13
|
+
'*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
|
|
14
|
+
'*uploadTrigger': Set<string>;
|
|
15
|
+
'*secureUploadsManager': SecureUploadsManager | null;
|
|
16
|
+
'*currentActivity': null;
|
|
17
|
+
'*currentActivityParams': {};
|
|
18
|
+
'*history': never[];
|
|
19
|
+
'*historyBack': null;
|
|
20
|
+
'*closeModal': () => void;
|
|
21
|
+
};
|
|
22
|
+
/** @private */
|
|
23
|
+
private get hasCtxOwner();
|
|
24
|
+
/**
|
|
25
|
+
* @returns {ValidationManager}
|
|
26
|
+
* @protected
|
|
27
|
+
*/
|
|
28
|
+
protected get validationManager(): ValidationManager;
|
|
29
|
+
/** @returns {UploaderPublicApi} */
|
|
30
|
+
get api(): UploaderPublicApi;
|
|
31
|
+
getAPI(): UploaderPublicApi;
|
|
32
|
+
/** @returns {TypedCollection} */
|
|
33
|
+
get uploadCollection(): TypedCollection;
|
|
34
|
+
/** @private */
|
|
35
|
+
private initCtxOwner;
|
|
36
|
+
/** @private */
|
|
37
|
+
private _unobserveCollection;
|
|
38
|
+
/** @private */
|
|
39
|
+
private _unobserveCollectionProperties;
|
|
40
|
+
/**
|
|
41
|
+
* @private
|
|
42
|
+
* @param {import('../types').OutputCollectionState} collectionState
|
|
43
|
+
*/
|
|
44
|
+
private _createGroup;
|
|
45
|
+
/** @private */
|
|
46
|
+
private _flushOutputItems;
|
|
47
|
+
/**
|
|
48
|
+
* @private
|
|
49
|
+
* @type {Parameters<import('./TypedCollection.js').TypedCollection['observeCollection']>[0]}
|
|
50
|
+
* @param {Set<import('./TypedData.js').TypedData>} removed
|
|
51
|
+
*/
|
|
52
|
+
private _handleCollectionUpdate;
|
|
53
|
+
/**
|
|
54
|
+
* @private
|
|
55
|
+
* @param {Record<keyof import('./uploadEntrySchema.js').UploadEntry, Set<string>>} changeMap
|
|
56
|
+
*/
|
|
57
|
+
private _handleCollectionPropertiesUpdate;
|
|
58
|
+
/** @private */
|
|
59
|
+
private _flushCommonUploadProgress;
|
|
60
|
+
/** @private */
|
|
61
|
+
private setInitialCrop;
|
|
62
|
+
/**
|
|
63
|
+
* @param {string} entryId
|
|
64
|
+
* @protected
|
|
65
|
+
*/
|
|
66
|
+
protected getMetadataFor(entryId: string): Promise<import("@uploadcare/upload-client").Metadata | undefined>;
|
|
67
|
+
/**
|
|
68
|
+
* @returns {Promise<import('@uploadcare/upload-client').FileFromOptions>}
|
|
69
|
+
* @protected
|
|
70
|
+
*/
|
|
71
|
+
protected getUploadClientOptions(): Promise<import('@uploadcare/upload-client').FileFromOptions>;
|
|
72
|
+
/** @returns {import('../types/exported.js').OutputFileEntry[]} */
|
|
73
|
+
getOutputData(): import('../types/exported.js').OutputFileEntry[];
|
|
74
|
+
}
|
|
75
|
+
export namespace UploaderBlock {
|
|
76
|
+
type extSrcList = string;
|
|
77
|
+
let extSrcList: Readonly<{
|
|
78
|
+
FACEBOOK: "facebook";
|
|
79
|
+
DROPBOX: "dropbox";
|
|
80
|
+
GDRIVE: "gdrive";
|
|
81
|
+
GPHOTOS: "gphotos";
|
|
82
|
+
INSTAGRAM: "instagram";
|
|
83
|
+
FLICKR: "flickr";
|
|
84
|
+
VK: "vk";
|
|
85
|
+
EVERNOTE: "evernote";
|
|
86
|
+
BOX: "box";
|
|
87
|
+
ONEDRIVE: "onedrive";
|
|
88
|
+
HUDDLE: "huddle";
|
|
89
|
+
}>;
|
|
90
|
+
type sourceTypes = string;
|
|
91
|
+
let sourceTypes: Readonly<{
|
|
92
|
+
FACEBOOK: "facebook";
|
|
93
|
+
DROPBOX: "dropbox";
|
|
94
|
+
GDRIVE: "gdrive";
|
|
95
|
+
GPHOTOS: "gphotos";
|
|
96
|
+
INSTAGRAM: "instagram";
|
|
97
|
+
FLICKR: "flickr";
|
|
98
|
+
VK: "vk";
|
|
99
|
+
EVERNOTE: "evernote";
|
|
100
|
+
BOX: "box";
|
|
101
|
+
ONEDRIVE: "onedrive";
|
|
102
|
+
HUDDLE: "huddle";
|
|
103
|
+
LOCAL: "local";
|
|
104
|
+
URL: "url";
|
|
105
|
+
CAMERA: "camera";
|
|
106
|
+
DRAW: "draw";
|
|
107
|
+
}>;
|
|
108
|
+
}
|
|
109
|
+
import { ActivityBlock } from './ActivityBlock.js';
|
|
110
|
+
import { SecureUploadsManager } from './SecureUploadsManager.js';
|
|
111
|
+
import { ValidationManager } from './ValidationManager.js';
|
|
112
|
+
import { UploaderPublicApi } from './UploaderPublicApi.js';
|
|
113
|
+
import { TypedCollection } from './TypedCollection.js';
|
|
114
|
+
//# sourceMappingURL=UploaderBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UploaderBlock.d.ts","sourceRoot":"","sources":["UploaderBlock.js"],"names":[],"mappings":"AAkBA;IACE,iBAAiB;IACjB,mCAAwB;IAExB,eAAe;IACf,mBAAmB;IAEnB;;;;;;;;;;;;;;;MAA+B;IAE/B,eAAe;IACf,0BAOC;IA2BD;;;OAGG;IACH,qDAKC;IAED,mCAAmC;IACnC,6BAKC;IAED,4BAEC;IAED,iCAAiC;IACjC,wCAKC;IAYD,eAAe;IACf,qBA0BC;IAvBC,eAAe;IACf,6BAAiG;IAEjG,eAAe;IACf,uCAEC;IAmBH;;;OAGG;IACH,qBAkBC;IAED,eAAe;IACf,0BAYQ;IAER;;;;OAIG;IACH,gCAiCE;IAEF;;;OAGG;IACH,0CAyFE;IAEF,eAAe;IACf,mCAoBE;IAEF,eAAe;IACf,uBAqCC;IAED;;;OAGG;IACH,kCAHW,MAAM,qEAWhB;IAED;;;OAGG;IACH,oCAHa,QAAQ,OAAO,2BAA2B,EAAE,eAAe,CAAC,CA2BxE;IAED,kEAAkE;IAClE,iBADc,OAAO,sBAAsB,EAAE,eAAe,EAAE,CAK7D;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAla6B,oBAAoB;qCAWb,2BAA2B;kCAG9B,wBAAwB;kCADxB,wBAAwB;gCAD1B,sBAAsB"}
|
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { ActivityBlock } from './ActivityBlock.js';
|
|
3
|
+
|
|
4
|
+
import { Data } from '@symbiotejs/symbiote';
|
|
5
|
+
import { uploadFileGroup } from '@uploadcare/upload-client';
|
|
6
|
+
import { calculateMaxCenteredCropFrame } from '../blocks/CloudImageEditor/src/crop-utils.js';
|
|
7
|
+
import { parseCropPreset } from '../blocks/CloudImageEditor/src/lib/parseCropPreset.js';
|
|
8
|
+
import { EventType } from '../blocks/UploadCtxProvider/EventEmitter.js';
|
|
9
|
+
import { debounce } from '../blocks/utils/debounce.js';
|
|
10
|
+
import { customUserAgent } from '../blocks/utils/userAgent.js';
|
|
11
|
+
import { createCdnUrl, createCdnUrlModifiers } from '../utils/cdn-utils.js';
|
|
12
|
+
import { uploaderBlockCtx } from './CTX.js';
|
|
13
|
+
import { SecureUploadsManager } from './SecureUploadsManager.js';
|
|
14
|
+
import { TypedCollection } from './TypedCollection.js';
|
|
15
|
+
import { UploaderPublicApi } from './UploaderPublicApi.js';
|
|
16
|
+
import { ValidationManager } from './ValidationManager.js';
|
|
17
|
+
import { uploadEntrySchema } from './uploadEntrySchema.js';
|
|
18
|
+
|
|
19
|
+
export class UploaderBlock extends ActivityBlock {
|
|
20
|
+
/** @protected */
|
|
21
|
+
couldBeCtxOwner = false;
|
|
22
|
+
|
|
23
|
+
/** @private */
|
|
24
|
+
isCtxOwner = false;
|
|
25
|
+
|
|
26
|
+
init$ = uploaderBlockCtx(this);
|
|
27
|
+
|
|
28
|
+
/** @private */
|
|
29
|
+
get hasCtxOwner() {
|
|
30
|
+
return this.hasBlockInCtx((block) => {
|
|
31
|
+
if (block instanceof UploaderBlock) {
|
|
32
|
+
return block.isCtxOwner && block.isConnected && block !== this;
|
|
33
|
+
}
|
|
34
|
+
return false;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** @protected */
|
|
39
|
+
initCallback() {
|
|
40
|
+
super.initCallback();
|
|
41
|
+
|
|
42
|
+
if (!this.has('*uploadCollection')) {
|
|
43
|
+
let uploadCollection = new TypedCollection({
|
|
44
|
+
typedSchema: uploadEntrySchema,
|
|
45
|
+
watchList: ['uploadProgress', 'uploadError', 'fileInfo', 'errors', 'cdnUrl', 'isUploading'],
|
|
46
|
+
});
|
|
47
|
+
this.add('*uploadCollection', uploadCollection);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (!this.has('*publicApi')) {
|
|
51
|
+
this.add('*publicApi', new UploaderPublicApi(this));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (!this.has('*validationManager')) {
|
|
55
|
+
this.add('*validationManager', new ValidationManager(this));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (!this.hasCtxOwner && this.couldBeCtxOwner) {
|
|
59
|
+
this.initCtxOwner();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @returns {ValidationManager}
|
|
65
|
+
* @protected
|
|
66
|
+
*/
|
|
67
|
+
get validationManager() {
|
|
68
|
+
if (!this.has('*validationManager')) {
|
|
69
|
+
throw new Error('Unexpected error: ValidationManager is not initialized');
|
|
70
|
+
}
|
|
71
|
+
return this.$['*validationManager'];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** @returns {UploaderPublicApi} */
|
|
75
|
+
get api() {
|
|
76
|
+
if (!this.has('*publicApi')) {
|
|
77
|
+
throw new Error('Unexpected error: UploaderPublicApi is not initialized');
|
|
78
|
+
}
|
|
79
|
+
return this.$['*publicApi'];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
getAPI() {
|
|
83
|
+
return this.api;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** @returns {TypedCollection} */
|
|
87
|
+
get uploadCollection() {
|
|
88
|
+
if (!this.has('*uploadCollection')) {
|
|
89
|
+
throw new Error('Unexpected error: TypedCollection is not initialized');
|
|
90
|
+
}
|
|
91
|
+
return this.$['*uploadCollection'];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** @protected */
|
|
95
|
+
destroyCtxCallback() {
|
|
96
|
+
this._unobserveCollectionProperties?.();
|
|
97
|
+
this._unobserveCollection?.();
|
|
98
|
+
this.uploadCollection.destroy();
|
|
99
|
+
this.$['*uploadCollection'] = null;
|
|
100
|
+
|
|
101
|
+
super.destroyCtxCallback();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** @private */
|
|
105
|
+
initCtxOwner() {
|
|
106
|
+
this.isCtxOwner = true;
|
|
107
|
+
|
|
108
|
+
/** @private */
|
|
109
|
+
this._unobserveCollection = this.uploadCollection.observeCollection(this._handleCollectionUpdate);
|
|
110
|
+
|
|
111
|
+
/** @private */
|
|
112
|
+
this._unobserveCollectionProperties = this.uploadCollection.observeProperties(
|
|
113
|
+
this._handleCollectionPropertiesUpdate,
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
this.subConfigValue('maxConcurrentRequests', (value) => {
|
|
117
|
+
this.$['*uploadQueue'].concurrency = Number(value) || 1;
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
if (!this.$['*secureUploadsManager']) {
|
|
121
|
+
this.$['*secureUploadsManager'] = new SecureUploadsManager(this);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (this.has('*modalActive')) {
|
|
125
|
+
this.sub('*modalActive', (modalActive) => {
|
|
126
|
+
if (modalActive && !this.$['*currentActivity']) {
|
|
127
|
+
this.$['*modalActive'] = false;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @private
|
|
135
|
+
* @param {import('../types').OutputCollectionState} collectionState
|
|
136
|
+
*/
|
|
137
|
+
async _createGroup(collectionState) {
|
|
138
|
+
const uploadClientOptions = await this.getUploadClientOptions();
|
|
139
|
+
const uuidList = collectionState.allEntries.map((entry) => {
|
|
140
|
+
return entry.uuid + (entry.cdnUrlModifiers ? `/${entry.cdnUrlModifiers}` : '');
|
|
141
|
+
});
|
|
142
|
+
const abortController = new AbortController();
|
|
143
|
+
const resp = await uploadFileGroup(uuidList, { ...uploadClientOptions, signal: abortController.signal });
|
|
144
|
+
if (this.$['*collectionState'] !== collectionState) {
|
|
145
|
+
abortController.abort();
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
this.$['*groupInfo'] = resp;
|
|
149
|
+
const collectionStateWithGroup = /** @type {import('../types').OutputCollectionState<'success', 'has-group'>} */ (
|
|
150
|
+
this.api.getOutputCollectionState()
|
|
151
|
+
);
|
|
152
|
+
this.emit(EventType.GROUP_CREATED, collectionStateWithGroup);
|
|
153
|
+
this.emit(EventType.CHANGE, () => this.api.getOutputCollectionState(), { debounce: true });
|
|
154
|
+
this.$['*collectionState'] = collectionStateWithGroup;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** @private */
|
|
158
|
+
_flushOutputItems = debounce(async () => {
|
|
159
|
+
const data = this.getOutputData();
|
|
160
|
+
if (data.length !== this.uploadCollection.size) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const collectionState = this.api.getOutputCollectionState();
|
|
164
|
+
this.$['*collectionState'] = collectionState;
|
|
165
|
+
this.emit(EventType.CHANGE, () => this.api.getOutputCollectionState(), { debounce: true });
|
|
166
|
+
|
|
167
|
+
if (this.cfg.groupOutput && collectionState.totalCount > 0 && collectionState.status === 'success') {
|
|
168
|
+
this._createGroup(collectionState);
|
|
169
|
+
}
|
|
170
|
+
}, 300);
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @private
|
|
174
|
+
* @type {Parameters<import('./TypedCollection.js').TypedCollection['observeCollection']>[0]}
|
|
175
|
+
* @param {Set<import('./TypedData.js').TypedData>} removed
|
|
176
|
+
*/
|
|
177
|
+
_handleCollectionUpdate = (entries, added, removed) => {
|
|
178
|
+
if (added.size || removed.size) {
|
|
179
|
+
this.$['*groupInfo'] = null;
|
|
180
|
+
}
|
|
181
|
+
this.validationManager.runFileValidators();
|
|
182
|
+
this.validationManager.runCollectionValidators();
|
|
183
|
+
|
|
184
|
+
for (const entry of added) {
|
|
185
|
+
if (!entry.getValue('silent')) {
|
|
186
|
+
this.emit(EventType.FILE_ADDED, this.api.getOutputItem(entry.uid));
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
for (const entry of removed) {
|
|
191
|
+
/** @type {Set<string>} */ (this.$['*uploadTrigger']).delete(entry.uid);
|
|
192
|
+
|
|
193
|
+
entry.getValue('abortController')?.abort();
|
|
194
|
+
entry.setMultipleValues({
|
|
195
|
+
isRemoved: true,
|
|
196
|
+
abortController: null,
|
|
197
|
+
isUploading: false,
|
|
198
|
+
uploadProgress: 0,
|
|
199
|
+
});
|
|
200
|
+
URL.revokeObjectURL(entry?.getValue('thumbUrl'));
|
|
201
|
+
this.emit(EventType.FILE_REMOVED, this.api.getOutputItem(entry.uid));
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
this.$['*uploadList'] = entries.map((uid) => {
|
|
205
|
+
return { uid };
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
this._flushCommonUploadProgress();
|
|
209
|
+
this._flushOutputItems();
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* @private
|
|
214
|
+
* @param {Record<keyof import('./uploadEntrySchema.js').UploadEntry, Set<string>>} changeMap
|
|
215
|
+
*/
|
|
216
|
+
_handleCollectionPropertiesUpdate = (changeMap) => {
|
|
217
|
+
this._flushOutputItems();
|
|
218
|
+
|
|
219
|
+
const uploadCollection = this.uploadCollection;
|
|
220
|
+
const entriesToRunValidation = [
|
|
221
|
+
...new Set(
|
|
222
|
+
Object.entries(changeMap)
|
|
223
|
+
.filter(([key]) => ['uploadError', 'fileInfo'].includes(key))
|
|
224
|
+
.map(([, ids]) => [...ids])
|
|
225
|
+
.flat(),
|
|
226
|
+
),
|
|
227
|
+
];
|
|
228
|
+
|
|
229
|
+
entriesToRunValidation.length > 0 &&
|
|
230
|
+
setTimeout(() => {
|
|
231
|
+
// We can't modify entry properties in the same tick, so we need to wait a bit
|
|
232
|
+
this.validationManager.runFileValidators(entriesToRunValidation);
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
if (changeMap.uploadProgress) {
|
|
236
|
+
for (const entryId of changeMap.uploadProgress) {
|
|
237
|
+
const { isUploading, silent } = Data.getCtx(entryId).store;
|
|
238
|
+
if (isUploading && !silent) {
|
|
239
|
+
this.emit(EventType.FILE_UPLOAD_PROGRESS, this.api.getOutputItem(entryId));
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
this._flushCommonUploadProgress();
|
|
244
|
+
}
|
|
245
|
+
if (changeMap.isUploading) {
|
|
246
|
+
for (const entryId of changeMap.isUploading) {
|
|
247
|
+
const { isUploading, silent } = Data.getCtx(entryId).store;
|
|
248
|
+
if (isUploading && !silent) {
|
|
249
|
+
this.emit(EventType.FILE_UPLOAD_START, this.api.getOutputItem(entryId));
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
if (changeMap.fileInfo) {
|
|
254
|
+
for (const entryId of changeMap.fileInfo) {
|
|
255
|
+
const { fileInfo, silent } = Data.getCtx(entryId).store;
|
|
256
|
+
if (fileInfo && !silent) {
|
|
257
|
+
this.emit(EventType.FILE_UPLOAD_SUCCESS, this.api.getOutputItem(entryId));
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
if (this.cfg.cropPreset) {
|
|
261
|
+
this.setInitialCrop();
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
if (changeMap.errors) {
|
|
265
|
+
for (const entryId of changeMap.errors) {
|
|
266
|
+
const { errors } = Data.getCtx(entryId).store;
|
|
267
|
+
if (errors.length > 0) {
|
|
268
|
+
this.emit(EventType.FILE_UPLOAD_FAILED, this.api.getOutputItem(entryId));
|
|
269
|
+
this.emit(
|
|
270
|
+
EventType.COMMON_UPLOAD_FAILED,
|
|
271
|
+
() =>
|
|
272
|
+
/** @type {import('../types').OutputCollectionState<'failed'>} */ (this.api.getOutputCollectionState()),
|
|
273
|
+
{ debounce: true },
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
const loadedItems = uploadCollection.findItems((entry) => {
|
|
278
|
+
return !!entry.getValue('fileInfo');
|
|
279
|
+
});
|
|
280
|
+
const errorItems = uploadCollection.findItems((entry) => {
|
|
281
|
+
return entry.getValue('errors').length > 0;
|
|
282
|
+
});
|
|
283
|
+
if (
|
|
284
|
+
uploadCollection.size > 0 &&
|
|
285
|
+
errorItems.length === 0 &&
|
|
286
|
+
uploadCollection.size === loadedItems.length &&
|
|
287
|
+
this.$['*collectionErrors'].length === 0
|
|
288
|
+
) {
|
|
289
|
+
this.emit(
|
|
290
|
+
EventType.COMMON_UPLOAD_SUCCESS,
|
|
291
|
+
/** @type {import('../types').OutputCollectionState<'success'>} */ (this.api.getOutputCollectionState()),
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
if (changeMap.cdnUrl) {
|
|
296
|
+
const uids = [...changeMap.cdnUrl].filter((uid) => {
|
|
297
|
+
return !!this.uploadCollection.read(uid)?.getValue('cdnUrl');
|
|
298
|
+
});
|
|
299
|
+
uids.forEach((uid) => {
|
|
300
|
+
this.emit(EventType.FILE_URL_CHANGED, this.api.getOutputItem(uid));
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
this.$['*groupInfo'] = null;
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
/** @private */
|
|
308
|
+
_flushCommonUploadProgress = () => {
|
|
309
|
+
let commonProgress = 0;
|
|
310
|
+
/** @type {Set<string>} */
|
|
311
|
+
const uploadTrigger = this.$['*uploadTrigger'];
|
|
312
|
+
const items = [...uploadTrigger].filter((id) => !!this.uploadCollection.read(id));
|
|
313
|
+
items.forEach((id) => {
|
|
314
|
+
const uploadProgress = this.uploadCollection.readProp(id, 'uploadProgress');
|
|
315
|
+
commonProgress += uploadProgress;
|
|
316
|
+
});
|
|
317
|
+
const progress = items.length ? Math.round(commonProgress / items.length) : 0;
|
|
318
|
+
|
|
319
|
+
if (this.$['*commonProgress'] === progress) {
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
this.$['*commonProgress'] = progress;
|
|
324
|
+
this.emit(
|
|
325
|
+
EventType.COMMON_UPLOAD_PROGRESS,
|
|
326
|
+
/** @type {import('../types').OutputCollectionState<'uploading'>} */ (this.api.getOutputCollectionState()),
|
|
327
|
+
);
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
/** @private */
|
|
331
|
+
setInitialCrop() {
|
|
332
|
+
const cropPreset = parseCropPreset(this.cfg.cropPreset);
|
|
333
|
+
if (cropPreset) {
|
|
334
|
+
const [aspectRatioPreset] = cropPreset;
|
|
335
|
+
|
|
336
|
+
const entries = this.uploadCollection
|
|
337
|
+
.findItems(
|
|
338
|
+
(entry) =>
|
|
339
|
+
entry.getValue('fileInfo') &&
|
|
340
|
+
entry.getValue('isImage') &&
|
|
341
|
+
!entry.getValue('cdnUrlModifiers')?.includes('/crop/'),
|
|
342
|
+
)
|
|
343
|
+
.map((id) => this.uploadCollection.read(id));
|
|
344
|
+
|
|
345
|
+
for (const entry of entries) {
|
|
346
|
+
const fileInfo = entry.getValue('fileInfo');
|
|
347
|
+
const { width, height } = fileInfo.imageInfo;
|
|
348
|
+
const expectedAspectRatio = aspectRatioPreset.width / aspectRatioPreset.height;
|
|
349
|
+
const crop = calculateMaxCenteredCropFrame(width, height, expectedAspectRatio);
|
|
350
|
+
const cdnUrlModifiers = createCdnUrlModifiers(
|
|
351
|
+
`crop/${crop.width}x${crop.height}/${crop.x},${crop.y}`,
|
|
352
|
+
'preview',
|
|
353
|
+
);
|
|
354
|
+
entry.setMultipleValues({
|
|
355
|
+
cdnUrlModifiers,
|
|
356
|
+
cdnUrl: createCdnUrl(entry.getValue('cdnUrl'), cdnUrlModifiers),
|
|
357
|
+
});
|
|
358
|
+
if (
|
|
359
|
+
this.uploadCollection.size === 1 &&
|
|
360
|
+
this.cfg.useCloudImageEditor &&
|
|
361
|
+
this.hasBlockInCtx((block) => block.activityType === ActivityBlock.activities.CLOUD_IMG_EDIT)
|
|
362
|
+
) {
|
|
363
|
+
this.$['*focusedEntry'] = entry;
|
|
364
|
+
this.$['*currentActivity'] = ActivityBlock.activities.CLOUD_IMG_EDIT;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* @param {string} entryId
|
|
372
|
+
* @protected
|
|
373
|
+
*/
|
|
374
|
+
async getMetadataFor(entryId) {
|
|
375
|
+
const configValue = this.cfg.metadata || undefined;
|
|
376
|
+
if (typeof configValue === 'function') {
|
|
377
|
+
const outputFileEntry = this.api.getOutputItem(entryId);
|
|
378
|
+
const metadata = await configValue(outputFileEntry);
|
|
379
|
+
return metadata;
|
|
380
|
+
}
|
|
381
|
+
return configValue;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* @returns {Promise<import('@uploadcare/upload-client').FileFromOptions>}
|
|
386
|
+
* @protected
|
|
387
|
+
*/
|
|
388
|
+
async getUploadClientOptions() {
|
|
389
|
+
/** @type {SecureUploadsManager} */
|
|
390
|
+
const secureUploadsManager = this.$['*secureUploadsManager'];
|
|
391
|
+
const secureToken = await secureUploadsManager.getSecureToken().catch(() => null);
|
|
392
|
+
|
|
393
|
+
let options = {
|
|
394
|
+
store: this.cfg.store,
|
|
395
|
+
publicKey: this.cfg.pubkey,
|
|
396
|
+
baseCDN: this.cfg.cdnCname,
|
|
397
|
+
baseURL: this.cfg.baseUrl,
|
|
398
|
+
userAgent: customUserAgent,
|
|
399
|
+
integration: this.cfg.userAgentIntegration,
|
|
400
|
+
secureSignature: secureToken?.secureSignature,
|
|
401
|
+
secureExpire: secureToken?.secureExpire,
|
|
402
|
+
retryThrottledRequestMaxTimes: this.cfg.retryThrottledRequestMaxTimes,
|
|
403
|
+
multipartMinFileSize: this.cfg.multipartMinFileSize,
|
|
404
|
+
multipartChunkSize: this.cfg.multipartChunkSize,
|
|
405
|
+
maxConcurrentRequests: this.cfg.multipartMaxConcurrentRequests,
|
|
406
|
+
multipartMaxAttempts: this.cfg.multipartMaxAttempts,
|
|
407
|
+
checkForUrlDuplicates: !!this.cfg.checkForUrlDuplicates,
|
|
408
|
+
saveUrlForRecurrentUploads: !!this.cfg.saveUrlForRecurrentUploads,
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
return options;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/** @returns {import('../types/exported.js').OutputFileEntry[]} */
|
|
415
|
+
getOutputData() {
|
|
416
|
+
const entriesIds = this.uploadCollection.items();
|
|
417
|
+
const data = entriesIds.map((itemId) => this.api.getOutputItem(itemId));
|
|
418
|
+
return data;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/** @enum {String} */
|
|
423
|
+
UploaderBlock.extSrcList = Object.freeze({
|
|
424
|
+
FACEBOOK: 'facebook',
|
|
425
|
+
DROPBOX: 'dropbox',
|
|
426
|
+
GDRIVE: 'gdrive',
|
|
427
|
+
GPHOTOS: 'gphotos',
|
|
428
|
+
INSTAGRAM: 'instagram',
|
|
429
|
+
FLICKR: 'flickr',
|
|
430
|
+
VK: 'vk',
|
|
431
|
+
EVERNOTE: 'evernote',
|
|
432
|
+
BOX: 'box',
|
|
433
|
+
ONEDRIVE: 'onedrive',
|
|
434
|
+
HUDDLE: 'huddle',
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
/** @enum {String} */
|
|
438
|
+
UploaderBlock.sourceTypes = Object.freeze({
|
|
439
|
+
LOCAL: 'local',
|
|
440
|
+
URL: 'url',
|
|
441
|
+
CAMERA: 'camera',
|
|
442
|
+
DRAW: 'draw',
|
|
443
|
+
...UploaderBlock.extSrcList,
|
|
444
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export class UploaderPublicApi {
|
|
2
|
+
/** @param {import('./UploaderBlock.js').UploaderBlock} ctx */
|
|
3
|
+
constructor(ctx: import('./UploaderBlock.js').UploaderBlock);
|
|
4
|
+
/**
|
|
5
|
+
* @private
|
|
6
|
+
* @type {import('./UploaderBlock.js').UploaderBlock}
|
|
7
|
+
*/
|
|
8
|
+
private _ctx;
|
|
9
|
+
/** @private */
|
|
10
|
+
private get _uploadCollection();
|
|
11
|
+
get cfg(): import("../types").ConfigType;
|
|
12
|
+
get l10n(): (str: string, variables?: {
|
|
13
|
+
[key: string]: string | number;
|
|
14
|
+
}) => string;
|
|
15
|
+
/**
|
|
16
|
+
* TODO: Probably we should not allow user to override `source` property
|
|
17
|
+
*
|
|
18
|
+
* @param {string} url
|
|
19
|
+
* @param {{ silent?: boolean; fileName?: string; source?: string }} [options]
|
|
20
|
+
* @returns {import('../types').OutputFileEntry<'idle'>}
|
|
21
|
+
*/
|
|
22
|
+
addFileFromUrl: (url: string, { silent, fileName, source }?: {
|
|
23
|
+
silent?: boolean | undefined;
|
|
24
|
+
fileName?: string | undefined;
|
|
25
|
+
source?: string | undefined;
|
|
26
|
+
} | undefined) => import('../types').OutputFileEntry<'idle'>;
|
|
27
|
+
/**
|
|
28
|
+
* @param {string} uuid
|
|
29
|
+
* @param {{ silent?: boolean; fileName?: string; source?: string }} [options]
|
|
30
|
+
* @returns {import('../types').OutputFileEntry<'idle'>}
|
|
31
|
+
*/
|
|
32
|
+
addFileFromUuid: (uuid: string, { silent, fileName, source }?: {
|
|
33
|
+
silent?: boolean | undefined;
|
|
34
|
+
fileName?: string | undefined;
|
|
35
|
+
source?: string | undefined;
|
|
36
|
+
} | undefined) => import('../types').OutputFileEntry<'idle'>;
|
|
37
|
+
/**
|
|
38
|
+
* @param {string} cdnUrl
|
|
39
|
+
* @param {{ silent?: boolean; fileName?: string; source?: string }} [options]
|
|
40
|
+
* @returns {import('../types').OutputFileEntry<'idle'>}
|
|
41
|
+
*/
|
|
42
|
+
addFileFromCdnUrl: (cdnUrl: string, { silent, fileName, source }?: {
|
|
43
|
+
silent?: boolean | undefined;
|
|
44
|
+
fileName?: string | undefined;
|
|
45
|
+
source?: string | undefined;
|
|
46
|
+
} | undefined) => import('../types').OutputFileEntry<'idle'>;
|
|
47
|
+
/**
|
|
48
|
+
* @param {File} file
|
|
49
|
+
* @param {{ silent?: boolean; fileName?: string; source?: string; fullPath?: string }} [options]
|
|
50
|
+
* @returns {import('../types').OutputFileEntry<'idle'>}
|
|
51
|
+
*/
|
|
52
|
+
addFileFromObject: (file: File, { silent, fileName, source, fullPath }?: {
|
|
53
|
+
silent?: boolean | undefined;
|
|
54
|
+
fileName?: string | undefined;
|
|
55
|
+
source?: string | undefined;
|
|
56
|
+
fullPath?: string | undefined;
|
|
57
|
+
} | undefined) => import('../types').OutputFileEntry<'idle'>;
|
|
58
|
+
/** @param {string} internalId */
|
|
59
|
+
removeFileByInternalId: (internalId: string) => void;
|
|
60
|
+
removeAllFiles(): void;
|
|
61
|
+
uploadAll: () => void;
|
|
62
|
+
/** @param {{ captureCamera?: boolean }} options */
|
|
63
|
+
openSystemDialog: (options?: {
|
|
64
|
+
captureCamera?: boolean;
|
|
65
|
+
}) => void;
|
|
66
|
+
/**
|
|
67
|
+
* @template {import('../types').OutputFileStatus} TStatus
|
|
68
|
+
* @param {string} entryId
|
|
69
|
+
* @returns {import('../types/exported.js').OutputFileEntry<TStatus>}
|
|
70
|
+
*/
|
|
71
|
+
getOutputItem: <TStatus extends import("../types").OutputFileStatus>(entryId: string) => import("../types").OutputFileEntry<TStatus>;
|
|
72
|
+
/** @template {import('../types').OutputCollectionStatus} TStatus */
|
|
73
|
+
getOutputCollectionState: <TStatus_1 extends import("../types").OutputCollectionStatus>() => import("../types").OutputCollectionState<TStatus_1, "maybe-has-group">;
|
|
74
|
+
/** @param {Boolean} [force] */
|
|
75
|
+
initFlow: (force?: boolean | undefined) => void;
|
|
76
|
+
doneFlow: () => void;
|
|
77
|
+
/**
|
|
78
|
+
* @param {import('./ActivityBlock.js').ActivityType} activityType
|
|
79
|
+
* @param {import('../blocks/ExternalSource/ExternalSource.js').ActivityParams | {}} [params]
|
|
80
|
+
*/
|
|
81
|
+
setCurrentActivity: (activityType: import('./ActivityBlock.js').ActivityType, params?: {} | import("../blocks/ExternalSource/ExternalSource.js").ActivityParams | undefined) => void;
|
|
82
|
+
/** @param {boolean} opened */
|
|
83
|
+
setModalState: (opened: boolean) => void;
|
|
84
|
+
/**
|
|
85
|
+
* @private
|
|
86
|
+
* @type {string[]}
|
|
87
|
+
*/
|
|
88
|
+
private get _sourceList();
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=UploaderPublicApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UploaderPublicApi.d.ts","sourceRoot":"","sources":["UploaderPublicApi.js"],"names":[],"mappings":"AAYA;IAOE,8DAA8D;IAC9D,iBADY,OAAO,oBAAoB,EAAE,aAAa,EAGrD;IATD;;;OAGG;IACH,aAAK;IAOL,eAAe;IACf,gCAEC;IAED,yCAEC;IAED;;iBAEC;IAED;;;;;;OAMG;IACH,sBAJW,MAAM;;;;sBAEJ,OAAO,UAAU,EAAE,eAAe,CAAC,MAAM,CAAC,CAUrD;IAEF;;;;OAIG;IACH,wBAJW,MAAM;;;;sBAEJ,OAAO,UAAU,EAAE,eAAe,CAAC,MAAM,CAAC,CAUrD;IAEF;;;;OAIG;IACH,4BAJW,MAAM;;;;sBAEJ,OAAO,UAAU,EAAE,eAAe,CAAC,MAAM,CAAC,CAgBrD;IAEF;;;;OAIG;IACH,0BAJW,IAAI;;;;;sBAEF,OAAO,UAAU,EAAE,eAAe,CAAC,MAAM,CAAC,CAcrD;IAEF,iCAAiC;IACjC,qCADY,MAAM,UAMhB;IAEF,uBAEC;IAED,sBAeE;IAEF,mDAAmD;IACnD,6BADY;QAAE,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,UAgCrC;IAEF;;;;OAIG;IACH,8EAHW,MAAM,iDA6Cf;IAEF,oEAAoE;IACpE,oKAIE;IAEF,+BAA+B;IAC/B,gDAsCE;IAEF,qBAQE;IAEF;;;OAGG;IACH,mCAHW,OAAO,oBAAoB,EAAE,YAAY,yGAYlD;IAEF,8BAA8B;IAC9B,wBADY,OAAO,UAOjB;IAEF;;;OAGG;IACH,0BAOC;CACF"}
|