feat: update dependencies
This commit is contained in:
parent
55fe1d144f
commit
3e087bd257
16 changed files with 2004 additions and 474 deletions
1781
Cargo.lock
generated
1781
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
24
Cargo.toml
24
Cargo.toml
|
@ -6,21 +6,21 @@ version = "0.1.0"
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
futures = { version = "0.3.25", optional = true }
|
futures = { version = "0.3.29", optional = true }
|
||||||
js-sys = "0.3.59"
|
js-sys = "0.3.66"
|
||||||
log = "0.4.17"
|
log = "0.4.20"
|
||||||
semver = {version = "1.0.14", optional = true, features = ["serde"]}
|
semver = {version = "1.0.20", optional = true, features = ["serde"]}
|
||||||
serde = {version = "1.0.140", features = ["derive"]}
|
serde = {version = "1.0.193", features = ["derive"]}
|
||||||
serde-wasm-bindgen = "0.4.3"
|
serde-wasm-bindgen = "0.6.3"
|
||||||
serde_repr = "0.1.10"
|
serde_repr = "0.1.17"
|
||||||
thiserror = "1.0.37"
|
thiserror = "1.0.50"
|
||||||
url = {version = "2.3.1", optional = true, features = ["serde"]}
|
url = {version = "2.5.0", optional = true, features = ["serde"]}
|
||||||
wasm-bindgen = {version = "0.2.82", features = ["serde_json"]}
|
wasm-bindgen = {version = "0.2.89", features = ["serde_json"]}
|
||||||
wasm-bindgen-futures = "0.4.32"
|
wasm-bindgen-futures = "0.4.39"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tauri-sys = {path = ".", features = ["all"]}
|
tauri-sys = {path = ".", features = ["all"]}
|
||||||
wasm-bindgen-test = "0.3.33"
|
wasm-bindgen-test = "0.3.39"
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
all-features = true
|
all-features = true
|
||||||
|
|
|
@ -7,13 +7,13 @@ edition = "2021"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tauri-sys = { path = "../../", features = ["all"] }
|
tauri-sys = { path = "../../", features = ["all"] }
|
||||||
sycamore = { git = "https://github.com/sycamore-rs/sycamore", rev = "abd556cbc02047042dad2ebd04405e455a9b11b2", features = ["suspense"] }
|
sycamore = { git = "https://github.com/sycamore-rs/sycamore", rev = "abd556cbc02047042dad2ebd04405e455a9b11b2", features = ["suspense"] }
|
||||||
anyhow = "1.0.66"
|
anyhow = "1.0.75"
|
||||||
console_error_panic_hook = "0.1.7"
|
console_error_panic_hook = "0.1.7"
|
||||||
wasm-bindgen-futures = "0.4.32"
|
wasm-bindgen-futures = "0.4.39"
|
||||||
serde = { version = "1.0.147", features = ["derive"] }
|
serde = { version = "1.0.193", features = ["derive"] }
|
||||||
log = { version = "0.4.17", features = ["serde"] }
|
log = { version = "0.4.20", features = ["serde"] }
|
||||||
futures = "0.3.25"
|
futures = "0.3.29"
|
||||||
gloo-timers = { version = "0.2.4", features = ["futures"] }
|
gloo-timers = { version = "0.3", features = ["futures"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
ci = []
|
ci = []
|
||||||
|
|
|
@ -7,4 +7,8 @@ ignore = ["./src-tauri"]
|
||||||
[serve]
|
[serve]
|
||||||
address = "127.0.0.1"
|
address = "127.0.0.1"
|
||||||
port = 1420
|
port = 1420
|
||||||
open = false
|
open = false
|
||||||
|
|
||||||
|
[tools]
|
||||||
|
# Default wasm-bindgen version to download.
|
||||||
|
wasm_bindgen = "0.2.89"
|
|
@ -11,18 +11,18 @@ rust-version = "1.57"
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
tauri-build = { version = "1.2", features = [] }
|
tauri-build = { version = "1.5.0", features = [] }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
tauri-plugin-log = {git = "https://github.com/tauri-apps/tauri-plugin-log", features = ["colored"] }
|
tauri-plugin-log = {git = "https://github.com/tauri-apps/tauri-plugin-log", features = ["colored"] }
|
||||||
tauri = { version = "1.2", features = ["api-all", "updater"] }
|
tauri = { version = "1.5.3", features = ["api-all", "updater"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
# by default Tauri runs in production mode
|
# by default Tauri runs in production mode
|
||||||
# when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL
|
# when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL
|
||||||
default = [ "custom-protocol" ]
|
default = [ "custom-protocol" ]
|
||||||
# this feature is used used for production builds where `devPath` points to the filesystem
|
# this feature is used for production builds where `devPath` points to the filesystem
|
||||||
# DO NOT remove this
|
# DO NOT remove this
|
||||||
custom-protocol = [ "tauri/custom-protocol" ]
|
custom-protocol = [ "tauri/custom-protocol" ]
|
||||||
|
|
|
@ -25,8 +25,8 @@ pub async fn get_tauri_version() -> anyhow::Result<()> {
|
||||||
let version = app::get_tauri_version().await?;
|
let version = app::get_tauri_version().await?;
|
||||||
|
|
||||||
ensure!(version.major == 1);
|
ensure!(version.major == 1);
|
||||||
ensure!(version.minor == 2);
|
ensure!(version.minor == 5);
|
||||||
ensure!(version.patch == 0);
|
ensure!(version.patch == 3);
|
||||||
ensure!(version.build.is_empty());
|
ensure!(version.build.is_empty());
|
||||||
ensure!(version.pre.is_empty());
|
ensure!(version.pre.is_empty());
|
||||||
|
|
||||||
|
|
73
pnpm-lock.yaml
generated
73
pnpm-lock.yaml
generated
|
@ -1,14 +1,17 @@
|
||||||
lockfileVersion: 5.4
|
lockfileVersion: '6.0'
|
||||||
|
|
||||||
specifiers:
|
settings:
|
||||||
esbuild: ^0.15.13
|
autoInstallPeers: true
|
||||||
|
excludeLinksFromLockfile: false
|
||||||
|
|
||||||
devDependencies:
|
devDependencies:
|
||||||
esbuild: 0.15.13
|
esbuild:
|
||||||
|
specifier: ^0.15.13
|
||||||
|
version: 0.15.13
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
|
|
||||||
/@esbuild/android-arm/0.15.13:
|
/@esbuild/android-arm@0.15.13:
|
||||||
resolution: {integrity: sha512-RY2fVI8O0iFUNvZirXaQ1vMvK0xhCcl0gqRj74Z6yEiO1zAUa7hbsdwZM1kzqbxHK7LFyMizipfXT3JME+12Hw==}
|
resolution: {integrity: sha512-RY2fVI8O0iFUNvZirXaQ1vMvK0xhCcl0gqRj74Z6yEiO1zAUa7hbsdwZM1kzqbxHK7LFyMizipfXT3JME+12Hw==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
|
@ -17,7 +20,7 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/linux-loong64/0.15.13:
|
/@esbuild/linux-loong64@0.15.13:
|
||||||
resolution: {integrity: sha512-+BoyIm4I8uJmH/QDIH0fu7MG0AEx9OXEDXnqptXCwKOlOqZiS4iraH1Nr7/ObLMokW3sOCeBNyD68ATcV9b9Ag==}
|
resolution: {integrity: sha512-+BoyIm4I8uJmH/QDIH0fu7MG0AEx9OXEDXnqptXCwKOlOqZiS4iraH1Nr7/ObLMokW3sOCeBNyD68ATcV9b9Ag==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
cpu: [loong64]
|
cpu: [loong64]
|
||||||
|
@ -26,7 +29,7 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-android-64/0.15.13:
|
/esbuild-android-64@0.15.13:
|
||||||
resolution: {integrity: sha512-yRorukXBlokwTip+Sy4MYskLhJsO0Kn0/Fj43s1krVblfwP+hMD37a4Wmg139GEsMLl+vh8WXp2mq/cTA9J97g==}
|
resolution: {integrity: sha512-yRorukXBlokwTip+Sy4MYskLhJsO0Kn0/Fj43s1krVblfwP+hMD37a4Wmg139GEsMLl+vh8WXp2mq/cTA9J97g==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
|
@ -35,7 +38,7 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-android-arm64/0.15.13:
|
/esbuild-android-arm64@0.15.13:
|
||||||
resolution: {integrity: sha512-TKzyymLD6PiVeyYa4c5wdPw87BeAiTXNtK6amWUcXZxkV51gOk5u5qzmDaYSwiWeecSNHamFsaFjLoi32QR5/w==}
|
resolution: {integrity: sha512-TKzyymLD6PiVeyYa4c5wdPw87BeAiTXNtK6amWUcXZxkV51gOk5u5qzmDaYSwiWeecSNHamFsaFjLoi32QR5/w==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
|
@ -44,7 +47,7 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-darwin-64/0.15.13:
|
/esbuild-darwin-64@0.15.13:
|
||||||
resolution: {integrity: sha512-WAx7c2DaOS6CrRcoYCgXgkXDliLnFv3pQLV6GeW1YcGEZq2Gnl8s9Pg7ahValZkpOa0iE/ojRVQ87sbUhF1Cbg==}
|
resolution: {integrity: sha512-WAx7c2DaOS6CrRcoYCgXgkXDliLnFv3pQLV6GeW1YcGEZq2Gnl8s9Pg7ahValZkpOa0iE/ojRVQ87sbUhF1Cbg==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
|
@ -53,7 +56,7 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-darwin-arm64/0.15.13:
|
/esbuild-darwin-arm64@0.15.13:
|
||||||
resolution: {integrity: sha512-U6jFsPfSSxC3V1CLiQqwvDuj3GGrtQNB3P3nNC3+q99EKf94UGpsG9l4CQ83zBs1NHrk1rtCSYT0+KfK5LsD8A==}
|
resolution: {integrity: sha512-U6jFsPfSSxC3V1CLiQqwvDuj3GGrtQNB3P3nNC3+q99EKf94UGpsG9l4CQ83zBs1NHrk1rtCSYT0+KfK5LsD8A==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
|
@ -62,7 +65,7 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-freebsd-64/0.15.13:
|
/esbuild-freebsd-64@0.15.13:
|
||||||
resolution: {integrity: sha512-whItJgDiOXaDG/idy75qqevIpZjnReZkMGCgQaBWZuKHoElDJC1rh7MpoUgupMcdfOd+PgdEwNQW9DAE6i8wyA==}
|
resolution: {integrity: sha512-whItJgDiOXaDG/idy75qqevIpZjnReZkMGCgQaBWZuKHoElDJC1rh7MpoUgupMcdfOd+PgdEwNQW9DAE6i8wyA==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
|
@ -71,7 +74,7 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-freebsd-arm64/0.15.13:
|
/esbuild-freebsd-arm64@0.15.13:
|
||||||
resolution: {integrity: sha512-6pCSWt8mLUbPtygv7cufV0sZLeylaMwS5Fznj6Rsx9G2AJJsAjQ9ifA+0rQEIg7DwJmi9it+WjzNTEAzzdoM3Q==}
|
resolution: {integrity: sha512-6pCSWt8mLUbPtygv7cufV0sZLeylaMwS5Fznj6Rsx9G2AJJsAjQ9ifA+0rQEIg7DwJmi9it+WjzNTEAzzdoM3Q==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
|
@ -80,7 +83,7 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-linux-32/0.15.13:
|
/esbuild-linux-32@0.15.13:
|
||||||
resolution: {integrity: sha512-VbZdWOEdrJiYApm2kkxoTOgsoCO1krBZ3quHdYk3g3ivWaMwNIVPIfEE0f0XQQ0u5pJtBsnk2/7OPiCFIPOe/w==}
|
resolution: {integrity: sha512-VbZdWOEdrJiYApm2kkxoTOgsoCO1krBZ3quHdYk3g3ivWaMwNIVPIfEE0f0XQQ0u5pJtBsnk2/7OPiCFIPOe/w==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
cpu: [ia32]
|
cpu: [ia32]
|
||||||
|
@ -89,7 +92,7 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-linux-64/0.15.13:
|
/esbuild-linux-64@0.15.13:
|
||||||
resolution: {integrity: sha512-rXmnArVNio6yANSqDQlIO4WiP+Cv7+9EuAHNnag7rByAqFVuRusLbGi2697A5dFPNXoO//IiogVwi3AdcfPC6A==}
|
resolution: {integrity: sha512-rXmnArVNio6yANSqDQlIO4WiP+Cv7+9EuAHNnag7rByAqFVuRusLbGi2697A5dFPNXoO//IiogVwi3AdcfPC6A==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
|
@ -98,16 +101,7 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-linux-arm/0.15.13:
|
/esbuild-linux-arm64@0.15.13:
|
||||||
resolution: {integrity: sha512-Ac6LpfmJO8WhCMQmO253xX2IU2B3wPDbl4IvR0hnqcPrdfCaUa2j/lLMGTjmQ4W5JsJIdHEdW12dG8lFS0MbxQ==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [arm]
|
|
||||||
os: [linux]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/esbuild-linux-arm64/0.15.13:
|
|
||||||
resolution: {integrity: sha512-alEMGU4Z+d17U7KQQw2IV8tQycO6T+rOrgW8OS22Ua25x6kHxoG6Ngry6Aq6uranC+pNWNMB6aHFPh7aTQdORQ==}
|
resolution: {integrity: sha512-alEMGU4Z+d17U7KQQw2IV8tQycO6T+rOrgW8OS22Ua25x6kHxoG6Ngry6Aq6uranC+pNWNMB6aHFPh7aTQdORQ==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
|
@ -116,7 +110,16 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-linux-mips64le/0.15.13:
|
/esbuild-linux-arm@0.15.13:
|
||||||
|
resolution: {integrity: sha512-Ac6LpfmJO8WhCMQmO253xX2IU2B3wPDbl4IvR0hnqcPrdfCaUa2j/lLMGTjmQ4W5JsJIdHEdW12dG8lFS0MbxQ==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [arm]
|
||||||
|
os: [linux]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/esbuild-linux-mips64le@0.15.13:
|
||||||
resolution: {integrity: sha512-47PgmyYEu+yN5rD/MbwS6DxP2FSGPo4Uxg5LwIdxTiyGC2XKwHhHyW7YYEDlSuXLQXEdTO7mYe8zQ74czP7W8A==}
|
resolution: {integrity: sha512-47PgmyYEu+yN5rD/MbwS6DxP2FSGPo4Uxg5LwIdxTiyGC2XKwHhHyW7YYEDlSuXLQXEdTO7mYe8zQ74czP7W8A==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
cpu: [mips64el]
|
cpu: [mips64el]
|
||||||
|
@ -125,7 +128,7 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-linux-ppc64le/0.15.13:
|
/esbuild-linux-ppc64le@0.15.13:
|
||||||
resolution: {integrity: sha512-z6n28h2+PC1Ayle9DjKoBRcx/4cxHoOa2e689e2aDJSaKug3jXcQw7mM+GLg+9ydYoNzj8QxNL8ihOv/OnezhA==}
|
resolution: {integrity: sha512-z6n28h2+PC1Ayle9DjKoBRcx/4cxHoOa2e689e2aDJSaKug3jXcQw7mM+GLg+9ydYoNzj8QxNL8ihOv/OnezhA==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
cpu: [ppc64]
|
cpu: [ppc64]
|
||||||
|
@ -134,7 +137,7 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-linux-riscv64/0.15.13:
|
/esbuild-linux-riscv64@0.15.13:
|
||||||
resolution: {integrity: sha512-+Lu4zuuXuQhgLUGyZloWCqTslcCAjMZH1k3Xc9MSEJEpEFdpsSU0sRDXAnk18FKOfEjhu4YMGaykx9xjtpA6ow==}
|
resolution: {integrity: sha512-+Lu4zuuXuQhgLUGyZloWCqTslcCAjMZH1k3Xc9MSEJEpEFdpsSU0sRDXAnk18FKOfEjhu4YMGaykx9xjtpA6ow==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
cpu: [riscv64]
|
cpu: [riscv64]
|
||||||
|
@ -143,7 +146,7 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-linux-s390x/0.15.13:
|
/esbuild-linux-s390x@0.15.13:
|
||||||
resolution: {integrity: sha512-BMeXRljruf7J0TMxD5CIXS65y7puiZkAh+s4XFV9qy16SxOuMhxhVIXYLnbdfLrsYGFzx7U9mcdpFWkkvy/Uag==}
|
resolution: {integrity: sha512-BMeXRljruf7J0TMxD5CIXS65y7puiZkAh+s4XFV9qy16SxOuMhxhVIXYLnbdfLrsYGFzx7U9mcdpFWkkvy/Uag==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
cpu: [s390x]
|
cpu: [s390x]
|
||||||
|
@ -152,7 +155,7 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-netbsd-64/0.15.13:
|
/esbuild-netbsd-64@0.15.13:
|
||||||
resolution: {integrity: sha512-EHj9QZOTel581JPj7UO3xYbltFTYnHy+SIqJVq6yd3KkCrsHRbapiPb0Lx3EOOtybBEE9EyqbmfW1NlSDsSzvQ==}
|
resolution: {integrity: sha512-EHj9QZOTel581JPj7UO3xYbltFTYnHy+SIqJVq6yd3KkCrsHRbapiPb0Lx3EOOtybBEE9EyqbmfW1NlSDsSzvQ==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
|
@ -161,7 +164,7 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-openbsd-64/0.15.13:
|
/esbuild-openbsd-64@0.15.13:
|
||||||
resolution: {integrity: sha512-nkuDlIjF/sfUhfx8SKq0+U+Fgx5K9JcPq1mUodnxI0x4kBdCv46rOGWbuJ6eof2n3wdoCLccOoJAbg9ba/bT2w==}
|
resolution: {integrity: sha512-nkuDlIjF/sfUhfx8SKq0+U+Fgx5K9JcPq1mUodnxI0x4kBdCv46rOGWbuJ6eof2n3wdoCLccOoJAbg9ba/bT2w==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
|
@ -170,7 +173,7 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-sunos-64/0.15.13:
|
/esbuild-sunos-64@0.15.13:
|
||||||
resolution: {integrity: sha512-jVeu2GfxZQ++6lRdY43CS0Tm/r4WuQQ0Pdsrxbw+aOrHQPHV0+LNOLnvbN28M7BSUGnJnHkHm2HozGgNGyeIRw==}
|
resolution: {integrity: sha512-jVeu2GfxZQ++6lRdY43CS0Tm/r4WuQQ0Pdsrxbw+aOrHQPHV0+LNOLnvbN28M7BSUGnJnHkHm2HozGgNGyeIRw==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
|
@ -179,7 +182,7 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-windows-32/0.15.13:
|
/esbuild-windows-32@0.15.13:
|
||||||
resolution: {integrity: sha512-XoF2iBf0wnqo16SDq+aDGi/+QbaLFpkiRarPVssMh9KYbFNCqPLlGAWwDvxEVz+ywX6Si37J2AKm+AXq1kC0JA==}
|
resolution: {integrity: sha512-XoF2iBf0wnqo16SDq+aDGi/+QbaLFpkiRarPVssMh9KYbFNCqPLlGAWwDvxEVz+ywX6Si37J2AKm+AXq1kC0JA==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
cpu: [ia32]
|
cpu: [ia32]
|
||||||
|
@ -188,7 +191,7 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-windows-64/0.15.13:
|
/esbuild-windows-64@0.15.13:
|
||||||
resolution: {integrity: sha512-Et6htEfGycjDrtqb2ng6nT+baesZPYQIW+HUEHK4D1ncggNrDNk3yoboYQ5KtiVrw/JaDMNttz8rrPubV/fvPQ==}
|
resolution: {integrity: sha512-Et6htEfGycjDrtqb2ng6nT+baesZPYQIW+HUEHK4D1ncggNrDNk3yoboYQ5KtiVrw/JaDMNttz8rrPubV/fvPQ==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
|
@ -197,7 +200,7 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-windows-arm64/0.15.13:
|
/esbuild-windows-arm64@0.15.13:
|
||||||
resolution: {integrity: sha512-3bv7tqntThQC9SWLRouMDmZnlOukBhOCTlkzNqzGCmrkCJI7io5LLjwJBOVY6kOUlIvdxbooNZwjtBvj+7uuVg==}
|
resolution: {integrity: sha512-3bv7tqntThQC9SWLRouMDmZnlOukBhOCTlkzNqzGCmrkCJI7io5LLjwJBOVY6kOUlIvdxbooNZwjtBvj+7uuVg==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
|
@ -206,7 +209,7 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild/0.15.13:
|
/esbuild@0.15.13:
|
||||||
resolution: {integrity: sha512-Cu3SC84oyzzhrK/YyN4iEVy2jZu5t2fz66HEOShHURcjSkOSAVL8C/gfUT+lDJxkVHpg8GZ10DD0rMHRPqMFaQ==}
|
resolution: {integrity: sha512-Cu3SC84oyzzhrK/YyN4iEVy2jZu5t2fz66HEOShHURcjSkOSAVL8C/gfUT+lDJxkVHpg8GZ10DD0rMHRPqMFaQ==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
|
@ -74,7 +74,8 @@ async function message(message2, options) {
|
||||||
cmd: "messageDialog",
|
cmd: "messageDialog",
|
||||||
message: message2.toString(),
|
message: message2.toString(),
|
||||||
title: opts?.title?.toString(),
|
title: opts?.title?.toString(),
|
||||||
type: opts?.type
|
type: opts?.type,
|
||||||
|
buttonLabel: opts?.okLabel?.toString()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -86,7 +87,11 @@ async function ask(message2, options) {
|
||||||
cmd: "askDialog",
|
cmd: "askDialog",
|
||||||
message: message2.toString(),
|
message: message2.toString(),
|
||||||
title: opts?.title?.toString(),
|
title: opts?.title?.toString(),
|
||||||
type: opts?.type
|
type: opts?.type,
|
||||||
|
buttonLabels: [
|
||||||
|
opts?.okLabel?.toString() ?? "Yes",
|
||||||
|
opts?.cancelLabel?.toString() ?? "No"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -98,7 +103,11 @@ async function confirm(message2, options) {
|
||||||
cmd: "confirmDialog",
|
cmd: "confirmDialog",
|
||||||
message: message2.toString(),
|
message: message2.toString(),
|
||||||
title: opts?.title?.toString(),
|
title: opts?.title?.toString(),
|
||||||
type: opts?.type
|
type: opts?.type,
|
||||||
|
buttonLabels: [
|
||||||
|
opts?.okLabel?.toString() ?? "Ok",
|
||||||
|
opts?.cancelLabel?.toString() ?? "Cancel"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
66
src/http.js
66
src/http.js
|
@ -48,40 +48,47 @@ var ResponseType = /* @__PURE__ */ ((ResponseType2) => {
|
||||||
ResponseType2[ResponseType2["Binary"] = 3] = "Binary";
|
ResponseType2[ResponseType2["Binary"] = 3] = "Binary";
|
||||||
return ResponseType2;
|
return ResponseType2;
|
||||||
})(ResponseType || {});
|
})(ResponseType || {});
|
||||||
|
async function formBody(data) {
|
||||||
|
const form = {};
|
||||||
|
const append = async (key, v) => {
|
||||||
|
if (v !== null) {
|
||||||
|
let r;
|
||||||
|
if (typeof v === "string") {
|
||||||
|
r = v;
|
||||||
|
} else if (v instanceof Uint8Array || Array.isArray(v)) {
|
||||||
|
r = Array.from(v);
|
||||||
|
} else if (v instanceof File) {
|
||||||
|
r = {
|
||||||
|
file: Array.from(new Uint8Array(await v.arrayBuffer())),
|
||||||
|
mime: v.type,
|
||||||
|
fileName: v.name
|
||||||
|
};
|
||||||
|
} else if (typeof v.file === "string") {
|
||||||
|
r = { file: v.file, mime: v.mime, fileName: v.fileName };
|
||||||
|
} else {
|
||||||
|
r = { file: Array.from(v.file), mime: v.mime, fileName: v.fileName };
|
||||||
|
}
|
||||||
|
form[String(key)] = r;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (data instanceof FormData) {
|
||||||
|
for (const [key, value] of data) {
|
||||||
|
await append(key, value);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (const [key, value] of Object.entries(data)) {
|
||||||
|
await append(key, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return form;
|
||||||
|
}
|
||||||
var Body = class {
|
var Body = class {
|
||||||
constructor(type, payload) {
|
constructor(type, payload) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.payload = payload;
|
this.payload = payload;
|
||||||
}
|
}
|
||||||
static form(data) {
|
static form(data) {
|
||||||
const form = {};
|
return new Body("Form", data);
|
||||||
const append = (key, v) => {
|
|
||||||
if (v !== null) {
|
|
||||||
let r;
|
|
||||||
if (typeof v === "string") {
|
|
||||||
r = v;
|
|
||||||
} else if (v instanceof Uint8Array || Array.isArray(v)) {
|
|
||||||
r = Array.from(v);
|
|
||||||
} else if (v instanceof File) {
|
|
||||||
r = { file: v.name, mime: v.type, fileName: v.name };
|
|
||||||
} else if (typeof v.file === "string") {
|
|
||||||
r = { file: v.file, mime: v.mime, fileName: v.fileName };
|
|
||||||
} else {
|
|
||||||
r = { file: Array.from(v.file), mime: v.mime, fileName: v.fileName };
|
|
||||||
}
|
|
||||||
form[String(key)] = r;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
if (data instanceof FormData) {
|
|
||||||
for (const [key, value] of data) {
|
|
||||||
append(key, value);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (const [key, value] of Object.entries(data)) {
|
|
||||||
append(key, value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new Body("Form", form);
|
|
||||||
}
|
}
|
||||||
static json(data) {
|
static json(data) {
|
||||||
return new Body("Json", data);
|
return new Body("Json", data);
|
||||||
|
@ -124,6 +131,9 @@ var Client = class {
|
||||||
if (jsonResponse) {
|
if (jsonResponse) {
|
||||||
options.responseType = 2 /* Text */;
|
options.responseType = 2 /* Text */;
|
||||||
}
|
}
|
||||||
|
if (options.body?.type === "Form") {
|
||||||
|
options.body.payload = await formBody(options.body.payload);
|
||||||
|
}
|
||||||
return invokeTauriCommand({
|
return invokeTauriCommand({
|
||||||
__tauriModule: "Http",
|
__tauriModule: "Http",
|
||||||
message: {
|
message: {
|
||||||
|
|
277
src/index.js
277
src/index.js
|
@ -58,8 +58,7 @@ async function invoke(cmd, args = {}) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function convertFileSrc(filePath, protocol = "asset") {
|
function convertFileSrc(filePath, protocol = "asset") {
|
||||||
const path = encodeURIComponent(filePath);
|
return window.__TAURI__.convertFileSrc(filePath, protocol);
|
||||||
return navigator.userAgent.includes("Windows") ? `https://${protocol}.localhost/${path}` : `${protocol}://localhost/${path}`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// tauri/tooling/api/src/helpers/tauri.ts
|
// tauri/tooling/api/src/helpers/tauri.ts
|
||||||
|
@ -189,7 +188,8 @@ async function message(message2, options) {
|
||||||
cmd: "messageDialog",
|
cmd: "messageDialog",
|
||||||
message: message2.toString(),
|
message: message2.toString(),
|
||||||
title: opts?.title?.toString(),
|
title: opts?.title?.toString(),
|
||||||
type: opts?.type
|
type: opts?.type,
|
||||||
|
buttonLabel: opts?.okLabel?.toString()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -201,7 +201,11 @@ async function ask(message2, options) {
|
||||||
cmd: "askDialog",
|
cmd: "askDialog",
|
||||||
message: message2.toString(),
|
message: message2.toString(),
|
||||||
title: opts?.title?.toString(),
|
title: opts?.title?.toString(),
|
||||||
type: opts?.type
|
type: opts?.type,
|
||||||
|
buttonLabels: [
|
||||||
|
opts?.okLabel?.toString() ?? "Yes",
|
||||||
|
opts?.cancelLabel?.toString() ?? "No"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -213,7 +217,11 @@ async function confirm(message2, options) {
|
||||||
cmd: "confirmDialog",
|
cmd: "confirmDialog",
|
||||||
message: message2.toString(),
|
message: message2.toString(),
|
||||||
title: opts?.title?.toString(),
|
title: opts?.title?.toString(),
|
||||||
type: opts?.type
|
type: opts?.type,
|
||||||
|
buttonLabels: [
|
||||||
|
opts?.okLabel?.toString() ?? "Ok",
|
||||||
|
opts?.cancelLabel?.toString() ?? "Cancel"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -576,40 +584,47 @@ var ResponseType = /* @__PURE__ */ ((ResponseType2) => {
|
||||||
ResponseType2[ResponseType2["Binary"] = 3] = "Binary";
|
ResponseType2[ResponseType2["Binary"] = 3] = "Binary";
|
||||||
return ResponseType2;
|
return ResponseType2;
|
||||||
})(ResponseType || {});
|
})(ResponseType || {});
|
||||||
|
async function formBody(data) {
|
||||||
|
const form = {};
|
||||||
|
const append = async (key, v) => {
|
||||||
|
if (v !== null) {
|
||||||
|
let r;
|
||||||
|
if (typeof v === "string") {
|
||||||
|
r = v;
|
||||||
|
} else if (v instanceof Uint8Array || Array.isArray(v)) {
|
||||||
|
r = Array.from(v);
|
||||||
|
} else if (v instanceof File) {
|
||||||
|
r = {
|
||||||
|
file: Array.from(new Uint8Array(await v.arrayBuffer())),
|
||||||
|
mime: v.type,
|
||||||
|
fileName: v.name
|
||||||
|
};
|
||||||
|
} else if (typeof v.file === "string") {
|
||||||
|
r = { file: v.file, mime: v.mime, fileName: v.fileName };
|
||||||
|
} else {
|
||||||
|
r = { file: Array.from(v.file), mime: v.mime, fileName: v.fileName };
|
||||||
|
}
|
||||||
|
form[String(key)] = r;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (data instanceof FormData) {
|
||||||
|
for (const [key, value] of data) {
|
||||||
|
await append(key, value);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (const [key, value] of Object.entries(data)) {
|
||||||
|
await append(key, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return form;
|
||||||
|
}
|
||||||
var Body = class {
|
var Body = class {
|
||||||
constructor(type2, payload) {
|
constructor(type2, payload) {
|
||||||
this.type = type2;
|
this.type = type2;
|
||||||
this.payload = payload;
|
this.payload = payload;
|
||||||
}
|
}
|
||||||
static form(data) {
|
static form(data) {
|
||||||
const form = {};
|
return new Body("Form", data);
|
||||||
const append = (key, v) => {
|
|
||||||
if (v !== null) {
|
|
||||||
let r;
|
|
||||||
if (typeof v === "string") {
|
|
||||||
r = v;
|
|
||||||
} else if (v instanceof Uint8Array || Array.isArray(v)) {
|
|
||||||
r = Array.from(v);
|
|
||||||
} else if (v instanceof File) {
|
|
||||||
r = { file: v.name, mime: v.type, fileName: v.name };
|
|
||||||
} else if (typeof v.file === "string") {
|
|
||||||
r = { file: v.file, mime: v.mime, fileName: v.fileName };
|
|
||||||
} else {
|
|
||||||
r = { file: Array.from(v.file), mime: v.mime, fileName: v.fileName };
|
|
||||||
}
|
|
||||||
form[String(key)] = r;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
if (data instanceof FormData) {
|
|
||||||
for (const [key, value] of data) {
|
|
||||||
append(key, value);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (const [key, value] of Object.entries(data)) {
|
|
||||||
append(key, value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new Body("Form", form);
|
|
||||||
}
|
}
|
||||||
static json(data) {
|
static json(data) {
|
||||||
return new Body("Json", data);
|
return new Body("Json", data);
|
||||||
|
@ -652,6 +667,9 @@ var Client = class {
|
||||||
if (jsonResponse) {
|
if (jsonResponse) {
|
||||||
options.responseType = 2 /* Text */;
|
options.responseType = 2 /* Text */;
|
||||||
}
|
}
|
||||||
|
if (options.body?.type === "Form") {
|
||||||
|
options.body.payload = await formBody(options.body.payload);
|
||||||
|
}
|
||||||
return invokeTauriCommand({
|
return invokeTauriCommand({
|
||||||
__tauriModule: "Http",
|
__tauriModule: "Http",
|
||||||
message: {
|
message: {
|
||||||
|
@ -1353,11 +1371,12 @@ async function installUpdate() {
|
||||||
function onStatusChange(statusResult) {
|
function onStatusChange(statusResult) {
|
||||||
if (statusResult.error) {
|
if (statusResult.error) {
|
||||||
cleanListener();
|
cleanListener();
|
||||||
return reject(statusResult.error);
|
reject(statusResult.error);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (statusResult.status === "DONE") {
|
if (statusResult.status === "DONE") {
|
||||||
cleanListener();
|
cleanListener();
|
||||||
return resolve2();
|
resolve2();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onUpdaterEvent(onStatusChange).then((fn) => {
|
onUpdaterEvent(onStatusChange).then((fn) => {
|
||||||
|
@ -1383,7 +1402,7 @@ async function checkUpdate() {
|
||||||
return new Promise((resolve2, reject) => {
|
return new Promise((resolve2, reject) => {
|
||||||
function onUpdateAvailable(manifest) {
|
function onUpdateAvailable(manifest) {
|
||||||
cleanListener();
|
cleanListener();
|
||||||
return resolve2({
|
resolve2({
|
||||||
manifest,
|
manifest,
|
||||||
shouldUpdate: true
|
shouldUpdate: true
|
||||||
});
|
});
|
||||||
|
@ -1391,11 +1410,12 @@ async function checkUpdate() {
|
||||||
function onStatusChange(statusResult) {
|
function onStatusChange(statusResult) {
|
||||||
if (statusResult.error) {
|
if (statusResult.error) {
|
||||||
cleanListener();
|
cleanListener();
|
||||||
return reject(statusResult.error);
|
reject(statusResult.error);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (statusResult.status === "UPTODATE") {
|
if (statusResult.status === "UPTODATE") {
|
||||||
cleanListener();
|
cleanListener();
|
||||||
return resolve2({
|
resolve2({
|
||||||
shouldUpdate: false
|
shouldUpdate: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1619,6 +1639,20 @@ var WindowManager = class extends WebviewWindowHandle {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
async isMinimized() {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Window",
|
||||||
|
message: {
|
||||||
|
cmd: "manage",
|
||||||
|
data: {
|
||||||
|
label: this.label,
|
||||||
|
cmd: {
|
||||||
|
type: "isMinimized"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
async isMaximized() {
|
async isMaximized() {
|
||||||
return invokeTauriCommand({
|
return invokeTauriCommand({
|
||||||
__tauriModule: "Window",
|
__tauriModule: "Window",
|
||||||
|
@ -1633,6 +1667,20 @@ var WindowManager = class extends WebviewWindowHandle {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
async isFocused() {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Window",
|
||||||
|
message: {
|
||||||
|
cmd: "manage",
|
||||||
|
data: {
|
||||||
|
label: this.label,
|
||||||
|
cmd: {
|
||||||
|
type: "isFocused"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
async isDecorated() {
|
async isDecorated() {
|
||||||
return invokeTauriCommand({
|
return invokeTauriCommand({
|
||||||
__tauriModule: "Window",
|
__tauriModule: "Window",
|
||||||
|
@ -1661,6 +1709,48 @@ var WindowManager = class extends WebviewWindowHandle {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
async isMaximizable() {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Window",
|
||||||
|
message: {
|
||||||
|
cmd: "manage",
|
||||||
|
data: {
|
||||||
|
label: this.label,
|
||||||
|
cmd: {
|
||||||
|
type: "isMaximizable"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async isMinimizable() {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Window",
|
||||||
|
message: {
|
||||||
|
cmd: "manage",
|
||||||
|
data: {
|
||||||
|
label: this.label,
|
||||||
|
cmd: {
|
||||||
|
type: "isMinimizable"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async isClosable() {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Window",
|
||||||
|
message: {
|
||||||
|
cmd: "manage",
|
||||||
|
data: {
|
||||||
|
label: this.label,
|
||||||
|
cmd: {
|
||||||
|
type: "isClosable"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
async isVisible() {
|
async isVisible() {
|
||||||
return invokeTauriCommand({
|
return invokeTauriCommand({
|
||||||
__tauriModule: "Window",
|
__tauriModule: "Window",
|
||||||
|
@ -1675,6 +1765,20 @@ var WindowManager = class extends WebviewWindowHandle {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
async title() {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Window",
|
||||||
|
message: {
|
||||||
|
cmd: "manage",
|
||||||
|
data: {
|
||||||
|
label: this.label,
|
||||||
|
cmd: {
|
||||||
|
type: "title"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
async theme() {
|
async theme() {
|
||||||
return invokeTauriCommand({
|
return invokeTauriCommand({
|
||||||
__tauriModule: "Window",
|
__tauriModule: "Window",
|
||||||
|
@ -1741,6 +1845,51 @@ var WindowManager = class extends WebviewWindowHandle {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
async setMaximizable(maximizable) {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Window",
|
||||||
|
message: {
|
||||||
|
cmd: "manage",
|
||||||
|
data: {
|
||||||
|
label: this.label,
|
||||||
|
cmd: {
|
||||||
|
type: "setMaximizable",
|
||||||
|
payload: maximizable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async setMinimizable(minimizable) {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Window",
|
||||||
|
message: {
|
||||||
|
cmd: "manage",
|
||||||
|
data: {
|
||||||
|
label: this.label,
|
||||||
|
cmd: {
|
||||||
|
type: "setMinimizable",
|
||||||
|
payload: minimizable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async setClosable(closable) {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Window",
|
||||||
|
message: {
|
||||||
|
cmd: "manage",
|
||||||
|
data: {
|
||||||
|
label: this.label,
|
||||||
|
cmd: {
|
||||||
|
type: "setClosable",
|
||||||
|
payload: closable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
async setTitle(title) {
|
async setTitle(title) {
|
||||||
return invokeTauriCommand({
|
return invokeTauriCommand({
|
||||||
__tauriModule: "Window",
|
__tauriModule: "Window",
|
||||||
|
@ -1898,6 +2047,21 @@ var WindowManager = class extends WebviewWindowHandle {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
async setContentProtected(protected_) {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Window",
|
||||||
|
message: {
|
||||||
|
cmd: "manage",
|
||||||
|
data: {
|
||||||
|
label: this.label,
|
||||||
|
cmd: {
|
||||||
|
type: "setContentProtected",
|
||||||
|
payload: protected_
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
async setSize(size) {
|
async setSize(size) {
|
||||||
if (!size || size.type !== "Logical" && size.type !== "Physical") {
|
if (!size || size.type !== "Logical" && size.type !== "Physical") {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
@ -2164,10 +2328,16 @@ var WindowManager = class extends WebviewWindowHandle {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
async onResized(handler) {
|
async onResized(handler) {
|
||||||
return this.listen("tauri://resize" /* WINDOW_RESIZED */, handler);
|
return this.listen("tauri://resize" /* WINDOW_RESIZED */, (e) => {
|
||||||
|
e.payload = mapPhysicalSize(e.payload);
|
||||||
|
handler(e);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
async onMoved(handler) {
|
async onMoved(handler) {
|
||||||
return this.listen("tauri://move" /* WINDOW_MOVED */, handler);
|
return this.listen("tauri://move" /* WINDOW_MOVED */, (e) => {
|
||||||
|
e.payload = mapPhysicalPosition(e.payload);
|
||||||
|
handler(e);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
async onCloseRequested(handler) {
|
async onCloseRequested(handler) {
|
||||||
return this.listen("tauri://close-requested" /* WINDOW_CLOSE_REQUESTED */, (event) => {
|
return this.listen("tauri://close-requested" /* WINDOW_CLOSE_REQUESTED */, (event) => {
|
||||||
|
@ -2273,6 +2443,14 @@ var WebviewWindow = class extends WindowManager {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
static async getFocusedWindow() {
|
||||||
|
for (const w of getAll()) {
|
||||||
|
if (await w.isFocused()) {
|
||||||
|
return w;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
var appWindow;
|
var appWindow;
|
||||||
if ("__TAURI_METADATA__" in window) {
|
if ("__TAURI_METADATA__" in window) {
|
||||||
|
@ -2295,10 +2473,16 @@ function mapMonitor(m) {
|
||||||
return m === null ? null : {
|
return m === null ? null : {
|
||||||
name: m.name,
|
name: m.name,
|
||||||
scaleFactor: m.scaleFactor,
|
scaleFactor: m.scaleFactor,
|
||||||
position: new PhysicalPosition(m.position.x, m.position.y),
|
position: mapPhysicalPosition(m.position),
|
||||||
size: new PhysicalSize(m.size.width, m.size.height)
|
size: mapPhysicalSize(m.size)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
function mapPhysicalPosition(m) {
|
||||||
|
return new PhysicalPosition(m.x, m.y);
|
||||||
|
}
|
||||||
|
function mapPhysicalSize(m) {
|
||||||
|
return new PhysicalSize(m.width, m.height);
|
||||||
|
}
|
||||||
async function currentMonitor() {
|
async function currentMonitor() {
|
||||||
return invokeTauriCommand({
|
return invokeTauriCommand({
|
||||||
__tauriModule: "Window",
|
__tauriModule: "Window",
|
||||||
|
@ -2344,6 +2528,7 @@ var os_exports = {};
|
||||||
__export(os_exports, {
|
__export(os_exports, {
|
||||||
EOL: () => EOL,
|
EOL: () => EOL,
|
||||||
arch: () => arch,
|
arch: () => arch,
|
||||||
|
locale: () => locale,
|
||||||
platform: () => platform,
|
platform: () => platform,
|
||||||
tempdir: () => tempdir,
|
tempdir: () => tempdir,
|
||||||
type: () => type,
|
type: () => type,
|
||||||
|
@ -2390,6 +2575,14 @@ async function tempdir() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
async function locale() {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Os",
|
||||||
|
message: {
|
||||||
|
cmd: "locale"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// tauri/tooling/api/src/index.ts
|
// tauri/tooling/api/src/index.ts
|
||||||
var invoke2 = invoke;
|
var invoke2 = invoke;
|
||||||
|
|
16
src/mocks.js
16
src/mocks.js
|
@ -19,12 +19,24 @@ function mockWindows(current, ...additionalWindows) {
|
||||||
__currentWindow: { label: current }
|
__currentWindow: { label: current }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
function mockConvertFileSrc(osName, windowsProtocolScheme = "https") {
|
||||||
|
window.__TAURI__ = window.__TAURI__ ?? {};
|
||||||
|
window.__TAURI__.convertFileSrc = function(filePath, protocol = "asset") {
|
||||||
|
const path = encodeURIComponent(filePath);
|
||||||
|
return osName === "windows" ? `${windowsProtocolScheme}://${protocol}.localhost/${path}` : `${protocol}://localhost/${path}`;
|
||||||
|
};
|
||||||
|
}
|
||||||
function clearMocks() {
|
function clearMocks() {
|
||||||
delete window.__TAURI_IPC__;
|
if (window.__TAURI__?.convertFileSrc)
|
||||||
delete window.__TAURI_METADATA__;
|
delete window.__TAURI__.convertFileSrc;
|
||||||
|
if (window.__TAURI_IPC__)
|
||||||
|
delete window.__TAURI_IPC__;
|
||||||
|
if (window.__TAURI_METADATA__)
|
||||||
|
delete window.__TAURI_METADATA__;
|
||||||
}
|
}
|
||||||
export {
|
export {
|
||||||
clearMocks,
|
clearMocks,
|
||||||
|
mockConvertFileSrc,
|
||||||
mockIPC,
|
mockIPC,
|
||||||
mockWindows
|
mockWindows
|
||||||
};
|
};
|
||||||
|
|
|
@ -88,9 +88,18 @@ async function tempdir() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
async function locale() {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Os",
|
||||||
|
message: {
|
||||||
|
cmd: "locale"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
export {
|
export {
|
||||||
EOL,
|
EOL,
|
||||||
arch,
|
arch,
|
||||||
|
locale,
|
||||||
platform,
|
platform,
|
||||||
tempdir,
|
tempdir,
|
||||||
type,
|
type,
|
||||||
|
|
|
@ -36,8 +36,7 @@ async function invoke(cmd, args = {}) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function convertFileSrc(filePath, protocol = "asset") {
|
function convertFileSrc(filePath, protocol = "asset") {
|
||||||
const path = encodeURIComponent(filePath);
|
return window.__TAURI__.convertFileSrc(filePath, protocol);
|
||||||
return navigator.userAgent.includes("Windows") ? `https://${protocol}.localhost/${path}` : `${protocol}://localhost/${path}`;
|
|
||||||
}
|
}
|
||||||
export {
|
export {
|
||||||
convertFileSrc,
|
convertFileSrc,
|
||||||
|
|
|
@ -113,11 +113,12 @@ async function installUpdate() {
|
||||||
function onStatusChange(statusResult) {
|
function onStatusChange(statusResult) {
|
||||||
if (statusResult.error) {
|
if (statusResult.error) {
|
||||||
cleanListener();
|
cleanListener();
|
||||||
return reject(statusResult.error);
|
reject(statusResult.error);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (statusResult.status === "DONE") {
|
if (statusResult.status === "DONE") {
|
||||||
cleanListener();
|
cleanListener();
|
||||||
return resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onUpdaterEvent(onStatusChange).then((fn) => {
|
onUpdaterEvent(onStatusChange).then((fn) => {
|
||||||
|
@ -143,7 +144,7 @@ async function checkUpdate() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
function onUpdateAvailable(manifest) {
|
function onUpdateAvailable(manifest) {
|
||||||
cleanListener();
|
cleanListener();
|
||||||
return resolve({
|
resolve({
|
||||||
manifest,
|
manifest,
|
||||||
shouldUpdate: true
|
shouldUpdate: true
|
||||||
});
|
});
|
||||||
|
@ -151,11 +152,12 @@ async function checkUpdate() {
|
||||||
function onStatusChange(statusResult) {
|
function onStatusChange(statusResult) {
|
||||||
if (statusResult.error) {
|
if (statusResult.error) {
|
||||||
cleanListener();
|
cleanListener();
|
||||||
return reject(statusResult.error);
|
reject(statusResult.error);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (statusResult.status === "UPTODATE") {
|
if (statusResult.status === "UPTODATE") {
|
||||||
cleanListener();
|
cleanListener();
|
||||||
return resolve({
|
resolve({
|
||||||
shouldUpdate: false
|
shouldUpdate: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
172
src/window.js
172
src/window.js
|
@ -266,6 +266,20 @@ var WindowManager = class extends WebviewWindowHandle {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
async isMinimized() {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Window",
|
||||||
|
message: {
|
||||||
|
cmd: "manage",
|
||||||
|
data: {
|
||||||
|
label: this.label,
|
||||||
|
cmd: {
|
||||||
|
type: "isMinimized"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
async isMaximized() {
|
async isMaximized() {
|
||||||
return invokeTauriCommand({
|
return invokeTauriCommand({
|
||||||
__tauriModule: "Window",
|
__tauriModule: "Window",
|
||||||
|
@ -280,6 +294,20 @@ var WindowManager = class extends WebviewWindowHandle {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
async isFocused() {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Window",
|
||||||
|
message: {
|
||||||
|
cmd: "manage",
|
||||||
|
data: {
|
||||||
|
label: this.label,
|
||||||
|
cmd: {
|
||||||
|
type: "isFocused"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
async isDecorated() {
|
async isDecorated() {
|
||||||
return invokeTauriCommand({
|
return invokeTauriCommand({
|
||||||
__tauriModule: "Window",
|
__tauriModule: "Window",
|
||||||
|
@ -308,6 +336,48 @@ var WindowManager = class extends WebviewWindowHandle {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
async isMaximizable() {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Window",
|
||||||
|
message: {
|
||||||
|
cmd: "manage",
|
||||||
|
data: {
|
||||||
|
label: this.label,
|
||||||
|
cmd: {
|
||||||
|
type: "isMaximizable"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async isMinimizable() {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Window",
|
||||||
|
message: {
|
||||||
|
cmd: "manage",
|
||||||
|
data: {
|
||||||
|
label: this.label,
|
||||||
|
cmd: {
|
||||||
|
type: "isMinimizable"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async isClosable() {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Window",
|
||||||
|
message: {
|
||||||
|
cmd: "manage",
|
||||||
|
data: {
|
||||||
|
label: this.label,
|
||||||
|
cmd: {
|
||||||
|
type: "isClosable"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
async isVisible() {
|
async isVisible() {
|
||||||
return invokeTauriCommand({
|
return invokeTauriCommand({
|
||||||
__tauriModule: "Window",
|
__tauriModule: "Window",
|
||||||
|
@ -322,6 +392,20 @@ var WindowManager = class extends WebviewWindowHandle {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
async title() {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Window",
|
||||||
|
message: {
|
||||||
|
cmd: "manage",
|
||||||
|
data: {
|
||||||
|
label: this.label,
|
||||||
|
cmd: {
|
||||||
|
type: "title"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
async theme() {
|
async theme() {
|
||||||
return invokeTauriCommand({
|
return invokeTauriCommand({
|
||||||
__tauriModule: "Window",
|
__tauriModule: "Window",
|
||||||
|
@ -388,6 +472,51 @@ var WindowManager = class extends WebviewWindowHandle {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
async setMaximizable(maximizable) {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Window",
|
||||||
|
message: {
|
||||||
|
cmd: "manage",
|
||||||
|
data: {
|
||||||
|
label: this.label,
|
||||||
|
cmd: {
|
||||||
|
type: "setMaximizable",
|
||||||
|
payload: maximizable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async setMinimizable(minimizable) {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Window",
|
||||||
|
message: {
|
||||||
|
cmd: "manage",
|
||||||
|
data: {
|
||||||
|
label: this.label,
|
||||||
|
cmd: {
|
||||||
|
type: "setMinimizable",
|
||||||
|
payload: minimizable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async setClosable(closable) {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Window",
|
||||||
|
message: {
|
||||||
|
cmd: "manage",
|
||||||
|
data: {
|
||||||
|
label: this.label,
|
||||||
|
cmd: {
|
||||||
|
type: "setClosable",
|
||||||
|
payload: closable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
async setTitle(title) {
|
async setTitle(title) {
|
||||||
return invokeTauriCommand({
|
return invokeTauriCommand({
|
||||||
__tauriModule: "Window",
|
__tauriModule: "Window",
|
||||||
|
@ -545,6 +674,21 @@ var WindowManager = class extends WebviewWindowHandle {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
async setContentProtected(protected_) {
|
||||||
|
return invokeTauriCommand({
|
||||||
|
__tauriModule: "Window",
|
||||||
|
message: {
|
||||||
|
cmd: "manage",
|
||||||
|
data: {
|
||||||
|
label: this.label,
|
||||||
|
cmd: {
|
||||||
|
type: "setContentProtected",
|
||||||
|
payload: protected_
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
async setSize(size) {
|
async setSize(size) {
|
||||||
if (!size || size.type !== "Logical" && size.type !== "Physical") {
|
if (!size || size.type !== "Logical" && size.type !== "Physical") {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
@ -811,10 +955,16 @@ var WindowManager = class extends WebviewWindowHandle {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
async onResized(handler) {
|
async onResized(handler) {
|
||||||
return this.listen("tauri://resize" /* WINDOW_RESIZED */, handler);
|
return this.listen("tauri://resize" /* WINDOW_RESIZED */, (e) => {
|
||||||
|
e.payload = mapPhysicalSize(e.payload);
|
||||||
|
handler(e);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
async onMoved(handler) {
|
async onMoved(handler) {
|
||||||
return this.listen("tauri://move" /* WINDOW_MOVED */, handler);
|
return this.listen("tauri://move" /* WINDOW_MOVED */, (e) => {
|
||||||
|
e.payload = mapPhysicalPosition(e.payload);
|
||||||
|
handler(e);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
async onCloseRequested(handler) {
|
async onCloseRequested(handler) {
|
||||||
return this.listen("tauri://close-requested" /* WINDOW_CLOSE_REQUESTED */, (event) => {
|
return this.listen("tauri://close-requested" /* WINDOW_CLOSE_REQUESTED */, (event) => {
|
||||||
|
@ -920,6 +1070,14 @@ var WebviewWindow = class extends WindowManager {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
static async getFocusedWindow() {
|
||||||
|
for (const w of getAll()) {
|
||||||
|
if (await w.isFocused()) {
|
||||||
|
return w;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
var appWindow;
|
var appWindow;
|
||||||
if ("__TAURI_METADATA__" in window) {
|
if ("__TAURI_METADATA__" in window) {
|
||||||
|
@ -942,10 +1100,16 @@ function mapMonitor(m) {
|
||||||
return m === null ? null : {
|
return m === null ? null : {
|
||||||
name: m.name,
|
name: m.name,
|
||||||
scaleFactor: m.scaleFactor,
|
scaleFactor: m.scaleFactor,
|
||||||
position: new PhysicalPosition(m.position.x, m.position.y),
|
position: mapPhysicalPosition(m.position),
|
||||||
size: new PhysicalSize(m.size.width, m.size.height)
|
size: mapPhysicalSize(m.size)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
function mapPhysicalPosition(m) {
|
||||||
|
return new PhysicalPosition(m.x, m.y);
|
||||||
|
}
|
||||||
|
function mapPhysicalSize(m) {
|
||||||
|
return new PhysicalSize(m.width, m.height);
|
||||||
|
}
|
||||||
async function currentMonitor() {
|
async function currentMonitor() {
|
||||||
return invokeTauriCommand({
|
return invokeTauriCommand({
|
||||||
__tauriModule: "Window",
|
__tauriModule: "Window",
|
||||||
|
|
2
tauri
2
tauri
|
@ -1 +1 @@
|
||||||
Subproject commit 19019e4eb627e1c2191a1f0455239c32d2248bf5
|
Subproject commit f9c97b7e5b05dfdf79eae2cb9b63f55c9184d82f
|
Loading…
Add table
Reference in a new issue