@dreamcommerce/aurora 2.8.1-10 → 2.8.1-11

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.
@@ -8,17 +8,17 @@ var constants = require('./constants.js');
8
8
 
9
9
  const useFilePicker = ({ onChange, initialFile, allowedExtensions, inputRef, initialErrors, onError }) => {
10
10
  const [file, setFile] = React.useState(initialFile);
11
- const [errors, setErrors] = React.useState([]);
11
+ const [errors, setErrors] = React.useState(initialErrors !== null && initialErrors !== void 0 ? initialErrors : []);
12
12
  const [isDragOver, setDragOver] = React.useState(false);
13
13
  const [isPreview, setPreview] = React.useState(true);
14
14
  console.log('useFilePicker', initialErrors);
15
- console.log('useFilePicker 2', errors);
16
15
  React.useEffect(() => {
17
- initialErrors && setErrors(initialErrors);
18
16
  setFile(initialFile);
19
- }, [initialFile, initialErrors]);
17
+ }, [initialFile]);
18
+ React.useEffect(() => {
19
+ console.log('useFilePicker 2', errors);
20
+ }, [errors]);
20
21
  const onDropFile = (event) => {
21
- console.log('onDropFile');
22
22
  setErrors([]);
23
23
  event.stopPropagation();
24
24
  event.preventDefault();
@@ -36,7 +36,6 @@ const useFilePicker = ({ onChange, initialFile, allowedExtensions, inputRef, ini
36
36
  return acc ? acc : constants.MIME_TYPE_TO_FILE_EXTENSIONS[mimeType] === extension;
37
37
  }, false);
38
38
  if (isValid) {
39
- console.log('isValid');
40
39
  setErrors([]);
41
40
  return isValid;
42
41
  }
@@ -45,7 +44,6 @@ const useFilePicker = ({ onChange, initialFile, allowedExtensions, inputRef, ini
45
44
  return isValid;
46
45
  };
47
46
  const onFileChange = ({ target: { files } }) => {
48
- console.log('onFileChange');
49
47
  setErrors([]);
50
48
  updateFile(files);
51
49
  };
@@ -78,7 +76,6 @@ const useFilePicker = ({ onChange, initialFile, allowedExtensions, inputRef, ini
78
76
  };
79
77
  const onFileDelete = () => {
80
78
  inputRef.current.value = '';
81
- console.log('onFileDelete');
82
79
  setFile(undefined);
83
80
  setPreview(true);
84
81
  setErrors([]);
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -4,17 +4,17 @@ import { MIME_TYPE_TO_FILE_EXTENSIONS, FILE_PICKER_ERROR } from './constants.js'
4
4
 
5
5
  const useFilePicker = ({ onChange, initialFile, allowedExtensions, inputRef, initialErrors, onError }) => {
6
6
  const [file, setFile] = useState(initialFile);
7
- const [errors, setErrors] = useState([]);
7
+ const [errors, setErrors] = useState(initialErrors !== null && initialErrors !== void 0 ? initialErrors : []);
8
8
  const [isDragOver, setDragOver] = useState(false);
9
9
  const [isPreview, setPreview] = useState(true);
10
10
  console.log('useFilePicker', initialErrors);
11
- console.log('useFilePicker 2', errors);
12
11
  useEffect(() => {
13
- initialErrors && setErrors(initialErrors);
14
12
  setFile(initialFile);
15
- }, [initialFile, initialErrors]);
13
+ }, [initialFile]);
14
+ useEffect(() => {
15
+ console.log('useFilePicker 2', errors);
16
+ }, [errors]);
16
17
  const onDropFile = (event) => {
17
- console.log('onDropFile');
18
18
  setErrors([]);
19
19
  event.stopPropagation();
20
20
  event.preventDefault();
@@ -32,7 +32,6 @@ const useFilePicker = ({ onChange, initialFile, allowedExtensions, inputRef, ini
32
32
  return acc ? acc : MIME_TYPE_TO_FILE_EXTENSIONS[mimeType] === extension;
33
33
  }, false);
34
34
  if (isValid) {
35
- console.log('isValid');
36
35
  setErrors([]);
37
36
  return isValid;
38
37
  }
@@ -41,7 +40,6 @@ const useFilePicker = ({ onChange, initialFile, allowedExtensions, inputRef, ini
41
40
  return isValid;
42
41
  };
43
42
  const onFileChange = ({ target: { files } }) => {
44
- console.log('onFileChange');
45
43
  setErrors([]);
46
44
  updateFile(files);
47
45
  };
@@ -74,7 +72,6 @@ const useFilePicker = ({ onChange, initialFile, allowedExtensions, inputRef, ini
74
72
  };
75
73
  const onFileDelete = () => {
76
74
  inputRef.current.value = '';
77
- console.log('onFileDelete');
78
75
  setFile(undefined);
79
76
  setPreview(true);
80
77
  setErrors([]);
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@dreamcommerce/aurora",
3
3
  "packageManager": "yarn@3.2.0",
4
4
  "sideEffects": false,
5
- "version": "2.8.1-10",
5
+ "version": "2.8.1-11",
6
6
  "description": "aurora",
7
7
  "author": "k0ssak",
8
8
  "license": "MIT",