@tauri-apps/plugin-dialog 2.0.0-beta.0 → 2.0.0-beta.2

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 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.70**_
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', type: 'error' });
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
- type_: opts?.type,
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', type: 'warning' });
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
- type_: opts?.type,
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', type: 'warning' });
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
- type_: opts?.type,
169
+ kind: opts?.kind,
170
170
  okButtonLabel: opts?.okLabel?.toString() ?? "Ok",
171
171
  cancelButtonLabel: opts?.cancelLabel?.toString() ?? "Cancel",
172
172
  });
@@ -47,6 +47,8 @@ interface OpenDialogOptions {
47
47
  * Defines whether subdirectories will be allowed on the scope or not.
48
48
  */
49
49
  recursive?: boolean;
50
+ /** Whether to allow creating directories in the dialog. Enabled by default. **macOS Only** */
51
+ canCreateDirectories?: boolean;
50
52
  }
51
53
  /**
52
54
  * Options for the save dialog.
@@ -64,6 +66,8 @@ interface SaveDialogOptions {
64
66
  * If it's not an existing directory, the file name will be set to the dialog's file name input and the dialog will be set to the parent folder.
65
67
  */
66
68
  defaultPath?: string;
69
+ /** Whether to allow creating directories in the dialog. Enabled by default. **macOS Only** */
70
+ canCreateDirectories?: boolean;
67
71
  }
68
72
  /**
69
73
  * @since 2.0.0
@@ -71,16 +75,16 @@ interface SaveDialogOptions {
71
75
  interface MessageDialogOptions {
72
76
  /** The title of the dialog. Defaults to the app name. */
73
77
  title?: string;
74
- /** The type of the dialog. Defaults to `info`. */
75
- type?: "info" | "warning" | "error";
78
+ /** The kind of the dialog. Defaults to `info`. */
79
+ kind?: "info" | "warning" | "error";
76
80
  /** The label of the confirm button. */
77
81
  okLabel?: string;
78
82
  }
79
83
  interface ConfirmDialogOptions {
80
84
  /** The title of the dialog. Defaults to the app name. */
81
85
  title?: string;
82
- /** The type of the dialog. Defaults to `info`. */
83
- type?: "info" | "warning" | "error";
86
+ /** The kind of the dialog. Defaults to `info`. */
87
+ kind?: "info" | "warning" | "error";
84
88
  /** The label of the confirm button. */
85
89
  okLabel?: string;
86
90
  /** The label of the cancel button. */
@@ -171,7 +175,7 @@ declare function save(options?: SaveDialogOptions): Promise<string | null>;
171
175
  * ```typescript
172
176
  * import { message } from '@tauri-apps/plugin-dialog';
173
177
  * await message('Tauri is awesome', 'Tauri');
174
- * await message('File not found', { title: 'Tauri', type: 'error' });
178
+ * await message('File not found', { title: 'Tauri', kind: 'error' });
175
179
  * ```
176
180
  *
177
181
  * @param message The message to show.
@@ -189,7 +193,7 @@ declare function message(message: string, options?: string | MessageDialogOption
189
193
  * ```typescript
190
194
  * import { ask } from '@tauri-apps/plugin-dialog';
191
195
  * const yes = await ask('Are you sure?', 'Tauri');
192
- * const yes2 = await ask('This action cannot be reverted. Are you sure?', { title: 'Tauri', type: 'warning' });
196
+ * const yes2 = await ask('This action cannot be reverted. Are you sure?', { title: 'Tauri', kind: 'warning' });
193
197
  * ```
194
198
  *
195
199
  * @param message The message to show.
@@ -206,7 +210,7 @@ declare function ask(message: string, options?: string | ConfirmDialogOptions):
206
210
  * ```typescript
207
211
  * import { confirm } from '@tauri-apps/plugin-dialog';
208
212
  * const confirmed = await confirm('Are you sure?', 'Tauri');
209
- * const confirmed2 = await confirm('This action cannot be reverted. Are you sure?', { title: 'Tauri', type: 'warning' });
213
+ * const confirmed2 = await confirm('This action cannot be reverted. Are you sure?', { title: 'Tauri', kind: 'warning' });
210
214
  * ```
211
215
  *
212
216
  * @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', type: 'error' });
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
- type_: opts?.type,
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', type: 'warning' });
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
- type_: opts?.type,
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', type: 'warning' });
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
- type_: opts?.type,
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.0",
3
+ "version": "2.0.0-beta.2",
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.0"
23
+ "@tauri-apps/api": "2.0.0-beta.4"
24
24
  },
25
25
  "scripts": {
26
26
  "build": "rollup -c"