@dreamcommerce/aurora 2.10.5-11 → 2.10.5-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/build/cjs/packages/aurora/src/components/file_picker/use_file_picker.js +2 -2
- package/build/cjs/packages/aurora/src/components/image_picker/index.js +1 -3
- package/build/cjs/packages/aurora/src/components/image_picker/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/xhr_image_picker/index.js +1 -5
- package/build/cjs/packages/aurora/src/components/xhr_image_picker/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/file_picker/use_file_picker.js +2 -2
- package/build/esm/packages/aurora/src/components/image_picker/index.js +1 -3
- package/build/esm/packages/aurora/src/components/image_picker/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/xhr_image_picker/index.js +2 -6
- package/build/esm/packages/aurora/src/components/xhr_image_picker/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -20,8 +20,8 @@ const useFilePicker = ({ onChange, initialFile, allowedExtensions, inputRef, ini
|
|
|
20
20
|
return () => reader.current.removeEventListener('load', () => getDataUrlFromFile(reader.current.result));
|
|
21
21
|
}, []);
|
|
22
22
|
React.useEffect(() => {
|
|
23
|
-
setFile(initialFile);
|
|
24
|
-
}, [initialFile]);
|
|
23
|
+
!file && setFile(initialFile);
|
|
24
|
+
}, [file, initialFile]);
|
|
25
25
|
React.useEffect(() => {
|
|
26
26
|
initialErrors && setErrors(initialErrors);
|
|
27
27
|
}, [initialErrors]);
|
|
@@ -42,11 +42,9 @@ const ImagePicker = React.memo(({ id, onChange, onError, errors: initialErrors,
|
|
|
42
42
|
onImageSizeUpdated === null || onImageSizeUpdated === void 0 ? void 0 : onImageSizeUpdated(imageSize);
|
|
43
43
|
}, [imageSize]);
|
|
44
44
|
React.useEffect(() => {
|
|
45
|
-
console.log('useEffect - initialFile', initialFile);
|
|
46
45
|
initialFile && setImageSizeBasedOnUrl(initialFile === null || initialFile === void 0 ? void 0 : initialFile.fileUrl);
|
|
47
|
-
}, [
|
|
46
|
+
}, []);
|
|
48
47
|
const setImageSizeBasedOnUrl = (fileUrl) => {
|
|
49
|
-
console.log('setImageSizeBasedOnUrl - initialFile', initialFile);
|
|
50
48
|
createImageFromUrl(fileUrl).then((image) => {
|
|
51
49
|
setImageSize({ width: image.naturalWidth, height: image.naturalHeight });
|
|
52
50
|
});
|
|
@@ -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;"}
|
|
@@ -22,7 +22,6 @@ const XhrImagePicker = ({ id, url, name, onUploaded, initialFile, errors, onErro
|
|
|
22
22
|
] }) => {
|
|
23
23
|
const httpApi = use_http_api.useHttpApi();
|
|
24
24
|
const pendingRequestRef = React__default['default'].useRef();
|
|
25
|
-
const initialImageFile = React.useRef();
|
|
26
25
|
const handleControlChange = async (file) => {
|
|
27
26
|
const { fileList, fileAsDataUrl } = file;
|
|
28
27
|
onChange === null || onChange === void 0 ? void 0 : onChange({ fileList, fileAsDataUrl });
|
|
@@ -42,12 +41,9 @@ const XhrImagePicker = ({ id, url, name, onUploaded, initialFile, errors, onErro
|
|
|
42
41
|
onUploaded === null || onUploaded === void 0 ? void 0 : onUploaded(data, fileList[0]);
|
|
43
42
|
};
|
|
44
43
|
React.useEffect(() => {
|
|
45
|
-
initialImageFile.current = initialFile;
|
|
46
|
-
console.log('XhrImagePicker - initialFile', initialFile);
|
|
47
|
-
console.log('XhrImagePicker - initialImageFile.current', initialImageFile.current);
|
|
48
44
|
return () => { var _a; return (_a = pendingRequestRef.current) === null || _a === void 0 ? void 0 : _a.call(pendingRequestRef); };
|
|
49
45
|
}, []);
|
|
50
|
-
return (React__default['default'].createElement(index['default'], { id: id, name: name, onChange: handleControlChange, onError: onError, errors: errors, allowedExtensions: allowedExtensions, initialFile:
|
|
46
|
+
return (React__default['default'].createElement(index['default'], { id: id, name: name, onChange: handleControlChange, onError: onError, errors: errors, allowedExtensions: allowedExtensions, initialFile: initialFile, onImageSizeUpdated: onImageSizeUpdated }));
|
|
51
47
|
};
|
|
52
48
|
|
|
53
49
|
exports.default = XhrImagePicker;
|
|
@@ -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;
|
|
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;"}
|
|
@@ -16,8 +16,8 @@ const useFilePicker = ({ onChange, initialFile, allowedExtensions, inputRef, ini
|
|
|
16
16
|
return () => reader.current.removeEventListener('load', () => getDataUrlFromFile(reader.current.result));
|
|
17
17
|
}, []);
|
|
18
18
|
useEffect(() => {
|
|
19
|
-
setFile(initialFile);
|
|
20
|
-
}, [initialFile]);
|
|
19
|
+
!file && setFile(initialFile);
|
|
20
|
+
}, [file, initialFile]);
|
|
21
21
|
useEffect(() => {
|
|
22
22
|
initialErrors && setErrors(initialErrors);
|
|
23
23
|
}, [initialErrors]);
|
|
@@ -33,11 +33,9 @@ const ImagePicker = memo(({ id, onChange, onError, errors: initialErrors, allowe
|
|
|
33
33
|
onImageSizeUpdated === null || onImageSizeUpdated === void 0 ? void 0 : onImageSizeUpdated(imageSize);
|
|
34
34
|
}, [imageSize]);
|
|
35
35
|
useEffect(() => {
|
|
36
|
-
console.log('useEffect - initialFile', initialFile);
|
|
37
36
|
initialFile && setImageSizeBasedOnUrl(initialFile === null || initialFile === void 0 ? void 0 : initialFile.fileUrl);
|
|
38
|
-
}, [
|
|
37
|
+
}, []);
|
|
39
38
|
const setImageSizeBasedOnUrl = (fileUrl) => {
|
|
40
|
-
console.log('setImageSizeBasedOnUrl - initialFile', initialFile);
|
|
41
39
|
createImageFromUrl(fileUrl).then((image) => {
|
|
42
40
|
setImageSize({ width: image.naturalWidth, height: image.naturalHeight });
|
|
43
41
|
});
|
|
@@ -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;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
2
|
import { FILES_EXTENSIONS } from '../file_picker/constants.js';
|
|
3
3
|
import { REQUEST_TYPES } from '../../../../star_core/build/esm/packages/star_core/src/features/http_requester/http_requester_contants.js';
|
|
4
4
|
import ImagePicker from '../image_picker/index.js';
|
|
@@ -14,7 +14,6 @@ const XhrImagePicker = ({ id, url, name, onUploaded, initialFile, errors, onErro
|
|
|
14
14
|
] }) => {
|
|
15
15
|
const httpApi = useHttpApi();
|
|
16
16
|
const pendingRequestRef = React.useRef();
|
|
17
|
-
const initialImageFile = useRef();
|
|
18
17
|
const handleControlChange = async (file) => {
|
|
19
18
|
const { fileList, fileAsDataUrl } = file;
|
|
20
19
|
onChange === null || onChange === void 0 ? void 0 : onChange({ fileList, fileAsDataUrl });
|
|
@@ -34,12 +33,9 @@ const XhrImagePicker = ({ id, url, name, onUploaded, initialFile, errors, onErro
|
|
|
34
33
|
onUploaded === null || onUploaded === void 0 ? void 0 : onUploaded(data, fileList[0]);
|
|
35
34
|
};
|
|
36
35
|
useEffect(() => {
|
|
37
|
-
initialImageFile.current = initialFile;
|
|
38
|
-
console.log('XhrImagePicker - initialFile', initialFile);
|
|
39
|
-
console.log('XhrImagePicker - initialImageFile.current', initialImageFile.current);
|
|
40
36
|
return () => { var _a; return (_a = pendingRequestRef.current) === null || _a === void 0 ? void 0 : _a.call(pendingRequestRef); };
|
|
41
37
|
}, []);
|
|
42
|
-
return (React.createElement(ImagePicker, { id: id, name: name, onChange: handleControlChange, onError: onError, errors: errors, allowedExtensions: allowedExtensions, initialFile:
|
|
38
|
+
return (React.createElement(ImagePicker, { id: id, name: name, onChange: handleControlChange, onError: onError, errors: errors, allowedExtensions: allowedExtensions, initialFile: initialFile, onImageSizeUpdated: onImageSizeUpdated }));
|
|
43
39
|
};
|
|
44
40
|
|
|
45
41
|
export default XhrImagePicker;
|
|
@@ -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;
|
|
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;"}
|