@tauri-apps/plugin-dialog 2.0.0-beta.0 → 2.0.0-beta.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.
- package/README.md +1 -1
- package/dist-js/index.cjs +6 -6
- package/dist-js/index.d.ts +7 -7
- package/dist-js/index.js +6 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Native system dialogs for opening and saving files along with message dialogs.
|
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
|
-
_This plugin requires a Rust version of at least **1.
|
|
7
|
+
_This plugin requires a Rust version of at least **1.75**_
|
|
8
8
|
|
|
9
9
|
There are three general methods of installation that we can recommend.
|
|
10
10
|
|
package/dist-js/index.cjs
CHANGED
|
@@ -99,7 +99,7 @@ async function save(options = {}) {
|
|
|
99
99
|
* ```typescript
|
|
100
100
|
* import { message } from '@tauri-apps/plugin-dialog';
|
|
101
101
|
* await message('Tauri is awesome', 'Tauri');
|
|
102
|
-
* await message('File not found', { title: 'Tauri',
|
|
102
|
+
* await message('File not found', { title: 'Tauri', kind: 'error' });
|
|
103
103
|
* ```
|
|
104
104
|
*
|
|
105
105
|
* @param message The message to show.
|
|
@@ -115,7 +115,7 @@ async function message(message, options) {
|
|
|
115
115
|
return core.invoke("plugin:dialog|message", {
|
|
116
116
|
message: message.toString(),
|
|
117
117
|
title: opts?.title?.toString(),
|
|
118
|
-
|
|
118
|
+
kind: opts?.kind,
|
|
119
119
|
okButtonLabel: opts?.okLabel?.toString(),
|
|
120
120
|
});
|
|
121
121
|
}
|
|
@@ -125,7 +125,7 @@ async function message(message, options) {
|
|
|
125
125
|
* ```typescript
|
|
126
126
|
* import { ask } from '@tauri-apps/plugin-dialog';
|
|
127
127
|
* const yes = await ask('Are you sure?', 'Tauri');
|
|
128
|
-
* const yes2 = await ask('This action cannot be reverted. Are you sure?', { title: 'Tauri',
|
|
128
|
+
* const yes2 = await ask('This action cannot be reverted. Are you sure?', { title: 'Tauri', kind: 'warning' });
|
|
129
129
|
* ```
|
|
130
130
|
*
|
|
131
131
|
* @param message The message to show.
|
|
@@ -140,7 +140,7 @@ async function ask(message, options) {
|
|
|
140
140
|
return core.invoke("plugin:dialog|ask", {
|
|
141
141
|
message: message.toString(),
|
|
142
142
|
title: opts?.title?.toString(),
|
|
143
|
-
|
|
143
|
+
kind: opts?.kind,
|
|
144
144
|
okButtonLabel: opts?.okLabel?.toString() ?? "Yes",
|
|
145
145
|
cancelButtonLabel: opts?.cancelLabel?.toString() ?? "No",
|
|
146
146
|
});
|
|
@@ -151,7 +151,7 @@ async function ask(message, options) {
|
|
|
151
151
|
* ```typescript
|
|
152
152
|
* import { confirm } from '@tauri-apps/plugin-dialog';
|
|
153
153
|
* const confirmed = await confirm('Are you sure?', 'Tauri');
|
|
154
|
-
* const confirmed2 = await confirm('This action cannot be reverted. Are you sure?', { title: 'Tauri',
|
|
154
|
+
* const confirmed2 = await confirm('This action cannot be reverted. Are you sure?', { title: 'Tauri', kind: 'warning' });
|
|
155
155
|
* ```
|
|
156
156
|
*
|
|
157
157
|
* @param message The message to show.
|
|
@@ -166,7 +166,7 @@ async function confirm(message, options) {
|
|
|
166
166
|
return core.invoke("plugin:dialog|confirm", {
|
|
167
167
|
message: message.toString(),
|
|
168
168
|
title: opts?.title?.toString(),
|
|
169
|
-
|
|
169
|
+
kind: opts?.kind,
|
|
170
170
|
okButtonLabel: opts?.okLabel?.toString() ?? "Ok",
|
|
171
171
|
cancelButtonLabel: opts?.cancelLabel?.toString() ?? "Cancel",
|
|
172
172
|
});
|
package/dist-js/index.d.ts
CHANGED
|
@@ -71,16 +71,16 @@ interface SaveDialogOptions {
|
|
|
71
71
|
interface MessageDialogOptions {
|
|
72
72
|
/** The title of the dialog. Defaults to the app name. */
|
|
73
73
|
title?: string;
|
|
74
|
-
/** The
|
|
75
|
-
|
|
74
|
+
/** The kind of the dialog. Defaults to `info`. */
|
|
75
|
+
kind?: "info" | "warning" | "error";
|
|
76
76
|
/** The label of the confirm button. */
|
|
77
77
|
okLabel?: string;
|
|
78
78
|
}
|
|
79
79
|
interface ConfirmDialogOptions {
|
|
80
80
|
/** The title of the dialog. Defaults to the app name. */
|
|
81
81
|
title?: string;
|
|
82
|
-
/** The
|
|
83
|
-
|
|
82
|
+
/** The kind of the dialog. Defaults to `info`. */
|
|
83
|
+
kind?: "info" | "warning" | "error";
|
|
84
84
|
/** The label of the confirm button. */
|
|
85
85
|
okLabel?: string;
|
|
86
86
|
/** The label of the cancel button. */
|
|
@@ -171,7 +171,7 @@ declare function save(options?: SaveDialogOptions): Promise<string | null>;
|
|
|
171
171
|
* ```typescript
|
|
172
172
|
* import { message } from '@tauri-apps/plugin-dialog';
|
|
173
173
|
* await message('Tauri is awesome', 'Tauri');
|
|
174
|
-
* await message('File not found', { title: 'Tauri',
|
|
174
|
+
* await message('File not found', { title: 'Tauri', kind: 'error' });
|
|
175
175
|
* ```
|
|
176
176
|
*
|
|
177
177
|
* @param message The message to show.
|
|
@@ -189,7 +189,7 @@ declare function message(message: string, options?: string | MessageDialogOption
|
|
|
189
189
|
* ```typescript
|
|
190
190
|
* import { ask } from '@tauri-apps/plugin-dialog';
|
|
191
191
|
* const yes = await ask('Are you sure?', 'Tauri');
|
|
192
|
-
* const yes2 = await ask('This action cannot be reverted. Are you sure?', { title: 'Tauri',
|
|
192
|
+
* const yes2 = await ask('This action cannot be reverted. Are you sure?', { title: 'Tauri', kind: 'warning' });
|
|
193
193
|
* ```
|
|
194
194
|
*
|
|
195
195
|
* @param message The message to show.
|
|
@@ -206,7 +206,7 @@ declare function ask(message: string, options?: string | ConfirmDialogOptions):
|
|
|
206
206
|
* ```typescript
|
|
207
207
|
* import { confirm } from '@tauri-apps/plugin-dialog';
|
|
208
208
|
* const confirmed = await confirm('Are you sure?', 'Tauri');
|
|
209
|
-
* const confirmed2 = await confirm('This action cannot be reverted. Are you sure?', { title: 'Tauri',
|
|
209
|
+
* const confirmed2 = await confirm('This action cannot be reverted. Are you sure?', { title: 'Tauri', kind: 'warning' });
|
|
210
210
|
* ```
|
|
211
211
|
*
|
|
212
212
|
* @param message The message to show.
|
package/dist-js/index.js
CHANGED
|
@@ -97,7 +97,7 @@ async function save(options = {}) {
|
|
|
97
97
|
* ```typescript
|
|
98
98
|
* import { message } from '@tauri-apps/plugin-dialog';
|
|
99
99
|
* await message('Tauri is awesome', 'Tauri');
|
|
100
|
-
* await message('File not found', { title: 'Tauri',
|
|
100
|
+
* await message('File not found', { title: 'Tauri', kind: 'error' });
|
|
101
101
|
* ```
|
|
102
102
|
*
|
|
103
103
|
* @param message The message to show.
|
|
@@ -113,7 +113,7 @@ async function message(message, options) {
|
|
|
113
113
|
return invoke("plugin:dialog|message", {
|
|
114
114
|
message: message.toString(),
|
|
115
115
|
title: opts?.title?.toString(),
|
|
116
|
-
|
|
116
|
+
kind: opts?.kind,
|
|
117
117
|
okButtonLabel: opts?.okLabel?.toString(),
|
|
118
118
|
});
|
|
119
119
|
}
|
|
@@ -123,7 +123,7 @@ async function message(message, options) {
|
|
|
123
123
|
* ```typescript
|
|
124
124
|
* import { ask } from '@tauri-apps/plugin-dialog';
|
|
125
125
|
* const yes = await ask('Are you sure?', 'Tauri');
|
|
126
|
-
* const yes2 = await ask('This action cannot be reverted. Are you sure?', { title: 'Tauri',
|
|
126
|
+
* const yes2 = await ask('This action cannot be reverted. Are you sure?', { title: 'Tauri', kind: 'warning' });
|
|
127
127
|
* ```
|
|
128
128
|
*
|
|
129
129
|
* @param message The message to show.
|
|
@@ -138,7 +138,7 @@ async function ask(message, options) {
|
|
|
138
138
|
return invoke("plugin:dialog|ask", {
|
|
139
139
|
message: message.toString(),
|
|
140
140
|
title: opts?.title?.toString(),
|
|
141
|
-
|
|
141
|
+
kind: opts?.kind,
|
|
142
142
|
okButtonLabel: opts?.okLabel?.toString() ?? "Yes",
|
|
143
143
|
cancelButtonLabel: opts?.cancelLabel?.toString() ?? "No",
|
|
144
144
|
});
|
|
@@ -149,7 +149,7 @@ async function ask(message, options) {
|
|
|
149
149
|
* ```typescript
|
|
150
150
|
* import { confirm } from '@tauri-apps/plugin-dialog';
|
|
151
151
|
* const confirmed = await confirm('Are you sure?', 'Tauri');
|
|
152
|
-
* const confirmed2 = await confirm('This action cannot be reverted. Are you sure?', { title: 'Tauri',
|
|
152
|
+
* const confirmed2 = await confirm('This action cannot be reverted. Are you sure?', { title: 'Tauri', kind: 'warning' });
|
|
153
153
|
* ```
|
|
154
154
|
*
|
|
155
155
|
* @param message The message to show.
|
|
@@ -164,7 +164,7 @@ async function confirm(message, options) {
|
|
|
164
164
|
return invoke("plugin:dialog|confirm", {
|
|
165
165
|
message: message.toString(),
|
|
166
166
|
title: opts?.title?.toString(),
|
|
167
|
-
|
|
167
|
+
kind: opts?.kind,
|
|
168
168
|
okButtonLabel: opts?.okLabel?.toString() ?? "Ok",
|
|
169
169
|
cancelButtonLabel: opts?.cancelLabel?.toString() ?? "Cancel",
|
|
170
170
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tauri-apps/plugin-dialog",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.1",
|
|
4
4
|
"license": "MIT or APACHE-2.0",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Tauri Programme within The Commons Conservancy"
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"LICENSE"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@tauri-apps/api": "2.0.0-beta.
|
|
23
|
+
"@tauri-apps/api": "2.0.0-beta.2"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "rollup -c"
|