@s-ui/react-molecule-photo-uploader
Advanced tools
Comparing version 1.28.0 to 2.0.0
# CHANGELOG | ||
# 2.0.0 (2021-06-14) | ||
### Features | ||
* **components/molecule/photoUploader:** fix forgotten url in formatToBase64 and follow contract on ([843ec93](https://github.com/SUI-Components/sui-components/commit/843ec932dd632a9335ebafea439da13ee3b37491)) | ||
* **components/molecule/photoUploader:** restore the way how is returning newFiles ([a9d974b](https://github.com/SUI-Components/sui-components/commit/a9d974b16cfd2aece0410b9434b423cd22eba208)) | ||
* **components/molecule/photoUploader:** treat initialPhotos as an object and extract it an id ([7eccaad](https://github.com/SUI-Components/sui-components/commit/7eccaad5e3d101e615800a034b3b1b682caed8ae)) | ||
# 1.28.0 (2021-06-03) | ||
@@ -4,0 +15,0 @@ |
@@ -220,5 +220,5 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; | ||
setIsLoading = _ref5.setIsLoading; | ||
var filesWithBase64 = initialPhotos.map(function (url) { | ||
var filesWithBase64 = initialPhotos.map(function (item) { | ||
return formatToBase64({ | ||
url: url, | ||
item: item, | ||
options: defaultFormatToBase64Options | ||
@@ -233,3 +233,4 @@ }); | ||
_ref6$hasErrors = _ref6.hasErrors, | ||
hasErrors = _ref6$hasErrors === void 0 ? DEFAULT_HAS_ERRORS_STATUS : _ref6$hasErrors; | ||
hasErrors = _ref6$hasErrors === void 0 ? DEFAULT_HAS_ERRORS_STATUS : _ref6$hasErrors, | ||
id = _ref6.id; | ||
return { | ||
@@ -243,3 +244,4 @@ blob: blob, | ||
isNew: false, | ||
isModified: false | ||
isModified: false, | ||
id: id | ||
}; | ||
@@ -246,0 +248,0 @@ }); |
@@ -132,3 +132,4 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
file = currentFile.file, | ||
preview = currentFile.preview; | ||
preview = currentFile.preview, | ||
id = currentFile.id; | ||
array.push({ | ||
@@ -141,3 +142,4 @@ blob: blob, | ||
file: file, | ||
previewUrl: preview | ||
previewUrl: preview, | ||
id: id | ||
}); | ||
@@ -144,0 +146,0 @@ return [].concat(array); |
@@ -115,3 +115,3 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; | ||
formatToBase64({ | ||
url: photoToRetry.url, | ||
item: photoToRetry, | ||
options: defaultFormatToBase64Options | ||
@@ -118,0 +118,0 @@ }).then(function (_ref4) { |
@@ -5,3 +5,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
var file = _ref.file, | ||
url = _ref.url, | ||
item = _ref.item, | ||
_ref$options = _ref.options, | ||
@@ -66,2 +66,4 @@ options = _ref$options === void 0 ? FORM_IMAGE_UPLOADER_DEFAULT_FORMAT_TO_BASE_64_OPTIONS : _ref$options; | ||
} else { | ||
var url = item.url, | ||
id = item.id; | ||
return new Promise(function (resolve, reject) { | ||
@@ -78,3 +80,4 @@ cropAndRotateImage(_extends({ | ||
blob: blob, | ||
croppedBase64: base64 | ||
croppedBase64: base64, | ||
id: id | ||
}); | ||
@@ -84,2 +87,3 @@ })["catch"](function (e) { | ||
url: url, | ||
id: id, | ||
hasErrors: true | ||
@@ -86,0 +90,0 @@ }); |
{ | ||
"name": "@s-ui/react-molecule-photo-uploader", | ||
"version": "1.28.0", | ||
"version": "2.0.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -15,2 +15,4 @@ # MoleculePhotoUploader | ||
> `id` (String) you could pass an id to identify each image that was initially passed | ||
> `isNew` (Boolean) if it's a new uploaded image, will be true, if not, will be false and it will have an `url`. | ||
@@ -72,3 +74,3 @@ | ||
callbackPhotosUploaded={acceptedPhotos => console.log(acceptedPhotos)} | ||
callbackUploadPhoto= {(file,oldUrl) => console.log(file,oldUrl)} | ||
callbackUploadPhoto={(file, oldUrl) => console.log(file, oldUrl)} | ||
limitPhotosUploadedText={_limitPhotosUploaded} | ||
@@ -80,4 +82,4 @@ limitPhotosUploadedNotification={_limitPhotosUploadedNotification} | ||
initialPhotos={[ | ||
'https://images.net/image1.jpg', | ||
'https://images.net/image2.jpg' | ||
{url: 'https://images.net/image1.jpg', id: '6c7ee3d8-97db-4142-8520-5136fccfc40b'}, | ||
{url: 'https://images.net/image2.jpg}' | ||
]} | ||
@@ -84,0 +86,0 @@ /> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87
79824
14
1235