diff --git a/.changes/accept-first-mouse-api.md b/.changes/accept-first-mouse-api.md new file mode 100644 index 000000000..6422eb58a --- /dev/null +++ b/.changes/accept-first-mouse-api.md @@ -0,0 +1,5 @@ +--- +"api": minor +--- + +Added the `acceptFirstMouse` window option. diff --git a/.changes/accept-first-mouse.md b/.changes/accept-first-mouse.md new file mode 100644 index 000000000..1d75c8ee3 --- /dev/null +++ b/.changes/accept-first-mouse.md @@ -0,0 +1,6 @@ +--- +"tauri": minor +"tauri-runtime-wry": minor +--- + +Add `accept_first_mouse` option for macOS windows. diff --git a/.changes/api-fs-exists-return-type.md b/.changes/api-fs-exists-return-type.md new file mode 100644 index 000000000..f34b1ff3a --- /dev/null +++ b/.changes/api-fs-exists-return-type.md @@ -0,0 +1,5 @@ +--- +"api": patch +--- + +Fix incorrect return type on `fs/exists` diff --git a/.changes/api-monitor-class-initialization.md b/.changes/api-monitor-class-initialization.md new file mode 100644 index 000000000..426bf6e68 --- /dev/null +++ b/.changes/api-monitor-class-initialization.md @@ -0,0 +1,5 @@ +--- +"api": "patch" +--- + +Initialize `Monitor` instances with the correct classes for `position` and `size` fields instead of plain object. diff --git a/.changes/api-node14.md b/.changes/api-node14.md new file mode 100644 index 000000000..be3802f1c --- /dev/null +++ b/.changes/api-node14.md @@ -0,0 +1,5 @@ +--- +"api": minor +--- + +**Breaking change:** Node.js v12 is no longer supported. diff --git a/.changes/app-dirs-api.md b/.changes/app-dirs-api.md new file mode 100644 index 000000000..eb1d50fd7 --- /dev/null +++ b/.changes/app-dirs-api.md @@ -0,0 +1,6 @@ +--- +"tauri": minor +"api": minor +--- + +Add new app-specific `BaseDirectory` enum variants `AppConfig`, `AppData`, `AppLocalData`, `AppCache` and `AppLog` along with equivalent functions in `path` module and deprecated ambiguous variants `Log` and `App` along with their equivalent functions in `path` module. diff --git a/.changes/asset-protocol-streaming-mime-type.md b/.changes/asset-protocol-streaming-mime-type.md new file mode 100644 index 000000000..43c99d2c9 --- /dev/null +++ b/.changes/asset-protocol-streaming-mime-type.md @@ -0,0 +1,5 @@ +--- +"tauri": "patch" +--- + +Set the correct mimetype when streaming files through `asset:` protocol diff --git a/.changes/attohttpc-max-redirections.md b/.changes/attohttpc-max-redirections.md deleted file mode 100644 index f76248c2c..000000000 --- a/.changes/attohttpc-max-redirections.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri": patch ---- - -Implement `api::http::ClientBuilder::max_redirections` for the default attohttpc client. diff --git a/.changes/automatic-tabbing.md b/.changes/automatic-tabbing.md new file mode 100644 index 000000000..d136547b0 --- /dev/null +++ b/.changes/automatic-tabbing.md @@ -0,0 +1,6 @@ +--- +"tauri": minor +"tauri-runtime-wry": minor +--- + +Disable automatic window tabbing on macOS when the `tabbing_identifier` option is not defined, the window is transparent or does not have decorations. diff --git a/.changes/before-bundle-command.md b/.changes/before-bundle-command.md deleted file mode 100644 index 6465ba402..000000000 --- a/.changes/before-bundle-command.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"tauri-utils": minor -"cli.rs": minor -"cli.js": minor ---- - -Allow adding `build > beforeBundleCommand` in tauri.conf.json to run a shell command before the bundling phase. diff --git a/.changes/before-command-cwd.md b/.changes/before-command-cwd.md deleted file mode 100644 index a33f5d46a..000000000 --- a/.changes/before-command-cwd.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"tauri-utils": minor -"cli.rs": minor -"cli.js": minor ---- - -Change `before_dev_command` and `before_build_command` config value to allow configuring the current working directory. diff --git a/.changes/before-dev-command-wait.md b/.changes/before-dev-command-wait.md deleted file mode 100644 index bb0b07d34..000000000 --- a/.changes/before-dev-command-wait.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"tauri-utils": minor -"cli.rs": minor -"cli.js": minor ---- - -Allow configuring the `before_dev_command` to force the CLI to wait for the command to finish before proceeding. diff --git a/.changes/build-codegen-rerun.md b/.changes/build-codegen-rerun.md deleted file mode 100644 index 9f1e003c6..000000000 --- a/.changes/build-codegen-rerun.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri-build": patch ---- - -Rerun codegen if assets or icons change. diff --git a/.changes/build-platform-alias.md b/.changes/build-platform-alias.md deleted file mode 100644 index 5a4e82880..000000000 --- a/.changes/build-platform-alias.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri-build": patch ---- - -Create the `desktop` and `mobile` cfg aliases. diff --git a/.changes/bundler-japanese-lang.md b/.changes/bundler-japanese-lang.md new file mode 100644 index 000000000..e683f331d --- /dev/null +++ b/.changes/bundler-japanese-lang.md @@ -0,0 +1,5 @@ +--- +"tauri-bundler": "patch" +--- + +Use correct code `ja-JP` for japanese instead of `jp-JP`. diff --git a/.changes/cache-appimage-tools.md b/.changes/cache-appimage-tools.md deleted file mode 100644 index 60d2dd834..000000000 --- a/.changes/cache-appimage-tools.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"tauri-bundler": patch ---- - -Avoid re-downloading AppImage build tools on every build. - diff --git a/.changes/cargo-config-target.md b/.changes/cargo-config-target.md deleted file mode 100644 index 65d35eae6..000000000 --- a/.changes/cargo-config-target.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"cli.rs": patch -"cli.js": patch ---- - -Check if the default build target is set in the Cargo configuration. diff --git a/.changes/cli-binstall.md b/.changes/cli-binstall.md deleted file mode 100644 index 9305fdb38..000000000 --- a/.changes/cli-binstall.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"cli.rs": patch ---- - -Add support to cargo-binstall. diff --git a/.changes/cli-detect-target-dir.md b/.changes/cli-detect-target-dir.md deleted file mode 100644 index 19ee4c57e..000000000 --- a/.changes/cli-detect-target-dir.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"cli.rs": "patch" -"cli.js": "patch" ---- - -Use `cargo metadata` to detect the workspace root and target directory. diff --git a/.changes/cli-dev-alive-on-error.md b/.changes/cli-dev-alive-on-error.md new file mode 100644 index 000000000..6049b0224 --- /dev/null +++ b/.changes/cli-dev-alive-on-error.md @@ -0,0 +1,5 @@ +--- +"cli.rs": "patch" +--- + +Keep `tauri dev` watcher alive when the configuration is invalid. diff --git a/.changes/cli-ignore-workspace-members.md b/.changes/cli-ignore-workspace-members.md new file mode 100644 index 000000000..93452bca4 --- /dev/null +++ b/.changes/cli-ignore-workspace-members.md @@ -0,0 +1,5 @@ +--- +"cli.rs": patch +--- + +Ignore workspace members in dev watcher if they are ignored by `.taurignore` diff --git a/.changes/cli-improve-config-watcher.md b/.changes/cli-improve-config-watcher.md new file mode 100644 index 000000000..3087512e6 --- /dev/null +++ b/.changes/cli-improve-config-watcher.md @@ -0,0 +1,6 @@ +--- +"cli.rs": patch +"cli.js": patch +--- + +Detect JSON5 and TOML configuration files in the dev watcher. diff --git a/.changes/cli-init-before-commands.md b/.changes/cli-init-before-commands.md deleted file mode 100644 index cca090bd2..000000000 --- a/.changes/cli-init-before-commands.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"cli.rs": "minor" -"cli.js": "minor" ---- - -Prompt for `beforeDevCommand` and `beforeBuildCommand` in `tauri init`. - diff --git a/.changes/cli-no-default-featurs-arg.md b/.changes/cli-no-default-featurs-arg.md new file mode 100644 index 000000000..a8f845998 --- /dev/null +++ b/.changes/cli-no-default-featurs-arg.md @@ -0,0 +1,5 @@ +--- +"cli.rs": "patch" +--- + +Fix cli passing `--no-default-features` to the app instead of the runner (Cargo). diff --git a/.changes/cli-product-name-validation.md b/.changes/cli-product-name-validation.md new file mode 100644 index 000000000..39e73f883 --- /dev/null +++ b/.changes/cli-product-name-validation.md @@ -0,0 +1,7 @@ +--- +"cli.rs": "patch" +"tauri-utils": "patch" +--- + +Validate `pacakge > productName` in the tauri config and produce errors if it contains one of the following characters `/\:*?\"<>|` + diff --git a/.changes/cli-static-files-hot-reload.md b/.changes/cli-static-files-hot-reload.md new file mode 100644 index 000000000..008f6817c --- /dev/null +++ b/.changes/cli-static-files-hot-reload.md @@ -0,0 +1,5 @@ +--- +"cli.rs": "minor" +--- + +Hot-reload the frontend when `tauri.conf.json > build > devPath` points to a directory. diff --git a/.changes/cli-target-triple-env.md b/.changes/cli-target-triple-env.md new file mode 100644 index 000000000..3dd2ba11a --- /dev/null +++ b/.changes/cli-target-triple-env.md @@ -0,0 +1,5 @@ +--- +"cli.rs": "patch" +--- + +Expose `TAURI_TARGET_TRIPLE` to `beforeDevCommand`, `beforeBuildCommand` and `beforeBundleCommand` diff --git a/.changes/cli-tauricon.md b/.changes/cli-tauricon.md deleted file mode 100644 index 15a353b91..000000000 --- a/.changes/cli-tauricon.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"cli.rs": minor ---- - -Add `icon` command to generate icons. diff --git a/.changes/cli-watcher-info.md b/.changes/cli-watcher-info.md new file mode 100644 index 000000000..584deaa24 --- /dev/null +++ b/.changes/cli-watcher-info.md @@ -0,0 +1,6 @@ +--- +"cli.rs": patch +"cli.js": patch +--- + +Log dev watcher file change detection. diff --git a/.changes/cli.js-node-shim-and-deno.md b/.changes/cli.js-node-shim-and-deno.md new file mode 100644 index 000000000..dc61a5440 --- /dev/null +++ b/.changes/cli.js-node-shim-and-deno.md @@ -0,0 +1,5 @@ +--- +"cli.js": patch +--- + +Fix crash when nodejs binary has the version in its name, for example `node18` or when running through deno. diff --git a/.changes/codegen-check-target.md b/.changes/codegen-check-target.md deleted file mode 100644 index 3156b592a..000000000 --- a/.changes/codegen-check-target.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri-codegen": patch ---- - -Use `TARGET` environment variable for code generation inside build scripts. diff --git a/.changes/command-into-stdcommand.md b/.changes/command-into-stdcommand.md deleted file mode 100644 index 0bb818ba7..000000000 --- a/.changes/command-into-stdcommand.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri": patch ---- - -Implement `From for std::process::Command`. diff --git a/.changes/config.json b/.changes/config.json index 31301b4d7..826e21c8c 100644 --- a/.changes/config.json +++ b/.changes/config.json @@ -207,7 +207,13 @@ "path": "./core/tauri-build", "manager": "rust", "dependencies": ["tauri-codegen", "tauri-utils"], - "postversion": "node ../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }" + "postversion": "node ../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }", + "assets": [ + { + "path": "./tooling/cli/schema.json", + "name": "schema.json" + } + ] }, "tauri": { "path": "./core/tauri", @@ -224,7 +230,10 @@ "path": "./tooling/cli/node", "manager": "javascript", "dependencies": ["cli.rs"], - "postversion": "node ../../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }", + "postversion": [ + "node ../../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }", + "cargo build --manifest-path ../../core/config-schema/Cargo.toml" + ], "prepublish": [], "publish": [], "postpublish": [] @@ -238,10 +247,6 @@ { "path": "${ pkg.path }/target/package/tauri-cli-${ pkgFile.version }.crate", "name": "${ pkg.pkg }-${ pkgFile.version }.crate" - }, - { - "path": "${ pkg.path }/schema.json", - "name": "schema.json" } ] }, diff --git a/.changes/custom-protocol-uri-parse.md b/.changes/custom-protocol-uri-parse.md new file mode 100644 index 000000000..c5b89ee79 --- /dev/null +++ b/.changes/custom-protocol-uri-parse.md @@ -0,0 +1,5 @@ +--- +"tauri": minor +--- + +The custom protocol now validates the request URI. This has implications when using the `asset` protocol without the `convertFileSrc` helper, the URL must now use the `asset://localhost/$filePath` format. diff --git a/.changes/default-ignore-file.md b/.changes/default-ignore-file.md deleted file mode 100644 index 2bff91390..000000000 --- a/.changes/default-ignore-file.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"cli.rs": patch -"cli.js": patch ---- - -Automatically use any `.taurignore` file as ignore rules for dev watcher and app path finder. diff --git a/.changes/dialog-save-return-fix.md b/.changes/dialog-save-return-fix.md new file mode 100644 index 000000000..89366bde0 --- /dev/null +++ b/.changes/dialog-save-return-fix.md @@ -0,0 +1,5 @@ +--- +"api": patch +--- + +Fix `dialog.save` return type diff --git a/.changes/drop-web-context.md b/.changes/drop-web-context.md new file mode 100644 index 000000000..84a043be5 --- /dev/null +++ b/.changes/drop-web-context.md @@ -0,0 +1,5 @@ +--- +"tauri-runtime-wry": patch +--- + +Drop the WebContext when the WebView is dropped. diff --git a/.changes/enhance-tray-api.md b/.changes/enhance-tray-api.md deleted file mode 100644 index 9cd6707fd..000000000 --- a/.changes/enhance-tray-api.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri": patch ---- - -Enhance `SystemTray::with_icon` to accept `tauri::Icon`. diff --git a/.changes/enhance-windows-dialog-style.md b/.changes/enhance-windows-dialog-style.md deleted file mode 100644 index 7ffa214ce..000000000 --- a/.changes/enhance-windows-dialog-style.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri-build": patch ---- - -Enhance the dialog style on Windows via the manifest dependency `Microsoft.Windows.Common-Controls v6.0.0.0`. diff --git a/.changes/escape-pattern.md b/.changes/escape-pattern.md new file mode 100644 index 000000000..4fe1907f0 --- /dev/null +++ b/.changes/escape-pattern.md @@ -0,0 +1,5 @@ +--- +"tauri": "patch" +--- + +Escape glob special characters in files/directories when dropping files or using the open/save dialogs. diff --git a/.changes/fips-compliant-env-var.md b/.changes/fips-compliant-env-var.md deleted file mode 100644 index 44934310e..000000000 --- a/.changes/fips-compliant-env-var.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"cli.rs": patch -"cli.js": patch ---- - -Enable WiX FIPS compliance when the `TAURI_FIPS_COMPLIANT` environment variable is set to `true`. diff --git a/.changes/fips-compliant.md b/.changes/fips-compliant.md deleted file mode 100644 index 508d192f0..000000000 --- a/.changes/fips-compliant.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri-bundler": patch ---- - -Add `fips_compliant` configuration option for WiX. diff --git a/.changes/fix-async-mockipc.md b/.changes/fix-async-mockipc.md deleted file mode 100644 index 16059b76e..000000000 --- a/.changes/fix-async-mockipc.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"api": patch ---- - -Update `mockIPC()` handler signature to allow async handler functions. diff --git a/.changes/fix-build-codegen.md b/.changes/fix-build-codegen.md deleted file mode 100644 index 2a5f62cb9..000000000 --- a/.changes/fix-build-codegen.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri-build": patch ---- - -Fix root of codegen output when using the `CodegenContext` API. diff --git a/.changes/fix-cli-envs.md b/.changes/fix-cli-envs.md new file mode 100644 index 000000000..7f329c780 --- /dev/null +++ b/.changes/fix-cli-envs.md @@ -0,0 +1,5 @@ +--- +"cli.rs": "patch" +--- + +Set `TAURI_PLATFORM_TYPE`, `TAURI_FAMILY`, `TAURI_ARCH` and `TAURI_PLATFORM` env vars for hook commands to based on the app not the cli. diff --git a/.changes/fix-cli-subcommand-matches.md b/.changes/fix-cli-subcommand-matches.md deleted file mode 100644 index 3c8593f3b..000000000 --- a/.changes/fix-cli-subcommand-matches.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri": patch ---- - -Fixes CLI parser ignoring inner subcommands. diff --git a/.changes/fix-event-payload.md b/.changes/fix-event-payload.md new file mode 100644 index 000000000..5d35305a7 --- /dev/null +++ b/.changes/fix-event-payload.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Properly emit events with object payload. diff --git a/.changes/fix-html-template.md b/.changes/fix-html-template.md new file mode 100644 index 000000000..203f98f9f --- /dev/null +++ b/.changes/fix-html-template.md @@ -0,0 +1,6 @@ +--- +"tauri-utils": patch +"tauri-codegen": patch +--- + +Properly serialize HTML template tags. diff --git a/.changes/fix-metadata-update.md b/.changes/fix-metadata-update.md new file mode 100644 index 000000000..d21507a03 --- /dev/null +++ b/.changes/fix-metadata-update.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Fixes access to the `WebviewWindow.getByLabel` function in a `tauri://window-created` event listener. diff --git a/.changes/fix-resource-scope.md b/.changes/fix-resource-scope.md new file mode 100644 index 000000000..07f206885 --- /dev/null +++ b/.changes/fix-resource-scope.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Fixes resource reading being always rejected by the scope. diff --git a/.changes/fix-tauri-pattern-freeze.md b/.changes/fix-tauri-pattern-freeze.md new file mode 100644 index 000000000..fce43572c --- /dev/null +++ b/.changes/fix-tauri-pattern-freeze.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Fixes `__TAURI_PATTERN__` object freeze. diff --git a/.changes/fix-typo-in-state-rs.md b/.changes/fix-typo-in-state-rs.md deleted file mode 100644 index e61e056b4..000000000 --- a/.changes/fix-typo-in-state-rs.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri": patch ---- - -Fix typo in invalid state access panic message. diff --git a/.changes/fix-updater-finder-icon.md b/.changes/fix-updater-finder-icon.md deleted file mode 100644 index b5e50b92c..000000000 --- a/.changes/fix-updater-finder-icon.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri": patch ---- - -Fixes updater breaking the app icon in Finder. diff --git a/.changes/fix-watcher.md b/.changes/fix-watcher.md deleted file mode 100644 index 6f63cfd56..000000000 --- a/.changes/fix-watcher.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"cli.rs": patch -"cli.js": patch ---- - -Fixes dev watcher incorrectly exiting the CLI when sequential file updates are detected. diff --git a/.changes/fix-window-id-getter.md b/.changes/fix-window-id-getter.md deleted file mode 100644 index bf975e601..000000000 --- a/.changes/fix-window-id-getter.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri-runtime-wry": patch ---- - -Ignore window events with unknown IDs. diff --git a/.changes/focused.md b/.changes/focused.md new file mode 100644 index 000000000..da3fd4edd --- /dev/null +++ b/.changes/focused.md @@ -0,0 +1,7 @@ +--- +"tauri": minor +"tauri-runtime": minor +"tauri-runtime-wry": minor +--- + +Readd the option to create an unfocused window via the `focused` method. The `focus` function has been deprecated. diff --git a/.changes/hidden-title-macos.md b/.changes/hidden-title-macos.md new file mode 100644 index 000000000..2ff415c61 --- /dev/null +++ b/.changes/hidden-title-macos.md @@ -0,0 +1,6 @@ +--- +'tauri': minor +"tauri-runtime-wry": minor +--- + +Add `hidden_title` option for macOS windows. diff --git a/.changes/improve-event-emitter.md b/.changes/improve-event-emitter.md deleted file mode 100644 index 5ee9c9416..000000000 --- a/.changes/improve-event-emitter.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"api": minor ---- - -Improve shell's `Command`, `Command.stdout` and `Command.stderr` events with new `once`, `off`, `listenerCount`, `prependListener`, `prependOnceListener` and `removeAllListeners` functions. diff --git a/.changes/improve-tray-errors.md b/.changes/improve-tray-errors.md deleted file mode 100644 index e2fbb0400..000000000 --- a/.changes/improve-tray-errors.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri-codegen": patch ---- - -Improve tray icon read error message. diff --git a/.changes/isolation-pattern-config.md b/.changes/isolation-pattern-config.md new file mode 100644 index 000000000..81426f3bf --- /dev/null +++ b/.changes/isolation-pattern-config.md @@ -0,0 +1,5 @@ +--- +"tauri-utils": minor +--- + +`PatternKind::Isolation` is now defined even without the `isolation` feature. diff --git a/.changes/issue-4723.md b/.changes/issue-4723.md deleted file mode 100644 index 6a375d288..000000000 --- a/.changes/issue-4723.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri-codegen": patch ---- - -Fix relative paths in `version` field of `tauri.config.json` not being correctly parsed by `generate_context!()`. diff --git a/.changes/libc-field.md b/.changes/libc-field.md deleted file mode 100644 index c6515bdda..000000000 --- a/.changes/libc-field.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"cli.js": patch ---- - -Add `libc` field to Node packages. diff --git a/.changes/linux-header-support.md b/.changes/linux-header-support.md new file mode 100644 index 000000000..7a77dd6a3 --- /dev/null +++ b/.changes/linux-header-support.md @@ -0,0 +1,6 @@ +--- +"tauri": minor +"tauri-runtime-wry": minor +--- + +Custom protocol headers are now implemented on Linux when running on webkit2gtk 2.36 or above. diff --git a/.changes/linux-theme.md b/.changes/linux-theme.md deleted file mode 100644 index 563718f6f..000000000 --- a/.changes/linux-theme.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"tauri-runtime-wry": patch -"tauri": patch ---- - -Implement theme APIs for Linux. diff --git a/.changes/mac-app-hide-allowlist.md b/.changes/mac-app-hide-allowlist.md new file mode 100644 index 000000000..d9d0baf40 --- /dev/null +++ b/.changes/mac-app-hide-allowlist.md @@ -0,0 +1,5 @@ +--- +"tauri-utils": minor +--- + +Added the `app` allowlist module. diff --git a/.changes/mac-app-hide-api.md b/.changes/mac-app-hide-api.md new file mode 100644 index 000000000..2d82c670b --- /dev/null +++ b/.changes/mac-app-hide-api.md @@ -0,0 +1,5 @@ +--- +"api": minor +--- + +Added `show` and `hide` methods on the `app` module. diff --git a/.changes/mac-app-hide-runtime.md b/.changes/mac-app-hide-runtime.md new file mode 100644 index 000000000..0d229522e --- /dev/null +++ b/.changes/mac-app-hide-runtime.md @@ -0,0 +1,6 @@ +--- +"tauri-runtime-wry": minor +"tauri-runtime": minor +--- + +Added `Runtime::show()`, `RuntimeHandle::show()`, `Runtime::hide()`, `RuntimeHandle::hide()` for hiding/showing the entire application on macOS. diff --git a/.changes/mac-app-hide.md b/.changes/mac-app-hide.md new file mode 100644 index 000000000..38c458ac7 --- /dev/null +++ b/.changes/mac-app-hide.md @@ -0,0 +1,5 @@ +--- +"tauri": minor +--- + +Add `App::show()`, `AppHandle::show()`, `App::hide()` and `AppHandle::hide()` for hiding/showing the entire application on macOS. diff --git a/.changes/macos-deployment-target-env-var.md b/.changes/macos-deployment-target-env-var.md deleted file mode 100644 index 4886cad69..000000000 --- a/.changes/macos-deployment-target-env-var.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"cli.rs": patch -"cli.js": patch ---- - -Set the `MACOSX_DEPLOYMENT_TARGET` environment variable with the configuration `minimum_system_version` value. diff --git a/.changes/menu-deadlock.md b/.changes/menu-deadlock.md new file mode 100644 index 000000000..3d35da675 --- /dev/null +++ b/.changes/menu-deadlock.md @@ -0,0 +1,5 @@ +--- +"tauri": "patch" +--- + +Fix a deadlock when modifying the menu in the `on_menu_event` closure. diff --git a/.changes/menu-on-left-click.md b/.changes/menu-on-left-click.md new file mode 100644 index 000000000..a45831916 --- /dev/null +++ b/.changes/menu-on-left-click.md @@ -0,0 +1,6 @@ +--- +"tauri-runtime-wry": "patch" +--- + +Fix regression in `SystemTray::with_menu_on_left_click` + diff --git a/.changes/config-toml.md b/.changes/msrv-1.59.md similarity index 59% rename from .changes/config-toml.md rename to .changes/msrv-1.59.md index c9029ef5d..6d56d02e4 100644 --- a/.changes/config-toml.md +++ b/.changes/msrv-1.59.md @@ -1,11 +1,12 @@ --- -"tauri": minor -"tauri-utils": minor -"tauri-macros": minor -"tauri-codegen": minor -"tauri-build": minor "cli.rs": minor -"cli.js": minor +"tauri-bundler": minor +"tauri": minor +"tauri-build": minor +"tauri-codegen": minor +"tauri-macros": minor +"tauri-utils": minor +"tauri-runtime": minor +"tauri-runtime-wry": minor --- -Added support to configuration files in TOML format (Tauri.toml file). diff --git a/.changes/no-watch.md b/.changes/no-watch.md deleted file mode 100644 index b24549847..000000000 --- a/.changes/no-watch.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"cli.rs": minor -"cli.js": minor ---- - -Added `--no-watch` argument to the `dev` command to disable the file watcher. diff --git a/.changes/publisher-field.md b/.changes/publisher-field.md new file mode 100644 index 000000000..93832b0b2 --- /dev/null +++ b/.changes/publisher-field.md @@ -0,0 +1,8 @@ +--- +"tauri-utils": "minor" +"tauri-bundler": "minor" +"cli.rs": "minor" +--- + +Add `tauri.conf.json > bundle > publisher` field to specify the app publisher. + diff --git a/.changes/raw-display-handle.md b/.changes/raw-display-handle.md deleted file mode 100644 index 2c99b533f..000000000 --- a/.changes/raw-display-handle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri": "patch" ---- - -Implement `raw_window_handle::HasRawDisplayHandle` for `App` and `AppHandle` diff --git a/.changes/readme.md b/.changes/readme.md new file mode 100644 index 000000000..8151b11df --- /dev/null +++ b/.changes/readme.md @@ -0,0 +1,31 @@ +# Changes + +##### via https://github.com/jbolda/covector + +As you create PRs and make changes that require a version bump, please add a new markdown file in this folder. You do not note the version _number_, but rather the type of bump that you expect: major, minor, or patch. The filename is not important, as long as it is a `.md`, but we recommend that it represents the overall change for organizational purposes. + +When you select the version bump required, you do _not_ need to consider dependencies. Only note the package with the actual change, and any packages that depend on that package will be bumped automatically in the process. + +Use the following format: + +```md +--- +"package-a": patch +"package-b": patch +--- + +Change summary goes here + +``` + +Summaries do not have a specific character limit, but are text only. These summaries are used within the (future implementation of) changelogs. They will give context to the change and also point back to the original PR if more details and context are needed. + +Changes will be designated as a `major`, `minor` or `patch` as further described in [semver](https://semver.org/). + +Given a version number MAJOR.MINOR.PATCH, increment the: + +- MAJOR version when you make incompatible API changes, +- MINOR version when you add functionality in a backwards compatible manner, and +- PATCH version when you make backwards compatible bug fixes. + +Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format, but will be discussed prior to usage (as extra steps will be necessary in consideration of merging and publishing). \ No newline at end of file diff --git a/.changes/refactor-windows-map.md b/.changes/refactor-windows-map.md deleted file mode 100644 index 753278125..000000000 --- a/.changes/refactor-windows-map.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri-runtime-wry": minor ---- - -Changed `windows` map to be stored in a `RefCell` instead of a `Mutex`. diff --git a/.changes/resource-dir-canonicalize.md b/.changes/resource-dir-canonicalize.md new file mode 100644 index 000000000..a53f820c1 --- /dev/null +++ b/.changes/resource-dir-canonicalize.md @@ -0,0 +1,5 @@ +--- +"tauri-utils": patch +--- + +Canonicalize the return value of `platform::resource_dir`. diff --git a/.changes/retain-args.md b/.changes/retain-args.md deleted file mode 100644 index 30596c643..000000000 --- a/.changes/retain-args.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri": patch ---- - -Retain command line arguments in `api::process::restart`. diff --git a/.changes/shell-encoding-api.md b/.changes/shell-encoding-api.md deleted file mode 100644 index 30909c2e6..000000000 --- a/.changes/shell-encoding-api.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"api": minor ---- - -Added the `encoding` option to the `Command` options. diff --git a/.changes/shell-encoding.md b/.changes/shell-encoding.md deleted file mode 100644 index a9357ff2c..000000000 --- a/.changes/shell-encoding.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri": minor ---- - -Add `api::Command::encoding` method to set the stdout/stderr encoding. diff --git a/.changes/skip-redirects.md b/.changes/skip-redirects.md deleted file mode 100644 index c2056b954..000000000 --- a/.changes/skip-redirects.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri": patch ---- - -Do not follow redirects when `api::http::ClientBuilder::max_redirections` is `0`. diff --git a/.changes/tabbing-identifier-api.md b/.changes/tabbing-identifier-api.md new file mode 100644 index 000000000..66d695981 --- /dev/null +++ b/.changes/tabbing-identifier-api.md @@ -0,0 +1,5 @@ +--- +"api": minor +--- + +Added `tabbingIdentifier` window option for macOS. diff --git a/.changes/windows-update.md b/.changes/tabbing-identifier.md similarity index 50% rename from .changes/windows-update.md rename to .changes/tabbing-identifier.md index 3a07f1d16..0e3b3f181 100644 --- a/.changes/windows-update.md +++ b/.changes/tabbing-identifier.md @@ -1,8 +1,8 @@ --- -"tauri-runtime-wry": minor -"tauri-runtime": minor -"tauri-utils": minor "tauri": minor +"tauri-runtime": minor +"tauri-runtime-wry": minor +"api": minor --- -Update windows to 0.39.0 and webview2-com to 0.19.1. +Added `tabbing_identifier` to the window builder on macOS. diff --git a/.changes/transparent-titlebar-macos.md b/.changes/transparent-titlebar-macos.md new file mode 100644 index 000000000..fba683818 --- /dev/null +++ b/.changes/transparent-titlebar-macos.md @@ -0,0 +1,6 @@ +--- +'tauri': minor +"tauri-runtime-wry": minor +--- + +Add `title_bar_style` option for macOS windows. diff --git a/.changes/tray-cleanup.md b/.changes/tray-cleanup.md new file mode 100644 index 000000000..3d5eeb24d --- /dev/null +++ b/.changes/tray-cleanup.md @@ -0,0 +1,5 @@ +--- +"tauri-runtime-wry": "patch" +--- + +Fix regression introduce in tauri@1.1 which prevented removing tray icon when the app exits on Windows. diff --git a/.changes/tray-destroy.md b/.changes/tray-destroy.md deleted file mode 100644 index f4f8e5893..000000000 --- a/.changes/tray-destroy.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri": minor ---- - -Added the `SystemTrayHandle::destroy` method. diff --git a/.changes/tray-title-config.md b/.changes/tray-title-config.md new file mode 100644 index 000000000..2ad02e9e9 --- /dev/null +++ b/.changes/tray-title-config.md @@ -0,0 +1,5 @@ +--- +"tauri-utils": minor +--- + +Added `title` option on the system tray configuration (macOS only). diff --git a/.changes/runtime-tray.md b/.changes/tray-title.md similarity index 58% rename from .changes/runtime-tray.md rename to .changes/tray-title.md index 69eeb6c31..a90729215 100644 --- a/.changes/runtime-tray.md +++ b/.changes/tray-title.md @@ -4,4 +4,4 @@ "tauri-runtime-wry": minor --- -Added APIs to create a system tray at runtime. +Added methods to set the system tray title on macOS. diff --git a/.changes/user-agent-config.md b/.changes/user-agent-config.md new file mode 100644 index 000000000..f0e168b7a --- /dev/null +++ b/.changes/user-agent-config.md @@ -0,0 +1,5 @@ +--- +"tauri-utils": minor +--- + +Added the `user_agent` option to the window configuration. diff --git a/.changes/user-agent.md b/.changes/user-agent.md new file mode 100644 index 000000000..08fa1c423 --- /dev/null +++ b/.changes/user-agent.md @@ -0,0 +1,8 @@ +--- +"api": minor +"tauri": minor +"tauri-runtime-wry": minor +"tauri-runtime": minor +--- + +Added the `user_agent` option when creating a window. diff --git a/.changes/utils-mimetype.md b/.changes/utils-mimetype.md new file mode 100644 index 000000000..77185aa8b --- /dev/null +++ b/.changes/utils-mimetype.md @@ -0,0 +1,5 @@ +--- +"tauri-utils": "patch" +--- + +Add `mime_type` module. diff --git a/.changes/utils-parse-refactor.md b/.changes/utils-parse-refactor.md deleted file mode 100644 index c0b593c38..000000000 --- a/.changes/utils-parse-refactor.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri-utils": minor ---- - -Refactored the `config::parse` module. diff --git a/.changes/validate-sidecar-name.md b/.changes/validate-sidecar-name.md deleted file mode 100644 index 850d1263b..000000000 --- a/.changes/validate-sidecar-name.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri-build": patch ---- - -Return an error if a sidecar is configured with the same file name as the application. diff --git a/.changes/validate-signature.md b/.changes/validate-signature.md deleted file mode 100644 index 03e0bda33..000000000 --- a/.changes/validate-signature.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"cli.rs": patch -"cli.js": patch ---- - -Validate updater signature matches configured public key. diff --git a/.changes/vendored-openssl.md b/.changes/vendored-openssl.md deleted file mode 100644 index ec39b4b65..000000000 --- a/.changes/vendored-openssl.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri": patch ---- - -Added `native-tls-vendored` and `reqwest-native-tls-vendored` Cargo features to compile and statically link to a vendored copy of OpenSSL on Linux. diff --git a/.changes/wix-clear-env.md b/.changes/wix-clear-env.md new file mode 100644 index 000000000..2738bac6a --- /dev/null +++ b/.changes/wix-clear-env.md @@ -0,0 +1,5 @@ +--- +"tauri-bundler": patch +--- + +Clear environment variables on the WiX light.exe and candle.exe commands to avoid "Windows Installer Service could not be accessed" error. Variables prefixed with `TAURI` are propagated. diff --git a/.changes/write-only-changed.md b/.changes/write-only-changed.md deleted file mode 100644 index 0d57efdb1..000000000 --- a/.changes/write-only-changed.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"tauri-codegen": patch -"tauri-build": patch ---- - -Only rewrite temporary icon files when the content change, avoid needless rebuilds. diff --git a/.github/workflows/artifacts-updater.yml b/.github/workflows/artifacts-updater.yml index 454b17762..2eb1dea7f 100644 --- a/.github/workflows/artifacts-updater.yml +++ b/.github/workflows/artifacts-updater.yml @@ -72,7 +72,7 @@ jobs: - name: Cache core cargo target uses: actions/cache@v2 env: - cache-name: cargo_core + cache-name: cargo-core with: path: target # Add date to the cache to keep it up to date @@ -114,7 +114,7 @@ jobs: working-directory: ./examples/updater run: | yarn install - cargo tauri build + cargo tauri build --verbose env: # Notarization (disabled) # FIXME: enable only on `dev` push maybe? as it take some times... @@ -128,15 +128,17 @@ jobs: APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} # Updater signature is exposed here to make sure it works in PR's TAURI_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5YTBGV3JiTy9lRDZVd3NkL0RoQ1htZmExNDd3RmJaNmRMT1ZGVjczWTBKZ0FBQkFBQUFBQUFBQUFBQUlBQUFBQWdMekUzVkE4K0tWQ1hjeGt1Vkx2QnRUR3pzQjVuV0ZpM2czWXNkRm9hVUxrVnB6TUN3K1NheHJMREhQbUVWVFZRK3NIL1VsMDBHNW5ET1EzQno0UStSb21nRW4vZlpTaXIwZFh5ZmRlL1lSN0dKcHdyOUVPclVvdzFhVkxDVnZrbHM2T1o4Tk1NWEU9Cg== + TAURI_KEY_PASSWORD: # run on PRs and forks - name: build sample artifacts (updater) if: steps.enablecodesigning.outputs.enabled != 'true' working-directory: ./examples/updater run: | yarn install - cargo tauri build + cargo tauri build --verbose env: TAURI_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5YTBGV3JiTy9lRDZVd3NkL0RoQ1htZmExNDd3RmJaNmRMT1ZGVjczWTBKZ0FBQkFBQUFBQUFBQUFBQUlBQUFBQWdMekUzVkE4K0tWQ1hjeGt1Vkx2QnRUR3pzQjVuV0ZpM2czWXNkRm9hVUxrVnB6TUN3K1NheHJMREhQbUVWVFZRK3NIL1VsMDBHNW5ET1EzQno0UStSb21nRW4vZlpTaXIwZFh5ZmRlL1lSN0dKcHdyOUVPclVvdzFhVkxDVnZrbHM2T1o4Tk1NWEU9Cg== + TAURI_KEY_PASSWORD: # upload assets - uses: actions/upload-artifact@v2 if: matrix.platform == 'ubuntu-latest' diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 22f8e295c..3491db02b 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -74,7 +74,7 @@ jobs: - name: Cache core cargo target uses: actions/cache@v2 env: - cache-name: cargo_core + cache-name: cargo-core with: path: target # Add date to the cache to keep it up to date diff --git a/.github/workflows/check-generated-files.yml b/.github/workflows/check-generated-files.yml new file mode 100644 index 000000000..58686ddee --- /dev/null +++ b/.github/workflows/check-generated-files.yml @@ -0,0 +1,113 @@ +# Copyright 2019-2022 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT + +name: Check generated files + +on: + push: + paths: + - '.github/workflows/check-generated-files.yml' + - 'tooling/api/src/**' + - 'core/tauri/scripts/bundle.global.js' + - 'core/tauri-utils/src/config.rs' + - 'tooling/cli/schema.json' + - 'core/config-schema/schema.json' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + changes: + runs-on: ubuntu-latest + outputs: + bundle: ${{ steps.filter.outputs.bundle }} + schema: ${{ steps.filter.outputs.schema }} + steps: + - uses: actions/checkout@v2 + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + bundle: + - 'tooling/api/src/**' + - 'core/tauri/scripts/bundle.global.js' + schema: + - 'core/tauri-utils/src/config.rs' + - 'tooling/cli/schema.json' + - 'core/config-schema/schema.json' + + check-bundle: + runs-on: ubuntu-latest + needs: changes + if: needs.changes.outputs.bundle == 'true' + steps: + - uses: actions/checkout@v2 + - name: generate bundle + working-directory: tooling/api + run: yarn && yarn build + - name: check bundle + run: ./.scripts/ci/has-diff.sh + + check-schema: + runs-on: ubuntu-latest + needs: changes + if: needs.changes.outputs.schema == 'true' + steps: + - uses: actions/checkout@v2 + + - uses: actions/checkout@v2 + - name: install stable + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: install Linux dependencies + run: | + sudo apt-get update + sudo apt-get install -y libgtk-3-dev + + - name: Get current date + run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + + - name: Cache cargo state + uses: actions/cache@v2 + env: + cache-name: cargo_state + with: + path: | + ~/.cargo/registry + ~/.cargo/git + ~/.cargo/bin + key: ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }} + restore-keys: | + ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}- + ubuntu-latest-stable-${{ env.cache-name }}- + ubuntu-latest-stable- + ubuntu-latest- + + - name: Cache core cargo target + uses: actions/cache@v2 + env: + cache-name: cargo-core + with: + path: target + # Add date to the cache to keep it up to date + key: ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }} + # Restore from outdated cache for speed + restore-keys: | + ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }} + ubuntu-latest-stable-${{ env.cache-name }}- + ubuntu-latest-stable- + ubuntu-latest- + + - name: generate schema.json + uses: actions-rs/cargo@v1 + with: + command: build + args: --manifest-path ./core/config-schema/Cargo.toml + + - name: check schema + run: ./.scripts/ci/has-diff.sh diff --git a/.github/workflows/covector-version-or-publish.yml b/.github/workflows/covector-version-or-publish.yml index 1364516a2..f4c702f71 100644 --- a/.github/workflows/covector-version-or-publish.yml +++ b/.github/workflows/covector-version-or-publish.yml @@ -60,7 +60,7 @@ jobs: - name: Cache core cargo target uses: actions/cache@v2 env: - cache-name: cargo_core + cache-name: cargo-core with: path: target # Add date to the cache to keep it up to date @@ -126,7 +126,7 @@ jobs: cache-dependency-path: tooling/*/yarn.lock - name: cargo login - run: cargo login ${{ secrets.crate_token }} + run: cargo login ${{ secrets.ORG_CRATES_IO_TOKEN }} - name: git config run: | git config --global user.name "${{ github.event.pusher.name }}" @@ -136,7 +136,7 @@ jobs: uses: jbolda/covector/packages/action@covector-v0 id: covector env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }} CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }} with: token: ${{ secrets.GITHUB_TOKEN }} @@ -145,7 +145,7 @@ jobs: - name: Create Pull Request With Versions Bumped if: steps.covector.outputs.commandRan == 'version' - uses: tauri-apps/create-pull-request@v3.4.1 + uses: tauri-apps/create-pull-request@v3 with: token: ${{ secrets.GITHUB_TOKEN }} branch: release/version-updates @@ -155,10 +155,12 @@ jobs: body: ${{ steps.covector.outputs.change }} - name: Trigger doc update - if: steps.covector.outputs.successfulPublish == 'true' + if: | + steps.covector.outputs.successfulPublish == 'true' && + steps.covector.outputs.packagesPublished != '' uses: peter-evans/repository-dispatch@v1 with: - token: ${{ secrets.TAURI_BOT_PAT }} + token: ${{ secrets.ORG_TAURI_BOT_PAT }} repository: tauri-apps/tauri-docs event-type: update-docs @@ -168,10 +170,10 @@ jobs: contains(steps.covector.outputs.packagesPublished, 'cli.rs') uses: peter-evans/repository-dispatch@v1 with: - token: ${{ secrets.TAURI_BOT_PAT }} + token: ${{ secrets.ORG_TAURI_BOT_PAT }} repository: tauri-apps/tauri event-type: publish-clijs - client-payload: '{"releaseId": "${{ steps.covector.outputs.cli.js-releaseId }}" }' + inputs: '{"releaseId": "${{ steps.covector.outputs.cli.js-releaseId }}" }' - name: Trigger cli.rs publishing workflow if: | @@ -179,6 +181,6 @@ jobs: contains(steps.covector.outputs.packagesPublished, 'cli.rs') uses: peter-evans/repository-dispatch@v1 with: - token: ${{ secrets.TAURI_BOT_PAT }} + token: ${{ secrets.ORG_TAURI_BOT_PAT }} repository: tauri-apps/tauri event-type: publish-clirs diff --git a/.github/workflows/lint-fmt-core.yml b/.github/workflows/lint-fmt-core.yml index eb28ec097..6bc15c0fa 100644 --- a/.github/workflows/lint-fmt-core.yml +++ b/.github/workflows/lint-fmt-core.yml @@ -13,6 +13,7 @@ on: paths: - '.github/workflows/lint-fmt-core.yml' - 'core/**' + - '!core/tauri/scripts/**' - 'examples/**' env: @@ -97,7 +98,7 @@ jobs: - name: Cache core cargo target uses: actions/cache@v2 env: - cache-name: cargo_core + cache-name: cargo-core with: path: target # Add date to the cache to keep it up to date diff --git a/.github/workflows/publish-cli-js.yml b/.github/workflows/publish-cli-js.yml index 4af22aea7..d1fe19933 100644 --- a/.github/workflows/publish-cli-js.yml +++ b/.github/workflows/publish-cli-js.yml @@ -5,6 +5,10 @@ env: MACOSX_DEPLOYMENT_TARGET: '10.13' on: workflow_dispatch: + inputs: + releaseId: + description: 'ID of the cli.js release' + required: true repository_dispatch: types: [publish-clijs] @@ -396,5 +400,5 @@ jobs: npm publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - RELEASE_ID: ${{ github.event.client_payload.releaseId }} + NPM_TOKEN: ${{ secrets.ORG_NPM_TOKEN }} + RELEASE_ID: ${{ github.event.inputs.releaseId }} diff --git a/.github/workflows/test-core.yml b/.github/workflows/test-core.yml index fa5b6fb78..b79063bd5 100644 --- a/.github/workflows/test-core.yml +++ b/.github/workflows/test-core.yml @@ -13,6 +13,7 @@ on: paths: - '.github/workflows/test-core.yml' - 'core/**' + - '!core/tauri/scripts/**' env: RUST_BACKTRACE: 1 @@ -41,14 +42,14 @@ jobs: - { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, - toolchain: '1.57.0', + toolchain: '1.59.0', cross: false, command: 'test' } - { target: x86_64-apple-darwin, os: macos-latest, - toolchain: '1.57.0', + toolchain: '1.59.0', cross: false, command: 'test' } @@ -108,7 +109,7 @@ jobs: - name: Cache core cargo target uses: actions/cache@v2 env: - cache-name: cargo_core + cache-name: cargo-core with: path: target # Add date to the cache to keep it up to date @@ -120,10 +121,6 @@ jobs: ${{ matrix.platform.os }}-${{ matrix.platform.toolchain }}- ${{ matrix.platform.os }}- - - name: pin time - run: | - cargo update -p time --precise 0.3.13 - - name: test uses: actions-rs/cargo@v1 with: diff --git a/.github/workflows/udeps.yml b/.github/workflows/udeps.yml index 1bd56bcc9..73255477f 100644 --- a/.github/workflows/udeps.yml +++ b/.github/workflows/udeps.yml @@ -40,6 +40,7 @@ jobs: filters: | tauri: - 'core/tauri/**' + - '!core/tauri/scripts/**' build: - 'core/tauri-build/**' codegen: @@ -161,7 +162,7 @@ jobs: - name: Cache core cargo target uses: actions/cache@v2 env: - cache-name: cargo_core + cache-name: cargo-core with: path: target # Add date to the cache to keep it up to date diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..d677e46da --- /dev/null +++ b/.prettierignore @@ -0,0 +1,11 @@ +/.github +/.husky +/.vscode +/audits +node_modules +target +dist +/core/tauri/scripts +/tooling/cli/templates +/tooling/cli/node +/tooling/cli/schema.json diff --git a/.scripts/ci/has-diff.sh b/.scripts/ci/has-diff.sh new file mode 100755 index 000000000..dd40c06fd --- /dev/null +++ b/.scripts/ci/has-diff.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +if git diff --quiet --ignore-submodules HEAD +then + echo "working directory is clean" +else + echo "found diff" + exit 1 +fi diff --git a/.scripts/covector/sync-cli-metadata.js b/.scripts/covector/sync-cli-metadata.js index 3a0ebf7e7..f63cfe56e 100644 --- a/.scripts/covector/sync-cli-metadata.js +++ b/.scripts/covector/sync-cli-metadata.js @@ -1,5 +1,5 @@ #!/usr/bin/env node - // Copyright 2019-2022 Tauri Programme within The Commons Conservancy +// Copyright 2019-2022 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT @@ -10,34 +10,39 @@ we should look to find a more "rusty way" to import / "pin" a version value in o rust binaries. */ -const { - readFileSync, - writeFileSync -} = require('fs') +const { readFileSync, writeFileSync } = require('fs') const packageNickname = process.argv[2] -const filePath = packageNickname === 'cli.js' ? `../../../tooling/cli/metadata.json` : `../../tooling/cli/metadata.json` +const filePath = + packageNickname === 'cli.js' + ? `../../../tooling/cli/metadata.json` + : `../../tooling/cli/metadata.json` const bump = process.argv[3] let index = null switch (bump) { case 'major': - index = 0; - break; + index = 0 + break case 'minor': - index = 1; - break; + index = 1 + break case 'patch': - index = 2; - break; + index = 2 + break default: throw new Error('unexpected bump ' + bump) } const inc = (version) => { const v = version.split('.') - const n = v[index] - v[index] = String(Number(n) + 1) + for (let i = 0; i < v.length; i++) { + if (i === index) { + v[i] = String(Number(v[i]) + 1) + } else if (i > index) { + v[i] = 0 + } + } return v.join('.') } diff --git a/Cargo.toml b/Cargo.toml index 81e0b560a..d766718b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,7 @@ members = [ "core/tauri-utils", "core/tauri-build", "core/tauri-codegen", + "core/config-schema", # integration tests "core/tests/restart", @@ -29,6 +30,3 @@ codegen-units = 1 lto = true incremental = false opt-level = "s" - -[patch.crates-io] -tao = { git = "https://github.com/tauri-apps/tao", branch = "dev" } diff --git a/README.md b/README.md index a7a92309a..4feac90fd 100644 --- a/README.md +++ b/README.md @@ -78,22 +78,16 @@ For **running** Tauri apps we support the below configurations (these are automa 1 `appindicator` is only required if system trays are used -### App Bundles +### Features -- [x] App Icons -- [x] Build on macOS (.app, .dmg) -- [x] Build on Linux (.deb, AppImage) -- [x] Build on Windows (.exe, .msi) -- [x] Copy Buffer -- [x] Device Notifications (toast) +- [x] Desktop Bundler (.app, .dmg, .deb, AppImage, .msi) - [x] Self Updater - [x] App Signing -- [x] Frameless Mode -- [x] Transparent Mode -- [x] Multiwindow Mode -- [x] Tray -- [ ] deeplink RPC (in progress) -- [ ] One-Time commands (coming soon) +- [x] Native Notifications (toast) +- [x] App Tray +- [x] Core Plugin System +- [x] Scoped Filesystem +- [x] Sidecar ### Security Features @@ -106,39 +100,9 @@ For **running** Tauri apps we support the below configurations (these are automa ### Utilities +- [x] Rust-based CLI - [x] GH Action for creating binaries for all platforms - [x] VS Code Extension -- [x] Tauri Core Plugins -- [x] Update core dependencies automatically from the command line -- [x] Rust-based CLI - -### Comparison between Tauri and Electron - -| Detail | Tauri | Electron | -| -------------------------- | ------ | -------------------- | -| Installer Size Linux | 3.1 MB | 52.1 MB | -| Memory Consumption Linux | 180 MB | 462 MB | -| Launch Time Linux | 0.39s | 0.80s | -| Interface Service Provider | WRY | Chromium | -| Backend Binding | Rust | Node.js (ECMAScript) | -| Underlying Engine | Rust | V8 (C/C++) | -| FLOSS | Yes | No | -| Multithreading | Yes | Yes | -| Bytecode Delivery | Yes | No | -| Multiple Windows | Yes | Yes | -| Auto Updater | Yes | Yes1 | -| Custom App Icon | Yes | Yes | -| Windows Binary | Yes | Yes | -| macOS Binary | Yes | Yes | -| Linux Binary | Yes | Yes | -| iOS Binary | Soon | No | -| Android Binary | Soon | No | -| Desktop Tray | Yes | Yes | -| Sidecar Binaries | Yes | No | - -#### Notes - -1. Electron has no native auto updater on Linux, but is offered by electron-packager ## Development @@ -153,18 +117,6 @@ Tauri is a system composed of a number of moving pieces: - Netlify-hosted documentation website - DigitalOcean Meilisearch instance -### Major Runtimes - -- Node.js for running the CLI (deno and pure rust are on the roadmap) -- Cargo for testing, running the dev service, building binaries and as the runtime harness for the webview - -### Major Languages - -- Rust for the CLI -- ECMAScript bindings to the Rust API, written in typescript -- Rust for bindings, rust side of the API, harnesses -- Rust plugins to Tauri backend - ### Operating systems Tauri core can be developed on Mac, Linux and Windows, but you are encouraged to use the latest possible operating systems and build tools for your OS. @@ -186,7 +138,7 @@ Documentation in a polyglot system is a tricky proposition. To this end, we pref Test all the things! We have a number of test suites, but are always looking to improve our coverage: - Rust (`cargo test`) => sourced via inline `#[cfg(test)]` declarations -- TS (`jest`) => via spec files +- Typescript (`jest`) => via spec files - Smoke Tests (run on merges to latest) - eslint, clippy diff --git a/core/config-schema/Cargo.toml b/core/config-schema/Cargo.toml new file mode 100644 index 000000000..a304bfa38 --- /dev/null +++ b/core/config-schema/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "config-schema" +version = "0.0.0" +edition = "2021" +publish = false + +[build-dependencies] +tauri-utils = { version = "1.0.0", features = [ "schema" ], path = "../tauri-utils" } +schemars = { version = "0.8", features = [ "url", "preserve_order" ] } +serde = { version = "1.0", features = [ "derive" ] } +serde_json = "1.0" +serde_with = "1.12" +url = { version = "2.3", features = [ "serde" ] } diff --git a/core/config-schema/build.rs b/core/config-schema/build.rs new file mode 100644 index 000000000..fd0097699 --- /dev/null +++ b/core/config-schema/build.rs @@ -0,0 +1,25 @@ +// Copyright 2019-2022 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use std::{ + error::Error, + fs::File, + io::{BufWriter, Write}, + path::PathBuf, +}; + +pub fn main() -> Result<(), Box> { + let schema = schemars::schema_for!(tauri_utils::config::Config); + let schema_str = serde_json::to_string_pretty(&schema).unwrap(); + let crate_dir = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR")?); + for file in [ + crate_dir.join("schema.json"), + crate_dir.join("../../tooling/cli/schema.json"), + ] { + let mut schema_file = BufWriter::new(File::create(&file)?); + write!(schema_file, "{}", schema_str)?; + } + + Ok(()) +} diff --git a/core/config-schema/schema.json b/core/config-schema/schema.json new file mode 100644 index 000000000..f8d166b7a --- /dev/null +++ b/core/config-schema/schema.json @@ -0,0 +1,2845 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Config", + "description": "The Tauri configuration object. It is read from a file where you can define your frontend assets, configure the bundler, enable the app updater, define a system tray, enable APIs via the allowlist and more.\n\nThe configuration file is generated by the [`tauri init`](https://tauri.app/v1/api/cli#init) command that lives in your Tauri application source directory (src-tauri).\n\nOnce generated, you may modify it at will to customize your Tauri application.\n\n## File Formats\n\nBy default, the configuration is defined as a JSON file named `tauri.conf.json`.\n\nTauri also supports JSON5 and TOML files via the `config-json5` and `config-toml` Cargo features, respectively. The JSON5 file name must be either `tauri.conf.json` or `tauri.conf.json5`. The TOML file name is `Tauri.toml`.\n\n## Platform-Specific Configuration\n\nIn addition to the default configuration file, Tauri can read a platform-specific configuration from `tauri.linux.conf.json`, `tauri.windows.conf.json`, `tauri.macos.conf.json`, `tauri.android.conf.json` and `tauri.ios.conf.json` (or `Tauri.linux.toml`, `Tauri.windows.toml`, `Tauri.macos.toml`, `Tauri.android.toml` and `Tauri.ios.toml` if the `Tauri.toml` format is used), which gets merged with the main configuration object.\n\n## Configuration Structure\n\nThe configuration is composed of the following objects:\n\n- [`package`](#packageconfig): Package settings - [`tauri`](#tauriconfig): The Tauri config - [`build`](#buildconfig): The build configuration - [`plugins`](#pluginconfig): The plugins config\n\n```json title=\"Example tauri.config.json file\" { \"build\": { \"beforeBuildCommand\": \"\", \"beforeDevCommand\": \"\", \"devPath\": \"../dist\", \"distDir\": \"../dist\" }, \"package\": { \"productName\": \"tauri-app\", \"version\": \"0.1.0\" }, \"tauri\": { \"allowlist\": { \"all\": true }, \"bundle\": {}, \"security\": { \"csp\": null }, \"updater\": { \"active\": false }, \"windows\": [ { \"fullscreen\": false, \"height\": 600, \"resizable\": true, \"title\": \"Tauri App\", \"width\": 800 } ] } } ```", + "type": "object", + "properties": { + "$schema": { + "description": "The JSON schema for the Tauri config.", + "type": [ + "string", + "null" + ] + }, + "package": { + "description": "Package settings.", + "default": { + "productName": null, + "version": null + }, + "allOf": [ + { + "$ref": "#/definitions/PackageConfig" + } + ] + }, + "tauri": { + "description": "The Tauri configuration.", + "default": { + "allowlist": { + "all": false, + "app": { + "all": false, + "hide": false, + "show": false + }, + "clipboard": { + "all": false, + "readText": false, + "writeText": false + }, + "dialog": { + "all": false, + "ask": false, + "confirm": false, + "message": false, + "open": false, + "save": false + }, + "fs": { + "all": false, + "copyFile": false, + "createDir": false, + "exists": false, + "readDir": false, + "readFile": false, + "removeDir": false, + "removeFile": false, + "renameFile": false, + "scope": [], + "writeFile": false + }, + "globalShortcut": { + "all": false + }, + "http": { + "all": false, + "request": false, + "scope": [] + }, + "notification": { + "all": false + }, + "os": { + "all": false + }, + "path": { + "all": false + }, + "process": { + "all": false, + "exit": false, + "relaunch": false, + "relaunchDangerousAllowSymlinkMacos": false + }, + "protocol": { + "all": false, + "asset": false, + "assetScope": [] + }, + "shell": { + "all": false, + "execute": false, + "open": false, + "scope": [], + "sidecar": false + }, + "window": { + "all": false, + "center": false, + "close": false, + "create": false, + "hide": false, + "maximize": false, + "minimize": false, + "print": false, + "requestUserAttention": false, + "setAlwaysOnTop": false, + "setCursorGrab": false, + "setCursorIcon": false, + "setCursorPosition": false, + "setCursorVisible": false, + "setDecorations": false, + "setFocus": false, + "setFullscreen": false, + "setIcon": false, + "setIgnoreCursorEvents": false, + "setMaxSize": false, + "setMinSize": false, + "setPosition": false, + "setResizable": false, + "setSize": false, + "setSkipTaskbar": false, + "setTitle": false, + "show": false, + "startDragging": false, + "unmaximize": false, + "unminimize": false + } + }, + "bundle": { + "active": false, + "appimage": { + "bundleMediaFramework": false + }, + "deb": { + "files": {} + }, + "iOS": {}, + "icon": [], + "identifier": "", + "macOS": { + "minimumSystemVersion": "10.13" + }, + "targets": "all", + "windows": { + "allowDowngrades": true, + "certificateThumbprint": null, + "digestAlgorithm": null, + "timestampUrl": null, + "tsp": false, + "webviewFixedRuntimePath": null, + "webviewInstallMode": { + "silent": true, + "type": "downloadBootstrapper" + }, + "wix": null + } + }, + "macOSPrivateApi": false, + "pattern": { + "use": "brownfield" + }, + "security": { + "dangerousDisableAssetCspModification": false, + "freezePrototype": false + }, + "updater": { + "active": false, + "dialog": true, + "pubkey": "", + "windows": { + "installMode": "passive" + } + }, + "windows": [] + }, + "allOf": [ + { + "$ref": "#/definitions/TauriConfig" + } + ] + }, + "build": { + "description": "The build configuration.", + "default": { + "devPath": "http://localhost:8080/", + "distDir": "../dist", + "withGlobalTauri": false + }, + "allOf": [ + { + "$ref": "#/definitions/BuildConfig" + } + ] + }, + "plugins": { + "description": "The plugins config.", + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/PluginConfig" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "PackageConfig": { + "description": "The package configuration.", + "type": "object", + "properties": { + "productName": { + "description": "App name.", + "type": [ + "string", + "null" + ], + "pattern": "^[^/\\:*?\"<>|]+$" + }, + "version": { + "description": "App version. It is a semver version number or a path to a `package.json` file containing the `version` field.", + "default": null, + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + "TauriConfig": { + "description": "The Tauri configuration object.", + "type": "object", + "properties": { + "pattern": { + "description": "The pattern to use.", + "default": { + "use": "brownfield" + }, + "allOf": [ + { + "$ref": "#/definitions/PatternKind" + } + ] + }, + "windows": { + "description": "The windows configuration.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/WindowConfig" + } + }, + "cli": { + "description": "The CLI configuration.", + "anyOf": [ + { + "$ref": "#/definitions/CliConfig" + }, + { + "type": "null" + } + ] + }, + "bundle": { + "description": "The bundler configuration.", + "default": { + "active": false, + "appimage": { + "bundleMediaFramework": false + }, + "deb": { + "files": {} + }, + "iOS": {}, + "icon": [], + "identifier": "", + "macOS": { + "minimumSystemVersion": "10.13" + }, + "targets": "all", + "windows": { + "allowDowngrades": true, + "certificateThumbprint": null, + "digestAlgorithm": null, + "timestampUrl": null, + "tsp": false, + "webviewFixedRuntimePath": null, + "webviewInstallMode": { + "silent": true, + "type": "downloadBootstrapper" + }, + "wix": null + } + }, + "allOf": [ + { + "$ref": "#/definitions/BundleConfig" + } + ] + }, + "allowlist": { + "description": "The allowlist configuration.", + "default": { + "all": false, + "app": { + "all": false, + "hide": false, + "show": false + }, + "clipboard": { + "all": false, + "readText": false, + "writeText": false + }, + "dialog": { + "all": false, + "ask": false, + "confirm": false, + "message": false, + "open": false, + "save": false + }, + "fs": { + "all": false, + "copyFile": false, + "createDir": false, + "exists": false, + "readDir": false, + "readFile": false, + "removeDir": false, + "removeFile": false, + "renameFile": false, + "scope": [], + "writeFile": false + }, + "globalShortcut": { + "all": false + }, + "http": { + "all": false, + "request": false, + "scope": [] + }, + "notification": { + "all": false + }, + "os": { + "all": false + }, + "path": { + "all": false + }, + "process": { + "all": false, + "exit": false, + "relaunch": false, + "relaunchDangerousAllowSymlinkMacos": false + }, + "protocol": { + "all": false, + "asset": false, + "assetScope": [] + }, + "shell": { + "all": false, + "execute": false, + "open": false, + "scope": [], + "sidecar": false + }, + "window": { + "all": false, + "center": false, + "close": false, + "create": false, + "hide": false, + "maximize": false, + "minimize": false, + "print": false, + "requestUserAttention": false, + "setAlwaysOnTop": false, + "setCursorGrab": false, + "setCursorIcon": false, + "setCursorPosition": false, + "setCursorVisible": false, + "setDecorations": false, + "setFocus": false, + "setFullscreen": false, + "setIcon": false, + "setIgnoreCursorEvents": false, + "setMaxSize": false, + "setMinSize": false, + "setPosition": false, + "setResizable": false, + "setSize": false, + "setSkipTaskbar": false, + "setTitle": false, + "show": false, + "startDragging": false, + "unmaximize": false, + "unminimize": false + } + }, + "allOf": [ + { + "$ref": "#/definitions/AllowlistConfig" + } + ] + }, + "security": { + "description": "Security configuration.", + "default": { + "dangerousDisableAssetCspModification": false, + "freezePrototype": false + }, + "allOf": [ + { + "$ref": "#/definitions/SecurityConfig" + } + ] + }, + "updater": { + "description": "The updater configuration.", + "default": { + "active": false, + "dialog": true, + "pubkey": "", + "windows": { + "installMode": "passive" + } + }, + "allOf": [ + { + "$ref": "#/definitions/UpdaterConfig" + } + ] + }, + "systemTray": { + "description": "Configuration for app system tray.", + "anyOf": [ + { + "$ref": "#/definitions/SystemTrayConfig" + }, + { + "type": "null" + } + ] + }, + "macOSPrivateApi": { + "description": "MacOS private API configuration. Enables the transparent background API and sets the `fullScreenEnabled` preference to `true`.", + "default": false, + "type": "boolean" + } + }, + "additionalProperties": false + }, + "PatternKind": { + "description": "The application pattern.", + "oneOf": [ + { + "description": "Brownfield pattern.", + "type": "object", + "required": [ + "use" + ], + "properties": { + "use": { + "type": "string", + "enum": [ + "brownfield" + ] + } + } + }, + { + "description": "Isolation pattern. Recommended for security purposes.", + "type": "object", + "required": [ + "options", + "use" + ], + "properties": { + "use": { + "type": "string", + "enum": [ + "isolation" + ] + }, + "options": { + "type": "object", + "required": [ + "dir" + ], + "properties": { + "dir": { + "description": "The dir containing the index.html file that contains the secure isolation application.", + "type": "string" + } + } + } + } + } + ] + }, + "WindowConfig": { + "description": "The window configuration object.", + "type": "object", + "properties": { + "label": { + "description": "The window identifier. It must be alphanumeric.", + "default": "main", + "type": "string" + }, + "url": { + "description": "The window webview URL.", + "default": "index.html", + "allOf": [ + { + "$ref": "#/definitions/WindowUrl" + } + ] + }, + "userAgent": { + "description": "The user agent for the webview", + "type": [ + "string", + "null" + ] + }, + "fileDropEnabled": { + "description": "Whether the file drop is enabled or not on the webview. By default it is enabled.\n\nDisabling it is required to use drag and drop on the frontend on Windows.", + "default": true, + "type": "boolean" + }, + "center": { + "description": "Whether or not the window starts centered or not.", + "default": false, + "type": "boolean" + }, + "x": { + "description": "The horizontal position of the window's top left corner", + "type": [ + "number", + "null" + ], + "format": "double" + }, + "y": { + "description": "The vertical position of the window's top left corner", + "type": [ + "number", + "null" + ], + "format": "double" + }, + "width": { + "description": "The window width.", + "default": 800.0, + "type": "number", + "format": "double" + }, + "height": { + "description": "The window height.", + "default": 600.0, + "type": "number", + "format": "double" + }, + "minWidth": { + "description": "The min window width.", + "type": [ + "number", + "null" + ], + "format": "double" + }, + "minHeight": { + "description": "The min window height.", + "type": [ + "number", + "null" + ], + "format": "double" + }, + "maxWidth": { + "description": "The max window width.", + "type": [ + "number", + "null" + ], + "format": "double" + }, + "maxHeight": { + "description": "The max window height.", + "type": [ + "number", + "null" + ], + "format": "double" + }, + "resizable": { + "description": "Whether the window is resizable or not.", + "default": true, + "type": "boolean" + }, + "title": { + "description": "The window title.", + "default": "Tauri App", + "type": "string" + }, + "fullscreen": { + "description": "Whether the window starts as fullscreen or not.", + "default": false, + "type": "boolean" + }, + "focus": { + "description": "Whether the window will be initially focused or not.", + "default": true, + "type": "boolean" + }, + "transparent": { + "description": "Whether the window is transparent or not.\n\nNote that on `macOS` this requires the `macos-private-api` feature flag, enabled under `tauri > macOSPrivateApi`. WARNING: Using private APIs on `macOS` prevents your application from being accepted to the `App Store`.", + "default": false, + "type": "boolean" + }, + "maximized": { + "description": "Whether the window is maximized or not.", + "default": false, + "type": "boolean" + }, + "visible": { + "description": "Whether the window is visible or not.", + "default": true, + "type": "boolean" + }, + "decorations": { + "description": "Whether the window should have borders and bars.", + "default": true, + "type": "boolean" + }, + "alwaysOnTop": { + "description": "Whether the window should always be on top of other windows.", + "default": false, + "type": "boolean" + }, + "skipTaskbar": { + "description": "Whether or not the window icon should be added to the taskbar.", + "default": false, + "type": "boolean" + }, + "theme": { + "description": "The initial window theme. Defaults to the system theme. Only implemented on Windows and macOS 10.14+.", + "anyOf": [ + { + "$ref": "#/definitions/Theme" + }, + { + "type": "null" + } + ] + }, + "titleBarStyle": { + "description": "The style of the macOS title bar.", + "default": "Visible", + "allOf": [ + { + "$ref": "#/definitions/TitleBarStyle" + } + ] + }, + "hiddenTitle": { + "description": "If `true`, sets the window title to be hidden on macOS.", + "default": false, + "type": "boolean" + }, + "acceptFirstMouse": { + "description": "Whether clicking an inactive window also clicks through to the webview.", + "default": false, + "type": "boolean" + }, + "tabbingIdentifier": { + "description": "Defines the window [tabbing identifier] for macOS.\n\nWindows with matching tabbing identifiers will be grouped together. If the tabbing identifier is not set, automatic tabbing will be disabled.\n\n[tabbing identifier]: ", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + "WindowUrl": { + "description": "An URL to open on a Tauri webview window.", + "anyOf": [ + { + "description": "An external URL.", + "type": "string", + "format": "uri" + }, + { + "description": "The path portion of an app URL. For instance, to load `tauri://localhost/users/john`, you can simply provide `users/john` in this configuration.", + "type": "string" + } + ] + }, + "Theme": { + "description": "System theme.", + "oneOf": [ + { + "description": "Light theme.", + "type": "string", + "enum": [ + "Light" + ] + }, + { + "description": "Dark theme.", + "type": "string", + "enum": [ + "Dark" + ] + } + ] + }, + "TitleBarStyle": { + "description": "How the window title bar should be displayed.", + "oneOf": [ + { + "description": "A normal title bar.", + "type": "string", + "enum": [ + "Visible" + ] + }, + { + "description": "Makes the title bar transparent, so the window background color is shown instead.\n\nUseful if you don't need to have actual HTML under the title bar. This lets you avoid the caveats of using `TitleBarStyle::Overlay`. Will be more useful when Tauri lets you set a custom window background color.", + "type": "string", + "enum": [ + "Transparent" + ] + }, + { + "description": "Shows the title bar as a transparent overlay over the window's content.\n\nKeep in mind: - The height of the title bar is different on different OS versions, which can lead to window the controls and title not being where you don't expect. - You need to define a custom drag region to make your window draggable, however due to a limitation you can't drag the window when it's not in focus (https://github.com/tauri-apps/tauri/issues/4316). - The color of the window title depends on the system theme.", + "type": "string", + "enum": [ + "Overlay" + ] + } + ] + }, + "CliConfig": { + "description": "describes a CLI configuration", + "type": "object", + "properties": { + "description": { + "description": "Command description which will be shown on the help information.", + "type": [ + "string", + "null" + ] + }, + "longDescription": { + "description": "Command long description which will be shown on the help information.", + "type": [ + "string", + "null" + ] + }, + "beforeHelp": { + "description": "Adds additional help information to be displayed in addition to auto-generated help. This information is displayed before the auto-generated help information. This is often used for header information.", + "type": [ + "string", + "null" + ] + }, + "afterHelp": { + "description": "Adds additional help information to be displayed in addition to auto-generated help. This information is displayed after the auto-generated help information. This is often used to describe how to use the arguments, or caveats to be noted.", + "type": [ + "string", + "null" + ] + }, + "args": { + "description": "List of arguments for the command", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/CliArg" + } + }, + "subcommands": { + "description": "List of subcommands of this command", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "$ref": "#/definitions/CliConfig" + } + } + }, + "additionalProperties": false + }, + "CliArg": { + "description": "A CLI argument definition.", + "type": "object", + "required": [ + "name" + ], + "properties": { + "short": { + "description": "The short version of the argument, without the preceding -.\n\nNOTE: Any leading `-` characters will be stripped, and only the first non-character will be used as the short version.", + "type": [ + "string", + "null" + ], + "maxLength": 1, + "minLength": 1 + }, + "name": { + "description": "The unique argument name", + "type": "string" + }, + "description": { + "description": "The argument description which will be shown on the help information. Typically, this is a short (one line) description of the arg.", + "type": [ + "string", + "null" + ] + }, + "longDescription": { + "description": "The argument long description which will be shown on the help information. Typically this a more detailed (multi-line) message that describes the argument.", + "type": [ + "string", + "null" + ] + }, + "takesValue": { + "description": "Specifies that the argument takes a value at run time.\n\nNOTE: values for arguments may be specified in any of the following methods - Using a space such as -o value or --option value - Using an equals and no space such as -o=value or --option=value - Use a short and no space such as -ovalue", + "default": false, + "type": "boolean" + }, + "multiple": { + "description": "Specifies that the argument may have an unknown number of multiple values. Without any other settings, this argument may appear only once.\n\nFor example, --opt val1 val2 is allowed, but --opt val1 val2 --opt val3 is not.\n\nNOTE: Setting this requires `takes_value` to be set to true.", + "default": false, + "type": "boolean" + }, + "multipleOccurrences": { + "description": "Specifies that the argument may appear more than once. For flags, this results in the number of occurrences of the flag being recorded. For example -ddd or -d -d -d would count as three occurrences. For options or arguments that take a value, this does not affect how many values they can accept. (i.e. only one at a time is allowed)\n\nFor example, --opt val1 --opt val2 is allowed, but --opt val1 val2 is not.", + "default": false, + "type": "boolean" + }, + "numberOfValues": { + "description": "Specifies how many values are required to satisfy this argument. For example, if you had a `-f ` argument where you wanted exactly 3 'files' you would set `number_of_values = 3`, and this argument wouldn't be satisfied unless the user provided 3 and only 3 values.\n\n**NOTE:** Does *not* require `multiple_occurrences = true` to be set. Setting `multiple_occurrences = true` would allow `-f -f ` where as *not* setting it would only allow one occurrence of this argument.\n\n**NOTE:** implicitly sets `takes_value = true` and `multiple_values = true`.", + "type": [ + "integer", + "null" + ], + "format": "uint", + "minimum": 0.0 + }, + "possibleValues": { + "description": "Specifies a list of possible values for this argument. At runtime, the CLI verifies that only one of the specified values was used, or fails with an error message.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "minValues": { + "description": "Specifies the minimum number of values for this argument. For example, if you had a -f `` argument where you wanted at least 2 'files', you would set `minValues: 2`, and this argument would be satisfied if the user provided, 2 or more values.", + "type": [ + "integer", + "null" + ], + "format": "uint", + "minimum": 0.0 + }, + "maxValues": { + "description": "Specifies the maximum number of values are for this argument. For example, if you had a -f `` argument where you wanted up to 3 'files', you would set .max_values(3), and this argument would be satisfied if the user provided, 1, 2, or 3 values.", + "type": [ + "integer", + "null" + ], + "format": "uint", + "minimum": 0.0 + }, + "required": { + "description": "Sets whether or not the argument is required by default.\n\n- Required by default means it is required, when no other conflicting rules have been evaluated - Conflicting rules take precedence over being required.", + "default": false, + "type": "boolean" + }, + "requiredUnlessPresent": { + "description": "Sets an arg that override this arg's required setting i.e. this arg will be required unless this other argument is present.", + "type": [ + "string", + "null" + ] + }, + "requiredUnlessPresentAll": { + "description": "Sets args that override this arg's required setting i.e. this arg will be required unless all these other arguments are present.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "requiredUnlessPresentAny": { + "description": "Sets args that override this arg's required setting i.e. this arg will be required unless at least one of these other arguments are present.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "conflictsWith": { + "description": "Sets a conflicting argument by name i.e. when using this argument, the following argument can't be present and vice versa.", + "type": [ + "string", + "null" + ] + }, + "conflictsWithAll": { + "description": "The same as conflictsWith but allows specifying multiple two-way conflicts per argument.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "requires": { + "description": "Tets an argument by name that is required when this one is present i.e. when using this argument, the following argument must be present.", + "type": [ + "string", + "null" + ] + }, + "requiresAll": { + "description": "Sts multiple arguments by names that are required when this one is present i.e. when using this argument, the following arguments must be present.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "requiresIf": { + "description": "Allows a conditional requirement with the signature [arg, value] the requirement will only become valid if `arg`'s value equals `${value}`.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "requiredIfEq": { + "description": "Allows specifying that an argument is required conditionally with the signature [arg, value] the requirement will only become valid if the `arg`'s value equals `${value}`.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "requireEquals": { + "description": "Requires that options use the --option=val syntax i.e. an equals between the option and associated value.", + "type": [ + "boolean", + "null" + ] + }, + "index": { + "description": "The positional argument index, starting at 1.\n\nThe index refers to position according to other positional argument. It does not define position in the argument list as a whole. When utilized with multiple=true, only the last positional argument may be defined as multiple (i.e. the one with the highest index).", + "type": [ + "integer", + "null" + ], + "format": "uint", + "minimum": 1.0 + } + }, + "additionalProperties": false + }, + "BundleConfig": { + "description": "Configuration for tauri-bundler.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "active": { + "description": "Whether Tauri should bundle your application or just output the executable.", + "default": false, + "type": "boolean" + }, + "targets": { + "description": "The bundle targets, currently supports [\"deb\", \"appimage\", \"msi\", \"app\", \"dmg\", \"updater\"] or \"all\".", + "default": "all", + "allOf": [ + { + "$ref": "#/definitions/BundleTarget" + } + ] + }, + "identifier": { + "description": "The application identifier in reverse domain name notation (e.g. `com.tauri.example`). This string must be unique across applications since it is used in system configurations like the bundle ID and path to the webview data directory. This string must contain only alphanumeric characters (A–Z, a–z, and 0–9), hyphens (-), and periods (.).", + "type": "string" + }, + "publisher": { + "description": "The application's publisher. Defaults to the second element in the identifier string. Currently maps to the Manufacturer property of the Windows Installer.", + "type": [ + "string", + "null" + ] + }, + "icon": { + "description": "The app's icons", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "resources": { + "description": "App resources to bundle. Each resource is a path to a file or directory. Glob patterns are supported.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "copyright": { + "description": "A copyright string associated with your application.", + "type": [ + "string", + "null" + ] + }, + "category": { + "description": "The application kind.\n\nShould be one of the following: Business, DeveloperTool, Education, Entertainment, Finance, Game, ActionGame, AdventureGame, ArcadeGame, BoardGame, CardGame, CasinoGame, DiceGame, EducationalGame, FamilyGame, KidsGame, MusicGame, PuzzleGame, RacingGame, RolePlayingGame, SimulationGame, SportsGame, StrategyGame, TriviaGame, WordGame, GraphicsAndDesign, HealthcareAndFitness, Lifestyle, Medical, Music, News, Photography, Productivity, Reference, SocialNetworking, Sports, Travel, Utility, Video, Weather.", + "type": [ + "string", + "null" + ] + }, + "shortDescription": { + "description": "A short description of your application.", + "type": [ + "string", + "null" + ] + }, + "longDescription": { + "description": "A longer, multi-line description of the application.", + "type": [ + "string", + "null" + ] + }, + "appimage": { + "description": "Configuration for the AppImage bundle.", + "default": { + "bundleMediaFramework": false + }, + "allOf": [ + { + "$ref": "#/definitions/AppImageConfig" + } + ] + }, + "deb": { + "description": "Configuration for the Debian bundle.", + "default": { + "files": {} + }, + "allOf": [ + { + "$ref": "#/definitions/DebConfig" + } + ] + }, + "macOS": { + "description": "Configuration for the macOS bundles.", + "default": { + "minimumSystemVersion": "10.13" + }, + "allOf": [ + { + "$ref": "#/definitions/MacConfig" + } + ] + }, + "externalBin": { + "description": "A list of—either absolute or relative—paths to binaries to embed with your application.\n\nNote that Tauri will look for system-specific binaries following the pattern \"binary-name{-target-triple}{.system-extension}\".\n\nE.g. for the external binary \"my-binary\", Tauri looks for:\n\n- \"my-binary-x86_64-pc-windows-msvc.exe\" for Windows - \"my-binary-x86_64-apple-darwin\" for macOS - \"my-binary-x86_64-unknown-linux-gnu\" for Linux\n\nso don't forget to provide binaries for all targeted platforms.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "windows": { + "description": "Configuration for the Windows bundle.", + "default": { + "allowDowngrades": true, + "certificateThumbprint": null, + "digestAlgorithm": null, + "timestampUrl": null, + "tsp": false, + "webviewFixedRuntimePath": null, + "webviewInstallMode": { + "silent": true, + "type": "downloadBootstrapper" + }, + "wix": null + }, + "allOf": [ + { + "$ref": "#/definitions/WindowsConfig" + } + ] + }, + "iOS": { + "description": "iOS configuration.", + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/IosConfig" + } + ] + } + }, + "additionalProperties": false + }, + "BundleTarget": { + "description": "Targets to bundle. Each value is case insensitive.", + "anyOf": [ + { + "description": "Bundle all targets.", + "enum": [ + "all" + ] + }, + { + "description": "A list of bundle targets.", + "type": "array", + "items": { + "$ref": "#/definitions/BundleType" + } + }, + { + "description": "A single bundle target.", + "allOf": [ + { + "$ref": "#/definitions/BundleType" + } + ] + } + ] + }, + "BundleType": { + "description": "A bundle referenced by tauri-bundler.", + "oneOf": [ + { + "description": "The debian bundle (.deb).", + "type": "string", + "enum": [ + "deb" + ] + }, + { + "description": "The AppImage bundle (.appimage).", + "type": "string", + "enum": [ + "appimage" + ] + }, + { + "description": "The Microsoft Installer bundle (.msi).", + "type": "string", + "enum": [ + "msi" + ] + }, + { + "description": "The macOS application bundle (.app).", + "type": "string", + "enum": [ + "app" + ] + }, + { + "description": "The Apple Disk Image bundle (.dmg).", + "type": "string", + "enum": [ + "dmg" + ] + }, + { + "description": "The Tauri updater bundle.", + "type": "string", + "enum": [ + "updater" + ] + } + ] + }, + "AppImageConfig": { + "description": "Configuration for AppImage bundles.", + "type": "object", + "properties": { + "bundleMediaFramework": { + "description": "Include additional gstreamer dependencies needed for audio and video playback. This increases the bundle size by ~15-35MB depending on your build system.", + "default": false, + "type": "boolean" + } + }, + "additionalProperties": false + }, + "DebConfig": { + "description": "Configuration for Debian (.deb) bundles.", + "type": "object", + "properties": { + "depends": { + "description": "The list of deb dependencies your application relies on.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "files": { + "description": "The files to include on the package.", + "default": {}, + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "MacConfig": { + "description": "Configuration for the macOS bundles.", + "type": "object", + "properties": { + "frameworks": { + "description": "A list of strings indicating any macOS X frameworks that need to be bundled with the application.\n\nIf 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.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "minimumSystemVersion": { + "description": "A version string indicating the minimum macOS X version that the bundled application supports. Defaults to `10.13`.\n\nSetting it to `null` completely removes the `LSMinimumSystemVersion` field on the bundle's `Info.plist` and the `MACOSX_DEPLOYMENT_TARGET` environment variable.\n\nAn empty string is considered an invalid value so the default value is used.", + "default": "10.13", + "type": [ + "string", + "null" + ] + }, + "exceptionDomain": { + "description": "Allows your application to communicate with the outside world. It should be a lowercase, without port and protocol domain name.", + "type": [ + "string", + "null" + ] + }, + "license": { + "description": "The path to the license file to add to the DMG bundle.", + "type": [ + "string", + "null" + ] + }, + "signingIdentity": { + "description": "Identity to use for code signing.", + "type": [ + "string", + "null" + ] + }, + "providerShortName": { + "description": "Provider short name for notarization.", + "type": [ + "string", + "null" + ] + }, + "entitlements": { + "description": "Path to the entitlements file.", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + "WindowsConfig": { + "description": "Windows bundler configuration.", + "type": "object", + "properties": { + "digestAlgorithm": { + "description": "Specifies the file digest algorithm to use for creating file signatures. Required for code signing. SHA-256 is recommended.", + "type": [ + "string", + "null" + ] + }, + "certificateThumbprint": { + "description": "Specifies the SHA1 hash of the signing certificate.", + "type": [ + "string", + "null" + ] + }, + "timestampUrl": { + "description": "Server to use during timestamping.", + "type": [ + "string", + "null" + ] + }, + "tsp": { + "description": "Whether to use Time-Stamp Protocol (TSP, a.k.a. RFC 3161) for the timestamp server. Your code signing provider may use a TSP timestamp server, like e.g. SSL.com does. If so, enable TSP by setting to true.", + "default": false, + "type": "boolean" + }, + "webviewInstallMode": { + "description": "The installation mode for the Webview2 runtime.", + "default": { + "silent": true, + "type": "downloadBootstrapper" + }, + "allOf": [ + { + "$ref": "#/definitions/WebviewInstallMode" + } + ] + }, + "webviewFixedRuntimePath": { + "description": "Path to the webview fixed runtime to use. Overwrites [`Self::webview_install_mode`] if set.\n\nWill be removed in v2, prefer the [`Self::webview_install_mode`] option.\n\nThe fixed version can be downloaded [on the official website](https://developer.microsoft.com/en-us/microsoft-edge/webview2/#download-section). The `.cab` file must be extracted to a folder and this folder path must be defined on this field.", + "type": [ + "string", + "null" + ] + }, + "allowDowngrades": { + "description": "Validates a second app installation, blocking the user from installing an older version if set to `false`.\n\nFor instance, if `1.2.1` is installed, the user won't be able to install app version `1.2.0` or `1.1.5`.\n\nThe default value of this flag is `true`.", + "default": true, + "type": "boolean" + }, + "wix": { + "description": "Configuration for the MSI generated with WiX.", + "anyOf": [ + { + "$ref": "#/definitions/WixConfig" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "WebviewInstallMode": { + "description": "Install modes for the Webview2 runtime. Note that for the updater bundle [`Self::DownloadBootstrapper`] is used.\n\nFor more information see .", + "oneOf": [ + { + "description": "Do not install the Webview2 as part of the Windows Installer.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "skip" + ] + } + }, + "additionalProperties": false + }, + { + "description": "Download the bootstrapper and run it. Requires internet connection. Results in a smaller installer size, but is not recommended on Windows 7.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "downloadBootstrapper" + ] + }, + "silent": { + "description": "Instructs the installer to run the bootstrapper in silent mode. Defaults to `true`.", + "default": true, + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "Embed the bootstrapper and run it. Requires internet connection. Increases the installer size by around 1.8MB, but offers better support on Windows 7.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "embedBootstrapper" + ] + }, + "silent": { + "description": "Instructs the installer to run the bootstrapper in silent mode. Defaults to `true`.", + "default": true, + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "Embed the offline installer and run it. Does not require internet connection. Increases the installer size by around 127MB.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "offlineInstaller" + ] + }, + "silent": { + "description": "Instructs the installer to run the installer in silent mode. Defaults to `true`.", + "default": true, + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "Embed a fixed webview2 version and use it at runtime. Increases the installer size by around 180MB.", + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "fixedRuntime" + ] + }, + "path": { + "description": "The path to the fixed runtime to use.\n\nThe fixed version can be downloaded [on the official website](https://developer.microsoft.com/en-us/microsoft-edge/webview2/#download-section). The `.cab` file must be extracted to a folder and this folder path must be defined on this field.", + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "WixConfig": { + "description": "Configuration for the MSI bundle using WiX.", + "type": "object", + "properties": { + "language": { + "description": "The installer languages to build. See .", + "default": "en-US", + "allOf": [ + { + "$ref": "#/definitions/WixLanguage" + } + ] + }, + "template": { + "description": "A custom .wxs template to use.", + "type": [ + "string", + "null" + ] + }, + "fragmentPaths": { + "description": "A list of paths to .wxs files with WiX fragments to use.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "componentGroupRefs": { + "description": "The ComponentGroup element ids you want to reference from the fragments.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "componentRefs": { + "description": "The Component element ids you want to reference from the fragments.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "featureGroupRefs": { + "description": "The FeatureGroup element ids you want to reference from the fragments.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "featureRefs": { + "description": "The Feature element ids you want to reference from the fragments.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "mergeRefs": { + "description": "The Merge element ids you want to reference from the fragments.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "skipWebviewInstall": { + "description": "Disables the Webview2 runtime installation after app install.\n\nWill be removed in v2, prefer the [`WindowsConfig::webview_install_mode`] option.", + "default": false, + "type": "boolean" + }, + "license": { + "description": "The path to the license file to render on the installer.\n\nMust be an RTF file, so if a different extension is provided, we convert it to the RTF format.", + "type": [ + "string", + "null" + ] + }, + "enableElevatedUpdateTask": { + "description": "Create an elevated update task within Windows Task Scheduler.", + "default": false, + "type": "boolean" + }, + "bannerPath": { + "description": "Path to a bitmap file to use as the installation user interface banner. This bitmap will appear at the top of all but the first page of the installer.\n\nThe required dimensions are 493px × 58px.", + "type": [ + "string", + "null" + ] + }, + "dialogImagePath": { + "description": "Path to a bitmap file to use on the installation user interface dialogs. It is used on the welcome and completion dialogs. The required dimensions are 493px × 312px.", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + "WixLanguage": { + "description": "The languages to build using WiX.", + "anyOf": [ + { + "description": "A single language to build, without configuration.", + "type": "string" + }, + { + "description": "A list of languages to build, without configuration.", + "type": "array", + "items": { + "type": "string" + } + }, + { + "description": "A map of languages and its configuration.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/WixLanguageConfig" + } + } + ] + }, + "WixLanguageConfig": { + "description": "Configuration for a target language for the WiX build.", + "type": "object", + "properties": { + "localePath": { + "description": "The path to a locale (`.wxl`) file. See .", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + "IosConfig": { + "description": "General configuration for the iOS target.", + "type": "object", + "properties": { + "developmentTeam": { + "description": "The development team. This value is required for iOS development because code signing is enforced. The `TAURI_APPLE_DEVELOPMENT_TEAM` environment variable can be set to overwrite it.", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + "AllowlistConfig": { + "description": "Allowlist configuration.", + "type": "object", + "properties": { + "all": { + "description": "Use this flag to enable all API features.", + "default": false, + "type": "boolean" + }, + "fs": { + "description": "File system API allowlist.", + "default": { + "all": false, + "copyFile": false, + "createDir": false, + "exists": false, + "readDir": false, + "readFile": false, + "removeDir": false, + "removeFile": false, + "renameFile": false, + "scope": [], + "writeFile": false + }, + "allOf": [ + { + "$ref": "#/definitions/FsAllowlistConfig" + } + ] + }, + "window": { + "description": "Window API allowlist.", + "default": { + "all": false, + "center": false, + "close": false, + "create": false, + "hide": false, + "maximize": false, + "minimize": false, + "print": false, + "requestUserAttention": false, + "setAlwaysOnTop": false, + "setCursorGrab": false, + "setCursorIcon": false, + "setCursorPosition": false, + "setCursorVisible": false, + "setDecorations": false, + "setFocus": false, + "setFullscreen": false, + "setIcon": false, + "setIgnoreCursorEvents": false, + "setMaxSize": false, + "setMinSize": false, + "setPosition": false, + "setResizable": false, + "setSize": false, + "setSkipTaskbar": false, + "setTitle": false, + "show": false, + "startDragging": false, + "unmaximize": false, + "unminimize": false + }, + "allOf": [ + { + "$ref": "#/definitions/WindowAllowlistConfig" + } + ] + }, + "shell": { + "description": "Shell API allowlist.", + "default": { + "all": false, + "execute": false, + "open": false, + "scope": [], + "sidecar": false + }, + "allOf": [ + { + "$ref": "#/definitions/ShellAllowlistConfig" + } + ] + }, + "dialog": { + "description": "Dialog API allowlist.", + "default": { + "all": false, + "ask": false, + "confirm": false, + "message": false, + "open": false, + "save": false + }, + "allOf": [ + { + "$ref": "#/definitions/DialogAllowlistConfig" + } + ] + }, + "http": { + "description": "HTTP API allowlist.", + "default": { + "all": false, + "request": false, + "scope": [] + }, + "allOf": [ + { + "$ref": "#/definitions/HttpAllowlistConfig" + } + ] + }, + "notification": { + "description": "Notification API allowlist.", + "default": { + "all": false + }, + "allOf": [ + { + "$ref": "#/definitions/NotificationAllowlistConfig" + } + ] + }, + "globalShortcut": { + "description": "Global shortcut API allowlist.", + "default": { + "all": false + }, + "allOf": [ + { + "$ref": "#/definitions/GlobalShortcutAllowlistConfig" + } + ] + }, + "os": { + "description": "OS allowlist.", + "default": { + "all": false + }, + "allOf": [ + { + "$ref": "#/definitions/OsAllowlistConfig" + } + ] + }, + "path": { + "description": "Path API allowlist.", + "default": { + "all": false + }, + "allOf": [ + { + "$ref": "#/definitions/PathAllowlistConfig" + } + ] + }, + "protocol": { + "description": "Custom protocol allowlist.", + "default": { + "all": false, + "asset": false, + "assetScope": [] + }, + "allOf": [ + { + "$ref": "#/definitions/ProtocolAllowlistConfig" + } + ] + }, + "process": { + "description": "Process API allowlist.", + "default": { + "all": false, + "exit": false, + "relaunch": false, + "relaunchDangerousAllowSymlinkMacos": false + }, + "allOf": [ + { + "$ref": "#/definitions/ProcessAllowlistConfig" + } + ] + }, + "clipboard": { + "description": "Clipboard APIs allowlist.", + "default": { + "all": false, + "readText": false, + "writeText": false + }, + "allOf": [ + { + "$ref": "#/definitions/ClipboardAllowlistConfig" + } + ] + }, + "app": { + "description": "App APIs allowlist.", + "default": { + "all": false, + "hide": false, + "show": false + }, + "allOf": [ + { + "$ref": "#/definitions/AppAllowlistConfig" + } + ] + } + }, + "additionalProperties": false + }, + "FsAllowlistConfig": { + "description": "Allowlist for the file system APIs.", + "type": "object", + "properties": { + "scope": { + "description": "The access scope for the filesystem APIs.", + "default": [], + "allOf": [ + { + "$ref": "#/definitions/FsAllowlistScope" + } + ] + }, + "all": { + "description": "Use this flag to enable all file system API features.", + "default": false, + "type": "boolean" + }, + "readFile": { + "description": "Read file from local filesystem.", + "default": false, + "type": "boolean" + }, + "writeFile": { + "description": "Write file to local filesystem.", + "default": false, + "type": "boolean" + }, + "readDir": { + "description": "Read directory from local filesystem.", + "default": false, + "type": "boolean" + }, + "copyFile": { + "description": "Copy file from local filesystem.", + "default": false, + "type": "boolean" + }, + "createDir": { + "description": "Create directory from local filesystem.", + "default": false, + "type": "boolean" + }, + "removeDir": { + "description": "Remove directory from local filesystem.", + "default": false, + "type": "boolean" + }, + "removeFile": { + "description": "Remove file from local filesystem.", + "default": false, + "type": "boolean" + }, + "renameFile": { + "description": "Rename file from local filesystem.", + "default": false, + "type": "boolean" + }, + "exists": { + "description": "Check if path exists on the local filesystem.", + "default": false, + "type": "boolean" + } + }, + "additionalProperties": false + }, + "FsAllowlistScope": { + "description": "Filesystem scope definition. It is a list of glob patterns that restrict the API access from the webview.\n\nEach pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", + "anyOf": [ + { + "description": "A list of paths that are allowed by this scope.", + "type": "array", + "items": { + "type": "string" + } + }, + { + "description": "A complete scope configuration.", + "type": "object", + "properties": { + "allow": { + "description": "A list of paths that are allowed by this scope.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "A list of paths that are not allowed by this scope. This gets precedence over the [`Self::Scope::allow`] list.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + } + ] + }, + "WindowAllowlistConfig": { + "description": "Allowlist for the window APIs.", + "type": "object", + "properties": { + "all": { + "description": "Use this flag to enable all window API features.", + "default": false, + "type": "boolean" + }, + "create": { + "description": "Allows dynamic window creation.", + "default": false, + "type": "boolean" + }, + "center": { + "description": "Allows centering the window.", + "default": false, + "type": "boolean" + }, + "requestUserAttention": { + "description": "Allows requesting user attention on the window.", + "default": false, + "type": "boolean" + }, + "setResizable": { + "description": "Allows setting the resizable flag of the window.", + "default": false, + "type": "boolean" + }, + "setTitle": { + "description": "Allows changing the window title.", + "default": false, + "type": "boolean" + }, + "maximize": { + "description": "Allows maximizing the window.", + "default": false, + "type": "boolean" + }, + "unmaximize": { + "description": "Allows unmaximizing the window.", + "default": false, + "type": "boolean" + }, + "minimize": { + "description": "Allows minimizing the window.", + "default": false, + "type": "boolean" + }, + "unminimize": { + "description": "Allows unminimizing the window.", + "default": false, + "type": "boolean" + }, + "show": { + "description": "Allows showing the window.", + "default": false, + "type": "boolean" + }, + "hide": { + "description": "Allows hiding the window.", + "default": false, + "type": "boolean" + }, + "close": { + "description": "Allows closing the window.", + "default": false, + "type": "boolean" + }, + "setDecorations": { + "description": "Allows setting the decorations flag of the window.", + "default": false, + "type": "boolean" + }, + "setAlwaysOnTop": { + "description": "Allows setting the always_on_top flag of the window.", + "default": false, + "type": "boolean" + }, + "setSize": { + "description": "Allows setting the window size.", + "default": false, + "type": "boolean" + }, + "setMinSize": { + "description": "Allows setting the window minimum size.", + "default": false, + "type": "boolean" + }, + "setMaxSize": { + "description": "Allows setting the window maximum size.", + "default": false, + "type": "boolean" + }, + "setPosition": { + "description": "Allows changing the position of the window.", + "default": false, + "type": "boolean" + }, + "setFullscreen": { + "description": "Allows setting the fullscreen flag of the window.", + "default": false, + "type": "boolean" + }, + "setFocus": { + "description": "Allows focusing the window.", + "default": false, + "type": "boolean" + }, + "setIcon": { + "description": "Allows changing the window icon.", + "default": false, + "type": "boolean" + }, + "setSkipTaskbar": { + "description": "Allows setting the skip_taskbar flag of the window.", + "default": false, + "type": "boolean" + }, + "setCursorGrab": { + "description": "Allows grabbing the cursor.", + "default": false, + "type": "boolean" + }, + "setCursorVisible": { + "description": "Allows setting the cursor visibility.", + "default": false, + "type": "boolean" + }, + "setCursorIcon": { + "description": "Allows changing the cursor icon.", + "default": false, + "type": "boolean" + }, + "setCursorPosition": { + "description": "Allows setting the cursor position.", + "default": false, + "type": "boolean" + }, + "setIgnoreCursorEvents": { + "description": "Allows ignoring cursor events.", + "default": false, + "type": "boolean" + }, + "startDragging": { + "description": "Allows start dragging on the window.", + "default": false, + "type": "boolean" + }, + "print": { + "description": "Allows opening the system dialog to print the window content.", + "default": false, + "type": "boolean" + } + }, + "additionalProperties": false + }, + "ShellAllowlistConfig": { + "description": "Allowlist for the shell APIs.", + "type": "object", + "properties": { + "scope": { + "description": "Access scope for the binary execution APIs. Sidecars are automatically enabled.", + "default": [], + "allOf": [ + { + "$ref": "#/definitions/ShellAllowlistScope" + } + ] + }, + "all": { + "description": "Use this flag to enable all shell API features.", + "default": false, + "type": "boolean" + }, + "execute": { + "description": "Enable binary execution.", + "default": false, + "type": "boolean" + }, + "sidecar": { + "description": "Enable sidecar execution, allowing the JavaScript layer to spawn a sidecar command, an executable that is shipped with the application. For more information see .", + "default": false, + "type": "boolean" + }, + "open": { + "description": "Open URL with the user's default application.", + "default": false, + "allOf": [ + { + "$ref": "#/definitions/ShellAllowlistOpen" + } + ] + } + }, + "additionalProperties": false + }, + "ShellAllowlistScope": { + "description": "Shell scope definition. It is a list of command names and associated CLI arguments that restrict the API access from the webview.", + "type": "array", + "items": { + "$ref": "#/definitions/ShellAllowedCommand" + } + }, + "ShellAllowedCommand": { + "description": "A command allowed to be executed by the webview API.", + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", + "type": "string" + }, + "cmd": { + "description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", + "default": "", + "type": "string" + }, + "args": { + "description": "The allowed arguments for the command execution.", + "default": false, + "allOf": [ + { + "$ref": "#/definitions/ShellAllowedArgs" + } + ] + }, + "sidecar": { + "description": "If this command is a sidecar command.", + "default": false, + "type": "boolean" + } + } + }, + "ShellAllowedArgs": { + "description": "A set of command arguments allowed to be executed by the webview API.\n\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration.", + "anyOf": [ + { + "description": "Use a simple boolean to allow all or disable all arguments to this command configuration.", + "type": "boolean" + }, + { + "description": "A specific set of [`ShellAllowedArg`] that are valid to call for the command configuration.", + "type": "array", + "items": { + "$ref": "#/definitions/ShellAllowedArg" + } + } + ] + }, + "ShellAllowedArg": { + "description": "A command argument allowed to be executed by the webview API.", + "anyOf": [ + { + "description": "A non-configurable argument that is passed to the command in the order it was specified.", + "type": "string" + }, + { + "description": "A variable that is set while calling the command from the webview API.", + "type": "object", + "required": [ + "validator" + ], + "properties": { + "validator": { + "description": "[regex] validator to require passed values to conform to an expected input.\n\nThis will require the argument value passed to this variable to match the `validator` regex before it will be executed.\n\n[regex]: https://docs.rs/regex/latest/regex/#syntax", + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "ShellAllowlistOpen": { + "description": "Defines the `shell > open` api scope.", + "anyOf": [ + { + "description": "If the shell open API should be enabled.\n\nIf enabled, the default validation regex (`^https?://`) is used.", + "type": "boolean" + }, + { + "description": "Enable the shell open API, with a custom regex that the opened path must match against.\n\nIf using a custom regex to support a non-http(s) schema, care should be used to prevent values that allow flag-like strings to pass validation. e.g. `--enable-debugging`, `-i`, `/R`.", + "type": "string" + } + ] + }, + "DialogAllowlistConfig": { + "description": "Allowlist for the dialog APIs.", + "type": "object", + "properties": { + "all": { + "description": "Use this flag to enable all dialog API features.", + "default": false, + "type": "boolean" + }, + "open": { + "description": "Allows the API to open a dialog window to pick files.", + "default": false, + "type": "boolean" + }, + "save": { + "description": "Allows the API to open a dialog window to pick where to save files.", + "default": false, + "type": "boolean" + }, + "message": { + "description": "Allows the API to show a message dialog window.", + "default": false, + "type": "boolean" + }, + "ask": { + "description": "Allows the API to show a dialog window with Yes/No buttons.", + "default": false, + "type": "boolean" + }, + "confirm": { + "description": "Allows the API to show a dialog window with Ok/Cancel buttons.", + "default": false, + "type": "boolean" + } + }, + "additionalProperties": false + }, + "HttpAllowlistConfig": { + "description": "Allowlist for the HTTP APIs.", + "type": "object", + "properties": { + "scope": { + "description": "The access scope for the HTTP APIs.", + "default": [], + "allOf": [ + { + "$ref": "#/definitions/HttpAllowlistScope" + } + ] + }, + "all": { + "description": "Use this flag to enable all HTTP API features.", + "default": false, + "type": "boolean" + }, + "request": { + "description": "Allows making HTTP requests.", + "default": false, + "type": "boolean" + } + }, + "additionalProperties": false + }, + "HttpAllowlistScope": { + "description": "HTTP API scope definition. It is a list of URLs that can be accessed by the webview when using the HTTP APIs. The scoped URL is matched against the request URL using a glob pattern.\n\nExamples: - \"https://**\": allows all HTTPS urls - \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path - \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"", + "type": "array", + "items": { + "type": "string", + "format": "uri" + } + }, + "NotificationAllowlistConfig": { + "description": "Allowlist for the notification APIs.", + "type": "object", + "properties": { + "all": { + "description": "Use this flag to enable all notification API features.", + "default": false, + "type": "boolean" + } + }, + "additionalProperties": false + }, + "GlobalShortcutAllowlistConfig": { + "description": "Allowlist for the global shortcut APIs.", + "type": "object", + "properties": { + "all": { + "description": "Use this flag to enable all global shortcut API features.", + "default": false, + "type": "boolean" + } + }, + "additionalProperties": false + }, + "OsAllowlistConfig": { + "description": "Allowlist for the OS APIs.", + "type": "object", + "properties": { + "all": { + "description": "Use this flag to enable all OS API features.", + "default": false, + "type": "boolean" + } + }, + "additionalProperties": false + }, + "PathAllowlistConfig": { + "description": "Allowlist for the path APIs.", + "type": "object", + "properties": { + "all": { + "description": "Use this flag to enable all path API features.", + "default": false, + "type": "boolean" + } + }, + "additionalProperties": false + }, + "ProtocolAllowlistConfig": { + "description": "Allowlist for the custom protocols.", + "type": "object", + "properties": { + "assetScope": { + "description": "The access scope for the asset protocol.", + "default": [], + "allOf": [ + { + "$ref": "#/definitions/FsAllowlistScope" + } + ] + }, + "all": { + "description": "Use this flag to enable all custom protocols.", + "default": false, + "type": "boolean" + }, + "asset": { + "description": "Enables the asset protocol.", + "default": false, + "type": "boolean" + } + }, + "additionalProperties": false + }, + "ProcessAllowlistConfig": { + "description": "Allowlist for the process APIs.", + "type": "object", + "properties": { + "all": { + "description": "Use this flag to enable all process APIs.", + "default": false, + "type": "boolean" + }, + "relaunch": { + "description": "Enables the relaunch API.", + "default": false, + "type": "boolean" + }, + "relaunchDangerousAllowSymlinkMacos": { + "description": "Dangerous option that allows macOS to relaunch even if the binary contains a symlink.\n\nThis is due to macOS having less symlink protection. Highly recommended to not set this flag unless you have a very specific reason too, and understand the implications of it.", + "default": false, + "type": "boolean" + }, + "exit": { + "description": "Enables the exit API.", + "default": false, + "type": "boolean" + } + }, + "additionalProperties": false + }, + "ClipboardAllowlistConfig": { + "description": "Allowlist for the clipboard APIs.", + "type": "object", + "properties": { + "all": { + "description": "Use this flag to enable all clipboard APIs.", + "default": false, + "type": "boolean" + }, + "writeText": { + "description": "Enables the clipboard's `writeText` API.", + "default": false, + "type": "boolean" + }, + "readText": { + "description": "Enables the clipboard's `readText` API.", + "default": false, + "type": "boolean" + } + }, + "additionalProperties": false + }, + "AppAllowlistConfig": { + "description": "Allowlist for the app APIs.", + "type": "object", + "properties": { + "all": { + "description": "Use this flag to enable all app APIs.", + "default": false, + "type": "boolean" + }, + "show": { + "description": "Enables the app's `show` API.", + "default": false, + "type": "boolean" + }, + "hide": { + "description": "Enables the app's `hide` API.", + "default": false, + "type": "boolean" + } + }, + "additionalProperties": false + }, + "SecurityConfig": { + "description": "Security configuration.", + "type": "object", + "properties": { + "csp": { + "description": "The Content Security Policy that will be injected on all HTML files on the built application. If [`dev_csp`](#SecurityConfig.devCsp) is not specified, this value is also injected on dev.\n\nThis is a really important part of the configuration since it helps you ensure your WebView is secured. See .", + "anyOf": [ + { + "$ref": "#/definitions/Csp" + }, + { + "type": "null" + } + ] + }, + "devCsp": { + "description": "The Content Security Policy that will be injected on all HTML files on development.\n\nThis is a really important part of the configuration since it helps you ensure your WebView is secured. See .", + "anyOf": [ + { + "$ref": "#/definitions/Csp" + }, + { + "type": "null" + } + ] + }, + "freezePrototype": { + "description": "Freeze the `Object.prototype` when using the custom protocol.", + "default": false, + "type": "boolean" + }, + "dangerousDisableAssetCspModification": { + "description": "Disables the Tauri-injected CSP sources.\n\nAt compile time, Tauri parses all the frontend assets and changes the Content-Security-Policy to only allow loading of your own scripts and styles by injecting nonce and hash sources. This stricts your CSP, which may introduce issues when using along with other flexing sources.\n\nThis configuration option allows both a boolean and a list of strings as value. A boolean instructs Tauri to disable the injection for all CSP injections, and a list of strings indicates the CSP directives that Tauri cannot inject.\n\n**WARNING:** Only disable this if you know what you are doing and have properly configured the CSP. Your application might be vulnerable to XSS attacks without this Tauri protection.", + "default": false, + "allOf": [ + { + "$ref": "#/definitions/DisabledCspModificationKind" + } + ] + } + }, + "additionalProperties": false + }, + "Csp": { + "description": "A Content-Security-Policy definition. See .", + "anyOf": [ + { + "description": "The entire CSP policy in a single text string.", + "type": "string" + }, + { + "description": "An object mapping a directive with its sources values as a list of strings.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CspDirectiveSources" + } + } + ] + }, + "CspDirectiveSources": { + "description": "A Content-Security-Policy directive source list. See .", + "anyOf": [ + { + "description": "An inline list of CSP sources. Same as [`Self::List`], but concatenated with a space separator.", + "type": "string" + }, + { + "description": "A list of CSP sources. The collection will be concatenated with a space separator for the CSP string.", + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "DisabledCspModificationKind": { + "description": "The possible values for the `dangerous_disable_asset_csp_modification` config option.", + "anyOf": [ + { + "description": "If `true`, disables all CSP modification. `false` is the default value and it configures Tauri to control the CSP.", + "type": "boolean" + }, + { + "description": "Disables the given list of CSP directives modifications.", + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "UpdaterConfig": { + "description": "The Updater configuration object.", + "type": "object", + "properties": { + "active": { + "description": "Whether the updater is active or not.", + "default": false, + "type": "boolean" + }, + "dialog": { + "description": "Display built-in dialog or use event system if disabled.", + "default": true, + "type": "boolean" + }, + "endpoints": { + "description": "The updater endpoints. TLS is enforced on production.\n\nThe updater URL can contain the following variables: - {{current_version}}: The version of the app that is requesting the update - {{target}}: The operating system name (one of `linux`, `windows` or `darwin`). - {{arch}}: The architecture of the machine (one of `x86_64`, `i686`, `aarch64` or `armv7`).\n\n# Examples - \"https://my.cdn.com/latest.json\": a raw JSON endpoint that returns the latest version and download links for each platform. - \"https://updates.app.dev/{{target}}?version={{current_version}}&arch={{arch}}\": a dedicated API with positional and query string arguments.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/UpdaterEndpoint" + } + }, + "pubkey": { + "description": "Signature public key.", + "default": "", + "type": "string" + }, + "windows": { + "description": "The Windows configuration for the updater.", + "default": { + "installMode": "passive" + }, + "allOf": [ + { + "$ref": "#/definitions/UpdaterWindowsConfig" + } + ] + } + }, + "additionalProperties": false + }, + "UpdaterEndpoint": { + "description": "A URL to an updater server.\n\nThe URL must use the `https` scheme on production.", + "type": "string", + "format": "uri" + }, + "UpdaterWindowsConfig": { + "description": "The updater configuration for Windows.", + "type": "object", + "properties": { + "installMode": { + "description": "The installation mode for the update on Windows. Defaults to `passive`.", + "default": "passive", + "allOf": [ + { + "$ref": "#/definitions/WindowsUpdateInstallMode" + } + ] + } + }, + "additionalProperties": false + }, + "WindowsUpdateInstallMode": { + "description": "Install modes for the Windows update.", + "oneOf": [ + { + "description": "Specifies there's a basic UI during the installation process, including a final dialog box at the end.", + "type": "string", + "enum": [ + "basicUi" + ] + }, + { + "description": "The quiet mode means there's no user interaction required. Requires admin privileges if the installer does.", + "type": "string", + "enum": [ + "quiet" + ] + }, + { + "description": "Specifies unattended mode, which means the installation only shows a progress bar.", + "type": "string", + "enum": [ + "passive" + ] + } + ] + }, + "SystemTrayConfig": { + "description": "Configuration for application system tray icon.", + "type": "object", + "required": [ + "iconPath" + ], + "properties": { + "iconPath": { + "description": "Path to the default icon to use on the system tray.", + "type": "string" + }, + "iconAsTemplate": { + "description": "A Boolean value that determines whether the image represents a [template](https://developer.apple.com/documentation/appkit/nsimage/1520017-template?language=objc) image on macOS.", + "default": false, + "type": "boolean" + }, + "menuOnLeftClick": { + "description": "A Boolean value that determines whether the menu should appear when the tray icon receives a left click on macOS.", + "default": true, + "type": "boolean" + }, + "title": { + "description": "Title for MacOS tray", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + "BuildConfig": { + "description": "The Build configuration object.", + "type": "object", + "properties": { + "runner": { + "description": "The binary used to build and run the application.", + "type": [ + "string", + "null" + ] + }, + "devPath": { + "description": "The path to the application assets or URL to load in development.\n\nThis is usually an URL to a dev server, which serves your application assets with live reloading. Most modern JavaScript bundlers provides a way to start a dev server by default.\n\nSee [vite](https://vitejs.dev/guide/), [Webpack DevServer](https://webpack.js.org/configuration/dev-server/) and [sirv](https://github.com/lukeed/sirv) for examples on how to set up a dev server.", + "default": "http://localhost:8080/", + "allOf": [ + { + "$ref": "#/definitions/AppUrl" + } + ] + }, + "distDir": { + "description": "The path to the application assets or URL to load in production.\n\nWhen a path relative to the configuration file is provided, it is read recursively and all files are embedded in the application binary. Tauri then looks for an `index.html` file unless you provide a custom window URL.\n\nYou can also provide a list of paths to be embedded, which allows granular control over what files are added to the binary. In this case, all files are added to the root and you must reference it that way in your HTML files.\n\nWhen an URL is provided, the application won't have bundled assets and the application will load that URL by default.", + "default": "../dist", + "allOf": [ + { + "$ref": "#/definitions/AppUrl" + } + ] + }, + "beforeDevCommand": { + "description": "A shell command to run before `tauri dev` kicks in.\n\nThe TAURI_PLATFORM, TAURI_ARCH, TAURI_FAMILY, TAURI_PLATFORM_VERSION, TAURI_PLATFORM_TYPE and TAURI_DEBUG environment variables are set if you perform conditional compilation.", + "anyOf": [ + { + "$ref": "#/definitions/BeforeDevCommand" + }, + { + "type": "null" + } + ] + }, + "beforeBuildCommand": { + "description": "A shell command to run before `tauri build` kicks in.\n\nThe TAURI_PLATFORM, TAURI_ARCH, TAURI_FAMILY, TAURI_PLATFORM_VERSION, TAURI_PLATFORM_TYPE and TAURI_DEBUG environment variables are set if you perform conditional compilation.", + "anyOf": [ + { + "$ref": "#/definitions/HookCommand" + }, + { + "type": "null" + } + ] + }, + "beforeBundleCommand": { + "description": "A shell command to run before the bundling phase in `tauri build` kicks in.\n\nThe TAURI_PLATFORM, TAURI_ARCH, TAURI_FAMILY, TAURI_PLATFORM_VERSION, TAURI_PLATFORM_TYPE and TAURI_DEBUG environment variables are set if you perform conditional compilation.", + "anyOf": [ + { + "$ref": "#/definitions/HookCommand" + }, + { + "type": "null" + } + ] + }, + "features": { + "description": "Features passed to `cargo` commands.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "withGlobalTauri": { + "description": "Whether we should inject the Tauri API on `window.__TAURI__` or not.", + "default": false, + "type": "boolean" + } + }, + "additionalProperties": false + }, + "AppUrl": { + "description": "Defines the URL or assets to embed in the application.", + "anyOf": [ + { + "description": "The app's external URL, or the path to the directory containing the app assets.", + "allOf": [ + { + "$ref": "#/definitions/WindowUrl" + } + ] + }, + { + "description": "An array of files to embed on the app.", + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "BeforeDevCommand": { + "description": "Describes the shell command to run before `tauri dev`.", + "anyOf": [ + { + "description": "Run the given script with the default options.", + "type": "string" + }, + { + "description": "Run the given script with custom options.", + "type": "object", + "required": [ + "script" + ], + "properties": { + "script": { + "description": "The script to execute.", + "type": "string" + }, + "cwd": { + "description": "The current working directory.", + "type": [ + "string", + "null" + ] + }, + "wait": { + "description": "Whether `tauri dev` should wait for the command to finish or not. Defaults to `false`.", + "default": false, + "type": "boolean" + } + } + } + ] + }, + "HookCommand": { + "description": "Describes a shell command to be executed when a CLI hook is triggered.", + "anyOf": [ + { + "description": "Run the given script with the default options.", + "type": "string" + }, + { + "description": "Run the given script with custom options.", + "type": "object", + "required": [ + "script" + ], + "properties": { + "script": { + "description": "The script to execute.", + "type": "string" + }, + "cwd": { + "description": "The current working directory.", + "type": [ + "string", + "null" + ] + } + } + } + ] + }, + "PluginConfig": { + "description": "The plugin configs holds a HashMap mapping a plugin name to its configuration object.", + "type": "object", + "additionalProperties": true + } + } +} \ No newline at end of file diff --git a/core/config-schema/src/main.rs b/core/config-schema/src/main.rs new file mode 100644 index 000000000..f328e4d9d --- /dev/null +++ b/core/config-schema/src/main.rs @@ -0,0 +1 @@ +fn main() {} diff --git a/core/tauri-build/CHANGELOG.md b/core/tauri-build/CHANGELOG.md index b2946d0f0..d16e64514 100644 --- a/core/tauri-build/CHANGELOG.md +++ b/core/tauri-build/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## \[1.1.1] + +- Add missing allowlist config for `set_cursor_grab`, `set_cursor_visible`, `set_cursor_icon` and `set_cursor_position` APIs. + - Bumped due to a bump in tauri-utils. + - [c764408d](https://www.github.com/tauri-apps/tauri/commit/c764408da7fae123edd41115bda42fa75a4731d2) fix: Add missing allowlist config for cursor apis, closes [#5207](https://www.github.com/tauri-apps/tauri/pull/5207) ([#5211](https://www.github.com/tauri-apps/tauri/pull/5211)) on 2022-09-16 + +## \[1.1.0] + +- Rerun codegen if assets or icons change. + - [ff8fd761](https://www.github.com/tauri-apps/tauri/commit/ff8fd7619ae894b70f149b192d8635d842827141) fix(tauri-build): rerun if assets or icons change ([#4910](https://www.github.com/tauri-apps/tauri/pull/4910)) on 2022-08-10 +- Create the `desktop` and `mobile` cfg aliases. + - [c04d0340](https://www.github.com/tauri-apps/tauri/commit/c04d0340e2f163483f3556c7aabe35322ee71e6a) feat(core): prepare build for mobile targets ([#4830](https://www.github.com/tauri-apps/tauri/pull/4830)) on 2022-08-02 +- Added support to configuration files in TOML format (Tauri.toml file). + - [ae83d008](https://www.github.com/tauri-apps/tauri/commit/ae83d008f9e1b89bfc8dddaca42aa5c1fbc36f6d) feat: add support to TOML config file `Tauri.toml`, closes [#4806](https://www.github.com/tauri-apps/tauri/pull/4806) ([#4813](https://www.github.com/tauri-apps/tauri/pull/4813)) on 2022-08-02 +- Enhance the dialog style on Windows via the manifest dependency `Microsoft.Windows.Common-Controls v6.0.0.0`. + - [5c5c42ed](https://www.github.com/tauri-apps/tauri/commit/5c5c42edb64adf4250af6891d7d226fda7d4d783) feat(build): use modern dialog styles on Windows, closes [#4709](https://www.github.com/tauri-apps/tauri/pull/4709) ([#4840](https://www.github.com/tauri-apps/tauri/pull/4840)) on 2022-08-02 +- Fix root of codegen output when using the `CodegenContext` API. + - [ed581950](https://www.github.com/tauri-apps/tauri/commit/ed581950ea6fd0afee47aa73fb63083d2483429f) fix(tauri-build): use `::tauri` as root for the CodegenContext ([#4894](https://www.github.com/tauri-apps/tauri/pull/4894)) on 2022-08-08 +- Return an error if a sidecar is configured with the same file name as the application. + - [5cc1fd0f](https://www.github.com/tauri-apps/tauri/commit/5cc1fd0f7b01b257a461d4e867ddc8cd5072ff15) feat(tauri-build): validate sidecar name, closes [#4780](https://www.github.com/tauri-apps/tauri/pull/4780) closes [#4823](https://www.github.com/tauri-apps/tauri/pull/4823) ([#4814](https://www.github.com/tauri-apps/tauri/pull/4814)) on 2022-08-02 +- Only rewrite temporary icon files when the content change, avoid needless rebuilds. + - [f957cbb5](https://www.github.com/tauri-apps/tauri/commit/f957cbb56ccbd8d1c047a978b4579946252a6fd2) fix(codegen): write output file when contents change ([#4889](https://www.github.com/tauri-apps/tauri/pull/4889)) on 2022-08-09 + ## \[1.0.4] - Reduce the amount of allocations when converting cases. diff --git a/core/tauri-build/Cargo.toml b/core/tauri-build/Cargo.toml index b08f3c123..d912d447f 100644 --- a/core/tauri-build/Cargo.toml +++ b/core/tauri-build/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-build" -version = "1.0.4" +version = "1.1.1" authors = [ "Tauri Programme within The Commons Conservancy" ] categories = [ "gui", "web-programming" ] license = "Apache-2.0 OR MIT" @@ -8,7 +8,7 @@ homepage = "https://tauri.app" repository = "https://github.com/tauri-apps/tauri/tree/dev/core/tauri-build" description = "build time code to pair with https://crates.io/crates/tauri" edition = "2021" -rust-version = "1.57" +rust-version = "1.59" exclude = [ "CHANGELOG.md", "/target" ] readme = "README.md" @@ -19,9 +19,9 @@ rustdoc-args = [ "--cfg", "doc_cfg" ] [dependencies] anyhow = "1" quote = { version = "1", optional = true } -tauri-codegen = { version = "1.0.4", path = "../tauri-codegen", optional = true } -tauri-utils = { version = "1.0.3", path = "../tauri-utils", features = [ "build", "resources" ] } -cargo_toml = "0.11" +tauri-codegen = { version = "1.1.1", path = "../tauri-codegen", optional = true } +tauri-utils = { version = "1.1.1", path = "../tauri-utils", features = [ "build", "resources" ] } +cargo_toml = "0.13" serde_json = "1" heck = "0.4" json-patch = "0.2" diff --git a/core/tauri-build/src/lib.rs b/core/tauri-build/src/lib.rs index a7b27ec9a..826eb4945 100644 --- a/core/tauri-build/src/lib.rs +++ b/core/tauri-build/src/lib.rs @@ -238,6 +238,7 @@ pub fn try_build(attributes: Attributes) -> Result<()> { let features = match tauri { Dependency::Simple(_) => Vec::new(), Dependency::Detailed(dep) => dep.features, + Dependency::Inherited(dep) => dep.features, }; let all_cli_managed_features = TauriConfig::all_features(); diff --git a/core/tauri-codegen/CHANGELOG.md b/core/tauri-codegen/CHANGELOG.md index 18848dd21..c0d38f431 100644 --- a/core/tauri-codegen/CHANGELOG.md +++ b/core/tauri-codegen/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## \[1.1.1] + +- Add missing allowlist config for `set_cursor_grab`, `set_cursor_visible`, `set_cursor_icon` and `set_cursor_position` APIs. + - Bumped due to a bump in tauri-utils. + - [c764408d](https://www.github.com/tauri-apps/tauri/commit/c764408da7fae123edd41115bda42fa75a4731d2) fix: Add missing allowlist config for cursor apis, closes [#5207](https://www.github.com/tauri-apps/tauri/pull/5207) ([#5211](https://www.github.com/tauri-apps/tauri/pull/5211)) on 2022-09-16 + +## \[1.1.0] + +- Use `TARGET` environment variable for code generation inside build scripts. + - [6ba99689](https://www.github.com/tauri-apps/tauri/commit/6ba99689aa7ed0ffa9072a1c8ab5db12c9bf95af) feat(codegen): use TARGET environment variable if set ([#4921](https://www.github.com/tauri-apps/tauri/pull/4921)) on 2022-08-12 +- Added support to configuration files in TOML format (Tauri.toml file). + - [ae83d008](https://www.github.com/tauri-apps/tauri/commit/ae83d008f9e1b89bfc8dddaca42aa5c1fbc36f6d) feat: add support to TOML config file `Tauri.toml`, closes [#4806](https://www.github.com/tauri-apps/tauri/pull/4806) ([#4813](https://www.github.com/tauri-apps/tauri/pull/4813)) on 2022-08-02 +- Improve tray icon read error message. + - [52f0c8bb](https://www.github.com/tauri-apps/tauri/commit/52f0c8bb836c6d50b7ce2393161394f4ce78f5ae) feat(core): improve tray icon read error messages ([#4850](https://www.github.com/tauri-apps/tauri/pull/4850)) on 2022-08-03 +- Fix relative paths in `version` field of `tauri.config.json` not being correctly parsed by `generate_context!()`. + - [accbc5e8](https://www.github.com/tauri-apps/tauri/commit/accbc5e8806a32efc555d019634fc2fa14d17f0a) fix(codegen): fix relative paths in `version` field of `tauri.config.json`, closes [#4723](https://www.github.com/tauri-apps/tauri/pull/4723) ([#4725](https://www.github.com/tauri-apps/tauri/pull/4725)) on 2022-07-24 +- Only rewrite temporary icon files when the content change, avoid needless rebuilds. + - [f957cbb5](https://www.github.com/tauri-apps/tauri/commit/f957cbb56ccbd8d1c047a978b4579946252a6fd2) fix(codegen): write output file when contents change ([#4889](https://www.github.com/tauri-apps/tauri/pull/4889)) on 2022-08-09 + ## \[1.0.4] - Validate `__TAURI_ISOLATION_HOOK__` being set by a file in the isolation application. diff --git a/core/tauri-codegen/Cargo.toml b/core/tauri-codegen/Cargo.toml index f8c17181d..f14a8a336 100644 --- a/core/tauri-codegen/Cargo.toml +++ b/core/tauri-codegen/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-codegen" -version = "1.0.4" +version = "1.1.1" authors = [ "Tauri Programme within The Commons Conservancy" ] categories = [ "gui", "web-programming" ] license = "Apache-2.0 OR MIT" @@ -8,7 +8,7 @@ homepage = "https://tauri.app" repository = "https://github.com/tauri-apps/tauri/tree/dev/core/tauri-codegen" description = "code generation meant to be consumed inside of `tauri` through `tauri-build` or `tauri-macros`" edition = "2021" -rust-version = "1.57" +rust-version = "1.59" exclude = [ "CHANGELOG.md", "/target" ] readme = "README.md" @@ -19,7 +19,7 @@ proc-macro2 = "1" quote = "1" serde = { version = "1", features = [ "derive" ] } serde_json = "1" -tauri-utils = { version = "1.0.3", path = "../tauri-utils", features = [ "build" ] } +tauri-utils = { version = "1.1.1", path = "../tauri-utils", features = [ "build" ] } thiserror = "1" walkdir = "2" brotli = { version = "3", optional = true, default-features = false, features = [ "std" ] } diff --git a/core/tauri-codegen/src/context.rs b/core/tauri-codegen/src/context.rs index 1ace8c10a..a2463ede7 100644 --- a/core/tauri-codegen/src/context.rs +++ b/core/tauri-codegen/src/context.rs @@ -11,7 +11,9 @@ use sha2::{Digest, Sha256}; use tauri_utils::assets::AssetKey; use tauri_utils::config::{AppUrl, Config, PatternKind, WindowUrl}; -use tauri_utils::html::{inject_nonce_token, parse as parse_html}; +use tauri_utils::html::{ + inject_nonce_token, parse as parse_html, serialize_node as serialize_html_node, +}; #[cfg(feature = "shell-scope")] use tauri_utils::config::{ShellAllowedArg, ShellAllowedArgs, ShellAllowlistScope}; @@ -37,10 +39,10 @@ fn map_core_assets( options.dangerous_disable_asset_csp_modification.clone(); move |key, path, input, csp_hashes| { if path.extension() == Some(OsStr::new("html")) { - let mut document = parse_html(String::from_utf8_lossy(input).into_owned()); - #[allow(clippy::collapsible_if)] if csp { + let mut document = parse_html(String::from_utf8_lossy(input).into_owned()); + if target == Target::Linux { ::tauri_utils::html::inject_csp_token(&mut document); } @@ -77,9 +79,9 @@ fn map_core_assets( .push(format!("'sha256-{}'", base64::encode(&hash))); } } - } - *input = document.to_string().as_bytes().to_vec(); + *input = serialize_html_node(&document); + } } Ok(()) } @@ -378,6 +380,10 @@ pub fn context_codegen(data: ContextData) -> Result quote!(#root::Pattern::Brownfield(std::marker::PhantomData)), + #[cfg(not(feature = "isolation"))] + PatternKind::Isolation { dir: _ } => { + quote!(#root::Pattern::Brownfield(std::marker::PhantomData)) + } #[cfg(feature = "isolation")] PatternKind::Isolation { dir } => { let dir = config_parent.join(dir); diff --git a/core/tauri-macros/CHANGELOG.md b/core/tauri-macros/CHANGELOG.md index 9abc8bf48..1d6157437 100644 --- a/core/tauri-macros/CHANGELOG.md +++ b/core/tauri-macros/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## \[1.1.1] + +- Add missing allowlist config for `set_cursor_grab`, `set_cursor_visible`, `set_cursor_icon` and `set_cursor_position` APIs. + - Bumped due to a bump in tauri-utils. + - [c764408d](https://www.github.com/tauri-apps/tauri/commit/c764408da7fae123edd41115bda42fa75a4731d2) fix: Add missing allowlist config for cursor apis, closes [#5207](https://www.github.com/tauri-apps/tauri/pull/5207) ([#5211](https://www.github.com/tauri-apps/tauri/pull/5211)) on 2022-09-16 + +## \[1.1.0] + +- Added support to configuration files in TOML format (Tauri.toml file). + - [ae83d008](https://www.github.com/tauri-apps/tauri/commit/ae83d008f9e1b89bfc8dddaca42aa5c1fbc36f6d) feat: add support to TOML config file `Tauri.toml`, closes [#4806](https://www.github.com/tauri-apps/tauri/pull/4806) ([#4813](https://www.github.com/tauri-apps/tauri/pull/4813)) on 2022-08-02 + ## \[1.0.4] - Adjust command imports to fix `items_after_statements` Clippy warning. diff --git a/core/tauri-macros/Cargo.toml b/core/tauri-macros/Cargo.toml index d3dfdaa70..3be3620fe 100644 --- a/core/tauri-macros/Cargo.toml +++ b/core/tauri-macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-macros" -version = "1.0.4" +version = "1.1.1" authors = [ "Tauri Programme within The Commons Conservancy" ] categories = [ "gui", "os", "filesystem", "web-programming" ] license = "Apache-2.0 OR MIT" @@ -8,7 +8,7 @@ homepage = "https://tauri.app" repository = "https://github.com/tauri-apps/tauri" description = "Macros for the tauri crate." edition = "2021" -rust-version = "1.57" +rust-version = "1.59" exclude = [ "CHANGELOG.md", "/target" ] readme = "README.md" @@ -20,8 +20,8 @@ proc-macro2 = "1" quote = "1" syn = { version = "1", features = [ "full" ] } heck = "0.4" -tauri-codegen = { version = "1.0.4", default-features = false, path = "../tauri-codegen" } -tauri-utils = { version = "1.0.3", path = "../tauri-utils" } +tauri-codegen = { version = "1.1.1", default-features = false, path = "../tauri-codegen" } +tauri-utils = { version = "1.1.1", path = "../tauri-utils" } [features] custom-protocol = [ ] diff --git a/core/tauri-macros/src/command/wrapper.rs b/core/tauri-macros/src/command/wrapper.rs index 29bf2b8a3..6dfa6db3a 100644 --- a/core/tauri-macros/src/command/wrapper.rs +++ b/core/tauri-macros/src/command/wrapper.rs @@ -2,39 +2,82 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT +use heck::{ToLowerCamelCase, ToSnakeCase}; use proc_macro::TokenStream; use proc_macro2::TokenStream as TokenStream2; use quote::{format_ident, quote}; use syn::{ ext::IdentExt, - parse::{Parse, ParseBuffer}, + parse::{Parse, ParseStream}, parse_macro_input, spanned::Spanned, - FnArg, Ident, ItemFn, Pat, Token, Visibility, + FnArg, Ident, ItemFn, Lit, Meta, Pat, Token, Visibility, }; +struct WrapperAttributes { + execution_context: ExecutionContext, + argument_case: ArgumentCase, +} + +impl Parse for WrapperAttributes { + fn parse(input: ParseStream) -> syn::Result { + let mut wrapper_attributes = WrapperAttributes { + execution_context: ExecutionContext::Blocking, + argument_case: ArgumentCase::Camel, + }; + + loop { + match input.parse::() { + Ok(Meta::List(_)) => {} + Ok(Meta::NameValue(v)) => { + if v.path.is_ident("rename_all") { + if let Lit::Str(s) = v.lit { + wrapper_attributes.argument_case = match s.value().as_str() { + "snake_case" => ArgumentCase::Snake, + "camelCase" => ArgumentCase::Camel, + _ => { + return Err(syn::Error::new( + s.span(), + "expected \"camelCase\" or \"snake_case\"", + )) + } + }; + } + } + } + Ok(Meta::Path(p)) => { + if p.is_ident("async") { + wrapper_attributes.execution_context = ExecutionContext::Async; + } else { + return Err(syn::Error::new(p.span(), "expected `async`")); + } + } + Err(_e) => { + break; + } + } + + let lookahead = input.lookahead1(); + if lookahead.peek(Token![,]) { + input.parse::()?; + } + } + + Ok(wrapper_attributes) + } +} + /// The execution context of the command. enum ExecutionContext { Async, Blocking, } -impl Parse for ExecutionContext { - fn parse(input: &ParseBuffer<'_>) -> syn::Result { - if input.is_empty() { - return Ok(Self::Blocking); - } - - input - .parse::() - .map(|_| Self::Async) - .map_err(|_| { - syn::Error::new( - input.span(), - "only a single item `async` is currently allowed", - ) - }) - } +/// The case of each argument name. +#[derive(Copy, Clone)] +enum ArgumentCase { + Snake, + Camel, } /// The bindings we attach to `tauri::Invoke`. @@ -61,14 +104,16 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream { }; // body to the command wrapper or a `compile_error!` of an error occurred while parsing it. - let body = syn::parse::(attributes) - .map(|context| match function.sig.asyncness { - Some(_) => ExecutionContext::Async, - None => context, + let body = syn::parse::(attributes) + .map(|mut attrs| { + if function.sig.asyncness.is_some() { + attrs.execution_context = ExecutionContext::Async; + } + attrs }) - .and_then(|context| match context { - ExecutionContext::Async => body_async(&function, &invoke), - ExecutionContext::Blocking => body_blocking(&function, &invoke), + .and_then(|attrs| match attrs.execution_context { + ExecutionContext::Async => body_async(&function, &invoke, attrs.argument_case), + ExecutionContext::Blocking => body_blocking(&function, &invoke, attrs.argument_case), }) .unwrap_or_else(syn::Error::into_compile_error); @@ -105,9 +150,9 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream { /// See the [`tauri::command`] module for all the items and traits that make this possible. /// /// [`tauri::command`]: https://docs.rs/tauri/*/tauri/runtime/index.html -fn body_async(function: &ItemFn, invoke: &Invoke) -> syn::Result { +fn body_async(function: &ItemFn, invoke: &Invoke, case: ArgumentCase) -> syn::Result { let Invoke { message, resolver } = invoke; - parse_args(function, message).map(|args| { + parse_args(function, message, case).map(|args| { quote! { #resolver.respond_async_serialized(async move { let result = $path(#(#args?),*); @@ -123,9 +168,13 @@ fn body_async(function: &ItemFn, invoke: &Invoke) -> syn::Result { /// See the [`tauri::command`] module for all the items and traits that make this possible. /// /// [`tauri::command`]: https://docs.rs/tauri/*/tauri/runtime/index.html -fn body_blocking(function: &ItemFn, invoke: &Invoke) -> syn::Result { +fn body_blocking( + function: &ItemFn, + invoke: &Invoke, + case: ArgumentCase, +) -> syn::Result { let Invoke { message, resolver } = invoke; - let args = parse_args(function, message)?; + let args = parse_args(function, message, case)?; // the body of a `match` to early return any argument that wasn't successful in parsing. let match_body = quote!({ @@ -141,17 +190,26 @@ fn body_blocking(function: &ItemFn, invoke: &Invoke) -> syn::Result syn::Result> { +fn parse_args( + function: &ItemFn, + message: &Ident, + case: ArgumentCase, +) -> syn::Result> { function .sig .inputs .iter() - .map(|arg| parse_arg(&function.sig.ident, arg, message)) + .map(|arg| parse_arg(&function.sig.ident, arg, message, case)) .collect() } /// Transform a [`FnArg`] into a command argument. -fn parse_arg(command: &Ident, arg: &FnArg, message: &Ident) -> syn::Result { +fn parse_arg( + command: &Ident, + arg: &FnArg, + message: &Ident, + case: ArgumentCase, +) -> syn::Result { // we have no use for self arguments let mut arg = match arg { FnArg::Typed(arg) => arg.pat.as_ref().clone(), @@ -185,9 +243,13 @@ fn parse_arg(command: &Ident, arg: &FnArg, message: &Ident) -> syn::Result camelCase - if key.as_str().contains('_') { - key = snake_case_to_camel_case(key.as_str()); + match case { + ArgumentCase::Camel => { + key = key.to_lower_camel_case(); + } + ArgumentCase::Snake => { + key = key.to_snake_case(); + } } Ok(quote!(::tauri::command::CommandArg::from_command( @@ -198,19 +260,3 @@ fn parse_arg(command: &Ident, arg: &FnArg, message: &Ident) -> syn::Result String { - let mut camel = String::with_capacity(key.len()); - let mut to_upper = false; - - for c in key.chars() { - match c { - '_' => to_upper = true, - c if std::mem::take(&mut to_upper) => camel.push(c.to_ascii_uppercase()), - c => camel.push(c), - } - } - - camel -} diff --git a/core/tauri-runtime-wry/CHANGELOG.md b/core/tauri-runtime-wry/CHANGELOG.md index e41894f5e..e30dc81c2 100644 --- a/core/tauri-runtime-wry/CHANGELOG.md +++ b/core/tauri-runtime-wry/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## \[0.11.1] + +- Add missing allowlist config for `set_cursor_grab`, `set_cursor_visible`, `set_cursor_icon` and `set_cursor_position` APIs. + - Bumped due to a bump in tauri-utils. + - [c764408d](https://www.github.com/tauri-apps/tauri/commit/c764408da7fae123edd41115bda42fa75a4731d2) fix: Add missing allowlist config for cursor apis, closes [#5207](https://www.github.com/tauri-apps/tauri/pull/5207) ([#5211](https://www.github.com/tauri-apps/tauri/pull/5211)) on 2022-09-16 + +## \[0.11.0] + +- Ignore window events with unknown IDs. + - [0668dd42](https://www.github.com/tauri-apps/tauri/commit/0668dd42204b163f11aaf31f45106c8551f15942) fix(tauri-runtime-wry): ignore events on unknown windows on 2022-08-29 +- Implement theme APIs for Linux. + - [f21cbecd](https://www.github.com/tauri-apps/tauri/commit/f21cbecdeb3571ac4ad971b9a865ff62a131a176) feat(core): implement theme APIs for Linux ([#4808](https://www.github.com/tauri-apps/tauri/pull/4808)) on 2022-08-02 +- Changed `windows` map to be stored in a `RefCell` instead of a `Mutex`. + - [64546cb9](https://www.github.com/tauri-apps/tauri/commit/64546cb9cca2fe56cf81cfc4aaf85c4e1d58877c) refactor: use RefCell instead of Mutex for windows map, closes [#4870](https://www.github.com/tauri-apps/tauri/pull/4870) ([#4909](https://www.github.com/tauri-apps/tauri/pull/4909)) on 2022-08-10 +- Added APIs to create a system tray at runtime. + - [4d063ae9](https://www.github.com/tauri-apps/tauri/commit/4d063ae9ee9538cd6fa5e01b80070c6edf8eaeb9) feat(core): create system tray at runtime, closes [#2278](https://www.github.com/tauri-apps/tauri/pull/2278) ([#4862](https://www.github.com/tauri-apps/tauri/pull/4862)) on 2022-08-09 +- Update windows to 0.39.0 and webview2-com to 0.19.1. + - [e6d9b670](https://www.github.com/tauri-apps/tauri/commit/e6d9b670b0b314ed667b0e164f2c8d27048e678f) refactor: remove unneeded focus code ([#5065](https://www.github.com/tauri-apps/tauri/pull/5065)) on 2022-09-03 + ## \[0.10.2] - Disable drag-n-drop of tao based on `fileDropEnabled` value. diff --git a/core/tauri-runtime-wry/Cargo.toml b/core/tauri-runtime-wry/Cargo.toml index 4beb2fdea..5e39e9e88 100644 --- a/core/tauri-runtime-wry/Cargo.toml +++ b/core/tauri-runtime-wry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-runtime-wry" -version = "0.10.2" +version = "0.11.1" authors = [ "Tauri Programme within The Commons Conservancy" ] categories = [ "gui", "web-programming" ] license = "Apache-2.0 OR MIT" @@ -8,14 +8,14 @@ homepage = "https://tauri.app" repository = "https://github.com/tauri-apps/tauri" description = "Wry bindings to the Tauri runtime" edition = "2021" -rust-version = "1.57" +rust-version = "1.59" exclude = [ "CHANGELOG.md", "/target" ] readme = "README.md" [dependencies] wry = { git = "https://github.com/tauri-apps/wry", branch = "dev", default-features = false, features = [ "file-drop", "protocol" ] } -tauri-runtime = { version = "0.10.2", path = "../tauri-runtime" } -tauri-utils = { version = "1.0.3", path = "../tauri-utils" } +tauri-runtime = { version = "0.11.1", path = "../tauri-runtime" } +tauri-utils = { version = "1.1.1", path = "../tauri-utils" } uuid = { version = "1", features = [ "v4" ] } rand = "0.8" raw-window-handle = "0.5" @@ -29,7 +29,7 @@ webview2-com = "0.19.1" [target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] gtk = { version = "0.15", features = [ "v3_20" ] } -webkit2gtk = { version = "0.18", features = [ "v2_22" ] } +webkit2gtk = { version = "0.18.2", features = [ "v2_36" ] } percent-encoding = "2.1" [target."cfg(any(target_os = \"ios\", target_os = \"macos\"))".dependencies] diff --git a/core/tauri-runtime-wry/src/lib.rs b/core/tauri-runtime-wry/src/lib.rs index f054e4fb7..3e5842948 100644 --- a/core/tauri-runtime-wry/src/lib.rs +++ b/core/tauri-runtime-wry/src/lib.rs @@ -6,10 +6,7 @@ use raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle, RawDisplayHandle}; use tauri_runtime::{ - http::{ - Request as HttpRequest, RequestParts as HttpRequestParts, Response as HttpResponse, - ResponseParts as HttpResponseParts, - }, + http::{header::CONTENT_TYPE, Request as HttpRequest, RequestParts, Response as HttpResponse}, menu::{AboutMetadata, CustomMenuItem, Menu, MenuEntry, MenuHash, MenuId, MenuItem, MenuUpdate}, monitor::Monitor, webview::{WebviewIpcHandler, WindowBuilder, WindowBuilderBase}, @@ -29,12 +26,16 @@ use webview2_com::FocusChangedEventHandler; #[cfg(windows)] use windows::Win32::{Foundation::HWND, System::WinRT::EventRegistrationToken}; #[cfg(target_os = "macos")] +use wry::application::platform::macos::EventLoopWindowTargetExtMacOS; +#[cfg(target_os = "macos")] use wry::application::platform::macos::WindowBuilderExtMacOS; #[cfg(target_os = "linux")] use wry::application::platform::unix::{WindowBuilderExtUnix, WindowExtUnix}; #[cfg(windows)] use wry::application::platform::windows::{WindowBuilderExtWindows, WindowExtWindows}; +#[cfg(target_os = "macos")] +use tauri_utils::TitleBarStyle; use tauri_utils::{config::WindowConfig, debug_eprintln, Theme}; use uuid::Uuid; use wry::{ @@ -59,10 +60,7 @@ use wry::{ UserAttentionType as WryUserAttentionType, }, }, - http::{ - Request as WryHttpRequest, RequestParts as WryRequestParts, Response as WryHttpResponse, - ResponseParts as WryResponseParts, - }, + http::{Request as WryRequest, Response as WryResponse}, webview::{FileDropEvent as WryFileDropEvent, WebContext, WebView, WebViewBuilder}, }; @@ -160,7 +158,10 @@ macro_rules! window_getter { }}; } -fn send_user_message(context: &Context, message: Message) -> Result<()> { +pub(crate) fn send_user_message( + context: &Context, + message: Message, +) -> Result<()> { if current_thread().id() == context.main_thread_id { handle_user_message( &context.main_thread.window_target, @@ -269,70 +270,36 @@ impl fmt::Debug for Context { } } -struct HttpRequestPartsWrapper(HttpRequestParts); - -impl From for HttpRequestParts { - fn from(parts: HttpRequestPartsWrapper) -> Self { - Self { - method: parts.0.method, - uri: parts.0.uri, - headers: parts.0.headers, - } - } -} - -impl From for HttpRequestPartsWrapper { - fn from(request: HttpRequestParts) -> Self { - Self(HttpRequestParts { - method: request.method, - uri: request.uri, - headers: request.headers, - }) - } -} - -impl From for HttpRequestPartsWrapper { - fn from(request: WryRequestParts) -> Self { - Self(HttpRequestParts { - method: request.method, - uri: request.uri, - headers: request.headers, - }) - } -} - struct HttpRequestWrapper(HttpRequest); -impl From<&WryHttpRequest> for HttpRequestWrapper { - fn from(req: &WryHttpRequest) -> Self { - Self(HttpRequest::new_internal( - HttpRequestPartsWrapper::from(req.head.clone()).0, - req.body.clone(), - )) +impl From<&WryRequest>> for HttpRequestWrapper { + fn from(req: &WryRequest>) -> Self { + let parts = RequestParts { + uri: req.uri().to_string(), + method: req.method().clone(), + headers: req.headers().clone(), + }; + Self(HttpRequest::new_internal(parts, req.body().clone())) } } // response -struct HttpResponsePartsWrapper(WryResponseParts); -impl From for HttpResponsePartsWrapper { - fn from(response: HttpResponseParts) -> Self { - Self(WryResponseParts { - mimetype: response.mimetype, - status: response.status, - version: response.version, - headers: response.headers, - }) - } -} - -struct HttpResponseWrapper(WryHttpResponse); +struct HttpResponseWrapper(WryResponse>); impl From for HttpResponseWrapper { fn from(response: HttpResponse) -> Self { let (parts, body) = response.into_parts(); - Self(WryHttpResponse { - body, - head: HttpResponsePartsWrapper::from(parts).0, - }) + let mut res_builder = WryResponse::builder() + .status(parts.status) + .version(parts.version); + if let Some(mime) = parts.mimetype { + res_builder = res_builder.header(CONTENT_TYPE, mime); + } + for (name, val) in parts.headers.iter() { + res_builder = res_builder.header(name, val); + } + + let res = res_builder.body(body).unwrap(); + Self(res) } } @@ -713,6 +680,8 @@ impl From for CursorIconWrapper { pub struct WindowBuilderWrapper { inner: WryWindowBuilder, center: bool, + #[cfg(target_os = "macos")] + tabbing_identifier: Option, menu: Option, } @@ -723,7 +692,7 @@ unsafe impl Send for WindowBuilderWrapper {} impl WindowBuilderBase for WindowBuilderWrapper {} impl WindowBuilder for WindowBuilderWrapper { fn new() -> Self { - Default::default() + Self::default().focused(true) } fn with_config(config: WindowConfig) -> Self { @@ -739,6 +708,16 @@ impl WindowBuilder for WindowBuilderWrapper { .skip_taskbar(config.skip_taskbar) .theme(config.theme); + #[cfg(target_os = "macos")] + { + window = window + .hidden_title(config.hidden_title) + .title_bar_style(config.title_bar_style); + if let Some(identifier) = &config.tabbing_identifier { + window = window.tabbing_identifier(identifier); + } + } + #[cfg(any(not(target_os = "macos"), feature = "macos-private-api"))] { window = window.transparent(config.transparent); @@ -829,9 +808,8 @@ impl WindowBuilder for WindowBuilderWrapper { self } - /// Deprecated since 0.1.4 (noop) - /// Windows is automatically focused when created. - fn focus(self) -> Self { + fn focused(mut self, focused: bool) -> Self { + self.inner = self.inner.with_focused(focused); self } @@ -879,6 +857,39 @@ impl WindowBuilder for WindowBuilderWrapper { self } + #[cfg(target_os = "macos")] + fn title_bar_style(mut self, style: TitleBarStyle) -> Self { + match style { + TitleBarStyle::Visible => { + self.inner = self.inner.with_titlebar_transparent(false); + // Fixes rendering issue when resizing window with devtools open (https://github.com/tauri-apps/tauri/issues/3914) + self.inner = self.inner.with_fullsize_content_view(true); + } + TitleBarStyle::Transparent => { + self.inner = self.inner.with_titlebar_transparent(true); + self.inner = self.inner.with_fullsize_content_view(false); + } + TitleBarStyle::Overlay => { + self.inner = self.inner.with_titlebar_transparent(true); + self.inner = self.inner.with_fullsize_content_view(true); + } + } + self + } + + #[cfg(target_os = "macos")] + fn hidden_title(mut self, hidden: bool) -> Self { + self.inner = self.inner.with_title_hidden(hidden); + self + } + + #[cfg(target_os = "macos")] + fn tabbing_identifier(mut self, identifier: &str) -> Self { + self.inner = self.inner.with_tabbing_identifier(identifier); + self.tabbing_identifier.replace(identifier.into()); + self + } + fn icon(mut self, icon: Icon) -> Result { self.inner = self .inner @@ -986,6 +997,13 @@ unsafe impl Send for GtkWindow {} pub struct RawWindowHandle(pub raw_window_handle::RawWindowHandle); unsafe impl Send for RawWindowHandle {} +#[cfg(target_os = "macos")] +#[derive(Debug, Clone)] +pub enum ApplicationMessage { + Show, + Hide, +} + pub enum WindowMessage { #[cfg(any(desktop, target_os = "android"))] WithWebview(Box), @@ -1051,6 +1069,7 @@ pub enum WindowMessage { SetCursorVisible(bool), SetCursorIcon(CursorIcon), SetCursorPosition(Position), + SetIgnoreCursorEvents(bool), DragWindow, UpdateMenuItem(u16, MenuUpdate), RequestRedraw, @@ -1078,8 +1097,10 @@ pub enum TrayMessage { UpdateIcon(Icon), #[cfg(target_os = "macos")] UpdateIconAsTemplate(bool), + #[cfg(target_os = "macos")] + UpdateTitle(String), Create(SystemTray, Sender>), - Destroy, + Destroy(Sender>), } pub type CreateWebviewClosure = Box< @@ -1088,6 +1109,8 @@ pub type CreateWebviewClosure = Box< pub enum Message { Task(Box), + #[cfg(target_os = "macos")] + Application(ApplicationMessage), Window(WebviewId, WindowMessage), Webview(WebviewId, WebviewMessage), #[cfg(all(desktop, feature = "system-tray"))] @@ -1493,6 +1516,13 @@ impl Dispatch for WryDispatcher { ) } + fn set_ignore_cursor_events(&self, ignore: bool) -> crate::Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetIgnoreCursorEvents(ignore)), + ) + } + fn start_dragging(&self) -> Result<()> { send_user_message( &self.context, @@ -1520,10 +1550,30 @@ impl Dispatch for WryDispatcher { #[derive(Clone)] enum WindowHandle { - Webview(Arc), + Webview { + inner: Arc, + context_store: WebContextStore, + // the key of the WebContext if it's not shared + context_key: Option, + }, Window(Arc), } +impl Drop for WindowHandle { + fn drop(&mut self) { + if let Self::Webview { + inner, + context_store, + context_key, + } = self + { + if Arc::get_mut(inner).is_some() { + context_store.lock().unwrap().remove(context_key); + } + } + } +} + impl fmt::Debug for WindowHandle { fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { Ok(()) @@ -1536,7 +1586,7 @@ impl Deref for WindowHandle { #[inline(always)] fn deref(&self) -> &Window { match self { - Self::Webview(w) => w.window(), + Self::Webview { inner, .. } => inner.window(), Self::Window(w) => w, } } @@ -1546,7 +1596,7 @@ impl WindowHandle { fn inner_size(&self) -> WryPhysicalSize { match self { WindowHandle::Window(w) => w.inner_size(), - WindowHandle::Webview(w) => w.inner_size(), + WindowHandle::Webview { inner, .. } => inner.inner_size(), } } } @@ -1733,6 +1783,7 @@ impl RuntimeHandle for WryHandle { )?; rx.recv().unwrap()?; Ok(SystemTrayHandle { + context: self.context.clone(), id, proxy: self.context.proxy.clone(), }) @@ -1741,6 +1792,22 @@ impl RuntimeHandle for WryHandle { fn raw_display_handle(&self) -> RawDisplayHandle { self.context.main_thread.window_target.raw_display_handle() } + + #[cfg(target_os = "macos")] + fn show(&self) -> tauri_runtime::Result<()> { + send_user_message( + &self.context, + Message::Application(ApplicationMessage::Show), + ) + } + + #[cfg(target_os = "macos")] + fn hide(&self) -> tauri_runtime::Result<()> { + send_user_message( + &self.context, + Message::Application(ApplicationMessage::Hide), + ) + } } impl Wry { @@ -1921,6 +1988,7 @@ impl Runtime for Wry { ); Ok(SystemTrayHandle { + context: self.context.clone(), id, proxy: self.event_loop.create_proxy(), }) @@ -1950,6 +2018,16 @@ impl Runtime for Wry { }); } + #[cfg(target_os = "macos")] + fn show(&self) { + self.event_loop.show_application(); + } + + #[cfg(target_os = "macos")] + fn hide(&self) { + self.event_loop.hide_application(); + } + #[cfg(desktop)] fn run_iteration) + 'static>(&mut self, mut callback: F) -> RunIteration { use wry::application::platform::run_return::EventLoopExtRunReturn; @@ -2140,6 +2218,15 @@ fn handle_user_message( } = context; match message { Message::Task(task) => task(), + #[cfg(target_os = "macos")] + Message::Application(application_message) => match application_message { + ApplicationMessage::Show => { + event_loop.show_application(); + } + ApplicationMessage::Hide => { + event_loop.hide_application(); + } + }, Message::Window(id, window_message) => { if let WindowMessage::UpdateMenuItem(item_id, update) = window_message { if let Some(menu_items) = windows.borrow_mut().get_mut(&id).map(|w| &mut w.menu_items) { @@ -2168,7 +2255,7 @@ fn handle_user_message( match window_message { #[cfg(any(target_os = "android", desktop))] WindowMessage::WithWebview(f) => { - if let WindowHandle::Webview(w) = window { + if let WindowHandle::Webview { inner: w, .. } = &window { #[cfg(any( target_os = "linux", target_os = "dragonfly", @@ -2213,19 +2300,19 @@ fn handle_user_message( #[cfg(any(debug_assertions, feature = "devtools"))] WindowMessage::OpenDevTools => { - if let WindowHandle::Webview(w) = &window { + if let WindowHandle::Webview { inner: w, .. } = &window { w.open_devtools(); } } #[cfg(any(debug_assertions, feature = "devtools"))] WindowMessage::CloseDevTools => { - if let WindowHandle::Webview(w) = &window { + if let WindowHandle::Webview { inner: w, .. } = &window { w.close_devtools(); } } #[cfg(any(debug_assertions, feature = "devtools"))] WindowMessage::IsDevToolsOpen(tx) => { - if let WindowHandle::Webview(w) = &window { + if let WindowHandle::Webview { inner: w, .. } = &window { tx.send(w.is_devtools_open()).unwrap(); } else { tx.send(false).unwrap(); @@ -2346,6 +2433,9 @@ fn handle_user_message( WindowMessage::SetCursorPosition(position) => { let _ = window.set_cursor_position(PositionWrapper::from(position).0); } + WindowMessage::SetIgnoreCursorEvents(ignore) => { + let _ = window.set_ignore_cursor_events(ignore); + } WindowMessage::DragWindow => { let _ = window.drag_window(); } @@ -2361,7 +2451,7 @@ fn handle_user_message( } Message::Webview(id, webview_message) => match webview_message { WebviewMessage::EvaluateScript(script) => { - if let Some(WindowHandle::Webview(webview)) = + if let Some(WindowHandle::Webview { inner: webview, .. }) = windows.borrow().get(&id).and_then(|w| w.inner.as_ref()) { if let Err(e) = webview.evaluate_script(&script) { @@ -2370,7 +2460,7 @@ fn handle_user_message( } } WebviewMessage::Print => { - if let Some(WindowHandle::Webview(webview)) = + if let Some(WindowHandle::Webview { inner: webview, .. }) = windows.borrow().get(&id).and_then(|w| w.inner.as_ref()) { let _ = webview.print(); @@ -2481,13 +2571,20 @@ fn handle_user_message( tray.set_icon_as_template(is_template); } } + #[cfg(target_os = "macos")] + TrayMessage::UpdateTitle(title) => { + if let Some(tray) = &mut *tray_context.tray.lock().unwrap() { + tray.set_title(&title); + } + } TrayMessage::Create(_tray, _tx) => { // already handled } - TrayMessage::Destroy => { + TrayMessage::Destroy(tx) => { *tray_context.tray.lock().unwrap() = None; tray_context.listeners.lock().unwrap().clear(); tray_context.items.lock().unwrap().clear(); + tx.send(Ok(())).unwrap(); } } } @@ -2616,14 +2713,13 @@ fn handle_event_loop( items.contains_key(&menu_id.0) }; if has_menu { - listeners.replace(tray_context.listeners.clone()); + listeners.replace(tray_context.listeners.lock().unwrap().clone()); tray_id = *id; break; } } drop(trays); if let Some(listeners) = listeners { - let listeners = listeners.lock().unwrap(); let handlers = listeners.iter(); for handler in handlers { handler(&event); @@ -2841,7 +2937,7 @@ fn to_wry_menu( fn create_webview( window_id: WebviewId, event_loop: &EventLoopWindowTarget>, - web_context: &WebContextStore, + web_context_store: &WebContextStore, context: Context, pending: PendingWindow>, ) -> Result { @@ -2863,10 +2959,6 @@ fn create_webview( let window_event_listeners = WindowEventListeners::default(); - #[cfg(target_os = "macos")] - { - window_builder.inner = window_builder.inner.with_fullsize_content_view(true); - } #[cfg(windows)] { window_builder.inner = window_builder @@ -2874,6 +2966,16 @@ fn create_webview( .with_drag_and_drop(webview_attributes.file_drop_handler_enabled); } + #[cfg(target_os = "macos")] + { + if window_builder.tabbing_identifier.is_none() + || window_builder.inner.window.transparent + || !window_builder.inner.window.decorations + { + window_builder.inner = window_builder.inner.with_automatic_window_tabbing(false); + } + } + let is_window_transparent = window_builder.inner.window.transparent; let menu_items = if let Some(menu) = window_builder.menu { let mut menu_items = HashMap::new(); @@ -2894,11 +2996,15 @@ fn create_webview( .map_err(|e| Error::CreateWebview(Box::new(e)))? .with_url(&url) .unwrap() // safe to unwrap because we validate the URL beforehand - .with_transparent(is_window_transparent); + .with_transparent(is_window_transparent) + .with_accept_first_mouse(webview_attributes.accept_first_mouse); if webview_attributes.file_drop_handler_enabled { webview_builder = webview_builder .with_file_drop_handler(create_file_drop_handler(window_event_listeners.clone())); } + if let Some(user_agent) = webview_attributes.user_agent { + webview_builder = webview_builder.with_user_agent(&user_agent); + } if let Some(handler) = ipc_handler { webview_builder = webview_builder.with_ipc_handler(create_ipc_handler( context, @@ -2920,19 +3026,18 @@ fn create_webview( webview_builder = webview_builder.with_initialization_script(&script); } - let mut web_context = web_context.lock().expect("poisoned WebContext store"); + let mut web_context = web_context_store.lock().expect("poisoned WebContext store"); let is_first_context = web_context.is_empty(); let automation_enabled = std::env::var("TAURI_AUTOMATION").as_deref() == Ok("true"); - let entry = web_context.entry( - // force a unique WebContext when automation is false; + let web_context_key = // force a unique WebContext when automation is false; // the context must be stored on the HashMap because it must outlive the WebView on macOS if automation_enabled { webview_attributes.data_directory.clone() } else { // random unique key Some(Uuid::new_v4().as_hyphenated().to_string().into()) - }, - ); + }; + let entry = web_context.entry(web_context_key.clone()); let web_context = match entry { Occupied(occupied) => occupied.into_mut(), Vacant(vacant) => { @@ -2995,7 +3100,15 @@ fn create_webview( Ok(WindowWrapper { label, - inner: Some(WindowHandle::Webview(Arc::new(webview))), + inner: Some(WindowHandle::Webview { + inner: Arc::new(webview), + context_store: web_context_store.clone(), + context_key: if automation_enabled { + None + } else { + web_context_key + }, + }), menu_items, window_event_listeners, menu_event_listeners: Default::default(), diff --git a/core/tauri-runtime-wry/src/system_tray.rs b/core/tauri-runtime-wry/src/system_tray.rs index b0d7883fd..ee6db6c9e 100644 --- a/core/tauri-runtime-wry/src/system_tray.rs +++ b/core/tauri-runtime-wry/src/system_tray.rs @@ -27,7 +27,7 @@ pub use wry::application::platform::macos::{ use wry::application::system_tray::{SystemTray as WrySystemTray, SystemTrayBuilder}; -use crate::{Error, Message, Result, TrayId, TrayMessage}; +use crate::{send_user_message, Context, Error, Message, Result, TrayId, TrayMessage}; use tauri_runtime::{menu::MenuHash, SystemTray, UserEvent}; @@ -105,7 +105,13 @@ pub fn create_tray( #[cfg(target_os = "macos")] { - builder = builder.with_icon_as_template(system_tray.icon_as_template) + builder = builder + .with_icon_as_template(system_tray.icon_as_template) + .with_menu_on_left_click(system_tray.menu_on_left_click); + + if let Some(title) = system_tray.title { + builder = builder.with_title(&title); + } } let tray = builder @@ -117,6 +123,7 @@ pub fn create_tray( #[derive(Debug, Clone)] pub struct SystemTrayHandle { + pub(crate) context: Context, pub(crate) id: TrayId, pub(crate) proxy: EventLoopProxy>, } @@ -154,12 +161,26 @@ impl TrayHandle for SystemTrayHandle { .map_err(|_| Error::FailedToSendMessage) } - fn destroy(&self) -> Result<()> { + #[cfg(target_os = "macos")] + fn set_title(&self, title: &str) -> tauri_runtime::Result<()> { self .proxy - .send_event(Message::Tray(self.id, TrayMessage::Destroy)) + .send_event(Message::Tray( + self.id, + TrayMessage::UpdateTitle(title.to_owned()), + )) .map_err(|_| Error::FailedToSendMessage) } + + fn destroy(&self) -> Result<()> { + let (tx, rx) = std::sync::mpsc::channel(); + send_user_message( + &self.context, + Message::Tray(self.id, TrayMessage::Destroy(tx)), + )?; + rx.recv().unwrap()?; + Ok(()) + } } impl From for crate::MenuItemWrapper { diff --git a/core/tauri-runtime/CHANGELOG.md b/core/tauri-runtime/CHANGELOG.md index 7e84c3d0d..bd1194e52 100644 --- a/core/tauri-runtime/CHANGELOG.md +++ b/core/tauri-runtime/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## \[0.11.1] + +- Add missing allowlist config for `set_cursor_grab`, `set_cursor_visible`, `set_cursor_icon` and `set_cursor_position` APIs. + - Bumped due to a bump in tauri-utils. + - [c764408d](https://www.github.com/tauri-apps/tauri/commit/c764408da7fae123edd41115bda42fa75a4731d2) fix: Add missing allowlist config for cursor apis, closes [#5207](https://www.github.com/tauri-apps/tauri/pull/5207) ([#5211](https://www.github.com/tauri-apps/tauri/pull/5211)) on 2022-09-16 + +## \[0.11.0] + +- Added APIs to create a system tray at runtime. + - [4d063ae9](https://www.github.com/tauri-apps/tauri/commit/4d063ae9ee9538cd6fa5e01b80070c6edf8eaeb9) feat(core): create system tray at runtime, closes [#2278](https://www.github.com/tauri-apps/tauri/pull/2278) ([#4862](https://www.github.com/tauri-apps/tauri/pull/4862)) on 2022-08-09 +- Update windows to 0.39.0 and webview2-com to 0.19.1. + - [e6d9b670](https://www.github.com/tauri-apps/tauri/commit/e6d9b670b0b314ed667b0e164f2c8d27048e678f) refactor: remove unneeded focus code ([#5065](https://www.github.com/tauri-apps/tauri/pull/5065)) on 2022-09-03 + ## \[0.10.2] - Added option to disable tray menu on left click on macOS. diff --git a/core/tauri-runtime/Cargo.toml b/core/tauri-runtime/Cargo.toml index 46c271126..2e30c7276 100644 --- a/core/tauri-runtime/Cargo.toml +++ b/core/tauri-runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-runtime" -version = "0.10.2" +version = "0.11.1" authors = [ "Tauri Programme within The Commons Conservancy" ] categories = [ "gui", "web-programming" ] license = "Apache-2.0 OR MIT" @@ -8,7 +8,7 @@ homepage = "https://tauri.app" repository = "https://github.com/tauri-apps/tauri" description = "Runtime for Tauri applications" edition = "2021" -rust-version = "1.57" +rust-version = "1.59" exclude = [ "CHANGELOG.md", "/target" ] readme = "README.md" @@ -26,11 +26,10 @@ targets = [ serde = { version = "1.0", features = [ "derive" ] } serde_json = "1.0" thiserror = "1.0" -tauri-utils = { version = "1.0.3", path = "../tauri-utils" } +tauri-utils = { version = "1.1.1", path = "../tauri-utils" } uuid = { version = "1", features = [ "v4" ] } http = "0.2.4" http-range = "0.1.4" -infer = "0.7" raw-window-handle = "0.5" rand = "0.8" diff --git a/core/tauri-runtime/src/http/mod.rs b/core/tauri-runtime/src/http/mod.rs index d20e27e40..359f8cf53 100644 --- a/core/tauri-runtime/src/http/mod.rs +++ b/core/tauri-runtime/src/http/mod.rs @@ -3,16 +3,16 @@ // SPDX-License-Identifier: MIT // custom wry types -mod mime_type; mod request; mod response; pub use self::{ - mime_type::MimeType, request::{Request, RequestParts}, response::{Builder as ResponseBuilder, Response, ResponseParts}, }; +pub use tauri_utils::mime_type::MimeType; + // re-expose default http types pub use http::{header, method, status, uri::InvalidUri, version, Uri}; diff --git a/core/tauri-runtime/src/lib.rs b/core/tauri-runtime/src/lib.rs index b8d4292c5..610b78e84 100644 --- a/core/tauri-runtime/src/lib.rs +++ b/core/tauri-runtime/src/lib.rs @@ -50,6 +50,8 @@ pub struct SystemTray { pub icon_as_template: bool, #[cfg(target_os = "macos")] pub menu_on_left_click: bool, + #[cfg(target_os = "macos")] + pub title: Option, pub on_event: Option>, } @@ -63,7 +65,8 @@ impl fmt::Debug for SystemTray { #[cfg(target_os = "macos")] { d.field("icon_as_template", &self.icon_as_template) - .field("menu_on_left_click", &self.menu_on_left_click); + .field("menu_on_left_click", &self.menu_on_left_click) + .field("title", &self.title); } d.finish() } @@ -81,6 +84,8 @@ impl Clone for SystemTray { icon_as_template: self.icon_as_template, #[cfg(target_os = "macos")] menu_on_left_click: self.menu_on_left_click, + #[cfg(target_os = "macos")] + title: self.title.clone(), } } } @@ -96,6 +101,8 @@ impl Default for SystemTray { icon_as_template: false, #[cfg(target_os = "macos")] menu_on_left_click: false, + #[cfg(target_os = "macos")] + title: None, on_event: None, } } @@ -142,6 +149,13 @@ impl SystemTray { self } + #[cfg(target_os = "macos")] + #[must_use] + pub fn with_title(mut self, title: &str) -> Self { + self.title = Some(title.to_owned()); + self + } + /// Sets the menu to show when the system tray is right clicked. #[must_use] pub fn with_menu(mut self, menu: menu::SystemTrayMenu) -> Self { @@ -338,6 +352,16 @@ pub trait RuntimeHandle: Debug + Clone + Send + Sync + Sized + 'st ) -> Result<>::TrayHandler>; fn raw_display_handle(&self) -> RawDisplayHandle; + + /// Shows the application, but does not automatically focus it. + #[cfg(target_os = "macos")] + #[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))] + fn show(&self) -> Result<()>; + + /// Hides the application. + #[cfg(target_os = "macos")] + #[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))] + fn hide(&self) -> Result<()>; } /// A global shortcut manager. @@ -427,6 +451,16 @@ pub trait Runtime: Debug + Sized + 'static { #[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))] fn set_activation_policy(&mut self, activation_policy: ActivationPolicy); + /// Shows the application, but does not automatically focus it. + #[cfg(target_os = "macos")] + #[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))] + fn show(&self); + + /// Hides the application. + #[cfg(target_os = "macos")] + #[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))] + fn hide(&self); + /// Runs the one step of the webview runtime event loop and returns control flow to the caller. #[cfg(desktop)] fn run_iteration) + 'static>(&mut self, callback: F) -> RunIteration; @@ -630,6 +664,9 @@ pub trait Dispatch: Debug + Clone + Send + Sync + Sized + 'static /// Changes the position of the cursor in window coordinates. fn set_cursor_position>(&self, position: Pos) -> Result<()>; + /// Ignores the window cursor events. + fn set_ignore_cursor_events(&self, ignore: bool) -> Result<()>; + /// Starts dragging the window. fn start_dragging(&self) -> Result<()>; diff --git a/core/tauri-runtime/src/menu.rs b/core/tauri-runtime/src/menu.rs index 5779bc570..7385541f3 100644 --- a/core/tauri-runtime/src/menu.rs +++ b/core/tauri-runtime/src/menu.rs @@ -152,6 +152,8 @@ pub trait TrayHandle: fmt::Debug + Clone + Send + Sync { fn update_item(&self, id: u16, update: MenuUpdate) -> crate::Result<()>; #[cfg(target_os = "macos")] fn set_icon_as_template(&self, is_template: bool) -> crate::Result<()>; + #[cfg(target_os = "macos")] + fn set_title(&self, title: &str) -> crate::Result<()>; fn destroy(&self) -> crate::Result<()>; } diff --git a/core/tauri-runtime/src/webview.rs b/core/tauri-runtime/src/webview.rs index cf3ce532e..8b6a0a694 100644 --- a/core/tauri-runtime/src/webview.rs +++ b/core/tauri-runtime/src/webview.rs @@ -6,6 +6,8 @@ use crate::{menu::Menu, window::DetachedWindow, Icon}; +#[cfg(target_os = "macos")] +use tauri_utils::TitleBarStyle; use tauri_utils::{ config::{WindowConfig, WindowUrl}, Theme, @@ -20,10 +22,12 @@ use std::{fmt, path::PathBuf}; #[derive(Debug, Clone)] pub struct WebviewAttributes { pub url: WindowUrl, + pub user_agent: Option, pub initialization_scripts: Vec, pub data_directory: Option, pub file_drop_handler_enabled: bool, pub clipboard: bool, + pub accept_first_mouse: bool, } impl WebviewAttributes { @@ -31,13 +35,22 @@ impl WebviewAttributes { pub fn new(url: WindowUrl) -> Self { Self { url, + user_agent: None, initialization_scripts: Vec::new(), data_directory: None, file_drop_handler_enabled: true, clipboard: false, + accept_first_mouse: false, } } + /// Sets the user agent + #[must_use] + pub fn user_agent(mut self, user_agent: &str) -> Self { + self.user_agent = Some(user_agent.to_string()); + self + } + /// Sets the init script. #[must_use] pub fn initialization_script(mut self, script: &str) -> Self { @@ -68,6 +81,13 @@ impl WebviewAttributes { self.clipboard = true; self } + + /// Sets whether clicking an inactive window also clicks through to the webview. + #[must_use] + pub fn accept_first_mouse(mut self, accept: bool) -> Self { + self.accept_first_mouse = accept; + self + } } /// Do **NOT** implement this trait except for use in a custom [`Runtime`](crate::Runtime). @@ -122,9 +142,9 @@ pub trait WindowBuilder: WindowBuilderBase { #[must_use] fn fullscreen(self, fullscreen: bool) -> Self; - /// Whether the window will be initially hidden or focused. + /// Whether the window will be initially focused or not. #[must_use] - fn focus(self) -> Self; + fn focused(self, focused: bool) -> Self; /// Whether the window should be maximized upon creation. #[must_use] @@ -189,6 +209,26 @@ pub trait WindowBuilder: WindowBuilderBase { #[must_use] fn owner_window(self, owner: HWND) -> Self; + /// Hide the titlebar. Titlebar buttons will still be visible. + #[cfg(target_os = "macos")] + #[must_use] + fn title_bar_style(self, style: TitleBarStyle) -> Self; + + /// Hide the window title. + #[cfg(target_os = "macos")] + #[must_use] + fn hidden_title(self, hidden: bool) -> Self; + + /// Defines the window [tabbing identifier] for macOS. + /// + /// Windows with matching tabbing identifiers will be grouped together. + /// If the tabbing identifier is not set, automatic tabbing will be disabled. + /// + /// [tabbing identifier]: + #[cfg(target_os = "macos")] + #[must_use] + fn tabbing_identifier(self, identifier: &str) -> Self; + /// Forces a theme or uses the system settings if None was provided. fn theme(self, theme: Option) -> Self; diff --git a/core/tauri-utils/CHANGELOG.md b/core/tauri-utils/CHANGELOG.md index 53ffff715..9e19335fa 100644 --- a/core/tauri-utils/CHANGELOG.md +++ b/core/tauri-utils/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## \[1.1.1] + +- Add missing allowlist config for `set_cursor_grab`, `set_cursor_visible`, `set_cursor_icon` and `set_cursor_position` APIs. + - [c764408d](https://www.github.com/tauri-apps/tauri/commit/c764408da7fae123edd41115bda42fa75a4731d2) fix: Add missing allowlist config for cursor apis, closes [#5207](https://www.github.com/tauri-apps/tauri/pull/5207) ([#5211](https://www.github.com/tauri-apps/tauri/pull/5211)) on 2022-09-16 + +## \[1.1.0] + +- Allow adding `build > beforeBundleCommand` in tauri.conf.json to run a shell command before the bundling phase. + - [57ab9847](https://www.github.com/tauri-apps/tauri/commit/57ab9847eb2d8c9a5da584b873b7c072e9ee26bf) feat(cli): add `beforeBundleCommand`, closes [#4879](https://www.github.com/tauri-apps/tauri/pull/4879) ([#4893](https://www.github.com/tauri-apps/tauri/pull/4893)) on 2022-08-09 +- Change `before_dev_command` and `before_build_command` config value to allow configuring the current working directory. + - [d6f7d3cf](https://www.github.com/tauri-apps/tauri/commit/d6f7d3cfe8a7ec8d68c8341016c4e0a3103da587) Add cwd option to `before` commands, add wait option to dev [#4740](https://www.github.com/tauri-apps/tauri/pull/4740) [#3551](https://www.github.com/tauri-apps/tauri/pull/3551) ([#4834](https://www.github.com/tauri-apps/tauri/pull/4834)) on 2022-08-02 +- Allow configuring the `before_dev_command` to force the CLI to wait for the command to finish before proceeding. + - [d6f7d3cf](https://www.github.com/tauri-apps/tauri/commit/d6f7d3cfe8a7ec8d68c8341016c4e0a3103da587) Add cwd option to `before` commands, add wait option to dev [#4740](https://www.github.com/tauri-apps/tauri/pull/4740) [#3551](https://www.github.com/tauri-apps/tauri/pull/3551) ([#4834](https://www.github.com/tauri-apps/tauri/pull/4834)) on 2022-08-02 +- Added support to configuration files in TOML format (Tauri.toml file). + - [ae83d008](https://www.github.com/tauri-apps/tauri/commit/ae83d008f9e1b89bfc8dddaca42aa5c1fbc36f6d) feat: add support to TOML config file `Tauri.toml`, closes [#4806](https://www.github.com/tauri-apps/tauri/pull/4806) ([#4813](https://www.github.com/tauri-apps/tauri/pull/4813)) on 2022-08-02 +- Refactored the `config::parse` module. + - [ae83d008](https://www.github.com/tauri-apps/tauri/commit/ae83d008f9e1b89bfc8dddaca42aa5c1fbc36f6d) feat: add support to TOML config file `Tauri.toml`, closes [#4806](https://www.github.com/tauri-apps/tauri/pull/4806) ([#4813](https://www.github.com/tauri-apps/tauri/pull/4813)) on 2022-08-02 +- Update windows to 0.39.0 and webview2-com to 0.19.1. + - [e6d9b670](https://www.github.com/tauri-apps/tauri/commit/e6d9b670b0b314ed667b0e164f2c8d27048e678f) refactor: remove unneeded focus code ([#5065](https://www.github.com/tauri-apps/tauri/pull/5065)) on 2022-09-03 + ## \[1.0.3] - Added `menu_on_left_click: bool` to the `SystemTrayConfig`. diff --git a/core/tauri-utils/Cargo.toml b/core/tauri-utils/Cargo.toml index 55bba1ac7..12cd55491 100644 --- a/core/tauri-utils/Cargo.toml +++ b/core/tauri-utils/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "tauri-utils" -version = "1.0.3" +version = "1.1.1" authors = [ "Tauri Programme within The Commons Conservancy" ] license = "Apache-2.0 OR MIT" homepage = "https://tauri.app" repository = "https://github.com/tauri-apps/tauri" description = "Utilities for Tauri" edition = "2021" -rust-version = "1.57" +rust-version = "1.59" exclude = [ "CHANGELOG.md", "/target" ] readme = "README.md" @@ -35,6 +35,7 @@ glob = { version = "0.3.0", optional = true } walkdir = { version = "2", optional = true } memchr = "2.4" semver = "1" +infer = "0.7" [target."cfg(target_os = \"linux\")".dependencies] heck = "0.4" diff --git a/core/tauri-utils/src/config.rs b/core/tauri-utils/src/config.rs index b332d3c21..321c370c6 100644 --- a/core/tauri-utils/src/config.rs +++ b/core/tauri-utils/src/config.rs @@ -34,6 +34,8 @@ use std::{ /// Items to help with parsing content into a [`Config`]. pub mod parse; +use crate::TitleBarStyle; + pub use self::parse::parse; /// An URL to open on a Tauri webview window. @@ -549,6 +551,9 @@ pub struct BundleConfig { /// This string must contain only alphanumeric characters (A–Z, a–z, and 0–9), hyphens (-), /// and periods (.). pub identifier: String, + /// The application's publisher. Defaults to the second element in the identifier string. + /// Currently maps to the Manufacturer property of the Windows Installer. + pub publisher: Option, /// The app's icons #[serde(default)] pub icon: Vec, @@ -794,6 +799,9 @@ pub struct WindowConfig { /// The window webview URL. #[serde(default)] pub url: WindowUrl, + /// The user agent for the webview + #[serde(alias = "user-agent")] + pub user_agent: Option, /// Whether the file drop is enabled or not on the webview. By default it is enabled. /// /// Disabling it is required to use drag and drop on the frontend on Windows. @@ -833,7 +841,7 @@ pub struct WindowConfig { /// Whether the window starts as fullscreen or not. #[serde(default)] pub fullscreen: bool, - /// Whether the window will be initially hidden or focused. + /// Whether the window will be initially focused or not. #[serde(default = "default_focus")] pub focus: bool, /// Whether the window is transparent or not. @@ -859,6 +867,23 @@ pub struct WindowConfig { pub skip_taskbar: bool, /// The initial window theme. Defaults to the system theme. Only implemented on Windows and macOS 10.14+. pub theme: Option, + /// The style of the macOS title bar. + #[serde(default, alias = "title-bar-style")] + pub title_bar_style: TitleBarStyle, + /// If `true`, sets the window title to be hidden on macOS. + #[serde(default, alias = "hidden-title")] + pub hidden_title: bool, + /// Whether clicking an inactive window also clicks through to the webview. + #[serde(default, alias = "accept-first-mouse")] + pub accept_first_mouse: bool, + /// Defines the window [tabbing identifier] for macOS. + /// + /// Windows with matching tabbing identifiers will be grouped together. + /// If the tabbing identifier is not set, automatic tabbing will be disabled. + /// + /// [tabbing identifier]: + #[serde(default, alias = "tabbing-identifier")] + pub tabbing_identifier: Option, } impl Default for WindowConfig { @@ -866,6 +891,7 @@ impl Default for WindowConfig { Self { label: default_window_label(), url: WindowUrl::default(), + user_agent: None, file_drop_enabled: default_file_drop_enabled(), center: false, x: None, @@ -887,6 +913,10 @@ impl Default for WindowConfig { always_on_top: false, skip_taskbar: false, theme: None, + title_bar_style: Default::default(), + hidden_title: false, + accept_first_mouse: false, + tabbing_identifier: None, } } } @@ -1129,7 +1159,8 @@ macro_rules! check_feature { /// Each pattern can start with a variable that resolves to a system base directory. /// The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, /// `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, -/// `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`. +/// `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, +/// `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`. #[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "schema", derive(JsonSchema))] #[serde(untagged)] @@ -1207,6 +1238,9 @@ pub struct FsAllowlistConfig { /// Rename file from local filesystem. #[serde(default, alias = "rename-file")] pub rename_file: bool, + /// Check if path exists on the local filesystem. + #[serde(default)] + pub exists: bool, } impl Allowlist for FsAllowlistConfig { @@ -1222,6 +1256,7 @@ impl Allowlist for FsAllowlistConfig { remove_dir: true, remove_file: true, rename_file: true, + exists: true, }; let mut features = allowlist.to_features(); features.push("fs-all"); @@ -1241,6 +1276,7 @@ impl Allowlist for FsAllowlistConfig { check_feature!(self, features, remove_dir, "fs-remove-dir"); check_feature!(self, features, remove_file, "fs-remove-file"); check_feature!(self, features, rename_file, "fs-rename-file"); + check_feature!(self, features, exists, "fs-exists"); features } } @@ -1320,6 +1356,21 @@ pub struct WindowAllowlistConfig { /// Allows setting the skip_taskbar flag of the window. #[serde(default, alias = "set-skip-taskbar")] pub set_skip_taskbar: bool, + /// Allows grabbing the cursor. + #[serde(default, alias = "set-cursor-grab")] + pub set_cursor_grab: bool, + /// Allows setting the cursor visibility. + #[serde(default, alias = "set-cursor-visible")] + pub set_cursor_visible: bool, + /// Allows changing the cursor icon. + #[serde(default, alias = "set-cursor-icon")] + pub set_cursor_icon: bool, + /// Allows setting the cursor position. + #[serde(default, alias = "set-cursor-position")] + pub set_cursor_position: bool, + /// Allows ignoring cursor events. + #[serde(default, alias = "set-ignore-cursor-events")] + pub set_ignore_cursor_events: bool, /// Allows start dragging on the window. #[serde(default, alias = "start-dragging")] pub start_dragging: bool, @@ -1354,6 +1405,11 @@ impl Allowlist for WindowAllowlistConfig { set_focus: true, set_icon: true, set_skip_taskbar: true, + set_cursor_grab: true, + set_cursor_visible: true, + set_cursor_icon: true, + set_cursor_position: true, + set_ignore_cursor_events: true, start_dragging: true, print: true, }; @@ -1399,6 +1455,26 @@ impl Allowlist for WindowAllowlistConfig { check_feature!(self, features, set_focus, "window-set-focus"); check_feature!(self, features, set_icon, "window-set-icon"); check_feature!(self, features, set_skip_taskbar, "window-set-skip-taskbar"); + check_feature!(self, features, set_cursor_grab, "window-set-cursor-grab"); + check_feature!( + self, + features, + set_cursor_visible, + "window-set-cursor-visible" + ); + check_feature!(self, features, set_cursor_icon, "window-set-cursor-icon"); + check_feature!( + self, + features, + set_cursor_position, + "window-set-cursor-position" + ); + check_feature!( + self, + features, + set_ignore_cursor_events, + "window-set-ignore-cursor-events" + ); check_feature!(self, features, start_dragging, "window-start-dragging"); check_feature!(self, features, print, "window-print"); features @@ -1420,7 +1496,8 @@ pub struct ShellAllowedCommand { /// It can start with a variable that resolves to a system base directory. /// The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, /// `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, - /// `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`. + /// `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, + /// `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`. #[serde(rename = "cmd", default)] // use default just so the schema doesn't flag it as required pub command: PathBuf, @@ -1948,6 +2025,46 @@ impl Allowlist for ClipboardAllowlistConfig { } } +/// Allowlist for the app APIs. +#[derive(Debug, Default, PartialEq, Eq, Clone, Deserialize, Serialize)] +#[cfg_attr(feature = "schema", derive(JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct AppAllowlistConfig { + /// Use this flag to enable all app APIs. + #[serde(default)] + pub all: bool, + /// Enables the app's `show` API. + #[serde(default)] + pub show: bool, + /// Enables the app's `hide` API. + #[serde(default)] + pub hide: bool, +} + +impl Allowlist for AppAllowlistConfig { + fn all_features() -> Vec<&'static str> { + let allowlist = Self { + all: false, + show: true, + hide: true, + }; + let mut features = allowlist.to_features(); + features.push("app-all"); + features + } + + fn to_features(&self) -> Vec<&'static str> { + if self.all { + vec!["app-all"] + } else { + let mut features = Vec::new(); + check_feature!(self, features, show, "app-show"); + check_feature!(self, features, hide, "app-hide"); + features + } + } +} + /// Allowlist configuration. #[derive(Debug, Default, PartialEq, Eq, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "schema", derive(JsonSchema))] @@ -1992,6 +2109,9 @@ pub struct AllowlistConfig { /// Clipboard APIs allowlist. #[serde(default)] pub clipboard: ClipboardAllowlistConfig, + /// App APIs allowlist. + #[serde(default)] + pub app: AppAllowlistConfig, } impl Allowlist for AllowlistConfig { @@ -2009,6 +2129,7 @@ impl Allowlist for AllowlistConfig { features.extend(ProtocolAllowlistConfig::all_features()); features.extend(ProcessAllowlistConfig::all_features()); features.extend(ClipboardAllowlistConfig::all_features()); + features.extend(AppAllowlistConfig::all_features()); features } @@ -2043,7 +2164,6 @@ pub enum PatternKind { /// Brownfield pattern. Brownfield, /// Isolation pattern. Recommended for security purposes. - #[cfg(feature = "isolation")] Isolation { /// The dir containing the index.html file that contains the secure isolation application. dir: PathBuf, @@ -2121,7 +2241,6 @@ impl TauriConfig { if self.macos_private_api { features.push("macos-private-api"); } - #[cfg(feature = "isolation")] if let PatternKind::Isolation { .. } = self.pattern { features.push("isolation"); } @@ -2344,6 +2463,8 @@ pub struct SystemTrayConfig { alias = "menu-on-left-click" )] pub menu_on_left_click: bool, + /// Title for MacOS tray + pub title: Option, } fn default_tray_menu_on_left_click() -> bool { @@ -2565,6 +2686,7 @@ impl<'d> serde::Deserialize<'d> for PackageVersion { pub struct PackageConfig { /// App name. #[serde(alias = "product-name")] + #[cfg_attr(feature = "schema", validate(regex(pattern = "^[^/\\:*?\"<>|]+$")))] pub product_name: Option, /// App version. It is a semver version number or a path to a `package.json` file containing the `version` field. #[serde(deserialize_with = "version_deserializer", default)] @@ -2896,10 +3018,23 @@ mod build { } } + impl ToTokens for crate::TitleBarStyle { + fn to_tokens(&self, tokens: &mut TokenStream) { + let prefix = quote! { ::tauri::utils::TitleBarStyle }; + + tokens.append_all(match self { + Self::Visible => quote! { #prefix::Visible }, + Self::Transparent => quote! { #prefix::Transparent }, + Self::Overlay => quote! { #prefix::Overlay }, + }) + } + } + impl ToTokens for WindowConfig { fn to_tokens(&self, tokens: &mut TokenStream) { let label = str_lit(&self.label); let url = &self.url; + let user_agent = opt_str_lit(self.user_agent.as_ref()); let file_drop_enabled = self.file_drop_enabled; let center = self.center; let x = opt_lit(self.x.as_ref()); @@ -2921,12 +3056,17 @@ mod build { let always_on_top = self.always_on_top; let skip_taskbar = self.skip_taskbar; let theme = opt_lit(self.theme.as_ref()); + let title_bar_style = &self.title_bar_style; + let hidden_title = self.hidden_title; + let accept_first_mouse = self.accept_first_mouse; + let tabbing_identifier = opt_str_lit(self.tabbing_identifier.as_ref()); literal_struct!( tokens, WindowConfig, label, url, + user_agent, file_drop_enabled, center, x, @@ -2947,7 +3087,11 @@ mod build { decorations, always_on_top, skip_taskbar, - theme + theme, + title_bar_style, + hidden_title, + accept_first_mouse, + tabbing_identifier ); } } @@ -3055,6 +3199,8 @@ mod build { tokens.append_all(match self { Self::Brownfield => quote! { #prefix::Brownfield }, + #[cfg(not(feature = "isolation"))] + Self::Isolation { dir: _ } => quote! { #prefix::Brownfield }, #[cfg(feature = "isolation")] Self::Isolation { dir } => { let dir = path_buf_lit(dir); @@ -3107,6 +3253,7 @@ mod build { impl ToTokens for BundleConfig { fn to_tokens(&self, tokens: &mut TokenStream) { let identifier = str_lit(&self.identifier); + let publisher = quote!(None); let icon = vec_lit(&self.icon, str_lit); let active = self.active; let targets = quote!(Default::default()); @@ -3127,6 +3274,7 @@ mod build { BundleConfig, active, identifier, + publisher, icon, targets, resources, @@ -3314,12 +3462,14 @@ mod build { let icon_as_template = self.icon_as_template; let menu_on_left_click = self.menu_on_left_click; let icon_path = path_buf_lit(&self.icon_path); + let title = opt_str_lit(self.title.as_ref()); literal_struct!( tokens, SystemTrayConfig, icon_path, icon_as_template, - menu_on_left_click + menu_on_left_click, + title ); } } @@ -3541,6 +3691,7 @@ mod test { active: false, targets: Default::default(), identifier: String::from(""), + publisher: None, icon: Vec::new(), resources: None, copyright: None, diff --git a/core/tauri-utils/src/config/parse.rs b/core/tauri-utils/src/config/parse.rs index 0c9eba633..c4439ebf9 100644 --- a/core/tauri-utils/src/config/parse.rs +++ b/core/tauri-utils/src/config/parse.rs @@ -153,6 +153,33 @@ pub enum ConfigError { }, } +/// Determines if the given folder has a configuration file. +pub fn folder_has_configuration_file(folder: &Path) -> bool { + folder.join(ConfigFormat::Json.into_file_name()).exists() + || folder.join(ConfigFormat::Json5.into_file_name()).exists() + || folder.join(ConfigFormat::Toml.into_file_name()).exists() + // platform file names + || folder.join(ConfigFormat::Json.into_platform_file_name()).exists() + || folder.join(ConfigFormat::Json5.into_platform_file_name()).exists() + || folder.join(ConfigFormat::Toml.into_platform_file_name()).exists() +} + +/// Determines if the given file path represents a Tauri configuration file. +pub fn is_configuration_file(path: &Path) -> bool { + path + .file_name() + .map(|file_name| { + file_name == OsStr::new(ConfigFormat::Json.into_file_name()) + || file_name == OsStr::new(ConfigFormat::Json5.into_file_name()) + || file_name == OsStr::new(ConfigFormat::Toml.into_file_name()) + // platform file names + || file_name == OsStr::new(ConfigFormat::Json.into_platform_file_name()) + || file_name == OsStr::new(ConfigFormat::Json5.into_platform_file_name()) + || file_name == OsStr::new(ConfigFormat::Toml.into_platform_file_name()) + }) + .unwrap_or_default() +} + /// Reads the configuration from the given root directory. /// /// It first looks for a `tauri.conf.json[5]` or `Tauri.toml` file on the given directory. The file must exist. diff --git a/core/tauri-utils/src/html.rs b/core/tauri-utils/src/html.rs index 31985df9e..b8744261b 100644 --- a/core/tauri-utils/src/html.rs +++ b/core/tauri-utils/src/html.rs @@ -6,9 +6,15 @@ use std::path::{Path, PathBuf}; -use html5ever::{interface::QualName, namespace_url, ns, tendril::TendrilSink, LocalName}; +use html5ever::{ + interface::QualName, + namespace_url, ns, + serialize::{HtmlSerializer, SerializeOpts, Serializer, TraversalScope}, + tendril::TendrilSink, + LocalName, +}; pub use kuchiki::NodeRef; -use kuchiki::{Attribute, ExpandedName}; +use kuchiki::{Attribute, ExpandedName, NodeData}; use serde::Serialize; #[cfg(feature = "isolation")] use serialize_to_javascript::DefaultTemplate; @@ -24,6 +30,90 @@ pub const SCRIPT_NONCE_TOKEN: &str = "__TAURI_SCRIPT_NONCE__"; /// The token used for style nonces. pub const STYLE_NONCE_TOKEN: &str = "__TAURI_STYLE_NONCE__"; +// taken from https://github.com/kuchiki-rs/kuchiki/blob/57ee6920d835315a498e748ba4b07a851ae5e498/src/serializer.rs#L12 +fn serialize_node_ref_internal( + node: &NodeRef, + serializer: &mut S, + traversal_scope: TraversalScope, +) -> crate::Result<()> { + match (traversal_scope, node.data()) { + (ref scope, &NodeData::Element(ref element)) => { + if *scope == TraversalScope::IncludeNode { + let attrs = element.attributes.borrow(); + + // Unfortunately we need to allocate something to hold these &'a QualName + let attrs = attrs + .map + .iter() + .map(|(name, attr)| { + ( + QualName::new(attr.prefix.clone(), name.ns.clone(), name.local.clone()), + &attr.value, + ) + }) + .collect::>(); + + serializer.start_elem( + element.name.clone(), + attrs.iter().map(|&(ref name, value)| (name, &**value)), + )? + } + + let children = match element.template_contents.as_ref() { + Some(template_root) => template_root.children(), + None => node.children(), + }; + for child in children { + serialize_node_ref_internal(&child, serializer, TraversalScope::IncludeNode)? + } + + if *scope == TraversalScope::IncludeNode { + serializer.end_elem(element.name.clone())? + } + Ok(()) + } + + (_, &NodeData::DocumentFragment) | (_, &NodeData::Document(_)) => { + for child in node.children() { + serialize_node_ref_internal(&child, serializer, TraversalScope::IncludeNode)? + } + Ok(()) + } + + (TraversalScope::ChildrenOnly(_), _) => Ok(()), + + (TraversalScope::IncludeNode, &NodeData::Doctype(ref doctype)) => { + serializer.write_doctype(&doctype.name).map_err(Into::into) + } + (TraversalScope::IncludeNode, &NodeData::Text(ref text)) => { + serializer.write_text(&text.borrow()).map_err(Into::into) + } + (TraversalScope::IncludeNode, &NodeData::Comment(ref text)) => { + serializer.write_comment(&text.borrow()).map_err(Into::into) + } + (TraversalScope::IncludeNode, &NodeData::ProcessingInstruction(ref contents)) => { + let contents = contents.borrow(); + serializer + .write_processing_instruction(&contents.0, &contents.1) + .map_err(Into::into) + } + } +} + +/// Serializes the node to HTML. +pub fn serialize_node(node: &NodeRef) -> Vec { + let mut u8_vec = Vec::new(); + let mut ser = HtmlSerializer::new( + &mut u8_vec, + SerializeOpts { + traversal_scope: TraversalScope::IncludeNode, + ..Default::default() + }, + ); + serialize_node_ref_internal(node, &mut ser, TraversalScope::IncludeNode).unwrap(); + u8_vec +} + /// Parses the given HTML string. pub fn parse(html: String) -> NodeRef { kuchiki::parse_html().one(html) @@ -122,7 +212,6 @@ impl From<&PatternKind> for PatternObject { fn from(pattern_kind: &PatternKind) -> Self { match pattern_kind { PatternKind::Brownfield => Self::Brownfield, - #[cfg(feature = "isolation")] PatternKind::Isolation { .. } => Self::Isolation { side: IsolationSide::default(), }, diff --git a/core/tauri-utils/src/lib.rs b/core/tauri-utils/src/lib.rs index 1f17a315f..b63e90ff3 100644 --- a/core/tauri-utils/src/lib.rs +++ b/core/tauri-utils/src/lib.rs @@ -14,6 +14,7 @@ pub mod assets; pub mod config; pub mod html; pub mod io; +pub mod mime_type; pub mod platform; /// Prepare application resources and sidecars. #[cfg(feature = "resources")] @@ -49,6 +50,68 @@ impl PackageInfo { } } +/// How the window title bar should be displayed. +#[derive(Debug, Clone, PartialEq, Eq)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +pub enum TitleBarStyle { + /// A normal title bar. + Visible, + /// Makes the title bar transparent, so the window background color is shown instead. + /// + /// Useful if you don't need to have actual HTML under the title bar. This lets you avoid the caveats of using `TitleBarStyle::Overlay`. Will be more useful when Tauri lets you set a custom window background color. + Transparent, + /// Shows the title bar as a transparent overlay over the window's content. + /// + /// Keep in mind: + /// - The height of the title bar is different on different OS versions, which can lead to window the controls and title not being where you don't expect. + /// - You need to define a custom drag region to make your window draggable, however due to a limitation you can't drag the window when it's not in focus (https://github.com/tauri-apps/tauri/issues/4316). + /// - The color of the window title depends on the system theme. + Overlay, +} + +impl Default for TitleBarStyle { + fn default() -> Self { + Self::Visible + } +} + +impl Serialize for TitleBarStyle { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + serializer.serialize_str(self.to_string().as_ref()) + } +} + +impl<'de> Deserialize<'de> for TitleBarStyle { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + Ok(match s.to_lowercase().as_str() { + "transparent" => Self::Transparent, + "overlay" => Self::Overlay, + _ => Self::Visible, + }) + } +} + +impl Display for TitleBarStyle { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!( + f, + "{}", + match self { + Self::Visible => "Visible", + Self::Transparent => "Transparent", + Self::Overlay => "Overlay", + } + ) + } +} + /// System theme. #[derive(Debug, Copy, Clone, PartialEq, Eq)] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] diff --git a/core/tauri-runtime/src/http/mime_type.rs b/core/tauri-utils/src/mime_type.rs similarity index 98% rename from core/tauri-runtime/src/http/mime_type.rs rename to core/tauri-utils/src/mime_type.rs index 2f9bb87e6..be2471ea9 100644 --- a/core/tauri-runtime/src/http/mime_type.rs +++ b/core/tauri-utils/src/mime_type.rs @@ -2,11 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT +//! Determine a mime type from a URI or file contents. + use std::fmt; const MIMETYPE_PLAIN: &str = "text/plain"; /// [Web Compatible MimeTypes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types#important_mime_types_for_web_developers) +#[allow(missing_docs)] pub enum MimeType { Css, Csv, diff --git a/core/tauri-utils/src/platform.rs b/core/tauri-utils/src/platform.rs index 6393e96e1..96614ffa2 100644 --- a/core/tauri-utils/src/platform.rs +++ b/core/tauri-utils/src/platform.rs @@ -172,7 +172,10 @@ pub fn resource_dir(package_info: &PackageInfo, env: &Env) -> crate::Result crate::Result for std::process::Command`. + - [9f1d34c2](https://www.github.com/tauri-apps/tauri/commit/9f1d34c288cbe64f0453cf210bc9488bb42ed19a) feat: implement From for std::process::Command, closes [#4673](https://www.github.com/tauri-apps/tauri/pull/4673) ([#4836](https://www.github.com/tauri-apps/tauri/pull/4836)) on 2022-08-02 +- Added support to configuration files in TOML format (Tauri.toml file). + - [ae83d008](https://www.github.com/tauri-apps/tauri/commit/ae83d008f9e1b89bfc8dddaca42aa5c1fbc36f6d) feat: add support to TOML config file `Tauri.toml`, closes [#4806](https://www.github.com/tauri-apps/tauri/pull/4806) ([#4813](https://www.github.com/tauri-apps/tauri/pull/4813)) on 2022-08-02 +- Enhance `SystemTray::with_icon` to accept `tauri::Icon`. + - [964926ff](https://www.github.com/tauri-apps/tauri/commit/964926ff850b82e104d29fec4c8a1d9a16798c06) feat(core): enhance `SystemTray::with_icon` ([#4849](https://www.github.com/tauri-apps/tauri/pull/4849)) on 2022-08-03 +- Fixes CLI parser ignoring inner subcommands. + - [dcd50667](https://www.github.com/tauri-apps/tauri/commit/dcd506676c0a15ac4af7705b62574cc2eea3bb43) fix(core): parse inner CLI subcommands, closes [#4688](https://www.github.com/tauri-apps/tauri/pull/4688) ([#4841](https://www.github.com/tauri-apps/tauri/pull/4841)) on 2022-08-02 +- Fix `fs.readDir` recursive option reading symlinked directories that are not allowed by the scope. + - [f4121c12](https://www.github.com/tauri-apps/tauri/commit/f4121c128e69b06c3eb5eea14dd2af4720afed49) fix(endpoints/fs/readDir): don't read symlinks that are not allowed b… ([#5123](https://www.github.com/tauri-apps/tauri/pull/5123)) on 2022-09-08 +- Fix typo in invalid state access panic message. + - [c7fec3e1](https://www.github.com/tauri-apps/tauri/commit/c7fec3e1ff73f7d857548cab78777a3aaf084c68) fix typo in state.rs ([#4699](https://www.github.com/tauri-apps/tauri/pull/4699)) on 2022-07-25 +- Fixes updater breaking the app icon in Finder. + - [58fc1f21](https://www.github.com/tauri-apps/tauri/commit/58fc1f2150b6ddd1b322deb03ca9083222fc3522) fix(updater): blank icon after update on macOS, closes [#4613](https://www.github.com/tauri-apps/tauri/pull/4613) ([#4861](https://www.github.com/tauri-apps/tauri/pull/4861)) on 2022-08-04 +- Implement theme APIs for Linux. + - [f21cbecd](https://www.github.com/tauri-apps/tauri/commit/f21cbecdeb3571ac4ad971b9a865ff62a131a176) feat(core): implement theme APIs for Linux ([#4808](https://www.github.com/tauri-apps/tauri/pull/4808)) on 2022-08-02 +- Implement `raw_window_handle::HasRawDisplayHandle` for `App` and `AppHandle` + - [0ad9531d](https://www.github.com/tauri-apps/tauri/commit/0ad9531d799d81e1f807000a9d74dfd7998206fe) chore(deps): update tao to 0.13, wry to 0.20, rfd to 0.10, raw-window-handle to 0.5 ([#4804](https://www.github.com/tauri-apps/tauri/pull/4804)) on 2022-07-31 +- Retain command line arguments in `api::process::restart`. + - [6218c31e](https://www.github.com/tauri-apps/tauri/commit/6218c31e175d43b59b87bd5b36ee773467566f67) fix(core): retain command line arguments on restart, closes [#4760](https://www.github.com/tauri-apps/tauri/pull/4760) ([#4763](https://www.github.com/tauri-apps/tauri/pull/4763)) on 2022-07-25 +- Added APIs to create a system tray at runtime. + - [4d063ae9](https://www.github.com/tauri-apps/tauri/commit/4d063ae9ee9538cd6fa5e01b80070c6edf8eaeb9) feat(core): create system tray at runtime, closes [#2278](https://www.github.com/tauri-apps/tauri/pull/2278) ([#4862](https://www.github.com/tauri-apps/tauri/pull/4862)) on 2022-08-09 +- Add `api::Command::encoding` method to set the stdout/stderr encoding. + - [d8cf9f9f](https://www.github.com/tauri-apps/tauri/commit/d8cf9f9fcd617ac24fa418952fd4a32c08804f5c) Command support for specified character encoding, closes [#4644](https://www.github.com/tauri-apps/tauri/pull/4644) ([#4772](https://www.github.com/tauri-apps/tauri/pull/4772)) on 2022-07-28 +- Do not follow redirects when `api::http::ClientBuilder::max_redirections` is `0`. + - [d576e8ae](https://www.github.com/tauri-apps/tauri/commit/d576e8ae72b025ca41f96ddf7a885b84f950a4b1) feat(core): do not follow redirects if `max_redirects` is 0 closes [#4795](https://www.github.com/tauri-apps/tauri/pull/4795) ([#4812](https://www.github.com/tauri-apps/tauri/pull/4812)) on 2022-07-31 +- Added the `SystemTrayHandle::destroy` method. + - [4d063ae9](https://www.github.com/tauri-apps/tauri/commit/4d063ae9ee9538cd6fa5e01b80070c6edf8eaeb9) feat(core): create system tray at runtime, closes [#2278](https://www.github.com/tauri-apps/tauri/pull/2278) ([#4862](https://www.github.com/tauri-apps/tauri/pull/4862)) on 2022-08-09 +- Added `native-tls-vendored` and `reqwest-native-tls-vendored` Cargo features to compile and statically link to a vendored copy of OpenSSL on Linux. + - [331f3460](https://www.github.com/tauri-apps/tauri/commit/331f3460027614738ddbbbbcd04bfc59a349f3de) feat(core): add option to use vendored openssl, closes [#4470](https://www.github.com/tauri-apps/tauri/pull/4470) ([#4809](https://www.github.com/tauri-apps/tauri/pull/4809)) on 2022-08-02 +- Update windows to 0.39.0 and webview2-com to 0.19.1. + - [e6d9b670](https://www.github.com/tauri-apps/tauri/commit/e6d9b670b0b314ed667b0e164f2c8d27048e678f) refactor: remove unneeded focus code ([#5065](https://www.github.com/tauri-apps/tauri/pull/5065)) on 2022-09-03 +- Add `exists` function to the fs module. + - [3c62dbc9](https://www.github.com/tauri-apps/tauri/commit/3c62dbc902c904d35a7472ce72a969084c95fbbe) feat(api): Add `exists` function to the fs module. ([#5060](https://www.github.com/tauri-apps/tauri/pull/5060)) on 2022-09-15 + +## \[1.0.6] + +- Fix `fs.readDir` recursive option reading symlinked directories that are not allowed by the scope. + - [bb178829](https://www.github.com/tauri-apps/tauri/commit/bb178829086e80916f9be190f02d83bc25802799) fix(endpoints/fs/readDir): don't read symlinks that are not allowed b… ([#5123](https://www.github.com/tauri-apps/tauri/pull/5123)) on 2022-09-08 + ## \[1.0.5] - Escape the MSI file path when running msiexec via powershell. diff --git a/core/tauri/Cargo.toml b/core/tauri/Cargo.toml index c13b1bd9e..4b3d76d93 100644 --- a/core/tauri/Cargo.toml +++ b/core/tauri/Cargo.toml @@ -3,19 +3,14 @@ authors = [ "Tauri Programme within The Commons Conservancy" ] categories = [ "gui", "web-programming" ] description = "Make tiny, secure apps for all desktop platforms with Tauri" edition = "2021" -rust-version = "1.57" -exclude = [ - "/test", - "/.scripts", - "CHANGELOG.md", - "/target" -] +rust-version = "1.59" +exclude = [ "/test", "/.scripts", "CHANGELOG.md", "/target" ] homepage = "https://tauri.app" license = "Apache-2.0 OR MIT" name = "tauri" readme = "README.md" repository = "https://github.com/tauri-apps/tauri" -version = "1.0.5" +version = "1.1.1" [package.metadata.docs.rs] no-default-features = true @@ -47,17 +42,17 @@ normal = [ "attohttpc", "reqwest" ] [dependencies] serde_json = { version = "1.0", features = [ "raw_value" ] } serde = { version = "1.0", features = [ "derive" ] } -tokio = { version = "1.19", features = [ "rt", "rt-multi-thread", "sync", "fs", "io-util" ] } -futures = "0.3" +tokio = { version = "1", features = [ "rt", "rt-multi-thread", "sync", "fs", "io-util" ] } +futures-util = "0.3" uuid = { version = "1", features = [ "v4" ] } -url = { version = "2.2" } +url = { version = "2.3" } anyhow = "1.0" thiserror = "1.0" -once_cell = "1.12" -tauri-runtime = { version = "0.10.2", path = "../tauri-runtime" } -tauri-macros = { version = "1.0.4", path = "../tauri-macros" } -tauri-utils = { version = "1.0.3", features = [ "resources" ], path = "../tauri-utils" } -tauri-runtime-wry = { version = "0.10.2", path = "../tauri-runtime-wry", optional = true } +once_cell = "1" +tauri-runtime = { version = "0.11.1", path = "../tauri-runtime" } +tauri-macros = { version = "1.1.1", path = "../tauri-macros" } +tauri-utils = { version = "1.1.1", features = [ "resources" ], path = "../tauri-utils" } +tauri-runtime-wry = { version = "0.11.1", path = "../tauri-runtime-wry", optional = true } rand = "0.8" semver = { version = "1.0", features = [ "serde" ] } serde_repr = "0.1" @@ -69,25 +64,24 @@ ignore = "0.4" flate2 = "1.0" http = "0.2" dirs-next = "2.0" -percent-encoding = "2.1" +percent-encoding = "2.2" base64 = { version = "0.13", optional = true } clap = { version = "3", optional = true } reqwest = { version = "0.11", features = [ "json", "stream" ], optional = true } bytes = { version = "1", features = [ "serde" ], optional = true } -attohttpc = { version = "0.20", features = [ "compress", "json", "form" ] } +attohttpc = { version = "0.22", features = [ "compress", "json", "form" ] } open = { version = "3.0", optional = true } shared_child = { version = "1.0", optional = true } os_pipe = { version = "1.0", optional = true } raw-window-handle = "0.5" minisign-verify = { version = "0.2", optional = true } time = { version = "0.3", features = [ "parsing", "formatting" ], optional = true } -os_info = { version = "3.4.0", optional = true } -futures-lite = "1.12" -regex = { version = "1.5.6", optional = true } +os_info = { version = "3.5.0", optional = true } +regex = { version = "1.6.0", optional = true } glob = "0.3" -data-url = { version = "0.1", optional = true } +data-url = { version = "0.2", optional = true } serialize-to-javascript = "=0.1.1" -infer = { version = "0.8", optional = true } +infer = { version = "0.9", optional = true } png = { version = "0.17", optional = true } ico = { version = "0.1", optional = true } encoding_rs = "0.8.31" @@ -99,7 +93,7 @@ notify-rust = { version = "4.5", default-features = false, features = [ "d" ], o [target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] gtk = { version = "0.15", features = [ "v3_20" ] } glib = "0.15" -webkit2gtk = { version = "0.18", features = [ "v2_22" ] } +webkit2gtk = { version = "0.18.2", features = [ "v2_36" ] } [target."cfg(target_os = \"macos\")".dependencies] embed_plist = "1.2" @@ -108,7 +102,7 @@ objc = "0.2" [target."cfg(windows)".dependencies] webview2-com = "0.19.1" -win7-notifications = { version = "0.3.0", optional = true } +win7-notifications = { version = "0.3.1", optional = true } [target.'cfg(target_os = "android")'.dependencies] paste = "1.0" @@ -119,7 +113,7 @@ features = [ "Win32_Foundation" ] [build-dependencies] heck = "0.4" -once_cell = "1.12" +once_cell = "1" [dev-dependencies] mockito = "0.31" @@ -130,7 +124,7 @@ serde = { version = "1.0", features = [ "derive" ] } serde_json = "1.0" tauri = { path = ".", default-features = false, features = [ "wry" ] } tokio-test = "0.4.2" -tokio = { version = "1.19", features = [ "full" ] } +tokio = { version = "1", features = [ "full" ] } cargo_toml = "0.11" [features] @@ -185,7 +179,8 @@ api-all = [ "process-all", "protocol-all", "shell-all", - "window-all" + "window-all", + "app-all" ] clipboard-all = [ "clipboard-write-text", "clipboard-read-text" ] clipboard-read-text = [ "clipboard" ] @@ -199,6 +194,7 @@ dialog-save = [ "dialog" ] fs-all = [ "fs-copy-file", "fs-create-dir", + "fs-exists", "fs-read-file", "fs-read-dir", "fs-remove-dir", @@ -208,6 +204,7 @@ fs-all = [ ] fs-copy-file = [ ] fs-create-dir = [ ] +fs-exists = [ ] fs-read-file = [ ] fs-read-dir = [ ] fs-remove-dir = [ ] @@ -257,6 +254,7 @@ window-all = [ "window-set-cursor-visible", "window-set-cursor-icon", "window-set-cursor-position", + "window-set-ignore-cursor-events", "window-start-dragging", "window-print" ] @@ -286,8 +284,12 @@ window-set-cursor-grab = [ ] window-set-cursor-visible = [ ] window-set-cursor-icon = [ ] window-set-cursor-position = [ ] +window-set-ignore-cursor-events = [ ] window-start-dragging = [ ] window-print = [ ] +app-all = [ "app-show", "app-hide" ] +app-show = [ ] +app-hide = [ ] config-json5 = [ "tauri-macros/config-json5" ] config-toml = [ "tauri-macros/config-toml" ] icon-ico = [ "infer", "ico" ] diff --git a/core/tauri/build.rs b/core/tauri/build.rs index e6fbb8210..12dde1a7d 100644 --- a/core/tauri/build.rs +++ b/core/tauri/build.rs @@ -59,6 +59,7 @@ fn main() { "remove-dir", "remove-file", "rename-file", + "exists", ], api_all, ); @@ -92,6 +93,7 @@ fn main() { "set-cursor-visible", "set-cursor-icon", "set-cursor-position", + "set-ignore-cursor-events", "start-dragging", "print", ], @@ -129,6 +131,8 @@ fn main() { alias_module("clipboard", &["write-text", "read-text"], api_all); + alias_module("app", &["show", "hide"], api_all); + let checked_features_out_path = Path::new(&std::env::var("OUT_DIR").unwrap()).join("checked_features"); std::fs::write( diff --git a/core/tauri/scripts/bundle.global.js b/core/tauri/scripts/bundle.global.js new file mode 100644 index 000000000..65643521f --- /dev/null +++ b/core/tauri/scripts/bundle.global.js @@ -0,0 +1,8 @@ +"use strict";var __TAURI_IIFE__=(()=>{var L=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var pe=Object.prototype.hasOwnProperty;var c=(n,e)=>{for(var t in e)L(n,t,{get:e[t],enumerable:!0})},ge=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of me(e))!pe.call(n,s)&&s!==t&&L(n,s,{get:()=>e[s],enumerable:!(r=de(e,s))||r.enumerable});return n};var he=n=>ge(L({},"__esModule",{value:!0}),n);var Jt={};c(Jt,{app:()=>U,cli:()=>k,clipboard:()=>I,dialog:()=>z,event:()=>V,fs:()=>j,globalShortcut:()=>q,http:()=>$,invoke:()=>$t,notification:()=>J,os:()=>ne,path:()=>K,process:()=>Q,shell:()=>Z,tauri:()=>R,updater:()=>X,window:()=>te});var U={};c(U,{getName:()=>be,getTauriVersion:()=>Pe,getVersion:()=>_e,hide:()=>ve,show:()=>we});var R={};c(R,{convertFileSrc:()=>fe,invoke:()=>f,transformCallback:()=>d});function ye(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function d(n,e=!1){let t=ye(),r=`_${t}`;return Object.defineProperty(window,r,{value:s=>(e&&Reflect.deleteProperty(window,r),n==null?void 0:n(s)),writable:!1,configurable:!0}),t}async function f(n,e={}){return new Promise((t,r)=>{let s=d(l=>{t(l),Reflect.deleteProperty(window,`_${o}`)},!0),o=d(l=>{r(l),Reflect.deleteProperty(window,`_${s}`)},!0);window.__TAURI_IPC__({cmd:n,callback:s,error:o,...e})})}function fe(n,e="asset"){let t=encodeURIComponent(n);return navigator.userAgent.includes("Windows")?`https://${e}.localhost/${t}`:`${e}://localhost/${t}`}async function i(n){return f("tauri",n)}async function _e(){return i({__tauriModule:"App",message:{cmd:"getAppVersion"}})}async function be(){return i({__tauriModule:"App",message:{cmd:"getAppName"}})}async function Pe(){return i({__tauriModule:"App",message:{cmd:"getTauriVersion"}})}async function we(){return i({__tauriModule:"App",message:{cmd:"show"}})}async function ve(){return i({__tauriModule:"App",message:{cmd:"hide"}})}var k={};c(k,{getMatches:()=>Me});async function Me(){return i({__tauriModule:"Cli",message:{cmd:"cliMatches"}})}var I={};c(I,{readText:()=>Oe,writeText:()=>Te});async function Te(n){return i({__tauriModule:"Clipboard",message:{cmd:"writeText",data:n}})}async function Oe(){return i({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})}var z={};c(z,{ask:()=>Ce,confirm:()=>De,message:()=>Ae,open:()=>Fe,save:()=>Ee});async function Fe(n={}){return typeof n=="object"&&Object.freeze(n),i({__tauriModule:"Dialog",message:{cmd:"openDialog",options:n}})}async function Ee(n={}){return typeof n=="object"&&Object.freeze(n),i({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:n}})}async function Ae(n,e){var r;let t=typeof e=="string"?{title:e}:e;return i({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:n.toString(),title:(r=t==null?void 0:t.title)==null?void 0:r.toString(),type:t==null?void 0:t.type}})}async function Ce(n,e){var r;let t=typeof e=="string"?{title:e}:e;return i({__tauriModule:"Dialog",message:{cmd:"askDialog",message:n.toString(),title:(r=t==null?void 0:t.title)==null?void 0:r.toString(),type:t==null?void 0:t.type}})}async function De(n,e){var r;let t=typeof e=="string"?{title:e}:e;return i({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:n.toString(),title:(r=t==null?void 0:t.title)==null?void 0:r.toString(),type:t==null?void 0:t.type}})}var V={};c(V,{TauriEvent:()=>M,emit:()=>T,listen:()=>N,once:()=>H});async function ie(n,e){return i({__tauriModule:"Event",message:{cmd:"unlisten",event:n,eventId:e}})}async function w(n,e,t){await i({__tauriModule:"Event",message:{cmd:"emit",event:n,windowLabel:e,payload:t}})}async function _(n,e,t){return i({__tauriModule:"Event",message:{cmd:"listen",event:n,windowLabel:e,handler:d(t)}}).then(r=>async()=>ie(n,r))}async function v(n,e,t){return _(n,e,r=>{t(r),ie(n,r.id).catch(()=>{})})}var M=(u=>(u.WINDOW_RESIZED="tauri://resize",u.WINDOW_MOVED="tauri://move",u.WINDOW_CLOSE_REQUESTED="tauri://close-requested",u.WINDOW_CREATED="tauri://window-created",u.WINDOW_DESTROYED="tauri://destroyed",u.WINDOW_FOCUS="tauri://focus",u.WINDOW_BLUR="tauri://blur",u.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",u.WINDOW_THEME_CHANGED="tauri://theme-changed",u.WINDOW_FILE_DROP="tauri://file-drop",u.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",u.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",u.MENU="tauri://menu",u.CHECK_UPDATE="tauri://update",u.UPDATE_AVAILABLE="tauri://update-available",u.INSTALL_UPDATE="tauri://update-install",u.STATUS_UPDATE="tauri://update-status",u.DOWNLOAD_PROGRESS="tauri://update-download-progress",u))(M||{});async function N(n,e){return _(n,null,e)}async function H(n,e){return v(n,null,e)}async function T(n,e){return w(n,void 0,e)}var j={};c(j,{BaseDirectory:()=>O,Dir:()=>O,copyFile:()=>ze,createDir:()=>ke,exists:()=>Ve,readBinaryFile:()=>Se,readDir:()=>Ue,readTextFile:()=>xe,removeDir:()=>Ie,removeFile:()=>Ne,renameFile:()=>He,writeBinaryFile:()=>Re,writeFile:()=>Le,writeTextFile:()=>Le});var O=(a=>(a[a.Audio=1]="Audio",a[a.Cache=2]="Cache",a[a.Config=3]="Config",a[a.Data=4]="Data",a[a.LocalData=5]="LocalData",a[a.Desktop=6]="Desktop",a[a.Document=7]="Document",a[a.Download=8]="Download",a[a.Executable=9]="Executable",a[a.Font=10]="Font",a[a.Home=11]="Home",a[a.Picture=12]="Picture",a[a.Public=13]="Public",a[a.Runtime=14]="Runtime",a[a.Template=15]="Template",a[a.Video=16]="Video",a[a.Resource=17]="Resource",a[a.App=18]="App",a[a.Log=19]="Log",a[a.Temp=20]="Temp",a[a.AppConfig=21]="AppConfig",a[a.AppData=22]="AppData",a[a.AppLocalData=23]="AppLocalData",a[a.AppCache=24]="AppCache",a[a.AppLog=25]="AppLog",a))(O||{});async function xe(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"readTextFile",path:n,options:e}})}async function Se(n,e={}){let t=await i({__tauriModule:"Fs",message:{cmd:"readFile",path:n,options:e}});return Uint8Array.from(t)}async function Le(n,e,t){typeof t=="object"&&Object.freeze(t),typeof n=="object"&&Object.freeze(n);let r={path:"",contents:""},s=t;return typeof n=="string"?r.path=n:(r.path=n.path,r.contents=n.contents),typeof e=="string"?r.contents=e??"":s=e,i({__tauriModule:"Fs",message:{cmd:"writeFile",path:r.path,contents:Array.from(new TextEncoder().encode(r.contents)),options:s}})}async function Re(n,e,t){typeof t=="object"&&Object.freeze(t),typeof n=="object"&&Object.freeze(n);let r={path:"",contents:[]},s=t;return typeof n=="string"?r.path=n:(r.path=n.path,r.contents=n.contents),e&&"dir"in e?s=e:typeof n=="string"&&(r.contents=e??[]),i({__tauriModule:"Fs",message:{cmd:"writeFile",path:r.path,contents:Array.from(r.contents instanceof ArrayBuffer?new Uint8Array(r.contents):r.contents),options:s}})}async function Ue(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"readDir",path:n,options:e}})}async function ke(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"createDir",path:n,options:e}})}async function Ie(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"removeDir",path:n,options:e}})}async function ze(n,e,t={}){return i({__tauriModule:"Fs",message:{cmd:"copyFile",source:n,destination:e,options:t}})}async function Ne(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"removeFile",path:n,options:e}})}async function He(n,e,t={}){return i({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:n,newPath:e,options:t}})}async function Ve(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"exists",path:n,options:e}})}var q={};c(q,{isRegistered:()=>Ge,register:()=>je,registerAll:()=>qe,unregister:()=>$e,unregisterAll:()=>Je});async function je(n,e){return i({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:n,handler:d(e)}})}async function qe(n,e){return i({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:n,handler:d(e)}})}async function Ge(n){return i({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:n}})}async function $e(n){return i({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:n}})}async function Je(){return i({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})}var $={};c($,{Body:()=>p,Client:()=>E,Response:()=>F,ResponseType:()=>re,fetch:()=>Ke,getClient:()=>se});var re=(r=>(r[r.JSON=1]="JSON",r[r.Text=2]="Text",r[r.Binary=3]="Binary",r))(re||{}),p=class{constructor(e,t){this.type=e,this.payload=t}static form(e){let t={};for(let r in e){let s=e[r],o;typeof s=="string"?o=s:s instanceof Uint8Array||Array.isArray(s)?o=Array.from(s):typeof s.file=="string"?o={file:s.file,mime:s.mime,fileName:s.fileName}:o={file:Array.from(s.file),mime:s.mime,fileName:s.fileName},t[r]=o}return new p("Form",t)}static json(e){return new p("Json",e)}static text(e){return new p("Text",e)}static bytes(e){return new p("Bytes",Array.from(e instanceof ArrayBuffer?new Uint8Array(e):e))}},F=class{constructor(e){this.url=e.url,this.status=e.status,this.ok=this.status>=200&&this.status<300,this.headers=e.headers,this.rawHeaders=e.rawHeaders,this.data=e.data}},E=class{constructor(e){this.id=e}async drop(){return i({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})}async request(e){let t=!e.responseType||e.responseType===1;return t&&(e.responseType=2),i({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(r=>{let s=new F(r);if(t){try{s.data=JSON.parse(s.data)}catch(o){if(s.ok&&s.data==="")s.data={};else if(s.ok)throw Error(`Failed to parse response \`${s.data}\` as JSON: ${o}; + try setting the \`responseType\` option to \`ResponseType.Text\` or \`ResponseType.Binary\` if the API does not return a JSON response.`)}return s}return s})}async get(e,t){return this.request({method:"GET",url:e,...t})}async post(e,t,r){return this.request({method:"POST",url:e,body:t,...r})}async put(e,t,r){return this.request({method:"PUT",url:e,body:t,...r})}async patch(e,t){return this.request({method:"PATCH",url:e,...t})}async delete(e,t){return this.request({method:"DELETE",url:e,...t})}};async function se(n){return i({__tauriModule:"Http",message:{cmd:"createClient",options:n}}).then(e=>new E(e))}var G=null;async function Ke(n,e){return G===null&&(G=await se()),G.request({url:n,method:(e==null?void 0:e.method)??"GET",...e})}var J={};c(J,{isPermissionGranted:()=>Qe,requestPermission:()=>Ze,sendNotification:()=>Ye});async function Qe(){return window.Notification.permission!=="default"?Promise.resolve(window.Notification.permission==="granted"):i({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}})}async function Ze(){return window.Notification.requestPermission()}function Ye(n){typeof n=="string"?new window.Notification(n):new window.Notification(n.title,n)}var K={};c(K,{BaseDirectory:()=>O,appCacheDir:()=>tt,appConfigDir:()=>ae,appDataDir:()=>Be,appDir:()=>Xe,appLocalDataDir:()=>et,appLogDir:()=>oe,audioDir:()=>nt,basename:()=>At,cacheDir:()=>it,configDir:()=>rt,dataDir:()=>st,delimiter:()=>vt,desktopDir:()=>at,dirname:()=>Ft,documentDir:()=>ot,downloadDir:()=>lt,executableDir:()=>ut,extname:()=>Et,fontDir:()=>ct,homeDir:()=>dt,isAbsolute:()=>Ct,join:()=>Ot,localDataDir:()=>mt,logDir:()=>Pt,normalize:()=>Tt,pictureDir:()=>pt,publicDir:()=>gt,resolve:()=>Mt,resolveResource:()=>yt,resourceDir:()=>ht,runtimeDir:()=>ft,sep:()=>wt,templateDir:()=>_t,videoDir:()=>bt});function b(){return navigator.appVersion.includes("Win")}async function Xe(){return ae()}async function ae(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:21}})}async function Be(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:22}})}async function et(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:23}})}async function tt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:24}})}async function nt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:1}})}async function it(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:2}})}async function rt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:3}})}async function st(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:4}})}async function at(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:6}})}async function ot(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:7}})}async function lt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:8}})}async function ut(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:9}})}async function ct(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:10}})}async function dt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:11}})}async function mt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:5}})}async function pt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:12}})}async function gt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:13}})}async function ht(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:17}})}async function yt(n){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:n,directory:17}})}async function ft(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:14}})}async function _t(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:15}})}async function bt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:16}})}async function Pt(){return oe()}async function oe(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:25}})}var wt=b()?"\\":"/",vt=b()?";":":";async function Mt(...n){return i({__tauriModule:"Path",message:{cmd:"resolve",paths:n}})}async function Tt(n){return i({__tauriModule:"Path",message:{cmd:"normalize",path:n}})}async function Ot(...n){return i({__tauriModule:"Path",message:{cmd:"join",paths:n}})}async function Ft(n){return i({__tauriModule:"Path",message:{cmd:"dirname",path:n}})}async function Et(n){return i({__tauriModule:"Path",message:{cmd:"extname",path:n}})}async function At(n,e){return i({__tauriModule:"Path",message:{cmd:"basename",path:n,ext:e}})}async function Ct(n){return i({__tauriModule:"Path",message:{cmd:"isAbsolute",path:n}})}var Q={};c(Q,{exit:()=>Dt,relaunch:()=>Wt});async function Dt(n=0){return i({__tauriModule:"Process",message:{cmd:"exit",exitCode:n}})}async function Wt(){return i({__tauriModule:"Process",message:{cmd:"relaunch"}})}var Z={};c(Z,{Child:()=>A,Command:()=>P,EventEmitter:()=>g,open:()=>St});async function xt(n,e,t=[],r){return typeof t=="object"&&Object.freeze(t),i({__tauriModule:"Shell",message:{cmd:"execute",program:e,args:t,options:r,onEventFn:d(n)}})}var g=class{constructor(){this.eventListeners=Object.create(null)}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}on(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}once(e,t){let r=(...s)=>{this.removeListener(e,r),t(...s)};return this.addListener(e,r)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter(r=>r!==t)),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,...t){if(e in this.eventListeners){let r=this.eventListeners[e];for(let s of r)s(...t);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,t){return e in this.eventListeners?this.eventListeners[e].unshift(t):this.eventListeners[e]=[t],this}prependOnceListener(e,t){let r=(...s)=>{this.removeListener(e,r),t(...s)};return this.prependListener(e,r)}},A=class{constructor(e){this.pid=e}async write(e){return i({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:typeof e=="string"?e:Array.from(e)}})}async kill(){return i({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})}},P=class extends g{constructor(t,r=[],s){super();this.stdout=new g;this.stderr=new g;this.program=t,this.args=typeof r=="string"?[r]:r,this.options=s??{}}static sidecar(t,r=[],s){let o=new P(t,r,s);return o.options.sidecar=!0,o}async spawn(){return xt(t=>{switch(t.event){case"Error":this.emit("error",t.payload);break;case"Terminated":this.emit("close",t.payload);break;case"Stdout":this.stdout.emit("data",t.payload);break;case"Stderr":this.stderr.emit("data",t.payload);break}},this.program,this.args,this.options).then(t=>new A(t))}async execute(){return new Promise((t,r)=>{this.on("error",r);let s=[],o=[];this.stdout.on("data",l=>{s.push(l)}),this.stderr.on("data",l=>{o.push(l)}),this.on("close",l=>{t({code:l.code,signal:l.signal,stdout:s.join(` +`),stderr:o.join(` +`)})}),this.spawn().catch(r)})}};async function St(n,e){return i({__tauriModule:"Shell",message:{cmd:"open",path:n,with:e}})}var X={};c(X,{checkUpdate:()=>Rt,installUpdate:()=>Lt,onUpdaterEvent:()=>Y});async function Y(n){return N("tauri://update-status",e=>{n(e==null?void 0:e.payload)})}async function Lt(){let n;function e(){n&&n(),n=void 0}return new Promise((t,r)=>{function s(o){if(o.error)return e(),r(o.error);if(o.status==="DONE")return e(),t()}Y(s).then(o=>{n=o}).catch(o=>{throw e(),o}),T("tauri://update-install").catch(o=>{throw e(),o})})}async function Rt(){let n;function e(){n&&n(),n=void 0}return new Promise((t,r)=>{function s(l){return e(),t({manifest:l,shouldUpdate:!0})}function o(l){if(l.error)return e(),r(l.error);if(l.status==="UPTODATE")return e(),t({shouldUpdate:!1})}H("tauri://update-available",l=>{s(l==null?void 0:l.payload)}).catch(l=>{throw e(),l}),Y(o).then(l=>{n=l}).catch(l=>{throw e(),l}),T("tauri://update").catch(l=>{throw e(),l})})}var te={};c(te,{CloseRequestedEvent:()=>S,LogicalPosition:()=>D,LogicalSize:()=>C,PhysicalPosition:()=>y,PhysicalSize:()=>h,UserAttentionType:()=>ue,WebviewWindow:()=>m,WebviewWindowHandle:()=>W,WindowManager:()=>x,appWindow:()=>B,availableMonitors:()=>zt,currentMonitor:()=>kt,getAll:()=>ce,getCurrent:()=>Ut,primaryMonitor:()=>It});var C=class{constructor(e,t){this.type="Logical";this.width=e,this.height=t}},h=class{constructor(e,t){this.type="Physical";this.width=e,this.height=t}toLogical(e){return new C(this.width/e,this.height/e)}},D=class{constructor(e,t){this.type="Logical";this.x=e,this.y=t}},y=class{constructor(e,t){this.type="Physical";this.x=e,this.y=t}toLogical(e){return new D(this.x/e,this.y/e)}},ue=(t=>(t[t.Critical=1]="Critical",t[t.Informational=2]="Informational",t))(ue||{});function Ut(){return new m(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function ce(){return window.__TAURI_METADATA__.__windows.map(n=>new m(n.label,{skip:!0}))}var le=["tauri://created","tauri://error"],W=class{constructor(e){this.label=e,this.listeners=Object.create(null)}async listen(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let r=this.listeners[e];r.splice(r.indexOf(t),1)}):_(e,this.label,t)}async once(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let r=this.listeners[e];r.splice(r.indexOf(t),1)}):v(e,this.label,t)}async emit(e,t){if(le.includes(e)){for(let r of this.listeners[e]||[])r({event:e,id:-1,windowLabel:this.label,payload:t});return Promise.resolve()}return w(e,this.label,t)}_handleTauriEvent(e,t){return le.includes(e)?(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0):!1}},x=class extends W{async scaleFactor(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})}async innerPosition(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(({x:e,y:t})=>new y(e,t))}async outerPosition(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:e,y:t})=>new y(e,t))}async innerSize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:e,height:t})=>new h(e,t))}async outerSize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:e,height:t})=>new h(e,t))}async isFullscreen(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}async isMaximized(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})}async isDecorated(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})}async isResizable(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})}async isVisible(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})}async theme(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})}async center(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})}async requestUserAttention(e){let t=null;return e&&(e===1?t={type:"Critical"}:t={type:"Informational"}),i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:t}}}})}async setResizable(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:e}}}})}async setTitle(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:e}}}})}async maximize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})}async unmaximize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})}async toggleMaximize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})}async minimize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})}async unminimize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})}async show(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})}async hide(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})}async close(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})}async setDecorations(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:e}}}})}async setAlwaysOnTop(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:e}}}})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:e.type,data:{width:e.width,height:e.height}}}}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setFullscreen(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:e}}}})}async setFocus(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})}async setIcon(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:typeof e=="string"?e:Array.from(e)}}}}})}async setSkipTaskbar(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:e}}}})}async setCursorGrab(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:e}}}})}async setCursorVisible(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:e}}}})}async setCursorIcon(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorIcon",payload:e}}}})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setIgnoreCursorEvents(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:e}}}})}async startDragging(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})}async onResized(e){return this.listen("tauri://resize",e)}async onMoved(e){return this.listen("tauri://move",e)}async onCloseRequested(e){return this.listen("tauri://close-requested",t=>{let r=new S(t);Promise.resolve(e(r)).then(()=>{if(!r.isPreventDefault())return this.close()})})}async onFocusChanged(e){let t=await this.listen("tauri://focus",s=>{e({...s,payload:!0})}),r=await this.listen("tauri://blur",s=>{e({...s,payload:!1})});return()=>{t(),r()}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let t=await this.listen("tauri://file-drop",o=>{e({...o,payload:{type:"drop",paths:o.payload}})}),r=await this.listen("tauri://file-drop-hover",o=>{e({...o,payload:{type:"hover",paths:o.payload}})}),s=await this.listen("tauri://file-drop-cancelled",o=>{e({...o,payload:{type:"cancel"}})});return()=>{t(),r(),s()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},S=class{constructor(e){this._preventDefault=!1;this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}},m=class extends x{constructor(e,t={}){super(e),t!=null&&t.skip||i({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:{label:e,...t}}}}).then(async()=>this.emit("tauri://created")).catch(async r=>this.emit("tauri://error",r))}static getByLabel(e){return ce().some(t=>t.label===e)?new m(e,{skip:!0}):null}},B;"__TAURI_METADATA__"in window?B=new m(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label. +Note that this is not an issue if running this frontend on a browser instead of a Tauri window.`),B=new m("main",{skip:!0}));function ee(n){return n===null?null:{name:n.name,scaleFactor:n.scaleFactor,position:new y(n.position.x,n.position.y),size:new h(n.size.width,n.size.height)}}async function kt(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(ee)}async function It(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(ee)}async function zt(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then(n=>n.map(ee))}var ne={};c(ne,{EOL:()=>Nt,arch:()=>qt,platform:()=>Ht,tempdir:()=>Gt,type:()=>jt,version:()=>Vt});var Nt=b()?`\r +`:` +`;async function Ht(){return i({__tauriModule:"Os",message:{cmd:"platform"}})}async function Vt(){return i({__tauriModule:"Os",message:{cmd:"version"}})}async function jt(){return i({__tauriModule:"Os",message:{cmd:"osType"}})}async function qt(){return i({__tauriModule:"Os",message:{cmd:"arch"}})}async function Gt(){return i({__tauriModule:"Os",message:{cmd:"tempdir"}})}var $t=f;return he(Jt);})(); +window.__TAURI__ = __TAURI_IIFE__ diff --git a/core/tauri/scripts/bundle.js b/core/tauri/scripts/bundle.js deleted file mode 100644 index d97008fb7..000000000 --- a/core/tauri/scripts/bundle.js +++ /dev/null @@ -1 +0,0 @@ -function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,n=_getPrototypeOf(e);if(t){var a=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(u&&s){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),R(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;R(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:x(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}("object"===("undefined"==typeof module?"undefined":_typeof(module))?module.exports:{});try{regeneratorRuntime=t}catch(e){"object"===("undefined"==typeof globalThis?"undefined":_typeof(globalThis))?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}function r(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]&&arguments[1],a=n(),o="_".concat(a);return Object.defineProperty(window,o,{value:function(n){return t&&Reflect.deleteProperty(window,o),r([e,"optionalCall",function(e){return e(n)}])},writable:!1,configurable:!0}),a}function o(e){return i.apply(this,arguments)}function i(){return i=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",new Promise((function(e,n){var o=a((function(t){e(t),Reflect.deleteProperty(window,"_".concat(i))}),!0),i=a((function(e){n(e),Reflect.deleteProperty(window,"_".concat(o))}),!0);window.__TAURI_IPC__(_objectSpread({cmd:t,callback:o,error:i},r))})));case 2:case"end":return e.stop()}}),e)}))),i.apply(this,arguments)}var u=Object.freeze({__proto__:null,transformCallback:a,invoke:o,convertFileSrc:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asset",r=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?"https://".concat(t,".localhost/").concat(r):"".concat(t,"://").concat(r)}});function s(e){return c.apply(this,arguments)}function c(){return(c=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o("tauri",t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(){return(p=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(){return(l=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppName"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(){return(f=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getTauriVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var h=Object.freeze({__proto__:null,getName:function(){return l.apply(this,arguments)},getVersion:function(){return p.apply(this,arguments)},getTauriVersion:function(){return f.apply(this,arguments)}});function d(){return(d=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Cli",message:{cmd:"cliMatches"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var m=Object.freeze({__proto__:null,getMatches:function(){return d.apply(this,arguments)}});function _(){return(_=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function y(){return(y=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var g=Object.freeze({__proto__:null,writeText:function(e){return _.apply(this,arguments)},readText:function(){return y.apply(this,arguments)}});function v(e){for(var t=void 0,r=e[0],n=1;n0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}}));case 3:case"end":return e.stop()}}),e)}))),w.apply(this,arguments)}function b(){return b=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,r=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(t=r.length>0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}}));case 3:case"end":return e.stop()}}),e)}))),b.apply(this,arguments)}function R(){return R=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof r?{title:r}:r,e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:t.toString(),title:v([n,"optionalAccess",function(e){return e.title},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),type:v([n,"optionalAccess",function(e){return e.type}])}}));case 2:case"end":return e.stop()}}),e)}))),R.apply(this,arguments)}function k(){return k=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof r?{title:r}:r,e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"askDialog",message:t.toString(),title:v([n,"optionalAccess",function(e){return e.title},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),type:v([n,"optionalAccess",function(e){return e.type}])}}));case 2:case"end":return e.stop()}}),e)}))),k.apply(this,arguments)}function x(){return x=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof r?{title:r}:r,e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:t.toString(),title:v([n,"optionalAccess",function(e){return e.title},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),type:v([n,"optionalAccess",function(e){return e.type}])}}));case 2:case"end":return e.stop()}}),e)}))),x.apply(this,arguments)}var T,G=Object.freeze({__proto__:null,open:function(){return w.apply(this,arguments)},save:function(){return b.apply(this,arguments)},message:function(e,t){return R.apply(this,arguments)},ask:function(e,t){return k.apply(this,arguments)},confirm:function(e,t){return x.apply(this,arguments)}});function P(e,t){return O.apply(this,arguments)}function O(){return O=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"unlisten",event:t,eventId:r}}));case 1:case"end":return e.stop()}}),e)}))),O.apply(this,arguments)}function M(e,t,r){return A.apply(this,arguments)}function A(){return A=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s({__tauriModule:"Event",message:{cmd:"emit",event:t,windowLabel:r,payload:"string"==typeof n?n:JSON.stringify(n)}});case 2:case"end":return e.stop()}}),e)}))),A.apply(this,arguments)}function E(e,t,r){return L.apply(this,arguments)}function L(){return L=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"listen",event:t,windowLabel:r,handler:a(n)}}).then((function(e){return _asyncToGenerator(_regeneratorRuntime().mark((function r(){return _regeneratorRuntime().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",P(t,e));case 1:case"end":return r.stop()}}),r)})))})));case 1:case"end":return e.stop()}}),e)}))),L.apply(this,arguments)}function D(e,t,r){return C.apply(this,arguments)}function C(){return C=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",E(t,r,(function(e){n(e),P(t,e.id).catch((function(){}))})));case 1:case"end":return e.stop()}}),e)}))),C.apply(this,arguments)}function S(e,t){return j.apply(this,arguments)}function j(){return j=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",E(t,null,r));case 1:case"end":return e.stop()}}),e)}))),j.apply(this,arguments)}function W(e,t){return N.apply(this,arguments)}function N(){return N=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",D(t,null,r));case 1:case"end":return e.stop()}}),e)}))),N.apply(this,arguments)}function I(e,t){return z.apply(this,arguments)}function z(){return z=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",M(t,void 0,r));case 1:case"end":return e.stop()}}),e)}))),z.apply(this,arguments)}!function(e){e.WINDOW_RESIZED="tauri://resize";e.WINDOW_MOVED="tauri://move";e.WINDOW_CLOSE_REQUESTED="tauri://close-requested";e.WINDOW_CREATED="tauri://window-created";e.WINDOW_DESTROYED="tauri://destroyed";e.WINDOW_FOCUS="tauri://focus";e.WINDOW_BLUR="tauri://blur";e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change";e.WINDOW_THEME_CHANGED="tauri://theme-changed";e.WINDOW_FILE_DROP="tauri://file-drop";e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover";e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled";e.MENU="tauri://menu";e.CHECK_UPDATE="tauri://update";e.UPDATE_AVAILABLE="tauri://update-available";e.INSTALL_UPDATE="tauri://update-install";e.STATUS_UPDATE="tauri://update-status";e.DOWNLOAD_PROGRESS="tauri://update-download-progress"}(T||(T={}));var F,U=Object.freeze({__proto__:null,listen:S,once:W,emit:I});function H(e,t){return null!=e?e:t()}function V(){return V=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),V.apply(this,arguments)}function B(){return B=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},e.next=3,s({__tauriModule:"Fs",message:{cmd:"readFile",path:t,options:r}});case 3:return n=e.sent,e.abrupt("return",Uint8Array.from(n));case 5:case"end":return e.stop()}}),e)}))),B.apply(this,arguments)}function q(e,t,r){return J.apply(this,arguments)}function J(){return J=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){var a,o;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(n)&&Object.freeze(n),"object"===_typeof(t)&&Object.freeze(t),a={path:"",contents:""},o=n,"string"==typeof t?a.path=t:(a.path=t.path,a.contents=t.contents),"string"==typeof r?a.contents=H(r,(function(){return""})):o=r,e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:a.path,contents:Array.from((new TextEncoder).encode(a.contents)),options:o}}));case 7:case"end":return e.stop()}}),e)}))),J.apply(this,arguments)}function K(){return K=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){var a,o;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(n)&&Object.freeze(n),"object"===_typeof(t)&&Object.freeze(t),a={path:"",contents:[]},o=n,"string"==typeof t?a.path=t:(a.path=t.path,a.contents=t.contents),r&&"dir"in r?o=r:"string"==typeof t&&(a.contents=H(r,(function(){return[]}))),e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:a.path,contents:Array.from(a.contents instanceof ArrayBuffer?new Uint8Array(a.contents):a.contents),options:o}}));case 7:case"end":return e.stop()}}),e)}))),K.apply(this,arguments)}function Y(){return Y=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),Y.apply(this,arguments)}function Q(){return Q=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),Q.apply(this,arguments)}function Z(){return Z=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),Z.apply(this,arguments)}function $(){return $=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:r,options:n}}));case 2:case"end":return e.stop()}}),e)}))),$.apply(this,arguments)}function X(){return X=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),X.apply(this,arguments)}function ee(){return ee=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:r,options:n}}));case 2:case"end":return e.stop()}}),e)}))),ee.apply(this,arguments)}!function(e){e[e.Audio=1]="Audio";e[e.Cache=2]="Cache";e[e.Config=3]="Config";e[e.Data=4]="Data";e[e.LocalData=5]="LocalData";e[e.Desktop=6]="Desktop";e[e.Document=7]="Document";e[e.Download=8]="Download";e[e.Executable=9]="Executable";e[e.Font=10]="Font";e[e.Home=11]="Home";e[e.Picture=12]="Picture";e[e.Public=13]="Public";e[e.Runtime=14]="Runtime";e[e.Template=15]="Template";e[e.Video=16]="Video";e[e.Resource=17]="Resource";e[e.App=18]="App";e[e.Log=19]="Log";e[e.Temp=20]="Temp"}(F||(F={}));var te=Object.freeze({__proto__:null,get BaseDirectory(){return F},get Dir(){return F},readTextFile:function(e){return V.apply(this,arguments)},readBinaryFile:function(e){return B.apply(this,arguments)},writeTextFile:q,writeFile:q,writeBinaryFile:function(e,t,r){return K.apply(this,arguments)},readDir:function(e){return Y.apply(this,arguments)},createDir:function(e){return Q.apply(this,arguments)},removeDir:function(e){return Z.apply(this,arguments)},copyFile:function(e,t){return $.apply(this,arguments)},removeFile:function(e){return X.apply(this,arguments)},renameFile:function(e,t){return ee.apply(this,arguments)}});function re(){return(re=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ne(){return(ne=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ae(){return(ae=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function oe(){return(oe=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ie(){return(ie=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ue,se=Object.freeze({__proto__:null,register:function(e,t){return re.apply(this,arguments)},registerAll:function(e,t){return ne.apply(this,arguments)},isRegistered:function(e){return ae.apply(this,arguments)},unregister:function(e){return oe.apply(this,arguments)},unregisterAll:function(){return ie.apply(this,arguments)}});function ce(e,t){return null!=e?e:t()}function pe(e){for(var t=void 0,r=e[0],n=1;n=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data})),he=function(){function e(t){_classCallCheck(this,e),this.id=t}var t,r,n,a,o,i,u;return _createClass(e,[{key:"drop",value:(u=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"request",value:(i=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=!t.responseType||t.responseType===ue.JSON)&&(t.responseType=ue.Text),e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}}).then((function(e){var t=new fe(e);if(r){try{t.data=JSON.parse(t.data)}catch(e){if(t.ok&&""===t.data)t.data={};else if(t.ok)throw Error("Failed to parse response `".concat(t.data,"` as JSON: ").concat(e,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return t}return t})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"get",value:(o=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"GET",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"post",value:(a=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"POST",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return a.apply(this,arguments)})},{key:"put",value:(n=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PUT",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"patch",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PATCH",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"delete",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"DELETE",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function de(e){return me.apply(this,arguments)}function me(){return(me=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then((function(e){return new he(e)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _e=null;function ye(){return(ye=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==_e){e.next=4;break}return e.next=3,de();case 3:_e=e.sent;case 4:return e.abrupt("return",_e.request(_objectSpread({url:t,method:ce(pe([r,"optionalAccess",function(e){return e.method}]),(function(){return"GET"}))},r)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ge=Object.freeze({__proto__:null,getClient:de,fetch:function(e,t){return ye.apply(this,arguments)},Body:le,Client:he,Response:fe,get ResponseType(){return ue}});function ve(){return(ve=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("default"===window.Notification.permission){e.next=2;break}return e.abrupt("return",Promise.resolve("granted"===window.Notification.permission));case 2:return e.abrupt("return",s({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function we(){return(we=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.Notification.requestPermission());case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var be=Object.freeze({__proto__:null,sendNotification:function(e){"string"==typeof e?new window.Notification(e):new window.Notification(e.title,e)},requestPermission:function(){return we.apply(this,arguments)},isPermissionGranted:function(){return ve.apply(this,arguments)}});function Re(){return navigator.appVersion.includes("Win")}function ke(){return(ke=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.App}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xe(){return(xe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Audio}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Te(){return(Te=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Cache}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ge(){return(Ge=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Config}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pe(){return(Pe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Data}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Oe(){return(Oe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Desktop}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Me(){return(Me=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Document}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ae(){return(Ae=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Download}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ee(){return(Ee=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Executable}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Le(){return(Le=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Font}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function De(){return(De=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Home}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ce(){return(Ce=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.LocalData}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Se(){return(Se=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Picture}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function je(){return(je=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Public}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function We(){return(We=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Resource}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ne(){return(Ne=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:t,directory:F.Resource}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ie(){return(Ie=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Runtime}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ze(){return(ze=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Template}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Fe(){return(Fe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Video}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ue(){return(Ue=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Log}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var He=Re()?"\\":"/",Ve=Re()?";":":";function Be(){return Be=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,r,n,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=a.length,r=new Array(t),n=0;n0&&void 0!==r[0]?r[0]:0,e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"exit",exitCode:t}}));case 2:case"end":return e.stop()}}),e)}))),Xe.apply(this,arguments)}function et(){return(et=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"relaunch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var tt=Object.freeze({__proto__:null,exit:function(){return Xe.apply(this,arguments)},relaunch:function(){return et.apply(this,arguments)}});function rt(e,t){return null!=e?e:t()}function nt(e,t){return at.apply(this,arguments)}function at(){return at=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n,o,i=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>2&&void 0!==i[2]?i[2]:[],o=i.length>3?i[3]:void 0,"object"===_typeof(n)&&Object.freeze(n),e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"execute",program:r,args:n,options:o,onEventFn:a(t)}}));case 4:case"end":return e.stop()}}),e)}))),at.apply(this,arguments)}var ot=function(){function e(){_classCallCheck(this,e),e.prototype.__init.call(this)}return _createClass(e,[{key:"__init",value:function(){this.eventListeners=Object.create(null)}},{key:"addListener",value:function(e,t){return this.on(e,t)}},{key:"removeListener",value:function(e,t){return this.off(e,t)}},{key:"on",value:function(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}},{key:"once",value:function(e,t){var r=this;return this.addListener(e,(function n(){r.removeListener(e,n),t.apply(void 0,arguments)}))}},{key:"off",value:function(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter((function(e){return e!==t}))),this}},{key:"removeAllListeners",value:function(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}},{key:"emit",value:function(e){if(e in this.eventListeners){for(var t=this.eventListeners[e],r=arguments.length,n=new Array(r>1?r-1:0),a=1;a1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2?arguments[2]:void 0;return _classCallCheck(this,a),t=n.call(this),a.prototype.__init2.call(_assertThisInitialized(t)),a.prototype.__init3.call(_assertThisInitialized(t)),t.program=e,t.args="string"==typeof r?[r]:r,t.options=rt(o,(function(){return{}})),t}return _createClass(a,[{key:"__init2",value:function(){this.stdout=new ot}},{key:"__init3",value:function(){this.stderr=new ot}},{key:"spawn",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",nt((function(e){switch(e.event){case"Error":t.emit("error",e.payload);break;case"Terminated":t.emit("close",e.payload);break;case"Stdout":t.stdout.emit("data",e.payload);break;case"Stderr":t.stderr.emit("data",e.payload)}}),this.program,this.args,this.options).then((function(e){return new it(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"execute",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){t.on("error",r);var n=[],a=[];t.stdout.on("data",(function(e){n.push(e)})),t.stderr.on("data",(function(e){a.push(e)})),t.on("close",(function(t){e({code:t.code,signal:t.signal,stdout:n.join("\n"),stderr:a.join("\n")})})),t.spawn().catch(r)})));case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}],[{key:"sidecar",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=new a(e,t,r);return n.options.sidecar=!0,n}}]),a}(ot);function st(){return st=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"open",path:t,with:r}}));case 1:case"end":return e.stop()}}),e)}))),st.apply(this,arguments)}var ct=Object.freeze({__proto__:null,Command:ut,Child:it,EventEmitter:ot,open:function(e,t){return st.apply(this,arguments)}});function pt(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck(this,r),n=t.call(this,e),_t([a,"optionalAccess",function(e){return e.skip}])||s({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:_objectSpread({label:e},a)}}}).then(_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://created"));case 1:case"end":return e.stop()}}),e)})))).catch(function(){var e=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://error",t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),n}return _createClass(r,null,[{key:"getByLabel",value:function(e){return Rt().some((function(t){return t.label===e}))?new r(e,{skip:!0}):null}}]),r}(Gt);function Mt(){return(Mt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function At(){return(At=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Et(){return(Et=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}"__TAURI_METADATA__"in window?kt=new Ot(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn('Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.'),kt=new Ot("main",{skip:!0}));var Lt=Object.freeze({__proto__:null,WebviewWindow:Ot,WebviewWindowHandle:Tt,WindowManager:Gt,CloseRequestedEvent:Pt,getCurrent:function(){return new Ot(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})},getAll:Rt,get appWindow(){return kt},LogicalSize:gt,PhysicalSize:vt,LogicalPosition:wt,PhysicalPosition:bt,get UserAttentionType(){return yt},currentMonitor:function(){return Mt.apply(this,arguments)},primaryMonitor:function(){return At.apply(this,arguments)},availableMonitors:function(){return Et.apply(this,arguments)}}),Dt=Re()?"\r\n":"\n";function Ct(){return(Ct=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"platform"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function St(){return(St=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"version"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jt(){return(jt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"osType"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Wt(){return(Wt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"arch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nt(){return(Nt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"tempdir"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var It=Object.freeze({__proto__:null,EOL:Dt,platform:function(){return Ct.apply(this,arguments)},version:function(){return St.apply(this,arguments)},type:function(){return jt.apply(this,arguments)},arch:function(){return Wt.apply(this,arguments)},tempdir:function(){return Nt.apply(this,arguments)}}),zt=o;e.app=h,e.cli=m,e.clipboard=g,e.dialog=G,e.event=U,e.fs=te,e.globalShortcut=se,e.http=ge,e.invoke=zt,e.notification=be,e.os=It,e.path=$e,e.process=tt,e.shell=ct,e.tauri=u,e.updater=mt,e.window=Lt,Object.defineProperty(e,"__esModule",{value:!0})})); diff --git a/core/tauri/scripts/pattern.js b/core/tauri/scripts/pattern.js index 7112414e4..aa64661ca 100644 --- a/core/tauri/scripts/pattern.js +++ b/core/tauri/scripts/pattern.js @@ -7,8 +7,8 @@ const props = Object.getOwnPropertyNames(object) for (const prop of props) { - if (typeof object[name] === 'object') { - __tauriDeepFreeze(object[name]) + if (typeof object[prop] === 'object') { + __tauriDeepFreeze(object[prop]) } } diff --git a/core/tauri/src/api/dir.rs b/core/tauri/src/api/dir.rs index 8a37fd903..771a8925e 100644 --- a/core/tauri/src/api/dir.rs +++ b/core/tauri/src/api/dir.rs @@ -6,7 +6,7 @@ use serde::Serialize; use std::{ - fs::{self, metadata}, + fs::{self, metadata, symlink_metadata}, path::{Path, PathBuf}, }; use tempfile::{self, tempdir}; @@ -31,8 +31,36 @@ pub fn is_dir>(path: P) -> crate::api::Result { metadata(path).map(|md| md.is_dir()).map_err(Into::into) } +fn is_symlink>(path: P) -> crate::api::Result { + // TODO: remove the different implementation once we raise tauri's MSRV to at least 1.58 + #[cfg(windows)] + let ret = symlink_metadata(path) + .map(|md| md.is_symlink()) + .map_err(Into::into); + + #[cfg(not(windows))] + let ret = symlink_metadata(path) + .map(|md| md.file_type().is_symlink()) + .map_err(Into::into); + + ret +} + /// Reads a directory. Can perform recursive operations. pub fn read_dir>(path: P, recursive: bool) -> crate::api::Result> { + read_dir_with_options(path, recursive, ReadDirOptions { scope: None }) +} + +#[derive(Clone, Copy)] +pub(crate) struct ReadDirOptions<'a> { + pub scope: Option<&'a crate::FsScope>, +} + +pub(crate) fn read_dir_with_options>( + path: P, + recursive: bool, + options: ReadDirOptions<'_>, +) -> crate::api::Result> { let mut files_and_dirs: Vec = vec![]; for entry in fs::read_dir(path)? { let path = entry?.path(); @@ -42,11 +70,16 @@ pub fn read_dir>(path: P, recursive: bool) -> crate::api::Result< files_and_dirs.push(DiskEntry { path: path.clone(), children: if flag { - Some(if recursive { - read_dir(&path_as_string, true)? - } else { - vec![] - }) + Some( + if recursive + && (!is_symlink(&path_as_string)? + || options.scope.map(|s| s.is_allowed(&path)).unwrap_or(true)) + { + read_dir_with_options(&path_as_string, true, options)? + } else { + vec![] + }, + ) } else { None }, diff --git a/core/tauri/src/api/file.rs b/core/tauri/src/api/file.rs index c4a461b49..ee88284a0 100644 --- a/core/tauri/src/api/file.rs +++ b/core/tauri/src/api/file.rs @@ -74,6 +74,7 @@ pub fn read_binary>(file: P) -> crate::api::Result> { #[cfg(test)] mod test { use super::*; + #[cfg(not(windows))] use crate::api::Error; use quickcheck::{Arbitrary, Gen}; diff --git a/core/tauri/src/api/http.rs b/core/tauri/src/api/http.rs index 97e38cdbe..feae38191 100644 --- a/core/tauri/src/api/http.rs +++ b/core/tauri/src/api/http.rs @@ -599,7 +599,7 @@ impl Response { /// # Examples /// /// ```no_run - /// use futures::StreamExt; + /// use futures_util::StreamExt; /// /// # async fn run() -> Result<(), Box> { /// let client = tauri::api::http::ClientBuilder::new().build()?; @@ -617,8 +617,8 @@ impl Response { #[allow(dead_code)] pub(crate) fn bytes_stream( self, - ) -> impl futures::Stream> { - use futures::StreamExt; + ) -> impl futures_util::Stream> { + use futures_util::StreamExt; self.1.bytes_stream().map(|res| res.map_err(Into::into)) } diff --git a/core/tauri/src/api/path.rs b/core/tauri/src/api/path.rs index 3bef9dd5b..dc73389da 100644 --- a/core/tauri/src/api/path.rs +++ b/core/tauri/src/api/path.rs @@ -13,61 +13,94 @@ use crate::{Config, Env, PackageInfo}; use serde_repr::{Deserialize_repr, Serialize_repr}; -/// A base directory to be used in [`resolve_path`]. -/// -/// The base directory is the optional root of a file system operation. -/// If informed by the API call, all paths will be relative to the path of the given directory. -/// -/// For more information, check the [`dirs_next` documentation](https://docs.rs/dirs_next/). -#[derive(Serialize_repr, Deserialize_repr, Clone, Copy, Debug)] -#[repr(u16)] -#[non_exhaustive] -pub enum BaseDirectory { - /// The Audio directory. - Audio = 1, - /// The Cache directory. - Cache, - /// The Config directory. - Config, - /// The Data directory. - Data, - /// The LocalData directory. - LocalData, - /// The Desktop directory. - Desktop, - /// The Document directory. - Document, - /// The Download directory. - Download, - /// The Executable directory. - Executable, - /// The Font directory. - Font, - /// The Home directory. - Home, - /// The Picture directory. - Picture, - /// The Public directory. - Public, - /// The Runtime directory. - Runtime, - /// The Template directory. - Template, - /// The Video directory. - Video, - /// The Resource directory. - Resource, - /// The default App config directory. - /// Resolves to [`BaseDirectory::Config`]. - App, - /// The Log directory. - /// Resolves to `BaseDirectory::Home/Library/Logs/{bundle_identifier}` on macOS - /// and `BaseDirectory::Config/{bundle_identifier}/logs` on linux and windows. - Log, - /// A temporary directory. - /// Resolves to [`temp_dir`]. - Temp, +// we have to wrap the BaseDirectory enum in a module for #[allow(deprecated)] +// to work, because the procedural macros on the enum prevent it from working directly +// TODO: remove this workaround in v2 along with deprecated variants +#[allow(deprecated)] +mod base_directory { + use super::*; + + /// A base directory to be used in [`resolve_path`]. + /// + /// The base directory is the optional root of a file system operation. + /// If informed by the API call, all paths will be relative to the path of the given directory. + /// + /// For more information, check the [`dirs_next` documentation](https://docs.rs/dirs_next/). + #[derive(Serialize_repr, Deserialize_repr, Clone, Copy, Debug)] + #[repr(u16)] + #[non_exhaustive] + pub enum BaseDirectory { + /// The Audio directory. + Audio = 1, + /// The Cache directory. + Cache, + /// The Config directory. + Config, + /// The Data directory. + Data, + /// The LocalData directory. + LocalData, + /// The Desktop directory. + Desktop, + /// The Document directory. + Document, + /// The Download directory. + Download, + /// The Executable directory. + Executable, + /// The Font directory. + Font, + /// The Home directory. + Home, + /// The Picture directory. + Picture, + /// The Public directory. + Public, + /// The Runtime directory. + Runtime, + /// The Template directory. + Template, + /// The Video directory. + Video, + /// The Resource directory. + Resource, + /// The default app config directory. + /// Resolves to [`BaseDirectory::Config`]`/{bundle_identifier}`. + #[deprecated( + since = "1.2.0", + note = "Will be removed in 2.0.0. Use `BaseDirectory::AppConfig` or BaseDirectory::AppData` instead." + )] + App, + /// The default app log directory. + /// Resolves to [`BaseDirectory::Home`]`/Library/Logs/{bundle_identifier}` on macOS + /// and [`BaseDirectory::Config`]`/{bundle_identifier}/logs` on linux and Windows. + #[deprecated( + since = "1.2.0", + note = "Will be removed in 2.0.0. Use `BaseDirectory::AppLog` instead." + )] + Log, + /// A temporary directory. + /// Resolves to [`temp_dir`]. + Temp, + /// The default app config directory. + /// Resolves to [`BaseDirectory::Config`]`/{bundle_identifier}`. + AppConfig, + /// The default app data directory. + /// Resolves to [`BaseDirectory::Data`]`/{bundle_identifier}`. + AppData, + /// The default app local data directory. + /// Resolves to [`BaseDirectory::LocalData`]`/{bundle_identifier}`. + AppLocalData, + /// The default app cache directory. + /// Resolves to [`BaseDirectory::Cache`]`/{bundle_identifier}`. + AppCache, + /// The default app log directory. + /// Resolves to [`BaseDirectory::Home`]`/Library/Logs/{bundle_identifier}` on macOS + /// and [`BaseDirectory::Config`]`/{bundle_identifier}/logs` on linux and Windows. + AppLog, + } } +pub use base_directory::BaseDirectory; impl BaseDirectory { /// Gets the variable that represents this [`BaseDirectory`] for string paths. @@ -90,9 +123,16 @@ impl BaseDirectory { Self::Template => "$TEMPLATE", Self::Video => "$VIDEO", Self::Resource => "$RESOURCE", + #[allow(deprecated)] Self::App => "$APP", + #[allow(deprecated)] Self::Log => "$LOG", Self::Temp => "$TEMP", + Self::AppConfig => "$APPCONFIG", + Self::AppData => "$APPDATA", + Self::AppLocalData => "$APPLOCALDATA", + Self::AppCache => "$APPCACHE", + Self::AppLog => "$APPLOG", } } @@ -116,9 +156,16 @@ impl BaseDirectory { "$TEMPLATE" => Self::Template, "$VIDEO" => Self::Video, "$RESOURCE" => Self::Resource, + #[allow(deprecated)] "$APP" => Self::App, + #[allow(deprecated)] "$LOG" => Self::Log, "$TEMP" => Self::Temp, + "$APPCONFIG" => Self::AppConfig, + "$APPDATA" => Self::AppData, + "$APPLOCALDATA" => Self::AppLocalData, + "$APPCACHE" => Self::AppCache, + "$APPLOG" => Self::AppLog, _ => return None, }; Some(res) @@ -192,7 +239,7 @@ pub fn parse>( /// context.package_info(), /// &Env::default(), /// "db/tauri.sqlite", -/// Some(BaseDirectory::App)) +/// Some(BaseDirectory::AppData)) /// .expect("failed to resolve path"); /// assert_eq!(path.to_str().unwrap(), "/home/${whoami}/.config/com.tauri.app/db/tauri.sqlite"); /// @@ -242,9 +289,16 @@ pub fn resolve_path>( BaseDirectory::Template => template_dir(), BaseDirectory::Video => video_dir(), BaseDirectory::Resource => resource_dir(package_info, env), - BaseDirectory::App => app_dir(config), - BaseDirectory::Log => log_dir(config), + #[allow(deprecated)] + BaseDirectory::App => app_config_dir(config), + #[allow(deprecated)] + BaseDirectory::Log => app_log_dir(config), BaseDirectory::Temp => Some(temp_dir()), + BaseDirectory::AppConfig => app_config_dir(config), + BaseDirectory::AppData => app_data_dir(config), + BaseDirectory::AppLocalData => app_local_data_dir(config), + BaseDirectory::AppCache => app_cache_dir(config), + BaseDirectory::AppLog => app_log_dir(config), }; if let Some(mut base_dir_path_value) = base_dir_path { // use the same path resolution mechanism as the bundler's resource injection algorithm @@ -336,7 +390,7 @@ pub fn local_data_dir() -> Option { /// ## Platform-specific /// /// - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_DESKTOP_DIR`. -/// - **macOS:** Resolves to `$HOME/Library/Desktop`. +/// - **macOS:** Resolves to `$HOME/Desktop`. /// - **Windows:** Resolves to `{FOLDERID_Desktop}`. pub fn desktop_dir() -> Option { dirs_next::desktop_dir() @@ -459,25 +513,52 @@ pub fn resource_dir(package_info: &PackageInfo, env: &Env) -> Option { crate::utils::platform::resource_dir(package_info, env).ok() } -/// Returns the path to the suggested directory for your app config files. +/// Returns the path to the suggested directory for your app's config files. /// -/// Resolves to `${config_dir}/${bundle_identifier}`. +/// Resolves to [`config_dir`]`/${bundle_identifier}`. /// -/// See [`PathResolver::app_dir`](crate::PathResolver#method.app_dir) for a more convenient helper function. -pub fn app_dir(config: &Config) -> Option { +/// See [`PathResolver::app_config_dir`](crate::PathResolver#method.app_config_dir) for a more convenient helper function. +pub fn app_config_dir(config: &Config) -> Option { dirs_next::config_dir().map(|dir| dir.join(&config.tauri.bundle.identifier)) } -/// Returns the path to the suggested log directory. +/// Returns the path to the suggested directory for your app's data files. +/// +/// Resolves to [`data_dir`]`/${bundle_identifier}`. +/// +/// See [`PathResolver::app_data_dir`](crate::PathResolver#method.app_data_dir) for a more convenient helper function. +pub fn app_data_dir(config: &Config) -> Option { + dirs_next::data_dir().map(|dir| dir.join(&config.tauri.bundle.identifier)) +} + +/// Returns the path to the suggested directory for your app's local data files. +/// +/// Resolves to [`local_data_dir`]`/${bundle_identifier}`. +/// +/// See [`PathResolver::app_data_dir`](crate::PathResolver#method.app_data_dir) for a more convenient helper function. +pub fn app_local_data_dir(config: &Config) -> Option { + dirs_next::data_local_dir().map(|dir| dir.join(&config.tauri.bundle.identifier)) +} + +/// Returns the path to the suggested directory for your app's cache files. +/// +/// Resolves to [`cache_dir`]`/${bundle_identifier}`. +/// +/// See [`PathResolver::app_cache_dir`](crate::PathResolver#method.app_cache_dir) for a more convenient helper function. +pub fn app_cache_dir(config: &Config) -> Option { + dirs_next::cache_dir().map(|dir| dir.join(&config.tauri.bundle.identifier)) +} + +/// Returns the path to the suggested directory for your app's log files. /// /// ## Platform-specific /// -/// - **Linux:** Resolves to `${config_dir}/${bundle_identifier}`. -/// - **macOS:** Resolves to `${home_dir}//Library/Logs/{bundle_identifier}` -/// - **Windows:** Resolves to `${config_dir}/${bundle_identifier}`. +/// - **Linux:** Resolves to [`config_dir`]`/${bundle_identifier}/logs`. +/// - **macOS:** Resolves to [`home_dir`]`/Library/Logs/${bundle_identifier}` +/// - **Windows:** Resolves to [`config_dir`]`/${bundle_identifier}/logs`. /// -/// See [`PathResolver::log_dir`](crate::PathResolver#method.log_dir) for a more convenient helper function. -pub fn log_dir(config: &Config) -> Option { +/// See [`PathResolver::app_log_dir`](crate::PathResolver#method.app_log_dir) for a more convenient helper function. +pub fn app_log_dir(config: &Config) -> Option { #[cfg(target_os = "macos")] let path = dirs_next::home_dir().map(|dir| { dir @@ -491,3 +572,33 @@ pub fn log_dir(config: &Config) -> Option { path } + +/// Returns the path to the suggested directory for your app's config files. +/// +/// Resolves to [`config_dir`]`/${bundle_identifier}`. +/// +/// See [`PathResolver::app_config_dir`](crate::PathResolver#method.app_config_dir) for a more convenient helper function. +#[deprecated( + since = "1.2.0", + note = "Will be removed in 2.0.0. Use `app_config_dir` or `app_data_dir` instead." +)] +pub fn app_dir(config: &Config) -> Option { + app_config_dir(config) +} + +/// Returns the path to the suggested directory for your app's log files. +/// +/// ## Platform-specific +/// +/// - **Linux:** Resolves to [`config_dir`]`/${bundle_identifier}`. +/// - **macOS:** Resolves to [`home_dir`]`/Library/Logs/${bundle_identifier}` +/// - **Windows:** Resolves to [`config_dir`]`/${bundle_identifier}`. +/// +/// See [`PathResolver::app_log_dir`](crate::PathResolver#method.app_log_dir) for a more convenient helper function. +#[deprecated( + since = "1.2.0", + note = "Will be removed in 2.0.0. Use `app_log_dir` instead." +)] +pub fn log_dir(config: &Config) -> Option { + app_log_dir(config) +} diff --git a/core/tauri/src/app.rs b/core/tauri/src/app.rs index 6bcbd0ea0..1b3fb8081 100644 --- a/core/tauri/src/app.rs +++ b/core/tauri/src/app.rs @@ -289,14 +289,47 @@ impl PathResolver { .map(|dir| dir.join(resource_relpath(path.as_ref()))) } - /// Returns the path to the suggested directory for your app config files. - pub fn app_dir(&self) -> Option { - crate::api::path::app_dir(&self.config) + /// Returns the path to the suggested directory for your app's config files. + pub fn app_config_dir(&self) -> Option { + crate::api::path::app_config_dir(&self.config) } - /// Returns the path to the suggested log directory. + /// Returns the path to the suggested directory for your app's data files. + pub fn app_data_dir(&self) -> Option { + crate::api::path::app_data_dir(&self.config) + } + + /// Returns the path to the suggested directory for your app's local data files. + pub fn app_local_data_dir(&self) -> Option { + crate::api::path::app_local_data_dir(&self.config) + } + + /// Returns the path to the suggested directory for your app's cache files. + pub fn app_cache_dir(&self) -> Option { + crate::api::path::app_cache_dir(&self.config) + } + + /// Returns the path to the suggested directory for your app's log files. + pub fn app_log_dir(&self) -> Option { + crate::api::path::app_log_dir(&self.config) + } + + /// Returns the path to the suggested directory for your app's config files. + #[deprecated( + since = "1.2.0", + note = "Will be removed in 2.0.0. Use `app_config_dir` or `app_data_dir` instead." + )] + pub fn app_dir(&self) -> Option { + self.app_config_dir() + } + + /// Returns the path to the suggested directory for your app's log files. + #[deprecated( + since = "1.2.0", + note = "Will be removed in 2.0.0. Use `app_log_dir` instead." + )] pub fn log_dir(&self) -> Option { - crate::api::path::log_dir(&self.config) + self.app_log_dir() } } @@ -723,6 +756,28 @@ macro_rules! shared_app_impl { manager: self.manager.clone(), } } + + /// Shows the application, but does not automatically focus it. + #[cfg(target_os = "macos")] + pub fn show(&self) -> crate::Result<()> { + match self.runtime() { + RuntimeOrDispatch::Runtime(r) => r.show(), + RuntimeOrDispatch::RuntimeHandle(h) => h.show()?, + _ => unreachable!(), + } + Ok(()) + } + + /// Hides the application. + #[cfg(target_os = "macos")] + pub fn hide(&self) -> crate::Result<()> { + match self.runtime() { + RuntimeOrDispatch::Runtime(r) => r.hide(), + RuntimeOrDispatch::RuntimeHandle(h) => h.hide()?, + _ => unreachable!(), + } + Ok(()) + } } }; } @@ -1462,10 +1517,13 @@ impl Builder { for config in manager.config().tauri.windows.clone() { let url = config.url.clone(); let label = config.label.clone(); - let file_drop_enabled = config.file_drop_enabled; - let mut webview_attributes = WebviewAttributes::new(url); - if !file_drop_enabled { + let mut webview_attributes = + WebviewAttributes::new(url).accept_first_mouse(config.accept_first_mouse); + if let Some(ua) = &config.user_agent { + webview_attributes = webview_attributes.user_agent(&ua.to_string()); + } + if !config.file_drop_enabled { webview_attributes = webview_attributes.disable_file_drop_handler(); } diff --git a/core/tauri/src/app/tray.rs b/core/tauri/src/app/tray.rs index 7be51db62..3a265f0c9 100644 --- a/core/tauri/src/app/tray.rs +++ b/core/tauri/src/app/tray.rs @@ -62,6 +62,8 @@ pub struct SystemTray { menu_on_left_click_set: bool, #[cfg(target_os = "macos")] icon_as_template_set: bool, + #[cfg(target_os = "macos")] + title: Option, } impl fmt::Debug for SystemTray { @@ -94,6 +96,8 @@ impl Default for SystemTray { icon_as_template_set: false, #[cfg(target_os = "macos")] menu_on_left_click_set: false, + #[cfg(target_os = "macos")] + title: None, } } } @@ -228,6 +232,31 @@ impl SystemTray { self } + /// Sets the menu title` + /// + /// # Examples + /// + /// ``` + /// use tauri::SystemTray; + /// + /// tauri::Builder::default() + /// .setup(|app| { + /// let mut tray_builder = SystemTray::new(); + /// #[cfg(target_os = "macos")] + /// { + /// tray_builder = tray_builder.with_title("My App"); + /// } + /// let tray_handle = tray_builder.build(app)?; + /// Ok(()) + /// }); + /// ``` + #[cfg(target_os = "macos")] + #[must_use] + pub fn with_title(mut self, title: &str) -> Self { + self.title = Some(title.to_owned()); + self + } + /// Sets the event listener for this system tray. /// /// # Examples @@ -342,6 +371,14 @@ impl SystemTray { .as_ref() .map_or(false, |t| t.menu_on_left_click); } + if self.title.is_none() { + self.title = manager + .config() + .tauri + .system_tray + .as_ref() + .and_then(|t| t.title.clone()) + } } let tray_id = self.id.clone(); @@ -372,6 +409,9 @@ impl SystemTray { { runtime_tray = runtime_tray.with_icon_as_template(self.icon_as_template); runtime_tray = runtime_tray.with_menu_on_left_click(self.menu_on_left_click); + if let Some(title) = self.title { + runtime_tray = runtime_tray.with_title(&title); + } } let id = runtime_tray.id; @@ -564,6 +604,12 @@ impl SystemTrayHandle { .map_err(Into::into) } + /// Adds the title to the tray menu + #[cfg(target_os = "macos")] + pub fn set_title(&self, title: &str) -> crate::Result<()> { + self.inner.set_title(title).map_err(Into::into) + } + /// Destroys this system tray. pub fn destroy(&self) -> crate::Result<()> { self.inner.destroy().map_err(Into::into) diff --git a/core/tauri/src/async_runtime.rs b/core/tauri/src/async_runtime.rs index d6c4e1884..4ef9ad015 100644 --- a/core/tauri/src/async_runtime.rs +++ b/core/tauri/src/async_runtime.rs @@ -10,7 +10,6 @@ //! one you need isn't here, you could use types in [`tokio`] directly. //! For custom command handlers, it's recommended to use a plain `async fn` command. -use futures_lite::future::FutureExt; use once_cell::sync::OnceCell; pub use tokio::{ runtime::{Handle as TokioHandle, Runtime as TokioRuntime}, @@ -159,7 +158,7 @@ impl Future for JoinHandle { type Output = crate::Result; fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { match self.get_mut() { - Self::Tokio(t) => t.poll(cx).map_err(Into::into), + Self::Tokio(t) => Pin::new(t).poll(cx).map_err(Into::into), } } } diff --git a/core/tauri/src/command.rs b/core/tauri/src/command.rs index cc4935cb3..24896156b 100644 --- a/core/tauri/src/command.rs +++ b/core/tauri/src/command.rs @@ -156,7 +156,7 @@ impl<'de, R: Runtime> Deserializer<'de> for CommandItem<'de, R> { #[doc(hidden)] pub mod private { use crate::{InvokeError, InvokeResolver, Runtime}; - use futures::{FutureExt, TryFutureExt}; + use futures_util::{FutureExt, TryFutureExt}; use serde::Serialize; use serde_json::Value; use std::future::Future; diff --git a/core/tauri/src/endpoints/app.rs b/core/tauri/src/endpoints/app.rs index c18c29016..3910533cb 100644 --- a/core/tauri/src/endpoints/app.rs +++ b/core/tauri/src/endpoints/app.rs @@ -5,7 +5,7 @@ use super::InvokeContext; use crate::Runtime; use serde::Deserialize; -use tauri_macros::{command_enum, CommandModule}; +use tauri_macros::{command_enum, module_command_handler, CommandModule}; /// The API descriptor. #[command_enum] @@ -19,6 +19,12 @@ pub enum Cmd { GetAppName, /// Get Tauri Version GetTauriVersion, + /// Shows the application on macOS. + #[cmd(app_show, "app > show")] + Show, + /// Hides the application on macOS. + #[cmd(app_hide, "app > hide")] + Hide, } impl Cmd { @@ -33,4 +39,20 @@ impl Cmd { fn get_tauri_version(_context: InvokeContext) -> super::Result<&'static str> { Ok(env!("CARGO_PKG_VERSION")) } + + #[module_command_handler(app_show)] + #[allow(unused_variables)] + fn show(context: InvokeContext) -> super::Result<()> { + #[cfg(target_os = "macos")] + context.window.app_handle.show()?; + Ok(()) + } + + #[module_command_handler(app_hide)] + #[allow(unused_variables)] + fn hide(context: InvokeContext) -> super::Result<()> { + #[cfg(target_os = "macos")] + context.window.app_handle.hide()?; + Ok(()) + } } diff --git a/core/tauri/src/endpoints/event.rs b/core/tauri/src/endpoints/event.rs index 50f1f0d64..6d21d9316 100644 --- a/core/tauri/src/endpoints/event.rs +++ b/core/tauri/src/endpoints/event.rs @@ -14,6 +14,7 @@ use crate::{ Manager, Runtime, }; use serde::{de::Deserializer, Deserialize}; +use serde_json::Value as JsonValue; use tauri_macros::{command_enum, CommandModule}; pub struct EventId(String); @@ -73,7 +74,7 @@ pub enum Cmd { Emit { event: EventId, window_label: Option, - payload: Option, + payload: Option, }, } @@ -127,10 +128,22 @@ impl Cmd { context: InvokeContext, event: EventId, window_label: Option, - payload: Option, + payload: Option, ) -> super::Result<()> { // dispatch the event to Rust listeners - context.window.trigger(&event.0, payload.clone()); + context.window.trigger( + &event.0, + // TODO: dispatch any serializable value instead of a string in v2 + payload.as_ref().and_then(|p| { + serde_json::to_string(&p) + .map_err(|e| { + #[cfg(debug_assertions)] + eprintln!("{}", e); + e + }) + .ok() + }), + ); if let Some(target) = window_label { context diff --git a/core/tauri/src/endpoints/file_system.rs b/core/tauri/src/endpoints/file_system.rs index 82d99dc64..8d5f4534b 100644 --- a/core/tauri/src/endpoints/file_system.rs +++ b/core/tauri/src/endpoints/file_system.rs @@ -114,6 +114,12 @@ pub(crate) enum Cmd { new_path: SafePathBuf, options: Option, }, + /// The exists API. + #[cmd(fs_exists, "fs > exists")] + Exists { + path: SafePathBuf, + options: Option, + }, } impl Cmd { @@ -191,9 +197,15 @@ impl Cmd { path, dir, )?; - dir::read_dir(&resolved_path, recursive) - .with_context(|| format!("path: {}", resolved_path.display())) - .map_err(Into::into) + dir::read_dir_with_options( + &resolved_path, + recursive, + dir::ReadDirOptions { + scope: Some(&context.window.state::().fs), + }, + ) + .with_context(|| format!("path: {}", resolved_path.display())) + .map_err(Into::into) } #[module_command_handler(fs_copy_file)] @@ -333,6 +345,22 @@ impl Cmd { .with_context(|| format!("old: {}, new: {}", old.display(), new.display())) .map_err(Into::into) } + + #[module_command_handler(fs_exists)] + fn exists( + context: InvokeContext, + path: SafePathBuf, + options: Option, + ) -> super::Result { + let resolved_path = resolve_path( + &context.config, + &context.package_info, + &context.window, + path, + options.and_then(|o| o.dir), + )?; + Ok(resolved_path.as_ref().exists()) + } } #[allow(dead_code)] @@ -371,7 +399,7 @@ mod tests { impl Arbitrary for BaseDirectory { fn arbitrary(g: &mut Gen) -> Self { if bool::arbitrary(g) { - BaseDirectory::App + BaseDirectory::AppData } else { BaseDirectory::Resource } @@ -468,4 +496,11 @@ mod tests { ); crate::test_utils::assert_not_allowlist_error(res); } + + #[tauri_macros::module_command_test(fs_exists, "fs > exists")] + #[quickcheck_macros::quickcheck] + fn exists(path: SafePathBuf, options: Option) { + let res = super::Cmd::exists(crate::test::mock_invoke_context(), path, options); + crate::test_utils::assert_not_allowlist_error(res); + } } diff --git a/core/tauri/src/endpoints/window.rs b/core/tauri/src/endpoints/window.rs index 6322bac16..58ea4c747 100644 --- a/core/tauri/src/endpoints/window.rs +++ b/core/tauri/src/endpoints/window.rs @@ -127,6 +127,8 @@ pub enum WindowManagerCmd { SetCursorIcon(CursorIcon), #[cfg(window_set_cursor_position)] SetCursorPosition(Position), + #[cfg(window_set_ignore_cursor_events)] + SetIgnoreCursorEvents(bool), #[cfg(window_start_dragging)] StartDragging, #[cfg(window_print)] @@ -173,6 +175,9 @@ pub fn into_allowlist_error(variant: &str) -> crate::Error { "setCursorPosition" => { crate::Error::ApiNotAllowlisted("window > setCursorPosition".to_string()) } + "setIgnoreCursorEvents" => { + crate::Error::ApiNotAllowlisted("window > setIgnoreCursorEvents".to_string()) + } "startDragging" => crate::Error::ApiNotAllowlisted("window > startDragging".to_string()), "print" => crate::Error::ApiNotAllowlisted("window > print".to_string()), "internalToggleMaximize" => { @@ -314,6 +319,10 @@ impl Cmd { WindowManagerCmd::SetCursorIcon(icon) => window.set_cursor_icon(icon)?, #[cfg(window_set_cursor_position)] WindowManagerCmd::SetCursorPosition(position) => window.set_cursor_position(position)?, + #[cfg(window_set_ignore_cursor_events)] + WindowManagerCmd::SetIgnoreCursorEvents(ignore_cursor) => { + window.set_ignore_cursor_events(ignore_cursor)? + } #[cfg(window_start_dragging)] WindowManagerCmd::StartDragging => window.start_dragging()?, #[cfg(window_print)] diff --git a/core/tauri/src/event.rs b/core/tauri/src/event.rs index 50f4a3df2..d19fed996 100644 --- a/core/tauri/src/event.rs +++ b/core/tauri/src/event.rs @@ -327,17 +327,26 @@ pub fn listen_js( handler: String, ) -> String { format!( - "if (window['{listeners}'] === void 0) {{ - Object.defineProperty(window, '{listeners}', {{ value: Object.create(null) }}); - }} - if (window['{listeners}'][{event}] === void 0) {{ - Object.defineProperty(window['{listeners}'], {event}, {{ value: [] }}); - }} - window['{listeners}'][{event}].push({{ - id: {event_id}, - windowLabel: {window_label}, - handler: {handler} - }}); + " + (function () {{ + if (window['{listeners}'] === void 0) {{ + Object.defineProperty(window, '{listeners}', {{ value: Object.create(null) }}); + }} + if (window['{listeners}'][{event}] === void 0) {{ + Object.defineProperty(window['{listeners}'], {event}, {{ value: [] }}); + }} + const eventListeners = window['{listeners}'][{event}] + const listener = {{ + id: {event_id}, + windowLabel: {window_label}, + handler: {handler} + }}; + if ({event} == 'tauri://window-created') {{ + eventListeners.splice(eventListeners.length - 1, 0, listener) + }} else {{ + eventListeners.push(listener); + }} + }})() ", listeners = listeners_object_name, event = event, diff --git a/core/tauri/src/lib.rs b/core/tauri/src/lib.rs index 6c2392eaf..071a2eaea 100644 --- a/core/tauri/src/lib.rs +++ b/core/tauri/src/lib.rs @@ -69,6 +69,7 @@ //! - **fs-all**: Enables all [Filesystem APIs](https://tauri.app/en/docs/api/js/modules/fs). //! - **fs-copy-file**: Enables the [`copyFile` API](https://tauri.app/en/docs/api/js/modules/fs#copyfile). //! - **fs-create-dir**: Enables the [`createDir` API](https://tauri.app/en/docs/api/js/modules/fs#createdir). +//! - **fs-exists**: Enables the [`exists` API](https://tauri.app/en/docs/api/js/modules/fs#exists). //! - **fs-read-dir**: Enables the [`readDir` API](https://tauri.app/en/docs/api/js/modules/fs#readdir). //! - **fs-read-file**: Enables the [`readTextFile` API](https://tauri.app/en/docs/api/js/modules/fs#readtextfile) and the [`readBinaryFile` API](https://tauri.app/en/docs/api/js/modules/fs#readbinaryfile). //! - **fs-remove-dir**: Enables the [`removeDir` API](https://tauri.app/en/docs/api/js/modules/fs#removedir). @@ -144,8 +145,15 @@ //! - **window-set-cursor-visible**: Enables the [`setCursorVisible` API](https://tauri.app/en/docs/api/js/classes/window.WebviewWindow#setcursorvisible). //! - **window-set-cursor-icon**: Enables the [`setCursorIcon` API](https://tauri.app/en/docs/api/js/classes/window.WebviewWindow#setcursoricon). //! - **window-set-cursor-position**: Enables the [`setCursorPosition` API](https://tauri.app/en/docs/api/js/classes/window.WebviewWindow#setcursorposition). +//! - **window-set-ignore-cursor-events**: Enables the [`setIgnoreCursorEvents` API](https://tauri.app/en/docs/api/js/classes/window.WebviewWindow#setignorecursorevents). //! - **window-start-dragging**: Enables the [`startDragging` API](https://tauri.app/en/docs/api/js/classes/window.WebviewWindow#startdragging). //! - **window-print**: Enables the [`print` API](https://tauri.app/en/docs/api/js/classes/window.WebviewWindow#print). +//! +//! ### App allowlist +//! +//! - **app-all**: Enables all [App APIs](https://tauri.app/en/docs/api/js/modules/app). +//! - **app-show**: Enables the [`show` API](https://tauri.app/en/docs/api/js/modules/app#show). +//! - **app-hide**: Enables the [`hide` API](https://tauri.app/en/docs/api/js/modules/app#hide). #![warn(missing_docs, rust_2018_idioms)] #![cfg_attr(doc_cfg, feature(doc_cfg))] @@ -217,6 +225,8 @@ pub use runtime::http; #[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))] pub use runtime::{menu::NativeImage, ActivationPolicy}; +#[cfg(target_os = "macos")] +pub use self::utils::TitleBarStyle; #[cfg(all(desktop, feature = "system-tray"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "system-tray")))] pub use { diff --git a/core/tauri/src/manager.rs b/core/tauri/src/manager.rs index 8410154a2..e3b0e3f54 100644 --- a/core/tauri/src/manager.rs +++ b/core/tauri/src/manager.rs @@ -508,19 +508,17 @@ impl WindowManager { use crate::api::file::SafePathBuf; use tokio::io::{AsyncReadExt, AsyncSeekExt}; use url::Position; - let asset_scope = self.state().get::().asset_protocol.clone(); + let state = self.state(); + let asset_scope = state.get::().asset_protocol.clone(); + let mime_type_cache = MimeTypeCache::default(); pending.register_uri_scheme_protocol("asset", move |request| { let parsed_path = Url::parse(request.uri())?; let filtered_path = &parsed_path[..Position::AfterPath]; - #[cfg(target_os = "windows")] let path = filtered_path .strip_prefix("asset://localhost/") // the `strip_prefix` only returns None when a request is made to `https://tauri.$P` on Windows // where `$P` is not `localhost/*` .unwrap_or(""); - // safe to unwrap: request.uri() always starts with this prefix - #[cfg(not(target_os = "windows"))] - let path = filtered_path.strip_prefix("asset://").unwrap(); let path = percent_encoding::percent_decode(path.as_bytes()) .decode_utf8_lossy() .to_string(); @@ -627,7 +625,7 @@ impl WindowManager { response = response.header(k, v); } - let mime_type = MimeType::parse(&data, &path); + let mime_type = mime_type_cache.get_or_insert(&data, &path); response.mimetype(&mime_type).status(status_code).body(data) } else { match crate::async_runtime::safe_block_on(async move { tokio::fs::read(path_).await }) { @@ -931,7 +929,7 @@ impl WindowManager { } let bundle_script = if with_global_tauri { - include_str!("../scripts/bundle.js") + include_str!("../scripts/bundle.global.js") } else { "" }; @@ -1483,6 +1481,26 @@ fn request_to_path(request: &tauri_runtime::http::Request, base_url: &str) -> St } } +// key is uri/path, value is the store mime type +#[cfg(protocol_asset)] +#[derive(Debug, Clone, Default)] +struct MimeTypeCache(Arc>>); + +#[cfg(protocol_asset)] +impl MimeTypeCache { + pub fn get_or_insert(&self, content: &[u8], uri: &str) -> String { + let mut cache = self.0.lock().unwrap(); + let uri = uri.to_string(); + if let Some(mime_type) = cache.get(&uri) { + mime_type.clone() + } else { + let mime_type = MimeType::parse(content, &uri); + cache.insert(uri, mime_type.clone()); + mime_type + } + } +} + #[cfg(test)] mod tests { use super::replace_with_callback; diff --git a/core/tauri/src/scope/fs.rs b/core/tauri/src/scope/fs.rs index 44f4e2e25..66d8188c7 100644 --- a/core/tauri/src/scope/fs.rs +++ b/core/tauri/src/scope/fs.rs @@ -5,7 +5,7 @@ use std::{ collections::{HashMap, HashSet}, fmt, - path::{Path, PathBuf}, + path::{Path, PathBuf, MAIN_SEPARATOR}, sync::{Arc, Mutex}, }; @@ -64,15 +64,19 @@ impl fmt::Debug for Scope { } } -fn push_pattern>(list: &mut HashSet, pattern: P) -> crate::Result<()> { +fn push_pattern, F: Fn(&str) -> Result>( + list: &mut HashSet, + pattern: P, + f: F, +) -> crate::Result<()> { let path: PathBuf = pattern.as_ref().components().collect(); - list.insert(Pattern::new(&path.to_string_lossy())?); + list.insert(f(&path.to_string_lossy())?); #[cfg(windows)] { if let Ok(p) = std::fs::canonicalize(&path) { - list.insert(Pattern::new(&p.to_string_lossy())?); + list.insert(f(&p.to_string_lossy())?); } else { - list.insert(Pattern::new(&format!("\\\\?\\{}", path.display()))?); + list.insert(f(&format!("\\\\?\\{}", path.display()))?); } } Ok(()) @@ -89,7 +93,7 @@ impl Scope { let mut allowed_patterns = HashSet::new(); for path in scope.allowed_paths() { if let Ok(path) = parse_path(config, package_info, env, path) { - push_pattern(&mut allowed_patterns, path)?; + push_pattern(&mut allowed_patterns, path, Pattern::new)?; } } @@ -97,7 +101,7 @@ impl Scope { if let Some(forbidden_paths) = scope.forbidden_paths() { for path in forbidden_paths { if let Ok(path) = parse_path(config, package_info, env, path) { - push_pattern(&mut forbidden_patterns, path)?; + push_pattern(&mut forbidden_patterns, path, Pattern::new)?; } } } @@ -139,16 +143,18 @@ impl Scope { /// After this function has been called, the frontend will be able to use the Tauri API to read /// the directory and all of its files and subdirectories. pub fn allow_directory>(&self, path: P, recursive: bool) -> crate::Result<()> { - let path = path.as_ref().to_path_buf(); + let path = path.as_ref(); { let mut list = self.allowed_patterns.lock().unwrap(); // allow the directory to be read - push_pattern(&mut list, &path)?; + push_pattern(&mut list, &path, escaped_pattern)?; // allow its files and subdirectories to be read - push_pattern(&mut list, path.join(if recursive { "**" } else { "*" }))?; + push_pattern(&mut list, &path, |p| { + escaped_pattern_with(p, if recursive { "**" } else { "*" }) + })?; } - self.trigger(Event::PathAllowed(path)); + self.trigger(Event::PathAllowed(path.to_path_buf())); Ok(()) } @@ -157,7 +163,11 @@ impl Scope { /// After this function has been called, the frontend will be able to use the Tauri API to read the contents of this file. pub fn allow_file>(&self, path: P) -> crate::Result<()> { let path = path.as_ref(); - push_pattern(&mut self.allowed_patterns.lock().unwrap(), &path)?; + push_pattern( + &mut self.allowed_patterns.lock().unwrap(), + &path, + escaped_pattern, + )?; self.trigger(Event::PathAllowed(path.to_path_buf())); Ok(()) } @@ -166,16 +176,18 @@ impl Scope { /// /// **Note:** this takes precedence over allowed paths, so its access gets denied **always**. pub fn forbid_directory>(&self, path: P, recursive: bool) -> crate::Result<()> { - let path = path.as_ref().to_path_buf(); + let path = path.as_ref(); { let mut list = self.forbidden_patterns.lock().unwrap(); // allow the directory to be read - push_pattern(&mut list, &path)?; + push_pattern(&mut list, &path, escaped_pattern)?; // allow its files and subdirectories to be read - push_pattern(&mut list, path.join(if recursive { "**" } else { "*" }))?; + push_pattern(&mut list, &path, |p| { + escaped_pattern_with(p, if recursive { "**" } else { "*" }) + })?; } - self.trigger(Event::PathForbidden(path)); + self.trigger(Event::PathForbidden(path.to_path_buf())); Ok(()) } @@ -184,7 +196,11 @@ impl Scope { /// **Note:** this takes precedence over allowed paths, so its access gets denied **always**. pub fn forbid_file>(&self, path: P) -> crate::Result<()> { let path = path.as_ref(); - push_pattern(&mut self.forbidden_patterns.lock().unwrap(), &path)?; + push_pattern( + &mut self.forbidden_patterns.lock().unwrap(), + &path, + escaped_pattern, + )?; self.trigger(Event::PathForbidden(path.to_path_buf())); Ok(()) } @@ -224,3 +240,61 @@ impl Scope { } } } + +fn escaped_pattern(p: &str) -> Result { + Pattern::new(&glob::Pattern::escape(p)) +} + +fn escaped_pattern_with(p: &str, append: &str) -> Result { + Pattern::new(&format!( + "{}{}{}", + glob::Pattern::escape(p), + MAIN_SEPARATOR, + append + )) +} + +#[cfg(test)] +mod tests { + use super::Scope; + + fn new_scope() -> Scope { + Scope { + allowed_patterns: Default::default(), + forbidden_patterns: Default::default(), + event_listeners: Default::default(), + } + } + + #[test] + fn path_is_escaped() { + let scope = new_scope(); + scope.allow_directory("/home/tauri/**", false).unwrap(); + assert!(scope.is_allowed("/home/tauri/**")); + assert!(scope.is_allowed("/home/tauri/**/file")); + assert!(!scope.is_allowed("/home/tauri/anyfile")); + + let scope = new_scope(); + scope.allow_file("/home/tauri/**").unwrap(); + assert!(scope.is_allowed("/home/tauri/**")); + assert!(!scope.is_allowed("/home/tauri/**/file")); + assert!(!scope.is_allowed("/home/tauri/anyfile")); + + let scope = new_scope(); + scope.allow_directory("/home/tauri", true).unwrap(); + scope.forbid_directory("/home/tauri/**", false).unwrap(); + assert!(!scope.is_allowed("/home/tauri/**")); + assert!(!scope.is_allowed("/home/tauri/**/file")); + assert!(!scope.is_allowed("/home/tauri/**/inner/file")); + assert!(scope.is_allowed("/home/tauri/inner/folder/anyfile")); + assert!(scope.is_allowed("/home/tauri/anyfile")); + + let scope = new_scope(); + scope.allow_directory("/home/tauri", true).unwrap(); + scope.forbid_file("/home/tauri/**").unwrap(); + assert!(!scope.is_allowed("/home/tauri/**")); + assert!(scope.is_allowed("/home/tauri/**/file")); + assert!(scope.is_allowed("/home/tauri/**/inner/file")); + assert!(scope.is_allowed("/home/tauri/anyfile")); + } +} diff --git a/core/tauri/src/state.rs b/core/tauri/src/state.rs index 8b26f132b..d3805e60e 100644 --- a/core/tauri/src/state.rs +++ b/core/tauri/src/state.rs @@ -9,6 +9,8 @@ use crate::{ use state::Container; /// A guard for a state value. +/// +/// See [`Manager::manage`](`crate::Manager::manage`) for usage examples. pub struct State<'r, T: Send + Sync + 'static>(&'r T); impl<'r, T: Send + Sync + 'static> State<'r, T> { diff --git a/core/tauri/src/test/mock_runtime.rs b/core/tauri/src/test/mock_runtime.rs index 360bf9fc2..166766a6f 100644 --- a/core/tauri/src/test/mock_runtime.rs +++ b/core/tauri/src/test/mock_runtime.rs @@ -20,6 +20,8 @@ use tauri_runtime::{ menu::{SystemTrayMenu, TrayHandle}, SystemTray, SystemTrayEvent, TrayId, }; +#[cfg(target_os = "macos")] +use tauri_utils::TitleBarStyle; use tauri_utils::{config::WindowConfig, Theme}; use uuid::Uuid; @@ -92,6 +94,18 @@ impl RuntimeHandle for MockRuntimeHandle { fn raw_display_handle(&self) -> raw_window_handle::RawDisplayHandle { unimplemented!() } + + /// Shows the application, but does not automatically focus it. + #[cfg(target_os = "macos")] + fn show(&self) -> Result<()> { + Ok(()) + } + + /// Hides the application. + #[cfg(target_os = "macos")] + fn hide(&self) -> Result<()> { + Ok(()) + } } #[derive(Debug, Clone)] @@ -207,7 +221,7 @@ impl WindowBuilder for MockWindowBuilder { self } - fn focus(self) -> Self { + fn focused(self, focused: bool) -> Self { self } @@ -259,6 +273,21 @@ impl WindowBuilder for MockWindowBuilder { self } + #[cfg(target_os = "macos")] + fn title_bar_style(self, style: TitleBarStyle) -> Self { + self + } + + #[cfg(target_os = "macos")] + fn hidden_title(self, transparent: bool) -> Self { + self + } + + #[cfg(target_os = "macos")] + fn tabbing_identifier(self, identifier: &str) -> Self { + self + } + fn theme(self, theme: Option) -> Self { self } @@ -500,6 +529,10 @@ impl Dispatch for MockDispatcher { Ok(()) } + fn set_ignore_cursor_events(&self, ignore: bool) -> Result<()> { + Ok(()) + } + fn start_dragging(&self) -> Result<()> { Ok(()) } @@ -535,6 +568,11 @@ impl TrayHandle for MockTrayHandler { Ok(()) } + #[cfg(target_os = "macos")] + fn set_title(&self, title: &str) -> tauri_runtime::Result<()> { + Ok(()) + } + fn destroy(&self) -> Result<()> { Ok(()) } @@ -649,6 +687,14 @@ impl Runtime for MockRuntime { #[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))] fn set_activation_policy(&mut self, activation_policy: tauri_runtime::ActivationPolicy) {} + #[cfg(target_os = "macos")] + #[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))] + fn show(&self) {} + + #[cfg(target_os = "macos")] + #[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))] + fn hide(&self) {} + #[cfg(any( target_os = "macos", windows, diff --git a/core/tauri/src/updater/core.rs b/core/tauri/src/updater/core.rs index 52ff04d06..57085bcfd 100644 --- a/core/tauri/src/updater/core.rs +++ b/core/tauri/src/updater/core.rs @@ -563,7 +563,7 @@ impl Update { let mut buffer = Vec::new(); #[cfg(feature = "reqwest-client")] { - use futures::StreamExt; + use futures_util::StreamExt; let mut stream = response.bytes_stream(); while let Some(chunk) = stream.next().await { let chunk = chunk?; diff --git a/core/tauri/src/window.rs b/core/tauri/src/window.rs index 002bfc85b..690583547 100644 --- a/core/tauri/src/window.rs +++ b/core/tauri/src/window.rs @@ -8,6 +8,8 @@ pub(crate) mod menu; pub use menu::{MenuEvent, MenuHandle}; +#[cfg(target_os = "macos")] +use crate::TitleBarStyle; use crate::{ app::AppHandle, command::{CommandArg, CommandItem}, @@ -326,10 +328,21 @@ impl<'a, R: Runtime> WindowBuilder<'a, R> { self } - /// Whether the window will be initially hidden or focused. + /// Sets the window to be initially focused. #[must_use] + #[deprecated( + since = "1.2.0", + note = "The window is automatically focused by default. This function Will be removed in 2.0.0. Use `focused` instead." + )] pub fn focus(mut self) -> Self { - self.window_builder = self.window_builder.focus(); + self.window_builder = self.window_builder.focused(true); + self + } + + /// Whether the window will be initially focused or not. + #[must_use] + pub fn focused(mut self, focused: bool) -> Self { + self.window_builder = self.window_builder.focused(focused); self } @@ -433,6 +446,35 @@ impl<'a, R: Runtime> WindowBuilder<'a, R> { self } + /// Sets the [`TitleBarStyle`]. + #[cfg(target_os = "macos")] + #[must_use] + pub fn title_bar_style(mut self, style: TitleBarStyle) -> Self { + self.window_builder = self.window_builder.title_bar_style(style); + self + } + + /// Hide the window title. + #[cfg(target_os = "macos")] + #[must_use] + pub fn hidden_title(mut self, hidden: bool) -> Self { + self.window_builder = self.window_builder.hidden_title(hidden); + self + } + + /// Defines the window [tabbing identifier] for macOS. + /// + /// Windows with matching tabbing identifiers will be grouped together. + /// If the tabbing identifier is not set, automatic tabbing will be disabled. + /// + /// [tabbing identifier]: + #[cfg(target_os = "macos")] + #[must_use] + pub fn tabbing_identifier(mut self, identifier: &str) -> Self { + self.window_builder = self.window_builder.tabbing_identifier(identifier); + self + } + // ------------------------------------------- Webview attributes ------------------------------------------- /// Adds the provided JavaScript to a list of scripts that should be run after the global object has been created, @@ -473,6 +515,13 @@ impl<'a, R: Runtime> WindowBuilder<'a, R> { self } + /// Set the user agent for the webview + #[must_use] + pub fn user_agent(mut self, user_agent: &str) -> Self { + self.webview_attributes.user_agent = Some(user_agent.to_string()); + self + } + /// Data directory for the webview. #[must_use] pub fn data_directory(mut self, data_directory: PathBuf) -> Self { @@ -499,6 +548,13 @@ impl<'a, R: Runtime> WindowBuilder<'a, R> { self.webview_attributes.clipboard = true; self } + + /// Sets whether clicking an inactive window also clicks through to the webview. + #[must_use] + pub fn accept_first_mouse(mut self, accept: bool) -> Self { + self.webview_attributes.accept_first_mouse = accept; + self + } } // TODO: expand these docs since this is a pretty important type @@ -793,14 +849,13 @@ impl Window { pub fn on_menu_event(&self, f: F) -> uuid::Uuid { let menu_ids = self.window.menu_ids.clone(); self.window.dispatcher.on_menu_event(move |event| { - f(MenuEvent { - menu_item_id: menu_ids - .lock() - .unwrap() - .get(&event.menu_item_id) - .unwrap() - .clone(), - }) + let id = menu_ids + .lock() + .unwrap() + .get(&event.menu_item_id) + .unwrap() + .clone(); + f(MenuEvent { menu_item_id: id }) }) } } @@ -1196,6 +1251,15 @@ impl Window { .map_err(Into::into) } + /// Ignores the window cursor events. + pub fn set_ignore_cursor_events(&self, ignore: bool) -> crate::Result<()> { + self + .window + .dispatcher + .set_ignore_cursor_events(ignore) + .map_err(Into::into) + } + /// Starts dragging the window. pub fn start_dragging(&self) -> crate::Result<()> { self.window.dispatcher.start_dragging().map_err(Into::into) diff --git a/core/tauri/test/fixture/src-tauri/tauri.conf.json b/core/tauri/test/fixture/src-tauri/tauri.conf.json index 77d42b93e..6aa450ea6 100644 --- a/core/tauri/test/fixture/src-tauri/tauri.conf.json +++ b/core/tauri/test/fixture/src-tauri/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../../../../tooling/cli/schema.json", + "$schema": "../../../../../core/config-schema/schema.json", "build": { "distDir": "../dist", "devPath": "http://localhost:4000" diff --git a/core/tests/app-updater/tauri.conf.json b/core/tests/app-updater/tauri.conf.json index 0e21bd844..bae02862f 100644 --- a/core/tests/app-updater/tauri.conf.json +++ b/core/tests/app-updater/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../../tooling/cli/schema.json", + "$schema": "../../../core/config-schema/schema.json", "build": { "distDir": [], "devPath": [] diff --git a/examples/api/dist/assets/index.css b/examples/api/dist/assets/index.css index 524f9f03d..c1feae7e6 100644 --- a/examples/api/dist/assets/index.css +++ b/examples/api/dist/assets/index.css @@ -1 +1 @@ -*,::before,::after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x:var(--un-empty,/*!*/ /*!*/);--un-pan-y:var(--un-empty,/*!*/ /*!*/);--un-pinch-zoom:var(--un-empty,/*!*/ /*!*/);--un-scroll-snap-strictness:proximity;--un-ordinal:var(--un-empty,/*!*/ /*!*/);--un-slashed-zero:var(--un-empty,/*!*/ /*!*/);--un-numeric-figure:var(--un-empty,/*!*/ /*!*/);--un-numeric-spacing:var(--un-empty,/*!*/ /*!*/);--un-numeric-fraction:var(--un-empty,/*!*/ /*!*/);--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 #0000;--un-ring-shadow:0 0 #0000;--un-shadow-inset:var(--un-empty,/*!*/ /*!*/);--un-shadow:0 0 #0000;--un-ring-inset:var(--un-empty,/*!*/ /*!*/);--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,0.5);--un-blur:var(--un-empty,/*!*/ /*!*/);--un-brightness:var(--un-empty,/*!*/ /*!*/);--un-contrast:var(--un-empty,/*!*/ /*!*/);--un-drop-shadow:var(--un-empty,/*!*/ /*!*/);--un-grayscale:var(--un-empty,/*!*/ /*!*/);--un-hue-rotate:var(--un-empty,/*!*/ /*!*/);--un-invert:var(--un-empty,/*!*/ /*!*/);--un-saturate:var(--un-empty,/*!*/ /*!*/);--un-sepia:var(--un-empty,/*!*/ /*!*/);--un-backdrop-blur:var(--un-empty,/*!*/ /*!*/);--un-backdrop-brightness:var(--un-empty,/*!*/ /*!*/);--un-backdrop-contrast:var(--un-empty,/*!*/ /*!*/);--un-backdrop-grayscale:var(--un-empty,/*!*/ /*!*/);--un-backdrop-hue-rotate:var(--un-empty,/*!*/ /*!*/);--un-backdrop-invert:var(--un-empty,/*!*/ /*!*/);--un-backdrop-opacity:var(--un-empty,/*!*/ /*!*/);--un-backdrop-saturate:var(--un-empty,/*!*/ /*!*/);--un-backdrop-sepia:var(--un-empty,/*!*/ /*!*/);}@font-face { font-family: 'Fira Code'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/firacode/v21/uU9eCBsR6Z2vfE9aq3bL0fxyUs4tcw4W_D1sFVc.ttf) format('truetype');}@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/firamono/v14/N0bX2SlFPv1weGeLZDtQIQ.ttf) format('truetype');}@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url(https://fonts.gstatic.com/s/firamono/v14/N0bS2SlFPv1weGeLZDtondv3mQ.ttf) format('truetype');}@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/rubik/v21/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4i1UA.ttf) format('truetype');}.i-codicon-bell-dot{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M12.994 7.875A4.008 4.008 0 0 1 12 8h-.01v.217c0 .909.143 1.818.442 2.691l.371 1.113h-9.63v-.012l.37-1.113a8.633 8.633 0 0 0 .443-2.691V6.004c0-.563.12-1.113.347-1.616c.227-.514.55-.969.969-1.34c.419-.382.91-.67 1.436-.837c.538-.18 1.1-.24 1.65-.18l.12.018a4 4 0 0 1 .673-.887a5.15 5.15 0 0 0-.697-.135c-.694-.072-1.4 0-2.07.227c-.67.215-1.28.574-1.794 1.053a4.923 4.923 0 0 0-1.208 1.675a5.067 5.067 0 0 0-.431 2.022v2.2a7.61 7.61 0 0 1-.383 2.37L2 12.343l.479.658h3.505c0 .526.215 1.04.586 1.412c.37.37.885.586 1.412.586c.526 0 1.04-.215 1.411-.586s.587-.886.587-1.412h3.505l.478-.658l-.586-1.77a7.63 7.63 0 0 1-.383-2.381v-.318ZM7.982 14.02a.997.997 0 0 0 .706-.3a.939.939 0 0 0 .287-.705H6.977c0 .263.107.514.299.706a.999.999 0 0 0 .706.299Z' clip-rule='evenodd'/%3E%3Cpath d='M12 7a3 3 0 1 0 0-6a3 3 0 0 0 0 6Z'/%3E%3C/g%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-chrome-close{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m7.116 8l-4.558 4.558l.884.884L8 8.884l4.558 4.558l.884-.884L8.884 8l4.558-4.558l-.884-.884L8 7.116L3.442 2.558l-.884.884L7.116 8z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-chrome-maximize{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M3 3v10h10V3H3zm9 9H4V4h8v8z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-chrome-minimize{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M14 8v1H3V8h11z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-chrome-restore{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath d='M3 5v9h9V5H3zm8 8H4V6h7v7z'/%3E%3Cpath fill-rule='evenodd' d='M5 5h1V4h7v7h-1v1h2V3H5v2z' clip-rule='evenodd'/%3E%3C/g%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-clear-all{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m10 12.6l.7.7l1.6-1.6l1.6 1.6l.8-.7L13 11l1.7-1.6l-.8-.8l-1.6 1.7l-1.6-1.7l-.7.8l1.6 1.6l-1.6 1.6zM1 4h14V3H1v1zm0 3h14V6H1v1zm8 2.5V9H1v1h8v-.5zM9 13v-1H1v1h8z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-clippy{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M7 13.992H4v-9h8v2h1v-2.5l-.5-.5H11v-1h-1a2 2 0 0 0-4 0H4.94v1H3.5l-.5.5v10l.5.5H7v-1zm0-11.2a1 1 0 0 1 .8-.8a1 1 0 0 1 .58.06a.94.94 0 0 1 .45.36a1 1 0 1 1-1.75.94a1 1 0 0 1-.08-.56zm7.08 9.46L13 13.342v-5.35h-1v5.34l-1.08-1.08l-.71.71l1.94 1.93h.71l1.93-1.93l-.71-.71zm-5.92-4.16h.71l1.93 1.93l-.71.71l-1.08-1.08v5.34h-1v-5.35l-1.08 1.09l-.71-.71l1.94-1.93z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-close{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m8 8.707l3.646 3.647l.708-.707L8.707 8l3.647-3.646l-.707-.708L8 7.293L4.354 3.646l-.707.708L7.293 8l-3.646 3.646l.707.708L8 8.707z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-cloud-download{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M11.957 6h.05a2.99 2.99 0 0 1 2.116.879a3.003 3.003 0 0 1 0 4.242a2.99 2.99 0 0 1-2.117.879v-1a2.002 2.002 0 0 0 0-4h-.914l-.123-.857a2.49 2.49 0 0 0-2.126-2.122A2.478 2.478 0 0 0 6.231 5.5l-.333.762l-.809-.189A2.49 2.49 0 0 0 4.523 6c-.662 0-1.297.263-1.764.732A2.503 2.503 0 0 0 4.523 11h.498v1h-.498a3.486 3.486 0 0 1-2.628-1.16a3.502 3.502 0 0 1 1.958-5.78a3.462 3.462 0 0 1 1.468.04a3.486 3.486 0 0 1 3.657-2.06A3.479 3.479 0 0 1 11.957 6zm-5.25 5.121l1.314 1.314V7h.994v5.4l1.278-1.279l.707.707l-2.146 2.147h-.708L6 11.829l.707-.708z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-files{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M17.5 0h-9L7 1.5V6H2.5L1 7.5v15.07L2.5 24h12.07L16 22.57V18h4.7l1.3-1.43V4.5L17.5 0zm0 2.12l2.38 2.38H17.5V2.12zm-3 20.38h-12v-15H7v9.07L8.5 18h6v4.5zm6-6h-12v-15H16V6h4.5v10.5z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-link-external{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath d='M1.5 1H6v1H2v12h12v-4h1v4.5l-.5.5h-13l-.5-.5v-13l.5-.5z'/%3E%3Cpath d='M15 1.5V8h-1V2.707L7.243 9.465l-.707-.708L13.293 2H8V1h6.5l.5.5z'/%3E%3C/g%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-menu{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 5H0V4h16v1zm0 8H0v-1h16v1zm0-4.008H0V8h16v.992z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-multiple-windows{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m6 1.5l.5-.5h8l.5.5v7l-.5.5H12V8h2V4H7v1H6V1.5zM7 2v1h7V2H7zM1.5 7l-.5.5v7l.5.5h8l.5-.5v-7L9.5 7h-8zM2 9V8h7v1H2zm0 1h7v4H2v-4z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-radio-tower{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2.998 5.58a5.55 5.55 0 0 1 1.62-3.88l-.71-.7a6.45 6.45 0 0 0 0 9.16l.71-.7a5.55 5.55 0 0 1-1.62-3.88zm1.06 0a4.42 4.42 0 0 0 1.32 3.17l.71-.71a3.27 3.27 0 0 1-.76-1.12a3.45 3.45 0 0 1 0-2.67a3.22 3.22 0 0 1 .76-1.13l-.71-.71a4.46 4.46 0 0 0-1.32 3.17zm7.65 3.21l-.71-.71c.33-.32.59-.704.76-1.13a3.449 3.449 0 0 0 0-2.67a3.22 3.22 0 0 0-.76-1.13l.71-.7a4.468 4.468 0 0 1 0 6.34zM13.068 1l-.71.71a5.43 5.43 0 0 1 0 7.74l.71.71a6.45 6.45 0 0 0 0-9.16zM9.993 5.43a1.5 1.5 0 0 1-.245.98a2 2 0 0 1-.27.23l3.44 7.73l-.92.4l-.77-1.73h-5.54l-.77 1.73l-.92-.4l3.44-7.73a1.52 1.52 0 0 1-.33-1.63a1.55 1.55 0 0 1 .56-.68a1.5 1.5 0 0 1 2.325 1.1zm-1.595-.34a.52.52 0 0 0-.25.14a.52.52 0 0 0-.11.22a.48.48 0 0 0 0 .29c.04.09.102.17.18.23a.54.54 0 0 0 .28.08a.51.51 0 0 0 .5-.5a.54.54 0 0 0-.08-.28a.58.58 0 0 0-.23-.18a.48.48 0 0 0-.29 0zm.23 2.05h-.27l-.87 1.94h2l-.86-1.94zm2.2 4.94l-.89-2h-2.88l-.89 2h4.66z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-record-keys{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M14 3H3a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1zm0 8H3V4h11v7zm-3-6h-1v1h1V5zm-1 2H9v1h1V7zm2-2h1v1h-1V5zm1 4h-1v1h1V9zM6 9h5v1H6V9zm7-2h-2v1h2V7zM8 5h1v1H8V5zm0 2H7v1h1V7zM4 9h1v1H4V9zm0-4h1v1H4V5zm3 0H6v1h1V5zM4 7h2v1H4V7z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-terminal{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M3 1.5L1.5 3v18L3 22.5h18l1.5-1.5V3L21 1.5H3zM3 21V3h18v18H3zm5.656-4.01l1.038 1.061l5.26-5.243v-.912l-5.26-5.26l-1.035 1.06l4.59 4.702l-4.593 4.592z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-terminal-bash{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M13.655 3.56L8.918.75a1.785 1.785 0 0 0-1.82 0L2.363 3.56a1.889 1.889 0 0 0-.921 1.628v5.624a1.889 1.889 0 0 0 .913 1.627l4.736 2.812a1.785 1.785 0 0 0 1.82 0l4.736-2.812a1.888 1.888 0 0 0 .913-1.627V5.188a1.889 1.889 0 0 0-.904-1.627zm-3.669 8.781v.404a.149.149 0 0 1-.07.124l-.239.137c-.038.02-.07 0-.07-.053v-.396a.78.78 0 0 1-.545.053a.073.073 0 0 1-.027-.09l.086-.365a.153.153 0 0 1 .071-.096a.048.048 0 0 1 .038 0a.662.662 0 0 0 .497-.063a.662.662 0 0 0 .37-.567c0-.206-.112-.292-.384-.293c-.344 0-.661-.066-.67-.574A1.47 1.47 0 0 1 9.6 9.437V9.03a.147.147 0 0 1 .07-.126l.231-.147c.038-.02.07 0 .07.054v.409a.754.754 0 0 1 .453-.055a.073.073 0 0 1 .03.095l-.081.362a.156.156 0 0 1-.065.09a.055.055 0 0 1-.035 0a.6.6 0 0 0-.436.072a.549.549 0 0 0-.331.486c0 .185.098.242.425.248c.438 0 .627.199.632.639a1.568 1.568 0 0 1-.576 1.185zm2.481-.68a.094.094 0 0 1-.036.092l-1.198.727a.034.034 0 0 1-.04.003a.035.035 0 0 1-.016-.037v-.31a.086.086 0 0 1 .055-.076l1.179-.706a.035.035 0 0 1 .056.035v.273zm.827-6.914L8.812 7.515c-.559.331-.97.693-.97 1.367v5.52c0 .404.165.662.413.741a1.465 1.465 0 0 1-.248.025c-.264 0-.522-.072-.748-.207L2.522 12.15a1.558 1.558 0 0 1-.75-1.338V5.188a1.558 1.558 0 0 1 .75-1.34l4.738-2.81a1.46 1.46 0 0 1 1.489 0l4.736 2.812a1.548 1.548 0 0 1 .728 1.083c-.154-.334-.508-.427-.92-.185h.002z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-window{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M14.5 2h-13l-.5.5v11l.5.5h13l.5-.5v-11l-.5-.5zM14 13H2V6h12v7zm0-8H2V3h12v2z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-broadcast{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M128 88a40 40 0 1 0 40 40a40 40 0 0 0-40-40Zm0 64a24 24 0 1 1 24-24a24.1 24.1 0 0 1-24 24Zm-59-48.9a64.5 64.5 0 0 0 0 49.8a65.4 65.4 0 0 0 13.7 20.4a7.9 7.9 0 0 1 0 11.3a8 8 0 0 1-5.6 2.3a8.3 8.3 0 0 1-5.7-2.3a80 80 0 0 1-17.1-25.5a79.9 79.9 0 0 1 0-62.2a80 80 0 0 1 17.1-25.5a8 8 0 0 1 11.3 0a7.9 7.9 0 0 1 0 11.3A65.4 65.4 0 0 0 69 103.1Zm132.7 56a80 80 0 0 1-17.1 25.5a8.3 8.3 0 0 1-5.7 2.3a8 8 0 0 1-5.6-2.3a7.9 7.9 0 0 1 0-11.3a65.4 65.4 0 0 0 13.7-20.4a64.5 64.5 0 0 0 0-49.8a65.4 65.4 0 0 0-13.7-20.4a7.9 7.9 0 0 1 0-11.3a8 8 0 0 1 11.3 0a80 80 0 0 1 17.1 25.5a79.9 79.9 0 0 1 0 62.2ZM54.5 201.5a8.1 8.1 0 0 1 0 11.4a8.3 8.3 0 0 1-5.7 2.3a8.5 8.5 0 0 1-5.7-2.3a121.8 121.8 0 0 1-25.7-38.2a120.7 120.7 0 0 1 0-93.4a121.8 121.8 0 0 1 25.7-38.2a8.1 8.1 0 0 1 11.4 11.4A103.5 103.5 0 0 0 24 128a103.5 103.5 0 0 0 30.5 73.5ZM248 128a120.2 120.2 0 0 1-9.4 46.7a121.8 121.8 0 0 1-25.7 38.2a8.5 8.5 0 0 1-5.7 2.3a8.3 8.3 0 0 1-5.7-2.3a8.1 8.1 0 0 1 0-11.4A103.5 103.5 0 0 0 232 128a103.5 103.5 0 0 0-30.5-73.5a8.1 8.1 0 1 1 11.4-11.4a121.8 121.8 0 0 1 25.7 38.2A120.2 120.2 0 0 1 248 128Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-globe-hemisphere-west{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M221.6 173.3A102.9 102.9 0 0 0 232 128a104.2 104.2 0 0 0-77.2-100.5h-.5A103.8 103.8 0 0 0 60.4 49l-1.3 1.2A103.9 103.9 0 0 0 128 232h2.4a104.3 104.3 0 0 0 90.6-57.4ZM216 128a89.3 89.3 0 0 1-5.5 30.7l-46.4-28.5a16.6 16.6 0 0 0-6.3-2.3l-22.8-3a16.1 16.1 0 0 0-15.3 6.8h-8.6l-3.8-7.9a15.9 15.9 0 0 0-11-8.7l-6.6-1.4l4.6-10.8h21.4a16.1 16.1 0 0 0 7.7-2l12.2-6.8a16.1 16.1 0 0 0 3-2.1l26.9-24.4a15.7 15.7 0 0 0 4.5-16.9a88 88 0 0 1 46 77.3Zm-68.8-85.9l7.6 13.7l-26.9 24.3l-12.2 6.8H94.3a15.9 15.9 0 0 0-14.7 9.8l-5.3 12.4l-10.9-29.2l8.1-19.3a88 88 0 0 1 75.7-18.5ZM40 128a87.1 87.1 0 0 1 9.5-39.7l10.4 27.9a16.1 16.1 0 0 0 11.6 10l5.5 1.2h.1l15.8 3.4l3.8 7.9a16.3 16.3 0 0 0 14.4 9h1.2l-7.7 17.2a15.9 15.9 0 0 0 2.8 17.4l18.8 20.4l-2.5 13.2A88.1 88.1 0 0 1 40 128Zm100.1 87.2l1.8-9.5a16 16 0 0 0-3.9-13.9l-18.8-20.3l12.7-28.7l1-2.1l22.8 3.1l47.8 29.4a88.5 88.5 0 0 1-63.4 42Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-hand-waving{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m220.2 104l-20-34.7a28.1 28.1 0 0 0-47.3-1.9l-17.3-30a28.1 28.1 0 0 0-38.3-10.3a29.4 29.4 0 0 0-9.9 9.6a27.9 27.9 0 0 0-11.5-6.2a27.2 27.2 0 0 0-21.2 2.8a27.9 27.9 0 0 0-10.3 38.2l3.4 5.8A28.5 28.5 0 0 0 36 81a28.1 28.1 0 0 0-10.2 38.2l42 72.8a88 88 0 1 0 152.4-88Zm-6.7 62.6a71.2 71.2 0 0 1-33.5 43.7A72.1 72.1 0 0 1 81.6 184l-42-72.8a12 12 0 0 1 20.8-12l22 38.1l.6.9v.2l.5.5l.2.2l.7.6h.1l.7.5h.3l.6.3h.2l.9.3h.1l.8.2h2.2l.9-.2h.3l.6-.2h.3l.9-.4a8.1 8.1 0 0 0 2.9-11l-22-38.1l-16-27.7a12 12 0 0 1-1.2-9.1a11.8 11.8 0 0 1 5.6-7.3a12 12 0 0 1 9.1-1.2a12.5 12.5 0 0 1 7.3 5.6l8 14h.1l26 45a7 7 0 0 0 1.5 1.9a8 8 0 0 0 12.3-9.9l-26-45a12 12 0 1 1 20.8-12l30 51.9l6.3 11a48.1 48.1 0 0 0-10.9 61a8 8 0 0 0 13.8-8a32 32 0 0 1 11.7-43.7l.7-.4l.5-.4h.1l.6-.6l.5-.5l.4-.5l.3-.6h.1l.2-.5v-.2a1.9 1.9 0 0 0 .2-.7h.1c0-.2.1-.4.1-.6s0-.2.1-.2v-2.1a6.4 6.4 0 0 0-.2-.7a1.9 1.9 0 0 0-.2-.7v-.2c0-.2-.1-.3-.2-.5l-.3-.7l-10-17.4a12 12 0 0 1 13.5-17.5a11.8 11.8 0 0 1 7.2 5.5l20 34.7a70.9 70.9 0 0 1 7.2 53.8Zm-125.8 78a8.2 8.2 0 0 1-6.6 3.4a8.6 8.6 0 0 1-4.6-1.4A117.9 117.9 0 0 1 41.1 208a8 8 0 1 1 13.8-8a102.6 102.6 0 0 0 30.8 33.4a8.1 8.1 0 0 1 2 11.2ZM168 31a8 8 0 0 1 8-8a60.2 60.2 0 0 1 52 30a7.9 7.9 0 0 1-3 10.9a7.1 7.1 0 0 1-4 1.1a8 8 0 0 1-6.9-4A44 44 0 0 0 176 39a8 8 0 0 1-8-8Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-moon{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M224.3 150.3a8.1 8.1 0 0 0-7.8-5.7l-2.2.4A84 84 0 0 1 111 41.6a5.7 5.7 0 0 0 .3-1.8a7.9 7.9 0 0 0-10.3-8.1a100 100 0 1 0 123.3 123.2a7.2 7.2 0 0 0 0-4.6ZM128 212A84 84 0 0 1 92.8 51.7a99.9 99.9 0 0 0 111.5 111.5A84.4 84.4 0 0 1 128 212Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-sun{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M128 60a68 68 0 1 0 68 68a68.1 68.1 0 0 0-68-68Zm0 120a52 52 0 1 1 52-52a52 52 0 0 1-52 52Zm-8-144V16a8 8 0 0 1 16 0v20a8 8 0 0 1-16 0ZM43.1 54.5a8.1 8.1 0 1 1 11.4-11.4l14.1 14.2a8 8 0 0 1 0 11.3a8.1 8.1 0 0 1-11.3 0ZM36 136H16a8 8 0 0 1 0-16h20a8 8 0 0 1 0 16Zm32.6 51.4a8 8 0 0 1 0 11.3l-14.1 14.2a8.3 8.3 0 0 1-5.7 2.3a8.5 8.5 0 0 1-5.7-2.3a8.1 8.1 0 0 1 0-11.4l14.2-14.1a8 8 0 0 1 11.3 0ZM136 220v20a8 8 0 0 1-16 0v-20a8 8 0 0 1 16 0Zm76.9-18.5a8.1 8.1 0 0 1 0 11.4a8.5 8.5 0 0 1-5.7 2.3a8.3 8.3 0 0 1-5.7-2.3l-14.1-14.2a8 8 0 0 1 11.3-11.3ZM248 128a8 8 0 0 1-8 8h-20a8 8 0 0 1 0-16h20a8 8 0 0 1 8 8Zm-60.6-59.4a8 8 0 0 1 0-11.3l14.1-14.2a8.1 8.1 0 0 1 11.4 11.4l-14.2 14.1a8.1 8.1 0 0 1-11.3 0Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.note{position:relative;display:inline-flex;align-items:center;border-left-width:4px;border-left-style:solid;--un-border-opacity:1;border-color:rgba(53,120,229,var(--un-border-opacity));border-radius:0.25rem;background-color:rgba(53,120,229,0.1);padding:0.5rem;text-decoration:none;}.note-red{position:relative;display:inline-flex;align-items:center;border-left-width:4px;border-left-style:solid;--un-border-opacity:1;border-color:rgba(53,120,229,var(--un-border-opacity));border-radius:0.25rem;background-color:rgba(53,120,229,0.1);background-color:rgba(185,28,28,0.1);padding:0.5rem;text-decoration:none;}.nv{position:relative;display:flex;align-items:center;border-radius:0.25rem;padding:0.5rem;--un-text-opacity:1;color:rgba(194,197,202,var(--un-text-opacity));text-decoration:none;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:125ms;}.nv_selected{position:relative;display:flex;align-items:center;border-left-width:4px;border-left-style:solid;border-radius:0.25rem;--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));padding:0.5rem;--un-text-opacity:1;color:rgba(194,197,202,var(--un-text-opacity));color:rgba(53,120,229,var(--un-text-opacity));text-decoration:none;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:125ms;}.input{height:2.5rem;display:flex;align-items:center;border-radius:0.25rem;border-style:none;--un-bg-opacity:1;background-color:rgba(233,236,239,var(--un-bg-opacity));padding:0.5rem;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);outline:2px solid transparent;outline-offset:2px;}.btn{user-select:none;border-radius:0.25rem;border-style:none;--un-bg-opacity:1;background-color:rgba(53,120,229,var(--un-bg-opacity));padding:0.5rem;font-weight:400;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));color:rgba(255,255,255,var(--un-text-opacity));--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);outline:2px solid transparent;outline-offset:2px;}.nv_selected:hover,.nv:hover{border-left-width:4px;border-left-style:solid;--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));--un-text-opacity:1;color:rgba(53,120,229,var(--un-text-opacity));}.dark .note{--un-border-opacity:1;border-color:rgba(103,214,237,var(--un-border-opacity));background-color:rgba(103,214,237,0.1);}.dark .note-red{--un-border-opacity:1;border-color:rgba(103,214,237,var(--un-border-opacity));background-color:rgba(103,214,237,0.1);background-color:rgba(185,28,28,0.1);}.btn:hover{--un-bg-opacity:1;background-color:rgba(45,102,195,var(--un-bg-opacity));}.dark .btn{--un-bg-opacity:1;background-color:rgba(103,214,237,var(--un-bg-opacity));font-weight:600;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));}.dark .btn:hover{--un-bg-opacity:1;background-color:rgba(57,202,232,var(--un-bg-opacity));}.dark .input{--un-bg-opacity:1;background-color:rgba(36,37,38,var(--un-bg-opacity));--un-text-opacity:1;color:rgba(227,227,227,var(--un-text-opacity));}.dark .note-red::after,.note-red::after{--un-bg-opacity:1;background-color:rgba(185,28,28,var(--un-bg-opacity));}.btn:active{--un-bg-opacity:1;background-color:rgba(37,84,160,var(--un-bg-opacity));}.dark .btn:active{--un-bg-opacity:1;background-color:rgba(25,181,213,var(--un-bg-opacity));}.dark .nv_selected,.dark .nv_selected:hover,.dark .nv:hover{--un-text-opacity:1;color:rgba(103,214,237,var(--un-text-opacity));} ::-webkit-scrollbar-thumb { background-color: #3578E5; } .dark ::-webkit-scrollbar-thumb { background-color: #67d6ed; } code { font-size: 0.75rem; font-family: "Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; border-radius: 0.25rem; background-color: #d6d8da; } .code-block { font-family: "Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; font-size: 0.875rem; } .dark code { background-color: #282a2e; } .visible{visibility:visible;}.absolute{position:absolute;}.left-2{left:0.5rem;}.top-2{top:0.5rem;}.z-2000{z-index:2000;}.grid{display:grid;}.grid-rows-\[2fr_auto\]{grid-template-rows:2fr auto;}.grid-rows-\[2px_2rem_1fr\]{grid-template-rows:2px 2rem 1fr;}.grid-rows-\[auto_1fr\]{grid-template-rows:auto 1fr;}.my-2{margin-top:0.5rem;margin-bottom:0.5rem;}.mb-2{margin-bottom:0.5rem;}.mr-2{margin-right:0.5rem;}.display-none,.hidden{display:none;}.children-h-10>*,.children\:h10>*{height:2.5rem;}.children\:h-100\%>*,.h-100\%{height:100%;}.children\:w-12>*{width:3rem;}.h-15rem{height:15rem;}.h-2px{height:2px;}.h-8{height:2rem;}.h-85\%{height:85%;}.h-auto{height:auto;}.h-screen{height:100vh;}.w-100\%{width:100%;}.w-8{width:2rem;}.w-screen{width:100vw;}.flex{display:flex;}.children\:inline-flex>*{display:inline-flex;}.flex-1{flex:1 1 0%;}.children-flex-none>*{flex:none;}.children\:grow>*,.grow{flex-grow:1;}.flex-row{flex-direction:row;}.flex-col{flex-direction:column;}.flex-wrap{flex-wrap:wrap;}@keyframes fade-in{from{opacity:0}to{opacity:1}}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.animate-fade-in{animation:fade-in 1s linear 1;}.animate-spin{animation:spin 1s linear infinite;}.animate-duration-300ms{animation-duration:300ms;}.cursor-ns-resize{cursor:ns-resize;}.cursor-pointer{cursor:pointer;}.select-none{user-select:none;}.children\:items-center>*,.items-center{align-items:center;}.self-center{align-self:center;}.children\:justify-center>*,.justify-center{justify-content:center;}.justify-between{justify-content:space-between;}.gap-1{grid-gap:0.25rem;gap:0.25rem;}.gap-2{grid-gap:0.5rem;gap:0.5rem;}.overflow-hidden{overflow:hidden;}.overflow-y-auto{overflow-y:auto;}.rd-1{border-radius:0.25rem;}.rd-8{border-radius:2rem;}.bg-accent{--un-bg-opacity:1;background-color:rgba(53,120,229,var(--un-bg-opacity));}.bg-black\/20{background-color:rgba(0,0,0,0.2);}.bg-darkPrimaryLighter{--un-bg-opacity:1;background-color:rgba(36,37,38,var(--un-bg-opacity));}.bg-darkPrimaryLighter\/60{background-color:rgba(36,37,38,0.6);}.bg-primary{--un-bg-opacity:1;background-color:rgba(255,255,255,var(--un-bg-opacity));}.bg-white\/5{background-color:rgba(255,255,255,0.05);}.dark .dark\:bg-darkAccent{--un-bg-opacity:1;background-color:rgba(103,214,237,var(--un-bg-opacity));}.dark .dark\:bg-darkPrimary{--un-bg-opacity:1;background-color:rgba(27,27,29,var(--un-bg-opacity));}.dark .dark\:hover\:bg-darkHoverOverlay:hover{--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));}.dark .dark\:hover\:bg-red-700:hover,.hover\:bg-red-700:hover{--un-bg-opacity:1;background-color:rgba(185,28,28,var(--un-bg-opacity));}.hover\:bg-hoverOverlay:hover{--un-bg-opacity:.05;background-color:rgba(0,0,0,var(--un-bg-opacity));}.active\:bg-accentDark:active{--un-bg-opacity:1;background-color:rgba(48,108,206,var(--un-bg-opacity));}.active\:bg-hoverOverlay\/25:active{background-color:rgba(0,0,0,0.25);}.active\:bg-hoverOverlayDarker:active{--un-bg-opacity:.1;background-color:rgba(0,0,0,var(--un-bg-opacity));}.active\:bg-red-700\/90:active,.dark .dark\:active\:bg-red-700\/90:active{background-color:rgba(185,28,28,0.9);}.dark .dark\:active\:bg-darkAccentDark:active{--un-bg-opacity:1;background-color:rgba(73,206,233,var(--un-bg-opacity));}.dark .dark\:active\:bg-darkHoverOverlay\/25:active{background-color:hsla(0,0%,100%,0.25);}.dark .dark\:active\:bg-darkHoverOverlayDarker:active{--un-bg-opacity:.1;background-color:hsla(0,0%,100%,var(--un-bg-opacity));}.p-1{padding:0.25rem;}.p-7{padding:1.75rem;}.px{padding-left:1rem;padding-right:1rem;}.px-2{padding-left:0.5rem;padding-right:0.5rem;}.px-5{padding-left:1.25rem;padding-right:1.25rem;}.children-pb-2>*{padding-bottom:0.5rem;}.children-pt8>*{padding-top:2rem;}.pl-2{padding-left:0.5rem;}.all\:font-mono *{font-family:"Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;}.all\:text-xs *{font-size:0.75rem;line-height:1rem;}.text-sm{font-size:0.875rem;line-height:1.25rem;}.font-700{font-weight:700;}.font-semibold{font-weight:600;}.dark .dark\:text-darkAccent{--un-text-opacity:1;color:rgba(103,214,237,var(--un-text-opacity));}.dark .dark\:text-darkAccentText,.text-primaryText{--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));}.dark .dark\:text-darkPrimaryText,.hover\:text-darkPrimaryText:hover,.text-darkPrimaryText,.active\:text-darkPrimaryText:active{--un-text-opacity:1;color:rgba(227,227,227,var(--un-text-opacity));}.text-accent{--un-text-opacity:1;color:rgba(53,120,229,var(--un-text-opacity));}.text-accentText{--un-text-opacity:1;color:rgba(255,255,255,var(--un-text-opacity));}.filter{filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia);}.transition-colors-250{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:250ms;}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}@media (max-width: 639.9px){.lt-sm\:absolute{position:absolute;}.lt-sm\:z-1999{z-index:1999;}.lt-sm\:h-screen{height:100vh;}.lt-sm\:flex{display:flex;}.lt-sm\:bg-darkPrimaryLighter{--un-bg-opacity:1;background-color:rgba(36,37,38,var(--un-bg-opacity));}.lt-sm\:pl-10{padding-left:2.5rem;}.lt-sm\:shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);}.lt-sm\:shadow-lg{--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);}.lt-sm\:transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}}*:not(h1,h2,h3,h4,h5,h6){margin:0;padding:0}*{box-sizing:border-box;font-family:Rubik,sans-serif}::-webkit-scrollbar{width:.25rem;height:3px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:.25rem}code{padding:.05rem .25rem}code.code-block{padding:.5rem}#sidebar{width:18.75rem}@media screen and (max-width: 640px){#sidebar{--translate-x: -18.75rem;transform:translate(var(--translate-x))}}ul.svelte-gbh3pt{list-style:none;margin:0;padding:0;padding-left:var(--nodePaddingLeft, 1rem);border-left:var(--nodeBorderLeft, 1px dotted #9ca3af);color:var(--nodeColor, #374151)}.hidden.svelte-gbh3pt{display:none}.bracket.svelte-gbh3pt{cursor:pointer}.bracket.svelte-gbh3pt:hover{background:var(--bracketHoverBackground, #d1d5db)}.comma.svelte-gbh3pt{color:var(--nodeColor, #374151)}.val.svelte-gbh3pt{color:var(--leafDefaultColor, #9ca3af)}.val.string.svelte-gbh3pt{color:var(--leafStringColor, #059669)}.val.number.svelte-gbh3pt{color:var(--leafNumberColor, #d97706)}.val.boolean.svelte-gbh3pt{color:var(--leafBooleanColor, #2563eb)}.spinner.svelte-4xesec{height:1.2rem;width:1.2rem;border-radius:50rem;color:currentColor;border:2px dashed currentColor} +*,::before,::after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x:var(--un-empty,/*!*/ /*!*/);--un-pan-y:var(--un-empty,/*!*/ /*!*/);--un-pinch-zoom:var(--un-empty,/*!*/ /*!*/);--un-scroll-snap-strictness:proximity;--un-ordinal:var(--un-empty,/*!*/ /*!*/);--un-slashed-zero:var(--un-empty,/*!*/ /*!*/);--un-numeric-figure:var(--un-empty,/*!*/ /*!*/);--un-numeric-spacing:var(--un-empty,/*!*/ /*!*/);--un-numeric-fraction:var(--un-empty,/*!*/ /*!*/);--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 #0000;--un-ring-shadow:0 0 #0000;--un-shadow-inset:var(--un-empty,/*!*/ /*!*/);--un-shadow:0 0 #0000;--un-ring-inset:var(--un-empty,/*!*/ /*!*/);--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,0.5);--un-blur:var(--un-empty,/*!*/ /*!*/);--un-brightness:var(--un-empty,/*!*/ /*!*/);--un-contrast:var(--un-empty,/*!*/ /*!*/);--un-drop-shadow:var(--un-empty,/*!*/ /*!*/);--un-grayscale:var(--un-empty,/*!*/ /*!*/);--un-hue-rotate:var(--un-empty,/*!*/ /*!*/);--un-invert:var(--un-empty,/*!*/ /*!*/);--un-saturate:var(--un-empty,/*!*/ /*!*/);--un-sepia:var(--un-empty,/*!*/ /*!*/);--un-backdrop-blur:var(--un-empty,/*!*/ /*!*/);--un-backdrop-brightness:var(--un-empty,/*!*/ /*!*/);--un-backdrop-contrast:var(--un-empty,/*!*/ /*!*/);--un-backdrop-grayscale:var(--un-empty,/*!*/ /*!*/);--un-backdrop-hue-rotate:var(--un-empty,/*!*/ /*!*/);--un-backdrop-invert:var(--un-empty,/*!*/ /*!*/);--un-backdrop-opacity:var(--un-empty,/*!*/ /*!*/);--un-backdrop-saturate:var(--un-empty,/*!*/ /*!*/);--un-backdrop-sepia:var(--un-empty,/*!*/ /*!*/);}@font-face { font-family: 'Fira Code'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/firacode/v21/uU9eCBsR6Z2vfE9aq3bL0fxyUs4tcw4W_D1sFVc.ttf) format('truetype');}@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/firamono/v14/N0bX2SlFPv1weGeLZDtQIQ.ttf) format('truetype');}@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url(https://fonts.gstatic.com/s/firamono/v14/N0bS2SlFPv1weGeLZDtondv3mQ.ttf) format('truetype');}@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/rubik/v21/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4i1UA.ttf) format('truetype');}.i-codicon-bell-dot{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M12.994 7.875A4.008 4.008 0 0 1 12 8h-.01v.217c0 .909.143 1.818.442 2.691l.371 1.113h-9.63v-.012l.37-1.113a8.633 8.633 0 0 0 .443-2.691V6.004c0-.563.12-1.113.347-1.616c.227-.514.55-.969.969-1.34c.419-.382.91-.67 1.436-.837c.538-.18 1.1-.24 1.65-.18l.12.018a4 4 0 0 1 .673-.887a5.15 5.15 0 0 0-.697-.135c-.694-.072-1.4 0-2.07.227c-.67.215-1.28.574-1.794 1.053a4.923 4.923 0 0 0-1.208 1.675a5.067 5.067 0 0 0-.431 2.022v2.2a7.61 7.61 0 0 1-.383 2.37L2 12.343l.479.658h3.505c0 .526.215 1.04.586 1.412c.37.37.885.586 1.412.586c.526 0 1.04-.215 1.411-.586s.587-.886.587-1.412h3.505l.478-.658l-.586-1.77a7.63 7.63 0 0 1-.383-2.381v-.318ZM7.982 14.02a.997.997 0 0 0 .706-.3a.939.939 0 0 0 .287-.705H6.977c0 .263.107.514.299.706a.999.999 0 0 0 .706.299Z' clip-rule='evenodd'/%3E%3Cpath d='M12 7a3 3 0 1 0 0-6a3 3 0 0 0 0 6Z'/%3E%3C/g%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-chrome-close{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m7.116 8l-4.558 4.558l.884.884L8 8.884l4.558 4.558l.884-.884L8.884 8l4.558-4.558l-.884-.884L8 7.116L3.442 2.558l-.884.884L7.116 8z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-chrome-maximize{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M3 3v10h10V3H3zm9 9H4V4h8v8z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-chrome-minimize{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M14 8v1H3V8h11z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-chrome-restore{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath d='M3 5v9h9V5H3zm8 8H4V6h7v7z'/%3E%3Cpath fill-rule='evenodd' d='M5 5h1V4h7v7h-1v1h2V3H5v2z' clip-rule='evenodd'/%3E%3C/g%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-clear-all{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m10 12.6l.7.7l1.6-1.6l1.6 1.6l.8-.7L13 11l1.7-1.6l-.8-.8l-1.6 1.7l-1.6-1.7l-.7.8l1.6 1.6l-1.6 1.6zM1 4h14V3H1v1zm0 3h14V6H1v1zm8 2.5V9H1v1h8v-.5zM9 13v-1H1v1h8z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-clippy{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M7 13.992H4v-9h8v2h1v-2.5l-.5-.5H11v-1h-1a2 2 0 0 0-4 0H4.94v1H3.5l-.5.5v10l.5.5H7v-1zm0-11.2a1 1 0 0 1 .8-.8a1 1 0 0 1 .58.06a.94.94 0 0 1 .45.36a1 1 0 1 1-1.75.94a1 1 0 0 1-.08-.56zm7.08 9.46L13 13.342v-5.35h-1v5.34l-1.08-1.08l-.71.71l1.94 1.93h.71l1.93-1.93l-.71-.71zm-5.92-4.16h.71l1.93 1.93l-.71.71l-1.08-1.08v5.34h-1v-5.35l-1.08 1.09l-.71-.71l1.94-1.93z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-close{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m8 8.707l3.646 3.647l.708-.707L8.707 8l3.647-3.646l-.707-.708L8 7.293L4.354 3.646l-.707.708L7.293 8l-3.646 3.646l.707.708L8 8.707z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-cloud-download{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M11.957 6h.05a2.99 2.99 0 0 1 2.116.879a3.003 3.003 0 0 1 0 4.242a2.99 2.99 0 0 1-2.117.879v-1a2.002 2.002 0 0 0 0-4h-.914l-.123-.857a2.49 2.49 0 0 0-2.126-2.122A2.478 2.478 0 0 0 6.231 5.5l-.333.762l-.809-.189A2.49 2.49 0 0 0 4.523 6c-.662 0-1.297.263-1.764.732A2.503 2.503 0 0 0 4.523 11h.498v1h-.498a3.486 3.486 0 0 1-2.628-1.16a3.502 3.502 0 0 1 1.958-5.78a3.462 3.462 0 0 1 1.468.04a3.486 3.486 0 0 1 3.657-2.06A3.479 3.479 0 0 1 11.957 6zm-5.25 5.121l1.314 1.314V7h.994v5.4l1.278-1.279l.707.707l-2.146 2.147h-.708L6 11.829l.707-.708z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-files{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M17.5 0h-9L7 1.5V6H2.5L1 7.5v15.07L2.5 24h12.07L16 22.57V18h4.7l1.3-1.43V4.5L17.5 0zm0 2.12l2.38 2.38H17.5V2.12zm-3 20.38h-12v-15H7v9.07L8.5 18h6v4.5zm6-6h-12v-15H16V6h4.5v10.5z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-hubot{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M8.48 4h4l.5.5v2.03h.52l.5.5V8l-.5.5h-.52v3l-.5.5H9.36l-2.5 2.76L6 14.4V12H3.5l-.5-.64V8.5h-.5L2 8v-.97l.5-.5H3V4.36L3.53 4h4V2.86A1 1 0 0 1 7 2a1 1 0 0 1 2 0a1 1 0 0 1-.52.83V4zM12 8V5H4v5.86l2.5.14H7v2.19l1.8-2.04l.35-.15H12V8zm-2.12.51a2.71 2.71 0 0 1-1.37.74v-.01a2.71 2.71 0 0 1-2.42-.74l-.7.71c.34.34.745.608 1.19.79c.45.188.932.286 1.42.29a3.7 3.7 0 0 0 2.58-1.07l-.7-.71zM6.49 6.5h-1v1h1v-1zm3 0h1v1h-1v-1z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-link-external{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath d='M1.5 1H6v1H2v12h12v-4h1v4.5l-.5.5h-13l-.5-.5v-13l.5-.5z'/%3E%3Cpath d='M15 1.5V8h-1V2.707L7.243 9.465l-.707-.708L13.293 2H8V1h6.5l.5.5z'/%3E%3C/g%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-menu{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 5H0V4h16v1zm0 8H0v-1h16v1zm0-4.008H0V8h16v.992z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-multiple-windows{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m6 1.5l.5-.5h8l.5.5v7l-.5.5H12V8h2V4H7v1H6V1.5zM7 2v1h7V2H7zM1.5 7l-.5.5v7l.5.5h8l.5-.5v-7L9.5 7h-8zM2 9V8h7v1H2zm0 1h7v4H2v-4z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-radio-tower{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2.998 5.58a5.55 5.55 0 0 1 1.62-3.88l-.71-.7a6.45 6.45 0 0 0 0 9.16l.71-.7a5.55 5.55 0 0 1-1.62-3.88zm1.06 0a4.42 4.42 0 0 0 1.32 3.17l.71-.71a3.27 3.27 0 0 1-.76-1.12a3.45 3.45 0 0 1 0-2.67a3.22 3.22 0 0 1 .76-1.13l-.71-.71a4.46 4.46 0 0 0-1.32 3.17zm7.65 3.21l-.71-.71c.33-.32.59-.704.76-1.13a3.449 3.449 0 0 0 0-2.67a3.22 3.22 0 0 0-.76-1.13l.71-.7a4.468 4.468 0 0 1 0 6.34zM13.068 1l-.71.71a5.43 5.43 0 0 1 0 7.74l.71.71a6.45 6.45 0 0 0 0-9.16zM9.993 5.43a1.5 1.5 0 0 1-.245.98a2 2 0 0 1-.27.23l3.44 7.73l-.92.4l-.77-1.73h-5.54l-.77 1.73l-.92-.4l3.44-7.73a1.52 1.52 0 0 1-.33-1.63a1.55 1.55 0 0 1 .56-.68a1.5 1.5 0 0 1 2.325 1.1zm-1.595-.34a.52.52 0 0 0-.25.14a.52.52 0 0 0-.11.22a.48.48 0 0 0 0 .29c.04.09.102.17.18.23a.54.54 0 0 0 .28.08a.51.51 0 0 0 .5-.5a.54.54 0 0 0-.08-.28a.58.58 0 0 0-.23-.18a.48.48 0 0 0-.29 0zm.23 2.05h-.27l-.87 1.94h2l-.86-1.94zm2.2 4.94l-.89-2h-2.88l-.89 2h4.66z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-record-keys{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M14 3H3a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1zm0 8H3V4h11v7zm-3-6h-1v1h1V5zm-1 2H9v1h1V7zm2-2h1v1h-1V5zm1 4h-1v1h1V9zM6 9h5v1H6V9zm7-2h-2v1h2V7zM8 5h1v1H8V5zm0 2H7v1h1V7zM4 9h1v1H4V9zm0-4h1v1H4V5zm3 0H6v1h1V5zM4 7h2v1H4V7z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-terminal{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M3 1.5L1.5 3v18L3 22.5h18l1.5-1.5V3L21 1.5H3zM3 21V3h18v18H3zm5.656-4.01l1.038 1.061l5.26-5.243v-.912l-5.26-5.26l-1.035 1.06l4.59 4.702l-4.593 4.592z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-terminal-bash{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M13.655 3.56L8.918.75a1.785 1.785 0 0 0-1.82 0L2.363 3.56a1.889 1.889 0 0 0-.921 1.628v5.624a1.889 1.889 0 0 0 .913 1.627l4.736 2.812a1.785 1.785 0 0 0 1.82 0l4.736-2.812a1.888 1.888 0 0 0 .913-1.627V5.188a1.889 1.889 0 0 0-.904-1.627zm-3.669 8.781v.404a.149.149 0 0 1-.07.124l-.239.137c-.038.02-.07 0-.07-.053v-.396a.78.78 0 0 1-.545.053a.073.073 0 0 1-.027-.09l.086-.365a.153.153 0 0 1 .071-.096a.048.048 0 0 1 .038 0a.662.662 0 0 0 .497-.063a.662.662 0 0 0 .37-.567c0-.206-.112-.292-.384-.293c-.344 0-.661-.066-.67-.574A1.47 1.47 0 0 1 9.6 9.437V9.03a.147.147 0 0 1 .07-.126l.231-.147c.038-.02.07 0 .07.054v.409a.754.754 0 0 1 .453-.055a.073.073 0 0 1 .03.095l-.081.362a.156.156 0 0 1-.065.09a.055.055 0 0 1-.035 0a.6.6 0 0 0-.436.072a.549.549 0 0 0-.331.486c0 .185.098.242.425.248c.438 0 .627.199.632.639a1.568 1.568 0 0 1-.576 1.185zm2.481-.68a.094.094 0 0 1-.036.092l-1.198.727a.034.034 0 0 1-.04.003a.035.035 0 0 1-.016-.037v-.31a.086.086 0 0 1 .055-.076l1.179-.706a.035.035 0 0 1 .056.035v.273zm.827-6.914L8.812 7.515c-.559.331-.97.693-.97 1.367v5.52c0 .404.165.662.413.741a1.465 1.465 0 0 1-.248.025c-.264 0-.522-.072-.748-.207L2.522 12.15a1.558 1.558 0 0 1-.75-1.338V5.188a1.558 1.558 0 0 1 .75-1.34l4.738-2.81a1.46 1.46 0 0 1 1.489 0l4.736 2.812a1.548 1.548 0 0 1 .728 1.083c-.154-.334-.508-.427-.92-.185h.002z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-window{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M14.5 2h-13l-.5.5v11l.5.5h13l.5-.5v-11l-.5-.5zM14 13H2V6h12v7zm0-8H2V3h12v2z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-broadcast{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M128 88a40 40 0 1 0 40 40a40 40 0 0 0-40-40Zm0 64a24 24 0 1 1 24-24a24.1 24.1 0 0 1-24 24Zm-59-48.9a64.5 64.5 0 0 0 0 49.8a65.4 65.4 0 0 0 13.7 20.4a7.9 7.9 0 0 1 0 11.3a8 8 0 0 1-5.6 2.3a8.3 8.3 0 0 1-5.7-2.3a80 80 0 0 1-17.1-25.5a79.9 79.9 0 0 1 0-62.2a80 80 0 0 1 17.1-25.5a8 8 0 0 1 11.3 0a7.9 7.9 0 0 1 0 11.3A65.4 65.4 0 0 0 69 103.1Zm132.7 56a80 80 0 0 1-17.1 25.5a8.3 8.3 0 0 1-5.7 2.3a8 8 0 0 1-5.6-2.3a7.9 7.9 0 0 1 0-11.3a65.4 65.4 0 0 0 13.7-20.4a64.5 64.5 0 0 0 0-49.8a65.4 65.4 0 0 0-13.7-20.4a7.9 7.9 0 0 1 0-11.3a8 8 0 0 1 11.3 0a80 80 0 0 1 17.1 25.5a79.9 79.9 0 0 1 0 62.2ZM54.5 201.5a8.1 8.1 0 0 1 0 11.4a8.3 8.3 0 0 1-5.7 2.3a8.5 8.5 0 0 1-5.7-2.3a121.8 121.8 0 0 1-25.7-38.2a120.7 120.7 0 0 1 0-93.4a121.8 121.8 0 0 1 25.7-38.2a8.1 8.1 0 0 1 11.4 11.4A103.5 103.5 0 0 0 24 128a103.5 103.5 0 0 0 30.5 73.5ZM248 128a120.2 120.2 0 0 1-9.4 46.7a121.8 121.8 0 0 1-25.7 38.2a8.5 8.5 0 0 1-5.7 2.3a8.3 8.3 0 0 1-5.7-2.3a8.1 8.1 0 0 1 0-11.4A103.5 103.5 0 0 0 232 128a103.5 103.5 0 0 0-30.5-73.5a8.1 8.1 0 1 1 11.4-11.4a121.8 121.8 0 0 1 25.7 38.2A120.2 120.2 0 0 1 248 128Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-globe-hemisphere-west{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M221.6 173.3A102.9 102.9 0 0 0 232 128a104.2 104.2 0 0 0-77.2-100.5h-.5A103.8 103.8 0 0 0 60.4 49l-1.3 1.2A103.9 103.9 0 0 0 128 232h2.4a104.3 104.3 0 0 0 90.6-57.4ZM216 128a89.3 89.3 0 0 1-5.5 30.7l-46.4-28.5a16.6 16.6 0 0 0-6.3-2.3l-22.8-3a16.1 16.1 0 0 0-15.3 6.8h-8.6l-3.8-7.9a15.9 15.9 0 0 0-11-8.7l-6.6-1.4l4.6-10.8h21.4a16.1 16.1 0 0 0 7.7-2l12.2-6.8a16.1 16.1 0 0 0 3-2.1l26.9-24.4a15.7 15.7 0 0 0 4.5-16.9a88 88 0 0 1 46 77.3Zm-68.8-85.9l7.6 13.7l-26.9 24.3l-12.2 6.8H94.3a15.9 15.9 0 0 0-14.7 9.8l-5.3 12.4l-10.9-29.2l8.1-19.3a88 88 0 0 1 75.7-18.5ZM40 128a87.1 87.1 0 0 1 9.5-39.7l10.4 27.9a16.1 16.1 0 0 0 11.6 10l5.5 1.2h.1l15.8 3.4l3.8 7.9a16.3 16.3 0 0 0 14.4 9h1.2l-7.7 17.2a15.9 15.9 0 0 0 2.8 17.4l18.8 20.4l-2.5 13.2A88.1 88.1 0 0 1 40 128Zm100.1 87.2l1.8-9.5a16 16 0 0 0-3.9-13.9l-18.8-20.3l12.7-28.7l1-2.1l22.8 3.1l47.8 29.4a88.5 88.5 0 0 1-63.4 42Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-hand-waving{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m220.2 104l-20-34.7a28.1 28.1 0 0 0-47.3-1.9l-17.3-30a28.1 28.1 0 0 0-38.3-10.3a29.4 29.4 0 0 0-9.9 9.6a27.9 27.9 0 0 0-11.5-6.2a27.2 27.2 0 0 0-21.2 2.8a27.9 27.9 0 0 0-10.3 38.2l3.4 5.8A28.5 28.5 0 0 0 36 81a28.1 28.1 0 0 0-10.2 38.2l42 72.8a88 88 0 1 0 152.4-88Zm-6.7 62.6a71.2 71.2 0 0 1-33.5 43.7A72.1 72.1 0 0 1 81.6 184l-42-72.8a12 12 0 0 1 20.8-12l22 38.1l.6.9v.2l.5.5l.2.2l.7.6h.1l.7.5h.3l.6.3h.2l.9.3h.1l.8.2h2.2l.9-.2h.3l.6-.2h.3l.9-.4a8.1 8.1 0 0 0 2.9-11l-22-38.1l-16-27.7a12 12 0 0 1-1.2-9.1a11.8 11.8 0 0 1 5.6-7.3a12 12 0 0 1 9.1-1.2a12.5 12.5 0 0 1 7.3 5.6l8 14h.1l26 45a7 7 0 0 0 1.5 1.9a8 8 0 0 0 12.3-9.9l-26-45a12 12 0 1 1 20.8-12l30 51.9l6.3 11a48.1 48.1 0 0 0-10.9 61a8 8 0 0 0 13.8-8a32 32 0 0 1 11.7-43.7l.7-.4l.5-.4h.1l.6-.6l.5-.5l.4-.5l.3-.6h.1l.2-.5v-.2a1.9 1.9 0 0 0 .2-.7h.1c0-.2.1-.4.1-.6s0-.2.1-.2v-2.1a6.4 6.4 0 0 0-.2-.7a1.9 1.9 0 0 0-.2-.7v-.2c0-.2-.1-.3-.2-.5l-.3-.7l-10-17.4a12 12 0 0 1 13.5-17.5a11.8 11.8 0 0 1 7.2 5.5l20 34.7a70.9 70.9 0 0 1 7.2 53.8Zm-125.8 78a8.2 8.2 0 0 1-6.6 3.4a8.6 8.6 0 0 1-4.6-1.4A117.9 117.9 0 0 1 41.1 208a8 8 0 1 1 13.8-8a102.6 102.6 0 0 0 30.8 33.4a8.1 8.1 0 0 1 2 11.2ZM168 31a8 8 0 0 1 8-8a60.2 60.2 0 0 1 52 30a7.9 7.9 0 0 1-3 10.9a7.1 7.1 0 0 1-4 1.1a8 8 0 0 1-6.9-4A44 44 0 0 0 176 39a8 8 0 0 1-8-8Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-moon{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M224.3 150.3a8.1 8.1 0 0 0-7.8-5.7l-2.2.4A84 84 0 0 1 111 41.6a5.7 5.7 0 0 0 .3-1.8a7.9 7.9 0 0 0-10.3-8.1a100 100 0 1 0 123.3 123.2a7.2 7.2 0 0 0 0-4.6ZM128 212A84 84 0 0 1 92.8 51.7a99.9 99.9 0 0 0 111.5 111.5A84.4 84.4 0 0 1 128 212Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-sun{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M128 60a68 68 0 1 0 68 68a68.1 68.1 0 0 0-68-68Zm0 120a52 52 0 1 1 52-52a52 52 0 0 1-52 52Zm-8-144V16a8 8 0 0 1 16 0v20a8 8 0 0 1-16 0ZM43.1 54.5a8.1 8.1 0 1 1 11.4-11.4l14.1 14.2a8 8 0 0 1 0 11.3a8.1 8.1 0 0 1-11.3 0ZM36 136H16a8 8 0 0 1 0-16h20a8 8 0 0 1 0 16Zm32.6 51.4a8 8 0 0 1 0 11.3l-14.1 14.2a8.3 8.3 0 0 1-5.7 2.3a8.5 8.5 0 0 1-5.7-2.3a8.1 8.1 0 0 1 0-11.4l14.2-14.1a8 8 0 0 1 11.3 0ZM136 220v20a8 8 0 0 1-16 0v-20a8 8 0 0 1 16 0Zm76.9-18.5a8.1 8.1 0 0 1 0 11.4a8.5 8.5 0 0 1-5.7 2.3a8.3 8.3 0 0 1-5.7-2.3l-14.1-14.2a8 8 0 0 1 11.3-11.3ZM248 128a8 8 0 0 1-8 8h-20a8 8 0 0 1 0-16h20a8 8 0 0 1 8 8Zm-60.6-59.4a8 8 0 0 1 0-11.3l14.1-14.2a8.1 8.1 0 0 1 11.4 11.4l-14.2 14.1a8.1 8.1 0 0 1-11.3 0Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.note{position:relative;display:inline-flex;align-items:center;border-left-width:4px;border-left-style:solid;--un-border-opacity:1;border-color:rgba(53,120,229,var(--un-border-opacity));border-radius:0.25rem;background-color:rgba(53,120,229,0.1);padding:0.5rem;text-decoration:none;}.note-red{position:relative;display:inline-flex;align-items:center;border-left-width:4px;border-left-style:solid;--un-border-opacity:1;border-color:rgba(53,120,229,var(--un-border-opacity));border-radius:0.25rem;background-color:rgba(53,120,229,0.1);background-color:rgba(185,28,28,0.1);padding:0.5rem;text-decoration:none;}.nv{position:relative;display:flex;align-items:center;border-radius:0.25rem;padding:0.5rem;--un-text-opacity:1;color:rgba(194,197,202,var(--un-text-opacity));text-decoration:none;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:125ms;}.nv_selected{position:relative;display:flex;align-items:center;border-left-width:4px;border-left-style:solid;border-radius:0.25rem;--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));padding:0.5rem;--un-text-opacity:1;color:rgba(194,197,202,var(--un-text-opacity));color:rgba(53,120,229,var(--un-text-opacity));text-decoration:none;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:125ms;}.input{height:2.5rem;display:flex;align-items:center;border-radius:0.25rem;border-style:none;--un-bg-opacity:1;background-color:rgba(233,236,239,var(--un-bg-opacity));padding:0.5rem;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);outline:2px solid transparent;outline-offset:2px;}.btn{user-select:none;border-radius:0.25rem;border-style:none;--un-bg-opacity:1;background-color:rgba(53,120,229,var(--un-bg-opacity));padding:0.5rem;font-weight:400;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));color:rgba(255,255,255,var(--un-text-opacity));--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);outline:2px solid transparent;outline-offset:2px;}.nv_selected:hover,.nv:hover{border-left-width:4px;border-left-style:solid;--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));--un-text-opacity:1;color:rgba(53,120,229,var(--un-text-opacity));}.dark .note{--un-border-opacity:1;border-color:rgba(103,214,237,var(--un-border-opacity));background-color:rgba(103,214,237,0.1);}.dark .note-red{--un-border-opacity:1;border-color:rgba(103,214,237,var(--un-border-opacity));background-color:rgba(103,214,237,0.1);background-color:rgba(185,28,28,0.1);}.btn:hover{--un-bg-opacity:1;background-color:rgba(45,102,195,var(--un-bg-opacity));}.dark .btn{--un-bg-opacity:1;background-color:rgba(103,214,237,var(--un-bg-opacity));font-weight:600;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));}.dark .btn:hover{--un-bg-opacity:1;background-color:rgba(57,202,232,var(--un-bg-opacity));}.dark .input{--un-bg-opacity:1;background-color:rgba(36,37,38,var(--un-bg-opacity));--un-text-opacity:1;color:rgba(227,227,227,var(--un-text-opacity));}.dark .note-red::after,.note-red::after{--un-bg-opacity:1;background-color:rgba(185,28,28,var(--un-bg-opacity));}.btn:active{--un-bg-opacity:1;background-color:rgba(37,84,160,var(--un-bg-opacity));}.dark .btn:active{--un-bg-opacity:1;background-color:rgba(25,181,213,var(--un-bg-opacity));}.dark .nv_selected,.dark .nv_selected:hover,.dark .nv:hover{--un-text-opacity:1;color:rgba(103,214,237,var(--un-text-opacity));} ::-webkit-scrollbar-thumb { background-color: #3578E5; } .dark ::-webkit-scrollbar-thumb { background-color: #67d6ed; } code { font-size: 0.75rem; font-family: "Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; border-radius: 0.25rem; background-color: #d6d8da; } .code-block { font-family: "Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; font-size: 0.875rem; } .dark code { background-color: #282a2e; } .visible{visibility:visible;}.absolute{position:absolute;}.left-2{left:0.5rem;}.top-2{top:0.5rem;}.z-2000{z-index:2000;}.grid{display:grid;}.grid-rows-\[2fr_auto\]{grid-template-rows:2fr auto;}.grid-rows-\[2px_2rem_1fr\]{grid-template-rows:2px 2rem 1fr;}.grid-rows-\[auto_1fr\]{grid-template-rows:auto 1fr;}.my-2{margin-top:0.5rem;margin-bottom:0.5rem;}.mb-2{margin-bottom:0.5rem;}.mr-2{margin-right:0.5rem;}.display-none,.hidden{display:none;}.children-h-10>*,.children\:h10>*{height:2.5rem;}.children\:h-100\%>*,.h-100\%{height:100%;}.children\:w-12>*{width:3rem;}.h-15rem{height:15rem;}.h-2px{height:2px;}.h-8{height:2rem;}.h-85\%{height:85%;}.h-auto{height:auto;}.h-screen{height:100vh;}.w-100\%{width:100%;}.w-8{width:2rem;}.w-screen{width:100vw;}.flex{display:flex;}.children\:inline-flex>*{display:inline-flex;}.flex-1{flex:1 1 0%;}.children-flex-none>*{flex:none;}.children\:grow>*,.grow{flex-grow:1;}.flex-row{flex-direction:row;}.flex-col{flex-direction:column;}.flex-wrap{flex-wrap:wrap;}@keyframes fade-in{from{opacity:0}to{opacity:1}}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.animate-fade-in{animation:fade-in 1s linear 1;}.animate-spin{animation:spin 1s linear infinite;}.animate-duration-300ms{animation-duration:300ms;}.cursor-ns-resize{cursor:ns-resize;}.cursor-pointer{cursor:pointer;}.select-none{user-select:none;}.children\:items-center>*,.items-center{align-items:center;}.self-center{align-self:center;}.children\:justify-center>*,.justify-center{justify-content:center;}.justify-between{justify-content:space-between;}.gap-1{grid-gap:0.25rem;gap:0.25rem;}.gap-2{grid-gap:0.5rem;gap:0.5rem;}.overflow-hidden{overflow:hidden;}.overflow-y-auto{overflow-y:auto;}.rd-1{border-radius:0.25rem;}.rd-8{border-radius:2rem;}.bg-accent{--un-bg-opacity:1;background-color:rgba(53,120,229,var(--un-bg-opacity));}.bg-black\/20{background-color:rgba(0,0,0,0.2);}.bg-darkPrimaryLighter{--un-bg-opacity:1;background-color:rgba(36,37,38,var(--un-bg-opacity));}.bg-darkPrimaryLighter\/60{background-color:rgba(36,37,38,0.6);}.bg-primary{--un-bg-opacity:1;background-color:rgba(255,255,255,var(--un-bg-opacity));}.bg-white\/5{background-color:rgba(255,255,255,0.05);}.dark .dark\:bg-darkAccent{--un-bg-opacity:1;background-color:rgba(103,214,237,var(--un-bg-opacity));}.dark .dark\:bg-darkPrimary{--un-bg-opacity:1;background-color:rgba(27,27,29,var(--un-bg-opacity));}.dark .dark\:hover\:bg-darkHoverOverlay:hover{--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));}.dark .dark\:hover\:bg-red-700:hover,.hover\:bg-red-700:hover{--un-bg-opacity:1;background-color:rgba(185,28,28,var(--un-bg-opacity));}.hover\:bg-hoverOverlay:hover{--un-bg-opacity:.05;background-color:rgba(0,0,0,var(--un-bg-opacity));}.active\:bg-accentDark:active{--un-bg-opacity:1;background-color:rgba(48,108,206,var(--un-bg-opacity));}.active\:bg-hoverOverlay\/25:active{background-color:rgba(0,0,0,0.25);}.active\:bg-hoverOverlayDarker:active{--un-bg-opacity:.1;background-color:rgba(0,0,0,var(--un-bg-opacity));}.active\:bg-red-700\/90:active,.dark .dark\:active\:bg-red-700\/90:active{background-color:rgba(185,28,28,0.9);}.dark .dark\:active\:bg-darkAccentDark:active{--un-bg-opacity:1;background-color:rgba(73,206,233,var(--un-bg-opacity));}.dark .dark\:active\:bg-darkHoverOverlay\/25:active{background-color:hsla(0,0%,100%,0.25);}.dark .dark\:active\:bg-darkHoverOverlayDarker:active{--un-bg-opacity:.1;background-color:hsla(0,0%,100%,var(--un-bg-opacity));}.p-1{padding:0.25rem;}.p-7{padding:1.75rem;}.px{padding-left:1rem;padding-right:1rem;}.px-2{padding-left:0.5rem;padding-right:0.5rem;}.px-5{padding-left:1.25rem;padding-right:1.25rem;}.children-pb-2>*{padding-bottom:0.5rem;}.children-pt8>*{padding-top:2rem;}.pl-2{padding-left:0.5rem;}.all\:font-mono *{font-family:"Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;}.all\:text-xs *{font-size:0.75rem;line-height:1rem;}.text-sm{font-size:0.875rem;line-height:1.25rem;}.font-700{font-weight:700;}.font-semibold{font-weight:600;}.dark .dark\:text-darkAccent{--un-text-opacity:1;color:rgba(103,214,237,var(--un-text-opacity));}.dark .dark\:text-darkAccentText,.text-primaryText{--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));}.dark .dark\:text-darkPrimaryText,.hover\:text-darkPrimaryText:hover,.text-darkPrimaryText,.active\:text-darkPrimaryText:active{--un-text-opacity:1;color:rgba(227,227,227,var(--un-text-opacity));}.text-accent{--un-text-opacity:1;color:rgba(53,120,229,var(--un-text-opacity));}.text-accentText{--un-text-opacity:1;color:rgba(255,255,255,var(--un-text-opacity));}.filter{filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia);}.transition-colors-250{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:250ms;}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}@media (max-width: 639.9px){.lt-sm\:absolute{position:absolute;}.lt-sm\:z-1999{z-index:1999;}.lt-sm\:h-screen{height:100vh;}.lt-sm\:flex{display:flex;}.lt-sm\:bg-darkPrimaryLighter{--un-bg-opacity:1;background-color:rgba(36,37,38,var(--un-bg-opacity));}.lt-sm\:pl-10{padding-left:2.5rem;}.lt-sm\:shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);}.lt-sm\:shadow-lg{--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);}.lt-sm\:transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}}*:not(h1,h2,h3,h4,h5,h6){margin:0;padding:0}*{box-sizing:border-box;font-family:Rubik,sans-serif}::-webkit-scrollbar{width:.25rem;height:3px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:.25rem}code{padding:.05rem .25rem}code.code-block{padding:.5rem}#sidebar{width:18.75rem}@media screen and (max-width: 640px){#sidebar{--translate-x: -18.75rem;transform:translate(var(--translate-x))}}ul.svelte-gbh3pt{list-style:none;margin:0;padding:0;padding-left:var(--nodePaddingLeft, 1rem);border-left:var(--nodeBorderLeft, 1px dotted #9ca3af);color:var(--nodeColor, #374151)}.hidden.svelte-gbh3pt{display:none}.bracket.svelte-gbh3pt{cursor:pointer}.bracket.svelte-gbh3pt:hover{background:var(--bracketHoverBackground, #d1d5db)}.comma.svelte-gbh3pt{color:var(--nodeColor, #374151)}.val.svelte-gbh3pt{color:var(--leafDefaultColor, #9ca3af)}.val.string.svelte-gbh3pt{color:var(--leafStringColor, #059669)}.val.number.svelte-gbh3pt{color:var(--leafNumberColor, #d97706)}.val.boolean.svelte-gbh3pt{color:var(--leafBooleanColor, #2563eb)}.spinner.svelte-4xesec{height:1.2rem;width:1.2rem;border-radius:50rem;color:currentColor;border:2px dashed currentColor} diff --git a/examples/api/dist/assets/index.js b/examples/api/dist/assets/index.js index 52f29c45b..93e265832 100644 --- a/examples/api/dist/assets/index.js +++ b/examples/api/dist/assets/index.js @@ -1,44 +1,46 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerpolicy&&(l.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?l.credentials="include":o.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();function J(){}function vl(t){return t()}function Io(){return Object.create(null)}function pe(t){t.forEach(vl)}function xl(t){return typeof t=="function"}function ke(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Un;function $l(t,e){return Un||(Un=document.createElement("a")),Un.href=e,t===Un.href}function er(t){return Object.keys(t).length===0}function tr(t,...e){if(t==null)return J;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function _l(t,e,n){t.$$.on_destroy.push(tr(e,n))}function r(t,e){t.appendChild(e)}function m(t,e,n){t.insertBefore(e,n||null)}function h(t){t.parentNode.removeChild(t)}function dt(t,e){for(let n=0;nt.removeEventListener(e,n,i)}function Xn(t){return function(e){return e.preventDefault(),t.call(this,e)}}function u(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function se(t){return t===""?null:+t}function ir(t){return Array.from(t.childNodes)}function x(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function G(t,e){t.value=e==null?"":e}function zt(t,e){for(let n=0;n{Vn.delete(t),i&&(n&&t.d(1),i())}),t.o(e)}else i&&i()}function Kn(t){t&&t.c()}function Vt(t,e,n,i){const{fragment:o,on_mount:l,on_destroy:a,after_update:f}=t.$$;o&&o.m(e,n),i||Lt(()=>{const c=l.map(vl).filter(xl);a?a.push(...c):pe(c),t.$$.on_mount=[]}),f.forEach(Lt)}function Gt(t,e){const n=t.$$;n.fragment!==null&&(pe(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function ur(t,e){t.$$.dirty[0]===-1&&(Ut.push(t),rr(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const g=y.length?y[0]:_;return p.ctx&&o(p.ctx[w],p.ctx[w]=g)&&(!p.skip_bound&&p.bound[w]&&p.bound[w](g),d&&ur(t,w)),_}):[],p.update(),d=!0,pe(p.before_update),p.fragment=i?i(p.ctx):!1,e.target){if(e.hydrate){const w=ir(e.target);p.fragment&&p.fragment.l(w),w.forEach(h)}else p.fragment&&p.fragment.c();e.intro&&Ee(t.$$.fragment),Vt(t,e.target,e.anchor,e.customElement),gl()}qt(c)}class Se{$destroy(){Gt(this,1),this.$destroy=J}$on(e,n){const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const o=i.indexOf(n);o!==-1&&i.splice(o,1)}}$set(e){this.$$set&&!er(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Ct=[];function yl(t,e=J){let n;const i=new Set;function o(f){if(ke(t,f)&&(t=f,n)){const c=!Ct.length;for(const p of i)p[1](),Ct.push(p,t);if(c){for(let p=0;p{i.delete(p),i.size===0&&(n(),n=null)}}return{set:o,update:l,subscribe:a}}var Ei=function(t,e){return Ei=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},Ei(t,e)};function ji(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Ei(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var ue=function(){return ue=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0&&o[o.length-1])||d[0]!==6&&d[0]!==2)){a=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]{for(const o of l)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerpolicy&&(o.referrerPolicy=l.referrerpolicy),l.crossorigin==="use-credentials"?o.credentials="include":l.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}};oo();function V(){}function ws(e){return e()}function ql(){return Object.create(null)}function se(e){e.forEach(ws)}function ro(e){return typeof e=="function"}function me(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let Bn;function ao(e,t){return Bn||(Bn=document.createElement("a")),Bn.href=t,e===Bn.href}function uo(e){return Object.keys(e).length===0}function co(e,...t){if(e==null)return V;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function ks(e,t,n){e.$$.on_destroy.push(co(t,n))}function s(e,t){e.appendChild(t)}function m(e,t,n){e.insertBefore(t,n||null)}function p(e){e.parentNode.removeChild(e)}function pt(e,t){for(let n=0;ne.removeEventListener(t,n,i)}function Yn(e){return function(t){return t.preventDefault(),e.call(this,t)}}function a(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function le(e){return e===""?null:+e}function po(e){return Array.from(e.childNodes)}function K(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function B(e,t){e.value=t==null?"":t}function Dt(e,t){for(let n=0;n{$n.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function Qn(e){e&&e.c()}function Jt(e,t,n,i){const{fragment:l,on_mount:o,on_destroy:u,after_update:d}=e.$$;l&&l.m(t,n),i||Pt(()=>{const c=o.map(ws).filter(ro);u?u.push(...c):se(c),e.$$.on_mount=[]}),d.forEach(Pt)}function $t(e,t){const n=e.$$;n.fragment!==null&&(se(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function go(e,t){e.$$.dirty[0]===-1&&(qt.push(e),_o(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const g=y.length?y[0]:_;return f.ctx&&l(f.ctx[k],f.ctx[k]=g)&&(!f.skip_bound&&f.bound[k]&&f.bound[k](g),v&&go(e,k)),_}):[],f.update(),v=!0,se(f.before_update),f.fragment=i?i(f.ctx):!1,t.target){if(t.hydrate){const k=po(t.target);f.fragment&&f.fragment.l(k),k.forEach(p)}else f.fragment&&f.fragment.c();t.intro&&De(e.$$.fragment),Jt(e,t.target,t.anchor,t.customElement),Cs()}Vt(c)}class we{$destroy(){$t(this,1),this.$destroy=V}$on(t,n){const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const l=i.indexOf(n);l!==-1&&i.splice(l,1)}}$set(t){this.$$set&&!uo(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const zt=[];function Ts(e,t=V){let n;const i=new Set;function l(d){if(me(e,d)&&(e=d,n)){const c=!zt.length;for(const f of i)f[1](),zt.push(f,e);if(c){for(let f=0;f{i.delete(f),i.size===0&&(n(),n=null)}}return{set:l,update:o,subscribe:u}}var As=Object.defineProperty,vo=Object.defineProperties,yo=Object.getOwnPropertyDescriptors,Vl=Object.getOwnPropertySymbols,wo=Object.prototype.hasOwnProperty,ko=Object.prototype.propertyIsEnumerable,Gl=(e,t,n)=>t in e?As(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ze=(e,t)=>{for(var n in t||(t={}))wo.call(t,n)&&Gl(e,n,t[n]);if(Vl)for(var n of Vl(t))ko.call(t,n)&&Gl(e,n,t[n]);return e},Ut=(e,t)=>vo(e,yo(t)),Te=(e,t)=>{for(var n in t)As(e,n,{get:t[n],enumerable:!0})},Mo={};Te(Mo,{convertFileSrc:()=>Ls,invoke:()=>Zn,transformCallback:()=>mt});function Co(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function mt(e,t=!1){let n=Co(),i=`_${n}`;return Object.defineProperty(window,i,{value:l=>(t&&Reflect.deleteProperty(window,i),e==null?void 0:e(l)),writable:!1,configurable:!0}),n}async function Zn(e,t={}){return new Promise((n,i)=>{let l=mt(u=>{n(u),Reflect.deleteProperty(window,`_${o}`)},!0),o=mt(u=>{i(u),Reflect.deleteProperty(window,`_${l}`)},!0);window.__TAURI_IPC__(ze({cmd:e,callback:l,error:o},t))})}function Ls(e,t="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${t}.localhost/${n}`:`${t}://localhost/${n}`}async function L(e){return Zn("tauri",e)}var To={};Te(To,{Child:()=>Ss,Command:()=>Ri,EventEmitter:()=>Xn,open:()=>Ii});async function Ao(e,t,n=[],i){return typeof n=="object"&&Object.freeze(n),L({__tauriModule:"Shell",message:{cmd:"execute",program:t,args:n,options:i,onEventFn:mt(e)}})}var Xn=class{constructor(){this.eventListeners=Object.create(null)}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}on(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}once(e,t){let n=(...i)=>{this.removeListener(e,n),t(...i)};return this.addListener(e,n)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter(n=>n!==t)),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,...t){if(e in this.eventListeners){let n=this.eventListeners[e];for(let i of n)i(...t);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,t){return e in this.eventListeners?this.eventListeners[e].unshift(t):this.eventListeners[e]=[t],this}prependOnceListener(e,t){let n=(...i)=>{this.removeListener(e,n),t(...i)};return this.prependListener(e,n)}},Ss=class{constructor(e){this.pid=e}async write(e){return L({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:typeof e=="string"?e:Array.from(e)}})}async kill(){return L({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})}},Ri=class extends Xn{constructor(e,t=[],n){super(),this.stdout=new Xn,this.stderr=new Xn,this.program=e,this.args=typeof t=="string"?[t]:t,this.options=n!=null?n:{}}static sidecar(e,t=[],n){let i=new Ri(e,t,n);return i.options.sidecar=!0,i}async spawn(){return Ao(e=>{switch(e.event){case"Error":this.emit("error",e.payload);break;case"Terminated":this.emit("close",e.payload);break;case"Stdout":this.stdout.emit("data",e.payload);break;case"Stderr":this.stderr.emit("data",e.payload);break}},this.program,this.args,this.options).then(e=>new Ss(e))}async execute(){return new Promise((e,t)=>{this.on("error",t);let n=[],i=[];this.stdout.on("data",l=>{n.push(l)}),this.stderr.on("data",l=>{i.push(l)}),this.on("close",l=>{e({code:l.code,signal:l.signal,stdout:n.join(` +`),stderr:i.join(` +`)})}),this.spawn().catch(t)})}};async function Ii(e,t){return L({__tauriModule:"Shell",message:{cmd:"open",path:e,with:t}})}var Lo={};Te(Lo,{TauriEvent:()=>Ps,emit:()=>li,listen:()=>Yt,once:()=>Os});async function Es(e,t){return L({__tauriModule:"Event",message:{cmd:"unlisten",event:e,eventId:t}})}async function zs(e,t,n){await L({__tauriModule:"Event",message:{cmd:"emit",event:e,windowLabel:t,payload:typeof n=="string"?n:JSON.stringify(n)}})}async function Hi(e,t,n){return L({__tauriModule:"Event",message:{cmd:"listen",event:e,windowLabel:t,handler:mt(n)}}).then(i=>async()=>Es(e,i))}async function Ds(e,t,n){return Hi(e,t,i=>{n(i),Es(e,i.id).catch(()=>{})})}var Ps=(e=>(e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_CREATED="tauri://window-created",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_FILE_DROP="tauri://file-drop",e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",e.MENU="tauri://menu",e.CHECK_UPDATE="tauri://update",e.UPDATE_AVAILABLE="tauri://update-available",e.INSTALL_UPDATE="tauri://update-install",e.STATUS_UPDATE="tauri://update-status",e.DOWNLOAD_PROGRESS="tauri://update-download-progress",e))(Ps||{});async function Yt(e,t){return Hi(e,null,t)}async function Os(e,t){return Ds(e,null,t)}async function li(e,t){return zs(e,void 0,t)}var So={};Te(So,{CloseRequestedEvent:()=>js,LogicalPosition:()=>Ws,LogicalSize:()=>xn,PhysicalPosition:()=>et,PhysicalSize:()=>ft,UserAttentionType:()=>ji,WebviewWindow:()=>ht,WebviewWindowHandle:()=>Is,WindowManager:()=>Hs,appWindow:()=>Ue,availableMonitors:()=>Do,currentMonitor:()=>Eo,getAll:()=>Rs,getCurrent:()=>Bt,primaryMonitor:()=>zo});var xn=class{constructor(e,t){this.type="Logical",this.width=e,this.height=t}},ft=class{constructor(e,t){this.type="Physical",this.width=e,this.height=t}toLogical(e){return new xn(this.width/e,this.height/e)}},Ws=class{constructor(e,t){this.type="Logical",this.x=e,this.y=t}},et=class{constructor(e,t){this.type="Physical",this.x=e,this.y=t}toLogical(e){return new Ws(this.x/e,this.y/e)}},ji=(e=>(e[e.Critical=1]="Critical",e[e.Informational=2]="Informational",e))(ji||{});function Bt(){return new ht(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function Rs(){return window.__TAURI_METADATA__.__windows.map(e=>new ht(e.label,{skip:!0}))}var Jl=["tauri://created","tauri://error"],Is=class{constructor(e){this.label=e,this.listeners=Object.create(null)}async listen(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(t),1)}):Hi(e,this.label,t)}async once(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(t),1)}):Ds(e,this.label,t)}async emit(e,t){if(Jl.includes(e)){for(let n of this.listeners[e]||[])n({event:e,id:-1,windowLabel:this.label,payload:t});return Promise.resolve()}return zs(e,this.label,t)}_handleTauriEvent(e,t){return Jl.includes(e)?(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0):!1}},Hs=class extends Is{async scaleFactor(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})}async innerPosition(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(({x:e,y:t})=>new et(e,t))}async outerPosition(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:e,y:t})=>new et(e,t))}async innerSize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:e,height:t})=>new ft(e,t))}async outerSize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:e,height:t})=>new ft(e,t))}async isFullscreen(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}async isMaximized(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})}async isDecorated(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})}async isResizable(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})}async isVisible(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})}async theme(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})}async center(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})}async requestUserAttention(e){let t=null;return e&&(e===1?t={type:"Critical"}:t={type:"Informational"}),L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:t}}}})}async setResizable(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:e}}}})}async setTitle(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:e}}}})}async maximize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})}async unmaximize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})}async toggleMaximize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})}async minimize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})}async unminimize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})}async show(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})}async hide(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})}async close(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})}async setDecorations(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:e}}}})}async setAlwaysOnTop(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:e}}}})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:e.type,data:{width:e.width,height:e.height}}}}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setFullscreen(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:e}}}})}async setFocus(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})}async setIcon(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:typeof e=="string"?e:Array.from(e)}}}}})}async setSkipTaskbar(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:e}}}})}async setCursorGrab(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:e}}}})}async setCursorVisible(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:e}}}})}async setCursorIcon(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorIcon",payload:e}}}})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setIgnoreCursorEvents(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:e}}}})}async startDragging(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})}async onResized(e){return this.listen("tauri://resize",e)}async onMoved(e){return this.listen("tauri://move",e)}async onCloseRequested(e){return this.listen("tauri://close-requested",t=>{let n=new js(t);Promise.resolve(e(n)).then(()=>{if(!n.isPreventDefault())return this.close()})})}async onFocusChanged(e){let t=await this.listen("tauri://focus",i=>{e(Ut(ze({},i),{payload:!0}))}),n=await this.listen("tauri://blur",i=>{e(Ut(ze({},i),{payload:!1}))});return()=>{t(),n()}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let t=await this.listen("tauri://file-drop",l=>{e(Ut(ze({},l),{payload:{type:"drop",paths:l.payload}}))}),n=await this.listen("tauri://file-drop-hover",l=>{e(Ut(ze({},l),{payload:{type:"hover",paths:l.payload}}))}),i=await this.listen("tauri://file-drop-cancelled",l=>{e(Ut(ze({},l),{payload:{type:"cancel"}}))});return()=>{t(),n(),i()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},js=class{constructor(e){this._preventDefault=!1,this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}},ht=class extends Hs{constructor(e,t={}){super(e),t!=null&&t.skip||L({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:ze({label:e},t)}}}).then(async()=>this.emit("tauri://created")).catch(async n=>this.emit("tauri://error",n))}static getByLabel(e){return Rs().some(t=>t.label===e)?new ht(e,{skip:!0}):null}},Ue;"__TAURI_METADATA__"in window?Ue=new ht(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label. +Note that this is not an issue if running this frontend on a browser instead of a Tauri window.`),Ue=new ht("main",{skip:!0}));function Ni(e){return e===null?null:{name:e.name,scaleFactor:e.scaleFactor,position:new et(e.position.x,e.position.y),size:new ft(e.size.width,e.size.height)}}async function Eo(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(Ni)}async function zo(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(Ni)}async function Do(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then(e=>e.map(Ni))}function Po(){return navigator.appVersion.includes("Win")}var Oo={};Te(Oo,{EOL:()=>Wo,arch:()=>Ho,platform:()=>Ns,tempdir:()=>jo,type:()=>Io,version:()=>Ro});var Wo=Po()?`\r `:` -`;function El(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,P({__tauriModule:"Os",message:{cmd:"platform"}})]})})}function mr(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,P({__tauriModule:"Os",message:{cmd:"version"}})]})})}function vr(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,P({__tauriModule:"Os",message:{cmd:"osType"}})]})})}function _r(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,P({__tauriModule:"Os",message:{cmd:"arch"}})]})})}function br(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,P({__tauriModule:"Os",message:{cmd:"tempdir"}})]})})}Object.freeze({__proto__:null,EOL:hr,platform:El,version:mr,type:vr,arch:_r,tempdir:br});function Wl(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,P({__tauriModule:"App",message:{cmd:"getAppVersion"}})]})})}function Dl(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,P({__tauriModule:"App",message:{cmd:"getAppName"}})]})})}function jl(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,P({__tauriModule:"App",message:{cmd:"getTauriVersion"}})]})})}Object.freeze({__proto__:null,getName:Dl,getVersion:Wl,getTauriVersion:jl});function Rl(t){return t===void 0&&(t=0),M(this,void 0,void 0,function(){return T(this,function(e){return[2,P({__tauriModule:"Process",message:{cmd:"exit",exitCode:t}})]})})}function Fi(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,P({__tauriModule:"Process",message:{cmd:"relaunch"}})]})})}Object.freeze({__proto__:null,exit:Rl,relaunch:Fi});function gr(t){let e,n,i,o,l,a,f,c,p,d,w,_,y,g,b,L,W,U,j,q,A,S,z,D,C,N;return{c(){e=s("p"),e.innerHTML=`This is a demo of Tauri's API capabilities using the @tauri-apps/api package. It's used as the main validation app, serving as the test bed of our +`;async function Ns(){return L({__tauriModule:"Os",message:{cmd:"platform"}})}async function Ro(){return L({__tauriModule:"Os",message:{cmd:"version"}})}async function Io(){return L({__tauriModule:"Os",message:{cmd:"osType"}})}async function Ho(){return L({__tauriModule:"Os",message:{cmd:"arch"}})}async function jo(){return L({__tauriModule:"Os",message:{cmd:"tempdir"}})}var No={};Te(No,{getName:()=>Us,getTauriVersion:()=>qs,getVersion:()=>Fs,hide:()=>Vs,show:()=>Bs});async function Fs(){return L({__tauriModule:"App",message:{cmd:"getAppVersion"}})}async function Us(){return L({__tauriModule:"App",message:{cmd:"getAppName"}})}async function qs(){return L({__tauriModule:"App",message:{cmd:"getTauriVersion"}})}async function Bs(){return L({__tauriModule:"App",message:{cmd:"show"}})}async function Vs(){return L({__tauriModule:"App",message:{cmd:"hide"}})}var Fo={};Te(Fo,{exit:()=>Gs,relaunch:()=>Fi});async function Gs(e=0){return L({__tauriModule:"Process",message:{cmd:"exit",exitCode:e}})}async function Fi(){return L({__tauriModule:"Process",message:{cmd:"relaunch"}})}function Uo(e){let t,n,i,l,o,u,d,c,f,v,k,_,y,g,b,A,D,j,O,F,S,C,T,P,M,N;return{c(){t=r("p"),t.innerHTML=`This is a demo of Tauri's API capabilities using the @tauri-apps/api package. It's used as the main validation app, serving as the test bed of our development process. In the future, this app will be used on Tauri's integration - tests.`,n=v(),i=s("br"),o=v(),l=s("br"),a=v(),f=s("pre"),c=E("App name: "),p=s("code"),d=E(t[2]),w=E(` -App version: `),_=s("code"),y=E(t[0]),g=E(` -Tauri version: `),b=s("code"),L=E(t[1]),W=E(` -`),U=v(),j=s("br"),q=v(),A=s("div"),S=s("button"),S.textContent="Close application",z=v(),D=s("button"),D.textContent="Relaunch application",u(S,"class","btn"),u(D,"class","btn"),u(A,"class","flex flex-wrap gap-1 shadow-")},m(B,Y){m(B,e,Y),m(B,n,Y),m(B,i,Y),m(B,o,Y),m(B,l,Y),m(B,a,Y),m(B,f,Y),r(f,c),r(f,p),r(p,d),r(f,w),r(f,_),r(_,y),r(f,g),r(f,b),r(b,L),r(f,W),m(B,U,Y),m(B,j,Y),m(B,q,Y),m(B,A,Y),r(A,S),r(A,z),r(A,D),C||(N=[O(S,"click",t[3]),O(D,"click",t[4])],C=!0)},p(B,[Y]){Y&4&&x(d,B[2]),Y&1&&x(y,B[0]),Y&2&&x(L,B[1])},i:J,o:J,d(B){B&&h(e),B&&h(n),B&&h(i),B&&h(o),B&&h(l),B&&h(a),B&&h(f),B&&h(U),B&&h(j),B&&h(q),B&&h(A),C=!1,pe(N)}}}function yr(t,e,n){let i="0.0.0",o="0.0.0",l="Unknown";Dl().then(c=>{n(2,l=c)}),Wl().then(c=>{n(0,i=c)}),jl().then(c=>{n(1,o=c)});async function a(){await Rl()}async function f(){await Fi()}return[i,o,l,a,f]}class wr extends Se{constructor(e){super(),Ce(this,e,yr,gr,ke,{})}}function Hl(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,P({__tauriModule:"Cli",message:{cmd:"cliMatches"}})]})})}Object.freeze({__proto__:null,getMatches:Hl});function kr(t){let e,n,i,o,l,a,f,c,p,d,w,_,y;return{c(){e=s("p"),e.innerHTML=`This binary can be run from the terminal and takes the following arguments: + tests.`,n=h(),i=r("br"),l=h(),o=r("br"),u=h(),d=r("pre"),c=z("App name: "),f=r("code"),v=z(e[2]),k=z(` +App version: `),_=r("code"),y=z(e[0]),g=z(` +Tauri version: `),b=r("code"),A=z(e[1]),D=z(` +`),j=h(),O=r("br"),F=h(),S=r("div"),C=r("button"),C.textContent="Close application",T=h(),P=r("button"),P.textContent="Relaunch application",a(C,"class","btn"),a(P,"class","btn"),a(S,"class","flex flex-wrap gap-1 shadow-")},m(U,J){m(U,t,J),m(U,n,J),m(U,i,J),m(U,l,J),m(U,o,J),m(U,u,J),m(U,d,J),s(d,c),s(d,f),s(f,v),s(d,k),s(d,_),s(_,y),s(d,g),s(d,b),s(b,A),s(d,D),m(U,j,J),m(U,O,J),m(U,F,J),m(U,S,J),s(S,C),s(S,T),s(S,P),M||(N=[E(C,"click",e[3]),E(P,"click",e[4])],M=!0)},p(U,[J]){J&4&&K(v,U[2]),J&1&&K(y,U[0]),J&2&&K(A,U[1])},i:V,o:V,d(U){U&&p(t),U&&p(n),U&&p(i),U&&p(l),U&&p(o),U&&p(u),U&&p(d),U&&p(j),U&&p(O),U&&p(F),U&&p(S),M=!1,se(N)}}}function qo(e,t,n){let i="0.0.0",l="0.0.0",o="Unknown";Us().then(c=>{n(2,o=c)}),Fs().then(c=>{n(0,i=c)}),qs().then(c=>{n(1,l=c)});async function u(){await Gs()}async function d(){await Fi()}return[i,l,o,u,d]}class Bo extends we{constructor(t){super(),ye(this,t,qo,Uo,me,{})}}var Vo={};Te(Vo,{getMatches:()=>Js});async function Js(){return L({__tauriModule:"Cli",message:{cmd:"cliMatches"}})}function Go(e){let t,n,i,l,o,u,d,c,f,v,k,_,y;return{c(){t=r("p"),t.innerHTML=`This binary can be run from the terminal and takes the following arguments:
  --config <PATH>
   --theme <light|dark|system>
   --verbose
- Additionally, it has a update --background subcommand.`,n=v(),i=s("br"),o=v(),l=s("div"),l.textContent="Note that the arguments are only parsed, not implemented.",a=v(),f=s("br"),c=v(),p=s("br"),d=v(),w=s("button"),w.textContent="Get matches",u(l,"class","note"),u(w,"class","btn"),u(w,"id","cli-matches")},m(g,b){m(g,e,b),m(g,n,b),m(g,i,b),m(g,o,b),m(g,l,b),m(g,a,b),m(g,f,b),m(g,c,b),m(g,p,b),m(g,d,b),m(g,w,b),_||(y=O(w,"click",t[0]),_=!0)},p:J,i:J,o:J,d(g){g&&h(e),g&&h(n),g&&h(i),g&&h(o),g&&h(l),g&&h(a),g&&h(f),g&&h(c),g&&h(p),g&&h(d),g&&h(w),_=!1,y()}}}function Mr(t,e,n){let{onMessage:i}=e;function o(){Hl().then(i).catch(i)}return t.$$set=l=>{"onMessage"in l&&n(1,i=l.onMessage)},[o,i]}class Tr extends Se{constructor(e){super(),Ce(this,e,Mr,kr,ke,{onMessage:1})}}function Xt(t,e){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,Hi(t,null,e)]})})}function Fl(t,e){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,Sl(t,null,e)]})})}function ni(t,e){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,Cl(t,void 0,e)]})})}Object.freeze({__proto__:null,listen:Xt,once:Fl,emit:ni});function Cr(t){let e,n,i,o,l,a,f,c;return{c(){e=s("div"),n=s("button"),n.textContent="Call Log API",i=v(),o=s("button"),o.textContent="Call Request (async) API",l=v(),a=s("button"),a.textContent="Send event to Rust",u(n,"class","btn"),u(n,"id","log"),u(o,"class","btn"),u(o,"id","request"),u(a,"class","btn"),u(a,"id","event")},m(p,d){m(p,e,d),r(e,n),r(e,i),r(e,o),r(e,l),r(e,a),f||(c=[O(n,"click",t[0]),O(o,"click",t[1]),O(a,"click",t[2])],f=!0)},p:J,i:J,o:J,d(p){p&&h(e),f=!1,pe(c)}}}function Sr(t,e,n){let{onMessage:i}=e,o;at(async()=>{o=await Xt("rust-event",i)}),Di(()=>{o&&o()});function l(){Qn("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function a(){Qn("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function f(){ni("js-event","this is the payload string")}return t.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[l,a,f,i]}class zr extends Se{constructor(e){super(),Ce(this,e,Sr,Cr,ke,{onMessage:3})}}function Ii(t){return t===void 0&&(t={}),M(this,void 0,void 0,function(){return T(this,function(e){return typeof t=="object"&&Object.freeze(t),[2,P({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}})]})})}function Il(t){return t===void 0&&(t={}),M(this,void 0,void 0,function(){return T(this,function(e){return typeof t=="object"&&Object.freeze(t),[2,P({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}})]})})}function Lr(t,e){var n;return M(this,void 0,void 0,function(){var i;return T(this,function(o){return i=typeof e=="string"?{title:e}:e,[2,P({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:t.toString(),title:(n=i==null?void 0:i.title)===null||n===void 0?void 0:n.toString(),type:i==null?void 0:i.type}})]})})}function Ul(t,e){var n;return M(this,void 0,void 0,function(){var i;return T(this,function(o){return i=typeof e=="string"?{title:e}:e,[2,P({__tauriModule:"Dialog",message:{cmd:"askDialog",message:t.toString(),title:(n=i==null?void 0:i.title)===null||n===void 0?void 0:n.toString(),type:i==null?void 0:i.type}})]})})}function Ar(t,e){var n;return M(this,void 0,void 0,function(){var i;return T(this,function(o){return i=typeof e=="string"?{title:e}:e,[2,P({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:t.toString(),title:(n=i==null?void 0:i.title)===null||n===void 0?void 0:n.toString(),type:i==null?void 0:i.type}})]})})}Object.freeze({__proto__:null,open:Ii,save:Il,message:Lr,ask:Ul,confirm:Ar});var Pt;function Pr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,P({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:e}})]})})}function Ui(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){var n;return T(this,function(i){switch(i.label){case 0:return[4,P({__tauriModule:"Fs",message:{cmd:"readFile",path:t,options:e}})];case 1:return n=i.sent(),[2,Uint8Array.from(n)]}})})}function Wi(t,e,n){return M(this,void 0,void 0,function(){var i,o;return T(this,function(l){return typeof n=="object"&&Object.freeze(n),typeof t=="object"&&Object.freeze(t),i={path:"",contents:""},o=n,typeof t=="string"?i.path=t:(i.path=t.path,i.contents=t.contents),typeof e=="string"?i.contents=e!=null?e:"":o=e,[2,P({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(new TextEncoder().encode(i.contents)),options:o}})]})})}function Or(t,e,n){return M(this,void 0,void 0,function(){var i,o;return T(this,function(l){return typeof n=="object"&&Object.freeze(n),typeof t=="object"&&Object.freeze(t),i={path:"",contents:[]},o=n,typeof t=="string"?i.path=t:(i.path=t.path,i.contents=t.contents),e&&"dir"in e?o=e:typeof t=="string"&&(i.contents=e!=null?e:[]),[2,P({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(i.contents instanceof ArrayBuffer?new Uint8Array(i.contents):i.contents),options:o}})]})})}function Nl(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,P({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:e}})]})})}function Er(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,P({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:e}})]})})}function Wr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,P({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:e}})]})})}function Dr(t,e,n){return n===void 0&&(n={}),M(this,void 0,void 0,function(){return T(this,function(i){return[2,P({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:e,options:n}})]})})}function jr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,P({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:e}})]})})}function Rr(t,e,n){return n===void 0&&(n={}),M(this,void 0,void 0,function(){return T(this,function(i){return[2,P({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:e,options:n}})]})})}(function(t){t[t.Audio=1]="Audio",t[t.Cache=2]="Cache",t[t.Config=3]="Config",t[t.Data=4]="Data",t[t.LocalData=5]="LocalData",t[t.Desktop=6]="Desktop",t[t.Document=7]="Document",t[t.Download=8]="Download",t[t.Executable=9]="Executable",t[t.Font=10]="Font",t[t.Home=11]="Home",t[t.Picture=12]="Picture",t[t.Public=13]="Public",t[t.Runtime=14]="Runtime",t[t.Template=15]="Template",t[t.Video=16]="Video",t[t.Resource=17]="Resource",t[t.App=18]="App",t[t.Log=19]="Log",t[t.Temp=20]="Temp"})(Pt||(Pt={}));Object.freeze({__proto__:null,get BaseDirectory(){return Pt},get Dir(){return Pt},readTextFile:Pr,readBinaryFile:Ui,writeTextFile:Wi,writeFile:Wi,writeBinaryFile:Or,readDir:Nl,createDir:Er,removeDir:Wr,copyFile:Dr,removeFile:jr,renameFile:Rr});function Hr(t){let e,n,i,o,l,a,f,c,p,d,w,_,y,g,b,L,W,U,j,q,A,S,z,D;return{c(){e=s("div"),n=s("input"),i=v(),o=s("input"),l=v(),a=s("br"),f=v(),c=s("div"),p=s("input"),d=v(),w=s("label"),w.textContent="Multiple",_=v(),y=s("div"),g=s("input"),b=v(),L=s("label"),L.textContent="Directory",W=v(),U=s("br"),j=v(),q=s("button"),q.textContent="Open dialog",A=v(),S=s("button"),S.textContent="Open save dialog",u(n,"class","input"),u(n,"id","dialog-default-path"),u(n,"placeholder","Default path"),u(o,"class","input"),u(o,"id","dialog-filter"),u(o,"placeholder","Extensions filter, comma-separated"),u(e,"class","flex gap-2 children:grow"),u(p,"type","checkbox"),u(p,"id","dialog-multiple"),u(w,"for","dialog-multiple"),u(g,"type","checkbox"),u(g,"id","dialog-directory"),u(L,"for","dialog-directory"),u(q,"class","btn"),u(q,"id","open-dialog"),u(S,"class","btn"),u(S,"id","save-dialog")},m(C,N){m(C,e,N),r(e,n),G(n,t[0]),r(e,i),r(e,o),G(o,t[1]),m(C,l,N),m(C,a,N),m(C,f,N),m(C,c,N),r(c,p),p.checked=t[2],r(c,d),r(c,w),m(C,_,N),m(C,y,N),r(y,g),g.checked=t[3],r(y,b),r(y,L),m(C,W,N),m(C,U,N),m(C,j,N),m(C,q,N),m(C,A,N),m(C,S,N),z||(D=[O(n,"input",t[8]),O(o,"input",t[9]),O(p,"change",t[10]),O(g,"change",t[11]),O(q,"click",t[4]),O(S,"click",t[5])],z=!0)},p(C,[N]){N&1&&n.value!==C[0]&&G(n,C[0]),N&2&&o.value!==C[1]&&G(o,C[1]),N&4&&(p.checked=C[2]),N&8&&(g.checked=C[3])},i:J,o:J,d(C){C&&h(e),C&&h(l),C&&h(a),C&&h(f),C&&h(c),C&&h(_),C&&h(y),C&&h(W),C&&h(U),C&&h(j),C&&h(q),C&&h(A),C&&h(S),z=!1,pe(D)}}}function Fr(t,e){var n=new Blob([t],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(o){var l=o.target.result;e(l.substr(l.indexOf(",")+1))},i.readAsDataURL(n)}function Ir(t,e,n){let{onMessage:i}=e,{insecureRenderHtml:o}=e,l=null,a=null,f=!1,c=!1;function p(){Ii({title:"My wonderful open dialog",defaultPath:l,filters:a?[{name:"Tauri Example",extensions:a.split(",").map(b=>b.trim())}]:[],multiple:f,directory:c}).then(function(b){if(Array.isArray(b))i(b);else{var L=b,W=L.match(/\S+\.\S+$/g);Ui(L).then(function(U){W&&(L.includes(".png")||L.includes(".jpg"))?Fr(new Uint8Array(U),function(j){var q="data:image/png;base64,"+j;o('')}):i(b)}).catch(i(b))}}).catch(i)}function d(){Il({title:"My wonderful save dialog",defaultPath:l,filters:a?[{name:"Tauri Example",extensions:a.split(",").map(b=>b.trim())}]:[]}).then(i).catch(i)}function w(){l=this.value,n(0,l)}function _(){a=this.value,n(1,a)}function y(){f=this.checked,n(2,f)}function g(){c=this.checked,n(3,c)}return t.$$set=b=>{"onMessage"in b&&n(6,i=b.onMessage),"insecureRenderHtml"in b&&n(7,o=b.insecureRenderHtml)},[l,a,f,c,p,d,i,o,w,_,y,g]}class Ur extends Se{constructor(e){super(),Ce(this,e,Ir,Hr,ke,{onMessage:6,insecureRenderHtml:7})}}function qo(t,e,n){const i=t.slice();return i[9]=e[n],i}function Bo(t){let e,n=t[9][0]+"",i;return{c(){e=s("option"),i=E(n),e.__value=t[9][1],e.value=e.__value},m(o,l){m(o,e,l),r(e,i)},p:J,d(o){o&&h(e)}}}function Nr(t){let e,n,i,o,l,a,f,c,p,d,w,_,y,g,b,L,W,U,j,q=t[2],A=[];for(let S=0;SisNaN(parseInt(_))).map(_=>[_,Pt[_]]);function c(){const _=l.match(/\S+\.\S+$/g),y={dir:Vo()};(_?Ui(l,y):Nl(l,y)).then(function(b){if(_)if(l.includes(".png")||l.includes(".jpg"))qr(new Uint8Array(b),function(L){const W="data:image/png;base64,"+L;o('')});else{const L=String.fromCharCode.apply(null,b);o(''),setTimeout(()=>{const W=document.getElementById("file-response");W.value=L,document.getElementById("file-save").addEventListener("click",function(){Wi(l,W.value,{dir:Vo()}).catch(i)})})}else i(b)}).catch(i)}function p(){n(1,a.src=wl(l),a)}function d(){l=this.value,n(0,l)}function w(_){Yn[_?"unshift":"push"](()=>{a=_,n(1,a)})}return t.$$set=_=>{"onMessage"in _&&n(5,i=_.onMessage),"insecureRenderHtml"in _&&n(6,o=_.insecureRenderHtml)},[l,a,f,c,p,i,o,d,w]}class Vr extends Se{constructor(e){super(),Ce(this,e,Br,Nr,ke,{onMessage:5,insecureRenderHtml:6})}}var Ot;(function(t){t[t.JSON=1]="JSON",t[t.Text=2]="Text",t[t.Binary=3]="Binary"})(Ot||(Ot={}));var Jn=function(){function t(e,n){this.type=e,this.payload=n}return t.form=function(e){var n={};for(var i in e){var o=e[i],l=void 0;l=typeof o=="string"?o:o instanceof Uint8Array||Array.isArray(o)?Array.from(o):typeof o.file=="string"?{file:o.file,mime:o.mime,fileName:o.fileName}:{file:Array.from(o.file),mime:o.mime,fileName:o.fileName},n[i]=l}return new t("Form",n)},t.json=function(e){return new t("Json",e)},t.text=function(e){return new t("Text",e)},t.bytes=function(e){return new t("Bytes",Array.from(e instanceof ArrayBuffer?new Uint8Array(e):e))},t}(),ql=function(t){this.url=t.url,this.status=t.status,this.ok=this.status>=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data},Bl=function(){function t(e){this.id=e}return t.prototype.drop=function(){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,P({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]})})},t.prototype.request=function(e){return M(this,void 0,void 0,function(){var n;return T(this,function(i){return(n=!e.responseType||e.responseType===Ot.JSON)&&(e.responseType=Ot.Text),[2,P({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(function(o){var l=new ql(o);if(n){try{l.data=JSON.parse(l.data)}catch(a){if(l.ok&&l.data==="")l.data={};else if(l.ok)throw Error("Failed to parse response `".concat(l.data,"` as JSON: ").concat(a,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return l}return l})]})})},t.prototype.get=function(e,n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,this.request(ue({method:"GET",url:e},n))]})})},t.prototype.post=function(e,n,i){return M(this,void 0,void 0,function(){return T(this,function(o){return[2,this.request(ue({method:"POST",url:e,body:n},i))]})})},t.prototype.put=function(e,n,i){return M(this,void 0,void 0,function(){return T(this,function(o){return[2,this.request(ue({method:"PUT",url:e,body:n},i))]})})},t.prototype.patch=function(e,n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,this.request(ue({method:"PATCH",url:e},n))]})})},t.prototype.delete=function(e,n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,this.request(ue({method:"DELETE",url:e},n))]})})},t}();function xn(t){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,P({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then(function(n){return new Bl(n)})]})})}var Ai=null;function Gr(t,e){var n;return M(this,void 0,void 0,function(){return T(this,function(i){switch(i.label){case 0:return Ai!==null?[3,2]:[4,xn()];case 1:Ai=i.sent(),i.label=2;case 2:return[2,Ai.request(ue({url:t,method:(n=e==null?void 0:e.method)!==null&&n!==void 0?n:"GET"},e))]}})})}Object.freeze({__proto__:null,getClient:xn,fetch:Gr,Body:Jn,Client:Bl,Response:ql,get ResponseType(){return Ot}});function Go(t,e,n){const i=t.slice();return i[12]=e[n],i[14]=n,i}function Jo(t){let e,n,i,o,l,a,f,c,p,d,w,_,y,g,b,L,W,U=t[5],j=[];for(let z=0;zFe(j[z],1,1,()=>{j[z]=null});let A=!t[3]&&Qo(),S=!t[3]&&t[8]&&Zo();return{c(){e=s("span"),n=s("span"),i=E(t[6]),o=v(),l=s("ul");for(let z=0;z{d[g]=null}),ti(),l=d[o],l?l.p(_,y):(l=d[o]=p[o](_),l.c()),Ee(l,1),l.m(e,a))},i(_){f||(Ee(l),f=!0)},o(_){Fe(l),f=!1},d(_){_&&h(e),c&&c.d(),d[o].d()}}}function Qo(t){let e;return{c(){e=s("span"),e.textContent=",",u(e,"class","comma svelte-gbh3pt")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Zo(t){let e;return{c(){e=s("span"),e.textContent=",",u(e,"class","comma svelte-gbh3pt")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Yr(t){let e,n,i=t[5].length&&Jo(t);return{c(){i&&i.c(),e=$n()},m(o,l){i&&i.m(o,l),m(o,e,l),n=!0},p(o,[l]){o[5].length?i?(i.p(o,l),l&32&&Ee(i,1)):(i=Jo(o),i.c(),Ee(i,1),i.m(e.parentNode,e)):i&&(ei(),Fe(i,1,1,()=>{i=null}),ti())},i(o){n||(Ee(i),n=!0)},o(o){Fe(i),n=!1},d(o){i&&i.d(o),o&&h(e)}}}const Kr="...";function Qr(t,e,n){let{json:i}=e,{depth:o=1/0}=e,{_lvl:l=0}=e,{_last:a=!0}=e;const f=b=>b===null?"null":typeof b;let c,p,d,w,_;const y=b=>{switch(f(b)){case"string":return`"${b}"`;case"function":return"f () {...}";case"symbol":return b.toString();default:return b}},g=()=>{n(8,_=!_)};return t.$$set=b=>{"json"in b&&n(0,i=b.json),"depth"in b&&n(1,o=b.depth),"_lvl"in b&&n(2,l=b._lvl),"_last"in b&&n(3,a=b._last)},t.$$.update=()=>{t.$$.dirty&17&&(n(5,c=f(i)==="object"?Object.keys(i):[]),n(4,p=Array.isArray(i)),n(6,d=p?"[":"{"),n(7,w=p?"]":"}")),t.$$.dirty&6&&n(8,_=ot[9].call(n)),u(w,"class","input h-auto w-100%"),u(w,"id","request-body"),u(w,"placeholder","Request body"),u(w,"rows","5"),u(b,"class","btn"),u(b,"id","make-request"),u(S,"class","input"),u(D,"class","input"),u(A,"class","flex gap-2 children:grow"),u($,"type","checkbox"),u(Q,"class","btn"),u(Q,"type","button")},m(R,V){m(R,e,V),r(e,n),r(n,i),r(n,o),r(n,l),r(n,a),r(n,f),zt(n,t[0]),r(e,c),r(e,p),r(e,d),r(e,w),G(w,t[1]),r(e,_),r(e,y),r(e,g),r(e,b),m(R,L,V),m(R,W,V),m(R,U,V),m(R,j,V),m(R,q,V),m(R,A,V),r(A,S),G(S,t[2]),r(A,z),r(A,D),G(D,t[3]),m(R,C,V),m(R,N,V),m(R,B,V),m(R,Y,V),r(Y,$),$.checked=t[5],r(Y,_e),m(R,te,V),m(R,oe,V),m(R,K,V),m(R,be,V),m(R,H,V),m(R,Q,V),m(R,le,V),m(R,ae,V),m(R,ee,V),m(R,ve,V),m(R,re,V),Vt(ge,R,V),ne=!0,Me||(Le=[O(n,"change",t[9]),O(w,"input",t[10]),O(e,"submit",Xn(t[6])),O(S,"input",t[11]),O(D,"input",t[12]),O($,"change",t[13]),O(Q,"click",t[7])],Me=!0)},p(R,[V]){V&1&&zt(n,R[0]),V&2&&G(w,R[1]),V&4&&S.value!==R[2]&&G(S,R[2]),V&8&&D.value!==R[3]&&G(D,R[3]),V&32&&($.checked=R[5]);const Re={};V&16&&(Re.json=R[4]),ge.$set(Re)},i(R){ne||(Ee(ge.$$.fragment,R),ne=!0)},o(R){Fe(ge.$$.fragment,R),ne=!1},d(R){R&&h(e),R&&h(L),R&&h(W),R&&h(U),R&&h(j),R&&h(q),R&&h(A),R&&h(C),R&&h(N),R&&h(B),R&&h(Y),R&&h(te),R&&h(oe),R&&h(K),R&&h(be),R&&h(H),R&&h(Q),R&&h(le),R&&h(ae),R&&h(ee),R&&h(ve),R&&h(re),Gt(ge,R),Me=!1,pe(Le)}}}function xr(t,e,n){let i="GET",o="",{onMessage:l}=e;async function a(){const W=await xn().catch(q=>{throw l(q),q}),j={url:"http://localhost:3003",method:i||"GET"||"GET"};o.startsWith("{")&&o.endsWith("}")||o.startsWith("[")&&o.endsWith("]")?j.body=Jn.json(JSON.parse(o)):o!==""&&(j.body=Jn.text(o)),W.request(j).then(l).catch(l)}let f="baz",c="qux",p=null,d=!0;async function w(){const W=await xn().catch(U=>{throw l(U),U});n(4,p=await W.request({url:"http://localhost:3003",method:"POST",body:Jn.form({foo:f,bar:c}),headers:d?{"Content-Type":"multipart/form-data"}:void 0,responseType:Ot.Text}))}function _(){i=Pi(this),n(0,i)}function y(){o=this.value,n(1,o)}function g(){f=this.value,n(2,f)}function b(){c=this.value,n(3,c)}function L(){d=this.checked,n(5,d)}return t.$$set=W=>{"onMessage"in W&&n(8,l=W.onMessage)},[i,o,f,c,p,d,a,w,l,_,y,g,b,L]}class $r extends Se{constructor(e){super(),Ce(this,e,xr,Zr,ke,{onMessage:8})}}function es(t){let e,n,i;return{c(){e=s("button"),e.textContent="Send test notification",u(e,"class","btn"),u(e,"id","notification")},m(o,l){m(o,e,l),n||(i=O(e,"click",ts),n=!0)},p:J,i:J,o:J,d(o){o&&h(e),n=!1,i()}}}function ts(){new Notification("Notification title",{body:"This is the notification body"})}function ns(t,e,n){let{onMessage:i}=e;return t.$$set=o=>{"onMessage"in o&&n(0,i=o.onMessage)},[i]}class is extends Se{constructor(e){super(),Ce(this,e,ns,es,ke,{onMessage:0})}}function xo(t,e,n){const i=t.slice();return i[65]=e[n],i}function $o(t,e,n){const i=t.slice();return i[68]=e[n],i}function el(t){let e,n,i,o,l,a,f=Object.keys(t[1]),c=[];for(let p=0;pt[38].call(i))},m(p,d){m(p,e,d),m(p,n,d),m(p,i,d),r(i,o);for(let w=0;wt[55].call(Ne)),u(Ze,"class","input"),u(Ze,"type","number"),u(xe,"class","input"),u(xe,"type","number"),u(Ue,"class","flex gap-2"),u($e,"class","input grow"),u($e,"id","title"),u(Ft,"class","btn"),u(Ft,"type","submit"),u(st,"class","flex gap-1"),u(et,"class","input grow"),u(et,"id","url"),u(It,"class","btn"),u(It,"id","open-url"),u(ut,"class","flex gap-1"),u(rt,"class","flex flex-col gap-1")},m(k,I){m(k,e,I),m(k,n,I),m(k,i,I),r(i,o),r(i,l),r(i,a),r(i,f),r(i,c),r(i,p),r(i,d),r(i,w),r(i,_),m(k,y,I),m(k,g,I),m(k,b,I),m(k,L,I),r(L,W),r(W,U),r(W,j),j.checked=t[3],r(L,q),r(L,A),r(A,S),r(A,z),z.checked=t[2],r(L,D),r(L,C),r(C,N),r(C,B),B.checked=t[4],r(L,Y),r(L,$),r($,_e),r($,te),te.checked=t[5],r(L,oe),r(L,K),r(K,be),r(K,H),H.checked=t[6],m(k,Q,I),m(k,le,I),m(k,ae,I),m(k,ee,I),r(ee,ve),r(ve,re),r(re,ge),r(re,ne),G(ne,t[13]),r(ve,Me),r(ve,Le),r(Le,R),r(Le,V),G(V,t[14]),r(ee,Re),r(ee,Ae),r(Ae,Te),r(Te,ce),r(Te,he),G(he,t[7]),r(Ae,fe),r(Ae,Pe),r(Pe,tt),r(Pe,me),G(me,t[8]),r(ee,de),r(ee,F),r(F,ie),r(ie,X),r(ie,ye),G(ye,t[9]),r(F,Yt),r(F,ht),r(ht,Kt),r(ht,He),G(He,t[10]),r(ee,Qt),r(ee,Be),r(Be,Z),r(Z,Et),r(Z,We),G(We,t[11]),r(Be,Wt),r(Be,nt),r(nt,Dt),r(nt,De),G(De,t[12]),m(k,mt,I),m(k,vt,I),m(k,_t,I),m(k,Oe,I),r(Oe,Ie),r(Ie,je),r(je,it),r(je,jt),r(je,ot),r(ot,Rt),r(ot,ii),r(je,qi),r(je,Zt),r(Zt,Bi),r(Zt,oi),r(Ie,Vi),r(Ie,Ve),r(Ve,$t),r(Ve,Gi),r(Ve,en),r(en,Ji),r(en,li),r(Ve,Xi),r(Ve,nn),r(nn,Yi),r(nn,ri),r(Oe,Ki),r(Oe,gt),r(gt,Ge),r(Ge,ln),r(Ge,Qi),r(Ge,rn),r(rn,Zi),r(rn,si),r(Ge,xi),r(Ge,un),r(un,$i),r(un,ui),r(gt,eo),r(gt,Je),r(Je,cn),r(Je,to),r(Je,fn),r(fn,no),r(fn,ai),r(Je,io),r(Je,pn),r(pn,oo),r(pn,ci),r(Oe,lo),r(Oe,yt),r(yt,Xe),r(Xe,mn),r(Xe,ro),r(Xe,vn),r(vn,so),r(vn,fi),r(Xe,uo),r(Xe,bn),r(bn,ao),r(bn,di),r(yt,co),r(yt,Ye),r(Ye,yn),r(Ye,fo),r(Ye,wn),r(wn,po),r(wn,pi),r(Ye,ho),r(Ye,Mn),r(Mn,mo),r(Mn,hi),r(Oe,vo),r(Oe,wt),r(wt,Ke),r(Ke,Cn),r(Ke,_o),r(Ke,Sn),r(Sn,bo),r(Sn,mi),r(Ke,go),r(Ke,Ln),r(Ln,yo),r(Ln,vi),r(wt,wo),r(wt,Qe),r(Qe,Pn),r(Qe,ko),r(Qe,On),r(On,Mo),r(On,_i),r(Qe,To),r(Qe,Wn),r(Wn,Co),r(Wn,bi),m(k,gi,I),m(k,yi,I),m(k,wi,I),m(k,Ht,I),m(k,ki,I),m(k,lt,I),r(lt,jn),r(jn,kt),kt.checked=t[15],r(jn,So),r(lt,zo),r(lt,Rn),r(Rn,Mt),Mt.checked=t[16],r(Rn,Lo),m(k,Mi,I),m(k,Ue,I),r(Ue,Hn),r(Hn,Ao),r(Hn,Ne);for(let we=0;we=1,d,w,_,y=p&&el(t),g=t[1][t[0]]&&nl(t);return{c(){e=s("div"),n=s("div"),i=s("input"),o=v(),l=s("button"),l.textContent="New window",a=v(),f=s("br"),c=v(),y&&y.c(),d=v(),g&&g.c(),u(i,"class","input grow"),u(i,"type","text"),u(i,"placeholder","New Window label.."),u(l,"class","btn"),u(n,"class","flex gap-1"),u(e,"class","flex flex-col children:grow gap-2")},m(b,L){m(b,e,L),r(e,n),r(n,i),G(i,t[20]),r(n,o),r(n,l),r(e,a),r(e,f),r(e,c),y&&y.m(e,null),r(e,d),g&&g.m(e,null),w||(_=[O(i,"input",t[37]),O(l,"click",t[34])],w=!0)},p(b,L){L[0]&1048576&&i.value!==b[20]&&G(i,b[20]),L[0]&2&&(p=Object.keys(b[1]).length>=1),p?y?y.p(b,L):(y=el(b),y.c(),y.m(e,d)):y&&(y.d(1),y=null),b[1][b[0]]?g?g.p(b,L):(g=nl(b),g.c(),g.m(e,null)):g&&(g.d(1),g=null)},i:J,o:J,d(b){b&&h(e),y&&y.d(),g&&g.d(),w=!1,pe(_)}}}function ls(t,e,n){let i=qe.label;const o={[qe.label]:qe},l=["default","crosshair","hand","arrow","move","text","wait","help","progress","notAllowed","contextMenu","cell","verticalText","alias","copy","noDrop","grab","grabbing","allScroll","zoomIn","zoomOut","eResize","nResize","neResize","nwResize","sResize","seResize","swResize","wResize","ewResize","nsResize","neswResize","nwseResize","colResize","rowResize"];let{onMessage:a}=e,f,c="https://tauri.app",p=!0,d=!1,w=!0,_=!1,y=!1,g=null,b=null,L=null,W=null,U=null,j=null,q=null,A=null,S=1,z=new ft(q,A),D=new ft(q,A),C=new St(g,b),N=new St(g,b),B,Y,$=!1,_e=!0,te=null,oe=null,K="default",be="Awesome Tauri Example!";function H(){Ri(c)}function Q(){o[i].setTitle(be)}function le(){o[i].hide(),setTimeout(o[i].show,2e3)}function ae(){o[i].minimize(),setTimeout(o[i].unminimize,2e3)}function ee(){Ii({multiple:!1}).then(Z=>{typeof Z=="string"&&o[i].setIcon(Z)})}function ve(){if(!f)return;const Z=new At(f);n(1,o[f]=Z,o),Z.once("tauri://error",function(){a("Error creating new webview")})}function re(){o[i].innerSize().then(Z=>{n(25,C=Z),n(7,g=C.width),n(8,b=C.height)}),o[i].outerSize().then(Z=>{n(26,N=Z)})}function ge(){o[i].innerPosition().then(Z=>{n(23,z=Z)}),o[i].outerPosition().then(Z=>{n(24,D=Z),n(13,q=D.x),n(14,A=D.y)})}async function ne(Z){!Z||(B&&B(),Y&&Y(),Y=await Z.listen("tauri://move",ge),B=await Z.listen("tauri://resize",re))}async function Me(){await o[i].minimize(),await o[i].requestUserAttention(Jt.Critical),await new Promise(Z=>setTimeout(Z,3e3)),await o[i].requestUserAttention(null)}function Le(){f=this.value,n(20,f)}function R(){i=Pi(this),n(0,i),n(1,o)}const V=()=>o[i].center();function Re(){d=this.checked,n(3,d)}function Ae(){p=this.checked,n(2,p)}function Te(){w=this.checked,n(4,w)}function ce(){_=this.checked,n(5,_)}function he(){y=this.checked,n(6,y)}function fe(){q=se(this.value),n(13,q)}function Pe(){A=se(this.value),n(14,A)}function tt(){g=se(this.value),n(7,g)}function me(){b=se(this.value),n(8,b)}function de(){L=se(this.value),n(9,L)}function F(){W=se(this.value),n(10,W)}function ie(){U=se(this.value),n(11,U)}function X(){j=se(this.value),n(12,j)}function ye(){$=this.checked,n(15,$)}function Yt(){_e=this.checked,n(16,_e)}function ht(){K=Pi(this),n(19,K),n(28,l)}function Kt(){te=se(this.value),n(17,te)}function He(){oe=se(this.value),n(18,oe)}function Qt(){be=this.value,n(27,be)}function Be(){c=this.value,n(21,c)}return t.$$set=Z=>{"onMessage"in Z&&n(36,a=Z.onMessage)},t.$$.update=()=>{var Z,Et,We,Wt,nt,Dt,De,mt,vt,_t,Oe,Ie,je,it,jt,ot,Rt;t.$$.dirty[0]&3&&(o[i],ge(),re()),t.$$.dirty[0]&7&&((Z=o[i])==null||Z.setResizable(p)),t.$$.dirty[0]&11&&(d?(Et=o[i])==null||Et.maximize():(We=o[i])==null||We.unmaximize()),t.$$.dirty[0]&19&&((Wt=o[i])==null||Wt.setDecorations(w)),t.$$.dirty[0]&35&&((nt=o[i])==null||nt.setAlwaysOnTop(_)),t.$$.dirty[0]&67&&((Dt=o[i])==null||Dt.setFullscreen(y)),t.$$.dirty[0]&387&&g&&b&&((De=o[i])==null||De.setSize(new St(g,b))),t.$$.dirty[0]&1539&&(L&&W?(mt=o[i])==null||mt.setMinSize(new Zn(L,W)):(vt=o[i])==null||vt.setMinSize(null)),t.$$.dirty[0]&6147&&(U>800&&j>400?(_t=o[i])==null||_t.setMaxSize(new Zn(U,j)):(Oe=o[i])==null||Oe.setMaxSize(null)),t.$$.dirty[0]&24579&&q!==null&&A!==null&&((Ie=o[i])==null||Ie.setPosition(new ft(q,A))),t.$$.dirty[0]&3&&((je=o[i])==null||je.scaleFactor().then(bt=>n(22,S=bt))),t.$$.dirty[0]&3&&ne(o[i]),t.$$.dirty[0]&32771&&((it=o[i])==null||it.setCursorGrab($)),t.$$.dirty[0]&65539&&((jt=o[i])==null||jt.setCursorVisible(_e)),t.$$.dirty[0]&524291&&((ot=o[i])==null||ot.setCursorIcon(K)),t.$$.dirty[0]&393219&&te!==null&&oe!==null&&((Rt=o[i])==null||Rt.setCursorPosition(new ft(te,oe)))},[i,o,p,d,w,_,y,g,b,L,W,U,j,q,A,$,_e,te,oe,K,f,c,S,z,D,C,N,be,l,H,Q,le,ae,ee,ve,Me,a,Le,R,V,Re,Ae,Te,ce,he,fe,Pe,tt,me,de,F,ie,X,ye,Yt,ht,Kt,He,Qt,Be]}class rs extends Se{constructor(e){super(),Ce(this,e,ls,os,ke,{onMessage:36},null,[-1,-1,-1])}}function Gl(t,e){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,P({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:pt(e)}})]})})}function ss(t,e){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,P({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:pt(e)}})]})})}function us(t){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,P({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}})]})})}function Jl(t){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,P({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}})]})})}function Xl(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,P({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})]})})}Object.freeze({__proto__:null,register:Gl,registerAll:ss,isRegistered:us,unregister:Jl,unregisterAll:Xl});function ol(t,e,n){const i=t.slice();return i[9]=e[n],i}function ll(t){let e,n=t[9]+"",i,o,l,a,f;function c(){return t[8](t[9])}return{c(){e=s("div"),i=E(n),o=v(),l=s("button"),l.textContent="Unregister",u(l,"class","btn"),u(l,"type","button"),u(e,"class","flex justify-between")},m(p,d){m(p,e,d),r(e,i),r(e,o),r(e,l),a||(f=O(l,"click",c),a=!0)},p(p,d){t=p,d&2&&n!==(n=t[9]+"")&&x(i,n)},d(p){p&&h(e),a=!1,f()}}}function rl(t){let e,n,i,o,l;return{c(){e=s("br"),n=v(),i=s("button"),i.textContent="Unregister all",u(i,"class","btn"),u(i,"type","button")},m(a,f){m(a,e,f),m(a,n,f),m(a,i,f),o||(l=O(i,"click",t[5]),o=!0)},p:J,d(a){a&&h(e),a&&h(n),a&&h(i),o=!1,l()}}}function as(t){let e,n,i,o,l,a,f,c,p,d,w,_=t[1],y=[];for(let b=0;b<_.length;b+=1)y[b]=ll(ol(t,_,b));let g=t[1].length>1&&rl(t);return{c(){e=s("div"),n=s("input"),i=v(),o=s("button"),o.textContent="Register",l=v(),a=s("br"),f=v(),c=s("div");for(let b=0;b1?g?g.p(b,L):(g=rl(b),g.c(),g.m(c,null)):g&&(g.d(1),g=null)},i:J,o:J,d(b){b&&h(e),b&&h(l),b&&h(a),b&&h(f),b&&h(c),dt(y,b),g&&g.d(),d=!1,pe(w)}}}function cs(t,e,n){let i,{onMessage:o}=e;const l=yl([]);_l(t,l,_=>n(1,i=_));let a="CmdOrControl+X";function f(){const _=a;Gl(_,()=>{o(`Shortcut ${_} triggered`)}).then(()=>{l.update(y=>[...y,_]),o(`Shortcut ${_} registered successfully`)}).catch(o)}function c(_){const y=_;Jl(y).then(()=>{l.update(g=>g.filter(b=>b!==y)),o(`Shortcut ${y} unregistered`)}).catch(o)}function p(){Xl().then(()=>{l.update(()=>[]),o("Unregistered all shortcuts")}).catch(o)}function d(){a=this.value,n(0,a)}const w=_=>c(_);return t.$$set=_=>{"onMessage"in _&&n(6,o=_.onMessage)},[a,i,l,f,c,p,o,d,w]}class fs extends Se{constructor(e){super(),Ce(this,e,cs,as,ke,{onMessage:6})}}function sl(t){let e,n,i,o,l,a,f;return{c(){e=s("br"),n=v(),i=s("input"),o=v(),l=s("button"),l.textContent="Write",u(i,"class","input"),u(i,"placeholder","write to stdin"),u(l,"class","btn")},m(c,p){m(c,e,p),m(c,n,p),m(c,i,p),G(i,t[4]),m(c,o,p),m(c,l,p),a||(f=[O(i,"input",t[14]),O(l,"click",t[8])],a=!0)},p(c,p){p&16&&i.value!==c[4]&&G(i,c[4])},d(c){c&&h(e),c&&h(n),c&&h(i),c&&h(o),c&&h(l),a=!1,pe(f)}}}function ds(t){let e,n,i,o,l,a,f,c,p,d,w,_,y,g,b,L,W,U,j,q,A,S,z,D,C=t[5]&&sl(t);return{c(){e=s("div"),n=s("div"),i=E(`Script: - `),o=s("input"),l=v(),a=s("div"),f=E(`Encoding: - `),c=s("input"),p=v(),d=s("div"),w=E(`Working directory: - `),_=s("input"),y=v(),g=s("div"),b=E(`Arguments: - `),L=s("input"),W=v(),U=s("div"),j=s("button"),j.textContent="Run",q=v(),A=s("button"),A.textContent="Kill",S=v(),C&&C.c(),u(o,"class","grow input"),u(n,"class","flex items-center gap-1"),u(c,"class","grow input"),u(a,"class","flex items-center gap-1"),u(_,"class","grow input"),u(_,"placeholder","Working directory"),u(d,"class","flex items-center gap-1"),u(L,"class","grow input"),u(L,"placeholder","Environment variables"),u(g,"class","flex items-center gap-1"),u(j,"class","btn"),u(A,"class","btn"),u(U,"class","flex children:grow gap-1"),u(e,"class","flex flex-col childre:grow gap-1")},m(N,B){m(N,e,B),r(e,n),r(n,i),r(n,o),G(o,t[0]),r(e,l),r(e,a),r(a,f),r(a,c),G(c,t[3]),r(e,p),r(e,d),r(d,w),r(d,_),G(_,t[1]),r(e,y),r(e,g),r(g,b),r(g,L),G(L,t[2]),r(e,W),r(e,U),r(U,j),r(U,q),r(U,A),r(e,S),C&&C.m(e,null),z||(D=[O(o,"input",t[10]),O(c,"input",t[11]),O(_,"input",t[12]),O(L,"input",t[13]),O(j,"click",t[6]),O(A,"click",t[7])],z=!0)},p(N,[B]){B&1&&o.value!==N[0]&&G(o,N[0]),B&8&&c.value!==N[3]&&G(c,N[3]),B&2&&_.value!==N[1]&&G(_,N[1]),B&4&&L.value!==N[2]&&G(L,N[2]),N[5]?C?C.p(N,B):(C=sl(N),C.c(),C.m(e,null)):C&&(C.d(1),C=null)},i:J,o:J,d(N){N&&h(e),C&&C.d(),z=!1,pe(D)}}}function ps(t,e,n){const i=navigator.userAgent.includes("Windows");let o=i?"cmd":"sh",l=i?["/C"]:["-c"],{onMessage:a}=e,f='echo "hello world"',c=null,p="SOMETHING=value ANOTHER=2",d="",w="",_;function y(){return p.split(" ").reduce((S,z)=>{let[D,C]=z.split("=");return{...S,[D]:C}},{})}function g(){n(5,_=null);const S=new Ml(o,[...l,f],{cwd:c||null,env:y(),encoding:d});S.on("close",z=>{a(`command finished with code ${z.code} and signal ${z.signal}`),n(5,_=null)}),S.on("error",z=>a(`command error: "${z}"`)),S.stdout.on("data",z=>a(`command stdout: "${z}"`)),S.stderr.on("data",z=>a(`command stderr: "${z}"`)),S.spawn().then(z=>{n(5,_=z)}).catch(a)}function b(){_.kill().then(()=>a("killed child process")).catch(a)}function L(){_.write(w).catch(a)}function W(){f=this.value,n(0,f)}function U(){d=this.value,n(3,d)}function j(){c=this.value,n(1,c)}function q(){p=this.value,n(2,p)}function A(){w=this.value,n(4,w)}return t.$$set=S=>{"onMessage"in S&&n(9,a=S.onMessage)},[f,c,p,d,w,_,g,b,L,a,W,U,j,q,A]}class hs extends Se{constructor(e){super(),Ce(this,e,ps,ds,ke,{onMessage:9})}}function Ni(t){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,Xt("tauri://update-status",function(n){t(n==null?void 0:n.payload)})]})})}function Yl(){return M(this,void 0,void 0,function(){function t(){e&&e(),e=void 0}var e;return T(this,function(n){return[2,new Promise(function(i,o){Ni(function(l){return l.error?(t(),o(l.error)):l.status==="DONE"?(t(),i()):void 0}).then(function(l){e=l}).catch(function(l){throw t(),l}),ni("tauri://update-install").catch(function(l){throw t(),l})})]})})}function Kl(){return M(this,void 0,void 0,function(){function t(){e&&e(),e=void 0}var e;return T(this,function(n){return[2,new Promise(function(i,o){Fl("tauri://update-available",function(l){var a;a=l==null?void 0:l.payload,t(),i({manifest:a,shouldUpdate:!0})}).catch(function(l){throw t(),l}),Ni(function(l){return l.error?(t(),o(l.error)):l.status==="UPTODATE"?(t(),i({shouldUpdate:!1})):void 0}).then(function(l){e=l}).catch(function(l){throw t(),l}),ni("tauri://update").catch(function(l){throw t(),l})})]})})}Object.freeze({__proto__:null,onUpdaterEvent:Ni,installUpdate:Yl,checkUpdate:Kl});function ms(t){let e;return{c(){e=s("button"),e.innerHTML='
',u(e,"class","btn text-accentText dark:text-darkAccentText flex items-center justify-center")},m(n,i){m(n,e,i)},p:J,d(n){n&&h(e)}}}function vs(t){let e,n,i;return{c(){e=s("button"),e.textContent="Install update",u(e,"class","btn")},m(o,l){m(o,e,l),n||(i=O(e,"click",t[4]),n=!0)},p:J,d(o){o&&h(e),n=!1,i()}}}function _s(t){let e,n,i;return{c(){e=s("button"),e.textContent="Check update",u(e,"class","btn")},m(o,l){m(o,e,l),n||(i=O(e,"click",t[3]),n=!0)},p:J,d(o){o&&h(e),n=!1,i()}}}function bs(t){let e;function n(l,a){return!l[0]&&!l[2]?_s:!l[1]&&l[2]?vs:ms}let i=n(t),o=i(t);return{c(){e=s("div"),o.c(),u(e,"class","flex children:grow children:h10")},m(l,a){m(l,e,a),o.m(e,null)},p(l,[a]){i===(i=n(l))&&o?o.p(l,a):(o.d(1),o=i(l),o&&(o.c(),o.m(e,null)))},i:J,o:J,d(l){l&&h(e),o.d()}}}function gs(t,e,n){let{onMessage:i}=e,o;at(async()=>{o=await Xt("tauri://update-status",i)}),Di(()=>{o&&o()});let l,a,f;async function c(){n(0,l=!0);try{const{shouldUpdate:d,manifest:w}=await Kl();i(`Should update: ${d}`),i(w),n(2,f=d)}catch(d){i(d)}finally{n(0,l=!1)}}async function p(){n(1,a=!0);try{await Yl(),i("Installation complete, restart required."),await Fi()}catch(d){i(d)}finally{n(1,a=!1)}}return t.$$set=d=>{"onMessage"in d&&n(5,i=d.onMessage)},[l,a,f,c,p,i]}class ys extends Se{constructor(e){super(),Ce(this,e,gs,bs,ke,{onMessage:5})}}function Ql(t){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,P({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}})]})})}function Zl(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,P({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})]})})}Object.freeze({__proto__:null,writeText:Ql,readText:Zl});function ws(t){let e,n,i,o,l,a,f,c;return{c(){e=s("div"),n=s("input"),i=v(),o=s("button"),o.textContent="Write",l=v(),a=s("button"),a.textContent="Read",u(n,"class","grow input"),u(n,"placeholder","Text to write to the clipboard"),u(o,"class","btn"),u(o,"type","button"),u(a,"class","btn"),u(a,"type","button"),u(e,"class","flex gap-1")},m(p,d){m(p,e,d),r(e,n),G(n,t[0]),r(e,i),r(e,o),r(e,l),r(e,a),f||(c=[O(n,"input",t[4]),O(o,"click",t[1]),O(a,"click",t[2])],f=!0)},p(p,[d]){d&1&&n.value!==p[0]&&G(n,p[0])},i:J,o:J,d(p){p&&h(e),f=!1,pe(c)}}}function ks(t,e,n){let{onMessage:i}=e,o="clipboard message";function l(){Ql(o).then(()=>{i("Wrote to the clipboard")}).catch(i)}function a(){Zl().then(c=>{i(`Clipboard contents: ${c}`)}).catch(i)}function f(){o=this.value,n(0,o)}return t.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[o,l,a,i,f]}class Ms extends Se{constructor(e){super(),Ce(this,e,ks,ws,ke,{onMessage:3})}}function Ts(t){let e;return{c(){e=s("div"),e.innerHTML=`
Not available for Linux
- `,u(e,"class","flex flex-col gap-2")},m(n,i){m(n,e,i)},p:J,i:J,o:J,d(n){n&&h(e)}}}function Cs(t,e,n){let{onMessage:i}=e;const o=window.constraints={audio:!0,video:!0};function l(f){const c=document.querySelector("video"),p=f.getVideoTracks();i("Got stream with constraints:",o),i(`Using video device: ${p[0].label}`),window.stream=f,c.srcObject=f}function a(f){if(f.name==="ConstraintNotSatisfiedError"){const c=o.video;i(`The resolution ${c.width.exact}x${c.height.exact} px is not supported by your device.`)}else f.name==="PermissionDeniedError"&&i("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work.");i(`getUserMedia error: ${f.name}`,f)}return at(async()=>{try{const f=await navigator.mediaDevices.getUserMedia(o);l(f)}catch(f){a(f)}}),Di(()=>{window.stream.getTracks().forEach(function(f){f.stop()})}),t.$$set=f=>{"onMessage"in f&&n(0,i=f.onMessage)},[i]}class Ss extends Se{constructor(e){super(),Ce(this,e,Cs,Ts,ke,{onMessage:0})}}function ul(t,e,n){const i=t.slice();return i[32]=e[n],i}function al(t,e,n){const i=t.slice();return i[35]=e[n],i}function cl(t){let e,n,i,o,l,a,f,c,p,d,w,_,y,g,b;function L(S,z){return S[3]?Ls:zs}let W=L(t),U=W(t);function j(S,z){return S[2]?Ps:As}let q=j(t),A=q(t);return{c(){e=s("div"),n=s("span"),n.textContent="Tauri API Validation",i=v(),o=s("span"),l=s("span"),U.c(),f=v(),c=s("span"),c.innerHTML='
',p=v(),d=s("span"),A.c(),_=v(),y=s("span"),y.innerHTML='
',u(n,"class","lt-sm:pl-10 text-darkPrimaryText"),u(l,"title",a=t[3]?"Switch to Light mode":"Switch to Dark mode"),u(l,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),u(c,"title","Minimize"),u(c,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),u(d,"title",w=t[2]?"Restore":"Maximize"),u(d,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),u(y,"title","Close"),u(y,"class","hover:bg-red-700 dark:hover:bg-red-700 hover:text-darkPrimaryText active:bg-red-700/90 dark:active:bg-red-700/90 active:text-darkPrimaryText "),u(o,"class","h-100% children:h-100% children:w-12 children:inline-flex children:items-center children:justify-center"),u(e,"class","w-screen select-none h-8 pl-2 flex justify-between items-center absolute text-primaryText dark:text-darkPrimaryText"),u(e,"data-tauri-drag-region","")},m(S,z){m(S,e,z),r(e,n),r(e,i),r(e,o),r(o,l),U.m(l,null),r(o,f),r(o,c),r(o,p),r(o,d),A.m(d,null),r(o,_),r(o,y),g||(b=[O(l,"click",t[12]),O(c,"click",t[9]),O(d,"click",t[10]),O(y,"click",t[11])],g=!0)},p(S,z){W!==(W=L(S))&&(U.d(1),U=W(S),U&&(U.c(),U.m(l,null))),z[0]&8&&a!==(a=S[3]?"Switch to Light mode":"Switch to Dark mode")&&u(l,"title",a),q!==(q=j(S))&&(A.d(1),A=q(S),A&&(A.c(),A.m(d,null))),z[0]&4&&w!==(w=S[2]?"Restore":"Maximize")&&u(d,"title",w)},d(S){S&&h(e),U.d(),A.d(),g=!1,pe(b)}}}function zs(t){let e;return{c(){e=s("div"),u(e,"class","i-ph-moon")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Ls(t){let e;return{c(){e=s("div"),u(e,"class","i-ph-sun")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function As(t){let e;return{c(){e=s("div"),u(e,"class","i-codicon-chrome-maximize")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Ps(t){let e;return{c(){e=s("div"),u(e,"class","i-codicon-chrome-restore")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Os(t){let e;return{c(){e=s("span"),u(e,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Es(t){let e;return{c(){e=s("span"),u(e,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function fl(t){let e,n,i,o,l,a,f,c,p;function d(y,g){return y[3]?Ds:Ws}let w=d(t),_=w(t);return{c(){e=s("a"),_.c(),n=v(),i=s("br"),o=v(),l=s("div"),a=v(),f=s("br"),u(e,"href","##"),u(e,"class","nv justify-between h-8"),u(l,"class","bg-white/5 h-2px")},m(y,g){m(y,e,g),_.m(e,null),m(y,n,g),m(y,i,g),m(y,o,g),m(y,l,g),m(y,a,g),m(y,f,g),c||(p=O(e,"click",t[12]),c=!0)},p(y,g){w!==(w=d(y))&&(_.d(1),_=w(y),_&&(_.c(),_.m(e,null)))},d(y){y&&h(e),_.d(),y&&h(n),y&&h(i),y&&h(o),y&&h(l),y&&h(a),y&&h(f),c=!1,p()}}}function Ws(t){let e,n;return{c(){e=E(`Switch to Dark mode - `),n=s("div"),u(n,"class","i-ph-moon")},m(i,o){m(i,e,o),m(i,n,o)},d(i){i&&h(e),i&&h(n)}}}function Ds(t){let e,n;return{c(){e=E(`Switch to Light mode - `),n=s("div"),u(n,"class","i-ph-sun")},m(i,o){m(i,e,o),m(i,n,o)},d(i){i&&h(e),i&&h(n)}}}function js(t){let e,n,i,o,l=t[35].label+"",a,f,c,p;function d(){return t[20](t[35])}return{c(){e=s("a"),n=s("div"),i=v(),o=s("p"),a=E(l),u(n,"class",t[35].icon+" mr-2"),u(e,"href","##"),u(e,"class",f="nv "+(t[1]===t[35]?"nv_selected":""))},m(w,_){m(w,e,_),r(e,n),r(e,i),r(e,o),r(o,a),c||(p=O(e,"click",d),c=!0)},p(w,_){t=w,_[0]&2&&f!==(f="nv "+(t[1]===t[35]?"nv_selected":""))&&u(e,"class",f)},d(w){w&&h(e),c=!1,p()}}}function dl(t){let e,n=t[35]&&js(t);return{c(){n&&n.c(),e=$n()},m(i,o){n&&n.m(i,o),m(i,e,o)},p(i,o){i[35]&&n.p(i,o)},d(i){n&&n.d(i),i&&h(e)}}}function pl(t){let e,n=t[32].html+"",i;return{c(){e=new or(!1),i=$n(),e.a=i},m(o,l){e.m(n,o,l),m(o,i,l)},p(o,l){l[0]&64&&n!==(n=o[32].html+"")&&e.p(n)},d(o){o&&h(i),o&&e.d()}}}function Rs(t){let e,n,i,o,l,a,f,c,p,d,w,_,y,g,b,L,W,U,j,q,A,S,z,D,C,N,B,Y=t[1].label+"",$,_e,te,oe,K,be,H,Q,le,ae,ee,ve,re,ge,ne,Me,Le,R,V=t[5]&&cl(t);function Re(F,ie){return F[0]?Es:Os}let Ae=Re(t),Te=Ae(t),ce=!t[5]&&fl(t),he=t[7],fe=[];for(let F=0;F`,w=v(),_=s("a"),_.innerHTML=`Github - `,y=v(),g=s("a"),g.innerHTML=`Source - `,b=v(),L=s("br"),W=v(),U=s("div"),j=v(),q=s("br"),A=v(),S=s("div");for(let F=0;F',ge=v(),ne=s("div");for(let F=0;F{Gt(X,1)}),ti()}Pe?(K=new Pe(tt(F)),Kn(K.$$.fragment),Ee(K.$$.fragment,1),Vt(K,oe,null)):K=null}if(ie[0]&64){me=F[6];let X;for(X=0;X{await confirm("Are you sure?")||H.preventDefault()}),qe.onFileDropEvent(H=>{W(`File drop: ${JSON.stringify(H.payload)}`)});const o=navigator.userAgent.toLowerCase(),l=o.includes("android")||o.includes("iphone"),a=[{label:"Welcome",component:wr,icon:"i-ph-hand-waving"},{label:"Communication",component:zr,icon:"i-codicon-radio-tower"},!l&&{label:"CLI",component:Tr,icon:"i-codicon-terminal"},!l&&{label:"Dialog",component:Ur,icon:"i-codicon-multiple-windows"},{label:"File system",component:Vr,icon:"i-codicon-files"},{label:"HTTP",component:$r,icon:"i-ph-globe-hemisphere-west"},!l&&{label:"Notifications",component:is,icon:"i-codicon-bell-dot"},!l&&{label:"Window",component:rs,icon:"i-codicon-window"},!l&&{label:"Shortcuts",component:fs,icon:"i-codicon-record-keys"},{label:"Shell",component:hs,icon:"i-codicon-terminal-bash"},!l&&{label:"Updater",component:ys,icon:"i-codicon-cloud-download"},!l&&{label:"Clipboard",component:Ms,icon:"i-codicon-clippy"},{label:"WebRTC",component:Ss,icon:"i-ph-broadcast"}];let f=a[0];function c(H){n(1,f=H)}let p;at(async()=>{const H=Nt();n(2,p=await H.isMaximized()),Xt("tauri://resize",async()=>{n(2,p=await H.isMaximized())})});function d(){Nt().minimize()}async function w(){const H=Nt();await H.isMaximized()?H.unmaximize():H.maximize()}let _=!1;async function y(){_||(_=await Ul("Are you sure that you want to close this window?",{title:"Tauri API"}),_&&Nt().close())}let g;at(()=>{n(3,g=localStorage&&localStorage.getItem("theme")=="dark"),ml(g)});function b(){n(3,g=!g),ml(g)}let L=yl([]);_l(t,L,H=>n(6,i=H));function W(H){L.update(Q=>[{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof H=="string"?H:JSON.stringify(H,null,1))+"
"},...Q])}function U(H){L.update(Q=>[{html:`
[${new Date().toLocaleTimeString()}]: `+H+"
"},...Q])}function j(){L.update(()=>[])}let q,A,S;function z(H){S=H.clientY;const Q=window.getComputedStyle(q);A=parseInt(Q.height,10);const le=ee=>{const ve=ee.clientY-S,re=A-ve;n(4,q.style.height=`${re{document.removeEventListener("mouseup",ae),document.removeEventListener("mousemove",le)};document.addEventListener("mouseup",ae),document.addEventListener("mousemove",le)}let D;at(async()=>{n(5,D=await El()==="win32")});let C=!1,N,B,Y=!1,$=0,_e=0;const te=(H,Q,le)=>Math.min(Math.max(Q,H),le);at(()=>{n(18,N=document.querySelector("#sidebar")),B=document.querySelector("#sidebarToggle"),document.addEventListener("click",H=>{B.contains(H.target)?n(0,C=!C):C&&!N.contains(H.target)&&n(0,C=!1)}),document.addEventListener("touchstart",H=>{if(B.contains(H.target))return;const Q=H.touches[0].clientX;(0{if(Y){const Q=H.touches[0].clientX;_e=Q;const le=(Q-$)/10;N.style.setProperty("--translate-x",`-${te(0,C?0-le:18.75-le,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(Y){const H=(_e-$)/10;n(0,C=C?H>-(18.75/2):H>18.75/2)}Y=!1})});const oe=()=>Ri("https://tauri.app/"),K=H=>{c(H),n(0,C=!1)};function be(H){Yn[H?"unshift":"push"](()=>{q=H,n(4,q)})}return t.$$.update=()=>{if(t.$$.dirty[0]&1){const H=document.querySelector("#sidebar");H&&Hs(H,C)}},[C,f,p,g,q,D,i,a,c,d,w,y,b,L,W,U,j,z,N,oe,K,be]}class Is extends Se{constructor(e){super(),Ce(this,e,Fs,Rs,ke,{},null,[-1,-1])}}new Is({target:document.querySelector("#app")}); + Additionally, it has a update --background subcommand.`,n=h(),i=r("br"),l=h(),o=r("div"),o.textContent="Note that the arguments are only parsed, not implemented.",u=h(),d=r("br"),c=h(),f=r("br"),v=h(),k=r("button"),k.textContent="Get matches",a(o,"class","note"),a(k,"class","btn"),a(k,"id","cli-matches")},m(g,b){m(g,t,b),m(g,n,b),m(g,i,b),m(g,l,b),m(g,o,b),m(g,u,b),m(g,d,b),m(g,c,b),m(g,f,b),m(g,v,b),m(g,k,b),_||(y=E(k,"click",e[0]),_=!0)},p:V,i:V,o:V,d(g){g&&p(t),g&&p(n),g&&p(i),g&&p(l),g&&p(o),g&&p(u),g&&p(d),g&&p(c),g&&p(f),g&&p(v),g&&p(k),_=!1,y()}}}function Jo(e,t,n){let{onMessage:i}=t;function l(){Js().then(i).catch(i)}return e.$$set=o=>{"onMessage"in o&&n(1,i=o.onMessage)},[l,i]}class $o extends we{constructor(t){super(),ye(this,t,Jo,Go,me,{onMessage:1})}}function Xo(e){let t,n,i,l,o,u,d,c;return{c(){t=r("div"),n=r("button"),n.textContent="Call Log API",i=h(),l=r("button"),l.textContent="Call Request (async) API",o=h(),u=r("button"),u.textContent="Send event to Rust",a(n,"class","btn"),a(n,"id","log"),a(l,"class","btn"),a(l,"id","request"),a(u,"class","btn"),a(u,"id","event")},m(f,v){m(f,t,v),s(t,n),s(t,i),s(t,l),s(t,o),s(t,u),d||(c=[E(n,"click",e[0]),E(l,"click",e[1]),E(u,"click",e[2])],d=!0)},p:V,i:V,o:V,d(f){f&&p(t),d=!1,se(c)}}}function Yo(e,t,n){let{onMessage:i}=t,l;ct(async()=>{l=await Yt("rust-event",i)}),Wi(()=>{l&&l()});function o(){Zn("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function u(){Zn("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function d(){li("js-event","this is the payload string")}return e.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[o,u,d,i]}class Ko extends we{constructor(t){super(),ye(this,t,Yo,Xo,me,{onMessage:3})}}var Qo={};Te(Qo,{ask:()=>Xs,confirm:()=>xo,message:()=>Zo,open:()=>Ui,save:()=>$s});async function Ui(e={}){return typeof e=="object"&&Object.freeze(e),L({__tauriModule:"Dialog",message:{cmd:"openDialog",options:e}})}async function $s(e={}){return typeof e=="object"&&Object.freeze(e),L({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:e}})}async function Zo(e,t){var n;let i=typeof t=="string"?{title:t}:t;return L({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:e.toString(),title:(n=i==null?void 0:i.title)==null?void 0:n.toString(),type:i==null?void 0:i.type}})}async function Xs(e,t){var n;let i=typeof t=="string"?{title:t}:t;return L({__tauriModule:"Dialog",message:{cmd:"askDialog",message:e.toString(),title:(n=i==null?void 0:i.title)==null?void 0:n.toString(),type:i==null?void 0:i.type}})}async function xo(e,t){var n;let i=typeof t=="string"?{title:t}:t;return L({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:e.toString(),title:(n=i==null?void 0:i.title)==null?void 0:n.toString(),type:i==null?void 0:i.type}})}var er={};Te(er,{BaseDirectory:()=>Xt,Dir:()=>Xt,copyFile:()=>sr,createDir:()=>ir,exists:()=>ar,readBinaryFile:()=>qi,readDir:()=>Ys,readTextFile:()=>tr,removeDir:()=>lr,removeFile:()=>or,renameFile:()=>rr,writeBinaryFile:()=>nr,writeFile:()=>Oi,writeTextFile:()=>Oi});var Xt=(e=>(e[e.Audio=1]="Audio",e[e.Cache=2]="Cache",e[e.Config=3]="Config",e[e.Data=4]="Data",e[e.LocalData=5]="LocalData",e[e.Desktop=6]="Desktop",e[e.Document=7]="Document",e[e.Download=8]="Download",e[e.Executable=9]="Executable",e[e.Font=10]="Font",e[e.Home=11]="Home",e[e.Picture=12]="Picture",e[e.Public=13]="Public",e[e.Runtime=14]="Runtime",e[e.Template=15]="Template",e[e.Video=16]="Video",e[e.Resource=17]="Resource",e[e.App=18]="App",e[e.Log=19]="Log",e[e.Temp=20]="Temp",e[e.AppConfig=21]="AppConfig",e[e.AppData=22]="AppData",e[e.AppLocalData=23]="AppLocalData",e[e.AppCache=24]="AppCache",e[e.AppLog=25]="AppLog",e))(Xt||{});async function tr(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"readTextFile",path:e,options:t}})}async function qi(e,t={}){let n=await L({__tauriModule:"Fs",message:{cmd:"readFile",path:e,options:t}});return Uint8Array.from(n)}async function Oi(e,t,n){typeof n=="object"&&Object.freeze(n),typeof e=="object"&&Object.freeze(e);let i={path:"",contents:""},l=n;return typeof e=="string"?i.path=e:(i.path=e.path,i.contents=e.contents),typeof t=="string"?i.contents=t!=null?t:"":l=t,L({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(new TextEncoder().encode(i.contents)),options:l}})}async function nr(e,t,n){typeof n=="object"&&Object.freeze(n),typeof e=="object"&&Object.freeze(e);let i={path:"",contents:[]},l=n;return typeof e=="string"?i.path=e:(i.path=e.path,i.contents=e.contents),t&&"dir"in t?l=t:typeof e=="string"&&(i.contents=t!=null?t:[]),L({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(i.contents instanceof ArrayBuffer?new Uint8Array(i.contents):i.contents),options:l}})}async function Ys(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"readDir",path:e,options:t}})}async function ir(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"createDir",path:e,options:t}})}async function lr(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"removeDir",path:e,options:t}})}async function sr(e,t,n={}){return L({__tauriModule:"Fs",message:{cmd:"copyFile",source:e,destination:t,options:n}})}async function or(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"removeFile",path:e,options:t}})}async function rr(e,t,n={}){return L({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:e,newPath:t,options:n}})}async function ar(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"exists",path:e,options:t}})}function ur(e){let t,n,i,l,o,u,d,c,f,v,k,_,y,g,b,A,D,j,O,F,S,C,T,P;return{c(){t=r("div"),n=r("input"),i=h(),l=r("input"),o=h(),u=r("br"),d=h(),c=r("div"),f=r("input"),v=h(),k=r("label"),k.textContent="Multiple",_=h(),y=r("div"),g=r("input"),b=h(),A=r("label"),A.textContent="Directory",D=h(),j=r("br"),O=h(),F=r("button"),F.textContent="Open dialog",S=h(),C=r("button"),C.textContent="Open save dialog",a(n,"class","input"),a(n,"id","dialog-default-path"),a(n,"placeholder","Default path"),a(l,"class","input"),a(l,"id","dialog-filter"),a(l,"placeholder","Extensions filter, comma-separated"),a(t,"class","flex gap-2 children:grow"),a(f,"type","checkbox"),a(f,"id","dialog-multiple"),a(k,"for","dialog-multiple"),a(g,"type","checkbox"),a(g,"id","dialog-directory"),a(A,"for","dialog-directory"),a(F,"class","btn"),a(F,"id","open-dialog"),a(C,"class","btn"),a(C,"id","save-dialog")},m(M,N){m(M,t,N),s(t,n),B(n,e[0]),s(t,i),s(t,l),B(l,e[1]),m(M,o,N),m(M,u,N),m(M,d,N),m(M,c,N),s(c,f),f.checked=e[2],s(c,v),s(c,k),m(M,_,N),m(M,y,N),s(y,g),g.checked=e[3],s(y,b),s(y,A),m(M,D,N),m(M,j,N),m(M,O,N),m(M,F,N),m(M,S,N),m(M,C,N),T||(P=[E(n,"input",e[8]),E(l,"input",e[9]),E(f,"change",e[10]),E(g,"change",e[11]),E(F,"click",e[4]),E(C,"click",e[5])],T=!0)},p(M,[N]){N&1&&n.value!==M[0]&&B(n,M[0]),N&2&&l.value!==M[1]&&B(l,M[1]),N&4&&(f.checked=M[2]),N&8&&(g.checked=M[3])},i:V,o:V,d(M){M&&p(t),M&&p(o),M&&p(u),M&&p(d),M&&p(c),M&&p(_),M&&p(y),M&&p(D),M&&p(j),M&&p(O),M&&p(F),M&&p(S),M&&p(C),T=!1,se(P)}}}function cr(e,t){var n=new Blob([e],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(l){var o=l.target.result;t(o.substr(o.indexOf(",")+1))},i.readAsDataURL(n)}function dr(e,t,n){let{onMessage:i}=t,{insecureRenderHtml:l}=t,o=null,u=null,d=!1,c=!1;function f(){Ui({title:"My wonderful open dialog",defaultPath:o,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(b=>b.trim())}]:[],multiple:d,directory:c}).then(function(b){if(Array.isArray(b))i(b);else{var A=b,D=A.match(/\S+\.\S+$/g);qi(A).then(function(j){D&&(A.includes(".png")||A.includes(".jpg"))?cr(new Uint8Array(j),function(O){var F="data:image/png;base64,"+O;l('')}):i(b)}).catch(i(b))}}).catch(i)}function v(){$s({title:"My wonderful save dialog",defaultPath:o,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(b=>b.trim())}]:[]}).then(i).catch(i)}function k(){o=this.value,n(0,o)}function _(){u=this.value,n(1,u)}function y(){d=this.checked,n(2,d)}function g(){c=this.checked,n(3,c)}return e.$$set=b=>{"onMessage"in b&&n(6,i=b.onMessage),"insecureRenderHtml"in b&&n(7,l=b.insecureRenderHtml)},[o,u,d,c,f,v,i,l,k,_,y,g]}class fr extends we{constructor(t){super(),ye(this,t,dr,ur,me,{onMessage:6,insecureRenderHtml:7})}}function $l(e,t,n){const i=e.slice();return i[9]=t[n],i}function Xl(e){let t,n=e[9][0]+"",i,l;return{c(){t=r("option"),i=z(n),t.__value=l=e[9][1],t.value=t.__value},m(o,u){m(o,t,u),s(t,i)},p:V,d(o){o&&p(t)}}}function pr(e){let t,n,i,l,o,u,d,c,f,v,k,_,y,g,b,A,D,j,O,F=e[2],S=[];for(let C=0;CisNaN(parseInt(_))).map(_=>[_,Xt[_]]);function c(){const _=o.match(/\S+\.\S+$/g),y={dir:Yl()};(_?qi(o,y):Ys(o,y)).then(function(b){if(_)if(o.includes(".png")||o.includes(".jpg"))mr(new Uint8Array(b),function(A){const D="data:image/png;base64,"+A;l('')});else{const A=String.fromCharCode.apply(null,b);l(''),setTimeout(()=>{const D=document.getElementById("file-response");D.value=A,document.getElementById("file-save").addEventListener("click",function(){Oi(o,D.value,{dir:Yl()}).catch(i)})})}else i(b)}).catch(i)}function f(){n(1,u.src=Ls(o),u)}function v(){o=this.value,n(0,o)}function k(_){Kn[_?"unshift":"push"](()=>{u=_,n(1,u)})}return e.$$set=_=>{"onMessage"in _&&n(5,i=_.onMessage),"insecureRenderHtml"in _&&n(6,l=_.insecureRenderHtml)},[o,u,d,c,f,i,l,v,k]}class _r extends we{constructor(t){super(),ye(this,t,hr,pr,me,{onMessage:5,insecureRenderHtml:6})}}var br={};Te(br,{Body:()=>tt,Client:()=>Qs,Response:()=>Ks,ResponseType:()=>Bi,fetch:()=>gr,getClient:()=>ei});var Bi=(e=>(e[e.JSON=1]="JSON",e[e.Text=2]="Text",e[e.Binary=3]="Binary",e))(Bi||{}),tt=class{constructor(e,t){this.type=e,this.payload=t}static form(e){let t={};for(let n in e){let i=e[n],l;typeof i=="string"?l=i:i instanceof Uint8Array||Array.isArray(i)?l=Array.from(i):typeof i.file=="string"?l={file:i.file,mime:i.mime,fileName:i.fileName}:l={file:Array.from(i.file),mime:i.mime,fileName:i.fileName},t[n]=l}return new tt("Form",t)}static json(e){return new tt("Json",e)}static text(e){return new tt("Text",e)}static bytes(e){return new tt("Bytes",Array.from(e instanceof ArrayBuffer?new Uint8Array(e):e))}},Ks=class{constructor(e){this.url=e.url,this.status=e.status,this.ok=this.status>=200&&this.status<300,this.headers=e.headers,this.rawHeaders=e.rawHeaders,this.data=e.data}},Qs=class{constructor(e){this.id=e}async drop(){return L({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})}async request(e){let t=!e.responseType||e.responseType===1;return t&&(e.responseType=2),L({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(n=>{let i=new Ks(n);if(t){try{i.data=JSON.parse(i.data)}catch(l){if(i.ok&&i.data==="")i.data={};else if(i.ok)throw Error(`Failed to parse response \`${i.data}\` as JSON: ${l}; + try setting the \`responseType\` option to \`ResponseType.Text\` or \`ResponseType.Binary\` if the API does not return a JSON response.`)}return i}return i})}async get(e,t){return this.request(ze({method:"GET",url:e},t))}async post(e,t,n){return this.request(ze({method:"POST",url:e,body:t},n))}async put(e,t,n){return this.request(ze({method:"PUT",url:e,body:t},n))}async patch(e,t){return this.request(ze({method:"PATCH",url:e},t))}async delete(e,t){return this.request(ze({method:"DELETE",url:e},t))}};async function ei(e){return L({__tauriModule:"Http",message:{cmd:"createClient",options:e}}).then(t=>new Qs(t))}var zi=null;async function gr(e,t){var n;return zi===null&&(zi=await ei()),zi.request(ze({url:e,method:(n=t==null?void 0:t.method)!=null?n:"GET"},t))}function Kl(e,t,n){const i=e.slice();return i[12]=t[n],i[14]=n,i}function Ql(e){let t,n,i,l,o,u,d,c,f,v,k,_,y,g,b,A,D,j=e[5],O=[];for(let T=0;TIe(O[T],1,1,()=>{O[T]=null});let S=!e[3]&&ts(),C=!e[3]&&e[8]&&ns();return{c(){t=r("span"),n=r("span"),i=z(e[6]),l=h(),o=r("ul");for(let T=0;T{v[g]=null}),ii(),o=v[l],o?o.p(_,y):(o=v[l]=f[l](_),o.c()),De(o,1),o.m(t,u))},i(_){d||(De(o),d=!0)},o(_){Ie(o),d=!1},d(_){_&&p(t),c&&c.d(),v[l].d()}}}function ts(e){let t;return{c(){t=r("span"),t.textContent=",",a(t,"class","comma svelte-gbh3pt")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function ns(e){let t;return{c(){t=r("span"),t.textContent=",",a(t,"class","comma svelte-gbh3pt")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function wr(e){let t,n,i=e[5].length&&Ql(e);return{c(){i&&i.c(),t=ti()},m(l,o){i&&i.m(l,o),m(l,t,o),n=!0},p(l,[o]){l[5].length?i?(i.p(l,o),o&32&&De(i,1)):(i=Ql(l),i.c(),De(i,1),i.m(t.parentNode,t)):i&&(ni(),Ie(i,1,1,()=>{i=null}),ii())},i(l){n||(De(i),n=!0)},o(l){Ie(i),n=!1},d(l){i&&i.d(l),l&&p(t)}}}const kr="...";function Mr(e,t,n){let{json:i}=t,{depth:l=1/0}=t,{_lvl:o=0}=t,{_last:u=!0}=t;const d=b=>b===null?"null":typeof b;let c,f,v,k,_;const y=b=>{switch(d(b)){case"string":return`"${b}"`;case"function":return"f () {...}";case"symbol":return b.toString();default:return b}},g=()=>{n(8,_=!_)};return e.$$set=b=>{"json"in b&&n(0,i=b.json),"depth"in b&&n(1,l=b.depth),"_lvl"in b&&n(2,o=b._lvl),"_last"in b&&n(3,u=b._last)},e.$$.update=()=>{e.$$.dirty&17&&(n(5,c=d(i)==="object"?Object.keys(i):[]),n(4,f=Array.isArray(i)),n(6,v=f?"[":"{"),n(7,k=f?"]":"}")),e.$$.dirty&6&&n(8,_=le[9].call(n)),a(k,"class","input h-auto w-100%"),a(k,"id","request-body"),a(k,"placeholder","Request body"),a(k,"rows","5"),a(b,"class","btn"),a(b,"id","make-request"),a(C,"class","input"),a(P,"class","input"),a(S,"class","flex gap-2 children:grow"),a(Q,"type","checkbox"),a(Y,"class","btn"),a(Y,"type","button")},m(R,q){m(R,t,q),s(t,n),s(n,i),s(n,l),s(n,o),s(n,u),s(n,d),Dt(n,e[0]),s(t,c),s(t,f),s(t,v),s(t,k),B(k,e[1]),s(t,_),s(t,y),s(t,g),s(t,b),m(R,A,q),m(R,D,q),m(R,j,q),m(R,O,q),m(R,F,q),m(R,S,q),s(S,C),B(C,e[2]),s(S,T),s(S,P),B(P,e[3]),m(R,M,q),m(R,N,q),m(R,U,q),m(R,J,q),s(J,Q),Q.checked=e[5],s(J,he),m(R,x,q),m(R,ne,q),m(R,X,q),m(R,_e,q),m(R,W,q),m(R,Y,q),m(R,ie,q),m(R,oe,q),m(R,Z,q),m(R,pe,q),m(R,re,q),Jt(be,R,q),ee=!0,ke||(Ae=[E(n,"change",e[9]),E(k,"input",e[10]),E(t,"submit",Yn(e[6])),E(C,"input",e[11]),E(P,"input",e[12]),E(Q,"change",e[13]),E(Y,"click",e[7])],ke=!0)},p(R,[q]){q&1&&Dt(n,R[0]),q&2&&B(k,R[1]),q&4&&C.value!==R[2]&&B(C,R[2]),q&8&&P.value!==R[3]&&B(P,R[3]),q&32&&(Q.checked=R[5]);const We={};q&16&&(We.json=R[4]),be.$set(We)},i(R){ee||(De(be.$$.fragment,R),ee=!0)},o(R){Ie(be.$$.fragment,R),ee=!1},d(R){R&&p(t),R&&p(A),R&&p(D),R&&p(j),R&&p(O),R&&p(F),R&&p(S),R&&p(M),R&&p(N),R&&p(U),R&&p(J),R&&p(x),R&&p(ne),R&&p(X),R&&p(_e),R&&p(W),R&&p(Y),R&&p(ie),R&&p(oe),R&&p(Z),R&&p(pe),R&&p(re),$t(be,R),ke=!1,se(Ae)}}}function Tr(e,t,n){let i="GET",l="",{onMessage:o}=t;async function u(){const D=await ei().catch(F=>{throw o(F),F}),O={url:"http://localhost:3003",method:i||"GET"||"GET"};l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]")?O.body=tt.json(JSON.parse(l)):l!==""&&(O.body=tt.text(l)),D.request(O).then(o).catch(o)}let d="baz",c="qux",f=null,v=!0;async function k(){const D=await ei().catch(j=>{throw o(j),j});n(4,f=await D.request({url:"http://localhost:3003",method:"POST",body:tt.form({foo:d,bar:c}),headers:v?{"Content-Type":"multipart/form-data"}:void 0,responseType:Bi.Text}))}function _(){i=Di(this),n(0,i)}function y(){l=this.value,n(1,l)}function g(){d=this.value,n(2,d)}function b(){c=this.value,n(3,c)}function A(){v=this.checked,n(5,v)}return e.$$set=D=>{"onMessage"in D&&n(8,o=D.onMessage)},[i,l,d,c,f,v,u,k,o,_,y,g,b,A]}class Ar extends we{constructor(t){super(),ye(this,t,Tr,Cr,me,{onMessage:8})}}function Lr(e){let t,n,i;return{c(){t=r("button"),t.textContent="Send test notification",a(t,"class","btn"),a(t,"id","notification")},m(l,o){m(l,t,o),n||(i=E(t,"click",Sr),n=!0)},p:V,i:V,o:V,d(l){l&&p(t),n=!1,i()}}}function Sr(){new Notification("Notification title",{body:"This is the notification body"})}function Er(e,t,n){let{onMessage:i}=t;return e.$$set=l=>{"onMessage"in l&&n(0,i=l.onMessage)},[i]}class zr extends we{constructor(t){super(),ye(this,t,Er,Lr,me,{onMessage:0})}}function is(e,t,n){const i=e.slice();return i[67]=t[n],i}function ls(e,t,n){const i=e.slice();return i[70]=t[n],i}function ss(e){let t,n,i,l,o,u,d=Object.keys(e[1]),c=[];for(let f=0;fe[39].call(i))},m(f,v){m(f,t,v),m(f,n,v),m(f,i,v),s(i,l);for(let k=0;ke[57].call(Fe)),a(Ke,"class","input"),a(Ke,"type","number"),a(Qe,"class","input"),a(Qe,"type","number"),a(Ne,"class","flex gap-2"),a(Ze,"class","input grow"),a(Ze,"id","title"),a(Nt,"class","btn"),a(Nt,"type","submit"),a(at,"class","flex gap-1"),a(xe,"class","input grow"),a(xe,"id","url"),a(Ft,"class","btn"),a(Ft,"id","open-url"),a(ut,"class","flex gap-1"),a(rt,"class","flex flex-col gap-1")},m(w,I){m(w,t,I),m(w,n,I),m(w,i,I),s(i,l),s(i,o),s(i,u),s(i,d),s(i,c),s(i,f),s(i,v),s(i,k),s(i,_),m(w,y,I),m(w,g,I),m(w,b,I),m(w,A,I),s(A,D),s(D,j),s(D,O),O.checked=e[3],s(A,F),s(A,S),s(S,C),s(S,T),T.checked=e[2],s(A,P),s(A,M),s(M,N),s(M,U),U.checked=e[4],s(A,J),s(A,Q),s(Q,he),s(Q,x),x.checked=e[5],s(A,ne),s(A,X),s(X,_e),s(X,W),W.checked=e[6],m(w,Y,I),m(w,ie,I),m(w,oe,I),m(w,Z,I),s(Z,pe),s(pe,re),s(re,be),s(re,ee),B(ee,e[13]),s(pe,ke),s(pe,Ae),s(Ae,R),s(Ae,q),B(q,e[14]),s(Z,We),s(Z,Le),s(Le,Me),s(Me,ae),s(Me,de),B(de,e[7]),s(Le,ue),s(Le,Se),s(Se,nt),s(Se,fe),B(fe,e[8]),s(Z,ce),s(Z,H),s(H,te),s(te,G),s(te,ge),B(ge,e[9]),s(H,Kt),s(H,_t),s(_t,Qt),s(_t,Re),B(Re,e[10]),s(Z,Zt),s(Z,qe),s(qe,bt),s(bt,xt),s(bt,$),B($,e[11]),s(qe,Ot),s(qe,it),s(it,Wt),s(it,Pe),B(Pe,e[12]),m(w,gt,I),m(w,vt,I),m(w,yt,I),m(w,Ee,I),s(Ee,He),s(He,Oe),s(Oe,lt),s(Oe,Rt),s(Oe,st),s(st,It),s(st,wt),s(Oe,Ht),s(Oe,kt),s(kt,Gi),s(kt,si),s(He,Ji),s(He,Be),s(Be,tn),s(Be,$i),s(Be,nn),s(nn,Xi),s(nn,oi),s(Be,Yi),s(Be,sn),s(sn,Ki),s(sn,ri),s(Ee,Qi),s(Ee,Mt),s(Mt,Ve),s(Ve,rn),s(Ve,Zi),s(Ve,an),s(an,xi),s(an,ai),s(Ve,el),s(Ve,cn),s(cn,tl),s(cn,ui),s(Mt,nl),s(Mt,Ge),s(Ge,fn),s(Ge,il),s(Ge,pn),s(pn,ll),s(pn,ci),s(Ge,sl),s(Ge,hn),s(hn,ol),s(hn,di),s(Ee,rl),s(Ee,Ct),s(Ct,Je),s(Je,bn),s(Je,al),s(Je,gn),s(gn,ul),s(gn,fi),s(Je,cl),s(Je,yn),s(yn,dl),s(yn,pi),s(Ct,fl),s(Ct,$e),s($e,kn),s($e,pl),s($e,Mn),s(Mn,ml),s(Mn,mi),s($e,hl),s($e,Tn),s(Tn,_l),s(Tn,hi),s(Ee,bl),s(Ee,Tt),s(Tt,Xe),s(Xe,Ln),s(Xe,gl),s(Xe,Sn),s(Sn,vl),s(Sn,_i),s(Xe,yl),s(Xe,zn),s(zn,wl),s(zn,bi),s(Tt,kl),s(Tt,Ye),s(Ye,Pn),s(Ye,Ml),s(Ye,On),s(On,Cl),s(On,gi),s(Ye,Tl),s(Ye,Rn),s(Rn,Al),s(Rn,vi),m(w,yi,I),m(w,wi,I),m(w,ki,I),m(w,jt,I),m(w,Mi,I),m(w,je,I),s(je,Hn),s(Hn,At),At.checked=e[15],s(Hn,Ll),s(je,Sl),s(je,jn),s(jn,Lt),Lt.checked=e[16],s(jn,El),s(je,zl),s(je,Nn),s(Nn,St),St.checked=e[20],s(Nn,Dl),m(w,Ci,I),m(w,Ne,I),s(Ne,Fn),s(Fn,Pl),s(Fn,Fe);for(let ve=0;ve=1,v,k,_,y=f&&ss(e),g=e[1][e[0]]&&rs(e);return{c(){t=r("div"),n=r("div"),i=r("input"),l=h(),o=r("button"),o.textContent="New window",u=h(),d=r("br"),c=h(),y&&y.c(),v=h(),g&&g.c(),a(i,"class","input grow"),a(i,"type","text"),a(i,"placeholder","New Window label.."),a(o,"class","btn"),a(n,"class","flex gap-1"),a(t,"class","flex flex-col children:grow gap-2")},m(b,A){m(b,t,A),s(t,n),s(n,i),B(i,e[21]),s(n,l),s(n,o),s(t,u),s(t,d),s(t,c),y&&y.m(t,null),s(t,v),g&&g.m(t,null),k||(_=[E(i,"input",e[38]),E(o,"click",e[35])],k=!0)},p(b,A){A[0]&2097152&&i.value!==b[21]&&B(i,b[21]),A[0]&2&&(f=Object.keys(b[1]).length>=1),f?y?y.p(b,A):(y=ss(b),y.c(),y.m(t,v)):y&&(y.d(1),y=null),b[1][b[0]]?g?g.p(b,A):(g=rs(b),g.c(),g.m(t,null)):g&&(g.d(1),g=null)},i:V,o:V,d(b){b&&p(t),y&&y.d(),g&&g.d(),k=!1,se(_)}}}function Pr(e,t,n){let i=Ue.label;const l={[Ue.label]:Ue},o=["default","crosshair","hand","arrow","move","text","wait","help","progress","notAllowed","contextMenu","cell","verticalText","alias","copy","noDrop","grab","grabbing","allScroll","zoomIn","zoomOut","eResize","nResize","neResize","nwResize","sResize","seResize","swResize","wResize","ewResize","nsResize","neswResize","nwseResize","colResize","rowResize"];let{onMessage:u}=t,d,c="https://tauri.app",f=!0,v=!1,k=!0,_=!1,y=!1,g=null,b=null,A=null,D=null,j=null,O=null,F=null,S=null,C=1,T=new et(F,S),P=new et(F,S),M=new ft(g,b),N=new ft(g,b),U,J,Q=!1,he=!0,x=null,ne=null,X="default",_e=!1,W="Awesome Tauri Example!";function Y(){Ii(c)}function ie(){l[i].setTitle(W)}function oe(){l[i].hide(),setTimeout(l[i].show,2e3)}function Z(){l[i].minimize(),setTimeout(l[i].unminimize,2e3)}function pe(){Ui({multiple:!1}).then($=>{typeof $=="string"&&l[i].setIcon($)})}function re(){if(!d)return;const $=new ht(d);n(1,l[d]=$,l),$.once("tauri://error",function(){u("Error creating new webview")})}function be(){l[i].innerSize().then($=>{n(26,M=$),n(7,g=M.width),n(8,b=M.height)}),l[i].outerSize().then($=>{n(27,N=$)})}function ee(){l[i].innerPosition().then($=>{n(24,T=$)}),l[i].outerPosition().then($=>{n(25,P=$),n(13,F=P.x),n(14,S=P.y)})}async function ke($){!$||(U&&U(),J&&J(),J=await $.listen("tauri://move",ee),U=await $.listen("tauri://resize",be))}async function Ae(){await l[i].minimize(),await l[i].requestUserAttention(ji.Critical),await new Promise($=>setTimeout($,3e3)),await l[i].requestUserAttention(null)}function R(){d=this.value,n(21,d)}function q(){i=Di(this),n(0,i),n(1,l)}const We=()=>l[i].center();function Le(){v=this.checked,n(3,v)}function Me(){f=this.checked,n(2,f)}function ae(){k=this.checked,n(4,k)}function de(){_=this.checked,n(5,_)}function ue(){y=this.checked,n(6,y)}function Se(){F=le(this.value),n(13,F)}function nt(){S=le(this.value),n(14,S)}function fe(){g=le(this.value),n(7,g)}function ce(){b=le(this.value),n(8,b)}function H(){A=le(this.value),n(9,A)}function te(){D=le(this.value),n(10,D)}function G(){j=le(this.value),n(11,j)}function ge(){O=le(this.value),n(12,O)}function Kt(){Q=this.checked,n(15,Q)}function _t(){he=this.checked,n(16,he)}function Qt(){_e=this.checked,n(20,_e)}function Re(){X=Di(this),n(19,X),n(29,o)}function Zt(){x=le(this.value),n(17,x)}function qe(){ne=le(this.value),n(18,ne)}function bt(){W=this.value,n(28,W)}function xt(){c=this.value,n(22,c)}return e.$$set=$=>{"onMessage"in $&&n(37,u=$.onMessage)},e.$$.update=()=>{var $,Ot,it,Wt,Pe,gt,vt,yt,Ee,He,Oe,lt,Rt,st,It,ot,wt,Ht;e.$$.dirty[0]&3&&(l[i],ee(),be()),e.$$.dirty[0]&7&&(($=l[i])==null||$.setResizable(f)),e.$$.dirty[0]&11&&(v?(Ot=l[i])==null||Ot.maximize():(it=l[i])==null||it.unmaximize()),e.$$.dirty[0]&19&&((Wt=l[i])==null||Wt.setDecorations(k)),e.$$.dirty[0]&35&&((Pe=l[i])==null||Pe.setAlwaysOnTop(_)),e.$$.dirty[0]&67&&((gt=l[i])==null||gt.setFullscreen(y)),e.$$.dirty[0]&387&&g&&b&&((vt=l[i])==null||vt.setSize(new ft(g,b))),e.$$.dirty[0]&1539&&(A&&D?(yt=l[i])==null||yt.setMinSize(new xn(A,D)):(Ee=l[i])==null||Ee.setMinSize(null)),e.$$.dirty[0]&6147&&(j>800&&O>400?(He=l[i])==null||He.setMaxSize(new xn(j,O)):(Oe=l[i])==null||Oe.setMaxSize(null)),e.$$.dirty[0]&24579&&F!==null&&S!==null&&((lt=l[i])==null||lt.setPosition(new et(F,S))),e.$$.dirty[0]&3&&((Rt=l[i])==null||Rt.scaleFactor().then(kt=>n(23,C=kt))),e.$$.dirty[0]&3&&ke(l[i]),e.$$.dirty[0]&32771&&((st=l[i])==null||st.setCursorGrab(Q)),e.$$.dirty[0]&65539&&((It=l[i])==null||It.setCursorVisible(he)),e.$$.dirty[0]&524291&&((ot=l[i])==null||ot.setCursorIcon(X)),e.$$.dirty[0]&393219&&x!==null&&ne!==null&&((wt=l[i])==null||wt.setCursorPosition(new et(x,ne))),e.$$.dirty[0]&1048579&&((Ht=l[i])==null||Ht.setIgnoreCursorEvents(_e))},[i,l,f,v,k,_,y,g,b,A,D,j,O,F,S,Q,he,x,ne,X,_e,d,c,C,T,P,M,N,W,o,Y,ie,oe,Z,pe,re,Ae,u,R,q,We,Le,Me,ae,de,ue,Se,nt,fe,ce,H,te,G,ge,Kt,_t,Qt,Re,Zt,qe,bt,xt]}class Or extends we{constructor(t){super(),ye(this,t,Pr,Dr,me,{onMessage:37},null,[-1,-1,-1])}}var Wr={};Te(Wr,{isRegistered:()=>Ir,register:()=>xs,registerAll:()=>Rr,unregister:()=>eo,unregisterAll:()=>to});async function xs(e,t){return L({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:e,handler:mt(t)}})}async function Rr(e,t){return L({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:e,handler:mt(t)}})}async function Ir(e){return L({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:e}})}async function eo(e){return L({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:e}})}async function to(){return L({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})}function us(e,t,n){const i=e.slice();return i[9]=t[n],i}function cs(e){let t,n=e[9]+"",i,l,o,u,d;function c(){return e[8](e[9])}return{c(){t=r("div"),i=z(n),l=h(),o=r("button"),o.textContent="Unregister",a(o,"class","btn"),a(o,"type","button"),a(t,"class","flex justify-between")},m(f,v){m(f,t,v),s(t,i),s(t,l),s(t,o),u||(d=E(o,"click",c),u=!0)},p(f,v){e=f,v&2&&n!==(n=e[9]+"")&&K(i,n)},d(f){f&&p(t),u=!1,d()}}}function ds(e){let t,n,i,l,o;return{c(){t=r("br"),n=h(),i=r("button"),i.textContent="Unregister all",a(i,"class","btn"),a(i,"type","button")},m(u,d){m(u,t,d),m(u,n,d),m(u,i,d),l||(o=E(i,"click",e[5]),l=!0)},p:V,d(u){u&&p(t),u&&p(n),u&&p(i),l=!1,o()}}}function Hr(e){let t,n,i,l,o,u,d,c,f,v,k,_=e[1],y=[];for(let b=0;b<_.length;b+=1)y[b]=cs(us(e,_,b));let g=e[1].length>1&&ds(e);return{c(){t=r("div"),n=r("input"),i=h(),l=r("button"),l.textContent="Register",o=h(),u=r("br"),d=h(),c=r("div");for(let b=0;b1?g?g.p(b,A):(g=ds(b),g.c(),g.m(c,null)):g&&(g.d(1),g=null)},i:V,o:V,d(b){b&&p(t),b&&p(o),b&&p(u),b&&p(d),b&&p(c),pt(y,b),g&&g.d(),v=!1,se(k)}}}function jr(e,t,n){let i,{onMessage:l}=t;const o=Ts([]);ks(e,o,_=>n(1,i=_));let u="CmdOrControl+X";function d(){const _=u;xs(_,()=>{l(`Shortcut ${_} triggered`)}).then(()=>{o.update(y=>[...y,_]),l(`Shortcut ${_} registered successfully`)}).catch(l)}function c(_){const y=_;eo(y).then(()=>{o.update(g=>g.filter(b=>b!==y)),l(`Shortcut ${y} unregistered`)}).catch(l)}function f(){to().then(()=>{o.update(()=>[]),l("Unregistered all shortcuts")}).catch(l)}function v(){u=this.value,n(0,u)}const k=_=>c(_);return e.$$set=_=>{"onMessage"in _&&n(6,l=_.onMessage)},[u,i,o,d,c,f,l,v,k]}class Nr extends we{constructor(t){super(),ye(this,t,jr,Hr,me,{onMessage:6})}}function fs(e){let t,n,i,l,o,u,d;return{c(){t=r("br"),n=h(),i=r("input"),l=h(),o=r("button"),o.textContent="Write",a(i,"class","input"),a(i,"placeholder","write to stdin"),a(o,"class","btn")},m(c,f){m(c,t,f),m(c,n,f),m(c,i,f),B(i,e[4]),m(c,l,f),m(c,o,f),u||(d=[E(i,"input",e[14]),E(o,"click",e[8])],u=!0)},p(c,f){f&16&&i.value!==c[4]&&B(i,c[4])},d(c){c&&p(t),c&&p(n),c&&p(i),c&&p(l),c&&p(o),u=!1,se(d)}}}function Fr(e){let t,n,i,l,o,u,d,c,f,v,k,_,y,g,b,A,D,j,O,F,S,C,T,P,M=e[5]&&fs(e);return{c(){t=r("div"),n=r("div"),i=z(`Script: + `),l=r("input"),o=h(),u=r("div"),d=z(`Encoding: + `),c=r("input"),f=h(),v=r("div"),k=z(`Working directory: + `),_=r("input"),y=h(),g=r("div"),b=z(`Arguments: + `),A=r("input"),D=h(),j=r("div"),O=r("button"),O.textContent="Run",F=h(),S=r("button"),S.textContent="Kill",C=h(),M&&M.c(),a(l,"class","grow input"),a(n,"class","flex items-center gap-1"),a(c,"class","grow input"),a(u,"class","flex items-center gap-1"),a(_,"class","grow input"),a(_,"placeholder","Working directory"),a(v,"class","flex items-center gap-1"),a(A,"class","grow input"),a(A,"placeholder","Environment variables"),a(g,"class","flex items-center gap-1"),a(O,"class","btn"),a(S,"class","btn"),a(j,"class","flex children:grow gap-1"),a(t,"class","flex flex-col childre:grow gap-1")},m(N,U){m(N,t,U),s(t,n),s(n,i),s(n,l),B(l,e[0]),s(t,o),s(t,u),s(u,d),s(u,c),B(c,e[3]),s(t,f),s(t,v),s(v,k),s(v,_),B(_,e[1]),s(t,y),s(t,g),s(g,b),s(g,A),B(A,e[2]),s(t,D),s(t,j),s(j,O),s(j,F),s(j,S),s(t,C),M&&M.m(t,null),T||(P=[E(l,"input",e[10]),E(c,"input",e[11]),E(_,"input",e[12]),E(A,"input",e[13]),E(O,"click",e[6]),E(S,"click",e[7])],T=!0)},p(N,[U]){U&1&&l.value!==N[0]&&B(l,N[0]),U&8&&c.value!==N[3]&&B(c,N[3]),U&2&&_.value!==N[1]&&B(_,N[1]),U&4&&A.value!==N[2]&&B(A,N[2]),N[5]?M?M.p(N,U):(M=fs(N),M.c(),M.m(t,null)):M&&(M.d(1),M=null)},i:V,o:V,d(N){N&&p(t),M&&M.d(),T=!1,se(P)}}}function Ur(e,t,n){const i=navigator.userAgent.includes("Windows");let l=i?"cmd":"sh",o=i?["/C"]:["-c"],{onMessage:u}=t,d='echo "hello world"',c=null,f="SOMETHING=value ANOTHER=2",v="",k="",_;function y(){return f.split(" ").reduce((C,T)=>{let[P,M]=T.split("=");return{...C,[P]:M}},{})}function g(){n(5,_=null);const C=new Ri(l,[...o,d],{cwd:c||null,env:y(),encoding:v});C.on("close",T=>{u(`command finished with code ${T.code} and signal ${T.signal}`),n(5,_=null)}),C.on("error",T=>u(`command error: "${T}"`)),C.stdout.on("data",T=>u(`command stdout: "${T}"`)),C.stderr.on("data",T=>u(`command stderr: "${T}"`)),C.spawn().then(T=>{n(5,_=T)}).catch(u)}function b(){_.kill().then(()=>u("killed child process")).catch(u)}function A(){_.write(k).catch(u)}function D(){d=this.value,n(0,d)}function j(){v=this.value,n(3,v)}function O(){c=this.value,n(1,c)}function F(){f=this.value,n(2,f)}function S(){k=this.value,n(4,k)}return e.$$set=C=>{"onMessage"in C&&n(9,u=C.onMessage)},[d,c,f,v,k,_,g,b,A,u,D,j,O,F,S]}class qr extends we{constructor(t){super(),ye(this,t,Ur,Fr,me,{onMessage:9})}}var Br={};Te(Br,{checkUpdate:()=>io,installUpdate:()=>no,onUpdaterEvent:()=>Vi});async function Vi(e){return Yt("tauri://update-status",t=>{e(t==null?void 0:t.payload)})}async function no(){let e;function t(){e&&e(),e=void 0}return new Promise((n,i)=>{function l(o){if(o.error)return t(),i(o.error);if(o.status==="DONE")return t(),n()}Vi(l).then(o=>{e=o}).catch(o=>{throw t(),o}),li("tauri://update-install").catch(o=>{throw t(),o})})}async function io(){let e;function t(){e&&e(),e=void 0}return new Promise((n,i)=>{function l(u){return t(),n({manifest:u,shouldUpdate:!0})}function o(u){if(u.error)return t(),i(u.error);if(u.status==="UPTODATE")return t(),n({shouldUpdate:!1})}Os("tauri://update-available",u=>{l(u==null?void 0:u.payload)}).catch(u=>{throw t(),u}),Vi(o).then(u=>{e=u}).catch(u=>{throw t(),u}),li("tauri://update").catch(u=>{throw t(),u})})}function Vr(e){let t;return{c(){t=r("button"),t.innerHTML='
',a(t,"class","btn text-accentText dark:text-darkAccentText flex items-center justify-center")},m(n,i){m(n,t,i)},p:V,d(n){n&&p(t)}}}function Gr(e){let t,n,i;return{c(){t=r("button"),t.textContent="Install update",a(t,"class","btn")},m(l,o){m(l,t,o),n||(i=E(t,"click",e[4]),n=!0)},p:V,d(l){l&&p(t),n=!1,i()}}}function Jr(e){let t,n,i;return{c(){t=r("button"),t.textContent="Check update",a(t,"class","btn")},m(l,o){m(l,t,o),n||(i=E(t,"click",e[3]),n=!0)},p:V,d(l){l&&p(t),n=!1,i()}}}function $r(e){let t;function n(o,u){return!o[0]&&!o[2]?Jr:!o[1]&&o[2]?Gr:Vr}let i=n(e),l=i(e);return{c(){t=r("div"),l.c(),a(t,"class","flex children:grow children:h10")},m(o,u){m(o,t,u),l.m(t,null)},p(o,[u]){i===(i=n(o))&&l?l.p(o,u):(l.d(1),l=i(o),l&&(l.c(),l.m(t,null)))},i:V,o:V,d(o){o&&p(t),l.d()}}}function Xr(e,t,n){let{onMessage:i}=t,l;ct(async()=>{l=await Yt("tauri://update-status",i)}),Wi(()=>{l&&l()});let o,u,d;async function c(){n(0,o=!0);try{const{shouldUpdate:v,manifest:k}=await io();i(`Should update: ${v}`),i(k),n(2,d=v)}catch(v){i(v)}finally{n(0,o=!1)}}async function f(){n(1,u=!0);try{await no(),i("Installation complete, restart required."),await Fi()}catch(v){i(v)}finally{n(1,u=!1)}}return e.$$set=v=>{"onMessage"in v&&n(5,i=v.onMessage)},[o,u,d,c,f,i]}class Yr extends we{constructor(t){super(),ye(this,t,Xr,$r,me,{onMessage:5})}}var Kr={};Te(Kr,{readText:()=>so,writeText:()=>lo});async function lo(e){return L({__tauriModule:"Clipboard",message:{cmd:"writeText",data:e}})}async function so(){return L({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})}function Qr(e){let t,n,i,l,o,u,d,c;return{c(){t=r("div"),n=r("input"),i=h(),l=r("button"),l.textContent="Write",o=h(),u=r("button"),u.textContent="Read",a(n,"class","grow input"),a(n,"placeholder","Text to write to the clipboard"),a(l,"class","btn"),a(l,"type","button"),a(u,"class","btn"),a(u,"type","button"),a(t,"class","flex gap-1")},m(f,v){m(f,t,v),s(t,n),B(n,e[0]),s(t,i),s(t,l),s(t,o),s(t,u),d||(c=[E(n,"input",e[4]),E(l,"click",e[1]),E(u,"click",e[2])],d=!0)},p(f,[v]){v&1&&n.value!==f[0]&&B(n,f[0])},i:V,o:V,d(f){f&&p(t),d=!1,se(c)}}}function Zr(e,t,n){let{onMessage:i}=t,l="clipboard message";function o(){lo(l).then(()=>{i("Wrote to the clipboard")}).catch(i)}function u(){so().then(c=>{i(`Clipboard contents: ${c}`)}).catch(i)}function d(){l=this.value,n(0,l)}return e.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[l,o,u,i,d]}class xr extends we{constructor(t){super(),ye(this,t,Zr,Qr,me,{onMessage:3})}}function ea(e){let t;return{c(){t=r("div"),t.innerHTML=`
Not available for Linux
+ `,a(t,"class","flex flex-col gap-2")},m(n,i){m(n,t,i)},p:V,i:V,o:V,d(n){n&&p(t)}}}function ta(e,t,n){let{onMessage:i}=t;const l=window.constraints={audio:!0,video:!0};function o(d){const c=document.querySelector("video"),f=d.getVideoTracks();i("Got stream with constraints:",l),i(`Using video device: ${f[0].label}`),window.stream=d,c.srcObject=d}function u(d){if(d.name==="ConstraintNotSatisfiedError"){const c=l.video;i(`The resolution ${c.width.exact}x${c.height.exact} px is not supported by your device.`)}else d.name==="PermissionDeniedError"&&i("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work.");i(`getUserMedia error: ${d.name}`,d)}return ct(async()=>{try{const d=await navigator.mediaDevices.getUserMedia(l);o(d)}catch(d){u(d)}}),Wi(()=>{window.stream.getTracks().forEach(function(d){d.stop()})}),e.$$set=d=>{"onMessage"in d&&n(0,i=d.onMessage)},[i]}class na extends we{constructor(t){super(),ye(this,t,ta,ea,me,{onMessage:0})}}function ia(e){let t,n,i,l,o,u;return{c(){t=r("div"),n=r("button"),n.textContent="Show",i=h(),l=r("button"),l.textContent="Hide",a(n,"class","btn"),a(n,"id","show"),a(n,"title","Hides and shows the app after 2 seconds"),a(l,"class","btn"),a(l,"id","hide")},m(d,c){m(d,t,c),s(t,n),s(t,i),s(t,l),o||(u=[E(n,"click",e[0]),E(l,"click",e[1])],o=!0)},p:V,i:V,o:V,d(d){d&&p(t),o=!1,se(u)}}}function la(e,t,n){let{onMessage:i}=t;function l(){o().then(()=>{setTimeout(()=>{Bs().then(()=>i("Shown app")).catch(i)},2e3)}).catch(i)}function o(){return Vs().then(()=>i("Hide app")).catch(i)}return e.$$set=u=>{"onMessage"in u&&n(2,i=u.onMessage)},[l,o,i]}class sa extends we{constructor(t){super(),ye(this,t,la,ia,me,{onMessage:2})}}function ps(e,t,n){const i=e.slice();return i[32]=t[n],i}function ms(e,t,n){const i=e.slice();return i[35]=t[n],i}function hs(e){let t,n,i,l,o,u,d,c,f,v,k,_,y,g,b;function A(C,T){return C[3]?ra:oa}let D=A(e),j=D(e);function O(C,T){return C[2]?ua:aa}let F=O(e),S=F(e);return{c(){t=r("div"),n=r("span"),n.textContent="Tauri API Validation",i=h(),l=r("span"),o=r("span"),j.c(),d=h(),c=r("span"),c.innerHTML='
',f=h(),v=r("span"),S.c(),_=h(),y=r("span"),y.innerHTML='
',a(n,"class","lt-sm:pl-10 text-darkPrimaryText"),a(o,"title",u=e[3]?"Switch to Light mode":"Switch to Dark mode"),a(o,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(c,"title","Minimize"),a(c,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(v,"title",k=e[2]?"Restore":"Maximize"),a(v,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(y,"title","Close"),a(y,"class","hover:bg-red-700 dark:hover:bg-red-700 hover:text-darkPrimaryText active:bg-red-700/90 dark:active:bg-red-700/90 active:text-darkPrimaryText "),a(l,"class","h-100% children:h-100% children:w-12 children:inline-flex children:items-center children:justify-center"),a(t,"class","w-screen select-none h-8 pl-2 flex justify-between items-center absolute text-primaryText dark:text-darkPrimaryText"),a(t,"data-tauri-drag-region","")},m(C,T){m(C,t,T),s(t,n),s(t,i),s(t,l),s(l,o),j.m(o,null),s(l,d),s(l,c),s(l,f),s(l,v),S.m(v,null),s(l,_),s(l,y),g||(b=[E(o,"click",e[12]),E(c,"click",e[9]),E(v,"click",e[10]),E(y,"click",e[11])],g=!0)},p(C,T){D!==(D=A(C))&&(j.d(1),j=D(C),j&&(j.c(),j.m(o,null))),T[0]&8&&u!==(u=C[3]?"Switch to Light mode":"Switch to Dark mode")&&a(o,"title",u),F!==(F=O(C))&&(S.d(1),S=F(C),S&&(S.c(),S.m(v,null))),T[0]&4&&k!==(k=C[2]?"Restore":"Maximize")&&a(v,"title",k)},d(C){C&&p(t),j.d(),S.d(),g=!1,se(b)}}}function oa(e){let t;return{c(){t=r("div"),a(t,"class","i-ph-moon")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function ra(e){let t;return{c(){t=r("div"),a(t,"class","i-ph-sun")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function aa(e){let t;return{c(){t=r("div"),a(t,"class","i-codicon-chrome-maximize")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function ua(e){let t;return{c(){t=r("div"),a(t,"class","i-codicon-chrome-restore")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function ca(e){let t;return{c(){t=r("span"),a(t,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function da(e){let t;return{c(){t=r("span"),a(t,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function _s(e){let t,n,i,l,o,u,d,c,f;function v(y,g){return y[3]?pa:fa}let k=v(e),_=k(e);return{c(){t=r("a"),_.c(),n=h(),i=r("br"),l=h(),o=r("div"),u=h(),d=r("br"),a(t,"href","##"),a(t,"class","nv justify-between h-8"),a(o,"class","bg-white/5 h-2px")},m(y,g){m(y,t,g),_.m(t,null),m(y,n,g),m(y,i,g),m(y,l,g),m(y,o,g),m(y,u,g),m(y,d,g),c||(f=E(t,"click",e[12]),c=!0)},p(y,g){k!==(k=v(y))&&(_.d(1),_=k(y),_&&(_.c(),_.m(t,null)))},d(y){y&&p(t),_.d(),y&&p(n),y&&p(i),y&&p(l),y&&p(o),y&&p(u),y&&p(d),c=!1,f()}}}function fa(e){let t,n;return{c(){t=z(`Switch to Dark mode + `),n=r("div"),a(n,"class","i-ph-moon")},m(i,l){m(i,t,l),m(i,n,l)},d(i){i&&p(t),i&&p(n)}}}function pa(e){let t,n;return{c(){t=z(`Switch to Light mode + `),n=r("div"),a(n,"class","i-ph-sun")},m(i,l){m(i,t,l),m(i,n,l)},d(i){i&&p(t),i&&p(n)}}}function ma(e){let t,n,i,l,o,u=e[35].label+"",d,c,f,v;function k(){return e[20](e[35])}return{c(){t=r("a"),n=r("div"),l=h(),o=r("p"),d=z(u),a(n,"class",i=e[35].icon+" mr-2"),a(t,"href","##"),a(t,"class",c="nv "+(e[1]===e[35]?"nv_selected":""))},m(_,y){m(_,t,y),s(t,n),s(t,l),s(t,o),s(o,d),f||(v=E(t,"click",k),f=!0)},p(_,y){e=_,y[0]&2&&c!==(c="nv "+(e[1]===e[35]?"nv_selected":""))&&a(t,"class",c)},d(_){_&&p(t),f=!1,v()}}}function bs(e){let t,n=e[35]&&ma(e);return{c(){n&&n.c(),t=ti()},m(i,l){n&&n.m(i,l),m(i,t,l)},p(i,l){i[35]&&n.p(i,l)},d(i){n&&n.d(i),i&&p(t)}}}function gs(e){let t,n=e[32].html+"",i;return{c(){t=new mo(!1),i=ti(),t.a=i},m(l,o){t.m(n,l,o),m(l,i,o)},p(l,o){o[0]&64&&n!==(n=l[32].html+"")&&t.p(n)},d(l){l&&p(i),l&&t.d()}}}function ha(e){let t,n,i,l,o,u,d,c,f,v,k,_,y,g,b,A,D,j,O,F,S,C,T,P,M,N,U,J=e[1].label+"",Q,he,x,ne,X,_e,W,Y,ie,oe,Z,pe,re,be,ee,ke,Ae,R,q=e[5]&&hs(e);function We(H,te){return H[0]?da:ca}let Le=We(e),Me=Le(e),ae=!e[5]&&_s(e),de=e[7],ue=[];for(let H=0;H`,k=h(),_=r("a"),_.innerHTML=`GitHub + `,y=h(),g=r("a"),g.innerHTML=`Source + `,b=h(),A=r("br"),D=h(),j=r("div"),O=h(),F=r("br"),S=h(),C=r("div");for(let H=0;H',be=h(),ee=r("div");for(let H=0;H{$t(G,1)}),ii()}Se?(X=new Se(nt(H)),Qn(X.$$.fragment),De(X.$$.fragment,1),Jt(X,ne,null)):X=null}if(te[0]&64){fe=H[6];let G;for(G=0;G{await confirm("Are you sure?")||W.preventDefault()}),Ue.onFileDropEvent(W=>{D(`File drop: ${JSON.stringify(W.payload)}`)});const l=navigator.userAgent.toLowerCase(),o=l.includes("android")||l.includes("iphone"),u=[{label:"Welcome",component:Bo,icon:"i-ph-hand-waving"},{label:"Communication",component:Ko,icon:"i-codicon-radio-tower"},!o&&{label:"CLI",component:$o,icon:"i-codicon-terminal"},!o&&{label:"Dialog",component:fr,icon:"i-codicon-multiple-windows"},{label:"File system",component:_r,icon:"i-codicon-files"},{label:"HTTP",component:Ar,icon:"i-ph-globe-hemisphere-west"},!o&&{label:"Notifications",component:zr,icon:"i-codicon-bell-dot"},!o&&{label:"App",component:sa,icon:"i-codicon-hubot"},!o&&{label:"Window",component:Or,icon:"i-codicon-window"},!o&&{label:"Shortcuts",component:Nr,icon:"i-codicon-record-keys"},{label:"Shell",component:qr,icon:"i-codicon-terminal-bash"},!o&&{label:"Updater",component:Yr,icon:"i-codicon-cloud-download"},!o&&{label:"Clipboard",component:xr,icon:"i-codicon-clippy"},{label:"WebRTC",component:na,icon:"i-ph-broadcast"}];let d=u[0];function c(W){n(1,d=W)}let f;ct(async()=>{const W=Bt();n(2,f=await W.isMaximized()),Yt("tauri://resize",async()=>{n(2,f=await W.isMaximized())})});function v(){Bt().minimize()}async function k(){const W=Bt();await W.isMaximized()?W.unmaximize():W.maximize()}let _=!1;async function y(){_||(_=await Xs("Are you sure that you want to close this window?",{title:"Tauri API"}),_&&Bt().close())}let g;ct(()=>{n(3,g=localStorage&&localStorage.getItem("theme")=="dark"),ys(g)});function b(){n(3,g=!g),ys(g)}let A=Ts([]);ks(e,A,W=>n(6,i=W));function D(W){A.update(Y=>[{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof W=="string"?W:JSON.stringify(W,null,1))+"
"},...Y])}function j(W){A.update(Y=>[{html:`
[${new Date().toLocaleTimeString()}]: `+W+"
"},...Y])}function O(){A.update(()=>[])}let F,S,C;function T(W){C=W.clientY;const Y=window.getComputedStyle(F);S=parseInt(Y.height,10);const ie=Z=>{const pe=Z.clientY-C,re=S-pe;n(4,F.style.height=`${re{document.removeEventListener("mouseup",oe),document.removeEventListener("mousemove",ie)};document.addEventListener("mouseup",oe),document.addEventListener("mousemove",ie)}let P;ct(async()=>{n(5,P=await Ns()==="win32")});let M=!1,N,U,J=!1,Q=0,he=0;const x=(W,Y,ie)=>Math.min(Math.max(Y,W),ie);ct(()=>{n(18,N=document.querySelector("#sidebar")),U=document.querySelector("#sidebarToggle"),document.addEventListener("click",W=>{U.contains(W.target)?n(0,M=!M):M&&!N.contains(W.target)&&n(0,M=!1)}),document.addEventListener("touchstart",W=>{if(U.contains(W.target))return;const Y=W.touches[0].clientX;(0{if(J){const Y=W.touches[0].clientX;he=Y;const ie=(Y-Q)/10;N.style.setProperty("--translate-x",`-${x(0,M?0-ie:18.75-ie,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(J){const W=(he-Q)/10;n(0,M=M?W>-(18.75/2):W>18.75/2)}J=!1})});const ne=()=>Ii("https://tauri.app/"),X=W=>{c(W),n(0,M=!1)};function _e(W){Kn[W?"unshift":"push"](()=>{F=W,n(4,F)})}return e.$$.update=()=>{if(e.$$.dirty[0]&1){const W=document.querySelector("#sidebar");W&&_a(W,M)}},[M,d,f,g,F,P,i,u,c,v,k,y,b,A,D,j,O,T,N,ne,X,_e]}class ga extends we{constructor(t){super(),ye(this,t,ba,ha,me,{},null,[-1,-1])}}new ga({target:document.querySelector("#app")}); diff --git a/examples/api/src-tauri/Cargo.lock b/examples/api/src-tauri/Cargo.lock index 6dfe2d18f..d49f7c63f 100644 --- a/examples/api/src-tauri/Cargo.lock +++ b/examples/api/src-tauri/Cargo.lock @@ -51,24 +51,24 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.18" +version = "0.7.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" dependencies = [ "memchr", ] [[package]] name = "alloc-no-stdlib" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ef4730490ad1c4eae5c4325b2a95f521d023e5c885853ff7aca0a6a1631db3" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" [[package]] name = "alloc-stdlib" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697ed7edc0f1711de49ce108c541623a0af97c6c60b2f6e2b65229847ac843c2" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" dependencies = [ "alloc-no-stdlib", ] @@ -91,27 +91,18 @@ dependencies = [ "log", ] -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - [[package]] name = "anyhow" -version = "1.0.61" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "508b352bb5c066aac251f6daf6b36eccd03e8a88e8081cd44959ea277a3af9a8" +checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602" [[package]] name = "api" version = "0.1.0" dependencies = [ "android_logger", - "env_logger 0.9.0", + "env_logger 0.9.1", "log", "serde", "serde_json", @@ -124,9 +115,9 @@ dependencies = [ [[package]] name = "ascii" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf56136a5198c7b01a49e3afcbef6cf84597273d298f54432926024107b0109" +checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" [[package]] name = "atk" @@ -154,9 +145,9 @@ dependencies = [ [[package]] name = "attohttpc" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ca359af0239b00307656f0d6520fab5997a068cdfcfdb424e5466a3ea7958c5" +checksum = "1fcf00bc6d5abb29b5f97e3c61a90b6d3caa12f3faf897d4a3e3607c050a35a7" dependencies = [ "flate2", "http", @@ -164,12 +155,10 @@ dependencies = [ "mime", "multipart", "native-tls", - "openssl", "serde", "serde_json", "serde_urlencoded", "url", - "wildmatch", ] [[package]] @@ -209,9 +198,9 @@ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" dependencies = [ "generic-array", ] @@ -248,15 +237,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.10.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" +checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" [[package]] name = "bytemuck" -version = "1.11.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5377c8865e74a160d21f29c2d40669f53286db6eab59b88540cbb12ffc8b835" +checksum = "2f5715e491b5a1598fc2bef5a606847b5dc1d48ea625bd3c02c00de8285591da" [[package]] name = "byteorder" @@ -299,12 +288,11 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.11.5" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5809dd3e6444651fd1cdd3dbec71eca438c439a0fcc8081674a14da0afe50185" +checksum = "aa0e3586af56b3bfa51fca452bd56e8dbbbd5d8d81cbf0b7e4e35b695b537eb8" dependencies = [ "serde", - "serde_derive", "toml", ] @@ -338,7 +326,7 @@ checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" dependencies = [ "byteorder", "fnv", - "uuid 1.1.2", + "uuid 1.2.1", ] [[package]] @@ -382,9 +370,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.17" +version = "3.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e724a68d9319343bb3328c9cc2dfde263f4b3142ee1059a9980580171c954b" +checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750" dependencies = [ "atty", "bitflags", @@ -500,9 +488,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" dependencies = [ "libc", ] @@ -528,12 +516,11 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" +checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" dependencies = [ "cfg-if", - "once_cell", ] [[package]] @@ -654,15 +641,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "deflate" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c86f7e25f518f4b81808a2cf1c50996a61f5c2eb394b2393bd87f2a4780a432f" -dependencies = [ - "adler32", -] - [[package]] name = "derive_more" version = "0.99.17" @@ -678,9 +656,9 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" dependencies = [ "block-buffer", "crypto-common", @@ -755,9 +733,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +checksum = "c90bf5f19754d10198ccb95b70664fc925bd1fc090a0fd9a6ebc54acc8cd6272" dependencies = [ "atty", "humantime", @@ -830,11 +808,10 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" dependencies = [ - "matches", "percent-encoding", ] @@ -848,42 +825,26 @@ dependencies = [ "new_debug_unreachable", ] -[[package]] -name = "futures" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - [[package]] name = "futures-channel" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" dependencies = [ "futures-core", - "futures-sink", ] [[package]] name = "futures-core" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" +checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" [[package]] name = "futures-executor" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" +checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab" dependencies = [ "futures-core", "futures-task", @@ -892,30 +853,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" - -[[package]] -name = "futures-lite" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" -dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] +checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" [[package]] name = "futures-macro" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" +checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" dependencies = [ "proc-macro2", "quote", @@ -924,29 +870,25 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" +checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" [[package]] name = "futures-task" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" +checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" [[package]] name = "futures-util" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" dependencies = [ - "futures-channel", "futures-core", - "futures-io", "futures-macro", - "futures-sink", "futures-task", - "memchr", "pin-project-lite", "pin-utils", "slab", @@ -1250,9 +1192,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" +checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" dependencies = [ "bytes", "fnv", @@ -1319,7 +1261,7 @@ checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ "bytes", "fnv", - "itoa 1.0.3", + "itoa 1.0.4", ] [[package]] @@ -1341,9 +1283,9 @@ checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" [[package]] name = "httparse" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -1372,7 +1314,7 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 1.0.3", + "itoa 1.0.4", "pin-project-lite", "socket2", "tokio", @@ -1412,11 +1354,10 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" dependencies = [ - "matches", "unicode-bidi", "unicode-normalization", ] @@ -1441,9 +1382,9 @@ dependencies = [ [[package]] name = "image" -version = "0.24.3" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e30ca2ecf7666107ff827a8e481de6a132a9b687ed3bb20bb1c144a36c00964" +checksum = "bd8e4fb07cf672b1642304e731ef8a6a4c7891d67bb4fd4f5ce58cd6ed86803c" dependencies = [ "bytemuck", "byteorder", @@ -1473,9 +1414,9 @@ dependencies = [ [[package]] name = "infer" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e035cede526e0b21d5adffc9fa0eb4ef5d6026fe9c5b0bfe8084b9472b587a55" +checksum = "f178e61cdbfe084aa75a2f4f7a25a5bb09701a47ae1753608f194b15783c937a" dependencies = [ "cfb 0.7.3", ] @@ -1512,9 +1453,9 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "itoa" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" [[package]] name = "javascriptcore-rs" @@ -1541,9 +1482,9 @@ dependencies = [ [[package]] name = "jni" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +checksum = "039022cdf4d7b1cf548d31f60ae783138e5fd42013f6271049d7df7afadef96c" dependencies = [ "cesu8", "combine", @@ -1561,9 +1502,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "js-sys" -version = "0.3.59" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" dependencies = [ "wasm-bindgen", ] @@ -1623,9 +1564,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.131" +version = "0.2.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04c3b4822ccebfa39c02fc03d1534441b22ead323fa0f48bb7ddd8e6ba076a40" +checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" [[package]] name = "libdbus-sys" @@ -1669,9 +1610,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" dependencies = [ "autocfg", "scopeguard", @@ -1797,9 +1738,9 @@ checksum = "933dca44d65cdd53b355d0b73d380a2ff5da71f87f036053188bf1eab6a19881" [[package]] name = "miniz_oxide" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" +checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" dependencies = [ "adler", ] @@ -1899,13 +1840,23 @@ checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" [[package]] name = "notify-rust" -version = "4.5.8" +version = "4.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a995a3d2834cefa389218e7a35156e8ce544bc95f836900da01ee0b26a07e9d4" +checksum = "368e89ea58df747ce88be669ae44e79783c1d30bfd540ad0fc520b3f41f0b3b0" dependencies = [ "dbus", "mac-notification-sys", - "winrt-notification", + "tauri-winrt-notification", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", ] [[package]] @@ -2030,9 +1981,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" +checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" [[package]] name = "opaque-debug" @@ -2042,9 +1993,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "open" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23a407004a1033f53e93f9b45580d14de23928faad187384f891507c9b0c045" +checksum = "b4a3100141f1733ea40b53381b0ae3117330735ef22309a190ac57b9576ea716" dependencies = [ "pathdiff", "windows-sys", @@ -2052,9 +2003,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.41" +version = "0.10.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "618febf65336490dfcf20b73f885f5651a0c89c64c2d4a8c3662585a70bf5bd0" +checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" dependencies = [ "bitflags", "cfg-if", @@ -2093,9 +2044,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.75" +version = "0.9.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5f9bd0c2710541a3cda73d6f9ac4f1b240de4ae261065d309dbe73d9dceb42f" +checksum = "5230151e44c0f05157effb743e8d517472843121cf9243e8b81393edb5acd9ce" dependencies = [ "autocfg", "cc", @@ -2107,9 +2058,9 @@ dependencies = [ [[package]] name = "os_info" -version = "3.5.0" +version = "3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5209b2162b2c140df493a93689e04f8deab3a67634f5bc7a553c0a98e5b8d399" +checksum = "c4750134fb6a5d49afc80777394ad5d95b04bc12068c6abb92fae8f43817270f" dependencies = [ "log", "serde", @@ -2118,9 +2069,9 @@ dependencies = [ [[package]] name = "os_pipe" -version = "1.0.1" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c92f2b54f081d635c77e7120862d48db8e91f7f21cef23ab1b4fe9971c59f55" +checksum = "0dceb7e43f59c35ee1548045b2c72945a5a3bb6ce6d6f07cdc13dc8f6bc4930a" dependencies = [ "libc", "winapi", @@ -2128,9 +2079,15 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.2.0" +version = "6.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "648001efe5d5c0102d8cea768e348da85d90af8ba91f0bea908f157951493cd4" +checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "pango" @@ -2157,12 +2114,6 @@ dependencies = [ "system-deps 6.0.2", ] -[[package]] -name = "parking" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" - [[package]] name = "parking_lot" version = "0.12.1" @@ -2188,9 +2139,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9423e2b32f7a043629287a536f21951e8c6a82482d0acb1eeebfc90bc2225b22" +checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" [[package]] name = "pathdiff" @@ -2200,15 +2151,15 @@ checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.2.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69486e2b8c2d2aeb9762db7b4e00b0331156393555cff467f4163ff06821eef8" +checksum = "dbc7bc69c062e492337d74d59b120c274fd3d261b6bf6d3207d499b4b379c41a" dependencies = [ "thiserror", "ucd-trie", @@ -2351,20 +2302,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0b0cabbbd20c2d7f06dbf015e06aad59b6ca3d9ed14848783e98af9aaf19925" dependencies = [ "bitflags", - "deflate 0.7.20", + "deflate", "inflate", "num-iter", ] [[package]] name = "png" -version = "0.17.5" +version = "0.17.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc38c0ad57efb786dd57b9864e5b18bae478c00c824dc55a38bbc9da95dde3ba" +checksum = "8f0e7f4c94ec26ff209cee506314212639d6c91b80afb82984819fafce9df01c" dependencies = [ "bitflags", "crc32fast", - "deflate 1.0.0", + "flate2", "miniz_oxide", ] @@ -2435,13 +2386,22 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.43" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" dependencies = [ "unicode-ident", ] +[[package]] +name = "quick-xml" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11bafc859c6815fbaffbbbf4229ecb767ac913fecb27f9ad4343662e9ef099ea" +dependencies = [ + "memchr", +] + [[package]] name = "quote" version = "1.0.21" @@ -2473,7 +2433,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha 0.3.1", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -2493,7 +2453,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -2507,9 +2467,9 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom 0.2.7", ] @@ -2598,9 +2558,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.11" +version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b75aa69a3f06bbcc66ede33af2af253c6f7a86b1ca0033f60c580a27074fbf92" +checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc" dependencies = [ "base64", "bytes", @@ -2614,11 +2574,11 @@ dependencies = [ "hyper-tls", "ipnet", "js-sys", - "lazy_static", "log", "mime", "mime_guess", "native-tls", + "once_cell", "percent-encoding", "pin-project-lite", "serde", @@ -2674,7 +2634,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.13", + "semver 1.0.14", ] [[package]] @@ -2728,9 +2688,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "security-framework" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" dependencies = [ "bitflags", "core-foundation", @@ -2780,9 +2740,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" +checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" dependencies = [ "serde", ] @@ -2798,18 +2758,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.143" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e8e5d5b70924f74ff5c6d64d9a5acd91422117c60f48c4e07855238a254553" +checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.143" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3d8e8de557aee63c26b85b947f5e59b690d0454c753f3adeb5cd7835ab88391" +checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" dependencies = [ "proc-macro2", "quote", @@ -2818,11 +2778,11 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.83" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38dd04e3c8279e75b31ef29dbdceebfe5ad89f4d0937213c53f7d49d01b3d5a7" +checksum = "41feea4228a6f1cd09ec7a3593a682276702cd67b5273544757dae23c096f074" dependencies = [ - "itoa 1.0.3", + "itoa 1.0.4", "ryu", "serde", ] @@ -2845,7 +2805,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.3", + "itoa 1.0.4", "ryu", "serde", ] @@ -2906,9 +2866,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if", "cpufeatures", @@ -2951,15 +2911,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ "libc", "winapi", @@ -3069,9 +3029,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.99" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" +checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1" dependencies = [ "proc-macro2", "quote", @@ -3106,8 +3066,8 @@ dependencies = [ [[package]] name = "tao" -version = "0.13.3" -source = "git+https://github.com/tauri-apps/tao?branch=dev#0ae71fc887f0cbc498f7a2f5053201b4546f5a4d" +version = "0.14.0" +source = "git+https://github.com/tauri-apps/tao?branch=dev#38fef1087d217874aee016e237b6c15eedbd0250" dependencies = [ "bitflags", "cairo-rs", @@ -3140,12 +3100,12 @@ dependencies = [ "once_cell", "parking_lot", "paste", - "png 0.17.5", + "png 0.17.6", "raw-window-handle", "scopeguard", "serde", "unicode-segmentation", - "uuid 1.1.2", + "uuid 1.2.1", "windows 0.39.0", "windows-implement", "x11-dl", @@ -3164,7 +3124,7 @@ dependencies = [ [[package]] name = "tauri" -version = "1.0.5" +version = "1.1.1" dependencies = [ "anyhow", "attohttpc", @@ -3176,8 +3136,7 @@ dependencies = [ "embed_plist", "encoding_rs", "flate2", - "futures", - "futures-lite", + "futures-util", "glib", "glob", "gtk", @@ -3185,7 +3144,7 @@ dependencies = [ "http", "ico", "ignore", - "infer 0.8.1", + "infer 0.9.0", "minisign-verify", "notify-rust", "objc", @@ -3195,13 +3154,13 @@ dependencies = [ "os_pipe", "paste", "percent-encoding", - "png 0.17.5", + "png 0.17.6", "rand 0.8.5", "raw-window-handle", "regex", "reqwest", "rfd", - "semver 1.0.13", + "semver 1.0.14", "serde", "serde_json", "serde_repr", @@ -3218,7 +3177,7 @@ dependencies = [ "time", "tokio", "url", - "uuid 1.1.2", + "uuid 1.2.1", "webkit2gtk", "webview2-com", "win7-notifications", @@ -3228,14 +3187,14 @@ dependencies = [ [[package]] name = "tauri-build" -version = "1.0.4" +version = "1.1.1" dependencies = [ "anyhow", "cargo_toml", "heck 0.4.0", "json-patch", "quote", - "semver 1.0.13", + "semver 1.0.14", "serde_json", "tauri-codegen", "tauri-utils", @@ -3244,7 +3203,7 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "1.0.4" +version = "1.1.1" dependencies = [ "base64", "brotli", @@ -3252,11 +3211,11 @@ dependencies = [ "json-patch", "local-ip-address", "plist", - "png 0.17.5", + "png 0.17.6", "proc-macro2", "quote", "regex", - "semver 1.0.13", + "semver 1.0.14", "serde", "serde_json", "sha2", @@ -3264,13 +3223,13 @@ dependencies = [ "thiserror", "time", "url", - "uuid 1.1.2", + "uuid 1.2.1", "walkdir", ] [[package]] name = "tauri-macros" -version = "1.0.4" +version = "1.1.1" dependencies = [ "heck 0.4.0", "proc-macro2", @@ -3282,26 +3241,25 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "0.10.2" +version = "0.11.1" dependencies = [ "gtk", "http", "http-range", - "infer 0.7.0", "rand 0.8.5", "raw-window-handle", "serde", "serde_json", "tauri-utils", "thiserror", - "uuid 1.1.2", + "uuid 1.2.1", "webview2-com", "windows 0.39.0", ] [[package]] name = "tauri-runtime-wry" -version = "0.10.2" +version = "0.11.1" dependencies = [ "cocoa", "gtk", @@ -3310,7 +3268,7 @@ dependencies = [ "raw-window-handle", "tauri-runtime", "tauri-utils", - "uuid 1.1.2", + "uuid 1.2.1", "webkit2gtk", "webview2-com", "windows 0.39.0", @@ -3319,7 +3277,7 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "1.0.3" +version = "1.1.1" dependencies = [ "aes-gcm", "brotli", @@ -3328,13 +3286,14 @@ dependencies = [ "glob", "heck 0.4.0", "html5ever", + "infer 0.7.0", "json-patch", "kuchiki", "memchr", "phf 0.10.1", "proc-macro2", "quote", - "semver 1.0.13", + "semver 1.0.14", "serde", "serde_json", "serde_with", @@ -3345,6 +3304,17 @@ dependencies = [ "windows 0.39.0", ] +[[package]] +name = "tauri-winrt-notification" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c58de036c4d2e20717024de2a3c4bf56c301f07b21bc8ef9b57189fce06f1f3b" +dependencies = [ + "quick-xml", + "strum", + "windows 0.39.0", +] + [[package]] name = "tempfile" version = "3.3.0" @@ -3381,9 +3351,9 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" +checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16" [[package]] name = "thin-slice" @@ -3393,18 +3363,18 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" [[package]] name = "thiserror" -version = "1.0.32" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.32" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" dependencies = [ "proc-macro2", "quote", @@ -3422,11 +3392,11 @@ dependencies = [ [[package]] name = "time" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db76ff9fa4b1458b3c7f077f3ff9887394058460d21e634355b273aaf11eea45" +checksum = "d634a985c4d4238ec39cacaed2e7ae552fbd3c476b552c1deac3021b7d7eaf0c" dependencies = [ - "itoa 1.0.3", + "itoa 1.0.4", "libc", "num_threads", "time-macros", @@ -3468,9 +3438,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.20.1" +version = "1.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a8325f63a7d4774dd041e363b2409ed1c5cbbd0f867795e661df066b2b0a581" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" dependencies = [ "autocfg", "bytes", @@ -3478,7 +3448,6 @@ dependencies = [ "memchr", "mio", "num_cpus", - "once_cell", "pin-project-lite", "socket2", "winapi", @@ -3496,9 +3465,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" dependencies = [ "bytes", "futures-core", @@ -3525,9 +3494,9 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.36" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", "pin-project-lite", @@ -3537,9 +3506,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", @@ -3548,9 +3517,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ "once_cell", "valuable", @@ -3569,12 +3538,12 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60db860322da191b40952ad9affe65ea23e7dd6a5c442c2c42865810c6ab8e6b" +checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" dependencies = [ - "ansi_term", "matchers", + "nu-ansi-term", "once_cell", "regex", "sharded-slab", @@ -3608,9 +3577,9 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "ucd-trie" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89570599c4fe5585de2b388aab47e99f7fa4e9238a1399f707a02e356058141c" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" [[package]] name = "unicase" @@ -3629,24 +3598,24 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.3" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" [[package]] name = "unicode-normalization" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" +checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" [[package]] name = "universal-hash" @@ -3660,13 +3629,12 @@ dependencies = [ [[package]] name = "url" -version = "2.2.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ "form_urlencoded", "idna", - "matches", "percent-encoding", "serde", ] @@ -3685,9 +3653,9 @@ checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" [[package]] name = "uuid" -version = "1.1.2" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd6469f4314d5f1ffec476e05f17cc9a78bc7a27a6a857842170bdf8d6f98d2f" +checksum = "feb41e78f93363bb2df8b0e86a2ca30eed7806ea16ea0c790d757cf93f79be83" dependencies = [ "getrandom 0.2.7", ] @@ -3722,12 +3690,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "waker-fn" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" - [[package]] name = "walkdir" version = "2.3.2" @@ -3763,9 +3725,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.82" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3773,9 +3735,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.82" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" dependencies = [ "bumpalo", "log", @@ -3788,9 +3750,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.32" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa76fb221a1f8acddf5b54ace85912606980ad661ac7a503b4570ffd3a624dad" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" dependencies = [ "cfg-if", "js-sys", @@ -3800,9 +3762,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.82" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3810,9 +3772,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.82" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ "proc-macro2", "quote", @@ -3823,15 +3785,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.82" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" [[package]] name = "web-sys" -version = "0.3.59" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" dependencies = [ "js-sys", "wasm-bindgen", @@ -3839,9 +3801,9 @@ dependencies = [ [[package]] name = "webkit2gtk" -version = "0.18.0" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29952969fb5e10fe834a52eb29ad0814ccdfd8387159b0933edf1344a1c9cdcc" +checksum = "b8f859735e4a452aeb28c6c56a852967a8a76c8eb1cc32dbf931ad28a13d6370" dependencies = [ "bitflags", "cairo-rs", @@ -3922,12 +3884,6 @@ dependencies = [ "windows-metadata", ] -[[package]] -name = "wildmatch" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee583bdc5ff1cf9db20e9db5bb3ff4c3089a8f6b8b31aff265c9aba85812db86" - [[package]] name = "win7-notifications" version = "0.3.1" @@ -3993,18 +3949,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "windows" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9f39345ae0c8ab072c0ac7fe8a8b411636aa34f89be19ddd0d9226544f13944" -dependencies = [ - "windows_i686_gnu 0.24.0", - "windows_i686_msvc 0.24.0", - "windows_x86_64_gnu 0.24.0", - "windows_x86_64_msvc 0.24.0", -] - [[package]] name = "windows" version = "0.32.0" @@ -4114,12 +4058,6 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec7711666096bd4096ffa835238905bb33fb87267910e154b18b44eaabb340f2" -[[package]] -name = "windows_i686_gnu" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0866510a3eca9aed73a077490bbbf03e5eaac4e1fd70849d89539e5830501fd" - [[package]] name = "windows_i686_gnu" version = "0.32.0" @@ -4144,12 +4082,6 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "763fc57100a5f7042e3057e7e8d9bdd7860d330070251a73d003563a3bb49e1b" -[[package]] -name = "windows_i686_msvc" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf0ffed56b7e9369a29078d2ab3aaeceea48eb58999d2cff3aa2494a275b95c6" - [[package]] name = "windows_i686_msvc" version = "0.32.0" @@ -4174,12 +4106,6 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7bc7cbfe58828921e10a9f446fcaaf649204dcfe6c1ddd712c5eebae6bda1106" -[[package]] -name = "windows_x86_64_gnu" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384a173630588044205a2993b6864a2f56e5a8c1e7668c07b93ec18cf4888dc4" - [[package]] name = "windows_x86_64_gnu" version = "0.32.0" @@ -4204,12 +4130,6 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6868c165637d653ae1e8dc4d82c25d4f97dd6605eaa8d784b5c6e0ab2a252b65" -[[package]] -name = "windows_x86_64_msvc" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd8f062d8ca5446358159d79a90be12c543b3a965c847c8f3eedf14b321d399" - [[package]] name = "windows_x86_64_msvc" version = "0.32.0" @@ -4252,21 +4172,10 @@ dependencies = [ "toml", ] -[[package]] -name = "winrt-notification" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "007a0353840b23e0c6dc73e5b962ff58ed7f6bc9ceff3ce7fe6fbad8d496edf4" -dependencies = [ - "strum", - "windows 0.24.0", - "xml-rs", -] - [[package]] name = "wry" -version = "0.20.2" -source = "git+https://github.com/tauri-apps/wry?branch=dev#3624414faa53386660b9d066c00e91e240b7681d" +version = "0.21.1" +source = "git+https://github.com/tauri-apps/wry?branch=dev#3183e9333831cc407d2f193995cfda366e7c38d5" dependencies = [ "base64", "block", @@ -4288,6 +4197,7 @@ dependencies = [ "serde", "serde_json", "sha2", + "soup2", "tao", "thiserror", "url", @@ -4336,9 +4246,9 @@ checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" [[package]] name = "zip" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf225bcf73bb52cbb496e70475c7bd7a3f769df699c0020f6c7bd9a96dcf0b8d" +checksum = "537ce7411d25e54e8ae21a7ce0b15840e7bfcff15b51d697ec3266cc76bdf080" dependencies = [ "byteorder", "crc32fast", diff --git a/examples/api/src-tauri/Cargo.toml b/examples/api/src-tauri/Cargo.toml index 5741d8151..6dad7c673 100644 --- a/examples/api/src-tauri/Cargo.toml +++ b/examples/api/src-tauri/Cargo.toml @@ -3,7 +3,7 @@ name = "api" version = "0.1.0" description = "An example Tauri Application showcasing the api" edition = "2021" -rust-version = "1.57" +rust-version = "1.59" license = "Apache-2.0 OR MIT" [patch.crates-io] diff --git a/examples/api/src-tauri/src/desktop.rs b/examples/api/src-tauri/src/desktop.rs index 12a6ca7d1..adbfce9a1 100644 --- a/examples/api/src-tauri/src/desktop.rs +++ b/examples/api/src-tauri/src/desktop.rs @@ -58,14 +58,22 @@ pub fn main() { } fn create_tray(app: &tauri::App) -> tauri::Result<()> { - let tray_menu1 = SystemTrayMenu::new() + let mut tray_menu1 = SystemTrayMenu::new() .add_item(CustomMenuItem::new("toggle", "Toggle")) .add_item(CustomMenuItem::new("new", "New window")) .add_item(CustomMenuItem::new("icon_1", "Tray Icon 1")) - .add_item(CustomMenuItem::new("icon_2", "Tray Icon 2")) + .add_item(CustomMenuItem::new("icon_2", "Tray Icon 2")); + + #[cfg(target_os = "macos")] + { + tray_menu1 = tray_menu1.add_item(CustomMenuItem::new("set_title", "Set Title")); + } + + tray_menu1 = tray_menu1 .add_item(CustomMenuItem::new("switch_menu", "Switch Menu")) .add_item(CustomMenuItem::new("exit_app", "Quit")) .add_item(CustomMenuItem::new("destroy", "Destroy")); + let tray_menu2 = SystemTrayMenu::new() .add_item(CustomMenuItem::new("toggle", "Toggle")) .add_item(CustomMenuItem::new("new", "New window")) @@ -118,6 +126,10 @@ fn create_tray(app: &tauri::App) -> tauri::Result<()> { .build() .unwrap(); } + "set_title" => { + #[cfg(target_os = "macos")] + tray_handle.set_title("Tauri").unwrap(); + } "icon_1" => { #[cfg(target_os = "macos")] tray_handle.set_icon_as_template(true).unwrap(); diff --git a/examples/api/src-tauri/src/lib.rs b/examples/api/src-tauri/src/lib.rs index 50fb5fbdf..b6706674b 100644 --- a/examples/api/src-tauri/src/lib.rs +++ b/examples/api/src-tauri/src/lib.rs @@ -67,6 +67,7 @@ impl AppBuilder { #[allow(unused_mut)] let mut window_builder = WindowBuilder::new(app, "main", WindowUrl::default()) + .user_agent("Tauri API") .title("Tauri API Validation") .inner_size(1000., 800.) .min_inner_size(600., 400.); diff --git a/examples/api/src-tauri/tauri.conf.json b/examples/api/src-tauri/tauri.conf.json index 6ad3567bc..e16677630 100644 --- a/examples/api/src-tauri/tauri.conf.json +++ b/examples/api/src-tauri/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../../tooling/cli/schema.json", + "$schema": "../../../core/config-schema/schema.json", "build": { "distDir": "../dist", "devPath": "http://localhost:5173", @@ -87,8 +87,8 @@ "all": true, "fs": { "scope": { - "allow": ["$APP/db/**", "$DOWNLOAD/**", "$RESOURCE/**"], - "deny": ["$APP/db/*.stronghold"] + "allow": ["$APPDATA/db/**", "$DOWNLOAD/**", "$RESOURCE/**"], + "deny": ["$APPDATA/db/*.stronghold"] } }, "shell": { @@ -109,8 +109,8 @@ "protocol": { "asset": true, "assetScope": { - "allow": ["$APP/db/**", "$RESOURCE/**"], - "deny": ["$APP/db/*.stronghold"] + "allow": ["$APPDATA/db/**", "$RESOURCE/**"], + "deny": ["$APPDATA/db/*.stronghold"] } }, "http": { diff --git a/examples/api/src/App.svelte b/examples/api/src/App.svelte index 91fc381c9..423833fc2 100644 --- a/examples/api/src/App.svelte +++ b/examples/api/src/App.svelte @@ -17,6 +17,7 @@ import Updater from './views/Updater.svelte' import Clipboard from './views/Clipboard.svelte' import WebRTC from './views/WebRTC.svelte' + import App from './views/App.svelte' import { onMount } from 'svelte' import { listen } from '@tauri-apps/api/event' @@ -75,6 +76,11 @@ component: Notifications, icon: 'i-codicon-bell-dot' }, + !isMobile && { + label: 'App', + component: App, + icon: 'i-codicon-hubot' + }, !isMobile && { label: 'Window', component: Window, diff --git a/examples/api/src/views/App.svelte b/examples/api/src/views/App.svelte new file mode 100644 index 000000000..760590f0c --- /dev/null +++ b/examples/api/src/views/App.svelte @@ -0,0 +1,33 @@ + + +
+ + +
diff --git a/examples/api/src/views/Window.svelte b/examples/api/src/views/Window.svelte index d91c9bd25..c117fea65 100644 --- a/examples/api/src/views/Window.svelte +++ b/examples/api/src/views/Window.svelte @@ -87,6 +87,7 @@ let cursorX = null let cursorY = null let cursorIcon = 'default' + let cursorIgnoreEvents = false let windowTitle = 'Awesome Tauri Example!' function openUrl() { @@ -212,6 +213,7 @@ windowMap[selectedWindow]?.setCursorPosition( new PhysicalPosition(cursorX, cursorY) ) + $: windowMap[selectedWindow]?.setIgnoreCursorEvents(cursorIgnoreEvents)
@@ -413,6 +415,10 @@ Visible +