@dreamcommerce/aurora 2.8.1-28 → 2.8.1-29
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/image_picker/index.js +0 -10
- 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 +6 -1
- package/build/cjs/packages/aurora/src/components/xhr_image_picker/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/image_picker/index.js +0 -10
- 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 +7 -2
- package/build/esm/packages/aurora/src/components/xhr_image_picker/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -33,18 +33,8 @@ const ImagePicker = React.memo(({ id, onChange, onError, errors: initialErrors,
|
|
|
33
33
|
const inputRef = React.createRef();
|
|
34
34
|
console.log('ImagePicker');
|
|
35
35
|
console.log('ImagePicker', initialErrors);
|
|
36
|
-
const [errorsToDisplay, setErrorsToDisplay] = React.useState([]);
|
|
37
36
|
const [imageSize, setImageSize] = React.useState(undefined);
|
|
38
37
|
const { onDropFile, onFileChange, onDragOver, onDragLeave, onFileDelete, onPreviewError, file, errors, isPreview, isDragOver } = use_file_picker.useFilePicker({ initialFile, onChange, allowedExtensions, initialErrors, onError, inputRef });
|
|
39
|
-
React.useEffect(() => {
|
|
40
|
-
setErrorsToDisplay(errors);
|
|
41
|
-
}, [errors]);
|
|
42
|
-
React.useEffect(() => {
|
|
43
|
-
console.log('ImagePicker- initialErrors', initialErrors);
|
|
44
|
-
}, [initialErrors]);
|
|
45
|
-
React.useEffect(() => {
|
|
46
|
-
console.log('ImagePicker - errorsToDisplay', errorsToDisplay);
|
|
47
|
-
}, [errorsToDisplay]);
|
|
48
38
|
const acceptFiles = utils.getAcceptFilesParametersFromAllowedExtensions(allowedExtensions);
|
|
49
39
|
const imagePickerClassName = classnames__default['default'](main_module['default'][css_classes['default'].imagePicker], className && className);
|
|
50
40
|
const imagePickerWrapperClassName = classnames__default['default'](main_module['default'][css_classes['default'].imagePickerWrapper], file && main_module['default'][css_classes['default'].imagePickerWrapperHasFile], {
|
|
@@ -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;
|
|
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;"}
|
|
@@ -12,7 +12,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
12
12
|
|
|
13
13
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
14
|
|
|
15
|
-
const XhrImagePicker = ({ id, url, name, onUploaded, initialFile, errors, onError, onChange, onImageSizeUpdated, allowedExtensions = [
|
|
15
|
+
const XhrImagePicker = ({ id, url, name, onUploaded, initialFile, errors: initialErrors, onError, onChange, onImageSizeUpdated, allowedExtensions = [
|
|
16
16
|
constants.FILES_EXTENSIONS.WEBP,
|
|
17
17
|
constants.FILES_EXTENSIONS.JPG,
|
|
18
18
|
constants.FILES_EXTENSIONS.PNG,
|
|
@@ -20,8 +20,13 @@ const XhrImagePicker = ({ id, url, name, onUploaded, initialFile, errors, onErro
|
|
|
20
20
|
constants.FILES_EXTENSIONS.SVG,
|
|
21
21
|
constants.FILES_EXTENSIONS.JPEG
|
|
22
22
|
] }) => {
|
|
23
|
+
const [errors, setErrors] = React.useState([]);
|
|
23
24
|
const httpApi = use_http_api.useHttpApi();
|
|
24
25
|
const pendingRequestRef = React__default['default'].useRef();
|
|
26
|
+
React.useEffect(() => {
|
|
27
|
+
console.log('XhrImagePicker - initialErrors', initialErrors);
|
|
28
|
+
initialErrors && setErrors(initialErrors);
|
|
29
|
+
}, [initialErrors]);
|
|
25
30
|
const handleControlChange = async (fileList) => {
|
|
26
31
|
onChange === null || onChange === void 0 ? void 0 : onChange(fileList);
|
|
27
32
|
if (!fileList || !fileList.length)
|
|
@@ -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;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -24,18 +24,8 @@ const ImagePicker = memo(({ id, onChange, onError, errors: initialErrors, allowe
|
|
|
24
24
|
const inputRef = createRef();
|
|
25
25
|
console.log('ImagePicker');
|
|
26
26
|
console.log('ImagePicker', initialErrors);
|
|
27
|
-
const [errorsToDisplay, setErrorsToDisplay] = useState([]);
|
|
28
27
|
const [imageSize, setImageSize] = useState(undefined);
|
|
29
28
|
const { onDropFile, onFileChange, onDragOver, onDragLeave, onFileDelete, onPreviewError, file, errors, isPreview, isDragOver } = useFilePicker({ initialFile, onChange, allowedExtensions, initialErrors, onError, inputRef });
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
setErrorsToDisplay(errors);
|
|
32
|
-
}, [errors]);
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
console.log('ImagePicker- initialErrors', initialErrors);
|
|
35
|
-
}, [initialErrors]);
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
console.log('ImagePicker - errorsToDisplay', errorsToDisplay);
|
|
38
|
-
}, [errorsToDisplay]);
|
|
39
29
|
const acceptFiles = getAcceptFilesParametersFromAllowedExtensions(allowedExtensions);
|
|
40
30
|
const imagePickerClassName = classnames(styles[CSS_CLASSES.imagePicker], className && className);
|
|
41
31
|
const imagePickerWrapperClassName = classnames(styles[CSS_CLASSES.imagePickerWrapper], file && styles[CSS_CLASSES.imagePickerWrapperHasFile], {
|
|
@@ -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;
|
|
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;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React, { useEffect } from 'react';
|
|
1
|
+
import React, { useState, 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';
|
|
5
5
|
import { useHttpApi } from '../../hooks/use_http_api.js';
|
|
6
6
|
|
|
7
|
-
const XhrImagePicker = ({ id, url, name, onUploaded, initialFile, errors, onError, onChange, onImageSizeUpdated, allowedExtensions = [
|
|
7
|
+
const XhrImagePicker = ({ id, url, name, onUploaded, initialFile, errors: initialErrors, onError, onChange, onImageSizeUpdated, allowedExtensions = [
|
|
8
8
|
FILES_EXTENSIONS.WEBP,
|
|
9
9
|
FILES_EXTENSIONS.JPG,
|
|
10
10
|
FILES_EXTENSIONS.PNG,
|
|
@@ -12,8 +12,13 @@ const XhrImagePicker = ({ id, url, name, onUploaded, initialFile, errors, onErro
|
|
|
12
12
|
FILES_EXTENSIONS.SVG,
|
|
13
13
|
FILES_EXTENSIONS.JPEG
|
|
14
14
|
] }) => {
|
|
15
|
+
const [errors, setErrors] = useState([]);
|
|
15
16
|
const httpApi = useHttpApi();
|
|
16
17
|
const pendingRequestRef = React.useRef();
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
console.log('XhrImagePicker - initialErrors', initialErrors);
|
|
20
|
+
initialErrors && setErrors(initialErrors);
|
|
21
|
+
}, [initialErrors]);
|
|
17
22
|
const handleControlChange = async (fileList) => {
|
|
18
23
|
onChange === null || onChange === void 0 ? void 0 : onChange(fileList);
|
|
19
24
|
if (!fileList || !fileList.length)
|
|
@@ -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;AACA;AACA;AACA;AACA;AACA;"}
|