expo-image-picker
Advanced tools
Comparing version 10.1.1 to 10.1.2
import { PermissionResponse } from 'unimodules-permissions-interface'; | ||
import { ImagePickerResult, MediaTypeOptions, ImagePickerMultipleResult } from './ImagePicker.types'; | ||
import { ImagePickerMultipleResult, ImagePickerResult, MediaTypeOptions } from './ImagePicker.types'; | ||
declare const _default: { | ||
@@ -4,0 +4,0 @@ readonly name: string; |
@@ -0,1 +1,2 @@ | ||
import { Platform } from '@unimodules/core'; | ||
import { PermissionStatus } from 'unimodules-permissions-interface'; | ||
@@ -14,2 +15,6 @@ import { v4 } from 'uuid'; | ||
async launchImageLibraryAsync({ mediaTypes = MediaTypeOptions.Images, allowsMultipleSelection = false, }) { | ||
// SSR guard | ||
if (!Platform.isDOMAvailable) { | ||
return { cancelled: true }; | ||
} | ||
return await openFileBrowserAsync({ | ||
@@ -21,2 +26,6 @@ mediaTypes, | ||
async launchCameraAsync({ mediaTypes = MediaTypeOptions.Images, allowsMultipleSelection = false, }) { | ||
// SSR guard | ||
if (!Platform.isDOMAvailable) { | ||
return { cancelled: true }; | ||
} | ||
return await openFileBrowserAsync({ | ||
@@ -90,8 +99,2 @@ mediaTypes, | ||
}); | ||
document.body.onfocus = () => { | ||
if (!input.value.length) { | ||
resolve({ cancelled: true }); | ||
document.body.onfocus = null; | ||
} | ||
}; | ||
const event = new MouseEvent('click'); | ||
@@ -98,0 +101,0 @@ input.dispatchEvent(event); |
@@ -11,2 +11,9 @@ # Changelog | ||
## 10.1.2 — 2021-04-09 | ||
### 🐛 Bug fixes | ||
- Added SSR guard. ([#12420](https://github.com/expo/expo/pull/12420) by [@EvanBacon](https://github.com/EvanBacon)) | ||
- Reverted focus state listener PR. ([#12420](https://github.com/expo/expo/pull/12420) by [@EvanBacon](https://github.com/EvanBacon)) | ||
## 10.1.1 — 2021-03-31 | ||
@@ -13,0 +20,0 @@ |
{ | ||
"name": "expo-image-picker", | ||
"version": "10.1.1", | ||
"version": "10.1.2", | ||
"description": "Provides access to the system's UI for selecting images and videos from the phone's library or taking a photo with the camera.", | ||
@@ -51,3 +51,3 @@ "main": "build/ImagePicker.js", | ||
}, | ||
"gitHead": "1e83e224c24d9fa33e1f7adc0b9c8c0b89fe27b5" | ||
"gitHead": "ef873567599c2604c2d255c85ec91d910667b892" | ||
} |
@@ -0,1 +1,2 @@ | ||
import { Platform } from '@unimodules/core'; | ||
import { PermissionResponse, PermissionStatus } from 'unimodules-permissions-interface'; | ||
@@ -5,8 +6,8 @@ import { v4 } from 'uuid'; | ||
import { | ||
ExpandImagePickerResult, | ||
ImageInfo, | ||
ImagePickerMultipleResult, | ||
ImagePickerResult, | ||
MediaTypeOptions, | ||
OpenFileBrowserOptions, | ||
ImagePickerMultipleResult, | ||
ImageInfo, | ||
ExpandImagePickerResult, | ||
} from './ImagePicker.types'; | ||
@@ -29,2 +30,6 @@ | ||
}): Promise<ImagePickerResult | ImagePickerMultipleResult> { | ||
// SSR guard | ||
if (!Platform.isDOMAvailable) { | ||
return { cancelled: true }; | ||
} | ||
return await openFileBrowserAsync({ | ||
@@ -40,2 +45,6 @@ mediaTypes, | ||
}): Promise<ImagePickerResult | ImagePickerMultipleResult> { | ||
// SSR guard | ||
if (!Platform.isDOMAvailable) { | ||
return { cancelled: true }; | ||
} | ||
return await openFileBrowserAsync({ | ||
@@ -119,9 +128,2 @@ mediaTypes, | ||
document.body.onfocus = () => { | ||
if (!input.value.length) { | ||
resolve({ cancelled: true } as ExpandImagePickerResult<T>); | ||
document.body.onfocus = null; | ||
} | ||
}; | ||
const event = new MouseEvent('click'); | ||
@@ -128,0 +130,0 @@ input.dispatchEvent(event); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
144239
864