@nativescript-community/ui-document-picker 1.1.7 → 1.1.8

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.
@@ -19,7 +19,7 @@ var DocumentPickerDelegate = /** @class */ (function (_super) {
19
19
  DocumentPickerDelegate.prototype.documentPickerDidPickDocumentAtURL = function (controller, url) {
20
20
  this._resolve({
21
21
  files: [url.absoluteString],
22
- ios: url,
22
+ ios: url
23
23
  });
24
24
  this.cleanup(controller);
25
25
  };
@@ -30,13 +30,13 @@ var DocumentPickerDelegate = /** @class */ (function (_super) {
30
30
  }
31
31
  this._resolve({
32
32
  files: output,
33
- ios: urls,
33
+ ios: urls
34
34
  });
35
35
  this.cleanup(controller);
36
36
  };
37
37
  DocumentPickerDelegate.prototype.documentPickerWasCancelled = function (controller) {
38
38
  this._resolve({
39
- files: [],
39
+ files: []
40
40
  });
41
41
  this.cleanup(controller);
42
42
  };
@@ -60,4 +60,9 @@ export function openFilePicker(params) {
60
60
  visibleVC.presentViewControllerAnimatedCompletion(controller, true, null);
61
61
  });
62
62
  }
63
- //# sourceMappingURL=filepicker.ios.js.map
63
+ export async function pickFolder(params = {}) {
64
+ return {
65
+ folders: []
66
+ };
67
+ }
68
+ //# sourceMappingURL=index.ios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.ios.js","sourceRoot":"../src/","sources":["index.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuD3C,IAAI,QAAQ,CAAC;AACb,MAAM,UAAU,cAAc,CAAC,MAAyB;IAEpD,IAAI,aAAa,CAAC;IAElB,IAAI,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;QACnD,aAAa,GAAG,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,gBAAgB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;KAC7E;IAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACnC,MAAM,UAAU,GAAG,8BAA8B,CAAC,KAAK,EAAE,CAAC,2BAA2B,CACjF,aAAa,EACb,MAAM,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAA4B,CACpF,CAAC;QACF,QAAQ,GAAG,sBAAsB,CAAC,qBAAqB,CAAC,OAAO,EAAE,MAAM,CAAQ,CAAC;QAChF,UAAU,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAG/B,UAAU,CAAC,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC;QAIhE,MAAM,GAAG,GAAG,aAAa,CAAC,iBAAiB,CAAC;QAC5C,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1E,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,wBAAwB,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;QAChF,SAAS,CAAC,uCAAuC,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;AACP,CAAC;AACD,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,SAA8B,EAAE;IAC7D,OAAO;QACH,OAAO,EAAE,EAAE;KACd,CAAC;AACN,CAAC"}
package/package.json CHANGED
@@ -1,35 +1,42 @@
1
1
  {
2
- "name": "@nativescript-community/ui-document-picker",
3
- "version": "1.1.7",
4
- "description": "File Picker",
5
- "main": "./filepicker",
6
- "typings": "./filepicker.d.ts",
7
- "sideEffects": false,
8
- "nativescript": {
9
- "platforms": {
10
- "android": "3.0.0",
11
- "ios": "3.0.0"
12
- }
13
- },
14
- "repository": {
15
- "type": "git",
16
- "url": "https://github.com/nativescript-community/ui-document-picker.git"
17
- },
18
- "keywords": [
19
- "ecosystem:NativeScript",
20
- "NativeScript"
21
- ],
22
- "author": {
23
- "name": "Martin Guillon",
24
- "email": "martin.guillon@akyasl.fr"
25
- },
26
- "license": "MIT",
27
- "bugs": {
28
- "url": "https://github.com/nativescript-community/ui-document-picker/issues"
29
- },
30
- "homepage": "https://github.com/nativescript-community/ui-document-picker",
31
- "dependencies": {
32
- "@nativescript-community/perms": "^2.1.0"
33
- },
34
- "gitHead": "40975088276c5aeeb0044ea49f1a2f4db11e7193"
2
+ "name": "@nativescript-community/ui-document-picker",
3
+ "version": "1.1.8",
4
+ "description": "A NativeScript plugin that allows you to select files from the device.",
5
+ "main": "index",
6
+ "typings": "index.d.ts",
7
+ "sideEffects": false,
8
+ "scripts": {
9
+ "build": "npm run tsc && npm run readme",
10
+ "readme": "../../node_modules/.bin/readme generate -c ../../tools/readme/blueprint.json",
11
+ "tsc": "../../node_modules/.bin/cpy '**/*.d.ts' '../../packages/ui-document-picker' --parents --cwd=../../src/ui-document-picker && ../../node_modules/.bin/tsc -skipLibCheck -d",
12
+ "clean": "../../node_modules/.bin/rimraf ./*.d.ts ./*.js ./*.js.map"
13
+ },
14
+ "nativescript": {
15
+ "platforms": {
16
+ "android": "6.0.0",
17
+ "ios": "6.0.0"
18
+ }
19
+ },
20
+ "keywords": [
21
+ "NativeScript",
22
+ "JavaScript",
23
+ "Android",
24
+ "iOS",
25
+ "vue",
26
+ "vue.js"
27
+ ],
28
+ "author": {
29
+ "name": "Martin Guillon",
30
+ "email": "martin@akylas.fr"
31
+ },
32
+ "bugs": {
33
+ "url": "https://github.com/nativescript-community/ui-document-picker/issues"
34
+ },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "https://github.com/nativescript-community/ui-document-picker"
38
+ },
39
+ "license": "Apache-2.0",
40
+ "readmeFilename": "README.md",
41
+ "gitHead": "30e29361ede5e1358c817782694db6af592296e3"
35
42
  }
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
3
+ <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
4
+ </manifest>
@@ -0,0 +1,5 @@
1
+ dependencies {
2
+ def storageVersion = project.hasProperty("storageVersion") ? project.storageVersion : "0.13.0"
3
+ implementation "com.anggrayudi:storage:$storageVersion"
4
+
5
+ }
@@ -100,6 +100,8 @@ public class FilePath {
100
100
  if (cursor != null && cursor.moveToFirst()) {
101
101
  final int column_index = cursor.getColumnIndexOrThrow(column);
102
102
  return cursor.getString(column_index);
103
+ } else if (!cursor.moveToFirst()){
104
+ return getMediaStore(context, uri, null, null);
103
105
  }
104
106
  } finally {
105
107
  if (cursor != null)
@@ -225,6 +227,7 @@ public class FilePath {
225
227
 
226
228
  Log.d(TAG, "File - " +
227
229
  "Authority: " + uri.getAuthority() +
230
+ ", Path: " + uri.getPath() +
228
231
  ", Fragment: " + uri.getFragment() +
229
232
  ", Port: " + uri.getPort() +
230
233
  ", Query: " + uri.getQuery() +
@@ -260,7 +263,10 @@ public class FilePath {
260
263
  cursor = context.getContentResolver().query(uri, new String[]{MediaStore.MediaColumns.DISPLAY_NAME}, null, null, null);
261
264
  if (cursor != null && cursor.moveToFirst()) {
262
265
  String fileName = cursor.getString(0);
263
- String path = Environment.getExternalStorageDirectory().toString() + "/Download/" + fileName;
266
+ String folders = android.os.Environment.getExternalStoragePublicDirectory(
267
+ android.os.Environment.DIRECTORY_DOWNLOADS
268
+ ).getAbsolutePath();
269
+ String path = folders + "/" + fileName;
264
270
  if (!TextUtils.isEmpty(path)) {
265
271
  return path;
266
272
  }
@@ -0,0 +1 @@
1
+ /// <reference path="./typings/android.d.ts" />