mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-06 13:53:54 +02:00
chore(deps): update to tauri beta.9 (#1037)
This commit is contained in:
committed by
GitHub
parent
16fc0f2ee3
commit
cacf544d51
@@ -9,7 +9,7 @@
|
||||
"serve": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.3",
|
||||
"@tauri-apps/api": "2.0.0-beta.4",
|
||||
"@tauri-apps/plugin-barcode-scanner": "2.0.0-beta.1",
|
||||
"@tauri-apps/plugin-biometric": "2.0.0-beta.1",
|
||||
"@tauri-apps/plugin-cli": "2.0.0-beta.1",
|
||||
@@ -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.6",
|
||||
"@tauri-apps/cli": "2.0.0-beta.7",
|
||||
"@unocss/extractor-svelte": "^0.58.0",
|
||||
"internal-ip": "^8.0.0",
|
||||
"svelte": "^4.2.8",
|
||||
|
||||
@@ -9,10 +9,10 @@ license = "Apache-2.0 OR MIT"
|
||||
|
||||
[lib]
|
||||
name = "api_lib"
|
||||
crate-type = [ "staticlib", "cdylib", "rlib" ]
|
||||
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { workspace = true, features = [ "codegen", "isolation" ] }
|
||||
tauri-build = { workspace = true, features = ["codegen", "isolation"] }
|
||||
|
||||
[dependencies]
|
||||
serde_json = { workspace = true }
|
||||
@@ -20,24 +20,30 @@ serde = { workspace = true }
|
||||
tiny_http = "0.11"
|
||||
log = { workspace = true }
|
||||
tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.0-beta.1" }
|
||||
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0-beta.1", features = [ "watch" ] }
|
||||
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0-beta.1", features = [
|
||||
"watch",
|
||||
] }
|
||||
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.0.0-beta.1" }
|
||||
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.0-beta.1" }
|
||||
tauri-plugin-http = { path = "../../../plugins/http", features = [ "multipart" ], version = "2.0.0-beta.1" }
|
||||
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.0-beta.1", features = [ "windows7-compat" ] }
|
||||
tauri-plugin-http = { path = "../../../plugins/http", features = [
|
||||
"multipart",
|
||||
], version = "2.0.0-beta.1" }
|
||||
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.0-beta.1", features = [
|
||||
"windows7-compat",
|
||||
] }
|
||||
tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.0-beta.1" }
|
||||
tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.0-beta.1" }
|
||||
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.0-beta.1" }
|
||||
|
||||
[dependencies.tauri]
|
||||
workspace = true
|
||||
features = [
|
||||
"icon-ico",
|
||||
"icon-png",
|
||||
[dependencies.tauri]
|
||||
workspace = true
|
||||
features = [
|
||||
"image-ico",
|
||||
"image-png",
|
||||
"isolation",
|
||||
"macos-private-api",
|
||||
"tray-icon",
|
||||
"protocol-asset"
|
||||
"protocol-asset",
|
||||
]
|
||||
|
||||
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
|
||||
@@ -54,4 +60,4 @@ tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.0.
|
||||
window-shadows = "0.2"
|
||||
|
||||
[features]
|
||||
custom-protocol = [ "tauri/custom-protocol" ]
|
||||
prod = ["tauri/custom-protocol"]
|
||||
|
||||
@@ -11,6 +11,13 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "A list of capabilities.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/Capability"
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A list of capabilities.",
|
||||
"type": "object",
|
||||
@@ -4790,6 +4797,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",
|
||||
|
||||
@@ -7,7 +7,10 @@ mod cmd;
|
||||
mod tray;
|
||||
|
||||
use serde::Serialize;
|
||||
use tauri::{webview::WebviewWindowBuilder, App, AppHandle, Manager, RunEvent, WebviewUrl};
|
||||
use tauri::{
|
||||
webview::{PageLoadEvent, WebviewWindowBuilder},
|
||||
App, AppHandle, Manager, RunEvent, WebviewUrl,
|
||||
};
|
||||
|
||||
#[derive(Clone, Serialize)]
|
||||
struct Reply {
|
||||
@@ -107,18 +110,20 @@ pub fn run() {
|
||||
|
||||
Ok(())
|
||||
})
|
||||
.on_page_load(|webview, _| {
|
||||
let webview_ = webview.clone();
|
||||
webview.listen("js-event", move |event| {
|
||||
println!("got js-event with message '{:?}'", event.payload());
|
||||
let reply = Reply {
|
||||
data: "something else".to_string(),
|
||||
};
|
||||
.on_page_load(|webview, payload| {
|
||||
if payload.event() == PageLoadEvent::Finished {
|
||||
let webview_ = webview.clone();
|
||||
webview.listen("js-event", move |event| {
|
||||
println!("got js-event with message '{:?}'", event.payload());
|
||||
let reply = Reply {
|
||||
data: "something else".to_string(),
|
||||
};
|
||||
|
||||
webview_
|
||||
.emit("rust-event", Some(reply))
|
||||
.expect("failed to emit");
|
||||
});
|
||||
webview_
|
||||
.emit("rust-event", Some(reply))
|
||||
.expect("failed to emit");
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
|
||||
@@ -79,11 +79,14 @@ pub fn create_tray<R: Runtime>(app: &tauri::AppHandle<R>) -> tauri::Result<()> {
|
||||
}
|
||||
i @ "icon-1" | i @ "icon-2" => {
|
||||
if let Some(tray) = app.tray_by_id("tray-1") {
|
||||
let _ = tray.set_icon(Some(tauri::Icon::Raw(if i == "icon-1" {
|
||||
include_bytes!("../icons/icon.ico").to_vec()
|
||||
let _ = tray.set_icon(Some(if i == "icon-1" {
|
||||
tauri::Image::from_ico_bytes(include_bytes!("../icons/icon.ico")).unwrap()
|
||||
} else {
|
||||
include_bytes!("../icons/tray_icon_with_transparency.png").to_vec()
|
||||
})));
|
||||
tauri::Image::from_png_bytes(include_bytes!(
|
||||
"../icons/tray_icon_with_transparency.png"
|
||||
))
|
||||
.unwrap()
|
||||
}));
|
||||
}
|
||||
}
|
||||
"switch-menu" => {
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<script>
|
||||
import { getCurrent } from "@tauri-apps/api/window";
|
||||
import { getCurrent } from "@tauri-apps/api/webview";
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { onMount, onDestroy } from "svelte";
|
||||
|
||||
const appWindow = getCurrent();
|
||||
const webview = getCurrent();
|
||||
|
||||
export let onMessage;
|
||||
let unlisten;
|
||||
|
||||
onMount(async () => {
|
||||
unlisten = await appWindow.listen("rust-event", onMessage);
|
||||
unlisten = await webview.listen("rust-event", onMessage);
|
||||
});
|
||||
onDestroy(() => {
|
||||
if (unlisten) {
|
||||
@@ -37,7 +37,7 @@
|
||||
}
|
||||
|
||||
function emitEvent() {
|
||||
appWindow.emit("js-event", "this is the payload string");
|
||||
webview.emit("js-event", "this is the payload string");
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user