expo-document-picker 11.3.0 → 11.4.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,12 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 11.4.0 — 2023-05-08
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Export all types from the module. ([#22172](https://github.com/expo/expo/pull/22172) by [@alanjhughes](https://github.com/alanjhughes))
18
+
13
19
  ## 11.3.0 — 2023-04-14
14
20
 
15
21
  ### 🎉 New features
package/README.md CHANGED
@@ -18,7 +18,7 @@ For bare React Native projects, you must ensure that you have [installed and con
18
18
  ### Add the package to your npm dependencies
19
19
 
20
20
  ```
21
- expo install expo-document-picker
21
+ npx expo install expo-document-picker
22
22
  ```
23
23
 
24
24
  ### Configure for iOS
@@ -45,7 +45,7 @@ You can change the `com.apple.developer.icloud-container-environment` entitlemen
45
45
  }
46
46
  ```
47
47
 
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.
48
+ > 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
49
 
50
50
  # Contributing
51
51
 
@@ -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.4.0'
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", 33)
76
76
  versionCode 17
77
- versionName '11.3.0'
77
+ versionName '11.4.0'
78
78
  }
79
79
  lintOptions {
80
80
  abortOnError false
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,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","sourcesContent":["import ExpoDocumentPicker from './ExpoDocumentPicker';\nimport { DocumentPickerOptions, DocumentPickerResult } 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.4.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": "4ba50c428c8369bb6b3a51a860d4898ad4ccbe78"
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';