@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,551 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
import { Block } from '../../../abstract/Block.js';
|
|
4
|
+
import { debounce } from '../../utils/debounce.js';
|
|
5
|
+
import { throttle } from '../../utils/throttle.js';
|
|
6
|
+
import {
|
|
7
|
+
clamp,
|
|
8
|
+
constraintRect,
|
|
9
|
+
isRectInsideRect,
|
|
10
|
+
isRectMatchesAspectRatio,
|
|
11
|
+
rotateSize,
|
|
12
|
+
roundRect,
|
|
13
|
+
} from './crop-utils.js';
|
|
14
|
+
import { CROP_PADDING } from './cropper-constants.js';
|
|
15
|
+
import { classNames } from './lib/classNames.js';
|
|
16
|
+
import { pick } from './lib/pick.js';
|
|
17
|
+
import { preloadImage } from './lib/preloadImage.js';
|
|
18
|
+
import { viewerImageSrc } from './util.js';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @typedef {Object} Operations
|
|
22
|
+
* @property {boolean} flip
|
|
23
|
+
* @property {boolean} mirror
|
|
24
|
+
* @property {Number} rotate
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @param {import('./types.js').Transformations['crop']} crop
|
|
29
|
+
* @returns {boolean}
|
|
30
|
+
*/
|
|
31
|
+
function validateCrop(crop) {
|
|
32
|
+
if (!crop) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
/** @type {((arg: NonNullable<typeof crop>) => boolean)[]} */
|
|
36
|
+
let shouldMatch = [
|
|
37
|
+
({ dimensions, coords }) =>
|
|
38
|
+
[...dimensions, ...coords].every((number) => Number.isInteger(number) && Number.isFinite(number)),
|
|
39
|
+
({ dimensions, coords }) => dimensions.every((d) => d > 0) && coords.every((c) => c >= 0),
|
|
40
|
+
];
|
|
41
|
+
return shouldMatch.every((matcher) => matcher(crop));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export class EditorImageCropper extends Block {
|
|
45
|
+
ctxOwner = true;
|
|
46
|
+
constructor() {
|
|
47
|
+
super();
|
|
48
|
+
|
|
49
|
+
this.init$ = {
|
|
50
|
+
...this.init$,
|
|
51
|
+
image: null,
|
|
52
|
+
'*padding': CROP_PADDING,
|
|
53
|
+
/** @type {Operations} */
|
|
54
|
+
'*operations': {
|
|
55
|
+
rotate: 0,
|
|
56
|
+
mirror: false,
|
|
57
|
+
flip: false,
|
|
58
|
+
},
|
|
59
|
+
/** @type {import('./types.js').Rectangle} */
|
|
60
|
+
'*imageBox': {
|
|
61
|
+
x: 0,
|
|
62
|
+
y: 0,
|
|
63
|
+
width: 0,
|
|
64
|
+
height: 0,
|
|
65
|
+
},
|
|
66
|
+
/** @type {import('./types.js').Rectangle} */
|
|
67
|
+
'*cropBox': {
|
|
68
|
+
x: 0,
|
|
69
|
+
y: 0,
|
|
70
|
+
width: 0,
|
|
71
|
+
height: 0,
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/** @private */
|
|
76
|
+
this._commitDebounced = debounce(this._commit.bind(this), 300);
|
|
77
|
+
|
|
78
|
+
/** @private */
|
|
79
|
+
this._handleResizeThrottled = throttle(this._handleResize.bind(this), 100);
|
|
80
|
+
|
|
81
|
+
this._imageSize = { width: 0, height: 0 };
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** @private */
|
|
85
|
+
_handleResize() {
|
|
86
|
+
if (!this.isConnected || !this._isActive) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
this._initCanvas();
|
|
90
|
+
this._syncTransformations();
|
|
91
|
+
this._alignImage();
|
|
92
|
+
this._alignCrop();
|
|
93
|
+
this._draw();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** @private */
|
|
97
|
+
_syncTransformations() {
|
|
98
|
+
let transformations = this.$['*editorTransformations'];
|
|
99
|
+
let pickedTransformations = pick(transformations, Object.keys(this.$['*operations']));
|
|
100
|
+
let operations = { ...this.$['*operations'], ...pickedTransformations };
|
|
101
|
+
this.$['*operations'] = operations;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** @private */
|
|
105
|
+
_initCanvas() {
|
|
106
|
+
/** @type {HTMLCanvasElement} */
|
|
107
|
+
let canvas = this.ref['canvas-el'];
|
|
108
|
+
let ctx = canvas.getContext('2d');
|
|
109
|
+
|
|
110
|
+
let width = this.offsetWidth;
|
|
111
|
+
let height = this.offsetHeight;
|
|
112
|
+
let dpr = window.devicePixelRatio;
|
|
113
|
+
canvas.style.width = `${width}px`;
|
|
114
|
+
canvas.style.height = `${height}px`;
|
|
115
|
+
canvas.width = width * dpr;
|
|
116
|
+
canvas.height = height * dpr;
|
|
117
|
+
ctx?.scale(dpr, dpr);
|
|
118
|
+
|
|
119
|
+
this._canvas = canvas;
|
|
120
|
+
this._ctx = ctx;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** @private */
|
|
124
|
+
_alignImage() {
|
|
125
|
+
if (!this._isActive || !this.$.image) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
let image = this.$.image;
|
|
130
|
+
let padding = this.$['*padding'];
|
|
131
|
+
let operations = this.$['*operations'];
|
|
132
|
+
let { rotate } = operations;
|
|
133
|
+
|
|
134
|
+
let bounds = { width: this.offsetWidth, height: this.offsetHeight };
|
|
135
|
+
let naturalSize = rotateSize({ width: image.naturalWidth, height: image.naturalHeight }, rotate);
|
|
136
|
+
let imageBox;
|
|
137
|
+
|
|
138
|
+
if (naturalSize.width > bounds.width - padding * 2 || naturalSize.height > bounds.height - padding * 2) {
|
|
139
|
+
let imageAspectRatio = naturalSize.width / naturalSize.height;
|
|
140
|
+
let viewportAspectRatio = bounds.width / bounds.height;
|
|
141
|
+
|
|
142
|
+
if (imageAspectRatio > viewportAspectRatio) {
|
|
143
|
+
let width = bounds.width - padding * 2;
|
|
144
|
+
let height = width / imageAspectRatio;
|
|
145
|
+
let x = 0 + padding;
|
|
146
|
+
let y = padding + (bounds.height - padding * 2) / 2 - height / 2;
|
|
147
|
+
imageBox = { x, y, width, height };
|
|
148
|
+
} else {
|
|
149
|
+
let height = bounds.height - padding * 2;
|
|
150
|
+
let width = height * imageAspectRatio;
|
|
151
|
+
let x = padding + (bounds.width - padding * 2) / 2 - width / 2;
|
|
152
|
+
let y = 0 + padding;
|
|
153
|
+
imageBox = { x, y, width, height };
|
|
154
|
+
}
|
|
155
|
+
} else {
|
|
156
|
+
let { width, height } = naturalSize;
|
|
157
|
+
let x = padding + (bounds.width - padding * 2) / 2 - width / 2;
|
|
158
|
+
let y = padding + (bounds.height - padding * 2) / 2 - height / 2;
|
|
159
|
+
imageBox = { x, y, width, height };
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
this.$['*imageBox'] = roundRect(imageBox);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/** @private */
|
|
166
|
+
_alignCrop() {
|
|
167
|
+
let cropBox = this.$['*cropBox'];
|
|
168
|
+
let imageBox = this.$['*imageBox'];
|
|
169
|
+
let operations = this.$['*operations'];
|
|
170
|
+
let { rotate } = operations;
|
|
171
|
+
let cropTransformation = this.$['*editorTransformations']['crop'];
|
|
172
|
+
let { width: previewWidth, x: previewX, y: previewY } = this.$['*imageBox'];
|
|
173
|
+
|
|
174
|
+
if (cropTransformation) {
|
|
175
|
+
let {
|
|
176
|
+
dimensions: [width, height],
|
|
177
|
+
coords: [x, y],
|
|
178
|
+
} = cropTransformation;
|
|
179
|
+
let { width: sourceWidth } = rotateSize(this._imageSize, rotate);
|
|
180
|
+
let ratio = previewWidth / sourceWidth;
|
|
181
|
+
cropBox = constraintRect(
|
|
182
|
+
roundRect({
|
|
183
|
+
x: previewX + x * ratio,
|
|
184
|
+
y: previewY + y * ratio,
|
|
185
|
+
width: width * ratio,
|
|
186
|
+
height: height * ratio,
|
|
187
|
+
}),
|
|
188
|
+
this.$['*imageBox'],
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/** @type {import('./types.js').CropPresetList[0] | undefined} */
|
|
193
|
+
const cropPreset = this.$['*cropPresetList']?.[0];
|
|
194
|
+
const cropAspectRatio = cropPreset ? cropPreset.width / cropPreset.height : undefined;
|
|
195
|
+
|
|
196
|
+
if (
|
|
197
|
+
!isRectInsideRect(cropBox, imageBox) ||
|
|
198
|
+
(cropAspectRatio && !isRectMatchesAspectRatio(cropBox, cropAspectRatio))
|
|
199
|
+
) {
|
|
200
|
+
const imageAspectRatio = imageBox.width / imageBox.height;
|
|
201
|
+
let width = imageBox.width;
|
|
202
|
+
let height = imageBox.height;
|
|
203
|
+
if (cropAspectRatio) {
|
|
204
|
+
if (imageAspectRatio > cropAspectRatio) {
|
|
205
|
+
width = Math.min(imageBox.height * cropAspectRatio, imageBox.width);
|
|
206
|
+
} else {
|
|
207
|
+
height = Math.min(imageBox.width / cropAspectRatio, imageBox.height);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
cropBox = {
|
|
211
|
+
x: imageBox.x + imageBox.width / 2 - width / 2,
|
|
212
|
+
y: imageBox.y + imageBox.height / 2 - height / 2,
|
|
213
|
+
width,
|
|
214
|
+
height,
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
this.$['*cropBox'] = constraintRect(roundRect(cropBox), this.$['*imageBox']);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** @private */
|
|
222
|
+
_drawImage() {
|
|
223
|
+
let ctx = this._ctx;
|
|
224
|
+
if (!ctx) return;
|
|
225
|
+
let image = this.$.image;
|
|
226
|
+
let imageBox = this.$['*imageBox'];
|
|
227
|
+
let operations = this.$['*operations'];
|
|
228
|
+
let { mirror, flip, rotate } = operations;
|
|
229
|
+
let rotated = rotateSize({ width: imageBox.width, height: imageBox.height }, rotate);
|
|
230
|
+
ctx.save();
|
|
231
|
+
ctx.translate(imageBox.x + imageBox.width / 2, imageBox.y + imageBox.height / 2);
|
|
232
|
+
ctx.rotate((rotate * Math.PI * -1) / 180);
|
|
233
|
+
ctx.scale(mirror ? -1 : 1, flip ? -1 : 1);
|
|
234
|
+
ctx.drawImage(image, -rotated.width / 2, -rotated.height / 2, rotated.width, rotated.height);
|
|
235
|
+
ctx.restore();
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/** @private */
|
|
239
|
+
_draw() {
|
|
240
|
+
if (!this._isActive || !this.$.image || !this._canvas || !this._ctx) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
let canvas = this._canvas;
|
|
244
|
+
let ctx = this._ctx;
|
|
245
|
+
|
|
246
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
247
|
+
|
|
248
|
+
this._drawImage();
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* @private
|
|
253
|
+
* @param {{ fromViewer?: boolean }} options
|
|
254
|
+
*/
|
|
255
|
+
_animateIn({ fromViewer }) {
|
|
256
|
+
if (this.$.image) {
|
|
257
|
+
this.ref['frame-el'].toggleThumbs(true);
|
|
258
|
+
this._transitionToImage();
|
|
259
|
+
setTimeout(() => {
|
|
260
|
+
this.className = classNames({
|
|
261
|
+
'uc-active_from_viewer': fromViewer,
|
|
262
|
+
'uc-active_from_editor': !fromViewer,
|
|
263
|
+
'uc-inactive_to_editor': false,
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* @private
|
|
271
|
+
* @returns {NonNullable<import('./types.js').Transformations['crop']>['dimensions']}
|
|
272
|
+
*/
|
|
273
|
+
_getCropDimensions() {
|
|
274
|
+
let cropBox = this.$['*cropBox'];
|
|
275
|
+
let imageBox = this.$['*imageBox'];
|
|
276
|
+
let operations = this.$['*operations'];
|
|
277
|
+
let { rotate } = operations;
|
|
278
|
+
let { width: previewWidth, height: previewHeight } = imageBox;
|
|
279
|
+
let { width: sourceWidth, height: sourceHeight } = rotateSize(this._imageSize, rotate);
|
|
280
|
+
let { width: cropWidth, height: cropHeight } = cropBox;
|
|
281
|
+
let ratioW = previewWidth / sourceWidth;
|
|
282
|
+
let ratioH = previewHeight / sourceHeight;
|
|
283
|
+
|
|
284
|
+
/** @type {[Number, Number]} */
|
|
285
|
+
let dimensions = [
|
|
286
|
+
clamp(Math.round(cropWidth / ratioW), 1, sourceWidth),
|
|
287
|
+
clamp(Math.round(cropHeight / ratioH), 1, sourceHeight),
|
|
288
|
+
];
|
|
289
|
+
|
|
290
|
+
return dimensions;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* @private
|
|
295
|
+
* @returns {import('./types.js').Transformations['crop']}
|
|
296
|
+
*/
|
|
297
|
+
_getCropTransformation() {
|
|
298
|
+
let cropBox = this.$['*cropBox'];
|
|
299
|
+
let imageBox = this.$['*imageBox'];
|
|
300
|
+
let operations = this.$['*operations'];
|
|
301
|
+
let { rotate } = operations;
|
|
302
|
+
let { width: previewWidth, height: previewHeight, x: previewX, y: previewY } = imageBox;
|
|
303
|
+
let { width: sourceWidth, height: sourceHeight } = rotateSize(this._imageSize, rotate);
|
|
304
|
+
let { x: cropX, y: cropY } = cropBox;
|
|
305
|
+
let ratioW = previewWidth / sourceWidth;
|
|
306
|
+
let ratioH = previewHeight / sourceHeight;
|
|
307
|
+
|
|
308
|
+
let dimensions = this._getCropDimensions();
|
|
309
|
+
let crop = {
|
|
310
|
+
dimensions,
|
|
311
|
+
coords: /** @type {[Number, Number]} */ ([
|
|
312
|
+
clamp(Math.round((cropX - previewX) / ratioW), 0, sourceWidth - dimensions[0]),
|
|
313
|
+
clamp(Math.round((cropY - previewY) / ratioH), 0, sourceHeight - dimensions[1]),
|
|
314
|
+
]),
|
|
315
|
+
};
|
|
316
|
+
if (!validateCrop(crop)) {
|
|
317
|
+
console.error('Cropper is trying to create invalid crop object', {
|
|
318
|
+
payload: crop,
|
|
319
|
+
});
|
|
320
|
+
return undefined;
|
|
321
|
+
}
|
|
322
|
+
if (dimensions[0] === sourceWidth && dimensions[1] === sourceHeight) {
|
|
323
|
+
return undefined;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
return crop;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/** @private */
|
|
330
|
+
_commit() {
|
|
331
|
+
if (!this.isConnected || !this._imageSize) {
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
let operations = this.$['*operations'];
|
|
335
|
+
let { rotate, mirror, flip } = operations;
|
|
336
|
+
let crop = this._getCropTransformation();
|
|
337
|
+
/** @type {import('./types.js').Transformations} */
|
|
338
|
+
let editorTransformations = this.$['*editorTransformations'];
|
|
339
|
+
let transformations = {
|
|
340
|
+
...editorTransformations,
|
|
341
|
+
crop,
|
|
342
|
+
rotate,
|
|
343
|
+
mirror,
|
|
344
|
+
flip,
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
this.$['*editorTransformations'] = transformations;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* @param {String} operation
|
|
352
|
+
* @param {Number} value
|
|
353
|
+
* @returns {void}
|
|
354
|
+
*/
|
|
355
|
+
setValue(operation, value) {
|
|
356
|
+
this.$['*operations'] = {
|
|
357
|
+
...this.$['*operations'],
|
|
358
|
+
[operation]: value,
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
if (!this._isActive) {
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
this._alignImage();
|
|
366
|
+
this._alignCrop();
|
|
367
|
+
this._draw();
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* @param {keyof Operations} operation
|
|
372
|
+
* @returns {Number | boolean}
|
|
373
|
+
*/
|
|
374
|
+
getValue(operation) {
|
|
375
|
+
return this.$['*operations'][operation];
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* @param {import('./types.js').ImageSize} imageSize
|
|
380
|
+
* @param {{ fromViewer?: boolean }} options
|
|
381
|
+
*/
|
|
382
|
+
async activate(imageSize, { fromViewer } = {}) {
|
|
383
|
+
if (this._isActive) {
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
this._isActive = true;
|
|
387
|
+
this._imageSize = imageSize;
|
|
388
|
+
this.removeEventListener('transitionend', this._reset);
|
|
389
|
+
|
|
390
|
+
try {
|
|
391
|
+
this.$.image = await this._waitForImage(this.$['*originalUrl'], this.$['*editorTransformations']);
|
|
392
|
+
this._syncTransformations();
|
|
393
|
+
this._animateIn({ fromViewer });
|
|
394
|
+
} catch (err) {
|
|
395
|
+
console.error('Failed to activate cropper', { error: err });
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
this._observer = new ResizeObserver(([entry]) => {
|
|
399
|
+
const nonZeroSize = entry.contentRect.width > 0 && entry.contentRect.height > 0;
|
|
400
|
+
if (nonZeroSize && this._isActive && this.$.image) {
|
|
401
|
+
this._handleResizeThrottled();
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
this._observer.observe(this);
|
|
405
|
+
}
|
|
406
|
+
deactivate({ reset = false } = {}) {
|
|
407
|
+
if (!this._isActive) {
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
!reset && this._commit();
|
|
411
|
+
this._isActive = false;
|
|
412
|
+
|
|
413
|
+
this._transitionToCrop();
|
|
414
|
+
|
|
415
|
+
this.className = classNames({
|
|
416
|
+
'uc-active_from_viewer': false,
|
|
417
|
+
'uc-active_from_editor': false,
|
|
418
|
+
'uc-inactive_to_editor': true,
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
this.ref['frame-el'].toggleThumbs(false);
|
|
422
|
+
this.addEventListener('transitionend', this._reset, { once: true });
|
|
423
|
+
this._observer?.disconnect();
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/** @private */
|
|
427
|
+
_transitionToCrop() {
|
|
428
|
+
let dimensions = this._getCropDimensions();
|
|
429
|
+
let scaleX = Math.min(this.offsetWidth, dimensions[0]) / this.$['*cropBox'].width;
|
|
430
|
+
let scaleY = Math.min(this.offsetHeight, dimensions[1]) / this.$['*cropBox'].height;
|
|
431
|
+
let scale = Math.min(scaleX, scaleY);
|
|
432
|
+
let cropCenterX = this.$['*cropBox'].x + this.$['*cropBox'].width / 2;
|
|
433
|
+
let cropCenterY = this.$['*cropBox'].y + this.$['*cropBox'].height / 2;
|
|
434
|
+
|
|
435
|
+
this.style.transform = `scale(${scale}) translate(${(this.offsetWidth / 2 - cropCenterX) / scale}px, ${
|
|
436
|
+
(this.offsetHeight / 2 - cropCenterY) / scale
|
|
437
|
+
}px)`;
|
|
438
|
+
this.style.transformOrigin = `${cropCenterX}px ${cropCenterY}px`;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/** @private */
|
|
442
|
+
_transitionToImage() {
|
|
443
|
+
let cropCenterX = this.$['*cropBox'].x + this.$['*cropBox'].width / 2;
|
|
444
|
+
let cropCenterY = this.$['*cropBox'].y + this.$['*cropBox'].height / 2;
|
|
445
|
+
|
|
446
|
+
this.style.transform = `scale(1)`;
|
|
447
|
+
this.style.transformOrigin = `${cropCenterX}px ${cropCenterY}px`;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/** @private */
|
|
451
|
+
_reset() {
|
|
452
|
+
if (this._isActive) {
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
this.$.image = null;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* @private
|
|
460
|
+
* @param {String} originalUrl
|
|
461
|
+
* @param {import('./types.js').Transformations} transformations
|
|
462
|
+
* @returns {Promise<HTMLImageElement>}
|
|
463
|
+
*/
|
|
464
|
+
_waitForImage(originalUrl, transformations) {
|
|
465
|
+
let width = this.offsetWidth;
|
|
466
|
+
transformations = {
|
|
467
|
+
...transformations,
|
|
468
|
+
crop: undefined,
|
|
469
|
+
rotate: undefined,
|
|
470
|
+
flip: undefined,
|
|
471
|
+
mirror: undefined,
|
|
472
|
+
};
|
|
473
|
+
let src = this.proxyUrl(viewerImageSrc(originalUrl, width, transformations));
|
|
474
|
+
let { promise, cancel, image } = preloadImage(src);
|
|
475
|
+
|
|
476
|
+
let stop = this._handleImageLoading(src);
|
|
477
|
+
image.addEventListener('load', stop, { once: true });
|
|
478
|
+
image.addEventListener('error', stop, { once: true });
|
|
479
|
+
this._cancelPreload && this._cancelPreload();
|
|
480
|
+
this._cancelPreload = cancel;
|
|
481
|
+
|
|
482
|
+
return promise
|
|
483
|
+
.then(() => image)
|
|
484
|
+
.catch((err) => {
|
|
485
|
+
console.error('Failed to load image', { error: err });
|
|
486
|
+
this.$['*networkProblems'] = true;
|
|
487
|
+
return Promise.resolve(image);
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* @private
|
|
493
|
+
* @param {String} src
|
|
494
|
+
* @returns {() => void} Destructor
|
|
495
|
+
*/
|
|
496
|
+
_handleImageLoading(src) {
|
|
497
|
+
let operation = 'crop';
|
|
498
|
+
let loadingOperations = this.$['*loadingOperations'];
|
|
499
|
+
if (!loadingOperations.get(operation)) {
|
|
500
|
+
loadingOperations.set(operation, new Map());
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
if (!loadingOperations.get(operation).get(src)) {
|
|
504
|
+
loadingOperations.set(operation, loadingOperations.get(operation).set(src, true));
|
|
505
|
+
this.$['*loadingOperations'] = loadingOperations;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
return () => {
|
|
509
|
+
if (loadingOperations?.get(operation)?.has(src)) {
|
|
510
|
+
loadingOperations.get(operation).delete(src);
|
|
511
|
+
this.$['*loadingOperations'] = loadingOperations;
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
initCallback() {
|
|
517
|
+
super.initCallback();
|
|
518
|
+
|
|
519
|
+
this.sub('*imageBox', () => {
|
|
520
|
+
this._draw();
|
|
521
|
+
});
|
|
522
|
+
|
|
523
|
+
this.sub('*cropBox', () => {
|
|
524
|
+
if (this.$.image) {
|
|
525
|
+
this._commitDebounced();
|
|
526
|
+
}
|
|
527
|
+
});
|
|
528
|
+
|
|
529
|
+
this.sub('*cropPresetList', () => {
|
|
530
|
+
this._alignCrop();
|
|
531
|
+
});
|
|
532
|
+
|
|
533
|
+
setTimeout(() => {
|
|
534
|
+
this.sub('*networkProblems', (networkProblems) => {
|
|
535
|
+
if (!networkProblems) {
|
|
536
|
+
this._isActive && this.activate(this._imageSize, { fromViewer: false });
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
}, 0);
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
destroyCallback() {
|
|
543
|
+
super.destroyCallback();
|
|
544
|
+
this._observer?.disconnect();
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
EditorImageCropper.template = /* HTML */ `
|
|
549
|
+
<canvas class="uc-canvas" ref="canvas-el"></canvas>
|
|
550
|
+
<uc-crop-frame ref="frame-el"></uc-crop-frame>
|
|
551
|
+
`;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} Keypoint
|
|
3
|
+
* @property {String} src
|
|
4
|
+
* @property {Number} opacity
|
|
5
|
+
* @property {Number} zIndex
|
|
6
|
+
* @property {HTMLImageElement} image
|
|
7
|
+
* @property {Number} value
|
|
8
|
+
*/
|
|
9
|
+
export class EditorImageFader extends Block {
|
|
10
|
+
/**
|
|
11
|
+
* @private
|
|
12
|
+
* @type {Boolean}
|
|
13
|
+
*/
|
|
14
|
+
private _isActive;
|
|
15
|
+
/**
|
|
16
|
+
* @private
|
|
17
|
+
* @type {Boolean}
|
|
18
|
+
*/
|
|
19
|
+
private _hidden;
|
|
20
|
+
/** @private */
|
|
21
|
+
private _addKeypointDebounced;
|
|
22
|
+
/**
|
|
23
|
+
* @private
|
|
24
|
+
* @param {String} src
|
|
25
|
+
* @returns {() => void} Destructor
|
|
26
|
+
*/
|
|
27
|
+
private _handleImageLoading;
|
|
28
|
+
/** @private */
|
|
29
|
+
private _flush;
|
|
30
|
+
_raf: number | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* @private
|
|
33
|
+
* @param {Object} options
|
|
34
|
+
* @param {String} [options.url]
|
|
35
|
+
* @param {String} [options.filter]
|
|
36
|
+
* @param {String} [options.operation]
|
|
37
|
+
* @param {Number} [options.value]
|
|
38
|
+
* @returns {String}
|
|
39
|
+
*/
|
|
40
|
+
private _imageSrc;
|
|
41
|
+
/**
|
|
42
|
+
* @private
|
|
43
|
+
* @param {String} operation
|
|
44
|
+
* @param {Number} value
|
|
45
|
+
* @returns {Keypoint}
|
|
46
|
+
*/
|
|
47
|
+
private _constructKeypoint;
|
|
48
|
+
/**
|
|
49
|
+
* Check if current operation and filter equals passed ones
|
|
50
|
+
*
|
|
51
|
+
* @private
|
|
52
|
+
* @param {String} operation
|
|
53
|
+
* @param {String} [filter]
|
|
54
|
+
* @returns {Boolean}
|
|
55
|
+
*/
|
|
56
|
+
private _isSame;
|
|
57
|
+
/**
|
|
58
|
+
* @private
|
|
59
|
+
* @param {String} operation
|
|
60
|
+
* @param {String | null} filter
|
|
61
|
+
* @param {Number} value
|
|
62
|
+
*/
|
|
63
|
+
private _addKeypoint;
|
|
64
|
+
/** @param {String | Number} value */
|
|
65
|
+
set(value: string | number): void;
|
|
66
|
+
/**
|
|
67
|
+
* @private
|
|
68
|
+
* @param {String} operation
|
|
69
|
+
* @param {Number} value
|
|
70
|
+
*/
|
|
71
|
+
private _update;
|
|
72
|
+
_operation: string | undefined;
|
|
73
|
+
_value: number | undefined;
|
|
74
|
+
/** @private */
|
|
75
|
+
private _createPreviewImage;
|
|
76
|
+
/** @private */
|
|
77
|
+
private _initNodes;
|
|
78
|
+
_previewImage: any;
|
|
79
|
+
_cancelLastImages: any;
|
|
80
|
+
_container: HTMLDivElement | undefined;
|
|
81
|
+
/** @param {import('./types.js').Transformations} transformations */
|
|
82
|
+
setTransformations(transformations: import('./types.js').Transformations): void;
|
|
83
|
+
_transformations: import("./types.js").Transformations | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* @param {object} options
|
|
86
|
+
* @param {String} options.url
|
|
87
|
+
* @param {String} options.operation
|
|
88
|
+
* @param {Number} options.value
|
|
89
|
+
* @param {String} [options.filter]
|
|
90
|
+
*/
|
|
91
|
+
preload({ url, filter, operation, value }: {
|
|
92
|
+
url: string;
|
|
93
|
+
operation: string;
|
|
94
|
+
value: number;
|
|
95
|
+
filter?: string | undefined;
|
|
96
|
+
}): void;
|
|
97
|
+
_cancelBatchPreload: (() => void) | undefined;
|
|
98
|
+
/** @private */
|
|
99
|
+
private _setOriginalSrc;
|
|
100
|
+
/**
|
|
101
|
+
* @param {object} options
|
|
102
|
+
* @param {String} options.url
|
|
103
|
+
* @param {String} [options.operation]
|
|
104
|
+
* @param {Number} [options.value]
|
|
105
|
+
* @param {String} [options.filter]
|
|
106
|
+
* @param {Boolean} [options.fromViewer]
|
|
107
|
+
*/
|
|
108
|
+
activate({ url, operation, value, filter, fromViewer }: {
|
|
109
|
+
url: string;
|
|
110
|
+
operation?: string | undefined;
|
|
111
|
+
value?: number | undefined;
|
|
112
|
+
filter?: string | undefined;
|
|
113
|
+
fromViewer?: boolean | undefined;
|
|
114
|
+
}): void;
|
|
115
|
+
_url: string | undefined;
|
|
116
|
+
_filter: string | undefined;
|
|
117
|
+
_fromViewer: boolean | undefined;
|
|
118
|
+
_keypoints: Keypoint[] | undefined;
|
|
119
|
+
/** @param {{ hide?: Boolean }} options */
|
|
120
|
+
deactivate({ hide }?: {
|
|
121
|
+
hide?: boolean;
|
|
122
|
+
}): void;
|
|
123
|
+
}
|
|
124
|
+
export type Keypoint = {
|
|
125
|
+
src: string;
|
|
126
|
+
opacity: number;
|
|
127
|
+
zIndex: number;
|
|
128
|
+
image: HTMLImageElement;
|
|
129
|
+
value: number;
|
|
130
|
+
};
|
|
131
|
+
import { Block } from '../../../abstract/Block.js';
|
|
132
|
+
//# sourceMappingURL=EditorImageFader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorImageFader.d.ts","sourceRoot":"","sources":["EditorImageFader.js"],"names":[],"mappings":"AA8DA;;;;;;;GAOG;AAEH;IAII;;;OAGG;IACH,kBAAsB;IAEtB;;;OAGG;IACH,gBAAmB;IAEnB,eAAe;IACf,8BAAwE;IAK1E;;;;OAIG;IACH,4BAmBC;IAED,eAAe;IACf,eAWC;IATC,yBAQE;IAGJ;;;;;;;;OAQG;IACH,kBAUC;IAED;;;;;OAKG;IACH,2BASC;IAED;;;;;;;OAOG;IACH,gBAEC;IAED;;;;;OAKG;IACH,qBA0CC;IAED,qCAAqC;IACrC,WADY,eAAe,QAK1B;IAED;;;;OAIG;IACH,gBAgBC;IAfC,+BAA2B;IAC3B,2BAAmB;IAgBrB,eAAe;IACf,4BAKC;IAED,eAAe;IACf,mBAmCC;IAjCC,mBAAqE;IAcrE,uBAGC;IAMC,uCAA2B;IAY/B,oEAAoE;IACpE,oCADY,OAAO,YAAY,EAAE,eAAe,QAmB/C;IAjBC,mEAAuC;IAmBzC;;;;;;OAMG;IACH;QAL2B,GAAG;QACH,SAAS;QACT,KAAK;QACJ,MAAM;aAUjC;IADC,8CAAiC;IAGnC,eAAe;IACf,wBA4CC;IAED;;;;;;;OAOG;IACH;QAN2B,GAAG;QACF,SAAS;QACT,KAAK;QACL,MAAM;QACL,UAAU;aAsBtC;IAjBC,yBAAe;IAGf,4BAAqB;IACrB,iCAA6B;IAS7B,mCAAkH;IAMpH,0CAA0C;IAC1C,sBADY;QAAE,IAAI,CAAC,UAAS;KAAE,QA4B7B;CACF;;;;;WAlYa,gBAAgB;;;sBAlER,4BAA4B"}
|