@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,454 @@
|
|
|
1
|
+
import { debounce } from '../../utils/debounce.js';
|
|
2
|
+
import { Block } from '../../../abstract/Block.js';
|
|
3
|
+
import { classNames } from './lib/classNames.js';
|
|
4
|
+
import { linspace } from './lib/linspace.js';
|
|
5
|
+
import { batchPreloadImages } from './lib/preloadImage.js';
|
|
6
|
+
import { COLOR_OPERATIONS_CONFIG } from './toolbar-constants.js';
|
|
7
|
+
import { viewerImageSrc } from './util.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @param {Number[]} numbers
|
|
11
|
+
* @returns {[Number, Number][]}
|
|
12
|
+
*/
|
|
13
|
+
function splitBySections(numbers) {
|
|
14
|
+
return numbers.reduce(
|
|
15
|
+
(acc, point, idx) => (idx < numbers.length - 1 ? [...acc, [point, numbers[idx + 1]]] : acc),
|
|
16
|
+
[],
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @param {Number[]} keypoints
|
|
22
|
+
* @param {Number} value
|
|
23
|
+
* @param {Number} zero
|
|
24
|
+
*/
|
|
25
|
+
function calculateOpacities(keypoints, value, zero) {
|
|
26
|
+
let section = splitBySections(keypoints).find(([left, right]) => left <= value && value <= right);
|
|
27
|
+
return keypoints.map((point) => {
|
|
28
|
+
let distance = Math.abs(section[0] - section[1]);
|
|
29
|
+
let relation = Math.abs(value - section[0]) / distance;
|
|
30
|
+
|
|
31
|
+
if (section[0] === point) {
|
|
32
|
+
return value > zero ? 1 : 1 - relation;
|
|
33
|
+
}
|
|
34
|
+
if (section[1] === point) {
|
|
35
|
+
return value >= zero ? relation : 1;
|
|
36
|
+
}
|
|
37
|
+
return 0;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @param {Number[]} keypoints
|
|
43
|
+
* @param {Number} zero
|
|
44
|
+
*/
|
|
45
|
+
function calculateZIndices(keypoints, zero) {
|
|
46
|
+
return keypoints.map((point, idx) => (point < zero ? keypoints.length - idx : idx));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @param {String} operation
|
|
51
|
+
* @param {Number} value
|
|
52
|
+
* @returns {Number[]}
|
|
53
|
+
*/
|
|
54
|
+
function keypointsRange(operation, value) {
|
|
55
|
+
let n = COLOR_OPERATIONS_CONFIG[operation].keypointsNumber;
|
|
56
|
+
let { range, zero } = COLOR_OPERATIONS_CONFIG[operation];
|
|
57
|
+
|
|
58
|
+
return [...new Set([...linspace(range[0], zero, n + 1), ...linspace(zero, range[1], n + 1), zero, value])].sort(
|
|
59
|
+
(a, b) => a - b,
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @typedef {Object} Keypoint
|
|
65
|
+
* @property {String} src
|
|
66
|
+
* @property {Number} opacity
|
|
67
|
+
* @property {Number} zIndex
|
|
68
|
+
* @property {HTMLImageElement} image
|
|
69
|
+
* @property {Number} value
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
export class EditorImageFader extends Block {
|
|
73
|
+
constructor() {
|
|
74
|
+
super();
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @private
|
|
78
|
+
* @type {Boolean}
|
|
79
|
+
*/
|
|
80
|
+
this._isActive = false;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @private
|
|
84
|
+
* @type {Boolean}
|
|
85
|
+
*/
|
|
86
|
+
this._hidden = true;
|
|
87
|
+
|
|
88
|
+
/** @private */
|
|
89
|
+
this._addKeypointDebounced = debounce(this._addKeypoint.bind(this), 600);
|
|
90
|
+
|
|
91
|
+
this.classList.add('uc-inactive_to_cropper');
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @private
|
|
96
|
+
* @param {String} src
|
|
97
|
+
* @returns {() => void} Destructor
|
|
98
|
+
*/
|
|
99
|
+
_handleImageLoading(src) {
|
|
100
|
+
let operation = this._operation;
|
|
101
|
+
|
|
102
|
+
let loadingOperations = this.$['*loadingOperations'];
|
|
103
|
+
if (!loadingOperations.get(operation)) {
|
|
104
|
+
loadingOperations.set(operation, new Map());
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (!loadingOperations.get(operation).get(src)) {
|
|
108
|
+
loadingOperations.set(operation, loadingOperations.get(operation).set(src, true));
|
|
109
|
+
this.$['*loadingOperations'] = loadingOperations;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return () => {
|
|
113
|
+
if (loadingOperations?.get(operation)?.has(src)) {
|
|
114
|
+
loadingOperations.get(operation).delete(src);
|
|
115
|
+
this.$['*loadingOperations'] = loadingOperations;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** @private */
|
|
121
|
+
_flush() {
|
|
122
|
+
window.cancelAnimationFrame(this._raf);
|
|
123
|
+
this._raf = window.requestAnimationFrame(() => {
|
|
124
|
+
for (let kp of this._keypoints) {
|
|
125
|
+
let { image } = kp;
|
|
126
|
+
if (image) {
|
|
127
|
+
image.style.opacity = kp.opacity.toString();
|
|
128
|
+
image.style.zIndex = kp.zIndex.toString();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @private
|
|
136
|
+
* @param {Object} options
|
|
137
|
+
* @param {String} [options.url]
|
|
138
|
+
* @param {String} [options.filter]
|
|
139
|
+
* @param {String} [options.operation]
|
|
140
|
+
* @param {Number} [options.value]
|
|
141
|
+
* @returns {String}
|
|
142
|
+
*/
|
|
143
|
+
_imageSrc({ url = this._url, filter = this._filter, operation, value } = {}) {
|
|
144
|
+
let transformations = { ...this._transformations };
|
|
145
|
+
|
|
146
|
+
if (operation) {
|
|
147
|
+
transformations[operation] = filter ? { name: filter, amount: value } : value;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// do not use getBoundingClientRect because scale transform affects it
|
|
151
|
+
let width = this.offsetWidth;
|
|
152
|
+
return this.proxyUrl(viewerImageSrc(url, width, transformations));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @private
|
|
157
|
+
* @param {String} operation
|
|
158
|
+
* @param {Number} value
|
|
159
|
+
* @returns {Keypoint}
|
|
160
|
+
*/
|
|
161
|
+
_constructKeypoint(operation, value) {
|
|
162
|
+
let src = this._imageSrc({ operation, value });
|
|
163
|
+
return {
|
|
164
|
+
src,
|
|
165
|
+
image: null,
|
|
166
|
+
opacity: 0,
|
|
167
|
+
zIndex: 0,
|
|
168
|
+
value,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Check if current operation and filter equals passed ones
|
|
174
|
+
*
|
|
175
|
+
* @private
|
|
176
|
+
* @param {String} operation
|
|
177
|
+
* @param {String} [filter]
|
|
178
|
+
* @returns {Boolean}
|
|
179
|
+
*/
|
|
180
|
+
_isSame(operation, filter) {
|
|
181
|
+
return this._operation === operation && this._filter === filter;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* @private
|
|
186
|
+
* @param {String} operation
|
|
187
|
+
* @param {String | null} filter
|
|
188
|
+
* @param {Number} value
|
|
189
|
+
*/
|
|
190
|
+
_addKeypoint(operation, filter, value) {
|
|
191
|
+
let shouldSkip = () =>
|
|
192
|
+
!this._isSame(operation, filter) || this._value !== value || !!this._keypoints.find((kp) => kp.value === value);
|
|
193
|
+
|
|
194
|
+
if (shouldSkip()) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
let keypoint = this._constructKeypoint(operation, value);
|
|
198
|
+
let image = new Image();
|
|
199
|
+
image.src = keypoint.src;
|
|
200
|
+
let stop = this._handleImageLoading(keypoint.src);
|
|
201
|
+
image.addEventListener('load', stop, { once: true });
|
|
202
|
+
image.addEventListener('error', stop, { once: true });
|
|
203
|
+
keypoint.image = image;
|
|
204
|
+
image.classList.add('uc-fader-image');
|
|
205
|
+
|
|
206
|
+
image.addEventListener(
|
|
207
|
+
'load',
|
|
208
|
+
() => {
|
|
209
|
+
if (shouldSkip()) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
let keypoints = this._keypoints;
|
|
213
|
+
let idx = keypoints.findIndex((kp) => kp.value > value);
|
|
214
|
+
let insertBeforeNode = idx < keypoints.length ? keypoints[idx].image : null;
|
|
215
|
+
if (!this._container || (insertBeforeNode && !this._container.contains(insertBeforeNode))) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
keypoints.splice(idx, 0, keypoint);
|
|
219
|
+
this._container.insertBefore(image, insertBeforeNode);
|
|
220
|
+
this._update(operation, value);
|
|
221
|
+
},
|
|
222
|
+
{ once: true },
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
image.addEventListener(
|
|
226
|
+
'error',
|
|
227
|
+
() => {
|
|
228
|
+
this.$['*networkProblems'] = true;
|
|
229
|
+
},
|
|
230
|
+
{ once: true },
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/** @param {String | Number} value */
|
|
235
|
+
set(value) {
|
|
236
|
+
value = typeof value === 'string' ? parseInt(value, 10) : value;
|
|
237
|
+
this._update(this._operation, value);
|
|
238
|
+
this._addKeypointDebounced(this._operation, this._filter, value);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* @private
|
|
243
|
+
* @param {String} operation
|
|
244
|
+
* @param {Number} value
|
|
245
|
+
*/
|
|
246
|
+
_update(operation, value) {
|
|
247
|
+
this._operation = operation;
|
|
248
|
+
this._value = value;
|
|
249
|
+
|
|
250
|
+
let { zero } = COLOR_OPERATIONS_CONFIG[operation];
|
|
251
|
+
|
|
252
|
+
let keypointValues = this._keypoints.map((kp) => kp.value);
|
|
253
|
+
let opacities = calculateOpacities(keypointValues, value, zero);
|
|
254
|
+
let zIndices = calculateZIndices(keypointValues, zero);
|
|
255
|
+
|
|
256
|
+
for (let [idx, kp] of Object.entries(this._keypoints)) {
|
|
257
|
+
kp.opacity = opacities[idx];
|
|
258
|
+
kp.zIndex = zIndices[idx];
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
this._flush();
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/** @private */
|
|
265
|
+
_createPreviewImage() {
|
|
266
|
+
let image = new Image();
|
|
267
|
+
image.classList.add('uc-fader-image', 'uc-fader-image--preview');
|
|
268
|
+
image.style.opacity = '0';
|
|
269
|
+
return image;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/** @private */
|
|
273
|
+
async _initNodes() {
|
|
274
|
+
let fr = document.createDocumentFragment();
|
|
275
|
+
this._previewImage = this._previewImage || this._createPreviewImage();
|
|
276
|
+
!this.contains(this._previewImage) && fr.appendChild(this._previewImage);
|
|
277
|
+
|
|
278
|
+
let container = document.createElement('div');
|
|
279
|
+
fr.appendChild(container);
|
|
280
|
+
|
|
281
|
+
let srcList = this._keypoints.map((kp) => kp.src);
|
|
282
|
+
|
|
283
|
+
let { images, promise, cancel } = batchPreloadImages(srcList);
|
|
284
|
+
images.forEach((node) => {
|
|
285
|
+
let stop = this._handleImageLoading(node.src);
|
|
286
|
+
node.addEventListener('load', stop);
|
|
287
|
+
node.addEventListener('error', stop);
|
|
288
|
+
});
|
|
289
|
+
this._cancelLastImages = () => {
|
|
290
|
+
cancel();
|
|
291
|
+
this._cancelLastImages = undefined;
|
|
292
|
+
};
|
|
293
|
+
let operation = this._operation;
|
|
294
|
+
let filter = this._filter;
|
|
295
|
+
await promise;
|
|
296
|
+
if (this._isActive && this._isSame(operation, filter)) {
|
|
297
|
+
this._container && this._container.remove();
|
|
298
|
+
this._container = container;
|
|
299
|
+
this._keypoints.forEach((kp, idx) => {
|
|
300
|
+
let kpImage = images[idx];
|
|
301
|
+
kpImage.classList.add('uc-fader-image');
|
|
302
|
+
kp.image = kpImage;
|
|
303
|
+
this._container.appendChild(kpImage);
|
|
304
|
+
});
|
|
305
|
+
this.appendChild(fr);
|
|
306
|
+
this._flush();
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/** @param {import('./types.js').Transformations} transformations */
|
|
311
|
+
setTransformations(transformations) {
|
|
312
|
+
this._transformations = transformations;
|
|
313
|
+
if (this._previewImage) {
|
|
314
|
+
let src = this._imageSrc();
|
|
315
|
+
let stop = this._handleImageLoading(src);
|
|
316
|
+
this._previewImage.src = src;
|
|
317
|
+
this._previewImage.addEventListener('load', stop, { once: true });
|
|
318
|
+
this._previewImage.addEventListener('error', stop, { once: true });
|
|
319
|
+
this._previewImage.style.opacity = '1';
|
|
320
|
+
|
|
321
|
+
this._previewImage.addEventListener(
|
|
322
|
+
'error',
|
|
323
|
+
() => {
|
|
324
|
+
this.$['*networkProblems'] = true;
|
|
325
|
+
},
|
|
326
|
+
{ once: true },
|
|
327
|
+
);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* @param {object} options
|
|
333
|
+
* @param {String} options.url
|
|
334
|
+
* @param {String} options.operation
|
|
335
|
+
* @param {Number} options.value
|
|
336
|
+
* @param {String} [options.filter]
|
|
337
|
+
*/
|
|
338
|
+
preload({ url, filter, operation, value }) {
|
|
339
|
+
this._cancelBatchPreload && this._cancelBatchPreload();
|
|
340
|
+
|
|
341
|
+
let keypoints = keypointsRange(operation, value);
|
|
342
|
+
let srcList = keypoints.map((kp) => this._imageSrc({ url, filter, operation, value: kp }));
|
|
343
|
+
let { cancel } = batchPreloadImages(srcList);
|
|
344
|
+
|
|
345
|
+
this._cancelBatchPreload = cancel;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/** @private */
|
|
349
|
+
_setOriginalSrc(src) {
|
|
350
|
+
let image = this._previewImage || this._createPreviewImage();
|
|
351
|
+
!this.contains(image) && this.appendChild(image);
|
|
352
|
+
this._previewImage = image;
|
|
353
|
+
|
|
354
|
+
if (image.src === src) {
|
|
355
|
+
image.style.opacity = '1';
|
|
356
|
+
image.style.transform = 'scale(1)';
|
|
357
|
+
|
|
358
|
+
this.className = classNames({
|
|
359
|
+
'uc-active_from_viewer': this._fromViewer,
|
|
360
|
+
'uc-active_from_cropper': !this._fromViewer,
|
|
361
|
+
'uc-inactive_to_cropper': false,
|
|
362
|
+
});
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
image.style.opacity = '0';
|
|
366
|
+
let stop = this._handleImageLoading(src);
|
|
367
|
+
image.addEventListener('error', stop, { once: true });
|
|
368
|
+
image.src = src;
|
|
369
|
+
image.addEventListener(
|
|
370
|
+
'load',
|
|
371
|
+
() => {
|
|
372
|
+
stop();
|
|
373
|
+
if (image) {
|
|
374
|
+
image.style.opacity = '1';
|
|
375
|
+
image.style.transform = 'scale(1)';
|
|
376
|
+
|
|
377
|
+
this.className = classNames({
|
|
378
|
+
'uc-active_from_viewer': this._fromViewer,
|
|
379
|
+
'uc-active_from_cropper': !this._fromViewer,
|
|
380
|
+
'uc-inactive_to_cropper': false,
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
{ once: true },
|
|
385
|
+
);
|
|
386
|
+
image.addEventListener(
|
|
387
|
+
'error',
|
|
388
|
+
() => {
|
|
389
|
+
this.$['*networkProblems'] = true;
|
|
390
|
+
},
|
|
391
|
+
{ once: true },
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* @param {object} options
|
|
397
|
+
* @param {String} options.url
|
|
398
|
+
* @param {String} [options.operation]
|
|
399
|
+
* @param {Number} [options.value]
|
|
400
|
+
* @param {String} [options.filter]
|
|
401
|
+
* @param {Boolean} [options.fromViewer]
|
|
402
|
+
*/
|
|
403
|
+
activate({ url, operation, value, filter, fromViewer }) {
|
|
404
|
+
this._isActive = true;
|
|
405
|
+
this._hidden = false;
|
|
406
|
+
this._url = url;
|
|
407
|
+
this._operation = operation || 'initial';
|
|
408
|
+
this._value = value;
|
|
409
|
+
this._filter = filter;
|
|
410
|
+
this._fromViewer = fromViewer;
|
|
411
|
+
|
|
412
|
+
let isOriginal = typeof value !== 'number' && !filter;
|
|
413
|
+
if (isOriginal) {
|
|
414
|
+
let src = this._imageSrc({ operation, value });
|
|
415
|
+
this._setOriginalSrc(src);
|
|
416
|
+
this._container && this._container.remove();
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
this._keypoints = keypointsRange(operation, value).map((keyValue) => this._constructKeypoint(operation, keyValue));
|
|
420
|
+
|
|
421
|
+
this._update(operation, value);
|
|
422
|
+
this._initNodes();
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/** @param {{ hide?: Boolean }} options */
|
|
426
|
+
deactivate({ hide = true } = {}) {
|
|
427
|
+
this._isActive = false;
|
|
428
|
+
|
|
429
|
+
this._cancelLastImages && this._cancelLastImages();
|
|
430
|
+
this._cancelBatchPreload && this._cancelBatchPreload();
|
|
431
|
+
|
|
432
|
+
if (hide && !this._hidden) {
|
|
433
|
+
this._hidden = true;
|
|
434
|
+
if (this._previewImage) {
|
|
435
|
+
this._previewImage.style.transform = 'scale(1)';
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
this.className = classNames({
|
|
439
|
+
'uc-active_from_viewer': false,
|
|
440
|
+
'uc-active_from_cropper': false,
|
|
441
|
+
'uc-inactive_to_cropper': true,
|
|
442
|
+
});
|
|
443
|
+
this.addEventListener(
|
|
444
|
+
'transitionend',
|
|
445
|
+
() => {
|
|
446
|
+
this._container && this._container.remove();
|
|
447
|
+
},
|
|
448
|
+
{ once: true },
|
|
449
|
+
);
|
|
450
|
+
} else {
|
|
451
|
+
this._container && this._container.remove();
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorOperationControl.d.ts","sourceRoot":"","sources":["EditorOperationControl.js"],"names":[],"mappings":"AAGA;IACE;;;OAGG;IACH,mBAAgB;CA8BjB;oCAtCmC,0BAA0B"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { EditorButtonControl } from './EditorButtonControl.js';
|
|
2
|
+
import { COLOR_OPERATIONS_CONFIG } from './toolbar-constants.js';
|
|
3
|
+
|
|
4
|
+
export class EditorOperationControl extends EditorButtonControl {
|
|
5
|
+
/**
|
|
6
|
+
* @private
|
|
7
|
+
* @type {String}
|
|
8
|
+
*/
|
|
9
|
+
_operation = '';
|
|
10
|
+
|
|
11
|
+
initCallback() {
|
|
12
|
+
super.initCallback();
|
|
13
|
+
|
|
14
|
+
this.$['on.click'] = (e) => {
|
|
15
|
+
this.$['*sliderEl'].setOperation(this._operation);
|
|
16
|
+
this.$['*showSlider'] = true;
|
|
17
|
+
this.$['*currentOperation'] = this._operation;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
this.defineAccessor('operation', (operation) => {
|
|
21
|
+
if (operation) {
|
|
22
|
+
this._operation = operation;
|
|
23
|
+
this.$['icon'] = operation;
|
|
24
|
+
this.bindL10n('title', () => this.l10n(operation));
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
this.sub('*editorTransformations', (editorTransformations) => {
|
|
29
|
+
if (!this._operation) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let { zero } = COLOR_OPERATIONS_CONFIG[this._operation];
|
|
34
|
+
let value = editorTransformations[this._operation];
|
|
35
|
+
let isActive = typeof value !== 'undefined' ? value !== zero : false;
|
|
36
|
+
this.$.active = isActive;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorScroller.d.ts","sourceRoot":"","sources":["EditorScroller.js"],"names":[],"mappings":"AAIA;CA0BC;;;;sBA9BqB,4BAA4B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Block } from '../../../abstract/Block.js';
|
|
2
|
+
|
|
3
|
+
const X_THRESHOLD = 1;
|
|
4
|
+
|
|
5
|
+
export class EditorScroller extends Block {
|
|
6
|
+
initCallback() {
|
|
7
|
+
super.initCallback();
|
|
8
|
+
|
|
9
|
+
this.addEventListener(
|
|
10
|
+
'wheel',
|
|
11
|
+
(e) => {
|
|
12
|
+
e.preventDefault();
|
|
13
|
+
|
|
14
|
+
let { deltaY, deltaX } = e;
|
|
15
|
+
if (Math.abs(deltaX) > X_THRESHOLD) {
|
|
16
|
+
this.scrollLeft += deltaX;
|
|
17
|
+
} else {
|
|
18
|
+
this.scrollLeft += deltaY;
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
passive: false,
|
|
23
|
+
},
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
// This fixes some strange bug on MacOS - wheel event doesn't fire for physical mouse wheel if no scroll event attached also
|
|
27
|
+
this.addEventListener('scroll', () => {}, {
|
|
28
|
+
passive: true,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
EditorScroller.template = /* HTML */ ` <slot></slot> `;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export const FAKE_ORIGINAL_FILTER: "original";
|
|
2
|
+
export class EditorSlider extends Block {
|
|
3
|
+
init$: any;
|
|
4
|
+
/**
|
|
5
|
+
* @param {String} operation
|
|
6
|
+
* @param {String} [filter]
|
|
7
|
+
*/
|
|
8
|
+
setOperation(operation: string, filter?: string | undefined): void;
|
|
9
|
+
_controlType: string | undefined;
|
|
10
|
+
_operation: string | undefined;
|
|
11
|
+
_iconName: string | undefined;
|
|
12
|
+
_title: string | undefined;
|
|
13
|
+
_filter: string | undefined;
|
|
14
|
+
/** @private */
|
|
15
|
+
private _initializeValues;
|
|
16
|
+
apply(): void;
|
|
17
|
+
cancel(): void;
|
|
18
|
+
_originalUrl: any;
|
|
19
|
+
}
|
|
20
|
+
export namespace EditorSlider {
|
|
21
|
+
let template: string;
|
|
22
|
+
}
|
|
23
|
+
import { Block } from '../../../abstract/Block.js';
|
|
24
|
+
//# sourceMappingURL=EditorSlider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorSlider.d.ts","sourceRoot":"","sources":["EditorSlider.js"],"names":[],"mappings":"AAQA,8CAA+C;AAE/C;IACE,WAYE;IAEF;;;OAGG;IACH,mEAgBC;IAfC,iCAA6F;IAC7F,+BAA2B;IAC3B,8BAA0B;IAC1B,2BAAqC;IACrC,4BAAqB;IAavB,eAAe;IACf,0BAuBC;IAED,cAmBC;IAED,eAEC;IAMG,kBAA+B;CAQpC;;;;sBA9GqB,4BAA4B"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Block } from '../../../abstract/Block.js';
|
|
2
|
+
import { COLOR_OPERATIONS_CONFIG } from './toolbar-constants.js';
|
|
3
|
+
|
|
4
|
+
const ControlType = {
|
|
5
|
+
FILTER: 'filter',
|
|
6
|
+
COLOR_OPERATION: 'color_operation',
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const FAKE_ORIGINAL_FILTER = 'original';
|
|
10
|
+
|
|
11
|
+
export class EditorSlider extends Block {
|
|
12
|
+
init$ = {
|
|
13
|
+
...this.init$,
|
|
14
|
+
disabled: false,
|
|
15
|
+
min: 0,
|
|
16
|
+
max: 100,
|
|
17
|
+
value: 0,
|
|
18
|
+
defaultValue: 0,
|
|
19
|
+
zero: 0,
|
|
20
|
+
'on.input': (value) => {
|
|
21
|
+
this.$['*faderEl'].set(value);
|
|
22
|
+
this.$.value = value;
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @param {String} operation
|
|
28
|
+
* @param {String} [filter]
|
|
29
|
+
*/
|
|
30
|
+
setOperation(operation, filter) {
|
|
31
|
+
this._controlType = operation === 'filter' ? ControlType.FILTER : ControlType.COLOR_OPERATION;
|
|
32
|
+
this._operation = operation;
|
|
33
|
+
this._iconName = operation;
|
|
34
|
+
this._title = operation.toUpperCase();
|
|
35
|
+
this._filter = filter;
|
|
36
|
+
|
|
37
|
+
this._initializeValues();
|
|
38
|
+
|
|
39
|
+
this.$['*faderEl'].activate({
|
|
40
|
+
url: this.$['*originalUrl'],
|
|
41
|
+
operation: this._operation,
|
|
42
|
+
value: this._filter === FAKE_ORIGINAL_FILTER ? undefined : this.$.value,
|
|
43
|
+
filter: this._filter === FAKE_ORIGINAL_FILTER ? undefined : this._filter,
|
|
44
|
+
fromViewer: false,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** @private */
|
|
49
|
+
_initializeValues() {
|
|
50
|
+
let { range, zero } = COLOR_OPERATIONS_CONFIG[this._operation];
|
|
51
|
+
let [min, max] = range;
|
|
52
|
+
|
|
53
|
+
this.$.min = min;
|
|
54
|
+
this.$.max = max;
|
|
55
|
+
this.$.zero = zero;
|
|
56
|
+
|
|
57
|
+
let transformation = this.$['*editorTransformations'][this._operation];
|
|
58
|
+
if (this._controlType === ControlType.FILTER) {
|
|
59
|
+
let value = max;
|
|
60
|
+
if (transformation) {
|
|
61
|
+
let { name, amount } = transformation;
|
|
62
|
+
value = name === this._filter ? amount : max;
|
|
63
|
+
}
|
|
64
|
+
this.$.value = value;
|
|
65
|
+
this.$.defaultValue = value;
|
|
66
|
+
}
|
|
67
|
+
if (this._controlType === ControlType.COLOR_OPERATION) {
|
|
68
|
+
let value = typeof transformation !== 'undefined' ? transformation : zero;
|
|
69
|
+
this.$.value = value;
|
|
70
|
+
this.$.defaultValue = value;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
apply() {
|
|
75
|
+
let operationValue;
|
|
76
|
+
if (this._controlType === ControlType.FILTER) {
|
|
77
|
+
if (this._filter === FAKE_ORIGINAL_FILTER) {
|
|
78
|
+
operationValue = null;
|
|
79
|
+
} else {
|
|
80
|
+
operationValue = { name: this._filter, amount: this.$.value };
|
|
81
|
+
}
|
|
82
|
+
} else {
|
|
83
|
+
operationValue = this.$.value;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** @type {import('./types.js').Transformations} */
|
|
87
|
+
let transformations = {
|
|
88
|
+
...this.$['*editorTransformations'],
|
|
89
|
+
[this._operation]: operationValue,
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
this.$['*editorTransformations'] = transformations;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
cancel() {
|
|
96
|
+
this.$['*faderEl'].deactivate({ hide: false });
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
initCallback() {
|
|
100
|
+
super.initCallback();
|
|
101
|
+
|
|
102
|
+
this.sub('*originalUrl', (originalUrl) => {
|
|
103
|
+
this._originalUrl = originalUrl;
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
this.sub('value', (value) => {
|
|
107
|
+
let tooltip = `${this._filter || this._operation} ${value}`;
|
|
108
|
+
this.$['*operationTooltip'] = tooltip;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
EditorSlider.template = /* HTML */ `
|
|
114
|
+
<uc-slider-ui
|
|
115
|
+
ref="slider-el"
|
|
116
|
+
set="disabled: disabled; min: min; max: max; defaultValue: defaultValue; zero: zero; onInput: on.input;"
|
|
117
|
+
></uc-slider-ui>
|
|
118
|
+
`;
|