@dreamcommerce/aurora 2.8.12-20 → 2.8.12-22
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/build/cjs/packages/aurora/src/components/file_picker/use_file_picker.js +1 -1
- package/build/cjs/packages/aurora/src/components/image_picker/index.js +5 -2
- package/build/cjs/packages/aurora/src/components/image_picker/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/file_picker/use_file_picker.js +1 -1
- package/build/esm/packages/aurora/src/components/image_picker/index.js +5 -2
- package/build/esm/packages/aurora/src/components/image_picker/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -13,7 +13,6 @@ const useFilePicker = ({ onChange, initialFile, allowedExtensions, inputRef, ini
|
|
|
13
13
|
const [isPreview, setPreview] = React.useState(true);
|
|
14
14
|
React.useEffect(() => {
|
|
15
15
|
setFile(initialFile);
|
|
16
|
-
console.log('initialFile', initialFile);
|
|
17
16
|
}, [initialFile]);
|
|
18
17
|
React.useEffect(() => {
|
|
19
18
|
initialErrors && setErrors(initialErrors);
|
|
@@ -48,6 +47,7 @@ const useFilePicker = ({ onChange, initialFile, allowedExtensions, inputRef, ini
|
|
|
48
47
|
updateFile(files);
|
|
49
48
|
};
|
|
50
49
|
const updateFile = (files) => {
|
|
50
|
+
console.log('updateFile');
|
|
51
51
|
if (files === null || files === void 0 ? void 0 : files.length) {
|
|
52
52
|
setFile({
|
|
53
53
|
fileName: files === null || files === void 0 ? void 0 : files[0].name,
|
|
@@ -43,7 +43,7 @@ const ImagePicker = React.memo(({ id, onChange, onError, errors: initialErrors,
|
|
|
43
43
|
}, [imageSize]);
|
|
44
44
|
React.useEffect(() => {
|
|
45
45
|
initialFile && setImageSizeBasedOnUrl(initialFile === null || initialFile === void 0 ? void 0 : initialFile.fileUrl);
|
|
46
|
-
}, []);
|
|
46
|
+
}, [initialFile]);
|
|
47
47
|
const setImageSizeBasedOnUrl = (fileUrl) => {
|
|
48
48
|
createImageFromUrl(fileUrl).then((image) => {
|
|
49
49
|
setImageSize({ width: image.naturalWidth, height: image.naturalHeight });
|
|
@@ -92,7 +92,10 @@ const ImagePicker = React.memo(({ id, onChange, onError, errors: initialErrors,
|
|
|
92
92
|
React__default['default'].createElement("input", { onChange: handleOnFileChange, id: id, ref: inputRef, type: "file", name: name, className: main_module['default'][css_classes['default'].imagePickerInput], accept: acceptFiles })),
|
|
93
93
|
errors && React__default['default'].createElement(errors_list.ErrorsList, { errors: errors })));
|
|
94
94
|
}, (prev, curr) => {
|
|
95
|
-
|
|
95
|
+
var _a, _b, _c, _d;
|
|
96
|
+
return (((_a = prev.initialFile) === null || _a === void 0 ? void 0 : _a.fileUrl) === ((_b = curr.initialFile) === null || _b === void 0 ? void 0 : _b.fileUrl) &&
|
|
97
|
+
((_c = prev.initialFile) === null || _c === void 0 ? void 0 : _c.fileName) === ((_d = curr.initialFile) === null || _d === void 0 ? void 0 : _d.fileName) &&
|
|
98
|
+
prev.errors === curr.errors);
|
|
96
99
|
});
|
|
97
100
|
|
|
98
101
|
exports.default = ImagePicker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,6BAA6B,iEAAqE;AAClG,2BAA2B,yDAA6D;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,6BAA6B,iEAAqE;AAClG,2BAA2B,yDAA6D;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -9,7 +9,6 @@ const useFilePicker = ({ onChange, initialFile, allowedExtensions, inputRef, ini
|
|
|
9
9
|
const [isPreview, setPreview] = useState(true);
|
|
10
10
|
useEffect(() => {
|
|
11
11
|
setFile(initialFile);
|
|
12
|
-
console.log('initialFile', initialFile);
|
|
13
12
|
}, [initialFile]);
|
|
14
13
|
useEffect(() => {
|
|
15
14
|
initialErrors && setErrors(initialErrors);
|
|
@@ -44,6 +43,7 @@ const useFilePicker = ({ onChange, initialFile, allowedExtensions, inputRef, ini
|
|
|
44
43
|
updateFile(files);
|
|
45
44
|
};
|
|
46
45
|
const updateFile = (files) => {
|
|
46
|
+
console.log('updateFile');
|
|
47
47
|
if (files === null || files === void 0 ? void 0 : files.length) {
|
|
48
48
|
setFile({
|
|
49
49
|
fileName: files === null || files === void 0 ? void 0 : files[0].name,
|
|
@@ -34,7 +34,7 @@ const ImagePicker = memo(({ id, onChange, onError, errors: initialErrors, allowe
|
|
|
34
34
|
}, [imageSize]);
|
|
35
35
|
useEffect(() => {
|
|
36
36
|
initialFile && setImageSizeBasedOnUrl(initialFile === null || initialFile === void 0 ? void 0 : initialFile.fileUrl);
|
|
37
|
-
}, []);
|
|
37
|
+
}, [initialFile]);
|
|
38
38
|
const setImageSizeBasedOnUrl = (fileUrl) => {
|
|
39
39
|
createImageFromUrl(fileUrl).then((image) => {
|
|
40
40
|
setImageSize({ width: image.naturalWidth, height: image.naturalHeight });
|
|
@@ -83,7 +83,10 @@ const ImagePicker = memo(({ id, onChange, onError, errors: initialErrors, allowe
|
|
|
83
83
|
React.createElement("input", { onChange: handleOnFileChange, id: id, ref: inputRef, type: "file", name: name, className: styles[CSS_CLASSES.imagePickerInput], accept: acceptFiles })),
|
|
84
84
|
errors && React.createElement(ErrorsList, { errors: errors })));
|
|
85
85
|
}, (prev, curr) => {
|
|
86
|
-
|
|
86
|
+
var _a, _b, _c, _d;
|
|
87
|
+
return (((_a = prev.initialFile) === null || _a === void 0 ? void 0 : _a.fileUrl) === ((_b = curr.initialFile) === null || _b === void 0 ? void 0 : _b.fileUrl) &&
|
|
88
|
+
((_c = prev.initialFile) === null || _c === void 0 ? void 0 : _c.fileName) === ((_d = curr.initialFile) === null || _d === void 0 ? void 0 : _d.fileName) &&
|
|
89
|
+
prev.errors === curr.errors);
|
|
87
90
|
});
|
|
88
91
|
|
|
89
92
|
export default ImagePicker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA,+BAA+B,iEAAqE;AACpG,gCAAgC,yDAA6D;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,+BAA+B,iEAAqE;AACpG,gCAAgC,yDAA6D;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|