expo-document-picker 10.1.3 → 10.2.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,18 +10,28 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
- ## 10.1.3 — 2022-02-09
13
+ ## 10.2.0 — 2022-04-18
14
+
15
+ ### 💡 Others
16
+
17
+ - Updated `@expo/config-plugins` from `4.0.2` to `4.0.14` ([#15621](https://github.com/expo/expo/pull/15621) by [@EvanBacon](https://github.com/EvanBacon))
18
+
19
+ ### ⚠️ Notices
20
+
21
+ - On Android bump `compileSdkVersion` to `31`, `targetSdkVersion` to `31` and `Java` version to `11`. ([#16941](https://github.com/expo/expo/pull/16941) by [@bbarthec](https://github.com/bbarthec))
22
+
23
+ ## 10.1.3 - 2022-02-09
14
24
 
15
25
  _This version does not introduce any user-facing changes._
16
26
 
17
- ## 10.1.2 2022-02-01
27
+ ## 10.1.2 - 2022-02-01
18
28
 
19
29
  ### 🐛 Bug fixes
20
30
 
21
31
  - Fix `Plugin with id 'maven' not found` build error from Android Gradle 7. ([#16080](https://github.com/expo/expo/pull/16080) by [@kudo](https://github.com/kudo))
22
32
  - Handle nil MIME type. ([#16156](https://github.com/expo/expo/pull/16156) by [@brentvatne](https://github.com/brentvatne))
23
33
 
24
- ## 10.1.1 2022-01-26
34
+ ## 10.1.1 - 2022-01-26
25
35
 
26
36
  ### 🐛 Bug fixes
27
37
 
package/README.md CHANGED
@@ -4,12 +4,12 @@ Provides access to the system's UI for selecting documents from the available pr
4
4
 
5
5
  # API documentation
6
6
 
7
- - [Documentation for the master branch](https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/sdk/document-picker.md)
8
- - [Documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/document-picker/)
7
+ - [Documentation for the main branch](https://github.com/expo/expo/blob/main/docs/pages/versions/unversioned/sdk/document-picker.md)
8
+ - [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/document-picker/)
9
9
 
10
10
  # Installation in managed Expo projects
11
11
 
12
- For managed [managed](https://docs.expo.io/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/document-picker/).
12
+ For [managed](https://docs.expo.dev/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/document-picker/).
13
13
 
14
14
  # Installation in bare React Native projects
15
15
 
@@ -3,20 +3,35 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '10.1.3'
6
+ version = '10.2.0'
7
7
 
8
8
  buildscript {
9
+ def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
10
+ if (expoModulesCorePlugin.exists()) {
11
+ apply from: expoModulesCorePlugin
12
+ applyKotlinExpoModulesCorePlugin()
13
+ }
14
+
9
15
  // Simple helper that allows the root project to override versions declared by this library.
10
16
  ext.safeExtGet = { prop, fallback ->
11
17
  rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
12
18
  }
13
19
 
20
+ // Ensures backward compatibility
21
+ ext.getKotlinVersion = {
22
+ if (ext.has("kotlinVersion")) {
23
+ ext.kotlinVersion()
24
+ } else {
25
+ ext.safeExtGet("kotlinVersion", "1.6.10")
26
+ }
27
+ }
28
+
14
29
  repositories {
15
30
  mavenCentral()
16
31
  }
17
32
 
18
33
  dependencies {
19
- classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.4.21')}")
34
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
20
35
  }
21
36
  }
22
37
 
@@ -44,22 +59,22 @@ afterEvaluate {
44
59
  }
45
60
 
46
61
  android {
47
- compileSdkVersion safeExtGet("compileSdkVersion", 30)
62
+ compileSdkVersion safeExtGet("compileSdkVersion", 31)
48
63
 
49
64
  compileOptions {
50
- sourceCompatibility JavaVersion.VERSION_1_8
51
- targetCompatibility JavaVersion.VERSION_1_8
65
+ sourceCompatibility JavaVersion.VERSION_11
66
+ targetCompatibility JavaVersion.VERSION_11
52
67
  }
53
68
 
54
69
  kotlinOptions {
55
- jvmTarget = JavaVersion.VERSION_1_8
70
+ jvmTarget = JavaVersion.VERSION_11.majorVersion
56
71
  }
57
72
 
58
73
  defaultConfig {
59
74
  minSdkVersion safeExtGet("minSdkVersion", 21)
60
- targetSdkVersion safeExtGet("targetSdkVersion", 30)
75
+ targetSdkVersion safeExtGet("targetSdkVersion", 31)
61
76
  versionCode 17
62
- versionName '10.1.3'
77
+ versionName '10.2.0'
63
78
  }
64
79
  lintOptions {
65
80
  abortOnError false
@@ -72,5 +87,5 @@ dependencies {
72
87
  api "androidx.annotation:annotation:1.0.0"
73
88
  api 'commons-io:commons-io:2.6'
74
89
 
75
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet('kotlinVersion', '1.4.21')}"
90
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
76
91
  }
@@ -1,2 +1,3 @@
1
1
  declare const _default: import("expo-modules-core").ProxyNativeModule;
2
2
  export default _default;
3
+ //# sourceMappingURL=ExpoDocumentPicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoDocumentPicker.d.ts","sourceRoot":"","sources":["../src/ExpoDocumentPicker.ts"],"names":[],"mappings":";AAEA,wBAAqD"}
@@ -4,3 +4,4 @@ declare const _default: {
4
4
  getDocumentAsync({ type, multiple, }: DocumentPickerOptions): Promise<DocumentResult>;
5
5
  };
6
6
  export default _default;
7
+ //# sourceMappingURL=ExpoDocumentPicker.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoDocumentPicker.web.d.ts","sourceRoot":"","sources":["../src/ExpoDocumentPicker.web.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;;;0CAU3D,qBAAqB,GAAG,QAAQ,cAAc,CAAC;;AARpD,wBA4DE"}
package/build/index.d.ts CHANGED
@@ -12,3 +12,4 @@ export { DocumentPickerOptions, DocumentResult };
12
12
  * If the user cancelled the document picking, the promise resolves to `{ type: 'cancel' }`.
13
13
  */
14
14
  export declare function getDocumentAsync({ type, copyToCacheDirectory, multiple, }?: DocumentPickerOptions): Promise<DocumentResult>;
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,CAAC;AAGjD;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CAAC,EACrC,IAAY,EACZ,oBAA2B,EAC3B,QAAgB,GACjB,GAAE,qBAA0B,GAAG,OAAO,CAAC,cAAc,CAAC,CAKtD"}
package/build/types.d.ts CHANGED
@@ -48,3 +48,4 @@ export declare type DocumentResult = {
48
48
  file?: File;
49
49
  output?: FileList | null;
50
50
  };
51
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,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,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC1B,CAAC"}
@@ -39,7 +39,7 @@
39
39
  static NSString * EXConvertMimeTypeToUTI(NSString *mimeType)
40
40
  {
41
41
  CFStringRef uti;
42
-
42
+
43
43
  // UTTypeCreatePreferredIdentifierForTag doesn't work with wildcard mimetypes
44
44
  // so support common top level types with wildcards here.
45
45
  if ([mimeType isEqualToString:@"*/*"]) {
@@ -56,7 +56,7 @@ static NSString * EXConvertMimeTypeToUTI(NSString *mimeType)
56
56
  CFStringRef mimeTypeRef = (__bridge CFStringRef)mimeType;
57
57
  uti = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mimeTypeRef, NULL);
58
58
  }
59
-
59
+
60
60
  return (__bridge_transfer NSString *)uti;
61
61
  }
62
62
 
@@ -80,7 +80,7 @@ EX_EXPORT_MODULE(ExpoDocumentPicker);
80
80
  - (void)setModuleRegistry:(EXModuleRegistry *)moduleRegistry
81
81
  {
82
82
  _moduleRegistry = moduleRegistry;
83
-
83
+
84
84
  if (_moduleRegistry != nil) {
85
85
  _fileSystem = [moduleRegistry getModuleImplementingProtocol:@protocol(EXFileSystemInterface)];
86
86
  _utilities = [moduleRegistry getModuleImplementingProtocol:@protocol(EXUtilitiesInterface)];
@@ -97,7 +97,7 @@ EX_EXPORT_METHOD_AS(getDocumentAsync,
97
97
  }
98
98
  _resolve = resolve;
99
99
  _reject = reject;
100
-
100
+
101
101
  NSArray *mimeTypes = options[@"type"] ?: @[@"*/*"];
102
102
  if (mimeTypes.count == 0) {
103
103
  reject(@"E_DOCUMENT_PICKER", @"type must be a list of strings.", nil);
@@ -136,7 +136,7 @@ EX_EXPORT_METHOD_AS(getDocumentAsync,
136
136
  #endif
137
137
  }
138
138
  @catch (NSException *exception) {
139
- reject(@"E_PICKER_ICLOUD", @"DocumentPicker requires the iCloud entitlement. If you are using ExpoKit, you need to add this capability to your App Id. See `https://docs.expo.io/versions/latest/expokit/advanced-expokit-topics#using-documentpicker` for more info.", nil);
139
+ reject(@"E_PICKER_ICLOUD", @"DocumentPicker requires the iCloud entitlement. If you are using ExpoKit, you need to add this capability to your App Id. See `https://docs.expo.dev/versions/latest/expokit/advanced-expokit-topics#using-documentpicker` for more info.", nil);
140
140
  self->_resolve = nil;
141
141
  self->_reject = nil;
142
142
  return;
@@ -165,7 +165,7 @@ EX_EXPORT_METHOD_AS(getDocumentAsync,
165
165
  _reject = nil;
166
166
  return;
167
167
  }
168
-
168
+
169
169
  NSURL *newUrl = url;
170
170
  if (_shouldCopyToCacheDirectory) {
171
171
  if (!_fileSystem) {
@@ -183,7 +183,7 @@ EX_EXPORT_METHOD_AS(getDocumentAsync,
183
183
  return;
184
184
  }
185
185
  }
186
-
186
+
187
187
  NSString *extension = [url pathExtension];
188
188
  NSString *mimeType = [EXDocumentPickerModule getMimeType:extension];
189
189
 
@@ -224,17 +224,17 @@ EX_EXPORT_METHOD_AS(getDocumentAsync,
224
224
  if (*error) {
225
225
  return 0;
226
226
  }
227
-
227
+
228
228
  if (fileAttributes.fileType != NSFileTypeDirectory) {
229
229
  return fileAttributes.fileSize;
230
230
  }
231
-
231
+
232
232
  // The path is pointing to the folder
233
233
  NSArray *contents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:error];
234
234
  if (*error) {
235
235
  return 0;
236
236
  }
237
-
237
+
238
238
  NSEnumerator *contentsEnumurator = [contents objectEnumerator];
239
239
  NSString *file;
240
240
  unsigned long long folderSize = 0;
@@ -244,7 +244,7 @@ EX_EXPORT_METHOD_AS(getDocumentAsync,
244
244
  return 0;
245
245
  }
246
246
  }
247
-
247
+
248
248
  return folderSize;
249
249
  }
250
250
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-document-picker",
3
- "version": "10.1.3",
3
+ "version": "10.2.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",
@@ -35,7 +35,7 @@
35
35
  "preset": "expo-module-scripts"
36
36
  },
37
37
  "dependencies": {
38
- "@expo/config-plugins": "^4.0.2",
38
+ "@expo/config-plugins": "^4.0.14",
39
39
  "uuid": "^3.3.2"
40
40
  },
41
41
  "devDependencies": {
@@ -44,5 +44,5 @@
44
44
  "peerDependencies": {
45
45
  "expo": "*"
46
46
  },
47
- "gitHead": "fc89e291a33d38323e192761f940ddc583513c76"
47
+ "gitHead": "22dce752354bb429c84851bc4389abe47a766b1f"
48
48
  }