@dreamcommerce/aurora 2.8.1-24 → 2.8.1-25
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/xhr_image_picker/index.js +5 -1
- package/build/cjs/packages/aurora/src/components/xhr_image_picker/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/xhr_image_picker/index.js +6 -2
- package/build/esm/packages/aurora/src/components/xhr_image_picker/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -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,12 @@ 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
|
+
initialErrors && setErrors(initialErrors);
|
|
28
|
+
}, [initialErrors]);
|
|
25
29
|
const handleControlChange = async (fileList) => {
|
|
26
30
|
onChange === null || onChange === void 0 ? void 0 : onChange(fileList);
|
|
27
31
|
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;"}
|
|
@@ -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,12 @@ 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
|
+
initialErrors && setErrors(initialErrors);
|
|
20
|
+
}, [initialErrors]);
|
|
17
21
|
const handleControlChange = async (fileList) => {
|
|
18
22
|
onChange === null || onChange === void 0 ? void 0 : onChange(fileList);
|
|
19
23
|
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;"}
|