feat: update to alpha.11 (#555)

pull/423/head
Lucas Fernandes Nogueira 2 years ago committed by GitHub
parent d5a7c77a8d
commit d74fc0a097
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -28,4 +28,3 @@
---
Fixes docs.rs build by enabling the `tauri/dox` feature flag.

@ -0,0 +1,5 @@
---
"positioner": patch
---
Change `system-tray` feature flag to `tray-icon`.

@ -0,0 +1,53 @@
---
"app": patch
"app-js": patch
"authenticator": patch
"authenticator-js": patch
"autostart": patch
"autostart-js": patch
"cli": patch
"cli-js": patch
"clipboard-manager": patch
"clipboard-manager-js": patch
"dialog": patch
"dialog-js": patch
"fs": patch
"fs-js": patch
"global-shortcut": patch
"global-shortcut-js": patch
"http": patch
"http-js": patch
"localhost": patch
"log-plugin": patch
"log-js": patch
"notification": patch
"notification-js": patch
"os": patch
"os-js": patch
"persisted-scope": patch
"positioner": patch
"positioner-js": patch
"process": patch
"process-js": patch
"shell": patch
"shell-js": patch
"single-instance": patch
"sql": patch
"sql-js": patch
"store": patch
"store-js": patch
"stronghold": patch
"stronghold-js": patch
"updater": patch
"updater-js": patch
"upload": patch
"upload-js": patch
"websocket": patch
"websocket-js": patch
"window": patch
"window-js": patch
"window-state": patch
"window-state-js": patch
---
Update to alpha.11.

325
Cargo.lock generated

@ -275,7 +275,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6041616acea41d67c4a984709ddab1587fd0b10efe5cc563fee954d2f011854"
dependencies = [
"clipboard-win",
"core-graphics",
"core-graphics 0.22.3",
"image",
"log",
"objc",
@ -927,8 +927,24 @@ dependencies = [
"block",
"cocoa-foundation",
"core-foundation",
"core-graphics",
"foreign-types",
"core-graphics 0.22.3",
"foreign-types 0.3.2",
"libc",
"objc",
]
[[package]]
name = "cocoa"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c"
dependencies = [
"bitflags 1.3.2",
"block",
"cocoa-foundation",
"core-foundation",
"core-graphics 0.23.1",
"foreign-types 0.5.0",
"libc",
"objc",
]
@ -943,7 +959,7 @@ dependencies = [
"block",
"core-foundation",
"core-graphics-types",
"foreign-types",
"foreign-types 0.3.2",
"libc",
"objc",
]
@ -1078,7 +1094,20 @@ dependencies = [
"bitflags 1.3.2",
"core-foundation",
"core-graphics-types",
"foreign-types",
"foreign-types 0.3.2",
"libc",
]
[[package]]
name = "core-graphics"
version = "0.23.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "970a29baf4110c26fedbc7f82107d42c23f7e88e404c4577ed73fe99ff85a212"
dependencies = [
"bitflags 1.3.2",
"core-foundation",
"core-graphics-types",
"foreign-types 0.5.0",
"libc",
]
@ -1668,7 +1697,28 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
dependencies = [
"foreign-types-shared",
"foreign-types-shared 0.1.1",
]
[[package]]
name = "foreign-types"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965"
dependencies = [
"foreign-types-macros",
"foreign-types-shared 0.3.1",
]
[[package]]
name = "foreign-types-macros"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.28",
]
[[package]]
@ -1677,6 +1727,12 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
[[package]]
name = "foreign-types-shared"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"
[[package]]
name = "form_urlencoded"
version = "1.2.0"
@ -2310,9 +2366,9 @@ dependencies = [
[[package]]
name = "html5ever"
version = "0.25.2"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5c13fb08e5d4dfc151ee5e88bae63f7773d61852f3bdc73c9f4b9e1bde03148"
checksum = "bea68cab48b8459f17cf1c944c67ddc572d272d9f2b274140f223ecb1da4a3b7"
dependencies = [
"log",
"mac",
@ -2436,16 +2492,6 @@ dependencies = [
"cc",
]
[[package]]
name = "ico"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "031530fe562d8c8d71c0635013d6d155bbfe8ba0aa4b4d2d24ce8af6b71047bd"
dependencies = [
"byteorder",
"png",
]
[[package]]
name = "ico"
version = "0.3.0"
@ -2531,18 +2577,18 @@ dependencies = [
[[package]]
name = "infer"
version = "0.9.0"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f178e61cdbfe084aa75a2f4f7a25a5bb09701a47ae1753608f194b15783c937a"
checksum = "a898e4b7951673fce96614ce5751d13c40fc5674bc2d759288e46c3ab62598b3"
dependencies = [
"cfb",
]
[[package]]
name = "infer"
version = "0.12.0"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a898e4b7951673fce96614ce5751d13c40fc5674bc2d759288e46c3ab62598b3"
checksum = "cb33622da908807a06f9513c19b3c1ad50fab3e4137d82a78107d502075aa199"
dependencies = [
"cfb",
]
@ -2729,9 +2775,9 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
[[package]]
name = "javascriptcore-rs"
version = "0.17.0"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "110b9902c80c12bf113c432d0b71c7a94490b294a8234f326fd0abca2fac0b00"
checksum = "4cfcc681b896b083864a4a3c3b3ea196f14ff66b8641a68fde209c6d84434056"
dependencies = [
"bitflags 1.3.2",
"glib",
@ -2740,9 +2786,9 @@ dependencies = [
[[package]]
name = "javascriptcore-rs-sys"
version = "0.5.1"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98a216519a52cd941a733a0ad3f1023cfdb1cd47f3955e8e863ed56f558f916c"
checksum = "b0983ba5b3ab9a0c0918de02c42dc71f795d6de08092f88a98ce9fdfdee4ba91"
dependencies = [
"glib-sys",
"gobject-sys",
@ -2752,16 +2798,18 @@ dependencies = [
[[package]]
name = "jni"
version = "0.20.0"
version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "039022cdf4d7b1cf548d31f60ae783138e5fd42013f6271049d7df7afadef96c"
checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97"
dependencies = [
"cesu8",
"cfg-if",
"combine",
"jni-sys",
"log",
"thiserror",
"walkdir",
"windows-sys 0.45.0",
]
[[package]]
@ -2838,13 +2886,14 @@ dependencies = [
]
[[package]]
name = "kuchiki"
version = "0.8.1"
name = "kuchikiki"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ea8e9c6e031377cff82ee3001dc8026cdf431ed4e2e6b51f98ab8c73484a358"
checksum = "f29e4755b7b995046f510a7520c42b2fed58b77bd94d5a87a8eb43d2fd126da8"
dependencies = [
"cssparser",
"html5ever",
"indexmap 1.9.3",
"matches",
"selectors",
]
@ -3047,13 +3096,13 @@ dependencies = [
[[package]]
name = "markup5ever"
version = "0.10.1"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a24f40fb03852d1cdd84330cddcaf98e9ec08a7b7768e952fad3b4cf048ec8fd"
checksum = "7a2629bb1404f3d34c2e921f21fd34ba00b206124c81f65c50b43b6aaefeb016"
dependencies = [
"log",
"phf 0.8.0",
"phf_codegen",
"phf 0.10.1",
"phf_codegen 0.10.0",
"string_cache",
"string_cache_codegen",
"tendril",
@ -3190,6 +3239,25 @@ dependencies = [
"similar",
]
[[package]]
name = "muda"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47e33f46fb20f85553edb85e30a6a5231567f4103276ccdb5a2050613d253b1d"
dependencies = [
"cocoa 0.25.0",
"crossbeam-channel",
"gdk",
"gdk-pixbuf",
"gtk",
"keyboard-types",
"objc",
"once_cell",
"png",
"thiserror",
"windows-sys 0.48.0",
]
[[package]]
name = "native-tls"
version = "0.2.11"
@ -3210,14 +3278,15 @@ dependencies = [
[[package]]
name = "ndk"
version = "0.6.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4"
checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0"
dependencies = [
"bitflags 1.3.2",
"jni-sys",
"ndk-sys",
"num_enum",
"raw-window-handle",
"thiserror",
]
@ -3229,9 +3298,9 @@ checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b"
[[package]]
name = "ndk-sys"
version = "0.3.0"
version = "0.4.1+23.1.7779620"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97"
checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3"
dependencies = [
"jni-sys",
]
@ -3514,7 +3583,7 @@ checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d"
dependencies = [
"bitflags 1.3.2",
"cfg-if",
"foreign-types",
"foreign-types 0.3.2",
"libc",
"once_cell",
"openssl-macros",
@ -3734,6 +3803,16 @@ dependencies = [
"phf_shared 0.8.0",
]
[[package]]
name = "phf_codegen"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd"
dependencies = [
"phf_generator 0.10.0",
"phf_shared 0.10.0",
]
[[package]]
name = "phf_generator"
version = "0.8.0"
@ -4617,7 +4696,7 @@ dependencies = [
"log",
"matches",
"phf 0.8.0",
"phf_codegen",
"phf_codegen 0.8.0",
"precomputed-hash",
"servo_arc",
"smallvec",
@ -5166,9 +5245,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
[[package]]
name = "state"
version = "0.5.3"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbe866e1e51e8260c9eed836a042a5e7f6726bb2b411dffeaa712e19c388f23b"
checksum = "2b8c4a4445d81357df8b1a650d0d0d6fbbbfe99d064aa5e02f3e4022061476d8"
dependencies = [
"loom",
]
@ -5293,9 +5372,9 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
[[package]]
name = "swift-rs"
version = "1.0.5"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05e51d6f2b5fff4808614f429f8a7655ac8bcfe218185413f3a60c508482c2d6"
checksum = "1bbdb58577b6301f8d17ae2561f32002a5bae056d444e0f69e611e504a276204"
dependencies = [
"base64 0.21.2",
"serde",
@ -5349,18 +5428,17 @@ dependencies = [
[[package]]
name = "tao"
version = "0.19.1"
version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "746ae5d0ca57ae275a792f109f6e992e0b41a443abdf3f5c6eff179ef5b3443a"
checksum = "60279ecb16c33a6cef45cd37a9602455c190942d20e360bd8499bff49f2a48f3"
dependencies = [
"bitflags 1.3.2",
"cairo-rs",
"cc",
"cocoa",
"cocoa 0.24.1",
"core-foundation",
"core-graphics",
"core-graphics 0.22.3",
"crossbeam-channel",
"dirs-next",
"dispatch",
"gdk",
"gdk-pixbuf",
@ -5375,7 +5453,6 @@ dependencies = [
"instant",
"jni",
"lazy_static",
"libappindicator",
"libc",
"log",
"ndk",
@ -5390,10 +5467,12 @@ dependencies = [
"serde",
"tao-macros",
"unicode-segmentation",
"url",
"uuid",
"windows 0.44.0",
"windows 0.48.0",
"windows-implement",
"x11-dl",
"zbus",
]
[[package]]
@ -5426,13 +5505,13 @@ checksum = "1d2faeef5759ab89935255b1a4cd98e0baf99d1085e37d36599c625dac49ae8e"
[[package]]
name = "tauri"
version = "2.0.0-alpha.10"
version = "2.0.0-alpha.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e18377a75e314aa1d476896af881ed63f57a78ca84889fe63e69067f0de158d"
checksum = "fad0a5c32ce9e3e9862fb8cd433abf63e65ffea9b80dcc44d3d991e6794ea9a6"
dependencies = [
"anyhow",
"bytes 1.4.0",
"cocoa",
"cocoa 0.25.0",
"dirs-next",
"embed_plist",
"futures-util",
@ -5441,11 +5520,13 @@ dependencies = [
"gtk",
"heck",
"http",
"ico 0.2.0",
"infer 0.9.0",
"ico",
"infer 0.15.0",
"jni",
"libc",
"log",
"mime",
"muda",
"objc",
"once_cell",
"percent-encoding",
@ -5453,7 +5534,6 @@ dependencies = [
"rand 0.8.5",
"raw-window-handle",
"reqwest",
"semver",
"serde",
"serde_json",
"serde_repr",
@ -5465,26 +5545,27 @@ dependencies = [
"tauri-runtime",
"tauri-runtime-wry",
"tauri-utils",
"tempfile",
"thiserror",
"tokio",
"tray-icon",
"url",
"uuid",
"webkit2gtk",
"webview2-com",
"windows 0.44.0",
"windows 0.48.0",
]
[[package]]
name = "tauri-build"
version = "2.0.0-alpha.6"
version = "2.0.0-alpha.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a52990870fd043f1d3bd6719ae713ef2e0c50431334d7249f6ae8509d1b8c326"
checksum = "dc47d3c84f4aeac397cd956267f3b8060c5a2dba78288a5ccf9a8b7a8c1e7025"
dependencies = [
"anyhow",
"cargo_toml",
"heck",
"json-patch",
"plist",
"quote",
"semver",
"serde",
@ -5498,13 +5579,13 @@ dependencies = [
[[package]]
name = "tauri-codegen"
version = "2.0.0-alpha.6"
version = "2.0.0-alpha.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c1f1611ab0896f2693163ba4e8f3e39c02a1b70cdca4314286b5e365a5e08c6"
checksum = "7f98a67c7ef3cb3c25de91fe1fa16cc3681997f6ec99da0a7496d6feae2ea91e"
dependencies = [
"base64 0.21.2",
"brotli",
"ico 0.3.0",
"ico",
"json-patch",
"plist",
"png",
@ -5524,9 +5605,9 @@ dependencies = [
[[package]]
name = "tauri-macros"
version = "2.0.0-alpha.6"
version = "2.0.0-alpha.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22752425c6dd6f3a058f376db7371f1d5bac250e340d40ba6c97ecf7182eef29"
checksum = "b01cb5f945c71e040c5d191c32598565ae26cc266a9d5d4f7dd2dc324c5cfdd0"
dependencies = [
"heck",
"proc-macro2",
@ -5676,7 +5757,7 @@ version = "2.0.0-alpha.0"
dependencies = [
"android_logger",
"byte-unit",
"cocoa",
"cocoa 0.24.1",
"fern",
"log",
"objc",
@ -5907,9 +5988,9 @@ dependencies = [
[[package]]
name = "tauri-runtime"
version = "0.13.0-alpha.6"
version = "1.0.0-alpha.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7ce19f1309299bbc38ee9236307fad4943bd8fb09dd3fea5e9dd93c1d0898d6"
checksum = "f5ba2ea1c0b7a2c3e53259edc3c78527e9f40fa7b45f73c52ab5165e42f9d18a"
dependencies = [
"gtk",
"http",
@ -5923,16 +6004,16 @@ dependencies = [
"thiserror",
"url",
"uuid",
"windows 0.44.0",
"windows 0.48.0",
]
[[package]]
name = "tauri-runtime-wry"
version = "0.13.0-alpha.6"
version = "1.0.0-alpha.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1231be42085f3a8b150e615601f8a070bd16bf579771a5dafe2931970a05b518"
checksum = "095d8a6cb312211bd0ed6b51f078be2e5bba4e3244b5fdbe39fce2ebfc0d7a15"
dependencies = [
"cocoa",
"cocoa 0.24.1",
"gtk",
"jni",
"percent-encoding",
@ -5943,15 +6024,15 @@ dependencies = [
"uuid",
"webkit2gtk",
"webview2-com",
"windows 0.44.0",
"windows 0.48.0",
"wry",
]
[[package]]
name = "tauri-utils"
version = "2.0.0-alpha.6"
version = "2.0.0-alpha.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e2812e0cdfffb892c654555b2f1b8c84a035b4c56eb1646cb3eb5a9d8164d8e"
checksum = "06bcd7c6f67fd6371dcc22da7d7f26ec12c4eae26ad7bc54943bb9f35b5db302"
dependencies = [
"aes-gcm 0.10.2",
"brotli",
@ -5963,7 +6044,7 @@ dependencies = [
"html5ever",
"infer 0.12.0",
"json-patch",
"kuchiki",
"kuchikiki",
"memchr",
"phf 0.10.1",
"proc-macro2",
@ -5976,7 +6057,7 @@ dependencies = [
"thiserror",
"url",
"walkdir",
"windows 0.44.0",
"windows 0.48.0",
]
[[package]]
@ -6345,6 +6426,25 @@ dependencies = [
"tracing-log",
]
[[package]]
name = "tray-icon"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3b0e5bec13da15e62330e9bcf8b9fd42489b5acfe29ac8fec7ed659dbee21d9"
dependencies = [
"cocoa 0.25.0",
"core-graphics 0.23.1",
"crossbeam-channel",
"dirs-next",
"libappindicator",
"muda",
"objc",
"once_cell",
"png",
"thiserror",
"windows-sys 0.48.0",
]
[[package]]
name = "treediff"
version = "4.0.2"
@ -6760,9 +6860,9 @@ dependencies = [
[[package]]
name = "webkit2gtk"
version = "0.19.2"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8eea819afe15eb8dcdff4f19d8bfda540bae84d874c10e6f4b8faf2d6704bd1"
checksum = "3ba4cce9085e0fb02575cfd45c328740dde78253cba516b1e8be2ca0f57bd8bf"
dependencies = [
"bitflags 1.3.2",
"cairo-rs",
@ -6784,9 +6884,9 @@ dependencies = [
[[package]]
name = "webkit2gtk-sys"
version = "0.19.1"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0ac7a95ddd3fdfcaf83d8e513b4b1ad101b95b413b6aa6662ed95f284fc3d5b"
checksum = "f4489eb24e8cf0a3d0555fd3a8f7adec2a5ece34c1e7b7c9a62da7822fd40a59"
dependencies = [
"bitflags 1.3.2",
"cairo-sys-rs",
@ -6841,38 +6941,39 @@ dependencies = [
[[package]]
name = "webview2-com"
version = "0.22.1"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11296e5daf3a653b79bf47d66c380e4143d5b9c975818871179a3bda79499562"
checksum = "79e563ffe8e84d42e43ffacbace8780c0244fc8910346f334613559d92e203ad"
dependencies = [
"webview2-com-macros",
"webview2-com-sys",
"windows 0.44.0",
"windows 0.48.0",
"windows-implement",
"windows-interface",
]
[[package]]
name = "webview2-com-macros"
version = "0.6.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaebe196c01691db62e9e4ca52c5ef1e4fd837dcae27dae3ada599b5a8fd05ac"
checksum = "ac1345798ecd8122468840bcdf1b95e5dc6d2206c5e4b0eafa078d061f59c9bc"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
"syn 2.0.28",
]
[[package]]
name = "webview2-com-sys"
version = "0.22.1"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cde542bed28058a5b028d459689ee57f1d06685bb6c266da3b91b1be6703952f"
checksum = "19d39576804304cf9ead192467ef47f7859a1a12fec3bd459d5ba34b8cd65ed5"
dependencies = [
"regex",
"serde",
"serde_json",
"thiserror",
"windows 0.44.0",
"windows 0.48.0",
"windows-bindgen",
"windows-metadata",
]
@ -6951,7 +7052,7 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29d30320647cfc3dc45554c8ad825b84831def81f967a2f7589931328ff9b16d"
dependencies = [
"cocoa",
"cocoa 0.24.1",
"objc",
"raw-window-handle",
"windows-sys 0.42.0",
@ -6989,8 +7090,6 @@ version = "0.44.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b"
dependencies = [
"windows-implement",
"windows-interface",
"windows-targets 0.42.2",
]
@ -7000,14 +7099,16 @@ version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f"
dependencies = [
"windows-implement",
"windows-interface",
"windows-targets 0.48.1",
]
[[package]]
name = "windows-bindgen"
version = "0.44.0"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "222204ecf46521382a4d88b4a1bbefca9f8855697b4ab7d20803901425e061a3"
checksum = "1fe21a77bc54b7312dbd66f041605e098990c98be48cd52967b85b5e60e75ae6"
dependencies = [
"windows-metadata",
"windows-tokens",
@ -7015,9 +7116,9 @@ dependencies = [
[[package]]
name = "windows-implement"
version = "0.44.0"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ce87ca8e3417b02dc2a8a22769306658670ec92d78f1bd420d6310a67c245c6"
checksum = "5e2ee588991b9e7e6c8338edf3333fbe4da35dc72092643958ebb43f0ab2c49c"
dependencies = [
"proc-macro2",
"quote",
@ -7026,9 +7127,9 @@ dependencies = [
[[package]]
name = "windows-interface"
version = "0.44.0"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "853f69a591ecd4f810d29f17e902d40e349fb05b0b11fff63b08b826bfe39c7f"
checksum = "e6fb8df20c9bcaa8ad6ab513f7b40104840c8867d5751126e4df3b08388d0cc7"
dependencies = [
"proc-macro2",
"quote",
@ -7037,9 +7138,9 @@ dependencies = [
[[package]]
name = "windows-metadata"
version = "0.44.0"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee78911e3f4ce32c1ad9d3c7b0bd95389662ad8d8f1a3155688fed70bd96e2b6"
checksum = "422ee0e5f0e2cc372bb6addbfff9a8add712155cd743df9c15f6ab000f31432d"
[[package]]
name = "windows-sys"
@ -7119,9 +7220,9 @@ dependencies = [
[[package]]
name = "windows-tokens"
version = "0.44.0"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa4251900975a0d10841c5d4bde79c56681543367ef811f3fabb8d1803b0959b"
checksum = "b34c9a3b28cb41db7385546f7f9a8179348dffc89923dde66857b1ba5312f6b4"
[[package]]
name = "windows_aarch64_gnullvm"
@ -7307,14 +7408,14 @@ dependencies = [
[[package]]
name = "wry"
version = "0.28.3"
version = "0.31.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d15f9f827d537cefe6d047be3930f5d89b238dfb85e08ba6a319153217635aa"
checksum = "4c6289018fa3cbc051c13f4ae1a102d80c3f35a527456c75567eb2cad6989020"
dependencies = [
"base64 0.13.1",
"base64 0.21.2",
"block",
"cocoa",
"core-graphics",
"cocoa 0.24.1",
"core-graphics 0.22.3",
"crossbeam-channel",
"dunce",
"gdk",
@ -7324,7 +7425,7 @@ dependencies = [
"html5ever",
"http",
"javascriptcore-rs",
"kuchiki",
"kuchikiki",
"libc",
"log",
"objc",
@ -7340,7 +7441,7 @@ dependencies = [
"webkit2gtk",
"webkit2gtk-sys",
"webview2-com",
"windows 0.44.0",
"windows 0.48.0",
"windows-implement",
]

@ -5,8 +5,8 @@ resolver = "2"
[workspace.dependencies]
serde = { version = "1", features = ["derive"] }
log = "0.4"
tauri = "2.0.0-alpha.10"
tauri-build = "2.0.0-alpha.6"
tauri = "2.0.0-alpha.11"
tauri-build = "2.0.0-alpha.8"
serde_json = "1"
thiserror = "1"

@ -9,7 +9,7 @@
"serve": "vite preview"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5",
"@tauri-apps/api": "2.0.0-alpha.6",
"@tauri-apps/plugin-app": "2.0.0-alpha.0",
"@tauri-apps/plugin-cli": "2.0.0-alpha.0",
"@tauri-apps/plugin-clipboard-manager": "2.0.0-alpha.0",
@ -29,7 +29,7 @@
"@iconify-json/codicon": "^1.1.26",
"@iconify-json/ph": "^1.1.5",
"@sveltejs/vite-plugin-svelte": "^2.4.1",
"@tauri-apps/cli": "2.0.0-alpha.10",
"@tauri-apps/cli": "2.0.0-alpha.11",
"@unocss/extractor-svelte": "^0.53.1",
"internal-ip": "^8.0.0",
"svelte": "^3.59.1",

@ -37,7 +37,7 @@ tauri-plugin-window = { path = "../../../plugins/window", version = "2.0.0-alpha
"icon-png",
"isolation",
"macos-private-api",
"system-tray",
"tray-icon",
"protocol-asset"
]

@ -44,7 +44,7 @@ pub fn run() {
.setup(move |app| {
#[cfg(desktop)]
{
tray::create_tray(app)?;
tray::create_tray(app.handle())?;
app.handle().plugin(tauri_plugin_cli::init())?;
app.handle()
.plugin(tauri_plugin_global_shortcut::Builder::new().build())?;

@ -4,140 +4,113 @@
use std::sync::atomic::{AtomicBool, Ordering};
use tauri::{
CustomMenuItem, Manager, SystemTray, SystemTrayEvent, SystemTrayMenu, WindowBuilder, WindowUrl,
menu::{Menu, MenuItem},
tray::{ClickType, TrayIconBuilder},
Manager, Runtime, WindowBuilder, WindowUrl,
};
use tauri_plugin_dialog::DialogExt;
use tauri_plugin_shell::ShellExt;
pub fn create_tray(app: &tauri::App) -> tauri::Result<()> {
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"));
pub fn create_tray<R: Runtime>(app: &tauri::AppHandle<R>) -> tauri::Result<()> {
let toggle_i = MenuItem::with_id(app, "toggle", "Toggle", true, None);
let new_window_i = MenuItem::with_id(app, "new-window", "New window", true, None);
let icon_i_1 = MenuItem::with_id(app, "icon-1", "Icon 1", true, None);
let icon_i_2 = MenuItem::with_id(app, "icon-2", "Icon 2", true, None);
#[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("about", "About"))
.add_item(CustomMenuItem::new("exit_app", "Quit"))
.add_item(CustomMenuItem::new("destroy", "Destroy"));
let set_title_i = MenuItem::with_id(app, "set-title", "Set Title", true, None);
let switch_i = MenuItem::with_id(app, "switch-menu", "Switch Menu", true, None);
let quit_i = MenuItem::with_id(app, "quit", "Quit", true, None);
let remove_tray_i = MenuItem::with_id(app, "remove-tray", "Remove Tray icon", true, None);
let menu1 = Menu::with_items(
app,
&[
&toggle_i,
&new_window_i,
&icon_i_1,
&icon_i_2,
#[cfg(target_os = "macos")]
&set_title_i,
&switch_i,
&quit_i,
&remove_tray_i,
],
)?;
let menu2 = Menu::with_items(
app,
&[&toggle_i, &new_window_i, &switch_i, &quit_i, &remove_tray_i],
)?;
let tray_menu2 = SystemTrayMenu::new()
.add_item(CustomMenuItem::new("toggle", "Toggle"))
.add_item(CustomMenuItem::new("new", "New window"))
.add_item(CustomMenuItem::new("switch_menu", "Switch Menu"))
.add_item(CustomMenuItem::new("about", "About"))
.add_item(CustomMenuItem::new("exit_app", "Quit"))
.add_item(CustomMenuItem::new("destroy", "Destroy"));
let is_menu1 = AtomicBool::new(true);
let handle = app.handle();
let tray_id = "my-tray".to_string();
SystemTray::new()
.with_id(&tray_id)
.with_menu(tray_menu1.clone())
.with_tooltip("Tauri")
.on_event(move |event| {
let tray_handle = handle.tray_handle_by_id(&tray_id).unwrap();
match event {
SystemTrayEvent::LeftClick {
position: _,
size: _,
..
} => {
let window = handle.get_window("main").unwrap();
window.show().unwrap();
window.set_focus().unwrap();
let _ = TrayIconBuilder::with_id("tray-1")
.tooltip("Tauri")
.icon(app.default_window_icon().unwrap().clone())
.menu(&menu1)
.menu_on_left_click(false)
.on_menu_event(move |app, event| match event.id.as_ref() {
"quit" => {
app.exit(0);
}
"remove-tray" => {
app.remove_tray_by_id("tray-1");
}
"toggle" => {
if let Some(window) = app.get_window("main") {
let new_title = if window.is_visible().unwrap_or_default() {
let _ = window.hide();
"Show"
} else {
let _ = window.show();
let _ = window.set_focus();
"Hide"
};
toggle_i.set_text(new_title).unwrap();
}
SystemTrayEvent::MenuItemClick { id, .. } => {
let item_handle = tray_handle.get_item(&id);
match id.as_str() {
"exit_app" => {
// exit the app
handle.exit(0);
}
"destroy" => {
tray_handle.destroy().unwrap();
}
"toggle" => {
let window = handle.get_window("main").unwrap();
let new_title = if window.is_visible().unwrap() {
window.hide().unwrap();
"Show"
} else {
window.show().unwrap();
"Hide"
};
item_handle.set_title(new_title).unwrap();
}
"new" => {
WindowBuilder::new(&handle, "new", WindowUrl::App("index.html".into()))
.title("Tauri")
.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();
tray_handle
.set_icon(tauri::Icon::Raw(
include_bytes!("../icons/tray_icon_with_transparency.png")
.to_vec(),
))
.unwrap();
}
"icon_2" => {
#[cfg(target_os = "macos")]
tray_handle.set_icon_as_template(true).unwrap();
}
"new-window" => {
let _ = WindowBuilder::new(app, "new", WindowUrl::App("index.html".into()))
.title("Tauri")
.build();
}
#[cfg(target_os = "macos")]
"set-title" => {
if let Some(tray) = app.tray_by_id("tray-1") {
let _ = tray.set_title(Some("Tauri"));
}
}
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()
} else {
include_bytes!("../icons/tray_icon_with_transparency.png").to_vec()
})));
}
}
"switch-menu" => {
let flag = is_menu1.load(Ordering::Relaxed);
let (menu, tooltip) = if flag {
(menu2.clone(), "Menu 2")
} else {
(menu1.clone(), "Tauri")
};
if let Some(tray) = app.tray_by_id("tray-1") {
let _ = tray.set_menu(Some(menu));
let _ = tray.set_tooltip(Some(tooltip));
}
is_menu1.store(!flag, Ordering::Relaxed);
}
tray_handle
.set_icon(tauri::Icon::Raw(
include_bytes!("../icons/icon.ico").to_vec(),
))
.unwrap();
}
"switch_menu" => {
let flag = is_menu1.load(Ordering::Relaxed);
let (menu, tooltip) = if flag {
(tray_menu2.clone(), "Menu 2")
} else {
(tray_menu1.clone(), "Tauri")
};
tray_handle.set_menu(menu).unwrap();
tray_handle.set_tooltip(tooltip).unwrap();
is_menu1.store(!flag, Ordering::Relaxed);
}
"about" => {
let window = handle.get_window("main").unwrap();
window
.dialog()
.message("Tauri demo app")
.title("About app")
.parent(&window)
.ok_button_label("Homepage")
.cancel_button_label("Cancel")
.show(move |ok| {
if ok {
window.shell().open("https://tauri.app/", None).unwrap();
}
});
}
_ => {}
}
_ => {}
})
.on_tray_event(|tray, event| {
if event.click_type == ClickType::Left {
let app = tray.app_handle();
if let Some(window) = app.get_window("main") {
let _ = window.show();
let _ = window.set_focus();
}
_ => {}
}
})
.build(app)
.map(|_| ())
.build(app);
Ok(())
}

@ -124,6 +124,7 @@
"security": {
"csp": {
"default-src": "'self' customprotocol: asset:",
"connect-src": "ipc: https://ipc.localhost",
"font-src": ["https://fonts.gstatic.com"],
"img-src": "'self' asset: https://asset.localhost blob: data:",
"style-src": "'unsafe-inline' 'self' https://fonts.googleapis.com"
@ -136,11 +137,6 @@
"deny": ["$APPDATA/db/*.stronghold"]
}
}
},
"systemTray": {
"iconPath": "icons/tray_icon_with_transparency.png",
"iconAsTemplate": true,
"menuOnLeftClick": false
}
}
}

@ -27,6 +27,6 @@
"tslib": "^2.5.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

@ -28,6 +28,6 @@
"tslib": "2.6.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

@ -27,6 +27,6 @@
"tslib": "2.6.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

@ -27,6 +27,6 @@
"tslib": "^2.4.1"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

@ -27,6 +27,6 @@
"tslib": "^2.4.1"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

@ -27,6 +27,6 @@
"tslib": "^2.4.1"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

@ -28,6 +28,6 @@
"tslib": "^2.4.1"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

File diff suppressed because one or more lines are too long

@ -5,7 +5,7 @@
use notify::{Config, Event, RecommendedWatcher, RecursiveMode, Watcher};
use notify_debouncer_mini::{new_debouncer, DebounceEventResult, Debouncer};
use serde::Deserialize;
use tauri::{api::ipc::Channel, command, Runtime, State};
use tauri::{command, ipc::Channel, State};
use crate::Result;
@ -30,7 +30,7 @@ enum WatcherKind {
Watcher(RecommendedWatcher),
}
fn watch_raw<R: Runtime>(on_event: Channel<R>, rx: Receiver<notify::Result<Event>>) {
fn watch_raw(on_event: Channel, rx: Receiver<notify::Result<Event>>) {
spawn(move || {
while let Ok(event) = rx.recv() {
if let Ok(event) = event {
@ -41,7 +41,7 @@ fn watch_raw<R: Runtime>(on_event: Channel<R>, rx: Receiver<notify::Result<Event
});
}
fn watch_debounced<R: Runtime>(on_event: Channel<R>, rx: Receiver<DebounceEventResult>) {
fn watch_debounced(on_event: Channel, rx: Receiver<DebounceEventResult>) {
spawn(move || {
while let Ok(event) = rx.recv() {
if let Ok(event) = event {
@ -60,12 +60,12 @@ pub struct WatchOptions {
}
#[command]
pub async fn watch<R: Runtime>(
pub async fn watch(
watchers: State<'_, WatcherCollection>,
id: Id,
paths: Vec<PathBuf>,
options: WatchOptions,
on_event: Channel<R>,
on_event: Channel,
) -> Result<()> {
let mode = if options.recursive {
RecursiveMode::Recursive

@ -8,14 +8,7 @@
* @module
*/
declare global {
interface Window {
__TAURI_INVOKE__: <T>(cmd: string, args?: unknown) => Promise<T>;
__TAURI__: {
transformCallback: <T>(cb: (payload: T) => void) => number;
};
}
}
import { invoke, Channel } from "@tauri-apps/api/tauri";
export type ShortcutHandler = (shortcut: string) => void;
@ -38,9 +31,12 @@ async function register(
shortcut: string,
handler: ShortcutHandler,
): Promise<void> {
return await window.__TAURI_INVOKE__("plugin:globalShortcut|register", {
const h = new Channel<string>();
h.onmessage = handler;
return await invoke("plugin:globalShortcut|register", {
shortcut,
handler: window.__TAURI__.transformCallback(handler),
handler: h,
});
}
@ -63,9 +59,12 @@ async function registerAll(
shortcuts: string[],
handler: ShortcutHandler,
): Promise<void> {
return await window.__TAURI_INVOKE__("plugin:globalShortcut|register_all", {
const h = new Channel<string>();
h.onmessage = handler;
return await invoke("plugin:globalShortcut|register_all", {
shortcuts,
handler: window.__TAURI__.transformCallback(handler),
handler: h,
});
}
@ -85,7 +84,7 @@ async function registerAll(
* @since 2.0.0
*/
async function isRegistered(shortcut: string): Promise<boolean> {
return await window.__TAURI_INVOKE__("plugin:globalShortcut|is_registered", {
return await invoke("plugin:globalShortcut|is_registered", {
shortcut,
});
}
@ -103,7 +102,7 @@ async function isRegistered(shortcut: string): Promise<boolean> {
* @since 2.0.0
*/
async function unregister(shortcut: string): Promise<void> {
return await window.__TAURI_INVOKE__("plugin:globalShortcut|unregister", {
return await invoke("plugin:globalShortcut|unregister", {
shortcut,
});
}
@ -119,7 +118,7 @@ async function unregister(shortcut: string): Promise<void> {
* @since 2.0.0
*/
async function unregisterAll(): Promise<void> {
return await window.__TAURI_INVOKE__("plugin:globalShortcut|unregister_all");
return await invoke("plugin:globalShortcut|unregister_all");
}
export { register, registerAll, isRegistered, unregister, unregisterAll };

@ -27,6 +27,6 @@
"tslib": "^2.4.1"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_GLOBALSHORTCUT__=function(_){"use strict";return _.isRegistered=async function(_){return await window.__TAURI_INVOKE__("plugin:globalShortcut|is_registered",{shortcut:_})},_.register=async function(_,t){return await window.__TAURI_INVOKE__("plugin:globalShortcut|register",{shortcut:_,handler:window.__TAURI__.transformCallback(t)})},_.registerAll=async function(_,t){return await window.__TAURI_INVOKE__("plugin:globalShortcut|register_all",{shortcuts:_,handler:window.__TAURI__.transformCallback(t)})},_.unregister=async function(_){return await window.__TAURI_INVOKE__("plugin:globalShortcut|unregister",{shortcut:_})},_.unregisterAll=async function(){return await window.__TAURI_INVOKE__("plugin:globalShortcut|unregister_all")},_}({});Object.defineProperty(window.__TAURI__,"globalShortcut",{value:__TAURI_GLOBALSHORTCUT__})}
if("__TAURI__"in window){var __TAURI_GLOBALSHORTCUT__=function(e){"use strict";var t=Object.defineProperty,n=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},r=(e,t,r)=>(n(e,t,"read from private field"),r?r.call(e):t.get(e)),i=(e,t,r,i)=>(n(e,t,"write to private field"),i?i.call(e,r):t.set(e,r),r);function a(e,t=!1){let n=window.crypto.getRandomValues(new Uint32Array(1))[0],r=`_${n}`;return Object.defineProperty(window,r,{value:n=>(t&&Reflect.deleteProperty(window,r),e?.(n)),writable:!1,configurable:!0}),n}((e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})})({},{Channel:()=>s,PluginListener:()=>l,addPluginListener:()=>c,convertFileSrc:()=>_,invoke:()=>u,transformCallback:()=>a});var o,s=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)})(this,o,(()=>{})),this.id=a((e=>{r(this,o).call(this,e)}))}set onmessage(e){i(this,o,e)}get onmessage(){return r(this,o)}toJSON(){return`__CHANNEL__:${this.id}`}};o=new WeakMap;var l=class{constructor(e,t,n){this.plugin=e,this.event=t,this.channelId=n}async unregister(){return u(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function c(e,t,n){let r=new s;return r.onmessage=n,u(`plugin:${e}|register_listener`,{event:t,handler:r}).then((()=>new l(e,t,r.id)))}async function u(e,t={},n){return new Promise(((r,i)=>{let o=a((e=>{r(e),Reflect.deleteProperty(window,`_${s}`)}),!0),s=a((e=>{i(e),Reflect.deleteProperty(window,`_${o}`)}),!0);window.__TAURI_IPC__({cmd:e,callback:o,error:s,payload:t,options:n})}))}function _(e,t="asset"){return window.__TAURI__.convertFileSrc(e,t)}return e.isRegistered=async function(e){return await u("plugin:globalShortcut|is_registered",{shortcut:e})},e.register=async function(e,t){const n=new s;return n.onmessage=t,await u("plugin:globalShortcut|register",{shortcut:e,handler:n})},e.registerAll=async function(e,t){const n=new s;return n.onmessage=t,await u("plugin:globalShortcut|register_all",{shortcuts:e,handler:n})},e.unregister=async function(e){return await u("plugin:globalShortcut|unregister",{shortcut:e})},e.unregisterAll=async function(){return await u("plugin:globalShortcut|unregister_all")},e}({});Object.defineProperty(window.__TAURI__,"globalShortcut",{value:__TAURI_GLOBALSHORTCUT__})}

@ -23,7 +23,7 @@ use std::{
pub use global_hotkey::hotkey::{Code, HotKey as Shortcut, Modifiers};
use global_hotkey::{GlobalHotKeyEvent, GlobalHotKeyManager};
use tauri::{
api::ipc::CallbackFn,
ipc::Channel,
plugin::{Builder as PluginBuilder, TauriPlugin},
AppHandle, Manager, Runtime, State, Window,
};
@ -35,21 +35,15 @@ type Result<T> = std::result::Result<T, Error>;
type HotKeyId = u32;
type HandlerFn = Box<dyn Fn(&Shortcut) + Send + Sync + 'static>;
enum ShortcutSource<R: Runtime> {
Ipc {
window: Window<R>,
handler: CallbackFn,
},
enum ShortcutSource {
Ipc(Channel),
Rust,
}
impl<R: Runtime> Clone for ShortcutSource<R> {
impl Clone for ShortcutSource {
fn clone(&self) -> Self {
match self {
Self::Ipc { window, handler } => Self::Ipc {
window: window.clone(),
handler: *handler,
},
Self::Ipc(channel) => Self::Ipc(channel.clone()),
Self::Rust => Self::Rust,
}
}
@ -70,8 +64,8 @@ impl TryFrom<&str> for ShortcutWrapper {
}
}
struct RegisteredShortcut<R: Runtime> {
source: ShortcutSource<R>,
struct RegisteredShortcut {
source: ShortcutSource,
shortcut: (Shortcut, Option<String>),
}
@ -79,14 +73,14 @@ pub struct GlobalShortcut<R: Runtime> {
#[allow(dead_code)]
app: AppHandle<R>,
manager: std::result::Result<GlobalHotKeyManager, global_hotkey::Error>,
shortcuts: Arc<Mutex<HashMap<HotKeyId, RegisteredShortcut<R>>>>,
shortcuts: Arc<Mutex<HashMap<HotKeyId, RegisteredShortcut>>>,
}
impl<R: Runtime> GlobalShortcut<R> {
fn register_internal(
&self,
shortcut: (Shortcut, Option<String>),
source: ShortcutSource<R>,
source: ShortcutSource,
) -> Result<()> {
let id = shortcut.0.id();
acquire_manager(&self.manager)?.register(shortcut.0)?;
@ -100,7 +94,7 @@ impl<R: Runtime> GlobalShortcut<R> {
fn register_all_internal<S: IntoIterator<Item = (Shortcut, Option<String>)>>(
&self,
shortcuts: S,
source: ShortcutSource<R>,
source: ShortcutSource,
) -> Result<()> {
let hotkeys = shortcuts
.into_iter()
@ -218,29 +212,29 @@ where
#[tauri::command]
fn register<R: Runtime>(
window: Window<R>,
_window: Window<R>,
global_shortcut: State<'_, GlobalShortcut<R>>,
shortcut: String,
handler: CallbackFn,
handler: Channel,
) -> Result<()> {
global_shortcut.register_internal(
(parse_shortcut(&shortcut)?, Some(shortcut)),
ShortcutSource::Ipc { window, handler },
ShortcutSource::Ipc(handler),
)
}
#[tauri::command]
fn register_all<R: Runtime>(
window: Window<R>,
_window: Window<R>,
global_shortcut: State<'_, GlobalShortcut<R>>,
shortcuts: Vec<String>,
handler: CallbackFn,
handler: Channel,
) -> Result<()> {
let mut hotkeys = Vec::new();
for shortcut in shortcuts {
hotkeys.push((parse_shortcut(&shortcut)?, Some(shortcut)));
}
global_shortcut.register_all_internal(hotkeys, ShortcutSource::Ipc { window, handler })
global_shortcut.register_all_internal(hotkeys, ShortcutSource::Ipc(handler))
}
#[tauri::command]
@ -303,19 +297,14 @@ impl Builder {
])
.setup(move |app, _api| {
let shortcuts =
Arc::new(Mutex::new(HashMap::<HotKeyId, RegisteredShortcut<R>>::new()));
Arc::new(Mutex::new(HashMap::<HotKeyId, RegisteredShortcut>::new()));
let shortcuts_ = shortcuts.clone();
GlobalHotKeyEvent::set_event_handler(Some(move |e: GlobalHotKeyEvent| {
if let Some(shortcut) = shortcuts_.lock().unwrap().get(&e.id) {
match &shortcut.source {
ShortcutSource::Ipc { window, handler } => {
let callback_string = tauri::api::ipc::format_callback(
*handler,
&shortcut.shortcut.1,
)
.expect("unable to serialize shortcut string to json");
let _ = window.eval(callback_string.as_str());
ShortcutSource::Ipc(channel) => {
let _ = channel.send(&shortcut.shortcut.1);
}
ShortcutSource::Rust => {
if let Some(handler) = &handler {

@ -27,6 +27,6 @@
"tslib": "^2.5.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

@ -28,6 +28,6 @@
"tslib": "2.6.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_LOG__=function(e){"use strict";var n=Object.defineProperty,t=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},r=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)},a=(e,n,t)=>(r(e,n,"read from private field"),t?t.call(e):n.get(e)),i=(e,n,t,a)=>(r(e,n,"write to private field"),a?a.call(e,t):n.set(e,t),t);function o(e,n=!1){let t=window.crypto.getRandomValues(new Uint32Array(1))[0],r=`_${t}`;return Object.defineProperty(window,r,{value:t=>(n&&Reflect.deleteProperty(window,r),e?.(t)),writable:!1,configurable:!0}),t}t({},{Channel:()=>c,PluginListener:()=>s,addPluginListener:()=>u,convertFileSrc:()=>d,invoke:()=>_,transformCallback:()=>o});var l,c=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)})(this,l,(()=>{})),this.id=o((e=>{a(this,l).call(this,e)}))}set onmessage(e){i(this,l,e)}get onmessage(){return a(this,l)}toJSON(){return`__CHANNEL__:${this.id}`}};l=new WeakMap;var s=class{constructor(e,n,t){this.plugin=e,this.event=n,this.channelId=t}async unregister(){return _(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function u(e,n,t){let r=new c;return r.onmessage=t,_(`plugin:${e}|register_listener`,{event:n,handler:r}).then((()=>new s(e,n,r.id)))}async function _(e,n={}){return new Promise(((t,r)=>{let a=o((e=>{t(e),Reflect.deleteProperty(window,`_${i}`)}),!0),i=o((e=>{r(e),Reflect.deleteProperty(window,`_${a}`)}),!0);window.__TAURI_IPC__({cmd:e,callback:a,error:i,...n})}))}function d(e,n="asset"){let t=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${n}.localhost/${t}`:`${n}://localhost/${t}`}t({},{TauriEvent:()=>f,emit:()=>E,listen:()=>v,once:()=>h});var w,f=(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))(f||{});async function g(e,n){await _("plugin:event|unlisten",{event:e,eventId:n})}async function v(e,n,t){return _("plugin:event|listen",{event:e,windowLabel:t?.target,handler:o(n)}).then((n=>async()=>g(e,n)))}async function h(e,n,t){return v(e,(t=>{n(t),g(e,t.id).catch((()=>{}))}),t)}async function E(e,n,t){await _("plugin:event|emit",{event:e,windowLabel:t?.target,payload:n})}async function I(e,n,t){var r,a;const i=null===(r=(new Error).stack)||void 0===r?void 0:r.split("\n").map((e=>e.split("@"))),o=null==i?void 0:i.filter((([e,n])=>e.length>0&&"[native code]"!==n)),{file:l,line:c,keyValues:s}=null!=t?t:{};let u=null===(a=null==o?void 0:o[0])||void 0===a?void 0:a.filter((e=>e.length>0)).join("@");"Error"===u&&(u="webview::unknown"),await window.__TAURI_INVOKE__("plugin:log|log",{level:e,message:n,location:u,file:l,line:c,keyValues:s})}return function(e){e[e.Trace=1]="Trace",e[e.Debug=2]="Debug",e[e.Info=3]="Info",e[e.Warn=4]="Warn",e[e.Error=5]="Error"}(w||(w={})),e.attachConsole=async function(){return await v("log://log",(e=>{const n=e.payload,t=n.message.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,"");switch(n.level){case w.Trace:console.log(t);break;case w.Debug:console.debug(t);break;case w.Info:console.info(t);break;case w.Warn:console.warn(t);break;case w.Error:console.error(t);break;default:throw new Error(`unknown log level ${n.level}`)}}))},e.debug=async function(e,n){await I(w.Debug,e,n)},e.error=async function(e,n){await I(w.Error,e,n)},e.info=async function(e,n){await I(w.Info,e,n)},e.trace=async function(e,n){await I(w.Trace,e,n)},e.warn=async function(e,n){await I(w.Warn,e,n)},e}({});Object.defineProperty(window.__TAURI__,"log",{value:__TAURI_LOG__})}
if("__TAURI__"in window){var __TAURI_LOG__=function(e){"use strict";var n=Object.defineProperty,t=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},r=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)},a=(e,n,t)=>(r(e,n,"read from private field"),t?t.call(e):n.get(e)),i=(e,n,t,a)=>(r(e,n,"write to private field"),a?a.call(e,t):n.set(e,t),t);function o(e,n=!1){let t=window.crypto.getRandomValues(new Uint32Array(1))[0],r=`_${t}`;return Object.defineProperty(window,r,{value:t=>(n&&Reflect.deleteProperty(window,r),e?.(t)),writable:!1,configurable:!0}),t}t({},{Channel:()=>c,PluginListener:()=>s,addPluginListener:()=>u,convertFileSrc:()=>d,invoke:()=>_,transformCallback:()=>o});var l,c=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)})(this,l,(()=>{})),this.id=o((e=>{a(this,l).call(this,e)}))}set onmessage(e){i(this,l,e)}get onmessage(){return a(this,l)}toJSON(){return`__CHANNEL__:${this.id}`}};l=new WeakMap;var s=class{constructor(e,n,t){this.plugin=e,this.event=n,this.channelId=t}async unregister(){return _(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function u(e,n,t){let r=new c;return r.onmessage=t,_(`plugin:${e}|register_listener`,{event:n,handler:r}).then((()=>new s(e,n,r.id)))}async function _(e,n={},t){return new Promise(((r,a)=>{let i=o((e=>{r(e),Reflect.deleteProperty(window,`_${l}`)}),!0),l=o((e=>{a(e),Reflect.deleteProperty(window,`_${i}`)}),!0);window.__TAURI_IPC__({cmd:e,callback:i,error:l,payload:n,options:t})}))}function d(e,n="asset"){return window.__TAURI__.convertFileSrc(e,n)}t({},{TauriEvent:()=>f,emit:()=>E,listen:()=>v,once:()=>h});var w,f=(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))(f||{});async function g(e,n){await _("plugin:event|unlisten",{event:e,eventId:n})}async function v(e,n,t){return _("plugin:event|listen",{event:e,windowLabel:t?.target,handler:o(n)}).then((n=>async()=>g(e,n)))}async function h(e,n,t){return v(e,(t=>{n(t),g(e,t.id).catch((()=>{}))}),t)}async function E(e,n,t){await _("plugin:event|emit",{event:e,windowLabel:t?.target,payload:n})}async function I(e,n,t){var r,a;const i=null===(r=(new Error).stack)||void 0===r?void 0:r.split("\n").map((e=>e.split("@"))),o=null==i?void 0:i.filter((([e,n])=>e.length>0&&"[native code]"!==n)),{file:l,line:c,keyValues:s}=null!=t?t:{};let u=null===(a=null==o?void 0:o[0])||void 0===a?void 0:a.filter((e=>e.length>0)).join("@");"Error"===u&&(u="webview::unknown"),await window.__TAURI_INVOKE__("plugin:log|log",{level:e,message:n,location:u,file:l,line:c,keyValues:s})}return function(e){e[e.Trace=1]="Trace",e[e.Debug=2]="Debug",e[e.Info=3]="Info",e[e.Warn=4]="Warn",e[e.Error=5]="Error"}(w||(w={})),e.attachConsole=async function(){return await v("log://log",(e=>{const n=e.payload,t=n.message.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,"");switch(n.level){case w.Trace:console.log(t);break;case w.Debug:console.debug(t);break;case w.Info:console.info(t);break;case w.Warn:console.warn(t);break;case w.Error:console.error(t);break;default:throw new Error(`unknown log level ${n.level}`)}}))},e.debug=async function(e,n){await I(w.Debug,e,n)},e.error=async function(e,n){await I(w.Error,e,n)},e.info=async function(e,n){await I(w.Info,e,n)},e.trace=async function(e,n){await I(w.Trace,e,n)},e.warn=async function(e,n){await I(w.Warn,e,n)},e}({});Object.defineProperty(window.__TAURI__,"log",{value:__TAURI_LOG__})}

@ -27,6 +27,6 @@
"tslib": "^2.4.1"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_NOTIFICATION__=function(n){"use strict";var e=Object.defineProperty,i=(n,e,i)=>{if(!e.has(n))throw TypeError("Cannot "+i)},t=(n,e,t)=>(i(n,e,"read from private field"),t?t.call(n):e.get(n)),o=(n,e,t,o)=>(i(n,e,"write to private field"),o?o.call(n,t):e.set(n,t),t);function r(n,e=!1){let i=window.crypto.getRandomValues(new Uint32Array(1))[0],t=`_${i}`;return Object.defineProperty(window,t,{value:i=>(e&&Reflect.deleteProperty(window,t),n?.(i)),writable:!1,configurable:!0}),i}((n,i)=>{for(var t in i)e(n,t,{get:i[t],enumerable:!0})})({},{Channel:()=>a,PluginListener:()=>f,addPluginListener:()=>d,convertFileSrc:()=>p,invoke:()=>_,transformCallback:()=>r});var c,a=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((n,e,i)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,i)})(this,c,(()=>{})),this.id=r((n=>{t(this,c).call(this,n)}))}set onmessage(n){o(this,c,n)}get onmessage(){return t(this,c)}toJSON(){return`__CHANNEL__:${this.id}`}};c=new WeakMap;var s,l,u,f=class{constructor(n,e,i){this.plugin=n,this.event=e,this.channelId=i}async unregister(){return _(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function d(n,e,i){let t=new a;return t.onmessage=i,_(`plugin:${n}|register_listener`,{event:e,handler:t}).then((()=>new f(n,e,t.id)))}async function _(n,e={}){return new Promise(((i,t)=>{let o=r((n=>{i(n),Reflect.deleteProperty(window,`_${c}`)}),!0),c=r((n=>{t(n),Reflect.deleteProperty(window,`_${o}`)}),!0);window.__TAURI_IPC__({cmd:n,callback:o,error:c,...e})}))}function p(n,e="asset"){let i=encodeURIComponent(n);return navigator.userAgent.includes("Windows")?`https://${e}.localhost/${i}`:`${e}://localhost/${i}`}return function(n){n.Year="Year",n.Month="Month",n.TwoWeeks="TwoWeeks",n.Week="Week",n.Day="Day",n.Hour="Hour",n.Minute="Minute",n.Second="Second"}(s||(s={})),n.Importance=void 0,(l=n.Importance||(n.Importance={}))[l.None=0]="None",l[l.Min=1]="Min",l[l.Low=2]="Low",l[l.Default=3]="Default",l[l.High=4]="High",n.Visibility=void 0,(u=n.Visibility||(n.Visibility={}))[u.Secret=-1]="Secret",u[u.Private=0]="Private",u[u.Public=1]="Public",n.active=async function(){return _("plugin:notification|get_active")},n.cancel=async function(n){return _("plugin:notification|cancel",{notifications:n})},n.cancelAll=async function(){return _("plugin:notification|cancel")},n.channels=async function(){return _("plugin:notification|getActive")},n.createChannel=async function(n){return _("plugin:notification|create_channel",{...n})},n.isPermissionGranted=async function(){return"default"!==window.Notification.permission?Promise.resolve("granted"===window.Notification.permission):_("plugin:notification|is_permission_granted")},n.onAction=async function(n){return d("notification","actionPerformed",n)},n.onNotificationReceived=async function(n){return d("notification","notification",n)},n.pending=async function(){return _("plugin:notification|get_pending")},n.registerActionTypes=async function(n){return _("plugin:notification|register_action_types",{types:n})},n.removeActive=async function(n){return _("plugin:notification|remove_active",{notifications:n})},n.removeAllActive=async function(){return _("plugin:notification|remove_active")},n.removeChannel=async function(n){return _("plugin:notification|delete_channel",{id:n})},n.requestPermission=async function(){return window.Notification.requestPermission()},n.sendNotification=function(n){"string"==typeof n?new window.Notification(n):new window.Notification(n.title,n)},n}({});Object.defineProperty(window.__TAURI__,"notification",{value:__TAURI_NOTIFICATION__})}
if("__TAURI__"in window){var __TAURI_NOTIFICATION__=function(n){"use strict";var e=Object.defineProperty,i=(n,e,i)=>{if(!e.has(n))throw TypeError("Cannot "+i)},t=(n,e,t)=>(i(n,e,"read from private field"),t?t.call(n):e.get(n)),o=(n,e,t,o)=>(i(n,e,"write to private field"),o?o.call(n,t):e.set(n,t),t);function r(n,e=!1){let i=window.crypto.getRandomValues(new Uint32Array(1))[0],t=`_${i}`;return Object.defineProperty(window,t,{value:i=>(e&&Reflect.deleteProperty(window,t),n?.(i)),writable:!1,configurable:!0}),i}((n,i)=>{for(var t in i)e(n,t,{get:i[t],enumerable:!0})})({},{Channel:()=>a,PluginListener:()=>f,addPluginListener:()=>d,convertFileSrc:()=>w,invoke:()=>_,transformCallback:()=>r});var c,a=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((n,e,i)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,i)})(this,c,(()=>{})),this.id=r((n=>{t(this,c).call(this,n)}))}set onmessage(n){o(this,c,n)}get onmessage(){return t(this,c)}toJSON(){return`__CHANNEL__:${this.id}`}};c=new WeakMap;var s,l,u,f=class{constructor(n,e,i){this.plugin=n,this.event=e,this.channelId=i}async unregister(){return _(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function d(n,e,i){let t=new a;return t.onmessage=i,_(`plugin:${n}|register_listener`,{event:e,handler:t}).then((()=>new f(n,e,t.id)))}async function _(n,e={},i){return new Promise(((t,o)=>{let c=r((n=>{t(n),Reflect.deleteProperty(window,`_${a}`)}),!0),a=r((n=>{o(n),Reflect.deleteProperty(window,`_${c}`)}),!0);window.__TAURI_IPC__({cmd:n,callback:c,error:a,payload:e,options:i})}))}function w(n,e="asset"){return window.__TAURI__.convertFileSrc(n,e)}return function(n){n.Year="Year",n.Month="Month",n.TwoWeeks="TwoWeeks",n.Week="Week",n.Day="Day",n.Hour="Hour",n.Minute="Minute",n.Second="Second"}(s||(s={})),n.Importance=void 0,(l=n.Importance||(n.Importance={}))[l.None=0]="None",l[l.Min=1]="Min",l[l.Low=2]="Low",l[l.Default=3]="Default",l[l.High=4]="High",n.Visibility=void 0,(u=n.Visibility||(n.Visibility={}))[u.Secret=-1]="Secret",u[u.Private=0]="Private",u[u.Public=1]="Public",n.active=async function(){return _("plugin:notification|get_active")},n.cancel=async function(n){return _("plugin:notification|cancel",{notifications:n})},n.cancelAll=async function(){return _("plugin:notification|cancel")},n.channels=async function(){return _("plugin:notification|getActive")},n.createChannel=async function(n){return _("plugin:notification|create_channel",{...n})},n.isPermissionGranted=async function(){return"default"!==window.Notification.permission?Promise.resolve("granted"===window.Notification.permission):_("plugin:notification|is_permission_granted")},n.onAction=async function(n){return d("notification","actionPerformed",n)},n.onNotificationReceived=async function(n){return d("notification","notification",n)},n.pending=async function(){return _("plugin:notification|get_pending")},n.registerActionTypes=async function(n){return _("plugin:notification|register_action_types",{types:n})},n.removeActive=async function(n){return _("plugin:notification|remove_active",{notifications:n})},n.removeAllActive=async function(){return _("plugin:notification|remove_active")},n.removeChannel=async function(n){return _("plugin:notification|delete_channel",{id:n})},n.requestPermission=async function(){return window.Notification.requestPermission()},n.sendNotification=function(n){"string"==typeof n?new window.Notification(n):new window.Notification(n.title,n)},n}({});Object.defineProperty(window.__TAURI__,"notification",{value:__TAURI_NOTIFICATION__})}

@ -27,6 +27,6 @@
"tslib": "2.6.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

@ -254,7 +254,7 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {
if let Some(fs_scope) = fs_scope {
if fs_scope_state_path.exists() {
let scope: Scope = tauri::api::file::read_binary(&fs_scope_state_path)
let scope: Scope = std::fs::read(&fs_scope_state_path)
.map_err(Error::from)
.and_then(|scope| bincode::deserialize(&scope).map_err(Into::into))
.unwrap_or_default();
@ -276,7 +276,7 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {
#[cfg(feature = "protocol-asset")]
if asset_scope_state_path.exists() {
let scope: Scope = tauri::api::file::read_binary(&asset_scope_state_path)
let scope: Scope = std::fs::read(&asset_scope_state_path)
.map_err(Error::from)
.and_then(|scope| bincode::deserialize(&scope).map_err(Into::into))
.unwrap_or_default();

@ -19,4 +19,4 @@ thiserror = { workspace = true }
serde_repr = "0.1"
[features]
system-tray = [ "tauri/system-tray" ]
tray-icon = [ "tauri/tray-icon" ]

@ -28,6 +28,6 @@
"tslib": "2.6.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

@ -3,10 +3,10 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
#[cfg(feature = "system-tray")]
#[cfg(feature = "tray-icon")]
use crate::Tray;
use serde_repr::Deserialize_repr;
#[cfg(feature = "system-tray")]
#[cfg(feature = "tray-icon")]
use tauri::Manager;
use tauri::{PhysicalPosition, PhysicalSize, Result, Runtime, Window};
@ -23,17 +23,17 @@ pub enum Position {
LeftCenter,
RightCenter,
Center,
#[cfg(feature = "system-tray")]
#[cfg(feature = "tray-icon")]
TrayLeft,
#[cfg(feature = "system-tray")]
#[cfg(feature = "tray-icon")]
TrayBottomLeft,
#[cfg(feature = "system-tray")]
#[cfg(feature = "tray-icon")]
TrayRight,
#[cfg(feature = "system-tray")]
#[cfg(feature = "tray-icon")]
TrayBottomRight,
#[cfg(feature = "system-tray")]
#[cfg(feature = "tray-icon")]
TrayCenter,
#[cfg(feature = "system-tray")]
#[cfg(feature = "tray-icon")]
TrayBottomCenter,
}
@ -59,7 +59,7 @@ impl<R: Runtime> WindowExt for Window<R> {
width: self.outer_size()?.width as i32,
height: self.outer_size()?.height as i32,
};
#[cfg(feature = "system-tray")]
#[cfg(feature = "tray-icon")]
let (tray_position, tray_size) = self
.state::<Tray>()
.0
@ -107,7 +107,7 @@ impl<R: Runtime> WindowExt for Window<R> {
x: screen_position.x + ((screen_size.width / 2) - (window_size.width / 2)),
y: screen_position.y + (screen_size.height / 2) - (window_size.height / 2),
},
#[cfg(feature = "system-tray")]
#[cfg(feature = "tray-icon")]
TrayLeft => {
if let Some((tray_x, tray_y)) = tray_position {
PhysicalPosition {
@ -118,7 +118,7 @@ impl<R: Runtime> WindowExt for Window<R> {
panic!("tray position not set");
}
}
#[cfg(feature = "system-tray")]
#[cfg(feature = "tray-icon")]
TrayBottomLeft => {
if let Some((tray_x, tray_y)) = tray_position {
PhysicalPosition {
@ -129,7 +129,7 @@ impl<R: Runtime> WindowExt for Window<R> {
panic!("Tray position not set");
}
}
#[cfg(feature = "system-tray")]
#[cfg(feature = "tray-icon")]
TrayRight => {
if let (Some((tray_x, tray_y)), Some((tray_width, _))) = (tray_position, tray_size)
{
@ -141,7 +141,7 @@ impl<R: Runtime> WindowExt for Window<R> {
panic!("Tray position not set");
}
}
#[cfg(feature = "system-tray")]
#[cfg(feature = "tray-icon")]
TrayBottomRight => {
if let (Some((tray_x, tray_y)), Some((tray_width, _))) = (tray_position, tray_size)
{
@ -153,7 +153,7 @@ impl<R: Runtime> WindowExt for Window<R> {
panic!("Tray position not set");
}
}
#[cfg(feature = "system-tray")]
#[cfg(feature = "tray-icon")]
TrayCenter => {
if let (Some((tray_x, tray_y)), Some((tray_width, _))) = (tray_position, tray_size)
{
@ -165,7 +165,7 @@ impl<R: Runtime> WindowExt for Window<R> {
panic!("Tray position not set");
}
}
#[cfg(feature = "system-tray")]
#[cfg(feature = "tray-icon")]
TrayBottomCenter => {
if let (Some((tray_x, tray_y)), Some((tray_width, _))) = (tray_position, tray_size)
{

@ -9,7 +9,7 @@
//!
//! # Cargo features
//!
//! - **system-tray**: Enables system-tray-relative positions.
//! - **tray-icon**: Enables tray-icon-relative positions.
//!
//! Note: This requires attaching the Tauri plugin, *even* when using the trait extension only.
@ -27,38 +27,27 @@ use tauri::{
Result, Runtime,
};
#[cfg(feature = "system-tray")]
use tauri::{AppHandle, Manager, PhysicalPosition, PhysicalSize, SystemTrayEvent};
#[cfg(feature = "tray-icon")]
use tauri::{tray::TrayIconEvent, AppHandle, Manager, PhysicalPosition, PhysicalSize};
#[cfg(feature = "system-tray")]
#[cfg(feature = "tray-icon")]
struct Tray(std::sync::Mutex<Option<(PhysicalPosition<f64>, PhysicalSize<f64>)>>);
#[cfg(feature = "system-tray")]
pub fn on_tray_event<R: Runtime>(app: &AppHandle<R>, event: &SystemTrayEvent) {
match event {
SystemTrayEvent::LeftClick { position, size, .. } => {
app.state::<Tray>()
.0
.lock()
.unwrap()
.replace((*position, *size));
}
SystemTrayEvent::RightClick { position, size, .. } => {
app.state::<Tray>()
.0
.lock()
.unwrap()
.replace((*position, *size));
}
SystemTrayEvent::DoubleClick { position, size, .. } => {
app.state::<Tray>()
.0
.lock()
.unwrap()
.replace((*position, *size));
}
_ => (),
}
#[cfg(feature = "tray-icon")]
pub fn on_tray_event<R: Runtime>(app: &AppHandle<R>, event: &TrayIconEvent) {
let position = PhysicalPosition {
x: event.x,
y: event.y,
};
let size = PhysicalSize {
width: event.icon_rect.right - event.icon_rect.left,
height: event.icon_rect.bottom - event.icon_rect.top,
};
app.state::<Tray>()
.0
.lock()
.unwrap()
.replace((position, size));
}
#[tauri::command]
@ -72,7 +61,7 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {
.js_init_script(include_str!("api-iife.js").to_string())
.invoke_handler(tauri::generate_handler![move_window]);
#[cfg(feature = "system-tray")]
#[cfg(feature = "tray-icon")]
let plugin = plugin.setup(|app_handle, _api| {
app_handle.manage(Tray(std::sync::Mutex::new(None)));
Ok(())

@ -27,6 +27,6 @@
"tslib": "2.6.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

@ -62,14 +62,7 @@
* @module
*/
declare global {
interface Window {
__TAURI_INVOKE__: <T>(cmd: string, args?: unknown) => Promise<T>;
__TAURI__: {
transformCallback: <T>(cb: (payload: T) => void) => number;
};
}
}
import { invoke, Channel } from "@tauri-apps/api/tauri";
/**
* @since 2.0.0
@ -111,7 +104,7 @@ interface ChildProcess<O extends IOPayload> {
*
* @ignore
* @param program The name of the scoped command.
* @param onEvent Event handler.
* @param onEventHandler Event handler.
* @param args Program arguments.
* @param options Configuration for the process spawn.
* @returns A promise resolving to the process id.
@ -119,7 +112,7 @@ interface ChildProcess<O extends IOPayload> {
* @since 2.0.0
*/
async function execute<O extends IOPayload>(
onEvent: (event: CommandEvent<O>) => void,
onEventHandler: (event: CommandEvent<O>) => void,
program: string,
args: string | string[] = [],
options?: InternalSpawnOptions,
@ -128,11 +121,14 @@ async function execute<O extends IOPayload>(
Object.freeze(args);
}
return window.__TAURI_INVOKE__<number>("plugin:shell|execute", {
const onEvent = new Channel<CommandEvent<O>>();
onEvent.onmessage = onEventHandler;
return invoke<number>("plugin:shell|execute", {
program,
args,
options,
onEventFn: window.__TAURI__.transformCallback(onEvent),
onEvent,
});
}
@ -358,7 +354,7 @@ class Child {
* @since 2.0.0
*/
async write(data: IOPayload): Promise<void> {
return window.__TAURI_INVOKE__("plugin:shell|stdin_write", {
return invoke("plugin:shell|stdin_write", {
pid: this.pid,
// correctly serialize Uint8Arrays
buffer: typeof data === "string" ? data : Array.from(data),
@ -373,7 +369,7 @@ class Child {
* @since 2.0.0
*/
async kill(): Promise<void> {
return window.__TAURI_INVOKE__("plugin:shell|kill", {
return invoke("plugin:shell|kill", {
cmd: "killChild",
pid: this.pid,
});
@ -648,7 +644,7 @@ type CommandEvent<O extends IOPayload> =
* @since 2.0.0
*/
async function open(path: string, openWith?: string): Promise<void> {
return window.__TAURI_INVOKE__("plugin:shell|open", {
return invoke("plugin:shell|open", {
path,
with: openWith,
});

@ -27,6 +27,6 @@
"tslib": "^2.4.1"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_SHELL__=function(e){"use strict";class t{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){const s=n=>{this.removeListener(e,s),t(n)};return this.addListener(e,s)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter((e=>e!==t))),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,t){if(e in this.eventListeners){const s=this.eventListeners[e];for(const e of s)e(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){const s=n=>{this.removeListener(e,s),t(n)};return this.prependListener(e,s)}}class s{constructor(e){this.pid=e}async write(e){return window.__TAURI_INVOKE__("plugin:shell|stdin_write",{pid:this.pid,buffer:"string"==typeof e?e:Array.from(e)})}async kill(){return window.__TAURI_INVOKE__("plugin:shell|kill",{cmd:"killChild",pid:this.pid})}}class n extends t{constructor(e,s=[],n){super(),this.stdout=new t,this.stderr=new t,this.program=e,this.args="string"==typeof s?[s]:s,this.options=null!=n?n:{}}static create(e,t=[],s){return new n(e,t,s)}static sidecar(e,t=[],s){const r=new n(e,t,s);return r.options.sidecar=!0,r}async spawn(){return async function(e,t,s=[],n){return"object"==typeof s&&Object.freeze(s),window.__TAURI_INVOKE__("plugin:shell|execute",{program:t,args:s,options:n,onEventFn:window.__TAURI__.transformCallback(e)})}((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)}}),this.program,this.args,this.options).then((e=>new s(e)))}async execute(){return new Promise(((e,t)=>{this.on("error",t);const s=[],n=[];this.stdout.on("data",(e=>{s.push(e)})),this.stderr.on("data",(e=>{n.push(e)})),this.on("close",(t=>{e({code:t.code,signal:t.signal,stdout:this.collectOutput(s),stderr:this.collectOutput(n)})})),this.spawn().catch(t)}))}collectOutput(e){return"raw"===this.options.encoding?e.reduce(((e,t)=>new Uint8Array([...e,...t,10])),new Uint8Array):e.join("\n")}}return e.Child=s,e.Command=n,e.EventEmitter=t,e.open=async function(e,t){return window.__TAURI_INVOKE__("plugin:shell|open",{path:e,with:t})},e}({});Object.defineProperty(window.__TAURI__,"shell",{value:__TAURI_SHELL__})}
if("__TAURI__"in window){var __TAURI_SHELL__=function(e){"use strict";var t=Object.defineProperty,n=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},r=(e,t,r)=>(n(e,t,"read from private field"),r?r.call(e):t.get(e)),s=(e,t,r,s)=>(n(e,t,"write to private field"),s?s.call(e,r):t.set(e,r),r);function i(e,t=!1){let n=window.crypto.getRandomValues(new Uint32Array(1))[0],r=`_${n}`;return Object.defineProperty(window,r,{value:n=>(t&&Reflect.deleteProperty(window,r),e?.(n)),writable:!1,configurable:!0}),n}((e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})})({},{Channel:()=>a,PluginListener:()=>c,addPluginListener:()=>l,convertFileSrc:()=>u,invoke:()=>h,transformCallback:()=>i});var o,a=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)})(this,o,(()=>{})),this.id=i((e=>{r(this,o).call(this,e)}))}set onmessage(e){s(this,o,e)}get onmessage(){return r(this,o)}toJSON(){return`__CHANNEL__:${this.id}`}};o=new WeakMap;var c=class{constructor(e,t,n){this.plugin=e,this.event=t,this.channelId=n}async unregister(){return h(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function l(e,t,n){let r=new a;return r.onmessage=n,h(`plugin:${e}|register_listener`,{event:t,handler:r}).then((()=>new c(e,t,r.id)))}async function h(e,t={},n){return new Promise(((r,s)=>{let o=i((e=>{r(e),Reflect.deleteProperty(window,`_${a}`)}),!0),a=i((e=>{s(e),Reflect.deleteProperty(window,`_${o}`)}),!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,payload:t,options:n})}))}function u(e,t="asset"){return window.__TAURI__.convertFileSrc(e,t)}class d{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){const n=r=>{this.removeListener(e,n),t(r)};return this.addListener(e,n)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter((e=>e!==t))),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,t){if(e in this.eventListeners){const n=this.eventListeners[e];for(const e of n)e(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){const n=r=>{this.removeListener(e,n),t(r)};return this.prependListener(e,n)}}class p{constructor(e){this.pid=e}async write(e){return h("plugin:shell|stdin_write",{pid:this.pid,buffer:"string"==typeof e?e:Array.from(e)})}async kill(){return h("plugin:shell|kill",{cmd:"killChild",pid:this.pid})}}class w extends d{constructor(e,t=[],n){super(),this.stdout=new d,this.stderr=new d,this.program=e,this.args="string"==typeof t?[t]:t,this.options=null!=n?n:{}}static create(e,t=[],n){return new w(e,t,n)}static sidecar(e,t=[],n){const r=new w(e,t,n);return r.options.sidecar=!0,r}async spawn(){return async function(e,t,n=[],r){"object"==typeof n&&Object.freeze(n);const s=new a;return s.onmessage=e,h("plugin:shell|execute",{program:t,args:n,options:r,onEvent:s})}((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)}}),this.program,this.args,this.options).then((e=>new p(e)))}async execute(){return new Promise(((e,t)=>{this.on("error",t);const n=[],r=[];this.stdout.on("data",(e=>{n.push(e)})),this.stderr.on("data",(e=>{r.push(e)})),this.on("close",(t=>{e({code:t.code,signal:t.signal,stdout:this.collectOutput(n),stderr:this.collectOutput(r)})})),this.spawn().catch(t)}))}collectOutput(e){return"raw"===this.options.encoding?e.reduce(((e,t)=>new Uint8Array([...e,...t,10])),new Uint8Array):e.join("\n")}}return e.Child=p,e.Command=w,e.EventEmitter=d,e.open=async function(e,t){return h("plugin:shell|open",{path:e,with:t})},e}({});Object.defineProperty(window.__TAURI__,"shell",{value:__TAURI_SHELL__})}

@ -6,7 +6,7 @@ use std::{collections::HashMap, path::PathBuf, string::FromUtf8Error};
use encoding_rs::Encoding;
use serde::{Deserialize, Serialize};
use tauri::{api::ipc::CallbackFn, Manager, Runtime, State, Window};
use tauri::{ipc::Channel, Manager, Runtime, State, Window};
use crate::{
open::Program,
@ -97,7 +97,7 @@ pub fn execute<R: Runtime>(
shell: State<'_, Shell<R>>,
program: String,
args: ExecuteArgs,
on_event_fn: CallbackFn,
on_event: Channel,
options: CommandOptions,
) -> crate::Result<ChildId> {
let mut command = if options.sidecar {
@ -166,10 +166,7 @@ pub fn execute<R: Runtime>(
children.lock().unwrap().remove(&pid);
};
let js_event = JSCommandEvent::new(event, encoding);
let js = tauri::api::ipc::format_callback(on_event_fn, &js_event)
.expect("unable to serialize CommandEvent");
let _ = window.eval(js.as_str());
let _ = on_event.send(&js_event);
}
});

@ -206,7 +206,7 @@ impl Command {
/// use tauri_plugin_shell::{process::CommandEvent, ShellExt};
/// tauri::Builder::default()
/// .setup(|app| {
/// let handle = app.handle();
/// let handle = app.handle().clone();
/// tauri::async_runtime::spawn(async move {
/// let (mut rx, mut child) = handle.shell().command("cargo")
/// .args(["tauri", "dev"])

@ -9,6 +9,6 @@
"author": "",
"license": "MIT",
"devDependencies": {
"@tauri-apps/cli": "2.0.0-alpha.10"
"@tauri-apps/cli": "2.0.0-alpha.11"
}
}

@ -28,6 +28,6 @@
"tslib": "2.6.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

@ -28,6 +28,6 @@
"tslib": "2.6.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_STORE__=function(e){"use strict";var t=Object.defineProperty,a=(e,a)=>{for(var n in a)t(e,n,{get:a[n],enumerable:!0})},n=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)},r=(e,t,a)=>(n(e,t,"read from private field"),a?a.call(e):t.get(e)),i=(e,t,a,r)=>(n(e,t,"write to private field"),r?r.call(e,a):t.set(e,a),a);function s(e,t=!1){let a=window.crypto.getRandomValues(new Uint32Array(1))[0],n=`_${a}`;return Object.defineProperty(window,n,{value:a=>(t&&Reflect.deleteProperty(window,n),e?.(a)),writable:!1,configurable:!0}),a}a({},{Channel:()=>o,PluginListener:()=>l,addPluginListener:()=>u,convertFileSrc:()=>c,invoke:()=>h,transformCallback:()=>s});var _,o=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,t,a)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,a)})(this,_,(()=>{})),this.id=s((e=>{r(this,_).call(this,e)}))}set onmessage(e){i(this,_,e)}get onmessage(){return r(this,_)}toJSON(){return`__CHANNEL__:${this.id}`}};_=new WeakMap;var l=class{constructor(e,t,a){this.plugin=e,this.event=t,this.channelId=a}async unregister(){return h(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function u(e,t,a){let n=new o;return n.onmessage=a,h(`plugin:${e}|register_listener`,{event:t,handler:n}).then((()=>new l(e,t,n.id)))}async function h(e,t={}){return new Promise(((a,n)=>{let r=s((e=>{a(e),Reflect.deleteProperty(window,`_${i}`)}),!0),i=s((e=>{n(e),Reflect.deleteProperty(window,`_${r}`)}),!0);window.__TAURI_IPC__({cmd:e,callback:r,error:i,...t})}))}function c(e,t="asset"){let a=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${t}.localhost/${a}`:`${t}://localhost/${a}`}a({},{TauriEvent:()=>d,emit:()=>y,listen:()=>w,once:()=>I});var d=(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))(d||{});async function p(e,t){await h("plugin:event|unlisten",{event:e,eventId:t})}async function w(e,t,a){return h("plugin:event|listen",{event:e,windowLabel:a?.target,handler:s(t)}).then((t=>async()=>p(e,t)))}async function I(e,t,a){return w(e,(a=>{t(a),p(e,a.id).catch((()=>{}))}),a)}async function y(e,t,a){await h("plugin:event|emit",{event:e,windowLabel:a?.target,payload:t})}return e.Store=class{constructor(e){this.path=e}async set(e,t){return await window.__TAURI_INVOKE__("plugin:store|set",{path:this.path,key:e,value:t})}async get(e){return await window.__TAURI_INVOKE__("plugin:store|get",{path:this.path,key:e})}async has(e){return await window.__TAURI_INVOKE__("plugin:store|has",{path:this.path,key:e})}async delete(e){return await window.__TAURI_INVOKE__("plugin:store|delete",{path:this.path,key:e})}async clear(){return await window.__TAURI_INVOKE__("plugin:store|clear",{path:this.path})}async reset(){return await window.__TAURI_INVOKE__("plugin:store|reset",{path:this.path})}async keys(){return await window.__TAURI_INVOKE__("plugin:store|keys",{path:this.path})}async values(){return await window.__TAURI_INVOKE__("plugin:store|values",{path:this.path})}async entries(){return await window.__TAURI_INVOKE__("plugin:store|entries",{path:this.path})}async length(){return await window.__TAURI_INVOKE__("plugin:store|length",{path:this.path})}async load(){return await window.__TAURI_INVOKE__("plugin:store|load",{path:this.path})}async save(){return await window.__TAURI_INVOKE__("plugin:store|save",{path:this.path})}async onKeyChange(e,t){return await w("store://change",(a=>{a.payload.path===this.path&&a.payload.key===e&&t(a.payload.value)}))}async onChange(e){return await w("store://change",(t=>{t.payload.path===this.path&&e(t.payload.key,t.payload.value)}))}},e}({});Object.defineProperty(window.__TAURI__,"store",{value:__TAURI_STORE__})}
if("__TAURI__"in window){var __TAURI_STORE__=function(e){"use strict";var t=Object.defineProperty,a=(e,a)=>{for(var n in a)t(e,n,{get:a[n],enumerable:!0})},n=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)},r=(e,t,a)=>(n(e,t,"read from private field"),a?a.call(e):t.get(e)),i=(e,t,a,r)=>(n(e,t,"write to private field"),r?r.call(e,a):t.set(e,a),a);function s(e,t=!1){let a=window.crypto.getRandomValues(new Uint32Array(1))[0],n=`_${a}`;return Object.defineProperty(window,n,{value:a=>(t&&Reflect.deleteProperty(window,n),e?.(a)),writable:!1,configurable:!0}),a}a({},{Channel:()=>o,PluginListener:()=>l,addPluginListener:()=>u,convertFileSrc:()=>c,invoke:()=>h,transformCallback:()=>s});var _,o=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,t,a)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,a)})(this,_,(()=>{})),this.id=s((e=>{r(this,_).call(this,e)}))}set onmessage(e){i(this,_,e)}get onmessage(){return r(this,_)}toJSON(){return`__CHANNEL__:${this.id}`}};_=new WeakMap;var l=class{constructor(e,t,a){this.plugin=e,this.event=t,this.channelId=a}async unregister(){return h(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function u(e,t,a){let n=new o;return n.onmessage=a,h(`plugin:${e}|register_listener`,{event:t,handler:n}).then((()=>new l(e,t,n.id)))}async function h(e,t={},a){return new Promise(((n,r)=>{let i=s((e=>{n(e),Reflect.deleteProperty(window,`_${_}`)}),!0),_=s((e=>{r(e),Reflect.deleteProperty(window,`_${i}`)}),!0);window.__TAURI_IPC__({cmd:e,callback:i,error:_,payload:t,options:a})}))}function c(e,t="asset"){return window.__TAURI__.convertFileSrc(e,t)}a({},{TauriEvent:()=>p,emit:()=>y,listen:()=>d,once:()=>I});var p=(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))(p||{});async function w(e,t){await h("plugin:event|unlisten",{event:e,eventId:t})}async function d(e,t,a){return h("plugin:event|listen",{event:e,windowLabel:a?.target,handler:s(t)}).then((t=>async()=>w(e,t)))}async function I(e,t,a){return d(e,(a=>{t(a),w(e,a.id).catch((()=>{}))}),a)}async function y(e,t,a){await h("plugin:event|emit",{event:e,windowLabel:a?.target,payload:t})}return e.Store=class{constructor(e){this.path=e}async set(e,t){return await window.__TAURI_INVOKE__("plugin:store|set",{path:this.path,key:e,value:t})}async get(e){return await window.__TAURI_INVOKE__("plugin:store|get",{path:this.path,key:e})}async has(e){return await window.__TAURI_INVOKE__("plugin:store|has",{path:this.path,key:e})}async delete(e){return await window.__TAURI_INVOKE__("plugin:store|delete",{path:this.path,key:e})}async clear(){return await window.__TAURI_INVOKE__("plugin:store|clear",{path:this.path})}async reset(){return await window.__TAURI_INVOKE__("plugin:store|reset",{path:this.path})}async keys(){return await window.__TAURI_INVOKE__("plugin:store|keys",{path:this.path})}async values(){return await window.__TAURI_INVOKE__("plugin:store|values",{path:this.path})}async entries(){return await window.__TAURI_INVOKE__("plugin:store|entries",{path:this.path})}async length(){return await window.__TAURI_INVOKE__("plugin:store|length",{path:this.path})}async load(){return await window.__TAURI_INVOKE__("plugin:store|load",{path:this.path})}async save(){return await window.__TAURI_INVOKE__("plugin:store|save",{path:this.path})}async onKeyChange(e,t){return await d("store://change",(a=>{a.payload.path===this.path&&a.payload.key===e&&t(a.payload.value)}))}async onChange(e){return await d("store://change",(t=>{t.payload.path===this.path&&e(t.payload.key,t.payload.value)}))}},e}({});Object.defineProperty(window.__TAURI__,"store",{value:__TAURI_STORE__})}

@ -218,7 +218,7 @@ impl<R: Runtime> Builder<R> {
///
/// tauri::Builder::default()
/// .setup(|app| {
/// let store = StoreBuilder::new("store.bin").build(app.handle());
/// let store = StoreBuilder::new("store.bin").build(app.handle().clone());
/// let builder = Builder::default().store(store);
/// Ok(())
/// });
@ -237,7 +237,7 @@ impl<R: Runtime> Builder<R> {
///
/// tauri::Builder::default()
/// .setup(|app| {
/// let store = StoreBuilder::new("store.bin").build(app.handle());
/// let store = StoreBuilder::new("store.bin").build(app.handle().clone());
/// let builder = Builder::default().stores([store]);
/// Ok(())
/// });
@ -261,7 +261,7 @@ impl<R: Runtime> Builder<R> {
///
/// tauri::Builder::default()
/// .setup(|app| {
/// let store = StoreBuilder::new("store.bin").build(app.handle());
/// let store = StoreBuilder::new("store.bin").build(app.handle().clone());
/// app.handle().plugin(Builder::default().freeze().build());
/// Ok(())
/// });
@ -280,7 +280,7 @@ impl<R: Runtime> Builder<R> {
///
/// tauri::Builder::default()
/// .setup(|app| {
/// let store = StoreBuilder::new("store.bin").build(app.handle());
/// let store = StoreBuilder::new("store.bin").build(app.handle().clone());
/// app.handle().plugin(Builder::default().build());
/// Ok(())
/// });

@ -144,7 +144,7 @@ impl StoreBuilder {
/// ```
/// tauri::Builder::default()
/// .setup(|app| {
/// let store = tauri_plugin_store::StoreBuilder::new("store.json").build(app.handle());
/// let store = tauri_plugin_store::StoreBuilder::new("store.json").build(app.handle().clone());
/// Ok(())
/// });
/// ```

@ -28,6 +28,6 @@
"tslib": "2.6.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

@ -27,6 +27,6 @@
"tslib": "^2.5.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_UPDATER__=function(e){"use strict";var n=Object.defineProperty,t=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)},r=(e,n,r)=>(t(e,n,"read from private field"),r?r.call(e):n.get(e)),i=(e,n,r,i)=>(t(e,n,"write to private field"),i?i.call(e,r):n.set(e,r),r);function a(e,n=!1){let t=window.crypto.getRandomValues(new Uint32Array(1))[0],r=`_${t}`;return Object.defineProperty(window,r,{value:t=>(n&&Reflect.deleteProperty(window,r),e?.(t)),writable:!1,configurable:!0}),t}((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})({},{Channel:()=>o,PluginListener:()=>l,addPluginListener:()=>c,convertFileSrc:()=>u,invoke:()=>d,transformCallback:()=>a});var s,o=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)})(this,s,(()=>{})),this.id=a((e=>{r(this,s).call(this,e)}))}set onmessage(e){i(this,s,e)}get onmessage(){return r(this,s)}toJSON(){return`__CHANNEL__:${this.id}`}};s=new WeakMap;var l=class{constructor(e,n,t){this.plugin=e,this.event=n,this.channelId=t}async unregister(){return d(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function c(e,n,t){let r=new o;return r.onmessage=t,d(`plugin:${e}|register_listener`,{event:n,handler:r}).then((()=>new l(e,n,r.id)))}async function d(e,n={}){return new Promise(((t,r)=>{let i=a((e=>{t(e),Reflect.deleteProperty(window,`_${s}`)}),!0),s=a((e=>{r(e),Reflect.deleteProperty(window,`_${i}`)}),!0);window.__TAURI_IPC__({cmd:e,callback:i,error:s,...n})}))}function u(e,n="asset"){let t=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${n}.localhost/${t}`:`${n}://localhost/${t}`}class _{constructor(e){this.currentVersion=e.currentVersion,this.version=e.version,this.date=e.date,this.body=e.body}async downloadAndInstall(e){const n=new o;return null!=e&&(n.onmessage=e),d("plugin:updater|download_and_install",{onEvent:n})}}return e.Update=_,e.check=async function(e){return(null==e?void 0:e.headers)&&(e.headers=Array.from(new Headers(e.headers).entries())),d("plugin:updater|check",{...e}).then((e=>e.available?new _(e):null))},e}({});Object.defineProperty(window.__TAURI__,"updater",{value:__TAURI_UPDATER__})}
if("__TAURI__"in window){var __TAURI_UPDATER__=function(e){"use strict";var n=Object.defineProperty,t=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)},r=(e,n,r)=>(t(e,n,"read from private field"),r?r.call(e):n.get(e)),i=(e,n,r,i)=>(t(e,n,"write to private field"),i?i.call(e,r):n.set(e,r),r);function a(e,n=!1){let t=window.crypto.getRandomValues(new Uint32Array(1))[0],r=`_${t}`;return Object.defineProperty(window,r,{value:t=>(n&&Reflect.deleteProperty(window,r),e?.(t)),writable:!1,configurable:!0}),t}((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})({},{Channel:()=>o,PluginListener:()=>l,addPluginListener:()=>d,convertFileSrc:()=>_,invoke:()=>c,transformCallback:()=>a});var s,o=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)})(this,s,(()=>{})),this.id=a((e=>{r(this,s).call(this,e)}))}set onmessage(e){i(this,s,e)}get onmessage(){return r(this,s)}toJSON(){return`__CHANNEL__:${this.id}`}};s=new WeakMap;var l=class{constructor(e,n,t){this.plugin=e,this.event=n,this.channelId=t}async unregister(){return c(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function d(e,n,t){let r=new o;return r.onmessage=t,c(`plugin:${e}|register_listener`,{event:n,handler:r}).then((()=>new l(e,n,r.id)))}async function c(e,n={},t){return new Promise(((r,i)=>{let s=a((e=>{r(e),Reflect.deleteProperty(window,`_${o}`)}),!0),o=a((e=>{i(e),Reflect.deleteProperty(window,`_${s}`)}),!0);window.__TAURI_IPC__({cmd:e,callback:s,error:o,payload:n,options:t})}))}function _(e,n="asset"){return window.__TAURI__.convertFileSrc(e,n)}class u{constructor(e){this.currentVersion=e.currentVersion,this.version=e.version,this.date=e.date,this.body=e.body}async downloadAndInstall(e){const n=new o;return null!=e&&(n.onmessage=e),c("plugin:updater|download_and_install",{onEvent:n})}}return e.Update=u,e.check=async function(e){return(null==e?void 0:e.headers)&&(e.headers=Array.from(new Headers(e.headers).entries())),c("plugin:updater|check",{...e}).then((e=>e.available?new u(e):null))},e}({});Object.defineProperty(window.__TAURI__,"updater",{value:__TAURI_UPDATER__})}

@ -5,7 +5,7 @@
use crate::{PendingUpdate, Result, UpdaterExt};
use serde::Serialize;
use tauri::{api::ipc::Channel, AppHandle, Runtime, State};
use tauri::{ipc::Channel, AppHandle, Runtime, State};
use std::{
sync::atomic::{AtomicBool, Ordering},
@ -76,7 +76,7 @@ pub(crate) async fn check<R: Runtime>(
pub(crate) async fn download_and_install<R: Runtime>(
_app: AppHandle<R>,
pending: State<'_, PendingUpdate>,
on_event: Channel<R>,
on_event: Channel,
) -> Result<()> {
if let Some(pending) = &*pending.0.lock().await {
let first_chunk = AtomicBool::new(false);
@ -86,11 +86,11 @@ pub(crate) async fn download_and_install<R: Runtime>(
move |chunk_length, content_length| {
if first_chunk.swap(false, Ordering::Acquire) {
on_event
.send(&DownloadEvent::Started { content_length })
.send(DownloadEvent::Started { content_length })
.unwrap();
}
on_event
.send(&DownloadEvent::Progress { chunk_length })
.send(DownloadEvent::Progress { chunk_length })
.unwrap();
},
move || {

@ -41,7 +41,7 @@ pub trait UpdaterExt<R: Runtime> {
/// use tauri_plugin_updater::UpdaterExt;
/// tauri::Builder::default()
/// .setup(|app| {
/// let handle = app.handle();
/// let handle = app.handle().clone();
/// tauri::async_runtime::spawn(async move {
/// let response = handle.updater_builder().build().unwrap().check().await;
/// });
@ -58,7 +58,7 @@ pub trait UpdaterExt<R: Runtime> {
/// use tauri_plugin_updater::UpdaterExt;
/// tauri::Builder::default()
/// .setup(|app| {
/// let handle = app.handle();
/// let handle = app.handle().clone();
/// tauri::async_runtime::spawn(async move {
/// let response = handle.updater().unwrap().check().await;
/// });

@ -13,7 +13,7 @@ fn main() {
tauri::Builder::default()
.plugin(tauri_plugin_updater::Builder::new().build())
.setup(|app| {
let handle = app.handle();
let handle = app.handle().clone();
tauri::async_runtime::spawn(async move {
let mut builder = handle.updater_builder();
if std::env::var("TARGET").unwrap_or_default() == "nsis" {

@ -28,6 +28,6 @@
"tslib": "2.6.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_UPLOAD__=function(e){"use strict";var n=Object.defineProperty,t=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)},r=(e,n,r)=>(t(e,n,"read from private field"),r?r.call(e):n.get(e)),o=(e,n,r,o)=>(t(e,n,"write to private field"),o?o.call(e,r):n.set(e,r),r);function a(e,n=!1){let t=window.crypto.getRandomValues(new Uint32Array(1))[0],r=`_${t}`;return Object.defineProperty(window,r,{value:t=>(n&&Reflect.deleteProperty(window,r),e?.(t)),writable:!1,configurable:!0}),t}((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})({},{Channel:()=>s,PluginListener:()=>l,addPluginListener:()=>d,convertFileSrc:()=>u,invoke:()=>c,transformCallback:()=>a});var i,s=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)})(this,i,(()=>{})),this.id=a((e=>{r(this,i).call(this,e)}))}set onmessage(e){o(this,i,e)}get onmessage(){return r(this,i)}toJSON(){return`__CHANNEL__:${this.id}`}};i=new WeakMap;var l=class{constructor(e,n,t){this.plugin=e,this.event=n,this.channelId=t}async unregister(){return c(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function d(e,n,t){let r=new s;return r.onmessage=t,c(`plugin:${e}|register_listener`,{event:n,handler:r}).then((()=>new l(e,n,r.id)))}async function c(e,n={}){return new Promise(((t,r)=>{let o=a((e=>{t(e),Reflect.deleteProperty(window,`_${i}`)}),!0),i=a((e=>{r(e),Reflect.deleteProperty(window,`_${o}`)}),!0);window.__TAURI_IPC__({cmd:e,callback:o,error:i,...n})}))}function u(e,n="asset"){let t=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${n}.localhost/${t}`:`${n}://localhost/${t}`}return e.download=async function(e,n,t,r){const o=new Uint32Array(1);window.crypto.getRandomValues(o);const a=o[0],i=new s;null!=t&&(i.onmessage=t),await c("plugin:upload|download",{id:a,url:e,filePath:n,headers:null!=r?r:{},onProgress:i})},e.upload=async function(e,n,t,r){const o=new Uint32Array(1);window.crypto.getRandomValues(o);const a=o[0],i=new s;null!=t&&(i.onmessage=t),await c("plugin:upload|upload",{id:a,url:e,filePath:n,headers:null!=r?r:{},onProgress:i})},e}({});Object.defineProperty(window.__TAURI__,"upload",{value:__TAURI_UPLOAD__})}
if("__TAURI__"in window){var __TAURI_UPLOAD__=function(e){"use strict";var n=Object.defineProperty,t=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)},r=(e,n,r)=>(t(e,n,"read from private field"),r?r.call(e):n.get(e)),i=(e,n,r,i)=>(t(e,n,"write to private field"),i?i.call(e,r):n.set(e,r),r);function o(e,n=!1){let t=window.crypto.getRandomValues(new Uint32Array(1))[0],r=`_${t}`;return Object.defineProperty(window,r,{value:t=>(n&&Reflect.deleteProperty(window,r),e?.(t)),writable:!1,configurable:!0}),t}((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})({},{Channel:()=>l,PluginListener:()=>s,addPluginListener:()=>d,convertFileSrc:()=>u,invoke:()=>c,transformCallback:()=>o});var a,l=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)})(this,a,(()=>{})),this.id=o((e=>{r(this,a).call(this,e)}))}set onmessage(e){i(this,a,e)}get onmessage(){return r(this,a)}toJSON(){return`__CHANNEL__:${this.id}`}};a=new WeakMap;var s=class{constructor(e,n,t){this.plugin=e,this.event=n,this.channelId=t}async unregister(){return c(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function d(e,n,t){let r=new l;return r.onmessage=t,c(`plugin:${e}|register_listener`,{event:n,handler:r}).then((()=>new s(e,n,r.id)))}async function c(e,n={},t){return new Promise(((r,i)=>{let a=o((e=>{r(e),Reflect.deleteProperty(window,`_${l}`)}),!0),l=o((e=>{i(e),Reflect.deleteProperty(window,`_${a}`)}),!0);window.__TAURI_IPC__({cmd:e,callback:a,error:l,payload:n,options:t})}))}function u(e,n="asset"){return window.__TAURI__.convertFileSrc(e,n)}return e.download=async function(e,n,t,r){const i=new Uint32Array(1);window.crypto.getRandomValues(i);const o=i[0],a=new l;null!=t&&(a.onmessage=t),await c("plugin:upload|download",{id:o,url:e,filePath:n,headers:null!=r?r:{},onProgress:a})},e.upload=async function(e,n,t,r){const i=new Uint32Array(1);window.crypto.getRandomValues(i);const o=i[0],a=new l;null!=t&&(a.onmessage=t),await c("plugin:upload|upload",{id:o,url:e,filePath:n,headers:null!=r?r:{},onProgress:a})},e}({});Object.defineProperty(window.__TAURI__,"upload",{value:__TAURI_UPLOAD__})}

@ -16,8 +16,8 @@
use futures_util::TryStreamExt;
use serde::{ser::Serializer, Serialize};
use tauri::{
api::ipc::Channel,
command,
ipc::Channel,
plugin::{Builder as PluginBuilder, TauriPlugin},
Runtime,
};
@ -56,11 +56,11 @@ struct ProgressPayload {
}
#[command]
async fn download<R: Runtime>(
async fn download(
url: &str,
file_path: &str,
headers: HashMap<String, String>,
on_progress: Channel<R>,
on_progress: Channel,
) -> Result<()> {
let client = reqwest::Client::new();
@ -89,11 +89,11 @@ async fn download<R: Runtime>(
}
#[command]
async fn upload<R: Runtime>(
async fn upload(
url: &str,
file_path: &str,
headers: HashMap<String, String>,
on_progress: Channel<R>,
on_progress: Channel,
) -> Result<serde_json::Value> {
// Read the file
let file = File::open(file_path).await?;
@ -113,13 +113,13 @@ async fn upload<R: Runtime>(
response.json().await.map_err(Into::into)
}
fn file_to_body<R: Runtime>(channel: Channel<R>, file: File) -> reqwest::Body {
fn file_to_body(channel: Channel, file: File) -> reqwest::Body {
let stream = FramedRead::new(file, BytesCodec::new()).map_ok(|r| r.freeze());
reqwest::Body::wrap_stream(ReadProgressStream::new(
stream,
Box::new(move |progress, total| {
let _ = channel.send(&ProgressPayload { progress, total });
let _ = channel.send(ProgressPayload { progress, total });
}),
))
}

@ -13,7 +13,7 @@
"devDependencies": {
"@sveltejs/adapter-auto": "2.1.0",
"@sveltejs/kit": "1.22.3",
"@tauri-apps/cli": "2.0.0-alpha.10",
"@tauri-apps/cli": "2.0.0-alpha.11",
"svelte": "4.0.5",
"svelte-check": "3.4.6",
"tslib": "2.6.0",

@ -2,14 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
declare global {
interface Window {
__TAURI_INVOKE__: <T>(cmd: string, args?: unknown) => Promise<T>;
__TAURI__: {
transformCallback: <T>(cb: (payload: T) => void) => number;
};
}
}
import { invoke, Channel } from "@tauri-apps/api/tauri";
export interface MessageKind<T, D> {
type: T;
@ -39,17 +32,17 @@ export default class WebSocket {
static async connect(url: string, options?: unknown): Promise<WebSocket> {
const listeners: Array<(arg: Message) => void> = [];
const handler = (message: Message): void => {
const onMessage = new Channel<Message>();
onMessage.onmessage = (message: Message): void => {
listeners.forEach((l) => l(message));
};
return await window
.__TAURI_INVOKE__<number>("plugin:websocket|connect", {
url,
callbackFunction: window.__TAURI__.transformCallback(handler),
options,
})
.then((id) => new WebSocket(id, listeners));
return await invoke<number>("plugin:websocket|connect", {
url,
onMessage,
options,
}).then((id) => new WebSocket(id, listeners));
}
addListener(cb: (arg: Message) => void): void {
@ -69,7 +62,7 @@ export default class WebSocket {
"invalid `message` type, expected a `{ type: string, data: any }` object, a string or a numeric array",
);
}
return await window.__TAURI_INVOKE__("plugin:websocket|send", {
return await invoke("plugin:websocket|send", {
id: this.id,
message: m,
});

@ -27,6 +27,6 @@
"tslib": "2.6.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_WEBSOCKET__=function(){"use strict";class e{constructor(e,t){this.id=e,this.listeners=t}static async connect(t,n){const i=[];return await window.__TAURI_INVOKE__("plugin:websocket|connect",{url:t,callbackFunction:window.__TAURI__.transformCallback((e=>{i.forEach((t=>t(e)))})),options:n}).then((t=>new e(t,i)))}addListener(e){this.listeners.push(e)}async send(e){let t;if("string"==typeof e)t={type:"Text",data:e};else if("object"==typeof e&&"type"in e)t=e;else{if(!Array.isArray(e))throw new Error("invalid `message` type, expected a `{ type: string, data: any }` object, a string or a numeric array");t={type:"Binary",data:e}}return await window.__TAURI_INVOKE__("plugin:websocket|send",{id:this.id,message:t})}async disconnect(){return await this.send({type:"Close",data:{code:1e3,reason:"Disconnected by client"}})}}return e}();Object.defineProperty(window.__TAURI__,"websocket",{value:__TAURI_WEBSOCKET__})}
if("__TAURI__"in window){var __TAURI_WEBSOCKET__=function(){"use strict";var e=Object.defineProperty,t=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},n=(e,n,r)=>(t(e,n,"read from private field"),r?r.call(e):n.get(e)),r=(e,n,r,i)=>(t(e,n,"write to private field"),i?i.call(e,r):n.set(e,r),r);function i(e,t=!1){let n=window.crypto.getRandomValues(new Uint32Array(1))[0],r=`_${n}`;return Object.defineProperty(window,r,{value:n=>(t&&Reflect.deleteProperty(window,r),e?.(n)),writable:!1,configurable:!0}),n}((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})({},{Channel:()=>a,PluginListener:()=>o,addPluginListener:()=>c,convertFileSrc:()=>d,invoke:()=>l,transformCallback:()=>i});var s,a=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)})(this,s,(()=>{})),this.id=i((e=>{n(this,s).call(this,e)}))}set onmessage(e){r(this,s,e)}get onmessage(){return n(this,s)}toJSON(){return`__CHANNEL__:${this.id}`}};s=new WeakMap;var o=class{constructor(e,t,n){this.plugin=e,this.event=t,this.channelId=n}async unregister(){return l(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function c(e,t,n){let r=new a;return r.onmessage=n,l(`plugin:${e}|register_listener`,{event:t,handler:r}).then((()=>new o(e,t,r.id)))}async function l(e,t={},n){return new Promise(((r,s)=>{let a=i((e=>{r(e),Reflect.deleteProperty(window,`_${o}`)}),!0),o=i((e=>{s(e),Reflect.deleteProperty(window,`_${a}`)}),!0);window.__TAURI_IPC__({cmd:e,callback:a,error:o,payload:t,options:n})}))}function d(e,t="asset"){return window.__TAURI__.convertFileSrc(e,t)}class _{constructor(e,t){this.id=e,this.listeners=t}static async connect(e,t){const n=[],r=new a;return r.onmessage=e=>{n.forEach((t=>t(e)))},await l("plugin:websocket|connect",{url:e,onMessage:r,options:t}).then((e=>new _(e,n)))}addListener(e){this.listeners.push(e)}async send(e){let t;if("string"==typeof e)t={type:"Text",data:e};else if("object"==typeof e&&"type"in e)t=e;else{if(!Array.isArray(e))throw new Error("invalid `message` type, expected a `{ type: string, data: any }` object, a string or a numeric array");t={type:"Binary",data:e}}return await l("plugin:websocket|send",{id:this.id,message:t})}async disconnect(){return await this.send({type:"Close",data:{code:1e3,reason:"Disconnected by client"}})}}return _}();Object.defineProperty(window.__TAURI__,"websocket",{value:__TAURI_WEBSOCKET__})}

@ -14,7 +14,7 @@
use futures_util::{stream::SplitSink, SinkExt, StreamExt};
use serde::{ser::Serializer, Deserialize, Serialize};
use tauri::{
api::ipc::{format_callback, CallbackFn},
ipc::Channel,
plugin::{Builder as PluginBuilder, TauriPlugin},
Manager, Runtime, State, Window,
};
@ -95,7 +95,7 @@ enum WebSocketMessage {
async fn connect<R: Runtime>(
window: Window<R>,
url: String,
callback_function: CallbackFn,
on_message: Channel,
config: Option<ConnectionConfig>,
) -> Result<Id> {
let id = rand::random();
@ -107,6 +107,7 @@ async fn connect<R: Runtime>(
manager.0.lock().await.insert(id, write);
read.for_each(move |message| {
let window_ = window.clone();
let on_message_ = on_message.clone();
async move {
if let Ok(Message::Close(_)) = message {
let manager = window_.state::<ConnectionManager>();
@ -136,9 +137,8 @@ async fn connect<R: Runtime>(
Ok(Message::Frame(_)) => serde_json::Value::Null, // This value can't be recieved.
Err(e) => serde_json::to_value(Error::from(e)).unwrap(),
};
let js = format_callback(callback_function, &response)
.expect("unable to serialize websocket message");
let _ = window_.eval(js.as_str());
let _ = on_message_.send(response);
}
})
.await;

@ -28,6 +28,6 @@
"tslib": "2.6.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

@ -317,8 +317,8 @@ impl Builder {
let state_path = app_dir.join(STATE_FILENAME);
if state_path.exists() {
Arc::new(Mutex::new(
tauri::api::file::read_binary(state_path)
.map_err(Error::TauriApi)
std::fs::read(state_path)
.map_err(Error::from)
.and_then(|state| bincode::deserialize(&state).map_err(Into::into))
.unwrap_or_default(),
))

@ -27,6 +27,6 @@
"tslib": "^2.5.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

File diff suppressed because one or more lines are too long

@ -37,7 +37,7 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {
.invoke_handler(|invoke| {
#[cfg(desktop)]
{
let handler: Box<dyn Fn(tauri::Invoke<R>) -> bool> =
let handler: Box<dyn Fn(tauri::ipc::Invoke<R>) -> bool> =
Box::new(tauri::generate_handler![
desktop_commands::create,
// getters

@ -64,8 +64,8 @@ importers:
examples/api:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
'@tauri-apps/plugin-app':
specifier: 2.0.0-alpha.0
version: link:../../plugins/app
@ -119,8 +119,8 @@ importers:
specifier: ^2.4.1
version: 2.4.1(svelte@3.59.1)(vite@4.4.4)
'@tauri-apps/cli':
specifier: 2.0.0-alpha.10
version: 2.0.0-alpha.10
specifier: 2.0.0-alpha.11
version: 2.0.0-alpha.11
'@unocss/extractor-svelte':
specifier: ^0.53.1
version: 0.53.1
@ -140,8 +140,8 @@ importers:
plugins/app:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: ^2.5.0
@ -150,8 +150,8 @@ importers:
plugins/authenticator:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: 2.6.0
@ -160,8 +160,8 @@ importers:
plugins/autostart:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: 2.6.0
@ -170,8 +170,8 @@ importers:
plugins/cli:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: ^2.4.1
@ -180,8 +180,8 @@ importers:
plugins/clipboard-manager:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: ^2.4.1
@ -190,8 +190,8 @@ importers:
plugins/dialog:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: ^2.4.1
@ -200,8 +200,8 @@ importers:
plugins/fs:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: ^2.4.1
@ -210,8 +210,8 @@ importers:
plugins/global-shortcut:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: ^2.4.1
@ -220,8 +220,8 @@ importers:
plugins/http:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: ^2.5.0
@ -230,8 +230,8 @@ importers:
plugins/log:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: 2.6.0
@ -240,8 +240,8 @@ importers:
plugins/notification:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: ^2.4.1
@ -250,8 +250,8 @@ importers:
plugins/os:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: 2.6.0
@ -260,8 +260,8 @@ importers:
plugins/positioner:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: 2.6.0
@ -270,8 +270,8 @@ importers:
plugins/process:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: 2.6.0
@ -280,8 +280,8 @@ importers:
plugins/shell:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: ^2.4.1
@ -290,14 +290,14 @@ importers:
plugins/single-instance/examples/vanilla:
devDependencies:
'@tauri-apps/cli':
specifier: 2.0.0-alpha.10
version: 2.0.0-alpha.10
specifier: 2.0.0-alpha.11
version: 2.0.0-alpha.11
plugins/sql:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: 2.6.0
@ -306,8 +306,8 @@ importers:
plugins/store:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: 2.6.0
@ -316,8 +316,8 @@ importers:
plugins/stronghold:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: 2.6.0
@ -326,8 +326,8 @@ importers:
plugins/updater:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: ^2.5.0
@ -336,8 +336,8 @@ importers:
plugins/upload:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: 2.6.0
@ -346,8 +346,8 @@ importers:
plugins/websocket:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: 2.6.0
@ -366,8 +366,8 @@ importers:
specifier: 1.22.3
version: 1.22.3(svelte@4.0.5)(vite@4.4.4)
'@tauri-apps/cli':
specifier: 2.0.0-alpha.10
version: 2.0.0-alpha.10
specifier: 2.0.0-alpha.11
version: 2.0.0-alpha.11
svelte:
specifier: 4.0.5
version: 4.0.5
@ -387,8 +387,8 @@ importers:
plugins/window:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: ^2.5.0
@ -397,8 +397,8 @@ importers:
plugins/window-state:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.5
version: 2.0.0-alpha.5
specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.6
devDependencies:
tslib:
specifier: 2.6.0
@ -1106,13 +1106,13 @@ packages:
- supports-color
dev: true
/@tauri-apps/api@2.0.0-alpha.5:
resolution: {integrity: sha512-OqysC4c819itGxic50RoDMrmd+ofX+MMNkXKeRS0BV2rkKqrnuV17o3TrQXFI1xs/kXRmmPC+3Y42P9Y5uNvRg==}
/@tauri-apps/api@2.0.0-alpha.6:
resolution: {integrity: sha512-ZMOc3eu9amwvkC6M69h3hWt4/EsFaAXmtkiw4xd2LN59/lTb4ZQiVfq2QKlRcu1rj3n/Tcr7U30ZopvHwXBGIg==}
engines: {node: '>= 14.6.0', npm: '>= 6.6.0', yarn: '>= 1.19.1'}
dev: false
/@tauri-apps/cli-darwin-arm64@2.0.0-alpha.10:
resolution: {integrity: sha512-z6DoKRUm1Yygu2Tpatu7Fej0eZejZQcsDKsHWc3b5yoIsrodxvKbko2SvYczUx4ecXWplJBTIfTZNo6ciIRRmw==}
/@tauri-apps/cli-darwin-arm64@2.0.0-alpha.11:
resolution: {integrity: sha512-SXm5vCO/Rt5JoY9se35jA4zz8iqgA0bgbcM/qVOrTnd1DUFWUP9Tss0g+UExhqEcvUxo/QPfuwk8qVYDH3A7gg==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [darwin]
@ -1120,8 +1120,8 @@ packages:
dev: true
optional: true
/@tauri-apps/cli-darwin-x64@2.0.0-alpha.10:
resolution: {integrity: sha512-xqPUC5uI6zo5+1IXSwZLj1uyRWCeZgQgpyaExGDOYBjcC8HUc2NRdFGsGVtGhFWE+HftppD9p8elJLQM90B02w==}
/@tauri-apps/cli-darwin-x64@2.0.0-alpha.11:
resolution: {integrity: sha512-usboHzRGITRcT4YM6CC7M11EpgO1pormVhOb2OzhkUmt7m0HTwKDswZL7YER5Kx82RaMqXmt8MKF5q14HZqzkg==}
engines: {node: '>= 10'}
cpu: [x64]
os: [darwin]
@ -1129,8 +1129,8 @@ packages:
dev: true
optional: true
/@tauri-apps/cli-linux-arm-gnueabihf@2.0.0-alpha.10:
resolution: {integrity: sha512-UpjG9qpF/7fkfrBoM6N+Lo08HRAKR9k7LENAFU+zd81JestxOCs0hxuX2/lGkVydtOuSXfVvMn1W5YpGKkgp3A==}
/@tauri-apps/cli-linux-arm-gnueabihf@2.0.0-alpha.11:
resolution: {integrity: sha512-yAcJOpTnijxSmvxwkbRmHNBmFGo0UyA9qunboDaSppQQqlEozGMwQe6yASUpBdjzRaECbygoiiNez9dHOnQfOg==}
engines: {node: '>= 10'}
cpu: [arm]
os: [linux]
@ -1138,8 +1138,8 @@ packages:
dev: true
optional: true
/@tauri-apps/cli-linux-arm64-gnu@2.0.0-alpha.10:
resolution: {integrity: sha512-Pc8seZINcbHDgOC0ThZ5EPUqOYbL94wEUecKkiaKn7gCl3/ZyIlRte5gizBeLwmnG4fkSLZc0UMvRilu4hGK3g==}
/@tauri-apps/cli-linux-arm64-gnu@2.0.0-alpha.11:
resolution: {integrity: sha512-tPYRhxZjAKaBcpN5WerHO39PEru9Uql8milTgp+rD+uu5C0cqUTR524YoffuIox38zB4skq7y8sQCT+oivDLkQ==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
@ -1147,8 +1147,8 @@ packages:
dev: true
optional: true
/@tauri-apps/cli-linux-arm64-musl@2.0.0-alpha.10:
resolution: {integrity: sha512-ZlaBbJq5yXP6VmNOrUGgSDnM1JcDsYf7XfVOm/kLVVrZ3iEzYA18v4SZH2kR18bU7h5+YVCPwwnfD+B8ROGidA==}
/@tauri-apps/cli-linux-arm64-musl@2.0.0-alpha.11:
resolution: {integrity: sha512-E+FJ9nnaYcsmm88u8GZOmmiHG/3qG4guF/k7r7Y3v5N9I1NFyiEr8hg5WeHBNBZoepHSrtBRQ0Ov2Bq58hqOzg==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
@ -1156,8 +1156,8 @@ packages:
dev: true
optional: true
/@tauri-apps/cli-linux-x64-gnu@2.0.0-alpha.10:
resolution: {integrity: sha512-7fo0u56URSFZwJpwPMeNiYypbgYcT8i5KPMe1CQgWW19sJLHBMK1Kd0L8SeAZDlCPpY2coNifAdEm3C7Ca7xMQ==}
/@tauri-apps/cli-linux-x64-gnu@2.0.0-alpha.11:
resolution: {integrity: sha512-Rvy/r0HI2RmE+D+0EUAs5xlIa4zMxQ421PTrOY0WmyTHrjxx/M4TX3D4oJnZsKrLjQ3L8OFvV6A632BJnxpAuA==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
@ -1165,8 +1165,8 @@ packages:
dev: true
optional: true
/@tauri-apps/cli-linux-x64-musl@2.0.0-alpha.10:
resolution: {integrity: sha512-9lY7YJmsm7SndlIxKzj/faX/bYX1q0dib88kpxT2xW4qNt9RihTI6PST1PDce5DmEoheLU9Xp9ere8SfoHgE2A==}
/@tauri-apps/cli-linux-x64-musl@2.0.0-alpha.11:
resolution: {integrity: sha512-QT1TH+QieJKDT8YOyUKRIdcnMZgeH/vGdkzkmXbKaGURcYEjsh8qHelYzE+2oyWt8VBIJJXV7DcbNX6g4Q+fMA==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
@ -1174,8 +1174,8 @@ packages:
dev: true
optional: true
/@tauri-apps/cli-win32-arm64-msvc@2.0.0-alpha.10:
resolution: {integrity: sha512-tJOHIy13vjYRkfw7++aRDQEb5CVzVQKDiJ35Zg4I8YcaPExgj6LKCpDo8N8AD4RXy4SnYKzqYTt8K9xcyIonzA==}
/@tauri-apps/cli-win32-arm64-msvc@2.0.0-alpha.11:
resolution: {integrity: sha512-ggGRBzdND1lEYlZ31ujeYvVAKZh/vHjnx7Q5Gsi4Bu3e9pSt3sId0G5G2OXH7WyxftaDUzfsLfKknE3cQwX9rA==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [win32]
@ -1183,8 +1183,8 @@ packages:
dev: true
optional: true
/@tauri-apps/cli-win32-ia32-msvc@2.0.0-alpha.10:
resolution: {integrity: sha512-DN4TlOU8e6cRRVXAnldHhfDDr0ER000fojJ/Vb33fgGvaXury3jBtNyKQuoscvg6T8fLUBc72O6+4tDnXlIBwQ==}
/@tauri-apps/cli-win32-ia32-msvc@2.0.0-alpha.11:
resolution: {integrity: sha512-P32D6CvyzVB+5pPDxcKSoIClGB0el5rzaDne8jVS/VR+IidYp1oCP5wAsF9h+ldEsdesAbsbtWaMKS36kxgA2g==}
engines: {node: '>= 10'}
cpu: [ia32]
os: [win32]
@ -1192,8 +1192,8 @@ packages:
dev: true
optional: true
/@tauri-apps/cli-win32-x64-msvc@2.0.0-alpha.10:
resolution: {integrity: sha512-H5Y+L7H24n9EVB/Dw5HHGo+wQZHTLVgWrkOwsxqssDhTPiM5CbEuyjEf/B1y8uqp4YoIlw5t7Db+GBg12KejAA==}
/@tauri-apps/cli-win32-x64-msvc@2.0.0-alpha.11:
resolution: {integrity: sha512-a3geg/sWR7+qfTuoQGFK13YlHlip47XYnMXtoaC+SAXJ7Pur+/m48PZgxYy5mwvI2ApNUTgkMO5ZwdeeK2sh5g==}
engines: {node: '>= 10'}
cpu: [x64]
os: [win32]
@ -1201,21 +1201,21 @@ packages:
dev: true
optional: true
/@tauri-apps/cli@2.0.0-alpha.10:
resolution: {integrity: sha512-8SkTAxg5J06f7BWgJjNt1NEBPRsffmj4X+PckHX3ZguZd8xqpGtACufUg0zVqaFZPmd+9OCvoEJSP5veO4utDQ==}
/@tauri-apps/cli@2.0.0-alpha.11:
resolution: {integrity: sha512-akkxK6lkPyo27F7+GHJuZTEUWwaX5yKRXrDhir+DAzEH4Gt/EZ+GsPFPgSV1EBQzDZGdMGpRovuftIky7m0TZw==}
engines: {node: '>= 10'}
hasBin: true
optionalDependencies:
'@tauri-apps/cli-darwin-arm64': 2.0.0-alpha.10
'@tauri-apps/cli-darwin-x64': 2.0.0-alpha.10
'@tauri-apps/cli-linux-arm-gnueabihf': 2.0.0-alpha.10
'@tauri-apps/cli-linux-arm64-gnu': 2.0.0-alpha.10
'@tauri-apps/cli-linux-arm64-musl': 2.0.0-alpha.10
'@tauri-apps/cli-linux-x64-gnu': 2.0.0-alpha.10
'@tauri-apps/cli-linux-x64-musl': 2.0.0-alpha.10
'@tauri-apps/cli-win32-arm64-msvc': 2.0.0-alpha.10
'@tauri-apps/cli-win32-ia32-msvc': 2.0.0-alpha.10
'@tauri-apps/cli-win32-x64-msvc': 2.0.0-alpha.10
'@tauri-apps/cli-darwin-arm64': 2.0.0-alpha.11
'@tauri-apps/cli-darwin-x64': 2.0.0-alpha.11
'@tauri-apps/cli-linux-arm-gnueabihf': 2.0.0-alpha.11
'@tauri-apps/cli-linux-arm64-gnu': 2.0.0-alpha.11
'@tauri-apps/cli-linux-arm64-musl': 2.0.0-alpha.11
'@tauri-apps/cli-linux-x64-gnu': 2.0.0-alpha.11
'@tauri-apps/cli-linux-x64-musl': 2.0.0-alpha.11
'@tauri-apps/cli-win32-arm64-msvc': 2.0.0-alpha.11
'@tauri-apps/cli-win32-ia32-msvc': 2.0.0-alpha.11
'@tauri-apps/cli-win32-x64-msvc': 2.0.0-alpha.11
dev: true
/@tauri-apps/toml@2.2.4:

@ -27,6 +27,6 @@
"tslib": "2.6.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/api": "2.0.0-alpha.6"
}
}

Loading…
Cancel
Save