@react-native-documents/picker 10.0.1 → 10.1.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.
@@ -40,13 +40,14 @@ class FileOperations(private val uriMap: MutableMap<String, Uri>) {
40
40
  val map = filesToCopy.getMap(i)
41
41
 
42
42
  try {
43
- val newFile = copySingleFile(map, context, destinationDir)
43
+ val nonNullMap = map ?: throw IllegalArgumentException("keepLocalCopy: The file argument is null at index $i")
44
+ val newFile = copySingleFile(nonNullMap, context, destinationDir)
44
45
  oneResult.merge(newFile)
45
46
  } catch (e: Exception) {
46
47
  val message: String = e.localizedMessage ?: e.message ?: "Unknown error"
47
48
  oneResult.putString("status", "error")
48
49
  oneResult.putString("copyError", message)
49
- oneResult.putString("sourceUri", map.getString("uri"))
50
+ oneResult.putString("sourceUri", map?.getString("uri"))
50
51
  }
51
52
  return@async oneResult
52
53
  }
@@ -180,18 +180,17 @@ class RNDocumentPickerModule(reactContext: ReactApplicationContext) :
180
180
  val filesToCopy = options.getArray("files")
181
181
  val copyTo = options.getString("destination")
182
182
  if (copyTo == null || filesToCopy == null) {
183
- promise.reject("keepLocalCopy",
183
+ return promise.reject("keepLocalCopy",
184
184
  "You did not provide the correct options. Expected 'files' and 'destination', got: ${options.toHashMap().keys}"
185
185
  )
186
- } else {
187
- fileCopyingCoroutine.launch {
188
- val results = fileOps.copyFilesToLocalStorage(
189
- reactApplicationContext,
190
- filesToCopy,
191
- CopyDestination.fromPath(copyTo),
192
- )
193
- promise.resolve(results)
194
- }
186
+ }
187
+ fileCopyingCoroutine.launch {
188
+ val results = fileOps.copyFilesToLocalStorage(
189
+ reactApplicationContext,
190
+ filesToCopy,
191
+ CopyDestination.fromPath(copyTo),
192
+ )
193
+ promise.resolve(results)
195
194
  }
196
195
  }
197
196
 
@@ -6,7 +6,14 @@
6
6
  #import "RCTConvert+RNDocumentPicker.h"
7
7
  // this header file is generated by Xcode: https://developer.apple.com/documentation/swift/importing-swift-into-objective-c
8
8
  // if it cannot be found, try cleaning the build folder and Xcode derived data folder
9
+
10
+ // When using use_frameworks! :linkage => :static in Podfile
11
+ #if __has_include(<react_native_document_picker/react_native_document_picker-Swift.h>)
12
+ #import <react_native_document_picker/react_native_document_picker-Swift.h>
13
+ #else
9
14
  #import "react_native_document_picker-Swift.h"
15
+ #endif
16
+
10
17
  // for UIModalPresentationStyle conversion
11
18
  // remove after https://github.com/facebook/react-native/commit/2d547a3252b328251e49dabfeec85f8d46c85411 is released
12
19
  #import <React/RCTModalHostViewManager.h>
@@ -1 +1 @@
1
- {"root":["../setup.ts"],"version":"5.6.3"}
1
+ {"root":["../setup.ts"],"version":"5.7.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-documents/picker",
3
- "version": "10.0.1",
3
+ "version": "10.1.1",
4
4
  "description": "A react native interface to access documents from dropbox, google drive, iCloud...",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -26,8 +26,7 @@
26
26
  ],
27
27
  "scripts": {
28
28
  "build:mock": "tsc --build jest",
29
- "prepare": "bob build && yarn build:mock",
30
- "release": "yarn prepare && npx semantic-release"
29
+ "prepare": "bob build && yarn build:mock"
31
30
  },
32
31
  "codegenConfig": {
33
32
  "name": "rndocumentpickerCGen",
@@ -51,7 +50,7 @@
51
50
  "url": "git+https://github.com/react-native-documents/document-picker.git"
52
51
  },
53
52
  "author": "Vojtech Novak (hello@react-native-training.eu)",
54
- "license": "see LICENSE file",
53
+ "license": "MIT",
55
54
  "bugs": {
56
55
  "url": "https://github.com/react-native-documents/document-picker/issues"
57
56
  },
@@ -61,8 +60,8 @@
61
60
  },
62
61
  "devDependencies": {
63
62
  "@tsconfig/node18": "^18.2.4",
64
- "react-native-builder-bob": "^0.30.2",
65
- "typescript": "^5.6.2"
63
+ "react-native-builder-bob": "^0.36.0",
64
+ "typescript": "^5.7.3"
66
65
  },
67
66
  "peerDependencies": {
68
67
  "react": "*",
@@ -87,6 +86,5 @@
87
86
  }
88
87
  ]
89
88
  ]
90
- },
91
- "packageManager": "yarn@4.5.1"
89
+ }
92
90
  }
@@ -21,10 +21,5 @@ Pod::Spec.new do |s|
21
21
  'DEFINES_MODULE' => 'YES',
22
22
  }
23
23
 
24
- if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
25
- # RN 71+
26
- install_modules_dependencies(s)
27
- else
28
- s.dependency "React-Core"
29
- end
24
+ install_modules_dependencies(s)
30
25
  end