monica-alexandria 3.72.1 → 3.72.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/dist/index.es.js
CHANGED
|
@@ -2964,7 +2964,7 @@ object-assign
|
|
|
2964
2964
|
fill: var(--mainLight);
|
|
2965
2965
|
}
|
|
2966
2966
|
}
|
|
2967
|
-
`;function Ud(n){const[r,o]=t(n.files),i=(e,t)=>{n.boomRejected(e,t)},{getRootProps:
|
|
2967
|
+
`;function Ud(n){const[r,o]=t(n.files),i=(e,t)=>{n.boomRejected(e,t)},{getRootProps:l,getInputProps:s,isDragActive:u,isDragAccept:d,isDragReject:m}=Hd({accept:n.accept?n.accept:"image/svg, image/jpeg, image/png, image/jpg, video/mp4, video/mpeg, video/webm",onDrop:c((e=>{const t=e.map((e=>{const t=e.name.split(".").pop(),r=n.userId?`${n.userId}.${t}`:e.name;return{...e,preview:URL.createObjectURL(e),name:r,lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,type:e.type,webkitRelativePath:e.webkitRelativePath}}));let r=[];t.forEach((e=>{"video"===n.type&&e.size>n.maxSize?i("videoSize",e.name):n.accept&&""!==n.accept&&!n.accept?.split(",")?.map((e=>e?.trim()))?.includes(e.type)||"image/png"!==e?.type&&"image/jpeg"!==e?.type&&"video/mp4"!==e?.type&&"video/mpeg"!==e?.type&&"image/webm"!==e?.type?i("fileMimetype",e.name):e.size>n.maxSize?i("fileSize",e?.name):r.push(e)})),r?.length>0&&o(r)}),[n.userId,n.accept,n.maxSize,n.type,i]),onDropRejected:()=>{"video"===n.type?i("videoType",""):"avatar"===n.type||"cover"===n.type?i("imageType",""):"media"===n.type&&i("mediaType","")},maxFiles:n.maxFiles});return a((()=>{n.getFilesFromChild(r)}),[r]),e.createElement(Gd,Bu({className:"Upload",noPadding:n.noPadding},l({isDragActive:u,isDragAccept:d,isDragReject:m})),e.createElement(y,{Icon:n.iconUpload?n.iconUpload:"Upload"}),e.createElement("span",null,n.text),e.createElement("input",s()))}const qd=m.div`
|
|
2968
2968
|
background: ${e=>e.theme.low};
|
|
2969
2969
|
padding: var(--largePads);
|
|
2970
2970
|
border-radius: var(--normalRadius);
|
package/dist/index.js
CHANGED
|
@@ -2964,7 +2964,7 @@ object-assign
|
|
|
2964
2964
|
fill: var(--mainLight);
|
|
2965
2965
|
}
|
|
2966
2966
|
}
|
|
2967
|
-
`;function Fs(t){const[n,r]=e.useState(t.files),o=(e,n)=>{t.boomRejected(e,n)},{getRootProps:i,getInputProps:l,isDragActive:u,isDragAccept:s,isDragReject:d}=Ns({accept:t.accept?t.accept:"image/svg, image/jpeg, image/png, image/jpg, video/mp4, video/mpeg, video/webm",onDrop:useCallback((e=>{const n=e.map((e=>{const n=e.name.split(".").pop(),r=t.userId?`${t.userId}.${n}`:e.name;return{...e,preview:URL.createObjectURL(e),name:r,lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,type:e.type,webkitRelativePath:e.webkitRelativePath}}));let a=[];n.forEach((e=>{"video"===t.type&&e.size>t.maxSize?o("videoSize",e.name):t.accept&&""!==t.accept&&!t.accept
|
|
2967
|
+
`;function Fs(t){const[n,r]=e.useState(t.files),o=(e,n)=>{t.boomRejected(e,n)},{getRootProps:i,getInputProps:l,isDragActive:u,isDragAccept:s,isDragReject:d}=Ns({accept:t.accept?t.accept:"image/svg, image/jpeg, image/png, image/jpg, video/mp4, video/mpeg, video/webm",onDrop:e.useCallback((e=>{const n=e.map((e=>{const n=e.name.split(".").pop(),r=t.userId?`${t.userId}.${n}`:e.name;return{...e,preview:URL.createObjectURL(e),name:r,lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,type:e.type,webkitRelativePath:e.webkitRelativePath}}));let a=[];n.forEach((e=>{"video"===t.type&&e.size>t.maxSize?o("videoSize",e.name):t.accept&&""!==t.accept&&!t.accept?.split(",")?.map((e=>e?.trim()))?.includes(e.type)||"image/png"!==e?.type&&"image/jpeg"!==e?.type&&"video/mp4"!==e?.type&&"video/mpeg"!==e?.type&&"image/webm"!==e?.type?o("fileMimetype",e.name):e.size>t.maxSize?o("fileSize",e?.name):a.push(e)})),a?.length>0&&r(a)}),[t.userId,t.accept,t.maxSize,t.type,o]),onDropRejected:()=>{"video"===t.type?o("videoType",""):"avatar"===t.type||"cover"===t.type?o("imageType",""):"media"===t.type&&o("mediaType","")},maxFiles:t.maxFiles});return e.useEffect((()=>{t.getFilesFromChild(n)}),[n]),a.default.createElement(Ps,Tu({className:"Upload",noPadding:t.noPadding},i({isDragActive:u,isDragAccept:s,isDragReject:d})),a.default.createElement(c,{Icon:t.iconUpload?t.iconUpload:"Upload"}),a.default.createElement("span",null,t.text),a.default.createElement("input",l()))}const zs=o.default.div`
|
|
2968
2968
|
background: ${e=>e.theme.low};
|
|
2969
2969
|
padding: var(--largePads);
|
|
2970
2970
|
border-radius: var(--normalRadius);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monica-alexandria",
|
|
3
|
-
"version": "3.72.
|
|
3
|
+
"version": "3.72.2",
|
|
4
4
|
"description": "A styled-components styles library for Doitforme platorm and universal tweeks to create your own new styled library for your project",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useDropzone } from "react-dropzone";
|
|
2
|
-
import React, { useEffect, useState } from "react";
|
|
2
|
+
import React, { useCallback, useEffect, useState } from "react";
|
|
3
3
|
import styled from "styled-components";
|
|
4
4
|
import { IconSvg } from "../../svg/IconSvg";
|
|
5
5
|
import { Button } from "../../helpers/Button";
|
|
@@ -72,21 +72,21 @@ export default function Upload_(props) {
|
|
|
72
72
|
} else if (
|
|
73
73
|
props.accept &&
|
|
74
74
|
props.accept !== "" &&
|
|
75
|
-
!props.accept
|
|
75
|
+
!props.accept?.split(',')?.map(type => type?.trim())?.includes(file.type)
|
|
76
76
|
) {
|
|
77
77
|
boomRejected("fileMimetype", file.name);
|
|
78
78
|
}
|
|
79
79
|
else if (
|
|
80
|
-
file
|
|
81
|
-
file
|
|
82
|
-
file
|
|
83
|
-
file
|
|
84
|
-
file
|
|
80
|
+
file?.type !== "image/png" &&
|
|
81
|
+
file?.type !== "image/jpeg" &&
|
|
82
|
+
file?.type !== "video/mp4" &&
|
|
83
|
+
file?.type !== "video/mpeg" &&
|
|
84
|
+
file?.type !== "image/webm"
|
|
85
85
|
) {
|
|
86
86
|
boomRejected("fileMimetype", file.name);
|
|
87
87
|
}
|
|
88
88
|
else if (file.size > props.maxSize) {
|
|
89
|
-
boomRejected("fileSize", file
|
|
89
|
+
boomRejected("fileSize", file?.name);
|
|
90
90
|
} else {
|
|
91
91
|
tempFiles.push(file);
|
|
92
92
|
}
|