expo-document-picker 11.3.0 → 11.5.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 CHANGED
@@ -10,6 +10,18 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 11.5.0 — 2023-06-21
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Fixed Android build warnings for Gradle version 8. ([#22537](https://github.com/expo/expo/pull/22537), [#22609](https://github.com/expo/expo/pull/22609) by [@kudo](https://github.com/kudo))
18
+
19
+ ## 11.4.0 — 2023-05-08
20
+
21
+ ### 🐛 Bug fixes
22
+
23
+ - Export all types from the module. ([#22172](https://github.com/expo/expo/pull/22172) by [@alanjhughes](https://github.com/alanjhughes))
24
+
13
25
  ## 11.3.0 — 2023-04-14
14
26
 
15
27
  ### 🎉 New features
package/README.md CHANGED
@@ -1,4 +1,11 @@
1
- # expo-document-picker
1
+ <p>
2
+ <a href="https://docs.expo.dev/versions/latest/sdk/document-picker/">
3
+ <img
4
+ src="../../.github/resources/expo-document-picker.svg"
5
+ alt="expo-document-picker"
6
+ height="64" />
7
+ </a>
8
+ </p>
2
9
 
3
10
  Provides access to the system's UI for selecting documents from the available providers on the user's device.
4
11
 
@@ -18,7 +25,7 @@ For bare React Native projects, you must ensure that you have [installed and con
18
25
  ### Add the package to your npm dependencies
19
26
 
20
27
  ```
21
- expo install expo-document-picker
28
+ npx expo install expo-document-picker
22
29
  ```
23
30
 
24
31
  ### Configure for iOS
@@ -45,7 +52,7 @@ You can change the `com.apple.developer.icloud-container-environment` entitlemen
45
52
  }
46
53
  ```
47
54
 
48
- > Running `expo prebuild` will generate the [native project locally](https://docs.expo.io/workflow/customizing/) with the applied changes in your iOS Entitlements file.
55
+ > Running `npx expo prebuild` will generate the [native project locally](https://docs.expo.dev/workflow/customizing/) with the applied changes in your iOS Entitlements file.
49
56
 
50
57
  # Contributing
51
58
 
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '11.3.0'
6
+ version = '11.5.0'
7
7
 
8
8
  buildscript {
9
9
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
@@ -35,19 +35,11 @@ buildscript {
35
35
  }
36
36
  }
37
37
 
38
- // Creating sources with comments
39
- task androidSourcesJar(type: Jar) {
40
- classifier = 'sources'
41
- from android.sourceSets.main.java.srcDirs
42
- }
43
-
44
38
  afterEvaluate {
45
39
  publishing {
46
40
  publications {
47
41
  release(MavenPublication) {
48
42
  from components.release
49
- // Add additional sourcesJar to artifacts
50
- artifact(androidSourcesJar)
51
43
  }
52
44
  }
53
45
  repositories {
@@ -70,15 +62,21 @@ android {
70
62
  jvmTarget = JavaVersion.VERSION_11.majorVersion
71
63
  }
72
64
 
65
+ namespace "expo.modules.documentpicker"
73
66
  defaultConfig {
74
67
  minSdkVersion safeExtGet("minSdkVersion", 21)
75
68
  targetSdkVersion safeExtGet("targetSdkVersion", 33)
76
69
  versionCode 17
77
- versionName '11.3.0'
70
+ versionName '11.5.0'
78
71
  }
79
72
  lintOptions {
80
73
  abortOnError false
81
74
  }
75
+ publishing {
76
+ singleVariant("release") {
77
+ withSourcesJar()
78
+ }
79
+ }
82
80
  }
83
81
 
84
82
  dependencies {
@@ -1,5 +1,4 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="expo.modules.documentpicker">
2
-
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
3
2
  <queries>
4
3
  <!-- Query open documents -->
5
4
  <intent>
package/build/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { DocumentPickerOptions, DocumentPickerResult } from './types';
2
- export { DocumentPickerOptions, DocumentPickerResult as DocumentResult };
3
2
  /**
4
3
  * 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
4
  * > **Notes for Web:** The system UI can only be shown after user activation (e.g. a `Button` press).
@@ -12,4 +11,5 @@ export { DocumentPickerOptions, DocumentPickerResult as DocumentResult };
12
11
  * If the user cancelled the document picking, the promise resolves to `{ type: 'cancel' }`.
13
12
  */
14
13
  export declare function getDocumentAsync({ type, copyToCacheDirectory, multiple, }?: DocumentPickerOptions): Promise<DocumentPickerResult>;
14
+ export * from './types';
15
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,IAAI,cAAc,EAAE,CAAC;AAqCzE;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CAAC,EACrC,IAAY,EACZ,oBAA2B,EAC3B,QAAgB,GACjB,GAAE,qBAA0B,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAU5D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAqCtE;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CAAC,EACrC,IAAY,EACZ,oBAA2B,EAC3B,QAAgB,GACjB,GAAE,qBAA0B,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAU5D;AAED,cAAc,SAAS,CAAC"}
package/build/index.js CHANGED
@@ -50,4 +50,5 @@ export async function getDocumentAsync({ type = '*/*', copyToCacheDirectory = tr
50
50
  });
51
51
  return mergeDeprecatedResult(result);
52
52
  }
53
+ export * from './types';
53
54
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAItD,MAA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ult } from './types';\nexport { DocumentPickerOptions, DocumentPickerResult as DocumentResult };\n\nconst DEPRECATED_RESULT_KEYS = [\n 'name',\n 'size',\n 'uri',\n 'mimeType',\n 'lastModified',\n 'file',\n 'output',\n];\n\nfunction mergeDeprecatedResult(result: DocumentPickerResult): DocumentPickerResult {\n const firstAsset = result.assets?.[0];\n const deprecatedResult = {\n ...result,\n get type() {\n console.warn(\n 'Key \"type\" in the document picker result is deprecated and will be removed in SDK 49, use \"canceled\" instead'\n );\n return this.canceled ? 'cancel' : 'success';\n },\n };\n for (const key of DEPRECATED_RESULT_KEYS) {\n Object.defineProperty(deprecatedResult, key, {\n get() {\n console.warn(\n `Key \"${key}\" in the document picker result is deprecated and will be removed in SDK 49, you can access selected assets through the \"assets\" array instead`\n );\n return firstAsset?.[key];\n },\n });\n }\n return deprecatedResult;\n}\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<DocumentPickerResult> {\n if (typeof type === 'string') {\n type = [type] as string[];\n }\n const result = await ExpoDocumentPicker.getDocumentAsync({\n type,\n copyToCacheDirectory,\n multiple,\n });\n return mergeDeprecatedResult(result);\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAGtD,MAAM,sBAAsB,GAAG;IAC7B,MAAM;IACN,MAAM;IACN,KAAK;IACL,UAAU;IACV,cAAc;IACd,MAAM;IACN,QAAQ;CACT,CAAC;AAEF,SAAS,qBAAqB,CAAC,MAA4B;IACzD,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,gBAAgB,GAAG;QACvB,GAAG,MAAM;QACT,IAAI,IAAI;YACN,OAAO,CAAC,IAAI,CACV,8GAA8G,CAC/G,CAAC;YACF,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9C,CAAC;KACF,CAAC;IACF,KAAK,MAAM,GAAG,IAAI,sBAAsB,EAAE;QACxC,MAAM,CAAC,cAAc,CAAC,gBAAgB,EAAE,GAAG,EAAE;YAC3C,GAAG;gBACD,OAAO,CAAC,IAAI,CACV,QAAQ,GAAG,gJAAgJ,CAC5J,CAAC;gBACF,OAAO,UAAU,EAAE,CAAC,GAAG,CAAC,CAAC;YAC3B,CAAC;SACF,CAAC,CAAC;KACJ;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,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,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,gBAAgB,CAAC;QACvD,IAAI;QACJ,oBAAoB;QACpB,QAAQ;KACT,CAAC,CAAC;IACH,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC;AAED,cAAc,SAAS,CAAC","sourcesContent":["import ExpoDocumentPicker from './ExpoDocumentPicker';\nimport { DocumentPickerOptions, DocumentPickerResult } from './types';\n\nconst DEPRECATED_RESULT_KEYS = [\n 'name',\n 'size',\n 'uri',\n 'mimeType',\n 'lastModified',\n 'file',\n 'output',\n];\n\nfunction mergeDeprecatedResult(result: DocumentPickerResult): DocumentPickerResult {\n const firstAsset = result.assets?.[0];\n const deprecatedResult = {\n ...result,\n get type() {\n console.warn(\n 'Key \"type\" in the document picker result is deprecated and will be removed in SDK 49, use \"canceled\" instead'\n );\n return this.canceled ? 'cancel' : 'success';\n },\n };\n for (const key of DEPRECATED_RESULT_KEYS) {\n Object.defineProperty(deprecatedResult, key, {\n get() {\n console.warn(\n `Key \"${key}\" in the document picker result is deprecated and will be removed in SDK 49, you can access selected assets through the \"assets\" array instead`\n );\n return firstAsset?.[key];\n },\n });\n }\n return deprecatedResult;\n}\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<DocumentPickerResult> {\n if (typeof type === 'string') {\n type = [type] as string[];\n }\n const result = await ExpoDocumentPicker.getDocumentAsync({\n type,\n copyToCacheDirectory,\n multiple,\n });\n return mergeDeprecatedResult(result);\n}\n\nexport * from './types';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-document-picker",
3
- "version": "11.3.0",
3
+ "version": "11.5.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",
@@ -40,5 +40,5 @@
40
40
  "peerDependencies": {
41
41
  "expo": "*"
42
42
  },
43
- "gitHead": "5d628076915823cbe56e281ec17c3a34cc0c1fc6"
43
+ "gitHead": "fa5ecca8251986b9f197cc14074eec0ab6dfb6db"
44
44
  }
package/src/index.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import ExpoDocumentPicker from './ExpoDocumentPicker';
2
2
  import { DocumentPickerOptions, DocumentPickerResult } from './types';
3
- export { DocumentPickerOptions, DocumentPickerResult as DocumentResult };
4
3
 
5
4
  const DEPRECATED_RESULT_KEYS = [
6
5
  'name',
@@ -63,3 +62,5 @@ export async function getDocumentAsync({
63
62
  });
64
63
  return mergeDeprecatedResult(result);
65
64
  }
65
+
66
+ export * from './types';