@micromerce/media-fileuploader 1.0.1834 → 1.0.1835
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +12 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +12 -4
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -18030,7 +18030,9 @@ const FilenameText = ({ decodedFileName, type, previewUrl }) => {
|
|
|
18030
18030
|
const StyledHover = styled.img `
|
|
18031
18031
|
display: none;
|
|
18032
18032
|
position: absolute;
|
|
18033
|
-
z-index:
|
|
18033
|
+
z-index: 100;
|
|
18034
|
+
left: 0;
|
|
18035
|
+
margin-top: 25px;
|
|
18034
18036
|
padding: 10px;
|
|
18035
18037
|
background: #FFFFFF;
|
|
18036
18038
|
border-radius: 4px;
|
|
@@ -18039,7 +18041,6 @@ const StyledHover = styled.img `
|
|
|
18039
18041
|
min-width: 100px;
|
|
18040
18042
|
max-width: 350px;
|
|
18041
18043
|
max-height: 250px;
|
|
18042
|
-
margin-top: 25px;
|
|
18043
18044
|
@media (max-width: 767px) {
|
|
18044
18045
|
max-width: 250px;
|
|
18045
18046
|
}
|
|
@@ -18054,17 +18055,24 @@ const StyledImagePreviewWrapper = styled.div `
|
|
|
18054
18055
|
display: flex;
|
|
18055
18056
|
top: 50%;
|
|
18056
18057
|
left: 8px;
|
|
18057
|
-
z-index:
|
|
18058
|
+
z-index: 1000;
|
|
18058
18059
|
transform: translateY(-50%);
|
|
18060
|
+
&:hover {
|
|
18061
|
+
z-index: 1001;
|
|
18062
|
+
}
|
|
18059
18063
|
&:hover ${StyledHover} {
|
|
18060
18064
|
display: block;
|
|
18061
18065
|
}
|
|
18062
18066
|
`;
|
|
18063
18067
|
|
|
18068
|
+
const withWidth = (url, w) => url.includes('?') ? `${url}&w=${w}` : `${url}?w=${w}`;
|
|
18064
18069
|
const ImagePreview = ({ previewUrl, type, decodedFileName }) => {
|
|
18065
18070
|
if (!(type === 'image' && previewUrl && decodedFileName))
|
|
18066
18071
|
return (null);
|
|
18067
|
-
|
|
18072
|
+
const isSvg = decodedFileName.toLowerCase().endsWith('.svg');
|
|
18073
|
+
const iconSrc = isSvg ? previewUrl : withWidth(previewUrl, 22);
|
|
18074
|
+
const hoverSrc = isSvg ? previewUrl : withWidth(previewUrl, 450);
|
|
18075
|
+
return (jsxRuntimeExports.jsxs(StyledImagePreviewWrapper, { "data-testid": 'fileuploader__preview-image', children: [jsxRuntimeExports.jsx(StyledIcon, { "data-testid": 'fileuploader__preview-image__icon', className: 'lazyload', src: iconSrc, "data-sizes": 'auto' }), jsxRuntimeExports.jsx(StyledHover, { className: 'lazyload', src: hoverSrc, "data-sizes": 'auto' })] }));
|
|
18068
18076
|
};
|
|
18069
18077
|
|
|
18070
18078
|
const StyledProgressbar = styled(StyledVisibilityContainerProgress) `
|