Skip to content

Commit f5f5016

Browse files
author
Laegel
authored
Feat/various updates (tauri-apps#72)
* feat(docs): Added notification support * fix: Added missing Rust docs * feat(anchors): Added support for custom anchors * feat(improvements): Added alpha badge * fix(styles): Fixing Docusaurus modified style * feat(instructions): Added PR instructions for showcase * fix: Changed MacOS for macOS * chore(clean): Removed console log * fix: Patching announcement style * fix: Removed extra trailing whitespaces * fix: Changed dmg link
1 parent 15a8dbf commit f5f5016

File tree

146 files changed

+3723
-1447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+3723
-1447
lines changed

docs/about/book.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ This is an early outline of the contents that we expect to publish. Contents sub
9696
1. Environment Prerequisites
9797
- Node, Npm, Yarn, Rustc, Rustup, Buildtools
9898
2. Development Platform Details
99-
- MacOS
99+
- macOS
100100
- Windows
101101
- Linux
102102
- Docker
@@ -142,7 +142,7 @@ This is an early outline of the contents that we expect to publish. Contents sub
142142
10. Taskbar Integration (Desktop Only)
143143
- Anatomy
144144
- Integrations
145-
- MacOS
145+
- macOS
146146
- Windows
147147
- Linux
148148
11. Security Features
@@ -170,7 +170,7 @@ This is an early outline of the contents that we expect to publish. Contents sub
170170
- Packaging
171171
- Minification
172172
- Distribution Platform Details
173-
- MacOS (.app / .dmg)
173+
- macOS (.app / .dmg)
174174
- Win (.exe / .msi)
175175
- Linux Arm64 (.appImage / .deb)
176176
- Linux x64 (.appImage / .deb)

docs/api/config.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ It's composed of the following properties:
1414

1515
## `build`
1616

17-
<Properties rows={[
17+
<Properties anchorRoot="build" rows={[
1818
{property: "distDir", type: "string", description: `The path—either absolute or relative—to the production-ready webpage/webapp directory that will be bundled by Tauri.
1919

2020
<div class="alert alert--info" role="alert" style="margin-top: 10px;">
@@ -36,7 +36,7 @@ It's composed of the following properties:
3636

3737
## `ctx`
3838

39-
<Properties rows={[
39+
<Properties anchorRoot="ctx" rows={[
4040
{ property: "debug", optional: true, type: "boolean", description: `Tells the CLI to build on debug mode instead of release. Can also be used as <code>tauri build --debug</code>.` },
4141
{ property: "exitOnPanic", optional: true, type: "boolean", description: `Whether or not the webview should be killed if some Rust code error happened. Can also be used as <code>tauri dev --exit-on-panic</code> or <code>tauri dev -e</code>.` }
4242
]} />
@@ -50,11 +50,11 @@ It's composed of the following properties:
5050

5151
## `tauri`
5252

53-
<Properties rows={[
53+
<Properties anchorRoot="ctx" rows={[
5454
{
5555
property: "cli", optional: true, type: "CliConfig",
56-
child: <Properties rows={[
57-
{ property: "args", optional: true, type: "CliArg[]", description: `List of args for the command.`, child: <Array type="CliArg" name="arg"><Properties rows={[
56+
child: <Properties anchorRoot="tauri.cli" rows={[
57+
{ property: "args", optional: true, type: "CliArg[]", description: `List of args for the command.`, child: <Array type="CliArg" name="arg"><Properties anchorRoot="tauri.cli.args" rows={[
5858
{ property: "short", optional: true, type: "string", description: `the short version of the argument, without the preceding hyphen (the "-" character).
5959
<div class="alert alert--info" role="alert" style="margin-top: 10px;">
6060
Any leading hyphen will be stripped, and only the first non hyphen character will be used as the short version.
@@ -131,11 +131,11 @@ It's composed of the following properties:
131131
},
132132
{
133133
property: "embeddedServer", type: "object",
134-
child: <Properties rows={[{ property: "active", optional: true, type: "boolean", description: `Set it to <code>false</code> if you plan to serve your application statically.` }]} />
134+
child: <Properties anchorRoot="tauri.embeddedServer" rows={[{ property: "active", optional: true, type: "boolean", description: `Set it to <code>false</code> if you plan to serve your application statically.` }]} />
135135
},
136136
{
137137
property: "bundle", type: "object",
138-
child: <Properties rows={[
138+
child: <Properties anchorRoot="tauri.bundle" rows={[
139139
{ property: "active", optional: true, type: "boolean", description: `Whether we should build your app with tauri-bundler or plain <code>cargo build</code>.` },
140140
{ property: "targets", optional: true, type: "string | string[]", description: `An array of the bundles you want to generate; e.g. ["deb", "osx", "msi", "appimage", "dmg"] or the string 'all' to make every supported bundle. By default we bundle everything your target supports (osx/dmg on mac, deb/appimage on linux, msi on windows).` },
141141
{ property: "identifier", type: "string", description: `A string that uniquely identifies your application, in reverse-DNS form (for example, "com.example.appname" or "io.github.username.project"). For OS X and iOS, this is used as the bundle's CFBundleIdentifier value; for Windows, this is hashed to create an application GUID.` },
@@ -147,7 +147,7 @@ It's composed of the following properties:
147147
E.g. you typed "my-binary":
148148
<ul>
149149
<li>"my-binary-x86_64-pc-windows-msvc.exe" for Windows</li>
150-
<li>"my-binary-x86_64-apple-darwin" for MacOS</li>
150+
<li>"my-binary-x86_64-apple-darwin" for macOS</li>
151151
<li>"my-binary-x86_64-unknown-linux-gnu" for Linux</li>
152152
</ul>
153153
so don't forget to provide binaries for <strong>all targeted platforms</strong>.
@@ -159,13 +159,13 @@ It's composed of the following properties:
159159
` },
160160
{ property: "shortDescription", optional: true, type: "string", description: `A short description of your application.` },
161161
{ property: "longDescription", optional: true, type: "string", description: `A longer, multi-line description of the application.` },
162-
{ property: "deb", optional: true, type: "object", child: <Properties rows={[
162+
{ property: "deb", optional: true, type: "object", child: <Properties anchorRoot="tauri.bundle.deb" rows={[
163163
{ property: "depends", optional: true, type: "string[]", description: `The list of deb dependencies your application relies on.` },
164164
{ property: "useBootstrapper", optional: true, type: "boolean", description: `Enable the <a href="#bootstrapper">boostrapper script</a>.` }]} />
165165
},
166-
{ property: "osx", optional: true, type: "object", child: <Properties rows={[
167-
{ property: "frameworks", optional: true, type: "string[]", description: `A list of strings indicating any MacOS X frameworks that need to be bundled with the application. If a name is used, ".framework" must be omitted and it will look for standard install locations. You may also use a path to a specific framework.` },
168-
{ property: "minimumSystemVersion", optional: true, type: "string", description: `A version string indicating the minimum MacOS X version that the bundled application supports.` },
166+
{ property: "osx", optional: true, type: "object", child: <Properties anchorRoot="tauri.bundle.osx" rows={[
167+
{ property: "frameworks", optional: true, type: "string[]", description: `A list of strings indicating any macOS X frameworks that need to be bundled with the application. If a name is used, ".framework" must be omitted and it will look for standard install locations. You may also use a path to a specific framework.` },
168+
{ property: "minimumSystemVersion", optional: true, type: "string", description: `A version string indicating the minimum macOS X version that the bundled application supports.` },
169169
{ property: "license", optional: true, type: "string", description: `The path to the license file to add to the DMG.` },
170170
{ property: "useBootstrapper", optional: true, type: "boolean", description: `Enable the <a href="#bootstrapper">boostrapper script</a>.` }]} /> },
171171
{ property: "exceptionDomain", optional: true, type: "string", description: `Allows your application to communicate with the outside world.
@@ -177,13 +177,14 @@ It's composed of the following properties:
177177
},
178178
{
179179
property: "whitelist", type: "object",
180-
child: <Properties rows={[
180+
child: <Properties anchorRoot="tauri.whitelist" rows={[
181181
{ property: "all", type: "boolean", description: `Use this flag to enable all API features.` },
182182
{ property: "createDir", optional: true, type: "boolean", description: `Copy file from local filesystem.` },
183183
{ property: "copyFile", optional: true, type: "boolean", description: `Create directory from local filesystem.` },
184184
{ property: "event", optional: true, type: "boolean", description: `Enable listening to messages from webview.` },
185185
{ property: "execute", optional: true, type: "boolean", description: `Enable binary execution.` },
186186
{ property: "listFiles", optional: true, type: "boolean", description: `Get a list of files in a directory.` },
187+
{ property: "notification", optional: true, type: "boolean", description: `Enable system notifications.` },
187188
{ property: "open", optional: true, type: "boolean", description: `Open link in the user's default browser.` },
188189
{ property: "openDialog", optional: true, type: "boolean", description: `Open dialog window to pick files.` },
189190
{ property: "readBinaryFile", optional: true, type: "boolean", description: `Read binary file from local filesystem.` },
@@ -200,7 +201,7 @@ It's composed of the following properties:
200201
},
201202
{
202203
property: "window", type: "object",
203-
child: <Properties rows={[
204+
child: <Properties anchorRoot="tauri.window" rows={[
204205
{ property: "title", type: "string", description: `Initial window title.` },
205206
{ property: "width", optional: true, type: "number", description: `Initial window width.` },
206207
{ property: "height", optional: true, type: "number", description: `Initial window height.` },
@@ -210,7 +211,7 @@ It's composed of the following properties:
210211
},
211212
{
212213
property: "security", type: "object",
213-
child: <Properties rows={[
214+
child: <Properties anchorRoot="tauri.security" rows={[
214215
{ property: "csp", optional: true, type: "string", description: `The Content Security Policy.
215216
<div class="alert alert--warning" role="alert" style="margin-top: 10px;">
216217
This is a really important part of the configuration since it helps you ensure your webview is secured. See more <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP" target="_blank">on Mozilla</a>.
@@ -219,13 +220,13 @@ It's composed of the following properties:
219220
},
220221
{
221222
property: "edge", type: "object",
222-
child: <Properties rows={[
223+
child: <Properties anchorRoot="tauri.edge" rows={[
223224
{ property: "active", optional: true, type: "boolean", description: `Whether you want to build with Microsoft Edge or with Microsoft Internet Explorer.` },
224225
]} />
225226
},
226227
{
227228
property: "inliner", type: "object",
228-
child: <Properties rows={[
229+
child: <Properties anchorRoot="tauri.inliner" rows={[
229230
{ property: "active", optional: true, type: "boolean", description: `Enable the inliner. See more <a href="https://github.com/tauri-apps/tauri-inliner/" target="_blank">on our GitHub</a>.` },
230231
]} />
231232
},

docs/api/js.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import Alert from '@theme/Alert'
77

88
Here is the JS API, exposed by the <a href="https://www.npmjs.com/package/tauri" target="_blank">Tauri package</a> in the "api" directory.
99

10+
Note that you can either enable or disable these APIs in your [tauri.conf.json](/docs/api/config). Please refer to the "whitelist" section.
11+
1012
If you haven't done it so far, add the package _locally_ to your project:
1113

1214
```sh
@@ -434,7 +436,7 @@ type HttpOptions = {
434436
* @property {BodyType} [bodyType=3] body type
435437
*/
436438

437-
/**
439+
/**
438440
* @param {HttpOptions} options request options
439441
*/
440442
request(options: HttpOptions): Promise<any>
@@ -580,6 +582,47 @@ Makes a DELETE HTTP request
580582

581583
promise resolving to the response
582584

585+
## Notification
586+
587+
<Alert icon="info-alt" title="Note">
588+
589+
Tauri patches the <a href="https://developer.mozilla.org/en-US/docs/Web/API/notification" target="_blank">Notification API</a> but not all methods and properties are available.
590+
591+
Since we're patching the browser API, you don't need to import anything as it lives in the global scope.
592+
</Alert>
593+
594+
### Types
595+
596+
```ts
597+
interface NotificationOptions {
598+
dir?: 'auto' | 'ltr' | 'rtl'
599+
lang?: string // The notification's language, as specified using a DOMString representing a BCP 47 language tag. See the Sitepoint ISO 2 letter language codes page for a simple reference.
600+
badge?: string // A USVString containing the URL of the image used to represent the notification when there isn't enough space to display the notification itself.
601+
body?: string // A DOMString representing the body text of the notification, which is displayed below the title.
602+
tag?: string // A DOMString representing an identifying tag for the notification.
603+
icon?: string // A USVString containing the URL of an icon to be displayed in the notification.
604+
image?: string // A USVString containing the URL of an image to be displayed in the notification.
605+
data?: any // Arbitrary data that you want associated with the notification. This can be of any data type.
606+
vibrate?: any // A vibration pattern for the device's vibration hardware to emit with the notification.
607+
renotify?: boolean // A Boolean specifying whether the user should be notified after a new notification replaces an old one. The default is false, which means they won't be notified.
608+
requireInteraction?: boolean // Indicates that a notification should remain active until the user clicks or dismisses it, rather than closing automatically. The default value is false.
609+
actions?: NotificationAction[] // An array of NotificationActions representing the actions available to the user when the notification is presented. These are options the user can choose among in order to act on the action within the context of the notification itself. The action's name is sent to the service worker notification handler to let it know the action was selected by the user.
610+
silent?: boolean // A Boolean specifying whether the notification is silent (no sounds or vibrations issued), regardless of the device settings. The default is false, which means it won't be silent.
611+
}
612+
```
613+
614+
### Classes
615+
616+
```ts
617+
class Notification {
618+
static permission: string
619+
620+
construct(title: string, options?: NotificationOptions)
621+
622+
static requestPermission(): Promise<'granted' | 'denied' | 'default'>
623+
}
624+
```
625+
583626
## Process
584627

585628
```ts

docs/api/rust/tauri/config/fn.get.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ title: "fn.get"
55
# Function [tauri](/docs/api/rust/tauri/../index.html)::​[config](/docs/api/rust/tauri/index.html)::​[get](/docs/api/rust/tauri/)
66

77
pub fn get() -> Result<Config>
8-
98

docs/api/rust/tauri/config/struct.BuildConfig.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,5 +135,4 @@ Performs the conversion.
135135
### `impl<V, T> VZip<V> for T where V: MultiLane<T>,`
136136

137137
#### `fn vzip(self) -> V`
138-
139138

docs/api/rust/tauri/config/struct.Config.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,4 @@ Performs the conversion.
136136
### `impl<V, T> VZip<V> for T where V: MultiLane<T>,`
137137

138138
#### `fn vzip(self) -> V`
139-
140139

docs/api/rust/tauri/config/struct.EmbeddedServerConfig.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,4 @@ Performs the conversion.
136136
### `impl<V, T> VZip<V> for T where V: MultiLane<T>,`
137137

138138
#### `fn vzip(self) -> V`
139-
140139

docs/api/rust/tauri/config/struct.TauriConfig.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,4 @@ Performs the conversion.
136136
### `impl<V, T> VZip<V> for T where V: MultiLane<T>,`
137137

138138
#### `fn vzip(self) -> V`
139-
140139

docs/api/rust/tauri/config/struct.WindowConfig.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,5 +139,4 @@ Performs the conversion.
139139
### `impl<V, T> VZip<V> for T where V: MultiLane<T>,`
140140

141141
#### `fn vzip(self) -> V`
142-
143142

docs/api/rust/tauri/enum.ErrorKind.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,5 +163,4 @@ Performs the conversion.
163163
### `impl<V, T> VZip<V> for T where V: MultiLane<T>,`
164164

165165
#### `fn vzip(self) -> V`
166-
167166

0 commit comments

Comments
 (0)