@nativescript-community/ui-document-picker 1.1.12 → 1.1.13
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 +3 -58
- package/README.md +72 -12
- package/index.android.d.ts +2 -1
- package/index.android.js +80 -11
- package/index.android.js.map +1 -1
- package/index.common.d.ts +5 -0
- package/index.d.ts +2 -1
- package/index.ios.d.ts +2 -1
- package/index.ios.js +55 -18
- package/index.ios.js.map +1 -1
- package/package.json +3 -3
- package/references.d.ts +2 -0
package/CHANGELOG.md
CHANGED
@@ -3,132 +3,77 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
-
## [1.1.
|
6
|
+
## [1.1.13](https://github.com/nativescript-community/ui-document-picker/compare/v1.1.12...v1.1.13) (2023-10-24)
|
7
7
|
|
8
8
|
**Note:** Version bump only for package @nativescript-community/ui-document-picker
|
9
9
|
|
10
|
+
## [1.1.12](https://github.com/nativescript-community/ui-document-picker/compare/v1.1.11...v1.1.12) (2022-02-18)
|
10
11
|
|
11
|
-
|
12
|
-
|
12
|
+
**Note:** Version bump only for package @nativescript-community/ui-document-picker
|
13
13
|
|
14
14
|
## [1.1.11](https://github.com/nativescript-community/ui-document-picker/compare/v1.1.10...v1.1.11) (2022-02-16)
|
15
15
|
|
16
|
-
|
17
16
|
### Bug Fixes
|
18
17
|
|
19
18
|
* missing dependency ([203fb9e](https://github.com/nativescript-community/ui-document-picker/commit/203fb9e46c7f6c526ff67c50ff8f60d842bd097e))
|
20
19
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
20
|
## [1.1.10](https://github.com/nativescript-community/ui-document-picker/compare/v1.1.9...v1.1.10) (2022-02-16)
|
26
21
|
|
27
|
-
|
28
22
|
### Bug Fixes
|
29
23
|
|
30
24
|
* **android:** removed unused dependency ([448d753](https://github.com/nativescript-community/ui-document-picker/commit/448d75379ce7c25d6faba64b2a4a320b4f5e058c))
|
31
25
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
26
|
## [1.1.9](https://github.com/nativescript-community/ui-document-picker/compare/v1.1.8...v1.1.9) (2022-01-29)
|
37
27
|
|
38
|
-
|
39
28
|
### Bug Fixes
|
40
29
|
|
41
30
|
* **android:** fixed path on some devices ([97881c8](https://github.com/nativescript-community/ui-document-picker/commit/97881c808dee5fb4f78339e2562482554dbe3bc4))
|
42
31
|
* **android:** remove `MANAGE_EXTERNAL_STORAGE` as it prevents app release ([564a5b3](https://github.com/nativescript-community/ui-document-picker/commit/564a5b3706c9bdd2ba9be963e77b7f03bd5f6eb4))
|
43
32
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
33
|
## [1.1.8](https://github.com/nativescript-community/ui-document-picker/compare/v13.0.32...v1.1.8) (2021-12-03)
|
49
34
|
|
50
|
-
|
51
35
|
### Bug Fixes
|
52
36
|
|
53
37
|
* package version ([9e52a0d](https://github.com/nativescript-community/ui-document-picker/commit/9e52a0ddec67b47a369efbf422731388681e2965))
|
54
38
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
39
|
## [13.0.32](https://github.com/nativescript-community/ui-document-picker/compare/v1.1.7...v13.0.32) (2021-12-03)
|
60
40
|
|
61
41
|
**Note:** Version bump only for package @nativescript-community/ui-document-picker
|
62
42
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
43
|
## [1.1.7](https://github.com/nativescript-community/ui-document-picker/compare/v1.1.6...v1.1.7) (2021-08-25)
|
68
44
|
|
69
45
|
**Note:** Version bump only for package @nativescript-community/ui-document-picker
|
70
46
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
47
|
## [1.1.6](https://github.com/nativescript-community/ui-document-picker/compare/v1.1.5...v1.1.6) (2021-06-28)
|
76
48
|
|
77
|
-
|
78
49
|
### Reverts
|
79
50
|
|
80
51
|
* Revert "v1.1.6" ([ef0be58](https://github.com/nativescript-community/ui-document-picker/commit/ef0be58589aa75a6be4a85b2837b6f968c341b08))
|
81
52
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
53
|
## [1.1.5](https://github.com/nativescript-community/ui-document-picker/compare/v1.1.4...v1.1.5) (2021-05-19)
|
87
54
|
|
88
55
|
**Note:** Version bump only for package @nativescript-community/ui-document-picker
|
89
56
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
57
|
## [1.1.4](https://github.com/nativescript-community/ui-document-picker/compare/v1.1.3...v1.1.4) (2021-05-04)
|
95
58
|
|
96
59
|
**Note:** Version bump only for package @nativescript-community/ui-document-picker
|
97
60
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
61
|
## [1.1.3](https://github.com/nativescript-community/ui-document-picker/compare/v1.1.2...v1.1.3) (2020-11-02)
|
103
62
|
|
104
63
|
**Note:** Version bump only for package @nativescript-community/ui-document-picker
|
105
64
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
65
|
## [1.1.2](https://github.com/nativescript-community/ui-document-picker/compare/v1.1.1...v1.1.2) (2020-10-13)
|
111
66
|
|
112
67
|
**Note:** Version bump only for package @nativescript-community/ui-document-picker
|
113
68
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
69
|
## [1.1.1](https://github.com/nativescript-community/ui-document-picker/compare/v1.1.0...v1.1.1) (2020-09-17)
|
119
70
|
|
120
|
-
|
121
71
|
### Bug Fixes
|
122
72
|
|
123
73
|
* **android:** build fix ([6d6495f](https://github.com/nativescript-community/ui-document-picker/commit/6d6495f8cbbd81f55773d74aae0fa0da0480dc21))
|
124
74
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
75
|
# 1.1.0 (2020-09-06)
|
130
76
|
|
131
|
-
|
132
77
|
### Features
|
133
78
|
|
134
79
|
* N7 and new plugin name ([1b9c4ab](https://github.com/nativescript-community/ui-document-picker/commit/1b9c4abf4eb1c64c8cee565f7a4ae08319718e3a))
|
package/README.md
CHANGED
@@ -43,9 +43,15 @@
|
|
43
43
|
* [Vue](#vue)
|
44
44
|
* [Examples](#examples)
|
45
45
|
* [Demos and Development](#demos-and-development)
|
46
|
-
* [Setup](#setup)
|
46
|
+
* [Repo Setup](#repo-setup)
|
47
47
|
* [Build](#build)
|
48
48
|
* [Demos](#demos)
|
49
|
+
* [Contributing](#contributing)
|
50
|
+
* [Update repo ](#update-repo-)
|
51
|
+
* [Update readme ](#update-readme-)
|
52
|
+
* [Update doc ](#update-doc-)
|
53
|
+
* [Publish](#publish)
|
54
|
+
* [modifying submodules](#modifying-submodules)
|
49
55
|
* [Questions](#questions)
|
50
56
|
|
51
57
|
|
@@ -93,18 +99,18 @@ export function openFilePicker(params: FilePickerOptions): Promise<{ files: stri
|
|
93
99
|
## Demos and Development
|
94
100
|
|
95
101
|
|
96
|
-
### Setup
|
97
|
-
|
98
|
-
To run the demos, you must clone this repo **recursively**.
|
102
|
+
### Repo Setup
|
99
103
|
|
104
|
+
The repo uses submodules. If you did not clone with ` --recursive` then you need to call
|
100
105
|
```
|
101
|
-
git
|
106
|
+
git submodule update --init
|
102
107
|
```
|
103
108
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
109
|
+
The package manager used to install and link dependencies must be `pnpm` or `yarn`. `npm` wont work.
|
110
|
+
|
111
|
+
To develop and test:
|
112
|
+
if you use `yarn` then run `yarn`
|
113
|
+
if you use `pnpm` then run `pnpm i`
|
108
114
|
|
109
115
|
**Interactive Menu:**
|
110
116
|
|
@@ -113,10 +119,9 @@ To start the interactive menu, run `npm start` (or `yarn start` or `pnpm start`)
|
|
113
119
|
### Build
|
114
120
|
|
115
121
|
```bash
|
116
|
-
npm run build
|
117
|
-
|
118
|
-
npm run build.angular # or for Angular
|
122
|
+
npm run build.all
|
119
123
|
```
|
124
|
+
WARNING: it seems `yarn build.all` wont always work (not finding binaries in `node_modules/.bin`) which is why the doc explicitly uses `npm run`
|
120
125
|
|
121
126
|
### Demos
|
122
127
|
|
@@ -125,6 +130,61 @@ npm run demo.[ng|react|svelte|vue].[ios|android]
|
|
125
130
|
|
126
131
|
npm run demo.svelte.ios # Example
|
127
132
|
```
|
133
|
+
|
134
|
+
Demo setup is a bit special in the sense that if you want to modify/add demos you dont work directly in `demo-[ng|react|svelte|vue]`
|
135
|
+
Instead you work in `demo-snippets/[ng|react|svelte|vue]`
|
136
|
+
You can start from the `install.ts` of each flavor to see how to register new demos
|
137
|
+
|
138
|
+
|
139
|
+
[](#contributing)
|
140
|
+
|
141
|
+
## Contributing
|
142
|
+
|
143
|
+
### Update repo
|
144
|
+
|
145
|
+
You can update the repo files quite easily
|
146
|
+
|
147
|
+
First update the submodules
|
148
|
+
|
149
|
+
```bash
|
150
|
+
npm run update
|
151
|
+
```
|
152
|
+
|
153
|
+
Then commit the changes
|
154
|
+
Then update common files
|
155
|
+
|
156
|
+
```bash
|
157
|
+
npm run sync
|
158
|
+
```
|
159
|
+
Then you can run `yarn|pnpm`, commit changed files if any
|
160
|
+
|
161
|
+
### Update readme
|
162
|
+
```bash
|
163
|
+
npm run readme
|
164
|
+
```
|
165
|
+
|
166
|
+
### Update doc
|
167
|
+
```bash
|
168
|
+
npm run doc
|
169
|
+
```
|
170
|
+
|
171
|
+
### Publish
|
172
|
+
|
173
|
+
The publishing is completely handled by `lerna` (you can add `-- --bump major` to force a major release)
|
174
|
+
Simply run
|
175
|
+
```shell
|
176
|
+
npm run publish
|
177
|
+
```
|
178
|
+
|
179
|
+
### modifying submodules
|
180
|
+
|
181
|
+
The repo uses https:// for submodules which means you won't be able to push directly into the submodules.
|
182
|
+
One easy solution is t modify `~/.gitconfig` and add
|
183
|
+
```
|
184
|
+
[url "ssh://git@github.com/"]
|
185
|
+
pushInsteadOf = https://github.com/
|
186
|
+
```
|
187
|
+
|
128
188
|
|
129
189
|
[](#questions)
|
130
190
|
|
package/index.android.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { FilePickerOptions, FolderPickerOptions } from './index.common';
|
1
|
+
import { FilePickerOptions, FolderPickerOptions, SaveFileOptions } from './index.common';
|
2
2
|
export { FilePickerOptions };
|
3
3
|
export declare function openFilePicker(params?: FilePickerOptions): Promise<{
|
4
4
|
files: string[];
|
@@ -20,3 +20,4 @@ export declare function pickFolder(params?: FolderPickerOptions): Promise<{
|
|
20
20
|
folders: any[];
|
21
21
|
android?: undefined;
|
22
22
|
}>;
|
23
|
+
export declare function saveFile(params: SaveFileOptions): Promise<boolean>;
|
package/index.android.js
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
import { request } from '@nativescript-community/perms';
|
2
|
-
import {
|
3
|
-
import { AndroidApplication, Device } from '@nativescript/core';
|
2
|
+
import { AndroidApplication, Application, Device, File, Utils, knownFolders } from '@nativescript/core';
|
4
3
|
import lazy from '@nativescript/core/utils/lazy';
|
5
4
|
let Intent;
|
6
5
|
let FilePath;
|
@@ -11,13 +10,16 @@ async function callIntent(context, intent, pickerType) {
|
|
11
10
|
const onEvent = function (e) {
|
12
11
|
if (e.requestCode === pickerType) {
|
13
12
|
resolve(e);
|
14
|
-
|
13
|
+
Application.android.off(AndroidApplication.activityResultEvent, onEvent);
|
15
14
|
}
|
16
15
|
};
|
17
|
-
|
16
|
+
Application.android.once(AndroidApplication.activityResultEvent, onEvent);
|
18
17
|
context.startActivityForResult(intent, pickerType);
|
19
18
|
});
|
20
19
|
}
|
20
|
+
/**
|
21
|
+
* Convert to android Array
|
22
|
+
*/
|
21
23
|
function convertToArray(types) {
|
22
24
|
let mimeTypes;
|
23
25
|
if (types && types.length > 0) {
|
@@ -52,8 +54,7 @@ function prepareIntent(intent, options) {
|
|
52
54
|
}
|
53
55
|
}
|
54
56
|
export function openFilePicker(params = {}) {
|
55
|
-
|
56
|
-
const context = androidApp.foregroundActivity || androidApp.startActivity;
|
57
|
+
const context = Application.android.startActivity;
|
57
58
|
const FILE_CODE = 1231;
|
58
59
|
if (!Intent) {
|
59
60
|
Intent = android.content.Intent;
|
@@ -62,12 +63,13 @@ export function openFilePicker(params = {}) {
|
|
62
63
|
FilePath = com.nativescript.documentpicker.FilePath;
|
63
64
|
}
|
64
65
|
const intent = new Intent(Intent.ACTION_GET_CONTENT);
|
66
|
+
// Convert extensions to mime type
|
65
67
|
let mimeTypes;
|
66
68
|
if (params.extensions) {
|
67
69
|
const singleton = android.webkit.MimeTypeMap.getSingleton();
|
68
|
-
mimeTypes =
|
70
|
+
mimeTypes = params.extensions?.map((s) => singleton.getMimeTypeFromExtension(s.replace('.', ''))).filter((s) => !!s);
|
69
71
|
}
|
70
|
-
if (mimeTypes
|
72
|
+
if (mimeTypes?.length) {
|
71
73
|
intent.setType(mimeTypes[0]);
|
72
74
|
if (mimeTypes.length > 1) {
|
73
75
|
intent.putExtra(Intent.EXTRA_MIME_TYPES, convertToArray(mimeTypes.slice(1)));
|
@@ -81,6 +83,10 @@ export function openFilePicker(params = {}) {
|
|
81
83
|
prepareIntent(intent, params);
|
82
84
|
return callIntent(context, intent, FILE_CODE).then((result) => {
|
83
85
|
if (result.resultCode === android.app.Activity.RESULT_OK) {
|
86
|
+
// The document selected by the user won't be returned in the intent.
|
87
|
+
// Instead, a URI to that document will be contained in the return intent
|
88
|
+
// provided to this method as a parameter.
|
89
|
+
// Pull that URI using resultData.getData().
|
84
90
|
if (result.intent != null) {
|
85
91
|
const uri = result.intent.getData();
|
86
92
|
if (uri) {
|
@@ -126,12 +132,21 @@ export function openFilePicker(params = {}) {
|
|
126
132
|
}
|
127
133
|
function updatePersistableUris(context, uri) {
|
128
134
|
const contentResolver = context.getContentResolver();
|
135
|
+
// contentResolver.getPersistedUriPermissions()
|
136
|
+
// .filter { it.isReadPermission }
|
137
|
+
// .filter { it.uri != uri }
|
138
|
+
// .forEach {
|
139
|
+
// contentResolver.releasePersistableUriPermission(
|
140
|
+
// it.uri,
|
141
|
+
// Intent.FLAG_GRANT_READ_URI_PERMISSION
|
142
|
+
// )
|
143
|
+
// }
|
129
144
|
if (contentResolver.takePersistableUriPermission) {
|
130
145
|
contentResolver.takePersistableUriPermission(uri, Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
131
146
|
}
|
132
147
|
}
|
133
148
|
export function pickFolder(params = {}) {
|
134
|
-
const context =
|
149
|
+
const context = Application.android.startActivity;
|
135
150
|
const FOLDER_CODE = 1232;
|
136
151
|
if (!Intent) {
|
137
152
|
Intent = android.content.Intent;
|
@@ -139,12 +154,15 @@ export function pickFolder(params = {}) {
|
|
139
154
|
const intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
|
140
155
|
prepareIntent(intent, params);
|
141
156
|
return callIntent(context, intent, FOLDER_CODE).then((result) => {
|
142
|
-
var _a;
|
143
157
|
if (result.resultCode === android.app.Activity.RESULT_OK) {
|
158
|
+
// The document selected by the user won't be returned in the intent.
|
159
|
+
// Instead, a URI to that document will be contained in the return intent
|
160
|
+
// provided to this method as a parameter.
|
161
|
+
// Pull that URI using resultData.getData().
|
144
162
|
if (result.intent != null) {
|
145
163
|
const uri = result.intent.getData();
|
146
164
|
if (uri) {
|
147
|
-
if (
|
165
|
+
if (params.permissions?.persistable) {
|
148
166
|
updatePersistableUris(context, uri);
|
149
167
|
}
|
150
168
|
return {
|
@@ -187,4 +205,55 @@ export function pickFolder(params = {}) {
|
|
187
205
|
}
|
188
206
|
});
|
189
207
|
}
|
208
|
+
export async function saveFile(params) {
|
209
|
+
// const tempFile = knownFolders.temp().getFile(params.name);
|
210
|
+
// if (typeof params.data === 'string') {
|
211
|
+
// await tempFile.writeText(params.data);
|
212
|
+
// } else {
|
213
|
+
// await tempFile.write(params.data);
|
214
|
+
// }
|
215
|
+
const context = Application.android.startActivity;
|
216
|
+
const FILE_CODE = 1233;
|
217
|
+
if (!Intent) {
|
218
|
+
Intent = android.content.Intent;
|
219
|
+
}
|
220
|
+
if (!FilePath) {
|
221
|
+
FilePath = com.nativescript.documentpicker.FilePath;
|
222
|
+
}
|
223
|
+
const intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
|
224
|
+
intent.putExtra(Intent.EXTRA_TITLE, params.name);
|
225
|
+
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
226
|
+
if (params.mimeType) {
|
227
|
+
intent.setType(params.mimeType);
|
228
|
+
}
|
229
|
+
else {
|
230
|
+
intent.setType('*/*');
|
231
|
+
}
|
232
|
+
prepareIntent(intent, params);
|
233
|
+
return callIntent(context, intent, FILE_CODE).then((result) => {
|
234
|
+
if (result.resultCode === android.app.Activity.RESULT_OK) {
|
235
|
+
if (result.intent != null) {
|
236
|
+
const uri = result.intent.getData();
|
237
|
+
const filePath = sdkVersion() >= 30 ? uri.toString() : FilePath.getPath(context, uri);
|
238
|
+
console.log('uri', filePath, params.data);
|
239
|
+
if (typeof params.data === 'string') {
|
240
|
+
return File.fromPath(filePath)
|
241
|
+
.writeText(params.data)
|
242
|
+
.then(() => true);
|
243
|
+
// await tempFile.writeText(params.data);
|
244
|
+
}
|
245
|
+
else {
|
246
|
+
return File.fromPath(filePath)
|
247
|
+
.write(params.data)
|
248
|
+
.then(() => true);
|
249
|
+
// await tempFile.write(params.data);
|
250
|
+
}
|
251
|
+
}
|
252
|
+
return false;
|
253
|
+
}
|
254
|
+
else {
|
255
|
+
return false;
|
256
|
+
}
|
257
|
+
});
|
258
|
+
}
|
190
259
|
//# sourceMappingURL=index.android.js.map
|
package/index.android.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.android.js","sourceRoot":"../src/","sources":["index.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,
|
1
|
+
{"version":3,"file":"index.android.js","sourceRoot":"../src/","sources":["index.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAEH,kBAAkB,EAClB,WAAW,EACX,MAAM,EACN,IAAI,EACJ,KAA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CAAC,CAAC;gBAC1C,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE;oBACjC,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;yBACzB,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;yBACtB,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;oBACtB,yCAAyC;iBAC5C;qBAAM;oBACH,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;yBACzB,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;yBAClB,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;oBACtB,qCAAqC;iBACxC;aACJ;YACD,OAAO,KAAK,CAAC;SAChB;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/index.common.d.ts
CHANGED
@@ -14,3 +14,8 @@ export interface FilePickerOptions extends CommonPickerOptions {
|
|
14
14
|
}
|
15
15
|
export interface FolderPickerOptions extends CommonPickerOptions {
|
16
16
|
}
|
17
|
+
export interface SaveFileOptions extends Pick<CommonPickerOptions, 'permissions'> {
|
18
|
+
name: string;
|
19
|
+
data: any;
|
20
|
+
mimeType?: string;
|
21
|
+
}
|
package/index.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
import { FilePickerOptions, FolderPickerOptions } from './index.common';
|
1
|
+
import { FilePickerOptions, FolderPickerOptions, SaveFileOptions } from './index.common';
|
2
2
|
|
3
3
|
export { FilePickerOptions, FolderPickerOptions };
|
4
4
|
export function openFilePicker(params?: FilePickerOptions): Promise<{ files: string[]; ios?; android? }>;
|
5
5
|
export function pickFolder(params?: FolderPickerOptions): Promise<{ folders: string[]; ios?; android? }>;
|
6
|
+
export function saveFile(params: SaveFileOptions): Promise<boolean>;
|
package/index.ios.d.ts
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
import { FolderPickerOptions } from '.';
|
2
|
-
import { FilePickerOptions } from './index.common';
|
2
|
+
import { FilePickerOptions, SaveFileOptions } from './index.common';
|
3
3
|
export { FilePickerOptions };
|
4
4
|
export declare function openFilePicker(params?: FilePickerOptions): Promise<unknown>;
|
5
5
|
export declare function pickFolder(params?: FolderPickerOptions): Promise<{
|
6
6
|
folders: any[];
|
7
7
|
}>;
|
8
|
+
export declare function saveFile(params: SaveFileOptions): Promise<unknown>;
|
package/index.ios.js
CHANGED
@@ -1,13 +1,15 @@
|
|
1
|
-
import { Utils } from '@nativescript/core';
|
1
|
+
import { Utils, knownFolders } from '@nativescript/core';
|
2
2
|
var DocumentPickerDelegate = /** @class */ (function (_super) {
|
3
3
|
__extends(DocumentPickerDelegate, _super);
|
4
4
|
function DocumentPickerDelegate() {
|
5
5
|
return _super !== null && _super.apply(this, arguments) || this;
|
6
6
|
}
|
7
|
-
DocumentPickerDelegate.initWithResolveReject = function (resolve, reject) {
|
7
|
+
DocumentPickerDelegate.initWithResolveReject = function (resolve, reject, booleanResult) {
|
8
|
+
if (booleanResult === void 0) { booleanResult = false; }
|
8
9
|
var delegate = DocumentPickerDelegate.new();
|
9
10
|
delegate._resolve = resolve;
|
10
11
|
delegate._reject = reject;
|
12
|
+
delegate._booleanResult = booleanResult;
|
11
13
|
return delegate;
|
12
14
|
};
|
13
15
|
DocumentPickerDelegate.prototype.cleanup = function (controller) {
|
@@ -17,46 +19,61 @@ var DocumentPickerDelegate = /** @class */ (function (_super) {
|
|
17
19
|
delegate = null;
|
18
20
|
};
|
19
21
|
DocumentPickerDelegate.prototype.documentPickerDidPickDocumentAtURL = function (controller, url) {
|
20
|
-
this._resolve(
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
this._resolve(this._booleanResult
|
23
|
+
? true
|
24
|
+
: {
|
25
|
+
files: [url.absoluteString],
|
26
|
+
ios: url
|
27
|
+
});
|
24
28
|
this.cleanup(controller);
|
25
29
|
};
|
26
30
|
DocumentPickerDelegate.prototype.documentPickerDidPickDocumentsAtURLs = function (controller, urls) {
|
27
|
-
|
28
|
-
|
29
|
-
|
31
|
+
if (this._booleanResult) {
|
32
|
+
this._resolve(true);
|
33
|
+
}
|
34
|
+
else {
|
35
|
+
var output = [];
|
36
|
+
for (var i = 0; i < urls.count; i++) {
|
37
|
+
output.push(urls[i].absoluteString);
|
38
|
+
}
|
39
|
+
this._resolve({
|
40
|
+
files: output,
|
41
|
+
ios: urls
|
42
|
+
});
|
30
43
|
}
|
31
|
-
this._resolve({
|
32
|
-
files: output,
|
33
|
-
ios: urls
|
34
|
-
});
|
35
44
|
this.cleanup(controller);
|
36
45
|
};
|
37
46
|
DocumentPickerDelegate.prototype.documentPickerWasCancelled = function (controller) {
|
38
|
-
this._resolve(
|
39
|
-
|
40
|
-
|
47
|
+
this._resolve(this._booleanResult
|
48
|
+
? false
|
49
|
+
: {
|
50
|
+
files: []
|
51
|
+
});
|
41
52
|
this.cleanup(controller);
|
42
53
|
};
|
43
54
|
DocumentPickerDelegate.ObjCProtocols = [UIDocumentPickerDelegate];
|
44
55
|
return DocumentPickerDelegate;
|
45
56
|
}(NSObject));
|
57
|
+
// Reference to delegate instance to avoid delegate issue
|
58
|
+
// https://github.com/nativescript-community/ui-document-picker/issues/10
|
46
59
|
let delegate;
|
47
60
|
export function openFilePicker(params = {}) {
|
61
|
+
// const options = params;
|
48
62
|
let documentTypes;
|
49
63
|
if (params.extensions && params.extensions.length > 0) {
|
50
64
|
documentTypes = Utils.ios.collections.jsArrayToNSArray(params.extensions);
|
51
65
|
}
|
52
66
|
else {
|
53
|
-
documentTypes = Utils.ios.collections.jsArrayToNSArray([
|
67
|
+
documentTypes = Utils.ios.collections.jsArrayToNSArray([UTTypeContent.identifier]);
|
54
68
|
}
|
55
69
|
return new Promise((resolve, reject) => {
|
56
|
-
const controller = UIDocumentPickerViewController.alloc().initWithDocumentTypesInMode(documentTypes, params.pickerMode !== undefined ? params.pickerMode : 0);
|
70
|
+
const controller = UIDocumentPickerViewController.alloc().initWithDocumentTypesInMode(documentTypes, params.pickerMode !== undefined ? params.pickerMode : 0 /* UIDocumentPickerMode.Import */);
|
57
71
|
delegate = DocumentPickerDelegate.initWithResolveReject(resolve, reject);
|
58
72
|
controller.delegate = delegate;
|
73
|
+
// if (options.multipleSelection) {
|
59
74
|
controller.allowsMultipleSelection = !!params.multipleSelection;
|
75
|
+
// }
|
76
|
+
// this.presentViewController(controller);
|
60
77
|
const app = UIApplication.sharedApplication;
|
61
78
|
const window = app.keyWindow || (app.windows.count > 0 && app.windows[0]);
|
62
79
|
const visibleVC = Utils.ios.getVisibleViewController(window.rootViewController);
|
@@ -68,4 +85,24 @@ export async function pickFolder(params = {}) {
|
|
68
85
|
folders: []
|
69
86
|
};
|
70
87
|
}
|
88
|
+
export async function saveFile(params) {
|
89
|
+
return new Promise(async (resolve, reject) => {
|
90
|
+
const tempFile = knownFolders.temp().getFile(params.name);
|
91
|
+
if (typeof params.data === 'string') {
|
92
|
+
await tempFile.writeText(params.data);
|
93
|
+
}
|
94
|
+
else {
|
95
|
+
await tempFile.write(params.data);
|
96
|
+
}
|
97
|
+
const controller = UIDocumentPickerViewController.alloc().initForExportingURLsAsCopy([NSURL.URLWithString(tempFile.path)], true);
|
98
|
+
delegate = DocumentPickerDelegate.initWithResolveReject(resolve, reject, true);
|
99
|
+
controller.delegate = delegate;
|
100
|
+
controller.shouldShowFileExtensions = true;
|
101
|
+
// this.presentViewController(controller);
|
102
|
+
const app = UIApplication.sharedApplication;
|
103
|
+
const window = app.keyWindow || (app.windows.count > 0 && app.windows[0]);
|
104
|
+
const visibleVC = Utils.ios.getVisibleViewController(window.rootViewController);
|
105
|
+
visibleVC.presentViewControllerAnimatedCompletion(controller, true, null);
|
106
|
+
});
|
107
|
+
}
|
71
108
|
//# sourceMappingURL=index.ios.js.map
|
package/index.ios.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.ios.js","sourceRoot":"../src/","sources":["index.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,E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C,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"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nativescript-community/ui-document-picker",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.13",
|
4
4
|
"description": "A NativeScript plugin that allows you to select files from the device.",
|
5
5
|
"main": "index",
|
6
6
|
"typings": "index.d.ts",
|
@@ -39,7 +39,7 @@
|
|
39
39
|
"license": "Apache-2.0",
|
40
40
|
"readmeFilename": "README.md",
|
41
41
|
"dependencies": {
|
42
|
-
"@nativescript-community/perms": "2.
|
42
|
+
"@nativescript-community/perms": "^2.3.0"
|
43
43
|
},
|
44
|
-
"gitHead": "
|
44
|
+
"gitHead": "19f4bdb19beb7ba53a6a8091942939e3fe189c19"
|
45
45
|
}
|
package/references.d.ts
CHANGED