expo-document-picker 10.0.0 → 10.1.0
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/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/android/build.gradle +2 -2
- package/build/types.d.ts +5 -4
- package/build/types.js.map +1 -1
- package/package.json +7 -5
- package/plugin/build/withDocumentPicker.d.ts +2 -3
- package/plugin/build/withDocumentPicker.js +2 -2
- package/plugin/build/withDocumentPickerIOS.d.ts +11 -3
- package/plugin/build/withDocumentPickerIOS.js +9 -6
- package/plugin/src/withDocumentPicker.ts +2 -2
- package/plugin/src/withDocumentPickerIOS.ts +25 -6
- package/src/types.ts +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 10.1.0 — 2021-12-03
|
|
14
|
+
|
|
15
|
+
### 🎉 New features
|
|
16
|
+
|
|
17
|
+
- [plugin] Added `iCloudContainerEnvironment` prop for setting the `com.apple.developer.icloud-container-environment` entitlement ([#14885](https://github.com/expo/expo/pull/14885) by [@EvanBacon](https://github.com/EvanBacon))
|
|
18
|
+
|
|
19
|
+
## 10.0.1 — 2021-10-01
|
|
20
|
+
|
|
21
|
+
_This version does not introduce any user-facing changes._
|
|
22
|
+
|
|
13
23
|
## 10.0.0 — 2021-09-28
|
|
14
24
|
|
|
15
25
|
### 🛠 Breaking changes
|
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ For managed [managed](https://docs.expo.io/versions/latest/introduction/managed-
|
|
|
13
13
|
|
|
14
14
|
# Installation in bare React Native projects
|
|
15
15
|
|
|
16
|
-
For bare React Native projects, you must ensure that you have [installed and configured the `
|
|
16
|
+
For bare React Native projects, you must ensure that you have [installed and configured the `expo` package](https://docs.expo.dev/bare/installing-expo-modules/) before continuing.
|
|
17
17
|
|
|
18
18
|
### Add the package to your npm dependencies
|
|
19
19
|
|
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'maven'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '10.
|
|
6
|
+
version = '10.1.0'
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
9
|
// Simple helper that allows the root project to override versions declared by this library.
|
|
@@ -61,7 +61,7 @@ android {
|
|
|
61
61
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
62
62
|
targetSdkVersion safeExtGet("targetSdkVersion", 30)
|
|
63
63
|
versionCode 17
|
|
64
|
-
versionName '10.
|
|
64
|
+
versionName '10.1.0'
|
|
65
65
|
}
|
|
66
66
|
lintOptions {
|
|
67
67
|
abortOnError false
|
package/build/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare type DocumentPickerOptions = {
|
|
|
6
6
|
* The [MIME type(s)](https://en.wikipedia.org/wiki/Media_type) of the documents that are available
|
|
7
7
|
* to be picked. Is also supports wildcards like `'image/*'` to choose any image. To allow any type
|
|
8
8
|
* of document you can use `'*/*'`.
|
|
9
|
-
* @default
|
|
9
|
+
* @default '*/*'
|
|
10
10
|
*/
|
|
11
11
|
type?: string | string[];
|
|
12
12
|
/**
|
|
@@ -14,12 +14,13 @@ export declare type DocumentPickerOptions = {
|
|
|
14
14
|
* which allows other Expo APIs to read the file immediately. This may impact performance for
|
|
15
15
|
* large files, so you should consider setting this to `false` if you expect users to pick
|
|
16
16
|
* particularly large files and your app does not need immediate read access.
|
|
17
|
-
* @default
|
|
17
|
+
* @default true
|
|
18
18
|
*/
|
|
19
19
|
copyToCacheDirectory?: boolean;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
* @default
|
|
21
|
+
* Allows multiple files to be selected from the system UI.
|
|
22
|
+
* @default false
|
|
23
|
+
* @platform web
|
|
23
24
|
*/
|
|
24
25
|
multiple?: boolean;
|
|
25
26
|
};
|
package/build/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["// @needsAudit\n/**\n *\n */\nexport type DocumentPickerOptions = {\n /**\n * The [MIME type(s)](https://en.wikipedia.org/wiki/Media_type) of the documents that are available\n * to be picked. Is also supports wildcards like `'image/*'` to choose any image. To allow any type\n * of document you can use `'*/*'`.\n * @default
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["// @needsAudit\n/**\n *\n */\nexport type DocumentPickerOptions = {\n /**\n * The [MIME type(s)](https://en.wikipedia.org/wiki/Media_type) of the documents that are available\n * to be picked. Is also supports wildcards like `'image/*'` to choose any image. To allow any type\n * of document you can use `'*/*'`.\n * @default '*/*'\n */\n type?: string | string[];\n /**\n * If `true`, the picked file is copied to [`FileSystem.CacheDirectory`](filesystem.md#filesystemcachedirectory),\n * which allows other Expo APIs to read the file immediately. This may impact performance for\n * large files, so you should consider setting this to `false` if you expect users to pick\n * particularly large files and your app does not need immediate read access.\n * @default true\n */\n copyToCacheDirectory?: boolean;\n /**\n * Allows multiple files to be selected from the system UI.\n * @default false\n * @platform web\n */\n multiple?: boolean;\n};\n\n// @needsAudit @docsMissing\nexport type DocumentResult =\n | { type: 'cancel' }\n | {\n type: 'success';\n /**\n * Document original name.\n */\n name: string;\n /**\n * Document size in bytes.\n */\n size?: number;\n /**\n * An URI to the local document file.\n */\n uri: string;\n /**\n * Document MIME type.\n */\n mimeType?: string;\n lastModified?: number;\n file?: File;\n output?: FileList | null;\n };\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-document-picker",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.1.0",
|
|
4
4
|
"description": "Provides access to the system's UI for selecting documents from the available providers on the user's device.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -32,15 +32,17 @@
|
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"homepage": "https://docs.expo.dev/versions/latest/sdk/document-picker/",
|
|
34
34
|
"jest": {
|
|
35
|
-
"preset": "expo-module-scripts
|
|
35
|
+
"preset": "expo-module-scripts"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@expo/config-plugins": "^
|
|
39
|
-
"expo-modules-core": "~0.4.0",
|
|
38
|
+
"@expo/config-plugins": "^4.0.2",
|
|
40
39
|
"uuid": "^3.3.2"
|
|
41
40
|
},
|
|
42
41
|
"devDependencies": {
|
|
43
42
|
"expo-module-scripts": "^2.0.0"
|
|
44
43
|
},
|
|
45
|
-
"
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"expo": "*"
|
|
46
|
+
},
|
|
47
|
+
"gitHead": "2e5c6983b86d5ecfca028ba64002897d8adc2cc4"
|
|
46
48
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}>;
|
|
2
|
+
import { IosProps } from './withDocumentPickerIOS';
|
|
3
|
+
declare const _default: ConfigPlugin<void | IosProps>;
|
|
5
4
|
export default _default;
|
|
@@ -4,7 +4,7 @@ const config_plugins_1 = require("@expo/config-plugins");
|
|
|
4
4
|
const withDocumentPickerIOS_1 = require("./withDocumentPickerIOS");
|
|
5
5
|
const pkg = require('expo-document-picker/package.json');
|
|
6
6
|
const withDocumentPicker = (config, { appleTeamId = process.env.EXPO_APPLE_TEAM_ID } = {}) => {
|
|
7
|
-
config = withDocumentPickerIOS_1.withDocumentPickerIOS(config, { appleTeamId });
|
|
7
|
+
config = (0, withDocumentPickerIOS_1.withDocumentPickerIOS)(config, { appleTeamId });
|
|
8
8
|
return config;
|
|
9
9
|
};
|
|
10
|
-
exports.default = config_plugins_1.createRunOncePlugin(withDocumentPicker, pkg.name, pkg.version);
|
|
10
|
+
exports.default = (0, config_plugins_1.createRunOncePlugin)(withDocumentPicker, pkg.name, pkg.version);
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { ConfigPlugin } from '@expo/config-plugins';
|
|
2
2
|
import { ExpoConfig } from '@expo/config-types';
|
|
3
|
-
export declare
|
|
3
|
+
export declare type IosProps = {
|
|
4
4
|
appleTeamId?: string;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Sets the `com.apple.developer.icloud-container-environment` entitlement which is read by EAS CLI to set
|
|
7
|
+
* the `iCloudContainerEnvironment` in the `xcodebuild` `exportOptionsPlist`.
|
|
8
|
+
*
|
|
9
|
+
* Available options: https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_icloud-container-environment
|
|
10
|
+
*/
|
|
11
|
+
iCloudContainerEnvironment?: 'Development' | 'Production';
|
|
12
|
+
};
|
|
13
|
+
export declare const withDocumentPickerIOS: ConfigPlugin<IosProps>;
|
|
14
|
+
export declare function setICloudEntitlements(config: Pick<ExpoConfig, 'ios'>, { appleTeamId, iCloudContainerEnvironment }: IosProps, { 'com.apple.developer.icloud-container-environment': _env, ...entitlements }: Record<string, any>): Record<string, any>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.setICloudEntitlements = exports.withDocumentPickerIOS = void 0;
|
|
4
4
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
|
-
const withDocumentPickerIOS = (config, { appleTeamId }) => {
|
|
6
|
-
return config_plugins_1.withEntitlementsPlist(config, (config) => {
|
|
5
|
+
const withDocumentPickerIOS = (config, { appleTeamId, iCloudContainerEnvironment }) => {
|
|
6
|
+
return (0, config_plugins_1.withEntitlementsPlist)(config, (config) => {
|
|
7
7
|
if (appleTeamId) {
|
|
8
|
-
config.modResults =
|
|
8
|
+
config.modResults = setICloudEntitlements(config, { appleTeamId, iCloudContainerEnvironment }, config.modResults);
|
|
9
9
|
}
|
|
10
10
|
else {
|
|
11
11
|
config_plugins_1.WarningAggregator.addWarningIOS('expo-document-picker', 'Cannot configure iOS entitlements because neither the appleTeamId property, nor the environment variable EXPO_APPLE_TEAM_ID were defined.');
|
|
@@ -14,9 +14,12 @@ const withDocumentPickerIOS = (config, { appleTeamId }) => {
|
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
exports.withDocumentPickerIOS = withDocumentPickerIOS;
|
|
17
|
-
function
|
|
17
|
+
function setICloudEntitlements(config, { appleTeamId, iCloudContainerEnvironment }, { 'com.apple.developer.icloud-container-environment': _env, ...entitlements }) {
|
|
18
18
|
var _a;
|
|
19
19
|
if ((_a = config.ios) === null || _a === void 0 ? void 0 : _a.usesIcloudStorage) {
|
|
20
|
+
// Used for AdHoc iOS builds: https://github.com/expo/eas-cli/issues/693
|
|
21
|
+
// https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_icloud-container-environment
|
|
22
|
+
entitlements['com.apple.developer.icloud-container-environment'] = iCloudContainerEnvironment;
|
|
20
23
|
entitlements['com.apple.developer.icloud-container-identifiers'] = [
|
|
21
24
|
'iCloud.' + config.ios.bundleIdentifier,
|
|
22
25
|
];
|
|
@@ -29,4 +32,4 @@ function setICloudEntitlments(config, appleTeamId, entitlements) {
|
|
|
29
32
|
}
|
|
30
33
|
return entitlements;
|
|
31
34
|
}
|
|
32
|
-
exports.
|
|
35
|
+
exports.setICloudEntitlements = setICloudEntitlements;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ConfigPlugin, createRunOncePlugin } from '@expo/config-plugins';
|
|
2
2
|
|
|
3
|
-
import { withDocumentPickerIOS } from './withDocumentPickerIOS';
|
|
3
|
+
import { withDocumentPickerIOS, IosProps } from './withDocumentPickerIOS';
|
|
4
4
|
|
|
5
5
|
const pkg = require('expo-document-picker/package.json');
|
|
6
6
|
|
|
7
|
-
const withDocumentPicker: ConfigPlugin<
|
|
7
|
+
const withDocumentPicker: ConfigPlugin<IosProps | void> = (
|
|
8
8
|
config,
|
|
9
9
|
{ appleTeamId = process.env.EXPO_APPLE_TEAM_ID } = {}
|
|
10
10
|
) => {
|
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
import { ConfigPlugin, WarningAggregator, withEntitlementsPlist } from '@expo/config-plugins';
|
|
2
2
|
import { ExpoConfig } from '@expo/config-types';
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export type IosProps = {
|
|
5
|
+
appleTeamId?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Sets the `com.apple.developer.icloud-container-environment` entitlement which is read by EAS CLI to set
|
|
8
|
+
* the `iCloudContainerEnvironment` in the `xcodebuild` `exportOptionsPlist`.
|
|
9
|
+
*
|
|
10
|
+
* Available options: https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_icloud-container-environment
|
|
11
|
+
*/
|
|
12
|
+
iCloudContainerEnvironment?: 'Development' | 'Production';
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const withDocumentPickerIOS: ConfigPlugin<IosProps> = (
|
|
5
16
|
config,
|
|
6
|
-
{ appleTeamId }
|
|
17
|
+
{ appleTeamId, iCloudContainerEnvironment }
|
|
7
18
|
) => {
|
|
8
19
|
return withEntitlementsPlist(config, (config) => {
|
|
9
20
|
if (appleTeamId) {
|
|
10
|
-
config.modResults =
|
|
21
|
+
config.modResults = setICloudEntitlements(
|
|
22
|
+
config,
|
|
23
|
+
{ appleTeamId, iCloudContainerEnvironment },
|
|
24
|
+
config.modResults
|
|
25
|
+
);
|
|
11
26
|
} else {
|
|
12
27
|
WarningAggregator.addWarningIOS(
|
|
13
28
|
'expo-document-picker',
|
|
@@ -18,12 +33,16 @@ export const withDocumentPickerIOS: ConfigPlugin<{ appleTeamId?: string }> = (
|
|
|
18
33
|
});
|
|
19
34
|
};
|
|
20
35
|
|
|
21
|
-
export function
|
|
36
|
+
export function setICloudEntitlements(
|
|
22
37
|
config: Pick<ExpoConfig, 'ios'>,
|
|
23
|
-
appleTeamId:
|
|
24
|
-
entitlements: Record<string, any>
|
|
38
|
+
{ appleTeamId, iCloudContainerEnvironment }: IosProps,
|
|
39
|
+
{ 'com.apple.developer.icloud-container-environment': _env, ...entitlements }: Record<string, any>
|
|
25
40
|
): Record<string, any> {
|
|
26
41
|
if (config.ios?.usesIcloudStorage) {
|
|
42
|
+
// Used for AdHoc iOS builds: https://github.com/expo/eas-cli/issues/693
|
|
43
|
+
// https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_icloud-container-environment
|
|
44
|
+
entitlements['com.apple.developer.icloud-container-environment'] = iCloudContainerEnvironment;
|
|
45
|
+
|
|
27
46
|
entitlements['com.apple.developer.icloud-container-identifiers'] = [
|
|
28
47
|
'iCloud.' + config.ios.bundleIdentifier,
|
|
29
48
|
];
|
package/src/types.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type DocumentPickerOptions = {
|
|
|
7
7
|
* The [MIME type(s)](https://en.wikipedia.org/wiki/Media_type) of the documents that are available
|
|
8
8
|
* to be picked. Is also supports wildcards like `'image/*'` to choose any image. To allow any type
|
|
9
9
|
* of document you can use `'*/*'`.
|
|
10
|
-
* @default
|
|
10
|
+
* @default '*/*'
|
|
11
11
|
*/
|
|
12
12
|
type?: string | string[];
|
|
13
13
|
/**
|
|
@@ -15,12 +15,13 @@ export type DocumentPickerOptions = {
|
|
|
15
15
|
* which allows other Expo APIs to read the file immediately. This may impact performance for
|
|
16
16
|
* large files, so you should consider setting this to `false` if you expect users to pick
|
|
17
17
|
* particularly large files and your app does not need immediate read access.
|
|
18
|
-
* @default
|
|
18
|
+
* @default true
|
|
19
19
|
*/
|
|
20
20
|
copyToCacheDirectory?: boolean;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
* @default
|
|
22
|
+
* Allows multiple files to be selected from the system UI.
|
|
23
|
+
* @default false
|
|
24
|
+
* @platform web
|
|
24
25
|
*/
|
|
25
26
|
multiple?: boolean;
|
|
26
27
|
};
|