diff --git a/Cargo.lock b/Cargo.lock index aa72c7f2b..4395aa643 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6276,9 +6276,9 @@ checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tauri" -version = "2.0.0-beta.9" +version = "2.0.0-beta.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "353a521566bd41164a05887f40fe93b375c82b82000726f63c66237955dfb4f5" +checksum = "e7ad6ebcb36709f29f161bd017c14c247b110a8563d90531f879df096510d697" dependencies = [ "anyhow", "bytes", @@ -6319,6 +6319,7 @@ dependencies = [ "tokio", "tray-icon", "url", + "urlpattern", "uuid", "webkit2gtk", "webview2-com", @@ -6328,9 +6329,9 @@ dependencies = [ [[package]] name = "tauri-build" -version = "2.0.0-beta.7" +version = "2.0.0-beta.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50887f06d343b6ede0260d29abb4edd57f40d8aac538f6e34d801c9a4fa1c6b8" +checksum = "746bc44948a2de0535fd66dd11510973f091d84a2d5cb61f2cdef9db85080816" dependencies = [ "anyhow", "cargo_toml", @@ -6352,9 +6353,9 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "2.0.0-beta.7" +version = "2.0.0-beta.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10c676621ba42f97d349ee1a835cfac8a268d8843c8b81fa7663ebac2854786a" +checksum = "9d54988388d81d51c778cb93854553d6e50d3afa8fb7693ff362f718c06956f2" dependencies = [ "base64 0.22.0", "brotli", @@ -6379,9 +6380,9 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "2.0.0-beta.7" +version = "2.0.0-beta.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd5e87dc692a359ee99662616639fe35681e3ce9929e1ec2447b2e3853b6bda6" +checksum = "2aa739d28ebddc149d781851a22f8d4f0d1e76de7d7348475c5072cb60f56c07" dependencies = [ "heck", "proc-macro2", @@ -6393,9 +6394,9 @@ dependencies = [ [[package]] name = "tauri-plugin" -version = "2.0.0-beta.7" +version = "2.0.0-beta.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84ccc2181a81c66f2b203775b6b67590cc357bc477c57f0fac844c31dd5c474" +checksum = "62895dc0fbcf604a20a1559e742b8eb79230e2c98564d0b99c77c953a48fd60d" dependencies = [ "anyhow", "glob", @@ -6628,7 +6629,6 @@ dependencies = [ "color-backtrace", "ctor", "env_logger", - "image", "lazy_static", "log", "mac-notification-sys", @@ -6856,9 +6856,9 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "2.0.0-beta.7" +version = "2.0.0-beta.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fc1ebe2a720c1b62a9980ebf44f27db4f8a475e1465917959ce3940d6903307" +checksum = "b5a16d9e5634401c03477d2c3ff3d5c051efb05ed48fda5a8757e2d3e7859d6d" dependencies = [ "gtk", "http 0.2.12", @@ -6874,9 +6874,9 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "2.0.0-beta.7" +version = "2.0.0-beta.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0e853c02137e908589e9f0c684f10bb49d0dedf9e86ad734a18e42ce9bbd2ab" +checksum = "71cd401defa237dc112b9e53f40f628c1cac6dfdd56d6ecbba6ad85b5a016d0c" dependencies = [ "cocoa 0.25.0", "gtk", @@ -6898,9 +6898,9 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "2.0.0-beta.7" +version = "2.0.0-beta.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1973b15065cb63868f5fba789d54ef04232d7e0229fb2230d1f557480a5ceea" +checksum = "1e9ab52971229a67ca96a8cefb7671d32aca844558518bda8e545ee5c8e1a787" dependencies = [ "aes-gcm 0.10.3", "brotli", @@ -6919,6 +6919,7 @@ dependencies = [ "phf 0.11.2", "proc-macro2", "quote", + "regex", "schemars", "semver", "serde", @@ -6929,6 +6930,7 @@ dependencies = [ "thiserror", "toml 0.8.10", "url", + "urlpattern", "walkdir", ] diff --git a/Cargo.toml b/Cargo.toml index 5f2dae3bc..dfe8312b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,9 +10,9 @@ resolver = "2" [workspace.dependencies] serde = { version = "1", features = ["derive"] } log = "0.4" -tauri = "2.0.0-beta.9" -tauri-build = "2.0.0-beta.7" -tauri-plugin = "2.0.0-beta.7" +tauri = "2.0.0-beta.10" +tauri-build = "2.0.0-beta.8" +tauri-plugin = "2.0.0-beta.8" serde_json = "1" thiserror = "1" url = "2" diff --git a/examples/api/package.json b/examples/api/package.json index 10858549c..113f73de7 100644 --- a/examples/api/package.json +++ b/examples/api/package.json @@ -30,7 +30,7 @@ "@iconify-json/codicon": "^1.1.37", "@iconify-json/ph": "^1.1.8", "@sveltejs/vite-plugin-svelte": "^3.0.1", - "@tauri-apps/cli": "2.0.0-beta.7", + "@tauri-apps/cli": "2.0.0-beta.8", "@unocss/extractor-svelte": "^0.58.0", "internal-ip": "^8.0.0", "svelte": "^4.2.8", diff --git a/examples/api/src-tauri/capabilities/base.json b/examples/api/src-tauri/capabilities/base.json index a03a9be89..486615b4a 100644 --- a/examples/api/src-tauri/capabilities/base.json +++ b/examples/api/src-tauri/capabilities/base.json @@ -21,6 +21,7 @@ "tray:default", "event:default", "window:default", + "image:default", "notification:default", "os:allow-platform", "dialog:allow-open", diff --git a/examples/api/src-tauri/gen/schemas/desktop-schema.json b/examples/api/src-tauri/gen/schemas/desktop-schema.json index b5468ccc8..81882de2e 100644 --- a/examples/api/src-tauri/gen/schemas/desktop-schema.json +++ b/examples/api/src-tauri/gen/schemas/desktop-schema.json @@ -41,8 +41,7 @@ "type": "object", "required": [ "identifier", - "permissions", - "windows" + "permissions" ], "properties": { "identifier": { @@ -93,14 +92,10 @@ }, "platforms": { "description": "Target platforms this capability applies. By default all platforms are affected by this capability.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } @@ -115,7 +110,7 @@ ], "properties": { "urls": { - "description": "Remote domains this capability refers to. Can use glob patterns.", + "description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).", "type": "array", "items": { "type": "string" diff --git a/examples/api/src-tauri/gen/schemas/mobile-schema.json b/examples/api/src-tauri/gen/schemas/mobile-schema.json index 6262fabb9..67e4101e1 100644 --- a/examples/api/src-tauri/gen/schemas/mobile-schema.json +++ b/examples/api/src-tauri/gen/schemas/mobile-schema.json @@ -11,6 +11,13 @@ } ] }, + { + "description": "A list of capabilities.", + "type": "array", + "items": { + "$ref": "#/definitions/Capability" + } + }, { "description": "A list of capabilities.", "type": "object", @@ -34,8 +41,7 @@ "type": "object", "required": [ "identifier", - "permissions", - "windows" + "permissions" ], "properties": { "identifier": { @@ -86,14 +92,10 @@ }, "platforms": { "description": "Target platforms this capability applies. By default all platforms are affected by this capability.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } @@ -108,7 +110,7 @@ ], "properties": { "urls": { - "description": "Remote domains this capability refers to. Can use glob patterns.", + "description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).", "type": "array", "items": { "type": "string" @@ -2616,31 +2618,87 @@ ] }, { - "description": "clipboard-manager:allow-read -> Enables the read command without any pre-configured scope.", + "description": "clipboard-manager:allow-clear -> Enables the clear command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:allow-clear" + ] + }, + { + "description": "clipboard-manager:allow-read-image -> Enables the read_image command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:allow-read-image" + ] + }, + { + "description": "clipboard-manager:allow-read-text -> Enables the read_text command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:allow-read-text" + ] + }, + { + "description": "clipboard-manager:allow-write-html -> Enables the write_html command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:allow-write-html" + ] + }, + { + "description": "clipboard-manager:allow-write-image -> Enables the write_image command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:allow-write-image" + ] + }, + { + "description": "clipboard-manager:allow-write-text -> Enables the write_text command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:allow-write-text" + ] + }, + { + "description": "clipboard-manager:deny-clear -> Denies the clear command without any pre-configured scope.", "type": "string", "enum": [ - "clipboard-manager:allow-read" + "clipboard-manager:deny-clear" ] }, { - "description": "clipboard-manager:allow-write -> Enables the write command without any pre-configured scope.", + "description": "clipboard-manager:deny-read-image -> Denies the read_image command without any pre-configured scope.", "type": "string", "enum": [ - "clipboard-manager:allow-write" + "clipboard-manager:deny-read-image" ] }, { - "description": "clipboard-manager:deny-read -> Denies the read command without any pre-configured scope.", + "description": "clipboard-manager:deny-read-text -> Denies the read_text command without any pre-configured scope.", "type": "string", "enum": [ - "clipboard-manager:deny-read" + "clipboard-manager:deny-read-text" ] }, { - "description": "clipboard-manager:deny-write -> Denies the write command without any pre-configured scope.", + "description": "clipboard-manager:deny-write-html -> Denies the write_html command without any pre-configured scope.", "type": "string", "enum": [ - "clipboard-manager:deny-write" + "clipboard-manager:deny-write-html" + ] + }, + { + "description": "clipboard-manager:deny-write-image -> Denies the write_image command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:deny-write-image" + ] + }, + { + "description": "clipboard-manager:deny-write-text -> Denies the write_text command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:deny-write-text" ] }, { @@ -4827,6 +4885,125 @@ "http:deny-fetch-send" ] }, + { + "description": "image:default -> Default permissions for the plugin.", + "type": "string", + "enum": [ + "image:default" + ] + }, + { + "description": "image:allow-from-bytes -> Enables the from_bytes command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:allow-from-bytes" + ] + }, + { + "description": "image:allow-from-ico-bytes -> Enables the from_ico_bytes command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:allow-from-ico-bytes" + ] + }, + { + "description": "image:allow-from-path -> Enables the from_path command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:allow-from-path" + ] + }, + { + "description": "image:allow-from-png-bytes -> Enables the from_png_bytes command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:allow-from-png-bytes" + ] + }, + { + "description": "image:allow-height -> Enables the height command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:allow-height" + ] + }, + { + "description": "image:allow-new -> Enables the new command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:allow-new" + ] + }, + { + "description": "image:allow-rgba -> Enables the rgba command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:allow-rgba" + ] + }, + { + "description": "image:allow-width -> Enables the width command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:allow-width" + ] + }, + { + "description": "image:deny-from-bytes -> Denies the from_bytes command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:deny-from-bytes" + ] + }, + { + "description": "image:deny-from-ico-bytes -> Denies the from_ico_bytes command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:deny-from-ico-bytes" + ] + }, + { + "description": "image:deny-from-path -> Denies the from_path command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:deny-from-path" + ] + }, + { + "description": "image:deny-from-png-bytes -> Denies the from_png_bytes command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:deny-from-png-bytes" + ] + }, + { + "description": "image:deny-height -> Denies the height command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:deny-height" + ] + }, + { + "description": "image:deny-new -> Denies the new command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:deny-new" + ] + }, + { + "description": "image:deny-rgba -> Denies the rgba command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:deny-rgba" + ] + }, + { + "description": "image:deny-width -> Denies the width command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:deny-width" + ] + }, { "description": "log:default -> Allows the log command", "type": "string", diff --git a/examples/api/src-tauri/src/tray.rs b/examples/api/src-tauri/src/tray.rs index 74863c0ae..3f3cb9be3 100644 --- a/examples/api/src-tauri/src/tray.rs +++ b/examples/api/src-tauri/src/tray.rs @@ -80,9 +80,9 @@ pub fn create_tray(app: &tauri::AppHandle) -> tauri::Result<()> { i @ "icon-1" | i @ "icon-2" => { if let Some(tray) = app.tray_by_id("tray-1") { let _ = tray.set_icon(Some(if i == "icon-1" { - tauri::Image::from_ico_bytes(include_bytes!("../icons/icon.ico")).unwrap() + tauri::image::Image::from_ico_bytes(include_bytes!("../icons/icon.ico")).unwrap() } else { - tauri::Image::from_png_bytes(include_bytes!( + tauri::image::Image::from_png_bytes(include_bytes!( "../icons/tray_icon_with_transparency.png" )) .unwrap() diff --git a/examples/api/src/views/Clipboard.svelte b/examples/api/src/views/Clipboard.svelte index 230bbda9a..fed4698b7 100644 --- a/examples/api/src/views/Clipboard.svelte +++ b/examples/api/src/views/Clipboard.svelte @@ -1,8 +1,9 @@