expo-document-picker 10.3.0 → 11.0.1
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 +16 -0
- package/android/build.gradle +2 -2
- package/build/index.d.ts +3 -3
- package/build/index.js +3 -3
- package/build/index.js.map +1 -1
- package/build/types.d.ts +4 -4
- package/build/types.d.ts.map +1 -1
- package/build/types.js.map +1 -1
- package/ios/EXDocumentPicker.podspec +1 -1
- package/package.json +3 -4
- package/plugin/build/withDocumentPicker.d.ts +1 -1
- package/plugin/build/withDocumentPicker.js +1 -1
- package/plugin/build/withDocumentPickerIOS.d.ts +2 -2
- package/plugin/build/withDocumentPickerIOS.js +2 -3
- package/plugin/src/withDocumentPicker.ts +1 -1
- package/plugin/src/withDocumentPickerIOS.ts +2 -2
- package/src/index.ts +3 -3
- package/src/types.ts +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,22 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 11.0.1 — 2022-10-28
|
|
14
|
+
|
|
15
|
+
_This version does not introduce any user-facing changes._
|
|
16
|
+
|
|
17
|
+
## 11.0.0 — 2022-10-25
|
|
18
|
+
|
|
19
|
+
### 🛠 Breaking changes
|
|
20
|
+
|
|
21
|
+
- [plugin] Upgrade minimum runtime requirement to Node 14 (LTS). ([#18204](https://github.com/expo/expo/pull/18204) by [@EvanBacon](https://github.com/EvanBacon))
|
|
22
|
+
- Bumped iOS deployment target to 13.0 and deprecated support for iOS 12. ([#18873](https://github.com/expo/expo/pull/18873) by [@tsapeta](https://github.com/tsapeta))
|
|
23
|
+
|
|
24
|
+
### 💡 Others
|
|
25
|
+
|
|
26
|
+
- [plugin] Migrate import from @expo/config-plugins to expo/config-plugins and @expo/config-types to expo/config. ([#18855](https://github.com/expo/expo/pull/18855) by [@brentvatne](https://github.com/brentvatne))
|
|
27
|
+
- Drop `@expo/config-plugins` dependency in favor of peer dependency on `expo`. ([#18595](https://github.com/expo/expo/pull/18595) by [@EvanBacon](https://github.com/EvanBacon))
|
|
28
|
+
|
|
13
29
|
## 10.3.0 — 2022-07-07
|
|
14
30
|
|
|
15
31
|
_This version does not introduce any user-facing changes._
|
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'maven-publish'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '
|
|
6
|
+
version = '11.0.1'
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
9
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
@@ -74,7 +74,7 @@ android {
|
|
|
74
74
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
75
75
|
targetSdkVersion safeExtGet("targetSdkVersion", 31)
|
|
76
76
|
versionCode 17
|
|
77
|
-
versionName '
|
|
77
|
+
versionName '11.0.1'
|
|
78
78
|
}
|
|
79
79
|
lintOptions {
|
|
80
80
|
abortOnError false
|
package/build/index.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ export { DocumentPickerOptions, DocumentResult };
|
|
|
3
3
|
/**
|
|
4
4
|
* Display the system UI for choosing a document. By default, the chosen file is copied to [the app's internal cache directory](filesystem.md#filesystemcachedirectory).
|
|
5
5
|
* > **Notes for Web:** The system UI can only be shown after user activation (e.g. a `Button` press).
|
|
6
|
-
* Therefore, calling `getDocumentAsync` in `componentDidMount`, for example, will **not** work as
|
|
7
|
-
* intended. The `cancel` event will not be returned in the browser due to platform restrictions and
|
|
8
|
-
* inconsistencies across browsers.
|
|
6
|
+
* > Therefore, calling `getDocumentAsync` in `componentDidMount`, for example, will **not** work as
|
|
7
|
+
* > intended. The `cancel` event will not be returned in the browser due to platform restrictions and
|
|
8
|
+
* > inconsistencies across browsers.
|
|
9
9
|
*
|
|
10
10
|
* @return On success returns a promise that fulfils with [`DocumentResult`](#documentresult) object.
|
|
11
11
|
*
|
package/build/index.js
CHANGED
|
@@ -3,9 +3,9 @@ import ExpoDocumentPicker from './ExpoDocumentPicker';
|
|
|
3
3
|
/**
|
|
4
4
|
* Display the system UI for choosing a document. By default, the chosen file is copied to [the app's internal cache directory](filesystem.md#filesystemcachedirectory).
|
|
5
5
|
* > **Notes for Web:** The system UI can only be shown after user activation (e.g. a `Button` press).
|
|
6
|
-
* Therefore, calling `getDocumentAsync` in `componentDidMount`, for example, will **not** work as
|
|
7
|
-
* intended. The `cancel` event will not be returned in the browser due to platform restrictions and
|
|
8
|
-
* inconsistencies across browsers.
|
|
6
|
+
* > Therefore, calling `getDocumentAsync` in `componentDidMount`, for example, will **not** work as
|
|
7
|
+
* > intended. The `cancel` event will not be returned in the browser due to platform restrictions and
|
|
8
|
+
* > inconsistencies across browsers.
|
|
9
9
|
*
|
|
10
10
|
* @return On success returns a promise that fulfils with [`DocumentResult`](#documentresult) object.
|
|
11
11
|
*
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAItD,cAAc;AACd;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EACrC,IAAI,GAAG,KAAK,EACZ,oBAAoB,GAAG,IAAI,EAC3B,QAAQ,GAAG,KAAK,MACS,EAAE;IAC3B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,IAAI,GAAG,CAAC,IAAI,CAAa,CAAC;KAC3B;IACD,OAAO,MAAM,kBAAkB,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC7F,CAAC","sourcesContent":["import ExpoDocumentPicker from './ExpoDocumentPicker';\nimport { DocumentPickerOptions, DocumentResult } from './types';\nexport { DocumentPickerOptions, DocumentResult };\n\n// @needsAudit\n/**\n * Display the system UI for choosing a document. By default, the chosen file is copied to [the app's internal cache directory](filesystem.md#filesystemcachedirectory).\n * > **Notes for Web:** The system UI can only be shown after user activation (e.g. a `Button` press).\n * Therefore, calling `getDocumentAsync` in `componentDidMount`, for example, will **not** work as\n * intended. The `cancel` event will not be returned in the browser due to platform restrictions and\n * inconsistencies across browsers.\n *\n * @return On success returns a promise that fulfils with [`DocumentResult`](#documentresult) object.\n *\n * If the user cancelled the document picking, the promise resolves to `{ type: 'cancel' }`.\n */\nexport async function getDocumentAsync({\n type = '*/*',\n copyToCacheDirectory = true,\n multiple = false,\n}: DocumentPickerOptions = {}): Promise<DocumentResult> {\n if (typeof type === 'string') {\n type = [type] as string[];\n }\n return await ExpoDocumentPicker.getDocumentAsync({ type, copyToCacheDirectory, multiple });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAItD,cAAc;AACd;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EACrC,IAAI,GAAG,KAAK,EACZ,oBAAoB,GAAG,IAAI,EAC3B,QAAQ,GAAG,KAAK,MACS,EAAE;IAC3B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,IAAI,GAAG,CAAC,IAAI,CAAa,CAAC;KAC3B;IACD,OAAO,MAAM,kBAAkB,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC7F,CAAC","sourcesContent":["import ExpoDocumentPicker from './ExpoDocumentPicker';\nimport { DocumentPickerOptions, DocumentResult } from './types';\nexport { DocumentPickerOptions, DocumentResult };\n\n// @needsAudit\n/**\n * Display the system UI for choosing a document. By default, the chosen file is copied to [the app's internal cache directory](filesystem.md#filesystemcachedirectory).\n * > **Notes for Web:** The system UI can only be shown after user activation (e.g. a `Button` press).\n * > Therefore, calling `getDocumentAsync` in `componentDidMount`, for example, will **not** work as\n * > intended. The `cancel` event will not be returned in the browser due to platform restrictions and\n * > inconsistencies across browsers.\n *\n * @return On success returns a promise that fulfils with [`DocumentResult`](#documentresult) object.\n *\n * If the user cancelled the document picking, the promise resolves to `{ type: 'cancel' }`.\n */\nexport async function getDocumentAsync({\n type = '*/*',\n copyToCacheDirectory = true,\n multiple = false,\n}: DocumentPickerOptions = {}): Promise<DocumentResult> {\n if (typeof type === 'string') {\n type = [type] as string[];\n }\n return await ExpoDocumentPicker.getDocumentAsync({ type, copyToCacheDirectory, multiple });\n}\n"]}
|
package/build/types.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*/
|
|
4
1
|
export declare type DocumentPickerOptions = {
|
|
5
2
|
/**
|
|
6
3
|
* The [MIME type(s)](https://en.wikipedia.org/wiki/Media_type) of the documents that are available
|
|
@@ -10,7 +7,7 @@ export declare type DocumentPickerOptions = {
|
|
|
10
7
|
*/
|
|
11
8
|
type?: string | string[];
|
|
12
9
|
/**
|
|
13
|
-
* If `true`, the picked file is copied to [`FileSystem.CacheDirectory`](filesystem
|
|
10
|
+
* If `true`, the picked file is copied to [`FileSystem.CacheDirectory`](./filesystem#filesystemcachedirectory),
|
|
14
11
|
* which allows other Expo APIs to read the file immediately. This may impact performance for
|
|
15
12
|
* large files, so you should consider setting this to `false` if you expect users to pick
|
|
16
13
|
* particularly large files and your app does not need immediate read access.
|
|
@@ -44,6 +41,9 @@ export declare type DocumentResult = {
|
|
|
44
41
|
* Document MIME type.
|
|
45
42
|
*/
|
|
46
43
|
mimeType?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Timestamp of last document modification.
|
|
46
|
+
*/
|
|
47
47
|
lastModified?: number;
|
|
48
48
|
file?: File;
|
|
49
49
|
output?: FileList | null;
|
package/build/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,oBAAY,qBAAqB,GAAG;IAClC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAGF,oBAAY,cAAc,GACtB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IACE,IAAI,EAAE,SAAS,CAAC;IAChB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC1B,CAAC"}
|
package/build/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["// @needsAudit\
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["// @needsAudit\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#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 /**\n * Timestamp of last document modification.\n */\n lastModified?: number;\n file?: File;\n output?: FileList | null;\n };\n"]}
|
|
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
|
|
|
10
10
|
s.license = package['license']
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.homepage = package['homepage']
|
|
13
|
-
s.platform = :ios, '
|
|
13
|
+
s.platform = :ios, '13.0'
|
|
14
14
|
s.source = { git: 'https://github.com/expo/expo.git' }
|
|
15
15
|
s.static_framework = true
|
|
16
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-document-picker",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.1",
|
|
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",
|
|
@@ -35,14 +35,13 @@
|
|
|
35
35
|
"preset": "expo-module-scripts"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@expo/config-plugins": "~5.0.0",
|
|
39
38
|
"uuid": "^3.3.2"
|
|
40
39
|
},
|
|
41
40
|
"devDependencies": {
|
|
42
|
-
"expo-module-scripts": "^
|
|
41
|
+
"expo-module-scripts": "^3.0.0"
|
|
43
42
|
},
|
|
44
43
|
"peerDependencies": {
|
|
45
44
|
"expo": "*"
|
|
46
45
|
},
|
|
47
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "59081bb17e727b10f2a00cd07bb45cd283a6f6a5"
|
|
48
47
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("
|
|
1
|
+
declare const _default: import("expo/config-plugins").ConfigPlugin<import("./withDocumentPickerIOS").IosProps>;
|
|
2
2
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const config_plugins_1 = require("
|
|
3
|
+
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
|
exports.default = (0, config_plugins_1.createRunOncePlugin)(withDocumentPickerIOS_1.withDocumentPickerIOS, pkg.name, pkg.version);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ExpoConfig } from 'expo/config';
|
|
2
|
+
import { ConfigPlugin } from 'expo/config-plugins';
|
|
3
3
|
export declare type IosProps = {
|
|
4
4
|
/**
|
|
5
5
|
* Sets the `com.apple.developer.icloud-container-environment` entitlement which is read by EAS CLI to set
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setICloudEntitlements = exports.withDocumentPickerIOS = void 0;
|
|
4
|
-
const config_plugins_1 = require("
|
|
4
|
+
const config_plugins_1 = require("expo/config-plugins");
|
|
5
5
|
const withDocumentPickerIOS = (config, { iCloudContainerEnvironment } = {}) => {
|
|
6
6
|
return (0, config_plugins_1.withEntitlementsPlist)(config, (config) => {
|
|
7
7
|
config.modResults = setICloudEntitlements(config, { iCloudContainerEnvironment }, config.modResults);
|
|
@@ -10,8 +10,7 @@ const withDocumentPickerIOS = (config, { iCloudContainerEnvironment } = {}) => {
|
|
|
10
10
|
};
|
|
11
11
|
exports.withDocumentPickerIOS = withDocumentPickerIOS;
|
|
12
12
|
function setICloudEntitlements(config, { iCloudContainerEnvironment }, { 'com.apple.developer.icloud-container-environment': _env, ...entitlements }) {
|
|
13
|
-
|
|
14
|
-
if ((_a = config.ios) === null || _a === void 0 ? void 0 : _a.usesIcloudStorage) {
|
|
13
|
+
if (config.ios?.usesIcloudStorage) {
|
|
15
14
|
// Used for AdHoc iOS builds: https://github.com/expo/eas-cli/issues/693
|
|
16
15
|
// https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_icloud-container-environment
|
|
17
16
|
entitlements['com.apple.developer.icloud-container-environment'] = iCloudContainerEnvironment;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ExpoConfig } from 'expo/config';
|
|
2
|
+
import { ConfigPlugin, withEntitlementsPlist } from 'expo/config-plugins';
|
|
3
3
|
|
|
4
4
|
export type IosProps = {
|
|
5
5
|
/**
|
package/src/index.ts
CHANGED
|
@@ -6,9 +6,9 @@ export { DocumentPickerOptions, DocumentResult };
|
|
|
6
6
|
/**
|
|
7
7
|
* Display the system UI for choosing a document. By default, the chosen file is copied to [the app's internal cache directory](filesystem.md#filesystemcachedirectory).
|
|
8
8
|
* > **Notes for Web:** The system UI can only be shown after user activation (e.g. a `Button` press).
|
|
9
|
-
* Therefore, calling `getDocumentAsync` in `componentDidMount`, for example, will **not** work as
|
|
10
|
-
* intended. The `cancel` event will not be returned in the browser due to platform restrictions and
|
|
11
|
-
* inconsistencies across browsers.
|
|
9
|
+
* > Therefore, calling `getDocumentAsync` in `componentDidMount`, for example, will **not** work as
|
|
10
|
+
* > intended. The `cancel` event will not be returned in the browser due to platform restrictions and
|
|
11
|
+
* > inconsistencies across browsers.
|
|
12
12
|
*
|
|
13
13
|
* @return On success returns a promise that fulfils with [`DocumentResult`](#documentresult) object.
|
|
14
14
|
*
|
package/src/types.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
// @needsAudit
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
*/
|
|
5
2
|
export type DocumentPickerOptions = {
|
|
6
3
|
/**
|
|
7
4
|
* The [MIME type(s)](https://en.wikipedia.org/wiki/Media_type) of the documents that are available
|
|
@@ -11,7 +8,7 @@ export type DocumentPickerOptions = {
|
|
|
11
8
|
*/
|
|
12
9
|
type?: string | string[];
|
|
13
10
|
/**
|
|
14
|
-
* If `true`, the picked file is copied to [`FileSystem.CacheDirectory`](filesystem
|
|
11
|
+
* If `true`, the picked file is copied to [`FileSystem.CacheDirectory`](./filesystem#filesystemcachedirectory),
|
|
15
12
|
* which allows other Expo APIs to read the file immediately. This may impact performance for
|
|
16
13
|
* large files, so you should consider setting this to `false` if you expect users to pick
|
|
17
14
|
* particularly large files and your app does not need immediate read access.
|
|
@@ -47,6 +44,9 @@ export type DocumentResult =
|
|
|
47
44
|
* Document MIME type.
|
|
48
45
|
*/
|
|
49
46
|
mimeType?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Timestamp of last document modification.
|
|
49
|
+
*/
|
|
50
50
|
lastModified?: number;
|
|
51
51
|
file?: File;
|
|
52
52
|
output?: FileList | null;
|