expo-image-picker
Advanced tools
Comparing version 10.2.3 to 11.0.0
@@ -1,2 +0,2 @@ | ||
declare const _default: import("@unimodules/core").ProxyNativeModule; | ||
declare const _default: import("expo-modules-core").ProxyNativeModule; | ||
export default _default; |
@@ -1,3 +0,3 @@ | ||
import { NativeModulesProxy } from '@unimodules/core'; | ||
import { NativeModulesProxy } from 'expo-modules-core'; | ||
export default NativeModulesProxy.ExponentImagePicker; | ||
//# sourceMappingURL=ExponentImagePicker.js.map |
@@ -1,3 +0,2 @@ | ||
import { Platform } from '@unimodules/core'; | ||
import { PermissionStatus } from 'expo-modules-core'; | ||
import { PermissionStatus, Platform } from 'expo-modules-core'; | ||
import { v4 } from 'uuid'; | ||
@@ -90,3 +89,3 @@ import { MediaTypeOptions, } from './ImagePicker.types'; | ||
else { | ||
const imgs = await Promise.all(Array.from(input.files).map(file => readFile(file, { base64 }))); | ||
const imgs = await Promise.all(Array.from(input.files).map((file) => readFile(file, { base64 }))); | ||
resolve({ | ||
@@ -93,0 +92,0 @@ cancelled: false, |
@@ -1,2 +0,2 @@ | ||
import { PermissionStatus, PermissionExpiration } from 'expo-modules-core'; | ||
import { PermissionStatus, PermissionExpiration, PermissionHookOptions } from 'expo-modules-core'; | ||
import { CameraPermissionResponse, CameraRollPermissionResponse, MediaLibraryPermissionResponse, ImagePickerResult, ImagePickerErrorResult, MediaTypeOptions, ImagePickerOptions, VideoExportPreset, ExpandImagePickerResult } from './ImagePicker.types'; | ||
@@ -15,5 +15,27 @@ export declare function getCameraPermissionsAsync(): Promise<CameraPermissionResponse>; | ||
export declare function requestMediaLibraryPermissionsAsync(writeOnly?: boolean): Promise<MediaLibraryPermissionResponse>; | ||
/** | ||
* Check or request permissions to access the media library. | ||
* This uses both `requestMediaLibraryPermissionsAsync` and `getMediaLibraryPermissionsAsync` to interact with the permissions. | ||
* | ||
* @example | ||
* ```ts | ||
* const [status, requestPermission] = ImagePicker.useMediaLibraryPermissions(); | ||
* ``` | ||
*/ | ||
export declare const useMediaLibraryPermissions: (options?: PermissionHookOptions<{ | ||
writeOnly?: boolean | undefined; | ||
}> | undefined) => [MediaLibraryPermissionResponse | null, () => Promise<MediaLibraryPermissionResponse>, () => Promise<MediaLibraryPermissionResponse>]; | ||
/** | ||
* Check or request permissions to access the camera. | ||
* This uses both `requestCameraPermissionsAsync` and `getCameraPermissionsAsync` to interact with the permissions. | ||
* | ||
* @example | ||
* ```ts | ||
* const [status, requestPermission] = ImagePicker.useCameraPermissions(); | ||
* ``` | ||
*/ | ||
export declare const useCameraPermissions: (options?: PermissionHookOptions<object> | undefined) => [CameraPermissionResponse | null, () => Promise<CameraPermissionResponse>, () => Promise<CameraPermissionResponse>]; | ||
export declare function getPendingResultAsync(): Promise<(ImagePickerResult | ImagePickerErrorResult)[]>; | ||
export declare function launchCameraAsync(options?: ImagePickerOptions): Promise<ImagePickerResult>; | ||
export declare function launchImageLibraryAsync<T extends ImagePickerOptions>(options?: T): Promise<ExpandImagePickerResult<T>>; | ||
export { MediaTypeOptions, ImagePickerOptions, ImagePickerResult, ImagePickerErrorResult, VideoExportPreset, CameraPermissionResponse, CameraRollPermissionResponse, MediaLibraryPermissionResponse, PermissionStatus, PermissionExpiration, }; | ||
export { MediaTypeOptions, ImagePickerOptions, ImagePickerResult, ImagePickerErrorResult, VideoExportPreset, CameraPermissionResponse, CameraRollPermissionResponse, MediaLibraryPermissionResponse, PermissionStatus, PermissionExpiration, PermissionHookOptions, }; |
@@ -1,3 +0,2 @@ | ||
import { UnavailabilityError, CodedError } from '@unimodules/core'; | ||
import { PermissionStatus } from 'expo-modules-core'; | ||
import { PermissionStatus, createPermissionHook, UnavailabilityError, CodedError, } from 'expo-modules-core'; | ||
import ExponentImagePicker from './ExponentImagePicker'; | ||
@@ -57,2 +56,31 @@ import { MediaTypeOptions, VideoExportPreset, } from './ImagePicker.types'; | ||
} | ||
// @needsAudit | ||
/** | ||
* Check or request permissions to access the media library. | ||
* This uses both `requestMediaLibraryPermissionsAsync` and `getMediaLibraryPermissionsAsync` to interact with the permissions. | ||
* | ||
* @example | ||
* ```ts | ||
* const [status, requestPermission] = ImagePicker.useMediaLibraryPermissions(); | ||
* ``` | ||
*/ | ||
export const useMediaLibraryPermissions = createPermissionHook({ | ||
// TODO(cedric): permission requesters should have an options param or a different requester | ||
getMethod: (options) => getMediaLibraryPermissionsAsync(options?.writeOnly), | ||
requestMethod: (options) => requestMediaLibraryPermissionsAsync(options?.writeOnly), | ||
}); | ||
// @needsAudit | ||
/** | ||
* Check or request permissions to access the camera. | ||
* This uses both `requestCameraPermissionsAsync` and `getCameraPermissionsAsync` to interact with the permissions. | ||
* | ||
* @example | ||
* ```ts | ||
* const [status, requestPermission] = ImagePicker.useCameraPermissions(); | ||
* ``` | ||
*/ | ||
export const useCameraPermissions = createPermissionHook({ | ||
getMethod: getCameraPermissionsAsync, | ||
requestMethod: requestCameraPermissionsAsync, | ||
}); | ||
export async function getPendingResultAsync() { | ||
@@ -59,0 +87,0 @@ if (ExponentImagePicker.getPendingResultAsync) { |
@@ -36,2 +36,13 @@ import { PermissionResponse } from 'expo-modules-core'; | ||
} | ||
export declare enum UIImagePickerPresentationStyle { | ||
FullScreen = 0, | ||
PageSheet = 1, | ||
FormSheet = 2, | ||
CurrentContext = 3, | ||
OverFullScreen = 5, | ||
OverCurrentContext = 6, | ||
Popover = 7, | ||
BlurOverFullScreen = 8, | ||
Automatic = -2 | ||
} | ||
export declare type ImageInfo = { | ||
@@ -77,2 +88,3 @@ uri: string; | ||
videoMaxDuration?: number; | ||
presentationStyle?: UIImagePickerPresentationStyle; | ||
}; | ||
@@ -79,0 +91,0 @@ export declare type OpenFileBrowserOptions = { |
@@ -30,2 +30,14 @@ export var MediaTypeOptions; | ||
})(UIImagePickerControllerQualityType || (UIImagePickerControllerQualityType = {})); | ||
export var UIImagePickerPresentationStyle; | ||
(function (UIImagePickerPresentationStyle) { | ||
UIImagePickerPresentationStyle[UIImagePickerPresentationStyle["FullScreen"] = 0] = "FullScreen"; | ||
UIImagePickerPresentationStyle[UIImagePickerPresentationStyle["PageSheet"] = 1] = "PageSheet"; | ||
UIImagePickerPresentationStyle[UIImagePickerPresentationStyle["FormSheet"] = 2] = "FormSheet"; | ||
UIImagePickerPresentationStyle[UIImagePickerPresentationStyle["CurrentContext"] = 3] = "CurrentContext"; | ||
UIImagePickerPresentationStyle[UIImagePickerPresentationStyle["OverFullScreen"] = 5] = "OverFullScreen"; | ||
UIImagePickerPresentationStyle[UIImagePickerPresentationStyle["OverCurrentContext"] = 6] = "OverCurrentContext"; | ||
UIImagePickerPresentationStyle[UIImagePickerPresentationStyle["Popover"] = 7] = "Popover"; | ||
UIImagePickerPresentationStyle[UIImagePickerPresentationStyle["BlurOverFullScreen"] = 8] = "BlurOverFullScreen"; | ||
UIImagePickerPresentationStyle[UIImagePickerPresentationStyle["Automatic"] = -2] = "Automatic"; | ||
})(UIImagePickerPresentationStyle || (UIImagePickerPresentationStyle = {})); | ||
//# sourceMappingURL=ImagePicker.types.js.map |
@@ -13,14 +13,23 @@ # Changelog | ||
## 10.2.3 — 2021-08-20 | ||
## 11.0.0 — 2021-09-28 | ||
_This version does not introduce any user-facing changes._ | ||
### 🛠 Breaking changes | ||
## 10.2.2 — 2021-06-24 | ||
- Dropped support for iOS 11.0 ([#14383](https://github.com/expo/expo/pull/14383) by [@cruzach](https://github.com/cruzach)) | ||
_This version does not introduce any user-facing changes._ | ||
### 🎉 New features | ||
## 10.2.1 — 2021-06-22 | ||
- Add useCameraPermissions and useMediaLibraryPermissions hooks from modules factory. ([#13859](https://github.com/expo/expo/pull/13859) by [@bycedric](https://github.com/bycedric)) | ||
- Add possibility to change presentation style on iOS. ([#14068](https://github.com/expo/expo/pull/14068) by [@mstach60161](https://github.com/mstach60161)) | ||
_This version does not introduce any user-facing changes._ | ||
### 🐛 Bug fixes | ||
- Add missing `GPSHPositioningError` exif parameter on Android. ([#13998](https://github.com/expo/expo/pull/13998) by [@mstach60161](https://github.com/mstach60161)) | ||
- Fix promise not resolving when the app is moved to the background on Android. ([#13975](https://github.com/expo/expo/pull/13975) by [@mstach60161](https://github.com/mstach60161)) | ||
- Fix building errors from use_frameworks! in Podfile. ([#14523](https://github.com/expo/expo/pull/14523) by [@kudo](https://github.com/kudo)) | ||
### 💡 Others | ||
- Updated `@expo/config-plugins` ([#14443](https://github.com/expo/expo/pull/14443) by [@EvanBacon](https://github.com/EvanBacon)) | ||
## 10.2.0 — 2021-06-16 | ||
@@ -33,2 +42,3 @@ | ||
- Fixed cases where Picker & Camera would be transparent on iOS 14.5. ([#12897](https://github.com/expo/expo/pull/12897) by [@cruzach](https://github.com/cruzach)) | ||
- Add missing exif data to cropped image on Android. ([#14038](https://github.com/expo/expo/pull/14038) by [@mstach60161](https://github.com/mstach60161)) | ||
@@ -38,2 +48,3 @@ ### 💡 Others | ||
- Migrated from `unimodules-file-system-interface` and `unimodules-permissions-interface` to `expo-modules-core`. ([#12961](https://github.com/expo/expo/pull/12961) by [@tsapeta](https://github.com/tsapeta)) | ||
- Migrated from `AsyncTask` to Kotlin concurrency utilities. ([#13800](https://github.com/expo/expo/pull/13800) by [@m1st4ke](https://github.com/m1st4ke)) | ||
@@ -40,0 +51,0 @@ ## 10.1.3 — 2021-04-13 |
{ | ||
"name": "expo-image-picker", | ||
"version": "10.2.3", | ||
"version": "11.0.0", | ||
"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.", | ||
@@ -34,12 +34,9 @@ "main": "build/ImagePicker.js", | ||
"license": "MIT", | ||
"homepage": "https://docs.expo.io/versions/latest/sdk/imagepicker/", | ||
"homepage": "https://docs.expo.dev/versions/latest/sdk/imagepicker/", | ||
"jest": { | ||
"preset": "expo-module-scripts" | ||
}, | ||
"unimodulePeerDependencies": { | ||
"@unimodules/core": "*" | ||
}, | ||
"dependencies": { | ||
"@expo/config-plugins": "^3.0.0", | ||
"expo-modules-core": "~0.2.0", | ||
"@expo/config-plugins": "^3.1.0", | ||
"expo-modules-core": "~0.4.0", | ||
"uuid": "7.0.2" | ||
@@ -50,3 +47,3 @@ }, | ||
}, | ||
"gitHead": "ab0dca77546a6760f6203151e29db807308e9589" | ||
"gitHead": "1fffde73411ee7a642b98f1506a8de921805d52b" | ||
} |
@@ -25,3 +25,3 @@ "use strict"; | ||
exports.setImagePickerManifestActivity = setImagePickerManifestActivity; | ||
const withImagePickerManifestActivity = config => { | ||
const withImagePickerManifestActivity = (config) => { | ||
// This plugin has no ability to remove the activity that it adds. | ||
@@ -28,0 +28,0 @@ return config_plugins_1.withAndroidManifest(config, async (config) => { |
@@ -37,5 +37,5 @@ import { | ||
const withImagePickerManifestActivity: ConfigPlugin = config => { | ||
const withImagePickerManifestActivity: ConfigPlugin = (config) => { | ||
// This plugin has no ability to remove the activity that it adds. | ||
return withAndroidManifest(config, async config => { | ||
return withAndroidManifest(config, async (config) => { | ||
config.modResults = setImagePickerManifestActivity(config.modResults); | ||
@@ -42,0 +42,0 @@ return config; |
@@ -1,2 +0,2 @@ | ||
import { NativeModulesProxy } from '@unimodules/core'; | ||
import { NativeModulesProxy } from 'expo-modules-core'; | ||
export default NativeModulesProxy.ExponentImagePicker; |
@@ -1,3 +0,2 @@ | ||
import { Platform } from '@unimodules/core'; | ||
import { PermissionResponse, PermissionStatus } from 'expo-modules-core'; | ||
import { PermissionResponse, PermissionStatus, Platform } from 'expo-modules-core'; | ||
import { v4 } from 'uuid'; | ||
@@ -121,3 +120,3 @@ | ||
const imgs: ImageInfo[] = await Promise.all( | ||
Array.from(input.files).map(file => readFile(file, { base64 })) | ||
Array.from(input.files).map((file) => readFile(file, { base64 })) | ||
); | ||
@@ -124,0 +123,0 @@ resolve({ |
@@ -1,3 +0,9 @@ | ||
import { UnavailabilityError, CodedError } from '@unimodules/core'; | ||
import { PermissionStatus, PermissionExpiration } from 'expo-modules-core'; | ||
import { | ||
PermissionStatus, | ||
PermissionExpiration, | ||
PermissionHookOptions, | ||
createPermissionHook, | ||
UnavailabilityError, | ||
CodedError, | ||
} from 'expo-modules-core'; | ||
@@ -102,2 +108,36 @@ import ExponentImagePicker from './ExponentImagePicker'; | ||
// @needsAudit | ||
/** | ||
* Check or request permissions to access the media library. | ||
* This uses both `requestMediaLibraryPermissionsAsync` and `getMediaLibraryPermissionsAsync` to interact with the permissions. | ||
* | ||
* @example | ||
* ```ts | ||
* const [status, requestPermission] = ImagePicker.useMediaLibraryPermissions(); | ||
* ``` | ||
*/ | ||
export const useMediaLibraryPermissions = createPermissionHook< | ||
MediaLibraryPermissionResponse, | ||
{ writeOnly?: boolean } | ||
>({ | ||
// TODO(cedric): permission requesters should have an options param or a different requester | ||
getMethod: (options) => getMediaLibraryPermissionsAsync(options?.writeOnly), | ||
requestMethod: (options) => requestMediaLibraryPermissionsAsync(options?.writeOnly), | ||
}); | ||
// @needsAudit | ||
/** | ||
* Check or request permissions to access the camera. | ||
* This uses both `requestCameraPermissionsAsync` and `getCameraPermissionsAsync` to interact with the permissions. | ||
* | ||
* @example | ||
* ```ts | ||
* const [status, requestPermission] = ImagePicker.useCameraPermissions(); | ||
* ``` | ||
*/ | ||
export const useCameraPermissions = createPermissionHook({ | ||
getMethod: getCameraPermissionsAsync, | ||
requestMethod: requestCameraPermissionsAsync, | ||
}); | ||
export async function getPendingResultAsync(): Promise< | ||
@@ -141,2 +181,3 @@ (ImagePickerResult | ImagePickerErrorResult)[] | ||
PermissionExpiration, | ||
PermissionHookOptions, | ||
}; |
@@ -44,2 +44,14 @@ import { PermissionResponse } from 'expo-modules-core'; | ||
export enum UIImagePickerPresentationStyle { | ||
FullScreen = 0, | ||
PageSheet = 1, | ||
FormSheet = 2, | ||
CurrentContext = 3, | ||
OverFullScreen = 5, | ||
OverCurrentContext = 6, | ||
Popover = 7, | ||
BlurOverFullScreen = 8, | ||
Automatic = -2, | ||
} | ||
export type ImageInfo = { | ||
@@ -80,2 +92,3 @@ uri: string; | ||
videoMaxDuration?: number; | ||
presentationStyle?: UIImagePickerPresentationStyle; | ||
}; | ||
@@ -90,8 +103,7 @@ | ||
export type ExpandImagePickerResult< | ||
T extends ImagePickerOptions | OpenFileBrowserOptions | ||
> = T extends { | ||
allowsMultipleSelection: true; | ||
} | ||
? ImagePickerMultipleResult | ||
: ImagePickerResult; | ||
export type ExpandImagePickerResult<T extends ImagePickerOptions | OpenFileBrowserOptions> = | ||
T extends { | ||
allowsMultipleSelection: true; | ||
} | ||
? ImagePickerMultipleResult | ||
: ImagePickerResult; |
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
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
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
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
159799
1011
+ Addedcompare-versions@3.6.0(transitive)
+ Addedexpo-modules-core@0.4.10(transitive)
+ Addedinvariant@2.2.4(transitive)
+ Addedloose-envify@1.4.0(transitive)
- Removedexpo-modules-core@0.2.0(transitive)
Updated@expo/config-plugins@^3.1.0
Updatedexpo-modules-core@~0.4.0