diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..24e33a9 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,52 @@ +name: Test + +on: + push: + branches: + - main + paths: + - '.github/workflows/test.yml' + - 'src/**' + - 'examples/test/**' + pull_request: + branches: + - main + paths: + - '.github/workflows/test.yml' + - 'src/**' + - 'examples/test/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-and-test: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v3 + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + target: wasm32-unknown-unknown + - uses: Swatinem/rust-cache@v1 + - name: Install native deps + run: | + sudo apt-get update + sudo apt-get install -y webkit2gtk-4.0 at-spi2-core + - name: Install Tauri CLI + run: | + cd examples/test + wget -qO- https://github.com/tauri-apps/tauri/releases/download/cli.rs-v1.2.0/cargo-tauri-x86_64-unknown-linux-gnu.tgz | tar -xzf- -C ~/.cargo/bin + - name: Install Trunk + run: | + cd examples/test + wget -qO- https://github.com/thedodd/trunk/releases/download/v0.16.0/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf- -C ~/.cargo/bin + - name: Run test app + run: | + cd examples/test + export CARGO_UNSTABLE_SPARSE_REGISTRY=true + xvfb-run cargo tauri dev --exit-on-panic --config ./src-tauri/ci.tauri.conf.json diff --git a/Cargo.lock b/Cargo.lock index 305ed81..d57e8e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,18 +2,313 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "adler32" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.8", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "anyhow" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" + +[[package]] +name = "atk" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c3d816ce6f0e2909a96830d6911c2aff044370b1ef92d7f267b43bae5addedd" +dependencies = [ + "atk-sys", + "bitflags", + "glib", + "libc", +] + +[[package]] +name = "atk-sys" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58aeb089fb698e06db8089971c7ee317ab9644bade33383f63631437b03aafb6" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.0.3", +] + +[[package]] +name = "attohttpc" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fcf00bc6d5abb29b5f97e3c61a90b6d3caa12f3faf897d4a3e3607c050a35a7" +dependencies = [ + "flate2", + "http", + "log", + "native-tls", + "serde", + "serde_json", + "serde_urlencoded", + "url", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array", +] + +[[package]] +name = "brotli" +version = "3.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ad2d4653bf5ca36ae797b1f4bb4dbddb60ce49ca4aed8a2ce4829f60425b80" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bstr" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +dependencies = [ + "memchr", +] + [[package]] name = "bumpalo" version = "3.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" +[[package]] +name = "bytemuck" +version = "1.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aec14f5d4e6e3f927cd0c81f72e5710d95ee9019fbeb4b3021193867491bfd8" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" + +[[package]] +name = "cairo-rs" +version = "0.15.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c76ee391b03d35510d9fa917357c7f1855bd9a6659c95a1b392e33f49b3369bc" +dependencies = [ + "bitflags", + "cairo-sys-rs", + "glib", + "libc", + "thiserror", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c55d429bef56ac9172d25fecb85dc8068307d17acd74b377866b7a1ef25d3c8" +dependencies = [ + "glib-sys", + "libc", + "system-deps 6.0.3", +] + +[[package]] +name = "cargo_toml" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa0e3586af56b3bfa51fca452bd56e8dbbbd5d8d81cbf0b7e4e35b695b537eb8" +dependencies = [ + "serde", + "toml", +] + +[[package]] +name = "cc" +version = "1.0.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581f5dba903aac52ea3feb5ec4810848460ee833876f1f9b0fdeab1f19091574" + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfb" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74f89d248799e3f15f91b70917f65381062a01bb8e222700ea0e5a7ff9785f9c" +dependencies = [ + "byteorder", + "uuid 0.8.2", +] + +[[package]] +name = "cfg-expr" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3431df59f28accaf4cb4eed4a9acc66bea3f3c3753aa6cdc2f024174ef232af7" +dependencies = [ + "smallvec", +] + +[[package]] +name = "cfg-expr" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0357a6402b295ca3a86bc148e84df46c02e41f41fef186bda662557ef6328aa" +dependencies = [ + "smallvec", +] + [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cocoa" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" +dependencies = [ + "bitflags", + "block", + "cocoa-foundation", + "core-foundation", + "core-graphics", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" +dependencies = [ + "bitflags", + "block", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "combine" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +dependencies = [ + "bytes", + "memchr", +] + [[package]] name = "console_error_panic_hook" version = "0.1.7" @@ -24,6 +319,347 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "core-graphics" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" +dependencies = [ + "bitflags", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" +dependencies = [ + "bitflags", + "core-foundation", + "foreign-types", + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cssparser" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754b69d351cdc2d8ee09ae203db831e005560fc6030da058f86ad60c92a9cb0a" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa 0.4.8", + "matches", + "phf 0.8.0", + "proc-macro2", + "quote", + "smallvec", + "syn", +] + +[[package]] +name = "cssparser-macros" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfae75de57f2b2e85e8768c3ea840fd159c8f33e2b6522c7835b7abac81be16e" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "ctor" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "cty" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" + +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "dbus" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f8bcdd56d2e5c4ed26a529c5a9029f5db8290d433497506f958eae3be148eb6" +dependencies = [ + "libc", + "libdbus-sys", + "winapi", +] + +[[package]] +name = "deflate" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" +dependencies = [ + "adler32", + "byteorder", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version 0.4.0", + "syn", +] + +[[package]] +name = "digest" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + +[[package]] +name = "dtoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" + +[[package]] +name = "dtoa-short" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bde03329ae10e79ede66c9ce4dc930aa8599043b0743008548680f25b91502d6" +dependencies = [ + "dtoa", +] + +[[package]] +name = "dunce" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bd4b30a6560bbd9b4620f4de34c3f14f60848e58a9b7216801afcb4c7b31c3c" + +[[package]] +name = "embed_plist" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" + +[[package]] +name = "encoding_rs" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "fastrand" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +dependencies = [ + "instant", +] + +[[package]] +name = "field-offset" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e1c54951450cbd39f3dbcf1005ac413b49487dabf18a720ad2383eccfeffb92" +dependencies = [ + "memoffset", + "rustc_version 0.3.3", +] + +[[package]] +name = "filetime" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b9663d381d07ae25dc88dbdf27df458faa83a9b25336bcac83d5e452b5fc9d3" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "windows-sys 0.42.0", +] + +[[package]] +name = "flate2" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" +dependencies = [ + "crc32fast", + "miniz_oxide 0.5.4", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "form_urlencoded" version = "1.1.0" @@ -33,6 +669,477 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "futf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" +dependencies = [ + "mac", + "new_debug_unreachable", +] + +[[package]] +name = "futures" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" + +[[package]] +name = "futures-executor" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" + +[[package]] +name = "futures-macro" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" + +[[package]] +name = "futures-task" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" + +[[package]] +name = "futures-util" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "gdk" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6e05c1f572ab0e1f15be94217f0dc29088c248b14f792a5ff0af0d84bcda9e8" +dependencies = [ + "bitflags", + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "libc", + "pango", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad38dd9cc8b099cceecdf41375bb6d481b1b5a7cd5cd603e10a69a9383f8619a" +dependencies = [ + "bitflags", + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "140b2f5378256527150350a8346dbdb08fadc13453a7a2d73aecd5fab3c402a7" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.0.3", +] + +[[package]] +name = "gdk-sys" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e7a08c1e8f06f4177fb7e51a777b8c1689f743a7bc11ea91d44d2226073a88" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", + "system-deps 6.0.3", +] + +[[package]] +name = "gdkx11-sys" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4b7f8c7a84b407aa9b143877e267e848ff34106578b64d1e0a24bf550716178" +dependencies = [ + "gdk-sys", + "glib-sys", + "libc", + "system-deps 6.0.3", + "x11", +] + +[[package]] +name = "generator" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc184cace1cea8335047a471cc1da80f18acf8a76f3bab2028d499e328948ec7" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "windows 0.32.0", +] + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "gio" +version = "0.15.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68fdbc90312d462781a395f7a16d96a2b379bb6ef8cd6310a2df272771c4283b" +dependencies = [ + "bitflags", + "futures-channel", + "futures-core", + "futures-io", + "gio-sys", + "glib", + "libc", + "once_cell", + "thiserror", +] + +[[package]] +name = "gio-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32157a475271e2c4a023382e9cab31c4584ee30a97da41d3c4e9fdd605abcf8d" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.0.3", + "winapi", +] + +[[package]] +name = "glib" +version = "0.15.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edb0306fbad0ab5428b0ca674a23893db909a98582969c9b537be4ced78c505d" +dependencies = [ + "bitflags", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "once_cell", + "smallvec", + "thiserror", +] + +[[package]] +name = "glib-macros" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a68131a662b04931e71891fb14aaf65ee4b44d08e8abc10f49e77418c86c64" +dependencies = [ + "anyhow", + "heck 0.4.0", + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "glib-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef4b192f8e65e9cf76cbf4ea71fa8e3be4a0e18ffe3d68b8da6836974cc5bad4" +dependencies = [ + "libc", + "system-deps 6.0.3", +] + +[[package]] +name = "glob" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" + +[[package]] +name = "globset" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a" +dependencies = [ + "aho-corasick", + "bstr", + "fnv", + "log", + "regex", +] + +[[package]] +name = "gobject-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d57ce44246becd17153bd035ab4d32cfee096a657fc01f2231c9278378d1e0a" +dependencies = [ + "glib-sys", + "libc", + "system-deps 6.0.3", +] + +[[package]] +name = "gtk" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e3004a2d5d6d8b5057d2b57b3712c9529b62e82c77f25c1fecde1fd5c23bd0" +dependencies = [ + "atk", + "bitflags", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib", + "gtk-sys", + "gtk3-macros", + "libc", + "once_cell", + "pango", + "pkg-config", +] + +[[package]] +name = "gtk-sys" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5bc2f0587cba247f60246a0ca11fe25fb733eabc3de12d1965fc07efab87c84" +dependencies = [ + "atk-sys", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "system-deps 6.0.3", +] + +[[package]] +name = "gtk3-macros" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24f518afe90c23fba585b2d7697856f9e6a7bbc62f65588035e66f6afb01a2e9" +dependencies = [ + "anyhow", + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "html-escape" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15315cfa9503e9aa85a477138eff76a1b203a430703548052c330b69d8d8c205" +dependencies = [ + "utf8-width", +] + +[[package]] +name = "html5ever" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5c13fb08e5d4dfc151ee5e88bae63f7773d61852f3bdc73c9f4b9e1bde03148" +dependencies = [ + "log", + "mac", + "markup5ever", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa 1.0.4", +] + +[[package]] +name = "http-range" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" + +[[package]] +name = "ico" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a4b3331534254a9b64095ae60d3dc2a8225a7a70229cd5888be127cdc1f6804" +dependencies = [ + "byteorder", + "png 0.11.0", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.3.0" @@ -43,12 +1150,129 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "ignore" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "713f1b139373f96a2e0ce3ac931cd01ee973c3c5dd7c40c0c2efe96ad2b6751d" +dependencies = [ + "crossbeam-utils", + "globset", + "lazy_static", + "log", + "memchr", + "regex", + "same-file", + "thread_local", + "walkdir", + "winapi-util", +] + +[[package]] +name = "image" +version = "0.24.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd8e4fb07cf672b1642304e731ef8a6a4c7891d67bb4fd4f5ce58cd6ed86803c" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "num-rational", + "num-traits", +] + +[[package]] +name = "indexmap" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "infer" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20b2b533137b9cad970793453d4f921c2e91312a6d88b1085c07bc15fc51bb3b" +dependencies = [ + "cfb", +] + +[[package]] +name = "inflate" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5f9f47468e9a76a6452271efadc88fe865a82be91fe75e6c0c57b87ccea59d4" +dependencies = [ + "adler32", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + [[package]] name = "itoa" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" +[[package]] +name = "javascriptcore-rs" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf053e7843f2812ff03ef5afe34bb9c06ffee120385caad4f6b9967fcd37d41c" +dependencies = [ + "bitflags", + "glib", + "javascriptcore-rs-sys", +] + +[[package]] +name = "javascriptcore-rs-sys" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "905fbb87419c5cde6e3269537e4ea7d46431f3008c5d057e915ef3f115e7793c" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 5.0.0", +] + +[[package]] +name = "jni" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "039022cdf4d7b1cf548d31f60ae783138e5fd42013f6271049d7df7afadef96c" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + [[package]] name = "js-sys" version = "0.3.60" @@ -58,6 +1282,69 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "json-patch" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f995a3c8f2bc3dd52a18a583e90f9ec109c047fa1603a853e46bcda14d2e279d" +dependencies = [ + "serde", + "serde_json", + "treediff", +] + +[[package]] +name = "kuchiki" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ea8e9c6e031377cff82ee3001dc8026cdf431ed4e2e6b51f98ab8c73484a358" +dependencies = [ + "cssparser", + "html5ever", + "matches", + "selectors", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.137" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" + +[[package]] +name = "libdbus-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c185b5b7ad900923ef3a8ff594083d4d9b5aea80bb4f32b8342363138c0d456b" +dependencies = [ + "pkg-config", +] + +[[package]] +name = "line-wrap" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9" +dependencies = [ + "safemem", +] + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + [[package]] name = "log" version = "0.4.17" @@ -67,18 +1354,681 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "loom" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "serde", + "serde_json", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "mac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" + +[[package]] +name = "mac-notification-sys" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e72d50edb17756489e79d52eb146927bec8eba9dd48faadf9ef08bca3791ad5" +dependencies = [ + "cc", + "dirs-next", + "objc-foundation", + "objc_id", + "time", +] + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "markup5ever" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a24f40fb03852d1cdd84330cddcaf98e9ec08a7b7768e952fad3b4cf048ec8fd" +dependencies = [ + "log", + "phf 0.8.0", + "phf_codegen", + "string_cache", + "string_cache_codegen", + "tendril", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "matches" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "miniz_oxide" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" +dependencies = [ + "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +dependencies = [ + "adler", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "ndk" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" +dependencies = [ + "bitflags", + "jni-sys", + "ndk-sys", + "num_enum", + "thiserror", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + +[[package]] +name = "notify-rust" +version = "4.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368e89ea58df747ce88be669ae44e79783c1d30bfd540ad0fc520b3f41f0b3b0" +dependencies = [ + "dbus", + "mac-notification-sys", + "tauri-winrt-notification", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", + "objc_exception", +] + +[[package]] +name = "objc-foundation" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +dependencies = [ + "block", + "objc", + "objc_id", +] + +[[package]] +name = "objc_exception" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +dependencies = [ + "cc", +] + +[[package]] +name = "objc_id" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +dependencies = [ + "objc", +] + [[package]] name = "once_cell" version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +[[package]] +name = "open" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4a3100141f1733ea40b53381b0ae3117330735ef22309a190ac57b9576ea716" +dependencies = [ + "pathdiff", + "windows-sys 0.36.1", +] + +[[package]] +name = "openssl" +version = "0.10.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a" +dependencies = [ + "autocfg", + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "os_info" +version = "3.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4750134fb6a5d49afc80777394ad5d95b04bc12068c6abb92fae8f43817270f" +dependencies = [ + "log", + "serde", + "winapi", +] + +[[package]] +name = "os_pipe" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dceb7e43f59c35ee1548045b2c72945a5a3bb6ce6d6f07cdc13dc8f6bc4930a" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "pango" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e4045548659aee5313bde6c582b0d83a627b7904dd20dc2d9ef0895d414e4f" +dependencies = [ + "bitflags", + "glib", + "libc", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2a00081cde4661982ed91d80ef437c20eacaf6aa1a5962c0279ae194662c3aa" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.0.3", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys 0.42.0", +] + +[[package]] +name = "paste" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" + +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + [[package]] name = "percent-encoding" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +[[package]] +name = "pest" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc7bc69c062e492337d74d59b120c274fd3d261b6bf6d3207d499b4b379c41a" +dependencies = [ + "thiserror", + "ucd-trie", +] + +[[package]] +name = "phf" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" +dependencies = [ + "phf_macros 0.8.0", + "phf_shared 0.8.0", + "proc-macro-hack", +] + +[[package]] +name = "phf" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" +dependencies = [ + "phf_macros 0.10.0", + "phf_shared 0.10.0", + "proc-macro-hack", +] + +[[package]] +name = "phf_codegen" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", +] + +[[package]] +name = "phf_generator" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" +dependencies = [ + "phf_shared 0.8.0", + "rand 0.7.3", +] + +[[package]] +name = "phf_generator" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" +dependencies = [ + "phf_shared 0.10.0", + "rand 0.8.5", +] + +[[package]] +name = "phf_macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fde18ff429ffc8fe78e2bf7f8b7a5a5a6e2a8b58bc5a9ac69198bbda9189c" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "phf_macros" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "phf_shared" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" +dependencies = [ + "siphasher", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + +[[package]] +name = "plist" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd39bc6cdc9355ad1dc5eeedefee696bb35c34caf21768741e81826c0bbd7225" +dependencies = [ + "base64", + "indexmap", + "line-wrap", + "serde", + "time", + "xml-rs", +] + +[[package]] +name = "png" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0b0cabbbd20c2d7f06dbf015e06aad59b6ca3d9ed14848783e98af9aaf19925" +dependencies = [ + "bitflags", + "deflate", + "inflate", + "num-iter", +] + +[[package]] +name = "png" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d708eaf860a19b19ce538740d2b4bdeeb8337fa53f7738455e706623ad5c638" +dependencies = [ + "bitflags", + "crc32fast", + "flate2", + "miniz_oxide 0.6.2", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "proc-macro-crate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" +dependencies = [ + "once_cell", + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" + [[package]] name = "proc-macro2" version = "1.0.47" @@ -88,6 +2038,15 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quick-xml" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11bafc859c6815fbaffbbbf4229ecb767ac913fecb27f9ad4343662e9ef099ea" +dependencies = [ + "memchr", +] + [[package]] name = "quote" version = "1.0.21" @@ -97,23 +2056,311 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", + "rand_pcg", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.8", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_pcg" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "raw-window-handle" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed7e3d950b66e19e0c372f3fa3fbbcf85b1746b571f74e0c2af6042a5c93420a" +dependencies = [ + "cty", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom 0.2.8", + "redox_syscall", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "rfd" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0149778bd99b6959285b0933288206090c50e2327f47a9c463bfdbf45c8823ea" +dependencies = [ + "block", + "dispatch", + "glib-sys", + "gobject-sys", + "gtk-sys", + "js-sys", + "lazy_static", + "log", + "objc", + "objc-foundation", + "objc_id", + "raw-window-handle", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows 0.37.0", +] + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.14", +] + +[[package]] +name = "rustversion" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" + [[package]] name = "ryu" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +[[package]] +name = "safemem" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +dependencies = [ + "lazy_static", + "windows-sys 0.36.1", +] + [[package]] name = "scoped-tls" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "security-framework" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "selectors" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df320f1889ac4ba6bc0cdc9c9af7af4bd64bb927bccdf32d81140dc1f9be12fe" +dependencies = [ + "bitflags", + "cssparser", + "derive_more", + "fxhash", + "log", + "matches", + "phf 0.8.0", + "phf_codegen", + "precomputed-hash", + "servo_arc", + "smallvec", + "thin-slice", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + [[package]] name = "semver" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" +dependencies = [ + "serde", +] + +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] [[package]] name = "serde" @@ -152,11 +2399,322 @@ version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" dependencies = [ - "itoa", + "itoa 1.0.4", "ryu", "serde", ] +[[package]] +name = "serde_repr" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fe39d9fbb0ebf5eb2c7cb7e2a47e4f462fad1379f1166b8ae49ad9eae89a7ca" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa 1.0.4", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" +dependencies = [ + "serde", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serialize-to-javascript" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9823f2d3b6a81d98228151fdeaf848206a7855a7a042bbf9bf870449a66cafb" +dependencies = [ + "serde", + "serde_json", + "serialize-to-javascript-impl", +] + +[[package]] +name = "serialize-to-javascript-impl" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74064874e9f6a15f04c1f3cb627902d0e6b410abbf36668afa873c61889f1763" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "servo_arc" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98238b800e0d1576d8b6e3de32827c2d74bee68bb97748dcf5071fb53965432" +dependencies = [ + "nodrop", + "stable_deref_trait", +] + +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shared_child" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0d94659ad3c2137fef23ae75b03d5241d633f8acded53d672decfa0e6e0caef" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "siphasher" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + +[[package]] +name = "slotmap" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +dependencies = [ + "version_check", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "soup2" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b4d76501d8ba387cf0fefbe055c3e0a59891d09f0f995ae4e4b16f6b60f3c0" +dependencies = [ + "bitflags", + "gio", + "glib", + "libc", + "once_cell", + "soup2-sys", +] + +[[package]] +name = "soup2-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "009ef427103fcb17f802871647a7fa6c60cbb654b4c4e4c0ac60a31c5f6dc9cf" +dependencies = [ + "bitflags", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps 5.0.0", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "state" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbe866e1e51e8260c9eed836a042a5e7f6726bb2b411dffeaa712e19c388f23b" +dependencies = [ + "loom", +] + +[[package]] +name = "string_cache" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213494b7a2b503146286049378ce02b482200519accc31872ee8be91fa820a08" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot", + "phf_shared 0.10.0", + "precomputed-hash", + "serde", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", + "proc-macro2", + "quote", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strum" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7ac893c7d471c8a21f31cfe213ec4f6d9afeed25537c772e08ef3f005f8729e" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339f799d8b549e3744c7ac7feb216383e4005d94bdb22561b3ab8f3b808ae9fb" +dependencies = [ + "heck 0.3.3", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sycamore" +version = "0.8.2" +source = "git+https://github.com/sycamore-rs/sycamore?rev=abd556cbc02047042dad2ebd04405e455a9b11b2#abd556cbc02047042dad2ebd04405e455a9b11b2" +dependencies = [ + "ahash", + "futures", + "indexmap", + "js-sys", + "paste", + "sycamore-core", + "sycamore-futures", + "sycamore-macro", + "sycamore-reactive", + "sycamore-web", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "sycamore-core" +version = "0.8.2" +source = "git+https://github.com/sycamore-rs/sycamore?rev=abd556cbc02047042dad2ebd04405e455a9b11b2#abd556cbc02047042dad2ebd04405e455a9b11b2" +dependencies = [ + "ahash", + "sycamore-reactive", +] + +[[package]] +name = "sycamore-futures" +version = "0.8.0" +source = "git+https://github.com/sycamore-rs/sycamore?rev=abd556cbc02047042dad2ebd04405e455a9b11b2#abd556cbc02047042dad2ebd04405e455a9b11b2" +dependencies = [ + "futures", + "sycamore-reactive", + "tokio", + "wasm-bindgen-futures", +] + +[[package]] +name = "sycamore-macro" +version = "0.8.2" +source = "git+https://github.com/sycamore-rs/sycamore?rev=abd556cbc02047042dad2ebd04405e455a9b11b2#abd556cbc02047042dad2ebd04405e455a9b11b2" +dependencies = [ + "once_cell", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sycamore-reactive" +version = "0.8.1" +source = "git+https://github.com/sycamore-rs/sycamore?rev=abd556cbc02047042dad2ebd04405e455a9b11b2#abd556cbc02047042dad2ebd04405e455a9b11b2" +dependencies = [ + "ahash", + "bumpalo", + "indexmap", + "slotmap", + "smallvec", +] + +[[package]] +name = "sycamore-web" +version = "0.8.2" +source = "git+https://github.com/sycamore-rs/sycamore?rev=abd556cbc02047042dad2ebd04405e455a9b11b2#abd556cbc02047042dad2ebd04405e455a9b11b2" +dependencies = [ + "html-escape", + "indexmap", + "js-sys", + "once_cell", + "sycamore-core", + "sycamore-reactive", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "syn" version = "1.0.103" @@ -168,12 +2726,245 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "system-deps" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18db855554db7bd0e73e06cf7ba3df39f97812cb11d3f75e71c39bf45171797e" +dependencies = [ + "cfg-expr 0.9.1", + "heck 0.3.3", + "pkg-config", + "toml", + "version-compare 0.0.11", +] + +[[package]] +name = "system-deps" +version = "6.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2955b1fe31e1fa2fbd1976b71cc69a606d7d4da16f6de3333d0c92d51419aeff" +dependencies = [ + "cfg-expr 0.11.0", + "heck 0.4.0", + "pkg-config", + "toml", + "version-compare 0.1.0", +] + +[[package]] +name = "tao" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42c460173627564bde252ca5ebf346ba5b37c5cee1a445782bacc8e9b8d38b5e" +dependencies = [ + "bitflags", + "cairo-rs", + "cc", + "cocoa", + "core-foundation", + "core-graphics", + "crossbeam-channel", + "dispatch", + "gdk", + "gdk-pixbuf", + "gdk-sys", + "gdkx11-sys", + "gio", + "glib", + "glib-sys", + "gtk", + "image", + "instant", + "jni", + "lazy_static", + "libc", + "log", + "ndk", + "ndk-context", + "ndk-sys", + "objc", + "once_cell", + "parking_lot", + "paste", + "png 0.17.7", + "raw-window-handle", + "scopeguard", + "serde", + "unicode-segmentation", + "uuid 1.2.1", + "windows 0.39.0", + "windows-implement", + "x11-dl", +] + +[[package]] +name = "tar" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "tauri" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac135e45c2923bd91edbb95a0d656f8d025389697e34d6d79166952bfa79c61c" +dependencies = [ + "anyhow", + "attohttpc", + "cocoa", + "dirs-next", + "embed_plist", + "encoding_rs", + "flate2", + "futures-util", + "glib", + "glob", + "gtk", + "heck 0.4.0", + "http", + "ignore", + "notify-rust", + "objc", + "once_cell", + "open", + "os_info", + "os_pipe", + "percent-encoding", + "rand 0.8.5", + "raw-window-handle", + "regex", + "rfd", + "semver 1.0.14", + "serde", + "serde_json", + "serde_repr", + "serialize-to-javascript", + "shared_child", + "state", + "tar", + "tauri-macros", + "tauri-runtime", + "tauri-runtime-wry", + "tauri-utils", + "tempfile", + "thiserror", + "tokio", + "url", + "uuid 1.2.1", + "webkit2gtk", + "webview2-com", + "windows 0.39.0", +] + +[[package]] +name = "tauri-build" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef796f49abc98e6de0abe1b655120addc9d82363d8fc2304e71a4177c25e783c" +dependencies = [ + "anyhow", + "cargo_toml", + "heck 0.4.0", + "json-patch", + "semver 1.0.14", + "serde_json", + "tauri-utils", + "winres", +] + +[[package]] +name = "tauri-codegen" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afcb77cf7bfe3d8f886e73a7fa6157587d015c599671180b76595c1aef175ba8" +dependencies = [ + "base64", + "brotli", + "ico", + "json-patch", + "plist", + "png 0.17.7", + "proc-macro2", + "quote", + "regex", + "semver 1.0.14", + "serde", + "serde_json", + "sha2", + "tauri-utils", + "thiserror", + "time", + "uuid 1.2.1", + "walkdir", +] + +[[package]] +name = "tauri-macros" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f24f481b0b2acfc288ac78755f00ebea53992c7365a165af64cb5ae00806edea" +dependencies = [ + "heck 0.4.0", + "proc-macro2", + "quote", + "syn", + "tauri-codegen", + "tauri-utils", +] + +[[package]] +name = "tauri-runtime" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc5d54c476defa5436e70e0d0a06e3cb0f49b6f863895995d5e3769411769cf" +dependencies = [ + "gtk", + "http", + "http-range", + "rand 0.8.5", + "raw-window-handle", + "serde", + "serde_json", + "tauri-utils", + "thiserror", + "uuid 1.2.1", + "webview2-com", + "windows 0.39.0", +] + +[[package]] +name = "tauri-runtime-wry" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d78c55091701426c2519c7e9f1dc2dd33e533af4e75eae89cedc6995409351a2" +dependencies = [ + "cocoa", + "gtk", + "percent-encoding", + "rand 0.8.5", + "raw-window-handle", + "tauri-runtime", + "tauri-utils", + "uuid 1.2.1", + "webkit2gtk", + "webview2-com", + "windows 0.39.0", + "wry", +] + [[package]] name = "tauri-sys" version = "0.1.0" dependencies = [ "js-sys", - "semver", + "log", + "semver 1.0.14", "serde", "serde-wasm-bindgen", "tauri-sys", @@ -184,6 +2975,101 @@ dependencies = [ "wasm-bindgen-test", ] +[[package]] +name = "tauri-sys-test" +version = "0.0.0" +dependencies = [ + "serde", + "serde_json", + "tauri", + "tauri-build", +] + +[[package]] +name = "tauri-sys-test-ui" +version = "0.0.0" +dependencies = [ + "anyhow", + "console_error_panic_hook", + "futures-util", + "log", + "serde", + "sycamore", + "tauri-sys", + "wasm-bindgen-futures", + "wasm-logger", +] + +[[package]] +name = "tauri-utils" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d64c9a09ba1538b8e67ae8c78c10904f36ce38d364bf7f089ec807032a826b02" +dependencies = [ + "brotli", + "ctor", + "glob", + "heck 0.4.0", + "html5ever", + "infer", + "json-patch", + "kuchiki", + "memchr", + "phf 0.10.1", + "proc-macro2", + "quote", + "semver 1.0.14", + "serde", + "serde_json", + "serde_with", + "thiserror", + "url", + "walkdir", + "windows 0.39.0", +] + +[[package]] +name = "tauri-winrt-notification" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c58de036c4d2e20717024de2a3c4bf56c301f07b21bc8ef9b57189fce06f1f3b" +dependencies = [ + "quick-xml", + "strum", + "windows 0.39.0", +] + +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", +] + +[[package]] +name = "tendril" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" +dependencies = [ + "futf", + "mac", + "utf-8", +] + +[[package]] +name = "thin-slice" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" + [[package]] name = "thiserror" version = "1.0.37" @@ -204,6 +3090,44 @@ dependencies = [ "syn", ] +[[package]] +name = "thread_local" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +dependencies = [ + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fab5c8b9980850e06d92ddbe3ab839c062c801f3927c0fb8abd6fc8e918fbca" +dependencies = [ + "itoa 1.0.4", + "libc", + "num_threads", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] +name = "time-macros" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bb801831d812c562ae7d2bfb531f26e66e4e1f6b17307ba4149c5064710e5b" +dependencies = [ + "time-core", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -219,6 +3143,111 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +[[package]] +name = "tokio" +version = "1.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +dependencies = [ + "autocfg", + "bytes", + "memchr", + "num_cpus", + "pin-project-lite", +] + +[[package]] +name = "toml" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +dependencies = [ + "serde", +] + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "treediff" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "761e8d5ad7ce14bb82b7e61ccc0ca961005a275a060b9644a2431aa11553c2ff" +dependencies = [ + "serde_json", +] + +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "ucd-trie" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" + [[package]] name = "unicode-bidi" version = "0.3.8" @@ -240,6 +3269,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-segmentation" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" + [[package]] name = "url" version = "2.3.1" @@ -249,8 +3284,89 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "utf8-width" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5190c9442dcdaf0ddd50f37420417d219ae5261bbf5db120d0f9bab996c9cba1" + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" + +[[package]] +name = "uuid" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "feb41e78f93363bb2df8b0e86a2ca30eed7806ea16ea0c790d757cf93f79be83" +dependencies = [ + "getrandom 0.2.8", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version-compare" +version = "0.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c18c859eead79d8b95d09e4678566e8d70105c4e7b251f707a03df32442661b" + +[[package]] +name = "version-compare" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe88247b92c1df6b6de80ddc290f3976dbdf2f5f5d3fd049a9fb598c6dd5ca73" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "walkdir" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +dependencies = [ + "same-file", + "winapi", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + [[package]] name = "wasm-bindgen" version = "0.2.83" @@ -342,6 +3458,17 @@ dependencies = [ "quote", ] +[[package]] +name = "wasm-logger" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "074649a66bb306c8f2068c9016395fa65d8e08d2affcbf95acf3c24c3ab19718" +dependencies = [ + "log", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "web-sys" version = "0.3.60" @@ -351,3 +3478,464 @@ dependencies = [ "js-sys", "wasm-bindgen", ] + +[[package]] +name = "webkit2gtk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8f859735e4a452aeb28c6c56a852967a8a76c8eb1cc32dbf931ad28a13d6370" +dependencies = [ + "bitflags", + "cairo-rs", + "gdk", + "gdk-sys", + "gio", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", + "gtk", + "gtk-sys", + "javascriptcore-rs", + "libc", + "once_cell", + "soup2", + "webkit2gtk-sys", +] + +[[package]] +name = "webkit2gtk-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d76ca6ecc47aeba01ec61e480139dda143796abcae6f83bcddf50d6b5b1dcf3" +dependencies = [ + "atk-sys", + "bitflags", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "gtk-sys", + "javascriptcore-rs-sys", + "libc", + "pango-sys", + "pkg-config", + "soup2-sys", + "system-deps 6.0.3", +] + +[[package]] +name = "webview2-com" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4a769c9f1a64a8734bde70caafac2b96cada12cd4aefa49196b3a386b8b4178" +dependencies = [ + "webview2-com-macros", + "webview2-com-sys", + "windows 0.39.0", + "windows-implement", +] + +[[package]] +name = "webview2-com-macros" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaebe196c01691db62e9e4ca52c5ef1e4fd837dcae27dae3ada599b5a8fd05ac" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "webview2-com-sys" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac48ef20ddf657755fdcda8dfed2a7b4fc7e4581acce6fe9b88c3d64f29dee7" +dependencies = [ + "regex", + "serde", + "serde_json", + "thiserror", + "windows 0.39.0", + "windows-bindgen", + "windows-metadata", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbedf6db9096bc2364adce0ae0aa636dcd89f3c3f2cd67947062aaf0ca2a10ec" +dependencies = [ + "windows_aarch64_msvc 0.32.0", + "windows_i686_gnu 0.32.0", + "windows_i686_msvc 0.32.0", + "windows_x86_64_gnu 0.32.0", + "windows_x86_64_msvc 0.32.0", +] + +[[package]] +name = "windows" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57b543186b344cc61c85b5aab0d2e3adf4e0f99bc076eff9aa5927bcc0b8a647" +dependencies = [ + "windows_aarch64_msvc 0.37.0", + "windows_i686_gnu 0.37.0", + "windows_i686_msvc 0.37.0", + "windows_x86_64_gnu 0.37.0", + "windows_x86_64_msvc 0.37.0", +] + +[[package]] +name = "windows" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1c4bd0a50ac6020f65184721f758dba47bb9fbc2133df715ec74a237b26794a" +dependencies = [ + "windows-implement", + "windows_aarch64_msvc 0.39.0", + "windows_i686_gnu 0.39.0", + "windows_i686_msvc 0.39.0", + "windows_x86_64_gnu 0.39.0", + "windows_x86_64_msvc 0.39.0", +] + +[[package]] +name = "windows-bindgen" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68003dbd0e38abc0fb85b939240f4bce37c43a5981d3df37ccbaaa981b47cb41" +dependencies = [ + "windows-metadata", + "windows-tokens", +] + +[[package]] +name = "windows-implement" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba01f98f509cb5dc05f4e5fc95e535f78260f15fea8fe1a8abdd08f774f1cee7" +dependencies = [ + "syn", + "windows-tokens", +] + +[[package]] +name = "windows-metadata" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ee5e275231f07c6e240d14f34e1b635bf1faa1c76c57cfd59a5cdb9848e4278" + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.0", +] + +[[package]] +name = "windows-tokens" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f838de2fe15fe6bac988e74b798f26499a8b21a9d97edec321e79b28d1d7f597" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8e92753b1c443191654ec532f14c199742964a061be25d77d7a96f09db20bf5" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2623277cb2d1c216ba3b578c0f3cf9cdebeddb6e66b1b218bb33596ea7769c3a" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec7711666096bd4096ffa835238905bb33fb87267910e154b18b44eaabb340f2" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + +[[package]] +name = "windows_i686_gnu" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a711c68811799e017b6038e0922cb27a5e2f43a2ddb609fe0b6f3eeda9de615" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_gnu" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3925fd0b0b804730d44d4b6278c50f9699703ec49bcd628020f46f4ba07d9e1" + +[[package]] +name = "windows_i686_gnu" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "763fc57100a5f7042e3057e7e8d9bdd7860d330070251a73d003563a3bb49e1b" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + +[[package]] +name = "windows_i686_msvc" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c11bb1a02615db74680b32a68e2d61f553cc24c4eb5b4ca10311740e44172" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_i686_msvc" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce907ac74fe331b524c1298683efbf598bb031bc84d5e274db2083696d07c57c" + +[[package]] +name = "windows_i686_msvc" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bc7cbfe58828921e10a9f446fcaaf649204dcfe6c1ddd712c5eebae6bda1106" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c912b12f7454c6620635bbff3450962753834be2a594819bd5e945af18ec64bc" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2babfba0828f2e6b32457d5341427dcbb577ceef556273229959ac23a10af33d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6868c165637d653ae1e8dc4d82c25d4f97dd6605eaa8d784b5c6e0ab2a252b65" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4dd6dc7df2d84cf7b33822ed5b86318fb1781948e9663bacd047fc9dd52259d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e4d40883ae9cae962787ca76ba76390ffa29214667a111db9e0a1ad8377e809" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + +[[package]] +name = "winres" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c" +dependencies = [ + "toml", +] + +[[package]] +name = "wry" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "923d297b203eae65b095af16c02978b7932be1968012b4da7138390edf34dea5" +dependencies = [ + "base64", + "block", + "cocoa", + "core-graphics", + "crossbeam-channel", + "dunce", + "gdk", + "gio", + "glib", + "gtk", + "html5ever", + "http", + "kuchiki", + "libc", + "log", + "objc", + "objc_id", + "once_cell", + "serde", + "serde_json", + "sha2", + "soup2", + "tao", + "thiserror", + "url", + "webkit2gtk", + "webkit2gtk-sys", + "webview2-com", + "windows 0.39.0", + "windows-implement", +] + +[[package]] +name = "x11" +version = "2.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7ae97874a928d821b061fce3d1fc52f08071dd53c89a6102bc06efcac3b2908" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "x11-dl" +version = "2.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c83627bc137605acc00bb399c7b908ef460b621fc37c953db2b09f88c449ea6" +dependencies = [ + "lazy_static", + "libc", + "pkg-config", +] + +[[package]] +name = "xattr" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" +dependencies = [ + "libc", +] + +[[package]] +name = "xml-rs" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" diff --git a/Cargo.toml b/Cargo.toml index 1032479..f80edfe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,19 +11,31 @@ js-sys = "0.3.59" serde = { version = "1.0.140", features = ["derive"] } wasm-bindgen = { version = "0.2.82", features = ["serde_json"] } wasm-bindgen-futures = "0.4.32" -url = { version = "2.3.1", optional = true } +url = { version = "2.3.1", optional = true, features = ["serde"] } thiserror = "1.0.37" -semver = { version = "1.0.14", optional = true } +semver = { version = "1.0.14", optional = true, features = ["serde"] } +log = "0.4.17" [dev-dependencies] wasm-bindgen-test = "0.3.33" tauri-sys = { path = ".", features = ["all"] } +# tauri = "1.1.1" + +[package.metadata.docs.rs] +all-features = true [features] -all = ["app", "clipboard", "event", "mocks", "tauri", "updater"] +all = ["app", "clipboard", "event", "mocks", "tauri", "window", "process", "dialog", "os", "notification"] app = ["dep:semver"] clipboard = [] +dialog = [] event = [] mocks = [] tauri = ["dep:url"] -updater = [] \ No newline at end of file +window = [] +process = [] +os = ["dep:semver"] +notification = [] + +[workspace] +members = ["examples/test", "examples/test/src-tauri"] diff --git a/README.md b/README.md index 08eca59..36d00e2 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ All modules are gated by accordingly named Cargo features. It is recommended you - **all**: Enables all modules. - **app**: Enables the `app` module. - **clipboard**: Enables the `clipboard` module. +- **dialog**: Enables the `dialog` module. - **event**: Enables the `event` module. - **mocks**: Enables the `mocks` module. - **tauri**: Enables the `tauri` module. @@ -54,20 +55,20 @@ These API bindings are not completely on-par with `@tauri-apps/api` yet, but her - [x] `app` - [ ] `cli` - [x] `clipboard` -- [ ] `dialog` +- [x] `dialog` - [x] `event` - [ ] `fs` - [ ] `global_shortcut` - [ ] `http` - [x] `mocks` -- [ ] `notification` -- [ ] `os` +- [x] `notification` +- [x] `os` - [ ] `path` -- [ ] `process` +- [x] `process` - [ ] `shell` - [x] `tauri` - [ ] `updater` -- [ ] `window` +- [x] `window` The current API also very closely mirrors the JS API even though that might not be the most ergonomic choice, ideas for improving the API with quality-of-life features beyond the regular JS API interface are very welcome. diff --git a/build.rs b/build.rs deleted file mode 100644 index c7d20bc..0000000 --- a/build.rs +++ /dev/null @@ -1,32 +0,0 @@ -use std::process::Command; - -fn main() { - /* Shared arguments */ - let sargs: [&str; 9] = [ - "--outdir=dist", - "--format=esm", - "--bundle", - "tauri/tooling/api/src/app.ts", - "tauri/tooling/api/src/clipboard.ts", - "tauri/tooling/api/src/tauri.ts", - "tauri/tooling/api/src/event.ts", - "tauri/tooling/api/src/mocks.ts", - "tauri/tooling/api/src/updater.ts", - ]; - - if cfg!(windows) { - /* Use cmd if the target is windows */ - Command::new("cmd") - .args(&["/C", "esbuild"]) - .args(&sargs) - .output() - .unwrap(); - } else if cfg!(unix) { - Command::new("esbuild") - .args(&sargs) - .output() - .unwrap(); - } else { - panic!("Unsupported build target"); - } -} diff --git a/examples/api/.gitignore b/examples/api/.gitignore deleted file mode 100644 index 48c3ca4..0000000 --- a/examples/api/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/dist/ -/target/ -/Cargo.lock diff --git a/examples/api/Trunk.toml b/examples/api/Trunk.toml deleted file mode 100644 index 60ac6db..0000000 --- a/examples/api/Trunk.toml +++ /dev/null @@ -1,16 +0,0 @@ -[build] -target = "./index.html" - -[watch] -ignore = ["./src-tauri"] - -[serve] -address = "127.0.0.1" -port = 1420 -open = false - -# [[hooks]] -# # Runs SSG on production builds -# stage = "post_build" -# command = "bash" -# command_arguments = ["-c", "if [[ $TRUNK_PROFILE == \"release\" ]]; then cargo run --release --features ssg -- $TRUNK_STAGING_DIR; fi"] diff --git a/examples/api/index.html b/examples/api/index.html deleted file mode 100644 index fc029e0..0000000 --- a/examples/api/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Tauri + Yew App - - - - - - - diff --git a/examples/api/public/tauri_logo.png b/examples/api/public/tauri_logo.png deleted file mode 100644 index 2c53b8c..0000000 Binary files a/examples/api/public/tauri_logo.png and /dev/null differ diff --git a/examples/api/shared/Cargo.toml b/examples/api/shared/Cargo.toml deleted file mode 100644 index 92a9d17..0000000 --- a/examples/api/shared/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "shared" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -serde = { version = "1.0.140", features = ["derive"] } \ No newline at end of file diff --git a/examples/api/shared/src/lib.rs b/examples/api/shared/src/lib.rs deleted file mode 100644 index 1ebbc1d..0000000 --- a/examples/api/shared/src/lib.rs +++ /dev/null @@ -1,12 +0,0 @@ -use serde::{Serialize, Deserialize}; - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct Reply<'a> { - pub data: &'a str, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct RequestBody<'a> { - pub id: i32, - pub name: &'a str, -} \ No newline at end of file diff --git a/examples/api/src-tauri/src/main.rs b/examples/api/src-tauri/src/main.rs deleted file mode 100644 index bea1e9a..0000000 --- a/examples/api/src-tauri/src/main.rs +++ /dev/null @@ -1,37 +0,0 @@ -#![cfg_attr( - all(not(debug_assertions), target_os = "windows"), - windows_subsystem = "windows" -)] - -use shared::{Reply, RequestBody}; - -#[tauri::command] -fn log_operation(event: String, payload: Option) { - println!("{} {:?}", event, payload); -} - -#[tauri::command] -fn perform_request(endpoint: String, body: RequestBody) -> String { - println!("{} {:?}", endpoint, body); - "message response".into() -} - -fn main() { - tauri::Builder::default() - .invoke_handler(tauri::generate_handler![log_operation, perform_request]) - .on_page_load(|window, _| { - let window_ = window.clone(); - window.listen("js-event", move |event| { - println!("got js-event with message '{:?}'", event.payload()); - let reply = Reply { - data: "something else", - }; - - window_ - .emit("rust-event", Some(reply)) - .expect("failed to emit"); - }); - }) - .run(tauri::generate_context!()) - .expect("error while running tauri application"); -} diff --git a/examples/api/src/main.rs b/examples/api/src/main.rs deleted file mode 100644 index 6d1e97b..0000000 --- a/examples/api/src/main.rs +++ /dev/null @@ -1,82 +0,0 @@ -mod views; - -use sycamore::prelude::*; -#[cfg(not(feature = "ssg"))] -use sycamore_router::{Router, HistoryIntegration}; - -#[component] -fn Header(cx: Scope) -> View { - view! { cx, - header(style="display: flex; gap: 1em; margin-bottom: 1em;") { - a(href="/") { - "Welcome" - } - a(href="/app") { - "App" - } - a(href="/clipboard") { - "Clipboard" - } - a(href="/updater") { - "Updater" - } - a(href="/communication") { - "Communication" - } - } - } -} - -#[cfg(all(not(debug_assertions), not(feature = "ssg")))] -fn main() { - wasm_logger::init(wasm_logger::Config::default()); - - sycamore::hydrate(|cx| view! { cx, - Header - Router( - integration=HistoryIntegration::new(), - view=views::switch - ) - }); -} - -#[cfg(all(debug_assertions, not(feature = "ssg")))] -fn main() { - use sycamore::view; - - wasm_logger::init(wasm_logger::Config::default()); - - sycamore::render(|cx| view! { cx, - Header - Router( - integration=HistoryIntegration::new(), - view=views::switch - ) - }); -} - -#[cfg(feature = "ssg")] -fn main() { - use sycamore_router::StaticRouter; - - let out_dir = std::env::args().nth(1).unwrap(); - - println!("out_dir {}", out_dir); - - let template = std::fs::read_to_string(format!("{}/index.html", out_dir)).unwrap(); - - let html = sycamore::render_to_string(|cx| view! { cx, - Header - StaticRouter( - route=route.clone(), - view=views::switch - ) - }); - - let html = template.replace("\n", &html); - - let path = format!("{}/index.html", out_dir); - - println!("Writing html to file \"{}\"", path); - std::fs::write(path, html).unwrap(); -} diff --git a/examples/api/src/views/app.rs b/examples/api/src/views/app.rs deleted file mode 100644 index 9b04817..0000000 --- a/examples/api/src/views/app.rs +++ /dev/null @@ -1,78 +0,0 @@ -use gloo_timers::callback::Timeout; -use sycamore::prelude::*; -use tauri_sys::app; - -#[component] -pub fn App(cx: Scope) -> View { - let show_app = |_| { - sycamore::futures::spawn_local(async move { - let res = app::hide().await; - - log::debug!("app hide res {:?}", res); - - let timeout = Timeout::new(2_000, move || { - sycamore::futures::spawn_local(async move { - let res = app::show().await; - - log::debug!("app show res {:?}", res); - }); - }); - - timeout.forget(); - }); - }; - - let hide_app = |_| { - sycamore::futures::spawn_local(async move { - let res = app::hide().await; - - log::debug!("app hide res {:?}", res); - }); - }; - - let get_name = |_| { - sycamore::futures::spawn_local(async move { - let res = app::get_name().await; - - log::debug!("app name {:?}", res); - }); - }; - - let get_version = |_| { - sycamore::futures::spawn_local(async move { - let res = app::get_version().await; - - log::debug!("app version {:?}", res); - }); - }; - - let get_tauri_version = |_| { - sycamore::futures::spawn_local(async move { - let res = app::get_tauri_version().await; - - log::debug!("tauri version {:?}", res); - }); - }; - - view! { cx, - div { - button(class="btn",id="get_name",on:click=get_name) { - "Get App Name" - } - button(class="btn",id="get_version",on:click=get_version) { - "Get App Version" - } - button(class="btn",id="get_tauri_version",on:click=get_tauri_version) { - "Get Tauri Version" - } - } - div { - button(class="btn",id="show",title="Hides and shows the app after 2 seconds",on:click=show_app) { - "Show" - } - button(class="btn",id="hide",on:click=hide_app) { - "Hide" - } - } - } -} diff --git a/examples/api/src/views/clipboard.rs b/examples/api/src/views/clipboard.rs deleted file mode 100644 index 1a2093a..0000000 --- a/examples/api/src/views/clipboard.rs +++ /dev/null @@ -1,42 +0,0 @@ -use sycamore::prelude::*; -use tauri_sys::clipboard::{read_text, write_text}; - -#[component] -pub fn Clipboard(cx: Scope) -> View { - let text = create_signal(cx, "clipboard message".to_string()); - - let write = move |_| { - sycamore::futures::spawn_local_scoped(cx, async move { - write_text(&text.get()).await - // .then(() => { - // onMessage('Wrote to the clipboard') - // }) - // .catch(onMessage) - }); - }; - - let read = |_| { - sycamore::futures::spawn_local(async move { - let text = read_text().await; - - log::info!("Read text from clipboard {:?}", text); - // readText() - // .then((contents) => { - // onMessage(`Clipboard contents: ${contents}`) - // }) - // .catch(onMessage) - }); - }; - - view! { cx, - div(class="flex gap-1") { - input(class="grow input",placeholder="Text to write to the clipboard",bind:value=text) - button(class="btn",type="button",on:click=write) { - "Write" - } - button(class="btn",type="button",on:click=read) { - "Read" - } - } - } -} diff --git a/examples/api/src/views/communication.rs b/examples/api/src/views/communication.rs deleted file mode 100644 index 5c0ed4d..0000000 --- a/examples/api/src/views/communication.rs +++ /dev/null @@ -1,90 +0,0 @@ -use serde::{Deserialize, Serialize}; -use sycamore::prelude::*; -use tauri_sys::event::{emit, listen}; -use tauri_sys::tauri::invoke; -use shared::RequestBody; - -#[component] -pub fn Communication<'a, G: Html>(cx: Scope<'a>) -> View { - let unlisten = create_signal::>>(cx, None); - - // on_mount(cx, move || { - - // sycamore::futures::spawn_local_scoped(cx, async move { - // let unlisten_raw = listen::("rust-event", &|reply| log::debug!("got reply {:?}", reply)).await; - - // unlisten.set(Some(Box::new(&unlisten_raw))); - // }); - // }); - - // on_cleanup(cx, || { - // if let Some(unlisten) = unlisten .take().as_deref() { - // (unlisten)() - // } - // }); - - let log = |_| { - #[derive(Serialize)] - struct Payload<'a> { - event: &'a str, - payload: &'a str, - } - - sycamore::futures::spawn_local(async move { - let res = invoke::<_, ()>( - "log_operation", - &Payload { - event: "tauri-click", - payload: "this payload is optional because we used Option in Rust", - }, - ) - .await; - - log::debug!("Emitted event, response {:?}", res); - }); - }; - - let perform_request = |_| { - sycamore::futures::spawn_local(async move { - #[derive(Serialize)] - struct Payload<'a> { - endpoint: &'a str, - body: RequestBody<'a> - } - - let res = invoke::<_, String>( - "perform_request", - &Payload { - endpoint: "dummy endpoint arg", - body: RequestBody { - id: 5, - name: "test", - }, - }, - ) - .await; - - log::debug!("Got reply {:?}", res); - }); - }; - - let emit_event = |_| { - sycamore::futures::spawn_local(async move { - emit("js-event", &"this is the payload string").await; - }); - }; - - view! { cx, - div { - button(class="btn",id="log",on:click=log) { - "Call Log API" - } - button(class="btn",mid="request",on:click=perform_request) { - "Call Request (async) API" - } - button(class="btn",id="event",on:click=emit_event) { - "Send event to Rust" - } - } - } -} diff --git a/examples/api/src/views/mod.rs b/examples/api/src/views/mod.rs deleted file mode 100644 index 441b135..0000000 --- a/examples/api/src/views/mod.rs +++ /dev/null @@ -1,33 +0,0 @@ -mod app; -mod clipboard; -mod communication; -mod updater; -mod welcome; - -use sycamore::view::View; -use sycamore_router::Route; -use sycamore::prelude::*; - -#[derive(Debug, Clone, Route)] -pub enum Page { - #[to("/app")] - App, - #[to("/clipboard")] - Clipboard, - #[to("/communication")] - Communication, - #[to("/updater")] - Updater, - #[not_found] - NotFound -} - -pub fn switch(cx: Scope, route: &ReadSignal) -> View { - match route.get().as_ref() { - Page::App => app::App(cx), - Page::Clipboard => clipboard::Clipboard(cx), - Page::Communication => communication::Communication(cx), - Page::Updater => updater::Updater(cx), - Page::NotFound => welcome::Welcome(cx) - } -} \ No newline at end of file diff --git a/examples/api/src/views/welcome.rs b/examples/api/src/views/welcome.rs deleted file mode 100644 index 1fffd14..0000000 --- a/examples/api/src/views/welcome.rs +++ /dev/null @@ -1,10 +0,0 @@ -use sycamore::prelude::*; - -#[component] -pub fn Welcome(cx: Scope) -> View { - view! { cx, - h1 { - "Welcome" - } - } -} \ No newline at end of file diff --git a/examples/api/style.css b/examples/api/style.css deleted file mode 100644 index a3fbd74..0000000 --- a/examples/api/style.css +++ /dev/null @@ -1,120 +0,0 @@ -.logo.yew:hover { - filter: drop-shadow(0 0 2em #20a88a); -} -.logo.sycamore { - color: #0000; - font-size: 3rem; - line-height: 1; - font-weight: 800; - -webkit-background-clip: text; - background-clip: text; - background-image: linear-gradient(to right,#fdba74, #f87171); - font-family: Inter,system-ui,sans-serif; -} -.logo.sycamore:hover { - filter: drop-shadow(0 0 2em #f87171); -} - -:root { - font-family: Inter, Avenir, Helvetica, Arial, sans-serif; - font-size: 16px; - line-height: 24px; - font-weight: 400; - - color: #0f0f0f; - background-color: #f6f6f6; - - font-synthesis: none; - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - -webkit-text-size-adjust: 100%; -} - -.container { - margin: 0; - padding-top: 10vh; - display: flex; - flex-direction: column; - justify-content: center; - text-align: center; -} - -.logo { - height: 6em; - padding: 1.5em; - will-change: filter; - transition: 0.75s; -} - -.logo.tauri:hover { - filter: drop-shadow(0 0 2em #24c8db); -} - -.row { - display: flex; - justify-content: center; - align-items: center; -} - -a { - font-weight: 500; - color: #646cff; - text-decoration: inherit; -} - -a:hover { - color: #535bf2; -} - -h1 { - text-align: center; -} - -input, -button { - border-radius: 8px; - border: 1px solid transparent; - padding: 0.6em 1.2em; - font-size: 1em; - font-weight: 500; - font-family: inherit; - color: #0f0f0f; - background-color: #ffffff; - transition: border-color 0.25s; - box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2); -} - -button { - cursor: pointer; -} - -button:hover { - border-color: #396cd8; -} - -input, -button { - outline: none; -} - -#greet-input { - margin-right: 5px; -} - -@media (prefers-color-scheme: dark) { - :root { - color: #f6f6f6; - background-color: #2f2f2f; - } - - a:hover { - color: #24c8db; - } - - input, - button { - color: #ffffff; - background-color: #0f0f0f98; - } -} diff --git a/examples/test/.gitignore b/examples/test/.gitignore new file mode 100644 index 0000000..22a146e --- /dev/null +++ b/examples/test/.gitignore @@ -0,0 +1,2 @@ +target +dist \ No newline at end of file diff --git a/examples/api/.taurignore b/examples/test/.taurignore similarity index 100% rename from examples/api/.taurignore rename to examples/test/.taurignore diff --git a/examples/test/Cargo.lock b/examples/test/Cargo.lock new file mode 100644 index 0000000..88aadaf --- /dev/null +++ b/examples/test/Cargo.lock @@ -0,0 +1,3894 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "adler32" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.8", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "anyhow" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" + +[[package]] +name = "atk" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c3d816ce6f0e2909a96830d6911c2aff044370b1ef92d7f267b43bae5addedd" +dependencies = [ + "atk-sys", + "bitflags", + "glib", + "libc", +] + +[[package]] +name = "atk-sys" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58aeb089fb698e06db8089971c7ee317ab9644bade33383f63631437b03aafb6" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.0.3", +] + +[[package]] +name = "attohttpc" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fcf00bc6d5abb29b5f97e3c61a90b6d3caa12f3faf897d4a3e3607c050a35a7" +dependencies = [ + "flate2", + "http", + "log", + "native-tls", + "serde", + "serde_json", + "serde_urlencoded", + "url", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array", +] + +[[package]] +name = "brotli" +version = "3.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ad2d4653bf5ca36ae797b1f4bb4dbddb60ce49ca4aed8a2ce4829f60425b80" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bstr" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +dependencies = [ + "memchr", +] + +[[package]] +name = "bumpalo" +version = "3.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" + +[[package]] +name = "bytemuck" +version = "1.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aec14f5d4e6e3f927cd0c81f72e5710d95ee9019fbeb4b3021193867491bfd8" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" + +[[package]] +name = "cairo-rs" +version = "0.15.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c76ee391b03d35510d9fa917357c7f1855bd9a6659c95a1b392e33f49b3369bc" +dependencies = [ + "bitflags", + "cairo-sys-rs", + "glib", + "libc", + "thiserror", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c55d429bef56ac9172d25fecb85dc8068307d17acd74b377866b7a1ef25d3c8" +dependencies = [ + "glib-sys", + "libc", + "system-deps 6.0.3", +] + +[[package]] +name = "cargo_toml" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e72c3ff59e3b7d24630206bb63a73af65da4ed5df1f76ee84dfafb9fee2ba60e" +dependencies = [ + "serde", + "serde_derive", + "toml", +] + +[[package]] +name = "cc" +version = "1.0.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581f5dba903aac52ea3feb5ec4810848460ee833876f1f9b0fdeab1f19091574" + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfb" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74f89d248799e3f15f91b70917f65381062a01bb8e222700ea0e5a7ff9785f9c" +dependencies = [ + "byteorder", + "uuid 0.8.2", +] + +[[package]] +name = "cfg-expr" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3431df59f28accaf4cb4eed4a9acc66bea3f3c3753aa6cdc2f024174ef232af7" +dependencies = [ + "smallvec", +] + +[[package]] +name = "cfg-expr" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0357a6402b295ca3a86bc148e84df46c02e41f41fef186bda662557ef6328aa" +dependencies = [ + "smallvec", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cocoa" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" +dependencies = [ + "bitflags", + "block", + "cocoa-foundation", + "core-foundation", + "core-graphics", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" +dependencies = [ + "bitflags", + "block", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "combine" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "core-graphics" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" +dependencies = [ + "bitflags", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" +dependencies = [ + "bitflags", + "core-foundation", + "foreign-types", + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cssparser" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754b69d351cdc2d8ee09ae203db831e005560fc6030da058f86ad60c92a9cb0a" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa 0.4.8", + "matches", + "phf 0.8.0", + "proc-macro2", + "quote", + "smallvec", + "syn", +] + +[[package]] +name = "cssparser-macros" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfae75de57f2b2e85e8768c3ea840fd159c8f33e2b6522c7835b7abac81be16e" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "ctor" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "cty" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" + +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "dbus" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f8bcdd56d2e5c4ed26a529c5a9029f5db8290d433497506f958eae3be148eb6" +dependencies = [ + "libc", + "libdbus-sys", + "winapi", +] + +[[package]] +name = "deflate" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" +dependencies = [ + "adler32", + "byteorder", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version 0.4.0", + "syn", +] + +[[package]] +name = "digest" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + +[[package]] +name = "dtoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" + +[[package]] +name = "dtoa-short" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bde03329ae10e79ede66c9ce4dc930aa8599043b0743008548680f25b91502d6" +dependencies = [ + "dtoa", +] + +[[package]] +name = "embed_plist" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" + +[[package]] +name = "encoding_rs" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "fastrand" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +dependencies = [ + "instant", +] + +[[package]] +name = "field-offset" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e1c54951450cbd39f3dbcf1005ac413b49487dabf18a720ad2383eccfeffb92" +dependencies = [ + "memoffset", + "rustc_version 0.3.3", +] + +[[package]] +name = "filetime" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b9663d381d07ae25dc88dbdf27df458faa83a9b25336bcac83d5e452b5fc9d3" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "windows-sys 0.42.0", +] + +[[package]] +name = "flate2" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" +dependencies = [ + "crc32fast", + "miniz_oxide 0.5.4", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" +dependencies = [ + "mac", + "new_debug_unreachable", +] + +[[package]] +name = "futures" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" + +[[package]] +name = "futures-executor" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" + +[[package]] +name = "futures-macro" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" + +[[package]] +name = "futures-task" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" + +[[package]] +name = "futures-util" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "gdk" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6e05c1f572ab0e1f15be94217f0dc29088c248b14f792a5ff0af0d84bcda9e8" +dependencies = [ + "bitflags", + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "libc", + "pango", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad38dd9cc8b099cceecdf41375bb6d481b1b5a7cd5cd603e10a69a9383f8619a" +dependencies = [ + "bitflags", + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "140b2f5378256527150350a8346dbdb08fadc13453a7a2d73aecd5fab3c402a7" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.0.3", +] + +[[package]] +name = "gdk-sys" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e7a08c1e8f06f4177fb7e51a777b8c1689f743a7bc11ea91d44d2226073a88" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", + "system-deps 6.0.3", +] + +[[package]] +name = "gdkx11-sys" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4b7f8c7a84b407aa9b143877e267e848ff34106578b64d1e0a24bf550716178" +dependencies = [ + "gdk-sys", + "glib-sys", + "libc", + "system-deps 6.0.3", + "x11", +] + +[[package]] +name = "generator" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc184cace1cea8335047a471cc1da80f18acf8a76f3bab2028d499e328948ec7" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "windows 0.32.0", +] + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "gio" +version = "0.15.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68fdbc90312d462781a395f7a16d96a2b379bb6ef8cd6310a2df272771c4283b" +dependencies = [ + "bitflags", + "futures-channel", + "futures-core", + "futures-io", + "gio-sys", + "glib", + "libc", + "once_cell", + "thiserror", +] + +[[package]] +name = "gio-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32157a475271e2c4a023382e9cab31c4584ee30a97da41d3c4e9fdd605abcf8d" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.0.3", + "winapi", +] + +[[package]] +name = "glib" +version = "0.15.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edb0306fbad0ab5428b0ca674a23893db909a98582969c9b537be4ced78c505d" +dependencies = [ + "bitflags", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "once_cell", + "smallvec", + "thiserror", +] + +[[package]] +name = "glib-macros" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a68131a662b04931e71891fb14aaf65ee4b44d08e8abc10f49e77418c86c64" +dependencies = [ + "anyhow", + "heck 0.4.0", + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "glib-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef4b192f8e65e9cf76cbf4ea71fa8e3be4a0e18ffe3d68b8da6836974cc5bad4" +dependencies = [ + "libc", + "system-deps 6.0.3", +] + +[[package]] +name = "glob" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" + +[[package]] +name = "globset" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a" +dependencies = [ + "aho-corasick", + "bstr", + "fnv", + "log", + "regex", +] + +[[package]] +name = "gobject-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d57ce44246becd17153bd035ab4d32cfee096a657fc01f2231c9278378d1e0a" +dependencies = [ + "glib-sys", + "libc", + "system-deps 6.0.3", +] + +[[package]] +name = "gtk" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e3004a2d5d6d8b5057d2b57b3712c9529b62e82c77f25c1fecde1fd5c23bd0" +dependencies = [ + "atk", + "bitflags", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib", + "gtk-sys", + "gtk3-macros", + "libc", + "once_cell", + "pango", + "pkg-config", +] + +[[package]] +name = "gtk-sys" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5bc2f0587cba247f60246a0ca11fe25fb733eabc3de12d1965fc07efab87c84" +dependencies = [ + "atk-sys", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "system-deps 6.0.3", +] + +[[package]] +name = "gtk3-macros" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24f518afe90c23fba585b2d7697856f9e6a7bbc62f65588035e66f6afb01a2e9" +dependencies = [ + "anyhow", + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "html-escape" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15315cfa9503e9aa85a477138eff76a1b203a430703548052c330b69d8d8c205" +dependencies = [ + "utf8-width", +] + +[[package]] +name = "html5ever" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5c13fb08e5d4dfc151ee5e88bae63f7773d61852f3bdc73c9f4b9e1bde03148" +dependencies = [ + "log", + "mac", + "markup5ever", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa 1.0.4", +] + +[[package]] +name = "http-range" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" + +[[package]] +name = "ico" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a4b3331534254a9b64095ae60d3dc2a8225a7a70229cd5888be127cdc1f6804" +dependencies = [ + "byteorder", + "png 0.11.0", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "ignore" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "713f1b139373f96a2e0ce3ac931cd01ee973c3c5dd7c40c0c2efe96ad2b6751d" +dependencies = [ + "crossbeam-utils", + "globset", + "lazy_static", + "log", + "memchr", + "regex", + "same-file", + "thread_local", + "walkdir", + "winapi-util", +] + +[[package]] +name = "image" +version = "0.24.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd8e4fb07cf672b1642304e731ef8a6a4c7891d67bb4fd4f5ce58cd6ed86803c" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "num-rational", + "num-traits", +] + +[[package]] +name = "indexmap" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "infer" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20b2b533137b9cad970793453d4f921c2e91312a6d88b1085c07bc15fc51bb3b" +dependencies = [ + "cfb", +] + +[[package]] +name = "inflate" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5f9f47468e9a76a6452271efadc88fe865a82be91fe75e6c0c57b87ccea59d4" +dependencies = [ + "adler32", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "itoa" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" + +[[package]] +name = "javascriptcore-rs" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf053e7843f2812ff03ef5afe34bb9c06ffee120385caad4f6b9967fcd37d41c" +dependencies = [ + "bitflags", + "glib", + "javascriptcore-rs-sys", +] + +[[package]] +name = "javascriptcore-rs-sys" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "905fbb87419c5cde6e3269537e4ea7d46431f3008c5d057e915ef3f115e7793c" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 5.0.0", +] + +[[package]] +name = "jni" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "js-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "json-patch" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f995a3c8f2bc3dd52a18a583e90f9ec109c047fa1603a853e46bcda14d2e279d" +dependencies = [ + "serde", + "serde_json", + "treediff", +] + +[[package]] +name = "kuchiki" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ea8e9c6e031377cff82ee3001dc8026cdf431ed4e2e6b51f98ab8c73484a358" +dependencies = [ + "cssparser", + "html5ever", + "matches", + "selectors", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.137" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" + +[[package]] +name = "libdbus-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c185b5b7ad900923ef3a8ff594083d4d9b5aea80bb4f32b8342363138c0d456b" +dependencies = [ + "pkg-config", +] + +[[package]] +name = "line-wrap" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9" +dependencies = [ + "safemem", +] + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "loom" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "serde", + "serde_json", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "mac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" + +[[package]] +name = "mac-notification-sys" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e72d50edb17756489e79d52eb146927bec8eba9dd48faadf9ef08bca3791ad5" +dependencies = [ + "cc", + "dirs-next", + "objc-foundation", + "objc_id", + "time", +] + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "markup5ever" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a24f40fb03852d1cdd84330cddcaf98e9ec08a7b7768e952fad3b4cf048ec8fd" +dependencies = [ + "log", + "phf 0.8.0", + "phf_codegen", + "string_cache", + "string_cache_codegen", + "tendril", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "matches" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "miniz_oxide" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" +dependencies = [ + "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +dependencies = [ + "adler", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "ndk" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" +dependencies = [ + "bitflags", + "jni-sys", + "ndk-sys", + "num_enum", + "thiserror", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + +[[package]] +name = "notify-rust" +version = "4.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368e89ea58df747ce88be669ae44e79783c1d30bfd540ad0fc520b3f41f0b3b0" +dependencies = [ + "dbus", + "mac-notification-sys", + "tauri-winrt-notification", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", + "objc_exception", +] + +[[package]] +name = "objc-foundation" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +dependencies = [ + "block", + "objc", + "objc_id", +] + +[[package]] +name = "objc_exception" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +dependencies = [ + "cc", +] + +[[package]] +name = "objc_id" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +dependencies = [ + "objc", +] + +[[package]] +name = "once_cell" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" + +[[package]] +name = "open" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4a3100141f1733ea40b53381b0ae3117330735ef22309a190ac57b9576ea716" +dependencies = [ + "pathdiff", + "windows-sys 0.36.1", +] + +[[package]] +name = "openssl" +version = "0.10.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a" +dependencies = [ + "autocfg", + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "os_info" +version = "3.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4750134fb6a5d49afc80777394ad5d95b04bc12068c6abb92fae8f43817270f" +dependencies = [ + "log", + "serde", + "winapi", +] + +[[package]] +name = "os_pipe" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dceb7e43f59c35ee1548045b2c72945a5a3bb6ce6d6f07cdc13dc8f6bc4930a" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "pango" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e4045548659aee5313bde6c582b0d83a627b7904dd20dc2d9ef0895d414e4f" +dependencies = [ + "bitflags", + "glib", + "libc", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2a00081cde4661982ed91d80ef437c20eacaf6aa1a5962c0279ae194662c3aa" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.0.3", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys 0.42.0", +] + +[[package]] +name = "paste" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" + +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pest" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc7bc69c062e492337d74d59b120c274fd3d261b6bf6d3207d499b4b379c41a" +dependencies = [ + "thiserror", + "ucd-trie", +] + +[[package]] +name = "phf" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" +dependencies = [ + "phf_macros 0.8.0", + "phf_shared 0.8.0", + "proc-macro-hack", +] + +[[package]] +name = "phf" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" +dependencies = [ + "phf_macros 0.10.0", + "phf_shared 0.10.0", + "proc-macro-hack", +] + +[[package]] +name = "phf_codegen" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", +] + +[[package]] +name = "phf_generator" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" +dependencies = [ + "phf_shared 0.8.0", + "rand 0.7.3", +] + +[[package]] +name = "phf_generator" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" +dependencies = [ + "phf_shared 0.10.0", + "rand 0.8.5", +] + +[[package]] +name = "phf_macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fde18ff429ffc8fe78e2bf7f8b7a5a5a6e2a8b58bc5a9ac69198bbda9189c" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "phf_macros" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "phf_shared" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" +dependencies = [ + "siphasher", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + +[[package]] +name = "plist" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd39bc6cdc9355ad1dc5eeedefee696bb35c34caf21768741e81826c0bbd7225" +dependencies = [ + "base64", + "indexmap", + "line-wrap", + "serde", + "time", + "xml-rs", +] + +[[package]] +name = "png" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0b0cabbbd20c2d7f06dbf015e06aad59b6ca3d9ed14848783e98af9aaf19925" +dependencies = [ + "bitflags", + "deflate", + "inflate", + "num-iter", +] + +[[package]] +name = "png" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d708eaf860a19b19ce538740d2b4bdeeb8337fa53f7738455e706623ad5c638" +dependencies = [ + "bitflags", + "crc32fast", + "flate2", + "miniz_oxide 0.6.2", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "proc-macro-crate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" +dependencies = [ + "once_cell", + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" + +[[package]] +name = "proc-macro2" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quick-xml" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11bafc859c6815fbaffbbbf4229ecb767ac913fecb27f9ad4343662e9ef099ea" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", + "rand_pcg", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.8", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_pcg" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "raw-window-handle" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed7e3d950b66e19e0c372f3fa3fbbcf85b1746b571f74e0c2af6042a5c93420a" +dependencies = [ + "cty", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom 0.2.8", + "redox_syscall", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "rfd" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0149778bd99b6959285b0933288206090c50e2327f47a9c463bfdbf45c8823ea" +dependencies = [ + "block", + "dispatch", + "glib-sys", + "gobject-sys", + "gtk-sys", + "js-sys", + "lazy_static", + "log", + "objc", + "objc-foundation", + "objc_id", + "raw-window-handle", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows 0.37.0", +] + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.14", +] + +[[package]] +name = "rustversion" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" + +[[package]] +name = "ryu" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" + +[[package]] +name = "safemem" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +dependencies = [ + "lazy_static", + "windows-sys 0.36.1", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "security-framework" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "selectors" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df320f1889ac4ba6bc0cdc9c9af7af4bd64bb927bccdf32d81140dc1f9be12fe" +dependencies = [ + "bitflags", + "cssparser", + "derive_more", + "fxhash", + "log", + "matches", + "phf 0.8.0", + "phf_codegen", + "precomputed-hash", + "servo_arc", + "smallvec", + "thin-slice", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" +dependencies = [ + "serde", +] + +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + +[[package]] +name = "serde" +version = "1.0.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" +dependencies = [ + "itoa 1.0.4", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fe39d9fbb0ebf5eb2c7cb7e2a47e4f462fad1379f1166b8ae49ad9eae89a7ca" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa 1.0.4", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" +dependencies = [ + "serde", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serialize-to-javascript" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9823f2d3b6a81d98228151fdeaf848206a7855a7a042bbf9bf870449a66cafb" +dependencies = [ + "serde", + "serde_json", + "serialize-to-javascript-impl", +] + +[[package]] +name = "serialize-to-javascript-impl" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74064874e9f6a15f04c1f3cb627902d0e6b410abbf36668afa873c61889f1763" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "servo_arc" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98238b800e0d1576d8b6e3de32827c2d74bee68bb97748dcf5071fb53965432" +dependencies = [ + "nodrop", + "stable_deref_trait", +] + +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shared_child" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0d94659ad3c2137fef23ae75b03d5241d633f8acded53d672decfa0e6e0caef" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "siphasher" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + +[[package]] +name = "slotmap" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +dependencies = [ + "version_check", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "soup2" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b4d76501d8ba387cf0fefbe055c3e0a59891d09f0f995ae4e4b16f6b60f3c0" +dependencies = [ + "bitflags", + "gio", + "glib", + "libc", + "once_cell", + "soup2-sys", +] + +[[package]] +name = "soup2-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "009ef427103fcb17f802871647a7fa6c60cbb654b4c4e4c0ac60a31c5f6dc9cf" +dependencies = [ + "bitflags", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps 5.0.0", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "state" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbe866e1e51e8260c9eed836a042a5e7f6726bb2b411dffeaa712e19c388f23b" +dependencies = [ + "loom", +] + +[[package]] +name = "string_cache" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213494b7a2b503146286049378ce02b482200519accc31872ee8be91fa820a08" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot", + "phf_shared 0.10.0", + "precomputed-hash", + "serde", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", + "proc-macro2", + "quote", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strum" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7ac893c7d471c8a21f31cfe213ec4f6d9afeed25537c772e08ef3f005f8729e" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339f799d8b549e3744c7ac7feb216383e4005d94bdb22561b3ab8f3b808ae9fb" +dependencies = [ + "heck 0.3.3", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sycamore" +version = "0.8.2" +source = "git+https://github.com/sycamore-rs/sycamore?rev=abd556cbc02047042dad2ebd04405e455a9b11b2#abd556cbc02047042dad2ebd04405e455a9b11b2" +dependencies = [ + "ahash", + "futures", + "indexmap", + "js-sys", + "paste", + "sycamore-core", + "sycamore-futures", + "sycamore-macro", + "sycamore-reactive", + "sycamore-web", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "sycamore-core" +version = "0.8.2" +source = "git+https://github.com/sycamore-rs/sycamore?rev=abd556cbc02047042dad2ebd04405e455a9b11b2#abd556cbc02047042dad2ebd04405e455a9b11b2" +dependencies = [ + "ahash", + "sycamore-reactive", +] + +[[package]] +name = "sycamore-futures" +version = "0.8.0" +source = "git+https://github.com/sycamore-rs/sycamore?rev=abd556cbc02047042dad2ebd04405e455a9b11b2#abd556cbc02047042dad2ebd04405e455a9b11b2" +dependencies = [ + "futures", + "sycamore-reactive", + "tokio", + "wasm-bindgen-futures", +] + +[[package]] +name = "sycamore-macro" +version = "0.8.2" +source = "git+https://github.com/sycamore-rs/sycamore?rev=abd556cbc02047042dad2ebd04405e455a9b11b2#abd556cbc02047042dad2ebd04405e455a9b11b2" +dependencies = [ + "once_cell", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sycamore-reactive" +version = "0.8.1" +source = "git+https://github.com/sycamore-rs/sycamore?rev=abd556cbc02047042dad2ebd04405e455a9b11b2#abd556cbc02047042dad2ebd04405e455a9b11b2" +dependencies = [ + "ahash", + "bumpalo", + "indexmap", + "slotmap", + "smallvec", +] + +[[package]] +name = "sycamore-web" +version = "0.8.2" +source = "git+https://github.com/sycamore-rs/sycamore?rev=abd556cbc02047042dad2ebd04405e455a9b11b2#abd556cbc02047042dad2ebd04405e455a9b11b2" +dependencies = [ + "html-escape", + "indexmap", + "js-sys", + "once_cell", + "sycamore-core", + "sycamore-reactive", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "syn" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "system-deps" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18db855554db7bd0e73e06cf7ba3df39f97812cb11d3f75e71c39bf45171797e" +dependencies = [ + "cfg-expr 0.9.1", + "heck 0.3.3", + "pkg-config", + "toml", + "version-compare 0.0.11", +] + +[[package]] +name = "system-deps" +version = "6.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2955b1fe31e1fa2fbd1976b71cc69a606d7d4da16f6de3333d0c92d51419aeff" +dependencies = [ + "cfg-expr 0.11.0", + "heck 0.4.0", + "pkg-config", + "toml", + "version-compare 0.1.0", +] + +[[package]] +name = "tao" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43336f5d1793543ba96e2a1e75f3a5c7dcd592743be06a0ab3a190f4fcb4b934" +dependencies = [ + "bitflags", + "cairo-rs", + "cc", + "cocoa", + "core-foundation", + "core-graphics", + "crossbeam-channel", + "dispatch", + "gdk", + "gdk-pixbuf", + "gdk-sys", + "gdkx11-sys", + "gio", + "glib", + "glib-sys", + "gtk", + "image", + "instant", + "jni", + "lazy_static", + "libc", + "log", + "ndk", + "ndk-context", + "ndk-sys", + "objc", + "once_cell", + "parking_lot", + "paste", + "png 0.17.7", + "raw-window-handle", + "scopeguard", + "serde", + "unicode-segmentation", + "uuid 1.2.1", + "windows 0.39.0", + "windows-implement", + "x11-dl", +] + +[[package]] +name = "tar" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "tauri" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efbf22abd61d95ca9b2becd77f9db4c093892f73e8a07d21d8b0b2bf71a7bcea" +dependencies = [ + "anyhow", + "attohttpc", + "cocoa", + "dirs-next", + "embed_plist", + "encoding_rs", + "flate2", + "futures-util", + "glib", + "glob", + "gtk", + "heck 0.4.0", + "http", + "ignore", + "notify-rust", + "objc", + "once_cell", + "open", + "os_info", + "os_pipe", + "percent-encoding", + "rand 0.8.5", + "raw-window-handle", + "regex", + "rfd", + "semver 1.0.14", + "serde", + "serde_json", + "serde_repr", + "serialize-to-javascript", + "shared_child", + "state", + "tar", + "tauri-macros", + "tauri-runtime", + "tauri-runtime-wry", + "tauri-utils", + "tempfile", + "thiserror", + "tokio", + "url", + "uuid 1.2.1", + "webkit2gtk", + "webview2-com", + "windows 0.39.0", +] + +[[package]] +name = "tauri-build" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0991fb306849897439dbd4a72e4cbed2413e2eb26cb4b3ba220b94edba8b4b88" +dependencies = [ + "anyhow", + "cargo_toml", + "heck 0.4.0", + "json-patch", + "semver 1.0.14", + "serde_json", + "tauri-utils", + "winres", +] + +[[package]] +name = "tauri-codegen" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "356fa253e40ae4d6ff02075011f2f2bb4066f5c9d8c1e16ca6912d7b75903ba6" +dependencies = [ + "base64", + "brotli", + "ico", + "json-patch", + "plist", + "png 0.17.7", + "proc-macro2", + "quote", + "regex", + "semver 1.0.14", + "serde", + "serde_json", + "sha2", + "tauri-utils", + "thiserror", + "time", + "uuid 1.2.1", + "walkdir", +] + +[[package]] +name = "tauri-macros" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6051fd6940ddb22af452340d03c66a3e2f5d72e0788d4081d91e31528ccdc4d" +dependencies = [ + "heck 0.4.0", + "proc-macro2", + "quote", + "syn", + "tauri-codegen", + "tauri-utils", +] + +[[package]] +name = "tauri-runtime" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d49439a5ea47f474572b854972f42eda2e02a470be5ca9609cc83bb66945abe2" +dependencies = [ + "gtk", + "http", + "http-range", + "infer", + "rand 0.8.5", + "raw-window-handle", + "serde", + "serde_json", + "tauri-utils", + "thiserror", + "uuid 1.2.1", + "webview2-com", + "windows 0.39.0", +] + +[[package]] +name = "tauri-runtime-wry" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dce920995fd49907aa9bea7249ed1771454f11f7611924c920a1f75fb614d4" +dependencies = [ + "cocoa", + "gtk", + "percent-encoding", + "rand 0.8.5", + "raw-window-handle", + "tauri-runtime", + "tauri-utils", + "uuid 1.2.1", + "webkit2gtk", + "webview2-com", + "windows 0.39.0", + "wry", +] + +[[package]] +name = "tauri-sys" +version = "0.1.0" +dependencies = [ + "js-sys", + "semver 1.0.14", + "serde", + "serde-wasm-bindgen", + "thiserror", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", +] + +[[package]] +name = "tauri-sys-test" +version = "0.0.0" +dependencies = [ + "serde", + "serde_json", + "tauri", + "tauri-build", +] + +[[package]] +name = "tauri-sys-test-ui" +version = "0.0.0" +dependencies = [ + "anyhow", + "console_error_panic_hook", + "futures-util", + "serde", + "sycamore", + "tauri-sys", + "wasm-bindgen-futures", +] + +[[package]] +name = "tauri-utils" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e8fdae6f29cef959809a3c3afef510c5b715a446a597ab8b791497585363f39" +dependencies = [ + "brotli", + "ctor", + "glob", + "heck 0.4.0", + "html5ever", + "json-patch", + "kuchiki", + "memchr", + "phf 0.10.1", + "proc-macro2", + "quote", + "semver 1.0.14", + "serde", + "serde_json", + "serde_with", + "thiserror", + "url", + "walkdir", + "windows 0.39.0", +] + +[[package]] +name = "tauri-winrt-notification" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c58de036c4d2e20717024de2a3c4bf56c301f07b21bc8ef9b57189fce06f1f3b" +dependencies = [ + "quick-xml", + "strum", + "windows 0.39.0", +] + +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", +] + +[[package]] +name = "tendril" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" +dependencies = [ + "futf", + "mac", + "utf-8", +] + +[[package]] +name = "thin-slice" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" + +[[package]] +name = "thiserror" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +dependencies = [ + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fab5c8b9980850e06d92ddbe3ab839c062c801f3927c0fb8abd6fc8e918fbca" +dependencies = [ + "itoa 1.0.4", + "libc", + "num_threads", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] +name = "time-macros" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bb801831d812c562ae7d2bfb531f26e66e4e1f6b17307ba4149c5064710e5b" +dependencies = [ + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +dependencies = [ + "autocfg", + "bytes", + "memchr", + "num_cpus", + "pin-project-lite", +] + +[[package]] +name = "toml" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +dependencies = [ + "serde", +] + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "treediff" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "761e8d5ad7ce14bb82b7e61ccc0ca961005a275a060b9644a2431aa11553c2ff" +dependencies = [ + "serde_json", +] + +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "ucd-trie" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" + +[[package]] +name = "unicode-bidi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-ident" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "utf8-width" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5190c9442dcdaf0ddd50f37420417d219ae5261bbf5db120d0f9bab996c9cba1" + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" + +[[package]] +name = "uuid" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "feb41e78f93363bb2df8b0e86a2ca30eed7806ea16ea0c790d757cf93f79be83" +dependencies = [ + "getrandom 0.2.8", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version-compare" +version = "0.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c18c859eead79d8b95d09e4678566e8d70105c4e7b251f707a03df32442661b" + +[[package]] +name = "version-compare" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe88247b92c1df6b6de80ddc290f3976dbdf2f5f5d3fd049a9fb598c6dd5ca73" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "walkdir" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +dependencies = [ + "same-file", + "winapi", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +dependencies = [ + "cfg-if", + "serde_json", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" + +[[package]] +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webkit2gtk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8f859735e4a452aeb28c6c56a852967a8a76c8eb1cc32dbf931ad28a13d6370" +dependencies = [ + "bitflags", + "cairo-rs", + "gdk", + "gdk-sys", + "gio", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", + "gtk", + "gtk-sys", + "javascriptcore-rs", + "libc", + "once_cell", + "soup2", + "webkit2gtk-sys", +] + +[[package]] +name = "webkit2gtk-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d76ca6ecc47aeba01ec61e480139dda143796abcae6f83bcddf50d6b5b1dcf3" +dependencies = [ + "atk-sys", + "bitflags", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "gtk-sys", + "javascriptcore-rs-sys", + "libc", + "pango-sys", + "pkg-config", + "soup2-sys", + "system-deps 6.0.3", +] + +[[package]] +name = "webview2-com" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4a769c9f1a64a8734bde70caafac2b96cada12cd4aefa49196b3a386b8b4178" +dependencies = [ + "webview2-com-macros", + "webview2-com-sys", + "windows 0.39.0", + "windows-implement", +] + +[[package]] +name = "webview2-com-macros" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaebe196c01691db62e9e4ca52c5ef1e4fd837dcae27dae3ada599b5a8fd05ac" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "webview2-com-sys" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac48ef20ddf657755fdcda8dfed2a7b4fc7e4581acce6fe9b88c3d64f29dee7" +dependencies = [ + "regex", + "serde", + "serde_json", + "thiserror", + "windows 0.39.0", + "windows-bindgen", + "windows-metadata", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbedf6db9096bc2364adce0ae0aa636dcd89f3c3f2cd67947062aaf0ca2a10ec" +dependencies = [ + "windows_aarch64_msvc 0.32.0", + "windows_i686_gnu 0.32.0", + "windows_i686_msvc 0.32.0", + "windows_x86_64_gnu 0.32.0", + "windows_x86_64_msvc 0.32.0", +] + +[[package]] +name = "windows" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57b543186b344cc61c85b5aab0d2e3adf4e0f99bc076eff9aa5927bcc0b8a647" +dependencies = [ + "windows_aarch64_msvc 0.37.0", + "windows_i686_gnu 0.37.0", + "windows_i686_msvc 0.37.0", + "windows_x86_64_gnu 0.37.0", + "windows_x86_64_msvc 0.37.0", +] + +[[package]] +name = "windows" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1c4bd0a50ac6020f65184721f758dba47bb9fbc2133df715ec74a237b26794a" +dependencies = [ + "windows-implement", + "windows_aarch64_msvc 0.39.0", + "windows_i686_gnu 0.39.0", + "windows_i686_msvc 0.39.0", + "windows_x86_64_gnu 0.39.0", + "windows_x86_64_msvc 0.39.0", +] + +[[package]] +name = "windows-bindgen" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68003dbd0e38abc0fb85b939240f4bce37c43a5981d3df37ccbaaa981b47cb41" +dependencies = [ + "windows-metadata", + "windows-tokens", +] + +[[package]] +name = "windows-implement" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba01f98f509cb5dc05f4e5fc95e535f78260f15fea8fe1a8abdd08f774f1cee7" +dependencies = [ + "syn", + "windows-tokens", +] + +[[package]] +name = "windows-metadata" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ee5e275231f07c6e240d14f34e1b635bf1faa1c76c57cfd59a5cdb9848e4278" + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.0", +] + +[[package]] +name = "windows-tokens" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f838de2fe15fe6bac988e74b798f26499a8b21a9d97edec321e79b28d1d7f597" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8e92753b1c443191654ec532f14c199742964a061be25d77d7a96f09db20bf5" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2623277cb2d1c216ba3b578c0f3cf9cdebeddb6e66b1b218bb33596ea7769c3a" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec7711666096bd4096ffa835238905bb33fb87267910e154b18b44eaabb340f2" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + +[[package]] +name = "windows_i686_gnu" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a711c68811799e017b6038e0922cb27a5e2f43a2ddb609fe0b6f3eeda9de615" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_gnu" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3925fd0b0b804730d44d4b6278c50f9699703ec49bcd628020f46f4ba07d9e1" + +[[package]] +name = "windows_i686_gnu" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "763fc57100a5f7042e3057e7e8d9bdd7860d330070251a73d003563a3bb49e1b" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + +[[package]] +name = "windows_i686_msvc" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c11bb1a02615db74680b32a68e2d61f553cc24c4eb5b4ca10311740e44172" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_i686_msvc" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce907ac74fe331b524c1298683efbf598bb031bc84d5e274db2083696d07c57c" + +[[package]] +name = "windows_i686_msvc" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bc7cbfe58828921e10a9f446fcaaf649204dcfe6c1ddd712c5eebae6bda1106" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c912b12f7454c6620635bbff3450962753834be2a594819bd5e945af18ec64bc" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2babfba0828f2e6b32457d5341427dcbb577ceef556273229959ac23a10af33d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6868c165637d653ae1e8dc4d82c25d4f97dd6605eaa8d784b5c6e0ab2a252b65" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4dd6dc7df2d84cf7b33822ed5b86318fb1781948e9663bacd047fc9dd52259d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e4d40883ae9cae962787ca76ba76390ffa29214667a111db9e0a1ad8377e809" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + +[[package]] +name = "winres" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c" +dependencies = [ + "toml", +] + +[[package]] +name = "wry" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff5c1352b4266fdf92c63479d2f58ab4cd29dc4e78fbc1b62011ed1227926945" +dependencies = [ + "base64", + "block", + "cocoa", + "core-graphics", + "crossbeam-channel", + "gdk", + "gio", + "glib", + "gtk", + "html5ever", + "http", + "kuchiki", + "libc", + "log", + "objc", + "objc_id", + "once_cell", + "serde", + "serde_json", + "sha2", + "tao", + "thiserror", + "url", + "webkit2gtk", + "webkit2gtk-sys", + "webview2-com", + "windows 0.39.0", + "windows-implement", +] + +[[package]] +name = "x11" +version = "2.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7ae97874a928d821b061fce3d1fc52f08071dd53c89a6102bc06efcac3b2908" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "x11-dl" +version = "2.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c83627bc137605acc00bb399c7b908ef460b621fc37c953db2b09f88c449ea6" +dependencies = [ + "lazy_static", + "libc", + "pkg-config", +] + +[[package]] +name = "xattr" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" +dependencies = [ + "libc", +] + +[[package]] +name = "xml-rs" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" diff --git a/examples/api/Cargo.toml b/examples/test/Cargo.toml similarity index 53% rename from examples/api/Cargo.toml rename to examples/test/Cargo.toml index 37c7504..6ea130e 100644 --- a/examples/api/Cargo.toml +++ b/examples/test/Cargo.toml @@ -1,21 +1,19 @@ [package] -name = "tauri-app-ui" +name = "tauri-sys-test-ui" version = "0.0.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] tauri-sys = { path = "../../", features = ["all"] } -serde = { version = "1.0.140", features = ["derive"] } -sycamore = { git = "https://github.com/sycamore-rs/sycamore", rev = "abd556cbc02047042dad2ebd04405e455a9b11b2", features = ["suspense", "hydrate"] } -sycamore-router = { git = "https://github.com/sycamore-rs/sycamore", rev = "abd556cbc02047042dad2ebd04405e455a9b11b2" } -log = "0.4.17" +sycamore = { git = "https://github.com/sycamore-rs/sycamore", rev = "abd556cbc02047042dad2ebd04405e455a9b11b2", features = ["suspense"] } +anyhow = "1.0.66" +console_error_panic_hook = "0.1.7" +wasm-bindgen-futures = "0.4.32" +futures-util = "0.3.25" +serde = { version = "1.0.147", features = ["derive"] } wasm-logger = "0.2.0" -gloo-timers = "0.2.4" -shared = { path = "shared" } +log = "0.4.17" [features] -ssg = ["sycamore/ssr"] - -[workspace] -members = ["src-tauri", "shared"] +ci = [] diff --git a/examples/test/Trunk.toml b/examples/test/Trunk.toml new file mode 100644 index 0000000..856f3d2 --- /dev/null +++ b/examples/test/Trunk.toml @@ -0,0 +1,10 @@ +[build] +target = "./index.html" + +[watch] +ignore = ["./src-tauri"] + +[serve] +address = "127.0.0.1" +port = 1420 +open = false \ No newline at end of file diff --git a/examples/test/index.html b/examples/test/index.html new file mode 100644 index 0000000..417f143 --- /dev/null +++ b/examples/test/index.html @@ -0,0 +1,7 @@ + + + + + Tauri + Yew App + + diff --git a/examples/api/src-tauri/.gitignore b/examples/test/src-tauri/.gitignore similarity index 100% rename from examples/api/src-tauri/.gitignore rename to examples/test/src-tauri/.gitignore diff --git a/examples/api/src-tauri/Cargo.toml b/examples/test/src-tauri/Cargo.toml similarity index 76% rename from examples/api/src-tauri/Cargo.toml rename to examples/test/src-tauri/Cargo.toml index 400173d..fb0e37b 100644 --- a/examples/api/src-tauri/Cargo.toml +++ b/examples/test/src-tauri/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "tauri-app" +name = "tauri-sys-test" version = "0.0.0" description = "A Tauri App" authors = ["you"] @@ -11,13 +11,12 @@ rust-version = "1.57" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [build-dependencies] -tauri-build = { git = "https://github.com/tauri-apps/tauri", features = [] } +tauri-build = { version = "1.2", features = [] } [dependencies] serde_json = "1.0" serde = { version = "1.0", features = ["derive"] } -tauri = { git = "https://github.com/tauri-apps/tauri", features = ["api-all", "updater"] } -shared = { path = "../shared" } +tauri = { version = "1.2", features = ["api-all"] } [features] # by default Tauri runs in production mode diff --git a/examples/api/src-tauri/build.rs b/examples/test/src-tauri/build.rs similarity index 100% rename from examples/api/src-tauri/build.rs rename to examples/test/src-tauri/build.rs diff --git a/examples/test/src-tauri/ci.tauri.conf.json b/examples/test/src-tauri/ci.tauri.conf.json new file mode 100644 index 0000000..b23a6dd --- /dev/null +++ b/examples/test/src-tauri/ci.tauri.conf.json @@ -0,0 +1,6 @@ +{ + "build": { + "beforeDevCommand": "trunk serve --features ci", + "beforeBuildCommand": "trunk build --release --features ci" + } +} diff --git a/examples/api/src-tauri/icons/128x128.png b/examples/test/src-tauri/icons/128x128.png similarity index 100% rename from examples/api/src-tauri/icons/128x128.png rename to examples/test/src-tauri/icons/128x128.png diff --git a/examples/api/src-tauri/icons/128x128@2x.png b/examples/test/src-tauri/icons/128x128@2x.png similarity index 100% rename from examples/api/src-tauri/icons/128x128@2x.png rename to examples/test/src-tauri/icons/128x128@2x.png diff --git a/examples/api/src-tauri/icons/32x32.png b/examples/test/src-tauri/icons/32x32.png similarity index 100% rename from examples/api/src-tauri/icons/32x32.png rename to examples/test/src-tauri/icons/32x32.png diff --git a/examples/api/src-tauri/icons/Square107x107Logo.png b/examples/test/src-tauri/icons/Square107x107Logo.png similarity index 100% rename from examples/api/src-tauri/icons/Square107x107Logo.png rename to examples/test/src-tauri/icons/Square107x107Logo.png diff --git a/examples/api/src-tauri/icons/Square142x142Logo.png b/examples/test/src-tauri/icons/Square142x142Logo.png similarity index 100% rename from examples/api/src-tauri/icons/Square142x142Logo.png rename to examples/test/src-tauri/icons/Square142x142Logo.png diff --git a/examples/api/src-tauri/icons/Square150x150Logo.png b/examples/test/src-tauri/icons/Square150x150Logo.png similarity index 100% rename from examples/api/src-tauri/icons/Square150x150Logo.png rename to examples/test/src-tauri/icons/Square150x150Logo.png diff --git a/examples/api/src-tauri/icons/Square284x284Logo.png b/examples/test/src-tauri/icons/Square284x284Logo.png similarity index 100% rename from examples/api/src-tauri/icons/Square284x284Logo.png rename to examples/test/src-tauri/icons/Square284x284Logo.png diff --git a/examples/api/src-tauri/icons/Square30x30Logo.png b/examples/test/src-tauri/icons/Square30x30Logo.png similarity index 100% rename from examples/api/src-tauri/icons/Square30x30Logo.png rename to examples/test/src-tauri/icons/Square30x30Logo.png diff --git a/examples/api/src-tauri/icons/Square310x310Logo.png b/examples/test/src-tauri/icons/Square310x310Logo.png similarity index 100% rename from examples/api/src-tauri/icons/Square310x310Logo.png rename to examples/test/src-tauri/icons/Square310x310Logo.png diff --git a/examples/api/src-tauri/icons/Square44x44Logo.png b/examples/test/src-tauri/icons/Square44x44Logo.png similarity index 100% rename from examples/api/src-tauri/icons/Square44x44Logo.png rename to examples/test/src-tauri/icons/Square44x44Logo.png diff --git a/examples/api/src-tauri/icons/Square71x71Logo.png b/examples/test/src-tauri/icons/Square71x71Logo.png similarity index 100% rename from examples/api/src-tauri/icons/Square71x71Logo.png rename to examples/test/src-tauri/icons/Square71x71Logo.png diff --git a/examples/api/src-tauri/icons/Square89x89Logo.png b/examples/test/src-tauri/icons/Square89x89Logo.png similarity index 100% rename from examples/api/src-tauri/icons/Square89x89Logo.png rename to examples/test/src-tauri/icons/Square89x89Logo.png diff --git a/examples/api/src-tauri/icons/StoreLogo.png b/examples/test/src-tauri/icons/StoreLogo.png similarity index 100% rename from examples/api/src-tauri/icons/StoreLogo.png rename to examples/test/src-tauri/icons/StoreLogo.png diff --git a/examples/api/src-tauri/icons/icon.icns b/examples/test/src-tauri/icons/icon.icns similarity index 100% rename from examples/api/src-tauri/icons/icon.icns rename to examples/test/src-tauri/icons/icon.icns diff --git a/examples/api/src-tauri/icons/icon.ico b/examples/test/src-tauri/icons/icon.ico similarity index 100% rename from examples/api/src-tauri/icons/icon.ico rename to examples/test/src-tauri/icons/icon.ico diff --git a/examples/api/src-tauri/icons/icon.png b/examples/test/src-tauri/icons/icon.png similarity index 100% rename from examples/api/src-tauri/icons/icon.png rename to examples/test/src-tauri/icons/icon.png diff --git a/examples/test/src-tauri/src/main.rs b/examples/test/src-tauri/src/main.rs new file mode 100644 index 0000000..e5eeef1 --- /dev/null +++ b/examples/test/src-tauri/src/main.rs @@ -0,0 +1,41 @@ +#![cfg_attr( + all(not(debug_assertions), target_os = "windows"), + windows_subsystem = "windows" +)] + +use std::sync::atomic::{AtomicBool, Ordering}; + +use tauri::{Manager, State, api::notification::Notification}; + +struct Received(AtomicBool); +// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command +#[tauri::command] +fn verify_receive(emitted: State) -> bool { + emitted.0.load(Ordering::Relaxed) +} + +#[tauri::command] +fn exit_with_error(e: &str) -> bool { + eprintln!("{}", e); + std::process::exit(1); +} + +fn main() { + tauri::Builder::default() + .invoke_handler(tauri::generate_handler![verify_receive, exit_with_error]) + .setup(|app| { + app.manage(Received(AtomicBool::new(false))); + + let app_handle = app.handle(); + app.listen_global("foo", move |_| { + app_handle + .state::() + .0 + .store(true, Ordering::Relaxed); + }); + + Ok(()) + }) + .run(tauri::generate_context!()) + .expect("error while running tauri application"); +} diff --git a/examples/api/src-tauri/tauri.conf.json b/examples/test/src-tauri/tauri.conf.json similarity index 94% rename from examples/api/src-tauri/tauri.conf.json rename to examples/test/src-tauri/tauri.conf.json index 32eedf6..660d3fd 100644 --- a/examples/api/src-tauri/tauri.conf.json +++ b/examples/test/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ "withGlobalTauri": true }, "package": { - "productName": "tauri-app", + "productName": "tauri-sys-test", "version": "0.0.0" }, "tauri": { @@ -63,7 +63,7 @@ "fullscreen": false, "height": 600, "resizable": true, - "title": "tauri-app", + "title": "tauri-sys testing suite", "width": 800 } ] diff --git a/examples/test/src/app.rs b/examples/test/src/app.rs new file mode 100644 index 0000000..693516b --- /dev/null +++ b/examples/test/src/app.rs @@ -0,0 +1,34 @@ +use anyhow::ensure; +use tauri_sys::app; + +pub async fn get_name() -> anyhow::Result<()> { + let name = app::get_name().await?; + + ensure!(name == "tauri-sys-test"); + + Ok(()) +} + +pub async fn get_version() -> anyhow::Result<()> { + let version = app::get_version().await?; + + ensure!(version.major == 0); + ensure!(version.minor == 0); + ensure!(version.patch == 0); + ensure!(version.build.is_empty()); + ensure!(version.pre.is_empty()); + + Ok(()) +} + +pub async fn get_tauri_version() -> anyhow::Result<()> { + let version = app::get_tauri_version().await?; + + ensure!(version.major == 1); + ensure!(version.minor == 2); + ensure!(version.patch == 0); + ensure!(version.build.is_empty()); + ensure!(version.pre.is_empty()); + + Ok(()) +} diff --git a/examples/test/src/clipboard.rs b/examples/test/src/clipboard.rs new file mode 100644 index 0000000..680766f --- /dev/null +++ b/examples/test/src/clipboard.rs @@ -0,0 +1,12 @@ +use anyhow::ensure; +use tauri_sys::clipboard; + +pub async fn test() -> anyhow::Result<()> { + clipboard::write_text("foobar").await?; + + let text = clipboard::read_text().await?; + + ensure!(text == "foobar".to_string()); + + Ok(()) +} diff --git a/examples/test/src/dialog.rs b/examples/test/src/dialog.rs new file mode 100644 index 0000000..c852a77 --- /dev/null +++ b/examples/test/src/dialog.rs @@ -0,0 +1,97 @@ +use anyhow::ensure; +use tauri_sys::dialog::{FileDialogBuilder, MessageDialogBuilder, MessageDialogType}; + +pub async fn ask() -> anyhow::Result<()> { + let mut builder = MessageDialogBuilder::new(); + builder.set_title("Tauri"); + builder.set_type(MessageDialogType::Warning); + + let works = builder + .ask("Does this work? \n Click Yes to mark this test as passing") + .await?; + + ensure!(works); + + Ok(()) +} + +pub async fn confirm() -> anyhow::Result<()> { + let mut builder = MessageDialogBuilder::new(); + builder.set_title("Tauri"); + builder.set_type(MessageDialogType::Warning); + + let works = builder + .confirm("Does this work? \n Click Ok to mark this test as passing") + .await?; + + ensure!(works); + + Ok(()) +} + +pub async fn message() -> anyhow::Result<()> { + let mut builder = MessageDialogBuilder::new(); + builder.set_title("Tauri"); + builder.set_type(MessageDialogType::Warning); + + builder.message("This is a message just for you!").await?; + + Ok(()) +} + +pub async fn pick_file() -> anyhow::Result<()> { + let mut builder = FileDialogBuilder::new(); + builder.set_title("Select a file to mark this test as passing"); + + let file = builder.pick_file().await?; + + ensure!(file.is_some()); + + Ok(()) +} + +pub async fn pick_files() -> anyhow::Result<()> { + let mut builder = FileDialogBuilder::new(); + builder.set_title("Select a multiple files to mark this test as passing"); + + let file = builder.pick_files().await?; + + ensure!(file.is_some()); + ensure!(file.unwrap().len() > 1); + + Ok(()) +} + +pub async fn pick_folder() -> anyhow::Result<()> { + let mut builder = FileDialogBuilder::new(); + builder.set_title("Select a folder to mark this test as passing"); + + let file = builder.pick_folder().await?; + + ensure!(file.is_some()); + + Ok(()) +} + +pub async fn pick_folders() -> anyhow::Result<()> { + let mut builder = FileDialogBuilder::new(); + builder.set_title("Select a multiple folders to mark this test as passing"); + + let file = builder.pick_folders().await?; + + ensure!(file.is_some()); + ensure!(file.unwrap().len() > 1); + + Ok(()) +} + +pub async fn save() -> anyhow::Result<()> { + let mut builder = FileDialogBuilder::new(); + builder.set_title("Select a file to mark this test as passing"); + + let file = builder.save().await?; + + ensure!(file.is_some()); + + Ok(()) +} \ No newline at end of file diff --git a/examples/test/src/event.rs b/examples/test/src/event.rs new file mode 100644 index 0000000..e7aa7f1 --- /dev/null +++ b/examples/test/src/event.rs @@ -0,0 +1,10 @@ +use anyhow::ensure; +use tauri_sys::{event, tauri}; + +pub async fn emit() -> anyhow::Result<()> { + event::emit("foo", &"bar").await?; + + ensure!(tauri::invoke::<_, bool>("verify_receive", &()).await?); + + Ok(()) +} diff --git a/examples/test/src/main.rs b/examples/test/src/main.rs new file mode 100644 index 0000000..5630f5d --- /dev/null +++ b/examples/test/src/main.rs @@ -0,0 +1,175 @@ +mod app; +mod clipboard; +mod event; +mod window; +mod dialog; +mod notification; +mod os; + +extern crate console_error_panic_hook; +use std::future::Future; +use std::panic; +use sycamore::prelude::*; +use sycamore::suspense::Suspense; + +#[cfg(feature = "ci")] +async fn exit_with_error(e: String) { + use serde::Serialize; + + #[derive(Serialize)] + struct Args { + e: String, + } + + tauri_sys::tauri::invoke::<_, ()>("exit_with_error", &Args { e }) + .await + .unwrap(); +} + +#[derive(Props)] +pub struct TestProps<'a, F> +where + F: Future> + 'a, +{ + name: &'a str, + test: F, +} + +#[component] +pub async fn Test<'a, G: Html, F>(cx: Scope<'a>, props: TestProps<'a, F>) -> View +where + F: Future> + 'a, +{ + let res = props.test.await; + + view! { cx, + tr { + td { code { (props.name.to_string()) } } + td { (if let Err(e) = &res { + #[cfg(feature = "ci")] + { + wasm_bindgen_futures::spawn_local(exit_with_error(e.to_string())); + unreachable!() + } + #[cfg(not(feature = "ci"))] + format!("❌ {:?}", e) + } else { + format!("✅") + }) + } + } + } +} + +#[cfg(not(feature = "ci"))] +#[component] +pub async fn InteractiveTest<'a, G: Html, F>(cx: Scope<'a>, props: TestProps<'a, F>) -> View +where + F: Future> + 'a, +{ + let mut test = Some(props.test); + let render_test = create_signal(cx, false); + + let run_test = |_| { + render_test.set(true); + }; + + view! { cx, + (if *render_test.get() { + let test = test.take().unwrap(); + + let fallback = view! { cx, + tr { + td { code { (props.name.to_string()) } } + td { + "Running Test..." + } + } + }; + + view! { cx, + Suspense(fallback=fallback) { + Test(name=props.name, test=test) + } + } + } else { + view! { cx, + tr { + td { code { (props.name.to_string()) } } + td { + button(on:click=run_test) { "Run Interactive Test"} + } + } + } + }) + } +} + +#[cfg(feature = "ci")] +#[component] +pub async fn InteractiveTest<'a, G: Html, F>(cx: Scope<'a>, _props: TestProps<'a, F>) -> View +where + F: Future> + 'a, +{ + view! { cx, "Interactive tests are not run in CI mode" } +} + +#[component] +pub async fn Terminate<'a, G: Html>(cx: Scope<'a>) -> View { + #[cfg(feature = "ci")] + sycamore::suspense::await_suspense(cx, async { + tauri_sys::process::exit(0).await; + }) + .await; + + view! { + cx, + } +} + +fn main() { + wasm_logger::init(wasm_logger::Config::default()); + + panic::set_hook(Box::new(|info| { + console_error_panic_hook::hook(info); + + #[cfg(feature = "ci")] + wasm_bindgen_futures::spawn_local(exit_with_error(format!("{}", info))); + })); + + sycamore::render(|cx| { + view! { cx, + table { + tbody { + Suspense(fallback=view!{ cx, "Running Tests..." }) { + Test(name="app::get_name",test=app::get_name()) + Test(name="app::get_version",test=app::get_version()) + Test(name="app::get_tauri_version",test=app::get_tauri_version()) + Test(name="clipboard::read_text | clipboard::write_text",test=clipboard::test()) + Test(name="event::emit",test=event::emit()) + InteractiveTest(name="dialog::message",test=dialog::message()) + InteractiveTest(name="dialog::ask",test=dialog::ask()) + InteractiveTest(name="dialog::confirm",test=dialog::confirm()) + InteractiveTest(name="dialog::pick_file",test=dialog::pick_file()) + InteractiveTest(name="dialog::pick_files",test=dialog::pick_files()) + InteractiveTest(name="dialog::pick_folder",test=dialog::pick_folder()) + InteractiveTest(name="dialog::pick_folders",test=dialog::pick_folders()) + InteractiveTest(name="dialog::save",test=dialog::save()) + Test(name="os::arch",test=os::arch()) + Test(name="os::platform",test=os::platform()) + Test(name="os::tempdir",test=os::tempdir()) + Test(name="os::kind",test=os::kind()) + Test(name="os::version",test=os::version()) + Test(name="notification::is_permission_granted",test=notification::is_permission_granted()) + Test(name="notification::request_permission",test=notification::request_permission()) + InteractiveTest(name="notification::show_notification",test=notification::show_notification()) + + // Test(name="window::WebviewWindow::new",test=window::create_window()) + + Terminate + } + } + } + } + }); +} diff --git a/examples/test/src/notification.rs b/examples/test/src/notification.rs new file mode 100644 index 0000000..1ce9dfd --- /dev/null +++ b/examples/test/src/notification.rs @@ -0,0 +1,28 @@ +use anyhow::ensure; +use tauri_sys::notification::{self, Permission}; + +pub async fn is_permission_granted() -> anyhow::Result<()> { + let granted = notification::is_permission_granted().await?; + + ensure!(granted); + + Ok(()) +} + +pub async fn request_permission() -> anyhow::Result<()> { + let permission = notification::request_permission().await?; + + ensure!(permission == Permission::Granted); + + Ok(()) +} + +pub async fn show_notification() -> anyhow::Result<()> { + let mut n = notification::Notification::default(); + n.set_title("TAURI"); + n.set_body("Tauri is awesome!"); + + n.show()?; + + Ok(()) +} \ No newline at end of file diff --git a/examples/test/src/os.rs b/examples/test/src/os.rs new file mode 100644 index 0000000..f7f31a4 --- /dev/null +++ b/examples/test/src/os.rs @@ -0,0 +1,41 @@ +use tauri_sys::os; + +pub async fn arch() -> anyhow::Result<()> { + let arch = os::arch().await?; + + log::debug!("{:?}", arch); + + Ok(()) +} + +pub async fn platform() -> anyhow::Result<()> { + let platform = os::platform().await?; + + log::debug!("{:?}", platform); + + Ok(()) +} + +pub async fn tempdir() -> anyhow::Result<()> { + let tempdir = os::tempdir().await?; + + log::debug!("{:?}", tempdir); + + Ok(()) +} + +pub async fn kind() -> anyhow::Result<()> { + let kind = os::kind().await?; + + log::debug!("{:?}", kind); + + Ok(()) +} + +pub async fn version() -> anyhow::Result<()> { + let version = os::version().await?; + + log::debug!("{:?}", version); + + Ok(()) +} \ No newline at end of file diff --git a/examples/test/src/window.rs b/examples/test/src/window.rs new file mode 100644 index 0000000..68f2538 --- /dev/null +++ b/examples/test/src/window.rs @@ -0,0 +1,13 @@ +use anyhow::ensure; +use tauri_sys::window; + +pub async fn create_window() -> anyhow::Result<()> { + let win = window::WebviewWindow::new("foo", ()); + + ensure!(win.is_visible().await?); + // ensure!(win.label() == "foo".to_string()); + + win.close().await?; + + Ok(()) +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..b99b41c --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "tauri-sys", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "build": "esbuild --outdir=src --format=esm --bundle tauri/tooling/api/src/*.ts" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "esbuild": "^0.15.13" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..fbedf0f --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,237 @@ +lockfileVersion: 5.4 + +specifiers: + esbuild: ^0.15.13 + +devDependencies: + esbuild: 0.15.13 + +packages: + + /@esbuild/android-arm/0.15.13: + resolution: {integrity: sha512-RY2fVI8O0iFUNvZirXaQ1vMvK0xhCcl0gqRj74Z6yEiO1zAUa7hbsdwZM1kzqbxHK7LFyMizipfXT3JME+12Hw==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64/0.15.13: + resolution: {integrity: sha512-+BoyIm4I8uJmH/QDIH0fu7MG0AEx9OXEDXnqptXCwKOlOqZiS4iraH1Nr7/ObLMokW3sOCeBNyD68ATcV9b9Ag==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-android-64/0.15.13: + resolution: {integrity: sha512-yRorukXBlokwTip+Sy4MYskLhJsO0Kn0/Fj43s1krVblfwP+hMD37a4Wmg139GEsMLl+vh8WXp2mq/cTA9J97g==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /esbuild-android-arm64/0.15.13: + resolution: {integrity: sha512-TKzyymLD6PiVeyYa4c5wdPw87BeAiTXNtK6amWUcXZxkV51gOk5u5qzmDaYSwiWeecSNHamFsaFjLoi32QR5/w==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /esbuild-darwin-64/0.15.13: + resolution: {integrity: sha512-WAx7c2DaOS6CrRcoYCgXgkXDliLnFv3pQLV6GeW1YcGEZq2Gnl8s9Pg7ahValZkpOa0iE/ojRVQ87sbUhF1Cbg==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /esbuild-darwin-arm64/0.15.13: + resolution: {integrity: sha512-U6jFsPfSSxC3V1CLiQqwvDuj3GGrtQNB3P3nNC3+q99EKf94UGpsG9l4CQ83zBs1NHrk1rtCSYT0+KfK5LsD8A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /esbuild-freebsd-64/0.15.13: + resolution: {integrity: sha512-whItJgDiOXaDG/idy75qqevIpZjnReZkMGCgQaBWZuKHoElDJC1rh7MpoUgupMcdfOd+PgdEwNQW9DAE6i8wyA==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-freebsd-arm64/0.15.13: + resolution: {integrity: sha512-6pCSWt8mLUbPtygv7cufV0sZLeylaMwS5Fznj6Rsx9G2AJJsAjQ9ifA+0rQEIg7DwJmi9it+WjzNTEAzzdoM3Q==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-32/0.15.13: + resolution: {integrity: sha512-VbZdWOEdrJiYApm2kkxoTOgsoCO1krBZ3quHdYk3g3ivWaMwNIVPIfEE0f0XQQ0u5pJtBsnk2/7OPiCFIPOe/w==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-64/0.15.13: + resolution: {integrity: sha512-rXmnArVNio6yANSqDQlIO4WiP+Cv7+9EuAHNnag7rByAqFVuRusLbGi2697A5dFPNXoO//IiogVwi3AdcfPC6A==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /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-arm64/0.15.13: + resolution: {integrity: sha512-alEMGU4Z+d17U7KQQw2IV8tQycO6T+rOrgW8OS22Ua25x6kHxoG6Ngry6Aq6uranC+pNWNMB6aHFPh7aTQdORQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-mips64le/0.15.13: + resolution: {integrity: sha512-47PgmyYEu+yN5rD/MbwS6DxP2FSGPo4Uxg5LwIdxTiyGC2XKwHhHyW7YYEDlSuXLQXEdTO7mYe8zQ74czP7W8A==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-ppc64le/0.15.13: + resolution: {integrity: sha512-z6n28h2+PC1Ayle9DjKoBRcx/4cxHoOa2e689e2aDJSaKug3jXcQw7mM+GLg+9ydYoNzj8QxNL8ihOv/OnezhA==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-riscv64/0.15.13: + resolution: {integrity: sha512-+Lu4zuuXuQhgLUGyZloWCqTslcCAjMZH1k3Xc9MSEJEpEFdpsSU0sRDXAnk18FKOfEjhu4YMGaykx9xjtpA6ow==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-s390x/0.15.13: + resolution: {integrity: sha512-BMeXRljruf7J0TMxD5CIXS65y7puiZkAh+s4XFV9qy16SxOuMhxhVIXYLnbdfLrsYGFzx7U9mcdpFWkkvy/Uag==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-netbsd-64/0.15.13: + resolution: {integrity: sha512-EHj9QZOTel581JPj7UO3xYbltFTYnHy+SIqJVq6yd3KkCrsHRbapiPb0Lx3EOOtybBEE9EyqbmfW1NlSDsSzvQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-openbsd-64/0.15.13: + resolution: {integrity: sha512-nkuDlIjF/sfUhfx8SKq0+U+Fgx5K9JcPq1mUodnxI0x4kBdCv46rOGWbuJ6eof2n3wdoCLccOoJAbg9ba/bT2w==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-sunos-64/0.15.13: + resolution: {integrity: sha512-jVeu2GfxZQ++6lRdY43CS0Tm/r4WuQQ0Pdsrxbw+aOrHQPHV0+LNOLnvbN28M7BSUGnJnHkHm2HozGgNGyeIRw==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-32/0.15.13: + resolution: {integrity: sha512-XoF2iBf0wnqo16SDq+aDGi/+QbaLFpkiRarPVssMh9KYbFNCqPLlGAWwDvxEVz+ywX6Si37J2AKm+AXq1kC0JA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-64/0.15.13: + resolution: {integrity: sha512-Et6htEfGycjDrtqb2ng6nT+baesZPYQIW+HUEHK4D1ncggNrDNk3yoboYQ5KtiVrw/JaDMNttz8rrPubV/fvPQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-arm64/0.15.13: + resolution: {integrity: sha512-3bv7tqntThQC9SWLRouMDmZnlOukBhOCTlkzNqzGCmrkCJI7io5LLjwJBOVY6kOUlIvdxbooNZwjtBvj+7uuVg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild/0.15.13: + resolution: {integrity: sha512-Cu3SC84oyzzhrK/YyN4iEVy2jZu5t2fz66HEOShHURcjSkOSAVL8C/gfUT+lDJxkVHpg8GZ10DD0rMHRPqMFaQ==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/android-arm': 0.15.13 + '@esbuild/linux-loong64': 0.15.13 + esbuild-android-64: 0.15.13 + esbuild-android-arm64: 0.15.13 + esbuild-darwin-64: 0.15.13 + esbuild-darwin-arm64: 0.15.13 + esbuild-freebsd-64: 0.15.13 + esbuild-freebsd-arm64: 0.15.13 + esbuild-linux-32: 0.15.13 + esbuild-linux-64: 0.15.13 + esbuild-linux-arm: 0.15.13 + esbuild-linux-arm64: 0.15.13 + esbuild-linux-mips64le: 0.15.13 + esbuild-linux-ppc64le: 0.15.13 + esbuild-linux-riscv64: 0.15.13 + esbuild-linux-s390x: 0.15.13 + esbuild-netbsd-64: 0.15.13 + esbuild-openbsd-64: 0.15.13 + esbuild-sunos-64: 0.15.13 + esbuild-windows-32: 0.15.13 + esbuild-windows-64: 0.15.13 + esbuild-windows-arm64: 0.15.13 + dev: true diff --git a/dist/app.js b/src/app.js similarity index 100% rename from dist/app.js rename to src/app.js diff --git a/src/app.rs b/src/app.rs index fae2cfb..e2464e2 100644 --- a/src/app.rs +++ b/src/app.rs @@ -9,8 +9,10 @@ use semver::Version; /// const appName = await getName(); /// ``` #[inline(always)] -pub async fn get_name() -> String { - inner::getName().await.as_string().unwrap() +pub async fn get_name() -> crate::Result { + let js_val = inner::getName().await?; + + Ok(serde_wasm_bindgen::from_value(js_val)?) } /// Gets the application version. @@ -23,8 +25,10 @@ pub async fn get_name() -> String { /// let version = get_version().await; /// ``` #[inline(always)] -pub async fn get_version() -> Version { - Version::parse(&inner::getVersion().await.as_string().unwrap()).unwrap() +pub async fn get_version() -> crate::Result { + let js_val = inner::getVersion().await?; + + Ok(serde_wasm_bindgen::from_value(js_val)?) } /// Gets the Tauri version. @@ -37,8 +41,10 @@ pub async fn get_version() -> Version { /// let version = get_tauri_version().await; /// ``` #[inline(always)] -pub async fn get_tauri_version() -> Version { - Version::parse(&inner::getTauriVersion().await.as_string().unwrap()).unwrap() +pub async fn get_tauri_version() -> crate::Result { + let js_val = inner::getTauriVersion().await?; + + Ok(serde_wasm_bindgen::from_value(js_val)?) } /// Shows the application on macOS. This function does not automatically focuses any app window. @@ -51,8 +57,8 @@ pub async fn get_tauri_version() -> Version { /// show().await; /// ``` #[inline(always)] -pub async fn show() { - inner::show().await; +pub async fn show() -> crate::Result<()> { + Ok(inner::show().await?) } /// Hides the application on macOS. @@ -65,19 +71,24 @@ pub async fn show() { /// hide().await; /// ``` #[inline(always)] -pub async fn hide() { - inner::hide().await; +pub async fn hide() -> crate::Result<()> { + Ok(inner::hide().await?) } mod inner { use wasm_bindgen::{prelude::wasm_bindgen, JsValue}; - #[wasm_bindgen(module = "/dist/app.js")] + #[wasm_bindgen(module = "/src/app.js")] extern "C" { - pub async fn getName() -> JsValue; - pub async fn getTauriVersion() -> JsValue; - pub async fn getVersion() -> JsValue; - pub async fn hide(); - pub async fn show(); + #[wasm_bindgen(catch)] + pub async fn getName() -> Result; + #[wasm_bindgen(catch)] + pub async fn getTauriVersion() -> Result; + #[wasm_bindgen(catch)] + pub async fn getVersion() -> Result; + #[wasm_bindgen(catch)] + pub async fn hide() -> Result<(), JsValue>; + #[wasm_bindgen(catch)] + pub async fn show() -> Result<(), JsValue>; } } diff --git a/src/cli.js b/src/cli.js new file mode 100644 index 0000000..8829347 --- /dev/null +++ b/src/cli.js @@ -0,0 +1,55 @@ +// tauri/tooling/api/src/tauri.ts +function uid() { + return window.crypto.getRandomValues(new Uint32Array(1))[0]; +} +function transformCallback(callback, once = false) { + const identifier = uid(); + const prop = `_${identifier}`; + Object.defineProperty(window, prop, { + value: (result) => { + if (once) { + Reflect.deleteProperty(window, prop); + } + return callback?.(result); + }, + writable: false, + configurable: true + }); + return identifier; +} +async function invoke(cmd, args = {}) { + return new Promise((resolve, reject) => { + const callback = transformCallback((e) => { + resolve(e); + Reflect.deleteProperty(window, `_${error}`); + }, true); + const error = transformCallback((e) => { + reject(e); + Reflect.deleteProperty(window, `_${callback}`); + }, true); + window.__TAURI_IPC__({ + cmd, + callback, + error, + ...args + }); + }); +} + +// tauri/tooling/api/src/helpers/tauri.ts +async function invokeTauriCommand(command) { + return invoke("tauri", command); +} + +// tauri/tooling/api/src/cli.ts +async function getMatches() { + return invokeTauriCommand({ + __tauriModule: "Cli", + message: { + cmd: "cliMatches" + } + }); +} +export { + getMatches +}; diff --git a/dist/clipboard.js b/src/clipboard.js similarity index 100% rename from dist/clipboard.js rename to src/clipboard.js diff --git a/src/clipboard.rs b/src/clipboard.rs index a716929..1715f18 100644 --- a/src/clipboard.rs +++ b/src/clipboard.rs @@ -8,8 +8,10 @@ /// let clipboard_text = read_text().await; /// ``` #[inline(always)] -pub async fn read_text() -> Option { - inner::readText().await.as_string() +pub async fn read_text() -> crate::Result { + let js_val = inner::readText().await?; + + Ok(serde_wasm_bindgen::from_value(js_val)?) } /// Writes plain text to the clipboard. @@ -25,16 +27,18 @@ pub async fn read_text() -> Option { /// /// @returns A promise indicating the success or failure of the operation. #[inline(always)] -pub async fn write_text(text: &str) { - inner::writeText(text).await +pub async fn write_text(text: &str) -> crate::Result<()> { + Ok(inner::writeText(text).await?) } mod inner { use wasm_bindgen::{prelude::wasm_bindgen, JsValue}; - #[wasm_bindgen(module = "/dist/clipboard.js")] + #[wasm_bindgen(module = "/src/clipboard.js")] extern "C" { - pub async fn readText() -> JsValue; - pub async fn writeText(text: &str); + #[wasm_bindgen(catch)] + pub async fn readText() -> Result; + #[wasm_bindgen(catch)] + pub async fn writeText(text: &str) -> Result<(), JsValue>; } } diff --git a/src/dialog.js b/src/dialog.js new file mode 100644 index 0000000..53811e1 --- /dev/null +++ b/src/dialog.js @@ -0,0 +1,111 @@ +// tauri/tooling/api/src/tauri.ts +function uid() { + return window.crypto.getRandomValues(new Uint32Array(1))[0]; +} +function transformCallback(callback, once = false) { + const identifier = uid(); + const prop = `_${identifier}`; + Object.defineProperty(window, prop, { + value: (result) => { + if (once) { + Reflect.deleteProperty(window, prop); + } + return callback?.(result); + }, + writable: false, + configurable: true + }); + return identifier; +} +async function invoke(cmd, args = {}) { + return new Promise((resolve, reject) => { + const callback = transformCallback((e) => { + resolve(e); + Reflect.deleteProperty(window, `_${error}`); + }, true); + const error = transformCallback((e) => { + reject(e); + Reflect.deleteProperty(window, `_${callback}`); + }, true); + window.__TAURI_IPC__({ + cmd, + callback, + error, + ...args + }); + }); +} + +// tauri/tooling/api/src/helpers/tauri.ts +async function invokeTauriCommand(command) { + return invoke("tauri", command); +} + +// tauri/tooling/api/src/dialog.ts +async function open(options = {}) { + if (typeof options === "object") { + Object.freeze(options); + } + return invokeTauriCommand({ + __tauriModule: "Dialog", + message: { + cmd: "openDialog", + options + } + }); +} +async function save(options = {}) { + if (typeof options === "object") { + Object.freeze(options); + } + return invokeTauriCommand({ + __tauriModule: "Dialog", + message: { + cmd: "saveDialog", + options + } + }); +} +async function message(message2, options) { + const opts = typeof options === "string" ? { title: options } : options; + return invokeTauriCommand({ + __tauriModule: "Dialog", + message: { + cmd: "messageDialog", + message: message2.toString(), + title: opts?.title?.toString(), + type: opts?.type + } + }); +} +async function ask(message2, options) { + const opts = typeof options === "string" ? { title: options } : options; + return invokeTauriCommand({ + __tauriModule: "Dialog", + message: { + cmd: "askDialog", + message: message2.toString(), + title: opts?.title?.toString(), + type: opts?.type + } + }); +} +async function confirm(message2, options) { + const opts = typeof options === "string" ? { title: options } : options; + return invokeTauriCommand({ + __tauriModule: "Dialog", + message: { + cmd: "confirmDialog", + message: message2.toString(), + title: opts?.title?.toString(), + type: opts?.type + } + }); +} +export { + ask, + confirm, + message, + open, + save +}; diff --git a/src/dialog.rs b/src/dialog.rs new file mode 100644 index 0000000..8074d5c --- /dev/null +++ b/src/dialog.rs @@ -0,0 +1,604 @@ +use serde::Serialize; +use std::path::{Path, PathBuf}; + +#[derive(Debug, Serialize)] +struct DialogFilter<'a> { + extensions: &'a [&'a str], + name: &'a str, +} + +#[derive(Debug, Default, Serialize)] +#[serde(rename = "camelCase")] +pub struct FileDialogBuilder<'a> { + default_path: Option<&'a Path>, + filters: Vec>, + title: Option<&'a str>, + directory: bool, + multiple: bool, + recursive: bool, +} + +impl<'a> FileDialogBuilder<'a> { + /// Gets the default file dialog builder. + pub fn new() -> Self { + Self::default() + } + + /// Set starting file name or directory of the dialog. + pub fn set_default_path(&mut self, default_path: &'a Path) { + self.default_path = Some(default_path); + } + + /// If directory is true, indicates that it will be read recursively later. + /// Defines whether subdirectories will be allowed on the scope or not. + /// + /// # Example + /// + /// ```rust + /// use tauri_sys::dialog::FileDialogBuilder; + /// + /// # fn main() -> Result<(), Box> { + /// let _builder = FileDialogBuilder::new().set_recursive(true); + /// # Ok(()) + /// # } + /// ``` + pub fn set_recursive(&mut self, recursive: bool) { + self.recursive = recursive; + } + + /// Set the title of the dialog. + /// + /// # Example + /// + /// ```rust + /// use tauri_sys::dialog::FileDialogBuilder; + /// + /// # fn main() -> Result<(), Box> { + /// let _builder = FileDialogBuilder::new().set_title("Test Title"); + /// # Ok(()) + /// # } + /// ``` + pub fn set_title(&mut self, title: &'a str) { + self.title = Some(title); + } + + /// Add file extension filter. Takes in the name of the filter, and list of extensions + /// + /// # Example + /// + /// ```rust + /// use tauri_sys::dialog::FileDialogBuilder; + /// + /// # fn main() -> Result<(), Box> { + /// let _builder = FileDialogBuilder::new().add_filter("Image", &["png", "jpeg"]); + /// # Ok(()) + /// # } + /// ``` + pub fn add_filter(&mut self, name: &'a str, extensions: &'a [&'a str]) { + self.filters.push(DialogFilter { name, extensions }); + } + + /// Add many file extension filters. + /// + /// # Example + /// + /// ```rust + /// use tauri_sys::dialog::FileDialogBuilder; + /// + /// # fn main() -> Result<(), Box> { + /// let _builder = FileDialogBuilder::new().add_filters(&[("Image", &["png", "jpeg"]),("Video", &["mp4"])]); + /// # Ok(()) + /// # } + /// ``` + pub fn add_filters(&mut self, filters: impl IntoIterator) { + for (name, extensions) in filters.into_iter() { + self.filters.push(DialogFilter { + name: name.as_ref(), + extensions, + }); + } + } + + /// Shows the dialog to select a single file. + /// + /// # Example + /// + /// ```rust,no_run + /// use tauri_sys::dialog::FileDialogBuilder; + /// + /// # async fn main() -> Result<(), Box> { + /// let file = FileDialogBuilder::new().pick_file().await?; + /// # Ok(()) + /// # } + /// ``` + pub async fn pick_file(self) -> crate::Result> { + let raw = inner::open(serde_wasm_bindgen::to_value(&self)?).await?; + + Ok(serde_wasm_bindgen::from_value(raw)?) + } + + /// Shows the dialog to select multiple files. + /// + /// # Example + /// + /// ```rust,no_run + /// use tauri_sys::dialog::FileDialogBuilder; + /// + /// # async fn main() -> Result<(), Box> { + /// let files = FileDialogBuilder::new().pick_files().await?; + /// # Ok(()) + /// # } + /// ``` + pub async fn pick_files(mut self) -> crate::Result>> { + self.multiple = true; + + let raw = inner::open(serde_wasm_bindgen::to_value(&self)?).await?; + + Ok(serde_wasm_bindgen::from_value(raw)?) + } + + /// Shows the dialog to select a single folder. + /// + /// # Example + /// + /// ```rust,no_run + /// use tauri_sys::dialog::FileDialogBuilder; + /// + /// # async fn main() -> Result<(), Box> { + /// let files = FileDialogBuilder::new().pick_folder().await?; + /// # Ok(()) + /// # } + /// ``` + pub async fn pick_folder(mut self) -> crate::Result> { + self.directory = true; + + let raw = inner::open(serde_wasm_bindgen::to_value(&self)?).await?; + + Ok(serde_wasm_bindgen::from_value(raw)?) + } + + /// Shows the dialog to select multiple folders. + /// + /// # Example + /// + /// ```rust,no_run + /// use tauri_sys::dialog::FileDialogBuilder; + /// + /// # async fn main() -> Result<(), Box> { + /// let files = FileDialogBuilder::new().pick_folders().await?; + /// # Ok(()) + /// # } + /// ``` + pub async fn pick_folders(mut self) -> crate::Result>> { + self.directory = true; + self.multiple = true; + + let raw = inner::open(serde_wasm_bindgen::to_value(&self)?).await?; + + Ok(serde_wasm_bindgen::from_value(raw)?) + } + + /// Open a file/directory save dialog. + /// + /// The selected path is added to the filesystem and asset protocol allowlist scopes. + /// When security is more important than the easy of use of this API, prefer writing a dedicated command instead. + /// + /// Note that the allowlist scope change is not persisted, so the values are cleared when the application is restarted. + /// You can save it to the filesystem using tauri-plugin-persisted-scope. + /// + /// # Example + /// + /// ```rust,no_run + /// use tauri_sys::dialog::FileDialogBuilder; + /// + /// # async fn main() -> Result<(), Box> { + /// let file = FileDialogBuilder::new().save().await?; + /// # Ok(()) + /// # } + /// ``` + pub async fn save(self) -> crate::Result> { + let raw = inner::save(serde_wasm_bindgen::to_value(&self)?).await?; + + Ok(serde_wasm_bindgen::from_value(raw)?) + } +} + +#[derive(Debug, Default)] +pub enum MessageDialogType { + #[default] + Info, + Warning, + Error, +} + +impl Serialize for MessageDialogType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + MessageDialogType::Info => serializer.serialize_str("info"), + MessageDialogType::Warning => serializer.serialize_str("warning"), + MessageDialogType::Error => serializer.serialize_str("error"), + } + } +} + +#[derive(Debug, Default, Serialize)] +pub struct MessageDialogBuilder<'a> { + title: Option<&'a str>, + r#type: MessageDialogType, +} + +impl<'a> MessageDialogBuilder<'a> { + pub fn new() -> Self { + Self::default() + } + + /// Set the title of the dialog. + /// + /// # Example + /// + /// ```rust + /// use tauri_sys::dialog::MessageDialogBuilder; + /// + /// # fn main() -> Result<(), Box> { + /// let _builder = MessageDialogBuilder::new().set_title("Test Title"); + /// # Ok(()) + /// # } + /// ``` + pub fn set_title(&mut self, title: &'a str) { + self.title = Some(title); + } + + /// Set the type of the dialog. + /// + /// # Example + /// + /// ```rust + /// use tauri_sys::dialog::{MessageDialogBuilder,MessageDialogType}; + /// + /// # fn main() -> Result<(), Box> { + /// let _builder = MessageDialogBuilder::new().set_type(MessageDialogType::Error); + /// # Ok(()) + /// # } + /// ``` + pub fn set_type(&mut self, r#type: MessageDialogType) { + self.r#type = r#type; + } + + /// Shows a message dialog with an `Ok` button. + /// + /// # Example + /// + /// ```rust,no_run + /// use tauri_sys::dialog::MessageDialogBuilder; + /// + /// # async fn main() -> Result<(), Box> { + /// let file = MessageDialogBuilder::new().message("Tauri is awesome").await?; + /// # Ok(()) + /// # } + /// ``` + pub async fn message(self, message: &str) -> crate::Result<()> { + Ok(inner::message(message, serde_wasm_bindgen::to_value(&self)?).await?) + } + + /// Shows a question dialog with `Yes` and `No` buttons. + /// + /// # Example + /// + /// ```rust,no_run + /// use tauri_sys::dialog::MessageDialogBuilder; + /// + /// # async fn main() -> Result<(), Box> { + /// let confirmation = MessageDialogBuilder::new().ask("Are you sure?").await?; + /// # Ok(()) + /// # } + /// ``` + pub async fn ask(self, message: &str) -> crate::Result { + let raw = inner::ask(message, serde_wasm_bindgen::to_value(&self)?).await?; + + Ok(serde_wasm_bindgen::from_value(raw)?) + } + + /// Shows a question dialog with `Ok` and `Cancel` buttons. + /// + /// # Example + /// + /// ```rust,no_run + /// use tauri_sys::dialog::MessageDialogBuilder; + /// + /// # async fn main() -> Result<(), Box> { + /// let confirmation = MessageDialogBuilder::new().confirm("Are you sure?").await?; + /// # Ok(()) + /// # } + /// ``` + pub async fn confirm(self, message: &str) -> crate::Result { + let raw = inner::confirm(message, serde_wasm_bindgen::to_value(&self)?).await?; + + Ok(serde_wasm_bindgen::from_value(raw)?) + } +} + +// //! User interaction with the file system using dialog boxes. +// //! +// //! # Example +// //! +// //! ```rust,no_run +// //! use tauri_api::dialog::open; +// //! +// //! let path = open(None).await; +// //! ``` +// use serde::Serialize; +// use std::path::PathBuf; + +// /// Extension filter for the file dialog. +// /// +// /// # Example +// /// +// /// ```rust,no_run +// /// let filter = DialogFilter { +// /// extension: vec![".jpg", ".jpeg", ".png", ".bmp"], +// /// name: "images", +// /// }; +// /// ``` +// #[derive(Serialize)] +// pub struct DialogFilter { +// /// Extensions to filter, without a `.` prefix. +// pub extensions: Vec, + +// /// Filter name +// pub name: String, +// } + +// /// Types of a [`message`] dialog. +// #[derive(Serialize)] +// pub enum MessageDialogType { +// Error, +// Info, +// Warning, +// } + +// /// Options for the [`message`] dialog. +// #[derive(Serialize)] +// pub struct MessageDialogOptions { +// /// The title of the dialog. Defaults to the app name. +// pub title: Option, + +// /// The type of the dialog. Defaults to MessageDialogType::Info. +// #[serde(rename(serialize = "type"))] +// pub kind: MessageDialogType, +// } + +// impl MessageDialogOptions { +// /// Creates a new `MessageDialogOptions` with sensible default values. +// pub fn new() -> Self { +// Self { +// title: None, +// kind: MessageDialogType::Info, +// } +// } +// } + +// /// Options for an [`open`] dialog. +// #[derive(Serialize)] +// pub struct OpenDialogOptions { +// /// Initial directory or file path. +// #[serde(rename(serialize = "defaultPath"))] +// pub default_path: Option, + +// /// Whether the dialog is a directory selection or not. +// pub directory: bool, + +// /// The filters of the dialog. +// pub filters: Vec, + +// /// Whether the dialog allows multiple selection or not. +// pub multiple: bool, + +// /// If `directory` is `true`, indicatees that it will be read recursivley later. +// /// Defines whether subdirectories will be allowed on the scope or not. +// pub recursive: bool, + +// /// The title of the dialog window. +// pub title: Option, +// } + +// impl OpenDialogOptions { +// /// Creates a new `OpenDialogOptions` with sensible default values. +// pub fn new() -> Self { +// Self { +// default_path: None, +// directory: false, +// filters: Vec::new(), +// multiple: false, +// recursive: false, +// title: None, +// } +// } +// } + +// /// Options for the save dialog. +// #[derive(Serialize)] +// pub struct SaveDialogOptions { +// /// Initial directory of the file path. +// /// If it's not a directory path, the dialog interface will change to that folder. +// /// If it's not an existing directory, the file name will be set to the dialog's +// /// file name input and the dialog will be set to the parent folder. +// #[serde(rename(serialize = "defaultPath"))] +// pub default_path: Option, + +// /// The filters of the dialog. +// pub filters: Vec, + +// /// The title of the dialog window. +// pub title: Option, +// } + +// impl SaveDialogOptions { +// /// Creates a new `SaveDialogOptions` with sensible default values. +// pub fn new() -> Self { +// Self { +// default_path: None, +// filters: Vec::new(), +// title: None, +// } +// } +// } + +// /// Show a question dialog with `Yes` and `No` buttons. +// /// +// /// # Example +// /// +// /// ```rust,no_run +// /// use tauri_api::dialog::{ask, MessageDialogOptions}; +// /// +// /// let yes = ask("Are you sure?", None).await; +// /// ``` +// /// @param message Message to display. +// /// @param options Dialog options. +// /// @returns Whether the user selected `Yes` or `No`. +// #[inline(always)] +// pub async fn ask(message: &str, options: Option) -> crate::Result { +// let js_val = inner::ask(message, serde_wasm_bindgen::to_value(&options)?).await?; + +// Ok(serde_wasm_bindgen::from_value(js_val)?) +// } + +// /// Shows a question dialog with `Ok` and `Cancel` buttons. +// /// +// /// # Example +// /// +// /// ```rust,no_run +// /// use tauri_api::dialog::{confirm, MessageDialogOptions}; +// /// +// /// let confirmed = confirm("Are you sure?", None).await; +// /// ``` +// /// @returns Whether the user selelced `Ok` or `Cancel`. +// pub async fn confirm(message: &str, options: Option) -> crate::Result { +// let js_val = inner::confirm(message, serde_wasm_bindgen::to_value(&options)?).await?; + +// Ok(serde_wasm_bindgen::from_value(js_val)?) +// } + +// /// Shows a message dialog with an `Ok` button. +// /// +// /// # Example +// /// +// /// ```rust,no_run +// /// use tauri_api::dialog::{message, MessageDialogOptions}; +// /// +// /// message("Tauri is awesome", None).await; +// /// ``` +// /// @param message Message to display. +// /// @param options Dialog options. +// /// @returns Promise resolved when user closes the dialog. +// pub async fn message(message: &str, options: Option) -> crate::Result<()> { +// Ok(inner::message(message, serde_wasm_bindgen::to_value(&options)?).await?) +// } + +// /// Opens a file/directory selection dialog for a single file. +// /// `multiple` field of [`options`](OpenDialogOptions) must be `false`, if provided. +// /// +// /// The selected paths are added to the filesystem and asset protocol allowlist scopes. +// /// When security is mroe important than the ease of use of this API, +// /// prefer writing a dedicated command instead. +// /// +// /// Note that the allowlist scope change is not persisited, +// /// so the values are cleared when the applicaiton is restarted. +// /// You can save it to the filessytem using the [tauri-plugin-persisted-scope](https://github.com/tauri-apps/tauri-plugin-persisted-scope). +// /// +// /// # Example +// /// +// /// ```rust,no_run +// /// use tauri_api::dialog::{open, OpenDialogOptions}; +// /// +// /// let file = open(None).await; +// /// +// /// let mut opts = OpenDialogOptions::new(); +// /// opts.directory = true; +// /// let dir = open(Some(opts)).await; +// /// ``` +// /// @param options Dialog options. +// /// @returns List of file paths, or `None` if user cancelled the dialog. +// pub async fn open(options: Option) -> crate::Result> { +// let file = inner::open(serde_wasm_bindgen::to_value(&options)?).await?; + +// Ok(serde_wasm_bindgen::from_value(file)?) +// } + +// /// Opens a file/directory selection dialog for multiple files. +// /// `multiple` field of [`options`](OpenDialogOptions) must be `true`, if provided. +// /// +// /// The selected paths are added to the filesystem and asset protocol allowlist scopes. +// /// When security is mroe important than the ease of use of this API, +// /// prefer writing a dedicated command instead. +// /// +// /// Note that the allowlist scope change is not persisited, +// /// so the values are cleared when the applicaiton is restarted. +// /// You can save it to the filessytem using the [tauri-plugin-persisted-scope](https://github.com/tauri-apps/tauri-plugin-persisted-scope). +// /// +// /// # Example +// /// +// /// ```rust,no_run +// /// use tauri_api::dialog::{open, OpenDialogOptions}; +// /// +// /// let files = open_multiple(None).await; +// /// +// /// let mut opts = OpenDialogOptions::new(); +// /// opts.multiple = true; +// /// opts.directory = true; +// /// let dirs = open(Some(opts)).await; +// /// ``` +// /// @param options Dialog options. +// /// @returns List of file paths, or `None` if user cancelled the dialog. +// pub async fn open_multiple( +// options: Option, +// ) -> crate::Result>> { +// let files = inner::open_multiple(serde_wasm_bindgen::to_value(&options)?).await?; + +// Ok(serde_wasm_bindgen::from_value(files)?) +// } + +// /// Opens a file/directory save dialog. +// /// +// /// The selected paths are added to the filesystem and asset protocol allowlist scopes. +// /// When security is mroe important than the ease of use of this API, +// /// prefer writing a dedicated command instead. +// /// +// /// Note that the allowlist scope change is not persisited, +// /// so the values are cleared when the applicaiton is restarted. +// /// You can save it to the filessytem using the [tauri-plugin-persisted-scope](https://github.com/tauri-apps/tauri-plugin-persisted-scope). +// /// +// /// # Example +// /// +// /// ```rust,no_run +// /// use tauri_api::dialog::{save, SaveDialogOptions}; +// /// +// /// let file = save(None).await; +// /// ``` +// /// @param options Dialog options. +// /// @returns File path, or `None` if user cancelled the dialog. +// pub async fn save(options: Option) -> crate::Result> { +// let path = inner::save(serde_wasm_bindgen::to_value(&options)?).await?; + +// Ok(serde_wasm_bindgen::from_value(path)?) +// } + +mod inner { + use wasm_bindgen::{prelude::wasm_bindgen, JsValue}; + + #[wasm_bindgen(module = "/src/dialog.js")] + extern "C" { + #[wasm_bindgen(catch)] + pub async fn ask(message: &str, options: JsValue) -> Result; + #[wasm_bindgen(catch)] + pub async fn confirm(message: &str, options: JsValue) -> Result; + #[wasm_bindgen(catch)] + pub async fn open(options: JsValue) -> Result; + #[wasm_bindgen(catch)] + pub async fn message(message: &str, option: JsValue) -> Result<(), JsValue>; + #[wasm_bindgen(catch)] + pub async fn save(options: JsValue) -> Result; + } +} diff --git a/dist/event.js b/src/event.js similarity index 100% rename from dist/event.js rename to src/event.js diff --git a/src/event.rs b/src/event.rs index 37cdb0f..9ba40f1 100644 --- a/src/event.rs +++ b/src/event.rs @@ -1,6 +1,5 @@ -use std::fmt::Debug; - use serde::{de::DeserializeOwned, Deserialize, Serialize}; +use std::fmt::Debug; use wasm_bindgen::{prelude::Closure, JsValue}; #[derive(Deserialize)] @@ -45,8 +44,10 @@ impl Debug for Event { /// /// @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. #[inline(always)] -pub async fn emit(event: &str, payload: &T) { - inner::emit(event, serde_wasm_bindgen::to_value(payload).unwrap()).await +pub async fn emit(event: &str, payload: &T) -> crate::Result<()> { + inner::emit(event, serde_wasm_bindgen::to_value(payload)?).await?; + + Ok(()) } /// Listen to an event from the backend. @@ -70,7 +71,7 @@ pub async fn emit(event: &str, payload: &T) { /// /// Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted. #[inline(always)] -pub async fn listen(event: &str, mut handler: H) -> impl FnOnce() +pub async fn listen(event: &str, mut handler: H) -> crate::Result where T: DeserializeOwned, H: FnMut(Event) + 'static, @@ -79,14 +80,14 @@ where (handler)(serde_wasm_bindgen::from_value(raw).unwrap()) }); - let unlisten = inner::listen(event, &closure).await; + let unlisten = inner::listen(event, &closure).await?; closure.forget(); let unlisten = js_sys::Function::from(unlisten); - move || { + Ok(move || { unlisten.call0(&wasm_bindgen::JsValue::NULL).unwrap(); - } + }) } /// Listen to an one-off event from the backend. @@ -115,7 +116,7 @@ where /// /// Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted. #[inline(always)] -pub async fn once(event: &str, mut handler: H) -> impl FnOnce() +pub async fn once(event: &str, mut handler: H) -> crate::Result where T: DeserializeOwned, H: FnMut(Event) + 'static, @@ -124,14 +125,14 @@ where (handler)(serde_wasm_bindgen::from_value(raw).unwrap()) }); - let unlisten = inner::once(event, &closure).await; + let unlisten = inner::once(event, &closure).await?; closure.forget(); let unlisten = js_sys::Function::from(unlisten); - move || { + Ok(move || { unlisten.call0(&wasm_bindgen::JsValue::NULL).unwrap(); - } + }) } mod inner { @@ -140,10 +141,19 @@ mod inner { JsValue, }; - #[wasm_bindgen(module = "/dist/event.js")] + #[wasm_bindgen(module = "/src/event.js")] extern "C" { - pub async fn emit(event: &str, payload: JsValue); - pub async fn listen(event: &str, handler: &Closure) -> JsValue; - pub async fn once(event: &str, handler: &Closure) -> JsValue; + #[wasm_bindgen(catch)] + pub async fn emit(event: &str, payload: JsValue) -> Result<(), JsValue>; + #[wasm_bindgen(catch)] + pub async fn listen( + event: &str, + handler: &Closure, + ) -> Result; + #[wasm_bindgen(catch)] + pub async fn once( + event: &str, + handler: &Closure, + ) -> Result; } } diff --git a/src/fs.js b/src/fs.js new file mode 100644 index 0000000..8e223c3 --- /dev/null +++ b/src/fs.js @@ -0,0 +1,243 @@ +// tauri/tooling/api/src/tauri.ts +function uid() { + return window.crypto.getRandomValues(new Uint32Array(1))[0]; +} +function transformCallback(callback, once = false) { + const identifier = uid(); + const prop = `_${identifier}`; + Object.defineProperty(window, prop, { + value: (result) => { + if (once) { + Reflect.deleteProperty(window, prop); + } + return callback?.(result); + }, + writable: false, + configurable: true + }); + return identifier; +} +async function invoke(cmd, args = {}) { + return new Promise((resolve, reject) => { + const callback = transformCallback((e) => { + resolve(e); + Reflect.deleteProperty(window, `_${error}`); + }, true); + const error = transformCallback((e) => { + reject(e); + Reflect.deleteProperty(window, `_${callback}`); + }, true); + window.__TAURI_IPC__({ + cmd, + callback, + error, + ...args + }); + }); +} + +// tauri/tooling/api/src/helpers/tauri.ts +async function invokeTauriCommand(command) { + return invoke("tauri", command); +} + +// tauri/tooling/api/src/fs.ts +var BaseDirectory = /* @__PURE__ */ ((BaseDirectory2) => { + BaseDirectory2[BaseDirectory2["Audio"] = 1] = "Audio"; + BaseDirectory2[BaseDirectory2["Cache"] = 2] = "Cache"; + BaseDirectory2[BaseDirectory2["Config"] = 3] = "Config"; + BaseDirectory2[BaseDirectory2["Data"] = 4] = "Data"; + BaseDirectory2[BaseDirectory2["LocalData"] = 5] = "LocalData"; + BaseDirectory2[BaseDirectory2["Desktop"] = 6] = "Desktop"; + BaseDirectory2[BaseDirectory2["Document"] = 7] = "Document"; + BaseDirectory2[BaseDirectory2["Download"] = 8] = "Download"; + BaseDirectory2[BaseDirectory2["Executable"] = 9] = "Executable"; + BaseDirectory2[BaseDirectory2["Font"] = 10] = "Font"; + BaseDirectory2[BaseDirectory2["Home"] = 11] = "Home"; + BaseDirectory2[BaseDirectory2["Picture"] = 12] = "Picture"; + BaseDirectory2[BaseDirectory2["Public"] = 13] = "Public"; + BaseDirectory2[BaseDirectory2["Runtime"] = 14] = "Runtime"; + BaseDirectory2[BaseDirectory2["Template"] = 15] = "Template"; + BaseDirectory2[BaseDirectory2["Video"] = 16] = "Video"; + BaseDirectory2[BaseDirectory2["Resource"] = 17] = "Resource"; + BaseDirectory2[BaseDirectory2["App"] = 18] = "App"; + BaseDirectory2[BaseDirectory2["Log"] = 19] = "Log"; + BaseDirectory2[BaseDirectory2["Temp"] = 20] = "Temp"; + BaseDirectory2[BaseDirectory2["AppConfig"] = 21] = "AppConfig"; + BaseDirectory2[BaseDirectory2["AppData"] = 22] = "AppData"; + BaseDirectory2[BaseDirectory2["AppLocalData"] = 23] = "AppLocalData"; + BaseDirectory2[BaseDirectory2["AppCache"] = 24] = "AppCache"; + BaseDirectory2[BaseDirectory2["AppLog"] = 25] = "AppLog"; + return BaseDirectory2; +})(BaseDirectory || {}); +async function readTextFile(filePath, options = {}) { + return invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "readTextFile", + path: filePath, + options + } + }); +} +async function readBinaryFile(filePath, options = {}) { + const arr = await invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "readFile", + path: filePath, + options + } + }); + return Uint8Array.from(arr); +} +async function writeTextFile(path, contents, options) { + if (typeof options === "object") { + Object.freeze(options); + } + if (typeof path === "object") { + Object.freeze(path); + } + const file = { path: "", contents: "" }; + let fileOptions = options; + if (typeof path === "string") { + file.path = path; + } else { + file.path = path.path; + file.contents = path.contents; + } + if (typeof contents === "string") { + file.contents = contents ?? ""; + } else { + fileOptions = contents; + } + return invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "writeFile", + path: file.path, + contents: Array.from(new TextEncoder().encode(file.contents)), + options: fileOptions + } + }); +} +async function writeBinaryFile(path, contents, options) { + if (typeof options === "object") { + Object.freeze(options); + } + if (typeof path === "object") { + Object.freeze(path); + } + const file = { path: "", contents: [] }; + let fileOptions = options; + if (typeof path === "string") { + file.path = path; + } else { + file.path = path.path; + file.contents = path.contents; + } + if (contents && "dir" in contents) { + fileOptions = contents; + } else if (typeof path === "string") { + file.contents = contents ?? []; + } + return invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "writeFile", + path: file.path, + contents: Array.from( + file.contents instanceof ArrayBuffer ? new Uint8Array(file.contents) : file.contents + ), + options: fileOptions + } + }); +} +async function readDir(dir, options = {}) { + return invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "readDir", + path: dir, + options + } + }); +} +async function createDir(dir, options = {}) { + return invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "createDir", + path: dir, + options + } + }); +} +async function removeDir(dir, options = {}) { + return invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "removeDir", + path: dir, + options + } + }); +} +async function copyFile(source, destination, options = {}) { + return invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "copyFile", + source, + destination, + options + } + }); +} +async function removeFile(file, options = {}) { + return invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "removeFile", + path: file, + options + } + }); +} +async function renameFile(oldPath, newPath, options = {}) { + return invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "renameFile", + oldPath, + newPath, + options + } + }); +} +async function exists(path, options = {}) { + return invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "exists", + path, + options + } + }); +} +export { + BaseDirectory, + BaseDirectory as Dir, + copyFile, + createDir, + exists, + readBinaryFile, + readDir, + readTextFile, + removeDir, + removeFile, + renameFile, + writeBinaryFile, + writeTextFile as writeFile, + writeTextFile +}; diff --git a/src/globalShortcut.js b/src/globalShortcut.js new file mode 100644 index 0000000..0a6235f --- /dev/null +++ b/src/globalShortcut.js @@ -0,0 +1,97 @@ +// tauri/tooling/api/src/tauri.ts +function uid() { + return window.crypto.getRandomValues(new Uint32Array(1))[0]; +} +function transformCallback(callback, once = false) { + const identifier = uid(); + const prop = `_${identifier}`; + Object.defineProperty(window, prop, { + value: (result) => { + if (once) { + Reflect.deleteProperty(window, prop); + } + return callback?.(result); + }, + writable: false, + configurable: true + }); + return identifier; +} +async function invoke(cmd, args = {}) { + return new Promise((resolve, reject) => { + const callback = transformCallback((e) => { + resolve(e); + Reflect.deleteProperty(window, `_${error}`); + }, true); + const error = transformCallback((e) => { + reject(e); + Reflect.deleteProperty(window, `_${callback}`); + }, true); + window.__TAURI_IPC__({ + cmd, + callback, + error, + ...args + }); + }); +} + +// tauri/tooling/api/src/helpers/tauri.ts +async function invokeTauriCommand(command) { + return invoke("tauri", command); +} + +// tauri/tooling/api/src/globalShortcut.ts +async function register(shortcut, handler) { + return invokeTauriCommand({ + __tauriModule: "GlobalShortcut", + message: { + cmd: "register", + shortcut, + handler: transformCallback(handler) + } + }); +} +async function registerAll(shortcuts, handler) { + return invokeTauriCommand({ + __tauriModule: "GlobalShortcut", + message: { + cmd: "registerAll", + shortcuts, + handler: transformCallback(handler) + } + }); +} +async function isRegistered(shortcut) { + return invokeTauriCommand({ + __tauriModule: "GlobalShortcut", + message: { + cmd: "isRegistered", + shortcut + } + }); +} +async function unregister(shortcut) { + return invokeTauriCommand({ + __tauriModule: "GlobalShortcut", + message: { + cmd: "unregister", + shortcut + } + }); +} +async function unregisterAll() { + return invokeTauriCommand({ + __tauriModule: "GlobalShortcut", + message: { + cmd: "unregisterAll" + } + }); +} +export { + isRegistered, + register, + registerAll, + unregister, + unregisterAll +}; diff --git a/src/http.js b/src/http.js new file mode 100644 index 0000000..078629f --- /dev/null +++ b/src/http.js @@ -0,0 +1,219 @@ +// tauri/tooling/api/src/tauri.ts +function uid() { + return window.crypto.getRandomValues(new Uint32Array(1))[0]; +} +function transformCallback(callback, once = false) { + const identifier = uid(); + const prop = `_${identifier}`; + Object.defineProperty(window, prop, { + value: (result) => { + if (once) { + Reflect.deleteProperty(window, prop); + } + return callback?.(result); + }, + writable: false, + configurable: true + }); + return identifier; +} +async function invoke(cmd, args = {}) { + return new Promise((resolve, reject) => { + const callback = transformCallback((e) => { + resolve(e); + Reflect.deleteProperty(window, `_${error}`); + }, true); + const error = transformCallback((e) => { + reject(e); + Reflect.deleteProperty(window, `_${callback}`); + }, true); + window.__TAURI_IPC__({ + cmd, + callback, + error, + ...args + }); + }); +} + +// tauri/tooling/api/src/helpers/tauri.ts +async function invokeTauriCommand(command) { + return invoke("tauri", command); +} + +// tauri/tooling/api/src/http.ts +var ResponseType = /* @__PURE__ */ ((ResponseType2) => { + ResponseType2[ResponseType2["JSON"] = 1] = "JSON"; + ResponseType2[ResponseType2["Text"] = 2] = "Text"; + ResponseType2[ResponseType2["Binary"] = 3] = "Binary"; + return ResponseType2; +})(ResponseType || {}); +var Body = class { + constructor(type, payload) { + this.type = type; + this.payload = payload; + } + static form(data) { + const form = {}; + 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) { + return new Body("Json", data); + } + static text(value) { + return new Body("Text", value); + } + static bytes(bytes) { + return new Body( + "Bytes", + Array.from(bytes instanceof ArrayBuffer ? new Uint8Array(bytes) : bytes) + ); + } +}; +var Response = class { + constructor(response) { + this.url = response.url; + this.status = response.status; + this.ok = this.status >= 200 && this.status < 300; + this.headers = response.headers; + this.rawHeaders = response.rawHeaders; + this.data = response.data; + } +}; +var Client = class { + constructor(id) { + this.id = id; + } + async drop() { + return invokeTauriCommand({ + __tauriModule: "Http", + message: { + cmd: "dropClient", + client: this.id + } + }); + } + async request(options) { + const jsonResponse = !options.responseType || options.responseType === 1 /* JSON */; + if (jsonResponse) { + options.responseType = 2 /* Text */; + } + return invokeTauriCommand({ + __tauriModule: "Http", + message: { + cmd: "httpRequest", + client: this.id, + options + } + }).then((res) => { + const response = new Response(res); + if (jsonResponse) { + try { + response.data = JSON.parse(response.data); + } catch (e) { + if (response.ok && response.data === "") { + response.data = {}; + } else if (response.ok) { + throw Error( + `Failed to parse response \`${response.data}\` as JSON: ${e}; + try setting the \`responseType\` option to \`ResponseType.Text\` or \`ResponseType.Binary\` if the API does not return a JSON response.` + ); + } + } + return response; + } + return response; + }); + } + async get(url, options) { + return this.request({ + method: "GET", + url, + ...options + }); + } + async post(url, body, options) { + return this.request({ + method: "POST", + url, + body, + ...options + }); + } + async put(url, body, options) { + return this.request({ + method: "PUT", + url, + body, + ...options + }); + } + async patch(url, options) { + return this.request({ + method: "PATCH", + url, + ...options + }); + } + async delete(url, options) { + return this.request({ + method: "DELETE", + url, + ...options + }); + } +}; +async function getClient(options) { + return invokeTauriCommand({ + __tauriModule: "Http", + message: { + cmd: "createClient", + options + } + }).then((id) => new Client(id)); +} +var defaultClient = null; +async function fetch(url, options) { + if (defaultClient === null) { + defaultClient = await getClient(); + } + return defaultClient.request({ + url, + method: options?.method ?? "GET", + ...options + }); +} +export { + Body, + Client, + Response, + ResponseType, + fetch, + getClient +}; diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..a683b61 --- /dev/null +++ b/src/index.js @@ -0,0 +1,2414 @@ +var __defProp = Object.defineProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; + +// tauri/tooling/api/src/app.ts +var app_exports = {}; +__export(app_exports, { + getName: () => getName, + getTauriVersion: () => getTauriVersion, + getVersion: () => getVersion, + hide: () => hide, + show: () => show +}); + +// tauri/tooling/api/src/tauri.ts +var tauri_exports = {}; +__export(tauri_exports, { + convertFileSrc: () => convertFileSrc, + invoke: () => invoke, + transformCallback: () => transformCallback +}); +function uid() { + return window.crypto.getRandomValues(new Uint32Array(1))[0]; +} +function transformCallback(callback, once3 = false) { + const identifier = uid(); + const prop = `_${identifier}`; + Object.defineProperty(window, prop, { + value: (result) => { + if (once3) { + Reflect.deleteProperty(window, prop); + } + return callback?.(result); + }, + writable: false, + configurable: true + }); + return identifier; +} +async function invoke(cmd, args = {}) { + return new Promise((resolve2, reject) => { + const callback = transformCallback((e) => { + resolve2(e); + Reflect.deleteProperty(window, `_${error}`); + }, true); + const error = transformCallback((e) => { + reject(e); + Reflect.deleteProperty(window, `_${callback}`); + }, true); + window.__TAURI_IPC__({ + cmd, + callback, + error, + ...args + }); + }); +} +function convertFileSrc(filePath, protocol = "asset") { + const path = encodeURIComponent(filePath); + return navigator.userAgent.includes("Windows") ? `https://${protocol}.localhost/${path}` : `${protocol}://localhost/${path}`; +} + +// tauri/tooling/api/src/helpers/tauri.ts +async function invokeTauriCommand(command) { + return invoke("tauri", command); +} + +// tauri/tooling/api/src/app.ts +async function getVersion() { + return invokeTauriCommand({ + __tauriModule: "App", + message: { + cmd: "getAppVersion" + } + }); +} +async function getName() { + return invokeTauriCommand({ + __tauriModule: "App", + message: { + cmd: "getAppName" + } + }); +} +async function getTauriVersion() { + return invokeTauriCommand({ + __tauriModule: "App", + message: { + cmd: "getTauriVersion" + } + }); +} +async function show() { + return invokeTauriCommand({ + __tauriModule: "App", + message: { + cmd: "show" + } + }); +} +async function hide() { + return invokeTauriCommand({ + __tauriModule: "App", + message: { + cmd: "hide" + } + }); +} + +// tauri/tooling/api/src/cli.ts +var cli_exports = {}; +__export(cli_exports, { + getMatches: () => getMatches +}); +async function getMatches() { + return invokeTauriCommand({ + __tauriModule: "Cli", + message: { + cmd: "cliMatches" + } + }); +} + +// tauri/tooling/api/src/clipboard.ts +var clipboard_exports = {}; +__export(clipboard_exports, { + readText: () => readText, + writeText: () => writeText +}); +async function writeText(text) { + return invokeTauriCommand({ + __tauriModule: "Clipboard", + message: { + cmd: "writeText", + data: text + } + }); +} +async function readText() { + return invokeTauriCommand({ + __tauriModule: "Clipboard", + message: { + cmd: "readText", + data: null + } + }); +} + +// tauri/tooling/api/src/dialog.ts +var dialog_exports = {}; +__export(dialog_exports, { + ask: () => ask, + confirm: () => confirm, + message: () => message, + open: () => open, + save: () => save +}); +async function open(options = {}) { + if (typeof options === "object") { + Object.freeze(options); + } + return invokeTauriCommand({ + __tauriModule: "Dialog", + message: { + cmd: "openDialog", + options + } + }); +} +async function save(options = {}) { + if (typeof options === "object") { + Object.freeze(options); + } + return invokeTauriCommand({ + __tauriModule: "Dialog", + message: { + cmd: "saveDialog", + options + } + }); +} +async function message(message2, options) { + const opts = typeof options === "string" ? { title: options } : options; + return invokeTauriCommand({ + __tauriModule: "Dialog", + message: { + cmd: "messageDialog", + message: message2.toString(), + title: opts?.title?.toString(), + type: opts?.type + } + }); +} +async function ask(message2, options) { + const opts = typeof options === "string" ? { title: options } : options; + return invokeTauriCommand({ + __tauriModule: "Dialog", + message: { + cmd: "askDialog", + message: message2.toString(), + title: opts?.title?.toString(), + type: opts?.type + } + }); +} +async function confirm(message2, options) { + const opts = typeof options === "string" ? { title: options } : options; + return invokeTauriCommand({ + __tauriModule: "Dialog", + message: { + cmd: "confirmDialog", + message: message2.toString(), + title: opts?.title?.toString(), + type: opts?.type + } + }); +} + +// tauri/tooling/api/src/event.ts +var event_exports = {}; +__export(event_exports, { + TauriEvent: () => TauriEvent, + emit: () => emit2, + listen: () => listen2, + once: () => once2 +}); + +// tauri/tooling/api/src/helpers/event.ts +async function _unlisten(event, eventId) { + return invokeTauriCommand({ + __tauriModule: "Event", + message: { + cmd: "unlisten", + event, + eventId + } + }); +} +async function emit(event, windowLabel, payload) { + await invokeTauriCommand({ + __tauriModule: "Event", + message: { + cmd: "emit", + event, + windowLabel, + payload + } + }); +} +async function listen(event, windowLabel, handler) { + return invokeTauriCommand({ + __tauriModule: "Event", + message: { + cmd: "listen", + event, + windowLabel, + handler: transformCallback(handler) + } + }).then((eventId) => { + return async () => _unlisten(event, eventId); + }); +} +async function once(event, windowLabel, handler) { + return listen(event, windowLabel, (eventData) => { + handler(eventData); + _unlisten(event, eventData.id).catch(() => { + }); + }); +} + +// tauri/tooling/api/src/event.ts +var TauriEvent = /* @__PURE__ */ ((TauriEvent2) => { + TauriEvent2["WINDOW_RESIZED"] = "tauri://resize"; + TauriEvent2["WINDOW_MOVED"] = "tauri://move"; + TauriEvent2["WINDOW_CLOSE_REQUESTED"] = "tauri://close-requested"; + TauriEvent2["WINDOW_CREATED"] = "tauri://window-created"; + TauriEvent2["WINDOW_DESTROYED"] = "tauri://destroyed"; + TauriEvent2["WINDOW_FOCUS"] = "tauri://focus"; + TauriEvent2["WINDOW_BLUR"] = "tauri://blur"; + TauriEvent2["WINDOW_SCALE_FACTOR_CHANGED"] = "tauri://scale-change"; + TauriEvent2["WINDOW_THEME_CHANGED"] = "tauri://theme-changed"; + TauriEvent2["WINDOW_FILE_DROP"] = "tauri://file-drop"; + TauriEvent2["WINDOW_FILE_DROP_HOVER"] = "tauri://file-drop-hover"; + TauriEvent2["WINDOW_FILE_DROP_CANCELLED"] = "tauri://file-drop-cancelled"; + TauriEvent2["MENU"] = "tauri://menu"; + TauriEvent2["CHECK_UPDATE"] = "tauri://update"; + TauriEvent2["UPDATE_AVAILABLE"] = "tauri://update-available"; + TauriEvent2["INSTALL_UPDATE"] = "tauri://update-install"; + TauriEvent2["STATUS_UPDATE"] = "tauri://update-status"; + TauriEvent2["DOWNLOAD_PROGRESS"] = "tauri://update-download-progress"; + return TauriEvent2; +})(TauriEvent || {}); +async function listen2(event, handler) { + return listen(event, null, handler); +} +async function once2(event, handler) { + return once(event, null, handler); +} +async function emit2(event, payload) { + return emit(event, void 0, payload); +} + +// tauri/tooling/api/src/fs.ts +var fs_exports = {}; +__export(fs_exports, { + BaseDirectory: () => BaseDirectory, + Dir: () => BaseDirectory, + copyFile: () => copyFile, + createDir: () => createDir, + exists: () => exists, + readBinaryFile: () => readBinaryFile, + readDir: () => readDir, + readTextFile: () => readTextFile, + removeDir: () => removeDir, + removeFile: () => removeFile, + renameFile: () => renameFile, + writeBinaryFile: () => writeBinaryFile, + writeFile: () => writeTextFile, + writeTextFile: () => writeTextFile +}); +var BaseDirectory = /* @__PURE__ */ ((BaseDirectory2) => { + BaseDirectory2[BaseDirectory2["Audio"] = 1] = "Audio"; + BaseDirectory2[BaseDirectory2["Cache"] = 2] = "Cache"; + BaseDirectory2[BaseDirectory2["Config"] = 3] = "Config"; + BaseDirectory2[BaseDirectory2["Data"] = 4] = "Data"; + BaseDirectory2[BaseDirectory2["LocalData"] = 5] = "LocalData"; + BaseDirectory2[BaseDirectory2["Desktop"] = 6] = "Desktop"; + BaseDirectory2[BaseDirectory2["Document"] = 7] = "Document"; + BaseDirectory2[BaseDirectory2["Download"] = 8] = "Download"; + BaseDirectory2[BaseDirectory2["Executable"] = 9] = "Executable"; + BaseDirectory2[BaseDirectory2["Font"] = 10] = "Font"; + BaseDirectory2[BaseDirectory2["Home"] = 11] = "Home"; + BaseDirectory2[BaseDirectory2["Picture"] = 12] = "Picture"; + BaseDirectory2[BaseDirectory2["Public"] = 13] = "Public"; + BaseDirectory2[BaseDirectory2["Runtime"] = 14] = "Runtime"; + BaseDirectory2[BaseDirectory2["Template"] = 15] = "Template"; + BaseDirectory2[BaseDirectory2["Video"] = 16] = "Video"; + BaseDirectory2[BaseDirectory2["Resource"] = 17] = "Resource"; + BaseDirectory2[BaseDirectory2["App"] = 18] = "App"; + BaseDirectory2[BaseDirectory2["Log"] = 19] = "Log"; + BaseDirectory2[BaseDirectory2["Temp"] = 20] = "Temp"; + BaseDirectory2[BaseDirectory2["AppConfig"] = 21] = "AppConfig"; + BaseDirectory2[BaseDirectory2["AppData"] = 22] = "AppData"; + BaseDirectory2[BaseDirectory2["AppLocalData"] = 23] = "AppLocalData"; + BaseDirectory2[BaseDirectory2["AppCache"] = 24] = "AppCache"; + BaseDirectory2[BaseDirectory2["AppLog"] = 25] = "AppLog"; + return BaseDirectory2; +})(BaseDirectory || {}); +async function readTextFile(filePath, options = {}) { + return invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "readTextFile", + path: filePath, + options + } + }); +} +async function readBinaryFile(filePath, options = {}) { + const arr = await invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "readFile", + path: filePath, + options + } + }); + return Uint8Array.from(arr); +} +async function writeTextFile(path, contents, options) { + if (typeof options === "object") { + Object.freeze(options); + } + if (typeof path === "object") { + Object.freeze(path); + } + const file = { path: "", contents: "" }; + let fileOptions = options; + if (typeof path === "string") { + file.path = path; + } else { + file.path = path.path; + file.contents = path.contents; + } + if (typeof contents === "string") { + file.contents = contents ?? ""; + } else { + fileOptions = contents; + } + return invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "writeFile", + path: file.path, + contents: Array.from(new TextEncoder().encode(file.contents)), + options: fileOptions + } + }); +} +async function writeBinaryFile(path, contents, options) { + if (typeof options === "object") { + Object.freeze(options); + } + if (typeof path === "object") { + Object.freeze(path); + } + const file = { path: "", contents: [] }; + let fileOptions = options; + if (typeof path === "string") { + file.path = path; + } else { + file.path = path.path; + file.contents = path.contents; + } + if (contents && "dir" in contents) { + fileOptions = contents; + } else if (typeof path === "string") { + file.contents = contents ?? []; + } + return invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "writeFile", + path: file.path, + contents: Array.from( + file.contents instanceof ArrayBuffer ? new Uint8Array(file.contents) : file.contents + ), + options: fileOptions + } + }); +} +async function readDir(dir, options = {}) { + return invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "readDir", + path: dir, + options + } + }); +} +async function createDir(dir, options = {}) { + return invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "createDir", + path: dir, + options + } + }); +} +async function removeDir(dir, options = {}) { + return invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "removeDir", + path: dir, + options + } + }); +} +async function copyFile(source, destination, options = {}) { + return invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "copyFile", + source, + destination, + options + } + }); +} +async function removeFile(file, options = {}) { + return invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "removeFile", + path: file, + options + } + }); +} +async function renameFile(oldPath, newPath, options = {}) { + return invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "renameFile", + oldPath, + newPath, + options + } + }); +} +async function exists(path, options = {}) { + return invokeTauriCommand({ + __tauriModule: "Fs", + message: { + cmd: "exists", + path, + options + } + }); +} + +// tauri/tooling/api/src/globalShortcut.ts +var globalShortcut_exports = {}; +__export(globalShortcut_exports, { + isRegistered: () => isRegistered, + register: () => register, + registerAll: () => registerAll, + unregister: () => unregister, + unregisterAll: () => unregisterAll +}); +async function register(shortcut, handler) { + return invokeTauriCommand({ + __tauriModule: "GlobalShortcut", + message: { + cmd: "register", + shortcut, + handler: transformCallback(handler) + } + }); +} +async function registerAll(shortcuts, handler) { + return invokeTauriCommand({ + __tauriModule: "GlobalShortcut", + message: { + cmd: "registerAll", + shortcuts, + handler: transformCallback(handler) + } + }); +} +async function isRegistered(shortcut) { + return invokeTauriCommand({ + __tauriModule: "GlobalShortcut", + message: { + cmd: "isRegistered", + shortcut + } + }); +} +async function unregister(shortcut) { + return invokeTauriCommand({ + __tauriModule: "GlobalShortcut", + message: { + cmd: "unregister", + shortcut + } + }); +} +async function unregisterAll() { + return invokeTauriCommand({ + __tauriModule: "GlobalShortcut", + message: { + cmd: "unregisterAll" + } + }); +} + +// tauri/tooling/api/src/http.ts +var http_exports = {}; +__export(http_exports, { + Body: () => Body, + Client: () => Client, + Response: () => Response, + ResponseType: () => ResponseType, + fetch: () => fetch, + getClient: () => getClient +}); +var ResponseType = /* @__PURE__ */ ((ResponseType2) => { + ResponseType2[ResponseType2["JSON"] = 1] = "JSON"; + ResponseType2[ResponseType2["Text"] = 2] = "Text"; + ResponseType2[ResponseType2["Binary"] = 3] = "Binary"; + return ResponseType2; +})(ResponseType || {}); +var Body = class { + constructor(type2, payload) { + this.type = type2; + this.payload = payload; + } + static form(data) { + const form = {}; + 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) { + return new Body("Json", data); + } + static text(value) { + return new Body("Text", value); + } + static bytes(bytes) { + return new Body( + "Bytes", + Array.from(bytes instanceof ArrayBuffer ? new Uint8Array(bytes) : bytes) + ); + } +}; +var Response = class { + constructor(response) { + this.url = response.url; + this.status = response.status; + this.ok = this.status >= 200 && this.status < 300; + this.headers = response.headers; + this.rawHeaders = response.rawHeaders; + this.data = response.data; + } +}; +var Client = class { + constructor(id) { + this.id = id; + } + async drop() { + return invokeTauriCommand({ + __tauriModule: "Http", + message: { + cmd: "dropClient", + client: this.id + } + }); + } + async request(options) { + const jsonResponse = !options.responseType || options.responseType === 1 /* JSON */; + if (jsonResponse) { + options.responseType = 2 /* Text */; + } + return invokeTauriCommand({ + __tauriModule: "Http", + message: { + cmd: "httpRequest", + client: this.id, + options + } + }).then((res) => { + const response = new Response(res); + if (jsonResponse) { + try { + response.data = JSON.parse(response.data); + } catch (e) { + if (response.ok && response.data === "") { + response.data = {}; + } else if (response.ok) { + throw Error( + `Failed to parse response \`${response.data}\` as JSON: ${e}; + try setting the \`responseType\` option to \`ResponseType.Text\` or \`ResponseType.Binary\` if the API does not return a JSON response.` + ); + } + } + return response; + } + return response; + }); + } + async get(url, options) { + return this.request({ + method: "GET", + url, + ...options + }); + } + async post(url, body, options) { + return this.request({ + method: "POST", + url, + body, + ...options + }); + } + async put(url, body, options) { + return this.request({ + method: "PUT", + url, + body, + ...options + }); + } + async patch(url, options) { + return this.request({ + method: "PATCH", + url, + ...options + }); + } + async delete(url, options) { + return this.request({ + method: "DELETE", + url, + ...options + }); + } +}; +async function getClient(options) { + return invokeTauriCommand({ + __tauriModule: "Http", + message: { + cmd: "createClient", + options + } + }).then((id) => new Client(id)); +} +var defaultClient = null; +async function fetch(url, options) { + if (defaultClient === null) { + defaultClient = await getClient(); + } + return defaultClient.request({ + url, + method: options?.method ?? "GET", + ...options + }); +} + +// tauri/tooling/api/src/notification.ts +var notification_exports = {}; +__export(notification_exports, { + isPermissionGranted: () => isPermissionGranted, + requestPermission: () => requestPermission, + sendNotification: () => sendNotification +}); +async function isPermissionGranted() { + if (window.Notification.permission !== "default") { + return Promise.resolve(window.Notification.permission === "granted"); + } + return invokeTauriCommand({ + __tauriModule: "Notification", + message: { + cmd: "isNotificationPermissionGranted" + } + }); +} +async function requestPermission() { + return window.Notification.requestPermission(); +} +function sendNotification(options) { + if (typeof options === "string") { + new window.Notification(options); + } else { + new window.Notification(options.title, options); + } +} + +// tauri/tooling/api/src/path.ts +var path_exports = {}; +__export(path_exports, { + BaseDirectory: () => BaseDirectory, + appCacheDir: () => appCacheDir, + appConfigDir: () => appConfigDir, + appDataDir: () => appDataDir, + appDir: () => appDir, + appLocalDataDir: () => appLocalDataDir, + appLogDir: () => appLogDir, + audioDir: () => audioDir, + basename: () => basename, + cacheDir: () => cacheDir, + configDir: () => configDir, + dataDir: () => dataDir, + delimiter: () => delimiter, + desktopDir: () => desktopDir, + dirname: () => dirname, + documentDir: () => documentDir, + downloadDir: () => downloadDir, + executableDir: () => executableDir, + extname: () => extname, + fontDir: () => fontDir, + homeDir: () => homeDir, + isAbsolute: () => isAbsolute, + join: () => join, + localDataDir: () => localDataDir, + logDir: () => logDir, + normalize: () => normalize, + pictureDir: () => pictureDir, + publicDir: () => publicDir, + resolve: () => resolve, + resolveResource: () => resolveResource, + resourceDir: () => resourceDir, + runtimeDir: () => runtimeDir, + sep: () => sep, + templateDir: () => templateDir, + videoDir: () => videoDir +}); + +// tauri/tooling/api/src/helpers/os-check.ts +function isWindows() { + return navigator.appVersion.includes("Win"); +} + +// tauri/tooling/api/src/path.ts +async function appDir() { + return appConfigDir(); +} +async function appConfigDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 21 /* AppConfig */ + } + }); +} +async function appDataDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 22 /* AppData */ + } + }); +} +async function appLocalDataDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 23 /* AppLocalData */ + } + }); +} +async function appCacheDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 24 /* AppCache */ + } + }); +} +async function audioDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 1 /* Audio */ + } + }); +} +async function cacheDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 2 /* Cache */ + } + }); +} +async function configDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 3 /* Config */ + } + }); +} +async function dataDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 4 /* Data */ + } + }); +} +async function desktopDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 6 /* Desktop */ + } + }); +} +async function documentDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 7 /* Document */ + } + }); +} +async function downloadDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 8 /* Download */ + } + }); +} +async function executableDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 9 /* Executable */ + } + }); +} +async function fontDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 10 /* Font */ + } + }); +} +async function homeDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 11 /* Home */ + } + }); +} +async function localDataDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 5 /* LocalData */ + } + }); +} +async function pictureDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 12 /* Picture */ + } + }); +} +async function publicDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 13 /* Public */ + } + }); +} +async function resourceDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 17 /* Resource */ + } + }); +} +async function resolveResource(resourcePath) { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: resourcePath, + directory: 17 /* Resource */ + } + }); +} +async function runtimeDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 14 /* Runtime */ + } + }); +} +async function templateDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 15 /* Template */ + } + }); +} +async function videoDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 16 /* Video */ + } + }); +} +async function logDir() { + return appLogDir(); +} +async function appLogDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 25 /* AppLog */ + } + }); +} +var sep = isWindows() ? "\\" : "/"; +var delimiter = isWindows() ? ";" : ":"; +async function resolve(...paths) { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolve", + paths + } + }); +} +async function normalize(path) { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "normalize", + path + } + }); +} +async function join(...paths) { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "join", + paths + } + }); +} +async function dirname(path) { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "dirname", + path + } + }); +} +async function extname(path) { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "extname", + path + } + }); +} +async function basename(path, ext) { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "basename", + path, + ext + } + }); +} +async function isAbsolute(path) { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "isAbsolute", + path + } + }); +} + +// tauri/tooling/api/src/process.ts +var process_exports = {}; +__export(process_exports, { + exit: () => exit, + relaunch: () => relaunch +}); +async function exit(exitCode = 0) { + return invokeTauriCommand({ + __tauriModule: "Process", + message: { + cmd: "exit", + exitCode + } + }); +} +async function relaunch() { + return invokeTauriCommand({ + __tauriModule: "Process", + message: { + cmd: "relaunch" + } + }); +} + +// tauri/tooling/api/src/shell.ts +var shell_exports = {}; +__export(shell_exports, { + Child: () => Child, + Command: () => Command, + EventEmitter: () => EventEmitter, + open: () => open2 +}); +async function execute(onEvent, program, args = [], options) { + if (typeof args === "object") { + Object.freeze(args); + } + return invokeTauriCommand({ + __tauriModule: "Shell", + message: { + cmd: "execute", + program, + args, + options, + onEventFn: transformCallback(onEvent) + } + }); +} +var EventEmitter = class { + constructor() { + this.eventListeners = /* @__PURE__ */ Object.create(null); + } + addListener(eventName, listener) { + return this.on(eventName, listener); + } + removeListener(eventName, listener) { + return this.off(eventName, listener); + } + on(eventName, listener) { + if (eventName in this.eventListeners) { + this.eventListeners[eventName].push(listener); + } else { + this.eventListeners[eventName] = [listener]; + } + return this; + } + once(eventName, listener) { + const wrapper = (...args) => { + this.removeListener(eventName, wrapper); + listener(...args); + }; + return this.addListener(eventName, wrapper); + } + off(eventName, listener) { + if (eventName in this.eventListeners) { + this.eventListeners[eventName] = this.eventListeners[eventName].filter( + (l) => l !== listener + ); + } + return this; + } + removeAllListeners(event) { + if (event) { + delete this.eventListeners[event]; + } else { + this.eventListeners = /* @__PURE__ */ Object.create(null); + } + return this; + } + emit(eventName, ...args) { + if (eventName in this.eventListeners) { + const listeners = this.eventListeners[eventName]; + for (const listener of listeners) + listener(...args); + return true; + } + return false; + } + listenerCount(eventName) { + if (eventName in this.eventListeners) + return this.eventListeners[eventName].length; + return 0; + } + prependListener(eventName, listener) { + if (eventName in this.eventListeners) { + this.eventListeners[eventName].unshift(listener); + } else { + this.eventListeners[eventName] = [listener]; + } + return this; + } + prependOnceListener(eventName, listener) { + const wrapper = (...args) => { + this.removeListener(eventName, wrapper); + listener(...args); + }; + return this.prependListener(eventName, wrapper); + } +}; +var Child = class { + constructor(pid) { + this.pid = pid; + } + async write(data) { + return invokeTauriCommand({ + __tauriModule: "Shell", + message: { + cmd: "stdinWrite", + pid: this.pid, + buffer: typeof data === "string" ? data : Array.from(data) + } + }); + } + async kill() { + return invokeTauriCommand({ + __tauriModule: "Shell", + message: { + cmd: "killChild", + pid: this.pid + } + }); + } +}; +var Command = class extends EventEmitter { + constructor(program, args = [], options) { + super(); + this.stdout = new EventEmitter(); + this.stderr = new EventEmitter(); + this.program = program; + this.args = typeof args === "string" ? [args] : args; + this.options = options ?? {}; + } + static sidecar(program, args = [], options) { + const instance = new Command(program, args, options); + instance.options.sidecar = true; + return instance; + } + async spawn() { + return execute( + (event) => { + switch (event.event) { + case "Error": + this.emit("error", event.payload); + break; + case "Terminated": + this.emit("close", event.payload); + break; + case "Stdout": + this.stdout.emit("data", event.payload); + break; + case "Stderr": + this.stderr.emit("data", event.payload); + break; + } + }, + this.program, + this.args, + this.options + ).then((pid) => new Child(pid)); + } + async execute() { + return new Promise((resolve2, reject) => { + this.on("error", reject); + const stdout = []; + const stderr = []; + this.stdout.on("data", (line) => { + stdout.push(line); + }); + this.stderr.on("data", (line) => { + stderr.push(line); + }); + this.on("close", (payload) => { + resolve2({ + code: payload.code, + signal: payload.signal, + stdout: stdout.join("\n"), + stderr: stderr.join("\n") + }); + }); + this.spawn().catch(reject); + }); + } +}; +async function open2(path, openWith) { + return invokeTauriCommand({ + __tauriModule: "Shell", + message: { + cmd: "open", + path, + with: openWith + } + }); +} + +// tauri/tooling/api/src/updater.ts +var updater_exports = {}; +__export(updater_exports, { + checkUpdate: () => checkUpdate, + installUpdate: () => installUpdate, + onUpdaterEvent: () => onUpdaterEvent +}); +async function onUpdaterEvent(handler) { + return listen2("tauri://update-status" /* STATUS_UPDATE */, (data) => { + handler(data?.payload); + }); +} +async function installUpdate() { + let unlistenerFn; + function cleanListener() { + if (unlistenerFn) { + unlistenerFn(); + } + unlistenerFn = void 0; + } + return new Promise((resolve2, reject) => { + function onStatusChange(statusResult) { + if (statusResult.error) { + cleanListener(); + return reject(statusResult.error); + } + if (statusResult.status === "DONE") { + cleanListener(); + return resolve2(); + } + } + onUpdaterEvent(onStatusChange).then((fn) => { + unlistenerFn = fn; + }).catch((e) => { + cleanListener(); + throw e; + }); + emit2("tauri://update-install" /* INSTALL_UPDATE */).catch((e) => { + cleanListener(); + throw e; + }); + }); +} +async function checkUpdate() { + let unlistenerFn; + function cleanListener() { + if (unlistenerFn) { + unlistenerFn(); + } + unlistenerFn = void 0; + } + return new Promise((resolve2, reject) => { + function onUpdateAvailable(manifest) { + cleanListener(); + return resolve2({ + manifest, + shouldUpdate: true + }); + } + function onStatusChange(statusResult) { + if (statusResult.error) { + cleanListener(); + return reject(statusResult.error); + } + if (statusResult.status === "UPTODATE") { + cleanListener(); + return resolve2({ + shouldUpdate: false + }); + } + } + once2("tauri://update-available" /* UPDATE_AVAILABLE */, (data) => { + onUpdateAvailable(data?.payload); + }).catch((e) => { + cleanListener(); + throw e; + }); + onUpdaterEvent(onStatusChange).then((fn) => { + unlistenerFn = fn; + }).catch((e) => { + cleanListener(); + throw e; + }); + emit2("tauri://update" /* CHECK_UPDATE */).catch((e) => { + cleanListener(); + throw e; + }); + }); +} + +// tauri/tooling/api/src/window.ts +var window_exports = {}; +__export(window_exports, { + CloseRequestedEvent: () => CloseRequestedEvent, + LogicalPosition: () => LogicalPosition, + LogicalSize: () => LogicalSize, + PhysicalPosition: () => PhysicalPosition, + PhysicalSize: () => PhysicalSize, + UserAttentionType: () => UserAttentionType, + WebviewWindow: () => WebviewWindow, + WebviewWindowHandle: () => WebviewWindowHandle, + WindowManager: () => WindowManager, + appWindow: () => appWindow, + availableMonitors: () => availableMonitors, + currentMonitor: () => currentMonitor, + getAll: () => getAll, + getCurrent: () => getCurrent, + primaryMonitor: () => primaryMonitor +}); +var LogicalSize = class { + constructor(width, height) { + this.type = "Logical"; + this.width = width; + this.height = height; + } +}; +var PhysicalSize = class { + constructor(width, height) { + this.type = "Physical"; + this.width = width; + this.height = height; + } + toLogical(scaleFactor) { + return new LogicalSize(this.width / scaleFactor, this.height / scaleFactor); + } +}; +var LogicalPosition = class { + constructor(x, y) { + this.type = "Logical"; + this.x = x; + this.y = y; + } +}; +var PhysicalPosition = class { + constructor(x, y) { + this.type = "Physical"; + this.x = x; + this.y = y; + } + toLogical(scaleFactor) { + return new LogicalPosition(this.x / scaleFactor, this.y / scaleFactor); + } +}; +var UserAttentionType = /* @__PURE__ */ ((UserAttentionType2) => { + UserAttentionType2[UserAttentionType2["Critical"] = 1] = "Critical"; + UserAttentionType2[UserAttentionType2["Informational"] = 2] = "Informational"; + return UserAttentionType2; +})(UserAttentionType || {}); +function getCurrent() { + return new WebviewWindow(window.__TAURI_METADATA__.__currentWindow.label, { + skip: true + }); +} +function getAll() { + return window.__TAURI_METADATA__.__windows.map( + (w) => new WebviewWindow(w.label, { + skip: true + }) + ); +} +var localTauriEvents = ["tauri://created", "tauri://error"]; +var WebviewWindowHandle = class { + constructor(label) { + this.label = label; + this.listeners = /* @__PURE__ */ Object.create(null); + } + async listen(event, handler) { + if (this._handleTauriEvent(event, handler)) { + return Promise.resolve(() => { + const listeners = this.listeners[event]; + listeners.splice(listeners.indexOf(handler), 1); + }); + } + return listen(event, this.label, handler); + } + async once(event, handler) { + if (this._handleTauriEvent(event, handler)) { + return Promise.resolve(() => { + const listeners = this.listeners[event]; + listeners.splice(listeners.indexOf(handler), 1); + }); + } + return once(event, this.label, handler); + } + async emit(event, payload) { + if (localTauriEvents.includes(event)) { + for (const handler of this.listeners[event] || []) { + handler({ event, id: -1, windowLabel: this.label, payload }); + } + return Promise.resolve(); + } + return emit(event, this.label, payload); + } + _handleTauriEvent(event, handler) { + if (localTauriEvents.includes(event)) { + if (!(event in this.listeners)) { + this.listeners[event] = [handler]; + } else { + this.listeners[event].push(handler); + } + return true; + } + return false; + } +}; +var WindowManager = class extends WebviewWindowHandle { + async scaleFactor() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "scaleFactor" + } + } + } + }); + } + async innerPosition() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "innerPosition" + } + } + } + }).then(({ x, y }) => new PhysicalPosition(x, y)); + } + async outerPosition() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "outerPosition" + } + } + } + }).then(({ x, y }) => new PhysicalPosition(x, y)); + } + async innerSize() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "innerSize" + } + } + } + }).then(({ width, height }) => new PhysicalSize(width, height)); + } + async outerSize() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "outerSize" + } + } + } + }).then(({ width, height }) => new PhysicalSize(width, height)); + } + async isFullscreen() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "isFullscreen" + } + } + } + }); + } + async isMaximized() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "isMaximized" + } + } + } + }); + } + async isDecorated() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "isDecorated" + } + } + } + }); + } + async isResizable() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "isResizable" + } + } + } + }); + } + async isVisible() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "isVisible" + } + } + } + }); + } + async theme() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "theme" + } + } + } + }); + } + async center() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "center" + } + } + } + }); + } + async requestUserAttention(requestType) { + let requestType_ = null; + if (requestType) { + if (requestType === 1 /* Critical */) { + requestType_ = { type: "Critical" }; + } else { + requestType_ = { type: "Informational" }; + } + } + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "requestUserAttention", + payload: requestType_ + } + } + } + }); + } + async setResizable(resizable) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setResizable", + payload: resizable + } + } + } + }); + } + async setTitle(title) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setTitle", + payload: title + } + } + } + }); + } + async maximize() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "maximize" + } + } + } + }); + } + async unmaximize() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "unmaximize" + } + } + } + }); + } + async toggleMaximize() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "toggleMaximize" + } + } + } + }); + } + async minimize() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "minimize" + } + } + } + }); + } + async unminimize() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "unminimize" + } + } + } + }); + } + async show() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "show" + } + } + } + }); + } + async hide() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "hide" + } + } + } + }); + } + async close() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "close" + } + } + } + }); + } + async setDecorations(decorations) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setDecorations", + payload: decorations + } + } + } + }); + } + async setAlwaysOnTop(alwaysOnTop) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setAlwaysOnTop", + payload: alwaysOnTop + } + } + } + }); + } + async setSize(size) { + if (!size || size.type !== "Logical" && size.type !== "Physical") { + throw new Error( + "the `size` argument must be either a LogicalSize or a PhysicalSize instance" + ); + } + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setSize", + payload: { + type: size.type, + data: { + width: size.width, + height: size.height + } + } + } + } + } + }); + } + async setMinSize(size) { + if (size && size.type !== "Logical" && size.type !== "Physical") { + throw new Error( + "the `size` argument must be either a LogicalSize or a PhysicalSize instance" + ); + } + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setMinSize", + payload: size ? { + type: size.type, + data: { + width: size.width, + height: size.height + } + } : null + } + } + } + }); + } + async setMaxSize(size) { + if (size && size.type !== "Logical" && size.type !== "Physical") { + throw new Error( + "the `size` argument must be either a LogicalSize or a PhysicalSize instance" + ); + } + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setMaxSize", + payload: size ? { + type: size.type, + data: { + width: size.width, + height: size.height + } + } : null + } + } + } + }); + } + async setPosition(position) { + if (!position || position.type !== "Logical" && position.type !== "Physical") { + throw new Error( + "the `position` argument must be either a LogicalPosition or a PhysicalPosition instance" + ); + } + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setPosition", + payload: { + type: position.type, + data: { + x: position.x, + y: position.y + } + } + } + } + } + }); + } + async setFullscreen(fullscreen) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setFullscreen", + payload: fullscreen + } + } + } + }); + } + async setFocus() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setFocus" + } + } + } + }); + } + async setIcon(icon) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setIcon", + payload: { + icon: typeof icon === "string" ? icon : Array.from(icon) + } + } + } + } + }); + } + async setSkipTaskbar(skip) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setSkipTaskbar", + payload: skip + } + } + } + }); + } + async setCursorGrab(grab) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setCursorGrab", + payload: grab + } + } + } + }); + } + async setCursorVisible(visible) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setCursorVisible", + payload: visible + } + } + } + }); + } + async setCursorIcon(icon) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setCursorIcon", + payload: icon + } + } + } + }); + } + async setCursorPosition(position) { + if (!position || position.type !== "Logical" && position.type !== "Physical") { + throw new Error( + "the `position` argument must be either a LogicalPosition or a PhysicalPosition instance" + ); + } + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setCursorPosition", + payload: { + type: position.type, + data: { + x: position.x, + y: position.y + } + } + } + } + } + }); + } + async setIgnoreCursorEvents(ignore) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setIgnoreCursorEvents", + payload: ignore + } + } + } + }); + } + async startDragging() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "startDragging" + } + } + } + }); + } + async onResized(handler) { + return this.listen("tauri://resize" /* WINDOW_RESIZED */, handler); + } + async onMoved(handler) { + return this.listen("tauri://move" /* WINDOW_MOVED */, handler); + } + async onCloseRequested(handler) { + return this.listen("tauri://close-requested" /* WINDOW_CLOSE_REQUESTED */, (event) => { + const evt = new CloseRequestedEvent(event); + void Promise.resolve(handler(evt)).then(() => { + if (!evt.isPreventDefault()) { + return this.close(); + } + }); + }); + } + async onFocusChanged(handler) { + const unlistenFocus = await this.listen( + "tauri://focus" /* WINDOW_FOCUS */, + (event) => { + handler({ ...event, payload: true }); + } + ); + const unlistenBlur = await this.listen( + "tauri://blur" /* WINDOW_BLUR */, + (event) => { + handler({ ...event, payload: false }); + } + ); + return () => { + unlistenFocus(); + unlistenBlur(); + }; + } + async onScaleChanged(handler) { + return this.listen( + "tauri://scale-change" /* WINDOW_SCALE_FACTOR_CHANGED */, + handler + ); + } + async onMenuClicked(handler) { + return this.listen("tauri://menu" /* MENU */, handler); + } + async onFileDropEvent(handler) { + const unlistenFileDrop = await this.listen( + "tauri://file-drop" /* WINDOW_FILE_DROP */, + (event) => { + handler({ ...event, payload: { type: "drop", paths: event.payload } }); + } + ); + const unlistenFileHover = await this.listen( + "tauri://file-drop-hover" /* WINDOW_FILE_DROP_HOVER */, + (event) => { + handler({ ...event, payload: { type: "hover", paths: event.payload } }); + } + ); + const unlistenCancel = await this.listen( + "tauri://file-drop-cancelled" /* WINDOW_FILE_DROP_CANCELLED */, + (event) => { + handler({ ...event, payload: { type: "cancel" } }); + } + ); + return () => { + unlistenFileDrop(); + unlistenFileHover(); + unlistenCancel(); + }; + } + async onThemeChanged(handler) { + return this.listen("tauri://theme-changed" /* WINDOW_THEME_CHANGED */, handler); + } +}; +var CloseRequestedEvent = class { + constructor(event) { + this._preventDefault = false; + this.event = event.event; + this.windowLabel = event.windowLabel; + this.id = event.id; + } + preventDefault() { + this._preventDefault = true; + } + isPreventDefault() { + return this._preventDefault; + } +}; +var WebviewWindow = class extends WindowManager { + constructor(label, options = {}) { + super(label); + if (!options?.skip) { + invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "createWebview", + data: { + options: { + label, + ...options + } + } + } + }).then(async () => this.emit("tauri://created")).catch(async (e) => this.emit("tauri://error", e)); + } + } + static getByLabel(label) { + if (getAll().some((w) => w.label === label)) { + return new WebviewWindow(label, { skip: true }); + } + return null; + } +}; +var appWindow; +if ("__TAURI_METADATA__" in window) { + appWindow = new WebviewWindow( + window.__TAURI_METADATA__.__currentWindow.label, + { + skip: true + } + ); +} else { + console.warn( + `Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label. +Note that this is not an issue if running this frontend on a browser instead of a Tauri window.` + ); + appWindow = new WebviewWindow("main", { + skip: true + }); +} +function mapMonitor(m) { + return m === null ? null : { + name: m.name, + scaleFactor: m.scaleFactor, + position: new PhysicalPosition(m.position.x, m.position.y), + size: new PhysicalSize(m.size.width, m.size.height) + }; +} +async function currentMonitor() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + cmd: { + type: "currentMonitor" + } + } + } + }).then(mapMonitor); +} +async function primaryMonitor() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + cmd: { + type: "primaryMonitor" + } + } + } + }).then(mapMonitor); +} +async function availableMonitors() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + cmd: { + type: "availableMonitors" + } + } + } + }).then((ms) => ms.map(mapMonitor)); +} + +// tauri/tooling/api/src/os.ts +var os_exports = {}; +__export(os_exports, { + EOL: () => EOL, + arch: () => arch, + platform: () => platform, + tempdir: () => tempdir, + type: () => type, + version: () => version +}); +var EOL = isWindows() ? "\r\n" : "\n"; +async function platform() { + return invokeTauriCommand({ + __tauriModule: "Os", + message: { + cmd: "platform" + } + }); +} +async function version() { + return invokeTauriCommand({ + __tauriModule: "Os", + message: { + cmd: "version" + } + }); +} +async function type() { + return invokeTauriCommand({ + __tauriModule: "Os", + message: { + cmd: "osType" + } + }); +} +async function arch() { + return invokeTauriCommand({ + __tauriModule: "Os", + message: { + cmd: "arch" + } + }); +} +async function tempdir() { + return invokeTauriCommand({ + __tauriModule: "Os", + message: { + cmd: "tempdir" + } + }); +} + +// tauri/tooling/api/src/index.ts +var invoke2 = invoke; +export { + app_exports as app, + cli_exports as cli, + clipboard_exports as clipboard, + dialog_exports as dialog, + event_exports as event, + fs_exports as fs, + globalShortcut_exports as globalShortcut, + http_exports as http, + invoke2 as invoke, + notification_exports as notification, + os_exports as os, + path_exports as path, + process_exports as process, + shell_exports as shell, + tauri_exports as tauri, + updater_exports as updater, + window_exports as window +}; diff --git a/src/lib.rs b/src/lib.rs index ace5379..655f5d8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,21 +4,49 @@ use wasm_bindgen::JsValue; pub mod app; #[cfg(feature = "clipboard")] pub mod clipboard; +#[cfg(feature = "dialog")] +pub mod dialog; #[cfg(feature = "event")] pub mod event; #[cfg(feature = "mocks")] pub mod mocks; +#[cfg(feature = "process")] +pub mod process; #[cfg(feature = "tauri")] pub mod tauri; #[cfg(feature = "updater")] pub mod updater; +#[cfg(feature = "window")] +pub mod window; +#[cfg(feature = "notification")] +pub mod notification; +#[cfg(feature = "os")] +pub mod os; #[derive(Debug, thiserror::Error)] pub enum Error { - #[error(transparent)] - Serde(#[from] serde_wasm_bindgen::Error), - #[error("{0:?}")] - Other(JsValue), + #[error("{0}")] + Serde(String), + #[error("Unknown Theme \"{0}\". Expected one of \"light\",\"dark\"")] + UnknownTheme(String), + #[error("Invalid Url {0}")] + InvalidUrl(#[from] url::ParseError), + #[error("Invalid Version {0}")] + InvalidVersion(#[from] semver::Error), + #[error("{0}")] + Other(String), +} + +impl From for Error { + fn from(e: serde_wasm_bindgen::Error) -> Self { + Self::Serde(format!("{:?}", e)) + } +} + +impl From for Error { + fn from(e: JsValue) -> Self { + Self::Serde(format!("{:?}", e)) + } } pub(crate) type Result = std::result::Result; diff --git a/dist/mocks.js b/src/mocks.js similarity index 100% rename from dist/mocks.js rename to src/mocks.js diff --git a/src/mocks.rs b/src/mocks.rs index f8c4877..aa51e9e 100644 --- a/src/mocks.rs +++ b/src/mocks.rs @@ -55,7 +55,7 @@ mod inner { JsValue, }; - #[wasm_bindgen(module = "/dist/mocks.js")] + #[wasm_bindgen(module = "/src/mocks.js")] extern "C" { #[wasm_bindgen(variadic)] pub fn mockWindows(current: &str, rest: JsValue); diff --git a/src/notification.js b/src/notification.js new file mode 100644 index 0000000..4ec6b9b --- /dev/null +++ b/src/notification.js @@ -0,0 +1,70 @@ +// tauri/tooling/api/src/tauri.ts +function uid() { + return window.crypto.getRandomValues(new Uint32Array(1))[0]; +} +function transformCallback(callback, once = false) { + const identifier = uid(); + const prop = `_${identifier}`; + Object.defineProperty(window, prop, { + value: (result) => { + if (once) { + Reflect.deleteProperty(window, prop); + } + return callback?.(result); + }, + writable: false, + configurable: true + }); + return identifier; +} +async function invoke(cmd, args = {}) { + return new Promise((resolve, reject) => { + const callback = transformCallback((e) => { + resolve(e); + Reflect.deleteProperty(window, `_${error}`); + }, true); + const error = transformCallback((e) => { + reject(e); + Reflect.deleteProperty(window, `_${callback}`); + }, true); + window.__TAURI_IPC__({ + cmd, + callback, + error, + ...args + }); + }); +} + +// tauri/tooling/api/src/helpers/tauri.ts +async function invokeTauriCommand(command) { + return invoke("tauri", command); +} + +// tauri/tooling/api/src/notification.ts +async function isPermissionGranted() { + if (window.Notification.permission !== "default") { + return Promise.resolve(window.Notification.permission === "granted"); + } + return invokeTauriCommand({ + __tauriModule: "Notification", + message: { + cmd: "isNotificationPermissionGranted" + } + }); +} +async function requestPermission() { + return window.Notification.requestPermission(); +} +function sendNotification(options) { + if (typeof options === "string") { + new window.Notification(options); + } else { + new window.Notification(options.title, options); + } +} +export { + isPermissionGranted, + requestPermission, + sendNotification +}; diff --git a/src/notification.rs b/src/notification.rs new file mode 100644 index 0000000..7391b88 --- /dev/null +++ b/src/notification.rs @@ -0,0 +1,84 @@ +use log::debug; +use serde::{Deserialize, Serialize}; +use wasm_bindgen::JsValue; + +pub async fn is_permission_granted() -> crate::Result { + let raw = inner::isPermissionGranted().await?; + + Ok(serde_wasm_bindgen::from_value(raw)?) +} + +pub async fn request_permission() -> crate::Result { + let raw = inner::requestPermission().await?; + + Ok(serde_wasm_bindgen::from_value(raw)?) +} + +#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] +pub enum Permission { + #[default] + Default, + Granted, + Denied, +} + +impl<'de> Deserialize<'de> for Permission { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + match String::deserialize(deserializer)?.as_str() { + "default" => Ok(Permission::Default), + "granted" => Ok(Permission::Granted), + "denied" => Ok(Permission::Denied), + _ => Err(serde::de::Error::custom( + "expected one of default, granted, denied", + )), + } + } +} + +#[derive(Debug, Default, Serialize)] +pub struct Notification<'a> { + body: Option<&'a str>, + title: Option<&'a str>, + icon: Option<&'a str> +} + +impl<'a> Notification<'a> { + pub fn new() -> Self { + Self::default() + } + + pub fn set_title(&mut self, title: &'a str) { + self.title = Some(title); + } + + pub fn set_body(&mut self, body: &'a str) { + self.body = Some(body); + } + + pub fn set_icon(&mut self, icon: &'a str) { + self.icon = Some(icon); + } + + pub fn show(&self) -> crate::Result<()> { + inner::sendNotification(serde_wasm_bindgen::to_value(&self)?)?; + + Ok(()) + } +} + +mod inner { + use wasm_bindgen::{prelude::wasm_bindgen, JsValue}; + + #[wasm_bindgen(module = "/src/notification.js")] + extern "C" { + #[wasm_bindgen(catch)] + pub async fn isPermissionGranted() -> Result; + #[wasm_bindgen(catch)] + pub async fn requestPermission() -> Result; + #[wasm_bindgen(catch)] + pub fn sendNotification(notification: JsValue) -> Result<(), JsValue>; + } +} diff --git a/src/os.js b/src/os.js new file mode 100644 index 0000000..76dd323 --- /dev/null +++ b/src/os.js @@ -0,0 +1,98 @@ +// tauri/tooling/api/src/helpers/os-check.ts +function isWindows() { + return navigator.appVersion.includes("Win"); +} + +// tauri/tooling/api/src/tauri.ts +function uid() { + return window.crypto.getRandomValues(new Uint32Array(1))[0]; +} +function transformCallback(callback, once = false) { + const identifier = uid(); + const prop = `_${identifier}`; + Object.defineProperty(window, prop, { + value: (result) => { + if (once) { + Reflect.deleteProperty(window, prop); + } + return callback?.(result); + }, + writable: false, + configurable: true + }); + return identifier; +} +async function invoke(cmd, args = {}) { + return new Promise((resolve, reject) => { + const callback = transformCallback((e) => { + resolve(e); + Reflect.deleteProperty(window, `_${error}`); + }, true); + const error = transformCallback((e) => { + reject(e); + Reflect.deleteProperty(window, `_${callback}`); + }, true); + window.__TAURI_IPC__({ + cmd, + callback, + error, + ...args + }); + }); +} + +// tauri/tooling/api/src/helpers/tauri.ts +async function invokeTauriCommand(command) { + return invoke("tauri", command); +} + +// tauri/tooling/api/src/os.ts +var EOL = isWindows() ? "\r\n" : "\n"; +async function platform() { + return invokeTauriCommand({ + __tauriModule: "Os", + message: { + cmd: "platform" + } + }); +} +async function version() { + return invokeTauriCommand({ + __tauriModule: "Os", + message: { + cmd: "version" + } + }); +} +async function type() { + return invokeTauriCommand({ + __tauriModule: "Os", + message: { + cmd: "osType" + } + }); +} +async function arch() { + return invokeTauriCommand({ + __tauriModule: "Os", + message: { + cmd: "arch" + } + }); +} +async function tempdir() { + return invokeTauriCommand({ + __tauriModule: "Os", + message: { + cmd: "tempdir" + } + }); +} +export { + EOL, + arch, + platform, + tempdir, + type, + version +}; diff --git a/src/os.rs b/src/os.rs new file mode 100644 index 0000000..261a3bd --- /dev/null +++ b/src/os.rs @@ -0,0 +1,111 @@ +use std::path::{PathBuf}; +use semver::Version; +use serde::{Serialize, Deserialize}; + +#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)] +pub enum Arch { + #[serde(rename = "x86")] + X86, + #[serde(rename = "x86_64")] + X86_64, + #[serde(rename = "arm")] + Arm, + #[serde(rename = "aarch64")] + Aarch64, + #[serde(rename = "mips")] + Mips, + #[serde(rename = "mips64")] + Mips64, + #[serde(rename = "powerpc")] + Powerpc, + #[serde(rename = "powerpc64")] + Powerpc64, + #[serde(rename = "riscv64")] + Riscv64, + #[serde(rename = "s390x")] + S390x, + #[serde(rename = "sparc64")] + Sparc64 +} + +#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)] +pub enum Platform { + #[serde(rename = "linux")] + Linux, + #[serde(rename = "darwin")] + Darwin, + #[serde(rename = "ios")] + Ios, + #[serde(rename = "freebsd")] + Freebsd, + #[serde(rename = "dragonfly")] + Dragonfly, + #[serde(rename = "netbsd")] + Netbsd, + #[serde(rename = "openbsd")] + Openbsd, + #[serde(rename = "solaris")] + Solaris, + #[serde(rename = "android")] + Android, + #[serde(rename = "win32")] + Win32, +} + +#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)] +pub enum OsKind { + #[serde(rename = "Linux")] + Linux, + #[serde(rename = "Darwin")] + Darwin, + #[serde(rename = "Windows_NT")] + WindowsNt, +} + +pub async fn arch() -> crate::Result { + let raw = inner::arch().await?; + + Ok(serde_wasm_bindgen::from_value(raw)?) +} + +pub async fn platform() -> crate::Result { + let raw = inner::platform().await?; + + Ok(serde_wasm_bindgen::from_value(raw)?) +} + +pub async fn tempdir() -> crate::Result { + let raw = inner::tempdir().await?; + + Ok(serde_wasm_bindgen::from_value(raw)?) +} + +pub async fn kind() -> crate::Result { + let raw = inner::kind().await?; + + Ok(serde_wasm_bindgen::from_value(raw)?) +} + +pub async fn version() -> crate::Result { + let raw = inner::version().await?; + + Ok(serde_wasm_bindgen::from_value(raw)?) +} + +mod inner { + use wasm_bindgen::prelude::*; + + #[wasm_bindgen(module = "/src/os.js")] + extern "C" { + #[wasm_bindgen(catch)] + pub async fn arch() -> Result; + #[wasm_bindgen(catch)] + pub async fn platform() -> Result; + #[wasm_bindgen(catch)] + pub async fn tempdir() -> Result; + #[wasm_bindgen(catch, js_name = "type")] + pub async fn kind() -> Result; + #[wasm_bindgen(catch)] + pub async fn version() -> Result; + } +} diff --git a/src/path.js b/src/path.js new file mode 100644 index 0000000..1250562 --- /dev/null +++ b/src/path.js @@ -0,0 +1,418 @@ +// tauri/tooling/api/src/tauri.ts +function uid() { + return window.crypto.getRandomValues(new Uint32Array(1))[0]; +} +function transformCallback(callback, once = false) { + const identifier = uid(); + const prop = `_${identifier}`; + Object.defineProperty(window, prop, { + value: (result) => { + if (once) { + Reflect.deleteProperty(window, prop); + } + return callback?.(result); + }, + writable: false, + configurable: true + }); + return identifier; +} +async function invoke(cmd, args = {}) { + return new Promise((resolve2, reject) => { + const callback = transformCallback((e) => { + resolve2(e); + Reflect.deleteProperty(window, `_${error}`); + }, true); + const error = transformCallback((e) => { + reject(e); + Reflect.deleteProperty(window, `_${callback}`); + }, true); + window.__TAURI_IPC__({ + cmd, + callback, + error, + ...args + }); + }); +} + +// tauri/tooling/api/src/helpers/tauri.ts +async function invokeTauriCommand(command) { + return invoke("tauri", command); +} + +// tauri/tooling/api/src/fs.ts +var BaseDirectory = /* @__PURE__ */ ((BaseDirectory2) => { + BaseDirectory2[BaseDirectory2["Audio"] = 1] = "Audio"; + BaseDirectory2[BaseDirectory2["Cache"] = 2] = "Cache"; + BaseDirectory2[BaseDirectory2["Config"] = 3] = "Config"; + BaseDirectory2[BaseDirectory2["Data"] = 4] = "Data"; + BaseDirectory2[BaseDirectory2["LocalData"] = 5] = "LocalData"; + BaseDirectory2[BaseDirectory2["Desktop"] = 6] = "Desktop"; + BaseDirectory2[BaseDirectory2["Document"] = 7] = "Document"; + BaseDirectory2[BaseDirectory2["Download"] = 8] = "Download"; + BaseDirectory2[BaseDirectory2["Executable"] = 9] = "Executable"; + BaseDirectory2[BaseDirectory2["Font"] = 10] = "Font"; + BaseDirectory2[BaseDirectory2["Home"] = 11] = "Home"; + BaseDirectory2[BaseDirectory2["Picture"] = 12] = "Picture"; + BaseDirectory2[BaseDirectory2["Public"] = 13] = "Public"; + BaseDirectory2[BaseDirectory2["Runtime"] = 14] = "Runtime"; + BaseDirectory2[BaseDirectory2["Template"] = 15] = "Template"; + BaseDirectory2[BaseDirectory2["Video"] = 16] = "Video"; + BaseDirectory2[BaseDirectory2["Resource"] = 17] = "Resource"; + BaseDirectory2[BaseDirectory2["App"] = 18] = "App"; + BaseDirectory2[BaseDirectory2["Log"] = 19] = "Log"; + BaseDirectory2[BaseDirectory2["Temp"] = 20] = "Temp"; + BaseDirectory2[BaseDirectory2["AppConfig"] = 21] = "AppConfig"; + BaseDirectory2[BaseDirectory2["AppData"] = 22] = "AppData"; + BaseDirectory2[BaseDirectory2["AppLocalData"] = 23] = "AppLocalData"; + BaseDirectory2[BaseDirectory2["AppCache"] = 24] = "AppCache"; + BaseDirectory2[BaseDirectory2["AppLog"] = 25] = "AppLog"; + return BaseDirectory2; +})(BaseDirectory || {}); + +// tauri/tooling/api/src/helpers/os-check.ts +function isWindows() { + return navigator.appVersion.includes("Win"); +} + +// tauri/tooling/api/src/path.ts +async function appDir() { + return appConfigDir(); +} +async function appConfigDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 21 /* AppConfig */ + } + }); +} +async function appDataDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 22 /* AppData */ + } + }); +} +async function appLocalDataDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 23 /* AppLocalData */ + } + }); +} +async function appCacheDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 24 /* AppCache */ + } + }); +} +async function audioDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 1 /* Audio */ + } + }); +} +async function cacheDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 2 /* Cache */ + } + }); +} +async function configDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 3 /* Config */ + } + }); +} +async function dataDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 4 /* Data */ + } + }); +} +async function desktopDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 6 /* Desktop */ + } + }); +} +async function documentDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 7 /* Document */ + } + }); +} +async function downloadDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 8 /* Download */ + } + }); +} +async function executableDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 9 /* Executable */ + } + }); +} +async function fontDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 10 /* Font */ + } + }); +} +async function homeDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 11 /* Home */ + } + }); +} +async function localDataDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 5 /* LocalData */ + } + }); +} +async function pictureDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 12 /* Picture */ + } + }); +} +async function publicDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 13 /* Public */ + } + }); +} +async function resourceDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 17 /* Resource */ + } + }); +} +async function resolveResource(resourcePath) { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: resourcePath, + directory: 17 /* Resource */ + } + }); +} +async function runtimeDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 14 /* Runtime */ + } + }); +} +async function templateDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 15 /* Template */ + } + }); +} +async function videoDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 16 /* Video */ + } + }); +} +async function logDir() { + return appLogDir(); +} +async function appLogDir() { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolvePath", + path: "", + directory: 25 /* AppLog */ + } + }); +} +var sep = isWindows() ? "\\" : "/"; +var delimiter = isWindows() ? ";" : ":"; +async function resolve(...paths) { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "resolve", + paths + } + }); +} +async function normalize(path) { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "normalize", + path + } + }); +} +async function join(...paths) { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "join", + paths + } + }); +} +async function dirname(path) { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "dirname", + path + } + }); +} +async function extname(path) { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "extname", + path + } + }); +} +async function basename(path, ext) { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "basename", + path, + ext + } + }); +} +async function isAbsolute(path) { + return invokeTauriCommand({ + __tauriModule: "Path", + message: { + cmd: "isAbsolute", + path + } + }); +} +export { + BaseDirectory, + appCacheDir, + appConfigDir, + appDataDir, + appDir, + appLocalDataDir, + appLogDir, + audioDir, + basename, + cacheDir, + configDir, + dataDir, + delimiter, + desktopDir, + dirname, + documentDir, + downloadDir, + executableDir, + extname, + fontDir, + homeDir, + isAbsolute, + join, + localDataDir, + logDir, + normalize, + pictureDir, + publicDir, + resolve, + resolveResource, + resourceDir, + runtimeDir, + sep, + templateDir, + videoDir +}; diff --git a/src/process.js b/src/process.js new file mode 100644 index 0000000..9356313 --- /dev/null +++ b/src/process.js @@ -0,0 +1,65 @@ +// tauri/tooling/api/src/tauri.ts +function uid() { + return window.crypto.getRandomValues(new Uint32Array(1))[0]; +} +function transformCallback(callback, once = false) { + const identifier = uid(); + const prop = `_${identifier}`; + Object.defineProperty(window, prop, { + value: (result) => { + if (once) { + Reflect.deleteProperty(window, prop); + } + return callback?.(result); + }, + writable: false, + configurable: true + }); + return identifier; +} +async function invoke(cmd, args = {}) { + return new Promise((resolve, reject) => { + const callback = transformCallback((e) => { + resolve(e); + Reflect.deleteProperty(window, `_${error}`); + }, true); + const error = transformCallback((e) => { + reject(e); + Reflect.deleteProperty(window, `_${callback}`); + }, true); + window.__TAURI_IPC__({ + cmd, + callback, + error, + ...args + }); + }); +} + +// tauri/tooling/api/src/helpers/tauri.ts +async function invokeTauriCommand(command) { + return invoke("tauri", command); +} + +// tauri/tooling/api/src/process.ts +async function exit(exitCode = 0) { + return invokeTauriCommand({ + __tauriModule: "Process", + message: { + cmd: "exit", + exitCode + } + }); +} +async function relaunch() { + return invokeTauriCommand({ + __tauriModule: "Process", + message: { + cmd: "relaunch" + } + }); +} +export { + exit, + relaunch +}; diff --git a/src/process.rs b/src/process.rs new file mode 100644 index 0000000..83ac88c --- /dev/null +++ b/src/process.rs @@ -0,0 +1,18 @@ +pub async fn exit(exit_code: u32) -> ! { + inner::exit(exit_code).await; + unreachable!() +} + +pub fn relaunch() { + inner::relaunch(); +} + +mod inner { + use wasm_bindgen::prelude::*; + + #[wasm_bindgen(module = "/src/process.js")] + extern "C" { + pub async fn exit(exitCode: u32); + pub fn relaunch(); + } +} diff --git a/src/shell.js b/src/shell.js new file mode 100644 index 0000000..006bca0 --- /dev/null +++ b/src/shell.js @@ -0,0 +1,230 @@ +// tauri/tooling/api/src/tauri.ts +function uid() { + return window.crypto.getRandomValues(new Uint32Array(1))[0]; +} +function transformCallback(callback, once = false) { + const identifier = uid(); + const prop = `_${identifier}`; + Object.defineProperty(window, prop, { + value: (result) => { + if (once) { + Reflect.deleteProperty(window, prop); + } + return callback?.(result); + }, + writable: false, + configurable: true + }); + return identifier; +} +async function invoke(cmd, args = {}) { + return new Promise((resolve, reject) => { + const callback = transformCallback((e) => { + resolve(e); + Reflect.deleteProperty(window, `_${error}`); + }, true); + const error = transformCallback((e) => { + reject(e); + Reflect.deleteProperty(window, `_${callback}`); + }, true); + window.__TAURI_IPC__({ + cmd, + callback, + error, + ...args + }); + }); +} + +// tauri/tooling/api/src/helpers/tauri.ts +async function invokeTauriCommand(command) { + return invoke("tauri", command); +} + +// tauri/tooling/api/src/shell.ts +async function execute(onEvent, program, args = [], options) { + if (typeof args === "object") { + Object.freeze(args); + } + return invokeTauriCommand({ + __tauriModule: "Shell", + message: { + cmd: "execute", + program, + args, + options, + onEventFn: transformCallback(onEvent) + } + }); +} +var EventEmitter = class { + constructor() { + this.eventListeners = /* @__PURE__ */ Object.create(null); + } + addListener(eventName, listener) { + return this.on(eventName, listener); + } + removeListener(eventName, listener) { + return this.off(eventName, listener); + } + on(eventName, listener) { + if (eventName in this.eventListeners) { + this.eventListeners[eventName].push(listener); + } else { + this.eventListeners[eventName] = [listener]; + } + return this; + } + once(eventName, listener) { + const wrapper = (...args) => { + this.removeListener(eventName, wrapper); + listener(...args); + }; + return this.addListener(eventName, wrapper); + } + off(eventName, listener) { + if (eventName in this.eventListeners) { + this.eventListeners[eventName] = this.eventListeners[eventName].filter( + (l) => l !== listener + ); + } + return this; + } + removeAllListeners(event) { + if (event) { + delete this.eventListeners[event]; + } else { + this.eventListeners = /* @__PURE__ */ Object.create(null); + } + return this; + } + emit(eventName, ...args) { + if (eventName in this.eventListeners) { + const listeners = this.eventListeners[eventName]; + for (const listener of listeners) + listener(...args); + return true; + } + return false; + } + listenerCount(eventName) { + if (eventName in this.eventListeners) + return this.eventListeners[eventName].length; + return 0; + } + prependListener(eventName, listener) { + if (eventName in this.eventListeners) { + this.eventListeners[eventName].unshift(listener); + } else { + this.eventListeners[eventName] = [listener]; + } + return this; + } + prependOnceListener(eventName, listener) { + const wrapper = (...args) => { + this.removeListener(eventName, wrapper); + listener(...args); + }; + return this.prependListener(eventName, wrapper); + } +}; +var Child = class { + constructor(pid) { + this.pid = pid; + } + async write(data) { + return invokeTauriCommand({ + __tauriModule: "Shell", + message: { + cmd: "stdinWrite", + pid: this.pid, + buffer: typeof data === "string" ? data : Array.from(data) + } + }); + } + async kill() { + return invokeTauriCommand({ + __tauriModule: "Shell", + message: { + cmd: "killChild", + pid: this.pid + } + }); + } +}; +var Command = class extends EventEmitter { + constructor(program, args = [], options) { + super(); + this.stdout = new EventEmitter(); + this.stderr = new EventEmitter(); + this.program = program; + this.args = typeof args === "string" ? [args] : args; + this.options = options ?? {}; + } + static sidecar(program, args = [], options) { + const instance = new Command(program, args, options); + instance.options.sidecar = true; + return instance; + } + async spawn() { + return execute( + (event) => { + switch (event.event) { + case "Error": + this.emit("error", event.payload); + break; + case "Terminated": + this.emit("close", event.payload); + break; + case "Stdout": + this.stdout.emit("data", event.payload); + break; + case "Stderr": + this.stderr.emit("data", event.payload); + break; + } + }, + this.program, + this.args, + this.options + ).then((pid) => new Child(pid)); + } + async execute() { + return new Promise((resolve, reject) => { + this.on("error", reject); + const stdout = []; + const stderr = []; + this.stdout.on("data", (line) => { + stdout.push(line); + }); + this.stderr.on("data", (line) => { + stderr.push(line); + }); + this.on("close", (payload) => { + resolve({ + code: payload.code, + signal: payload.signal, + stdout: stdout.join("\n"), + stderr: stderr.join("\n") + }); + }); + this.spawn().catch(reject); + }); + } +}; +async function open(path, openWith) { + return invokeTauriCommand({ + __tauriModule: "Shell", + message: { + cmd: "open", + path, + with: openWith + } + }); +} +export { + Child, + Command, + EventEmitter, + open +}; diff --git a/dist/tauri.js b/src/tauri.js similarity index 100% rename from dist/tauri.js rename to src/tauri.js diff --git a/src/tauri.rs b/src/tauri.rs index ad43df3..ea3cf68 100644 --- a/src/tauri.rs +++ b/src/tauri.rs @@ -36,14 +36,10 @@ use url::Url; /// /// @return the URL that can be used as source on the webview. #[inline(always)] -pub async fn convert_file_src(file_path: &str, protocol: Option<&str>) -> Url { - Url::parse( - &inner::convertFileSrc(file_path, protocol) - .await - .as_string() - .unwrap(), - ) - .unwrap() +pub async fn convert_file_src(file_path: &str, protocol: Option<&str>) -> crate::Result { + let js_val = inner::convertFileSrc(file_path, protocol).await?; + + Ok(serde_wasm_bindgen::from_value(js_val)?) } /// Sends a message to the backend. @@ -66,9 +62,8 @@ pub async fn convert_file_src(file_path: &str, protocol: Option<&str>) -> Url { /// @return A promise resolving or rejecting to the backend response. #[inline(always)] pub async fn invoke(cmd: &str, args: &A) -> crate::Result { - let res = inner::invoke(cmd, serde_wasm_bindgen::to_value(args).unwrap()).await; + let raw = inner::invoke(cmd, serde_wasm_bindgen::to_value(args)?).await?; - let raw = res.map_err(crate::Error::Other)?; serde_wasm_bindgen::from_value(raw).map_err(Into::into) } @@ -77,24 +72,35 @@ pub async fn invoke(cmd: &str, args: &A) -> c /// /// @return A unique identifier associated with the callback function. #[inline(always)] -pub async fn transform_callback(callback: &dyn Fn(T), once: bool) -> f64 { - inner::transformCallback( +pub async fn transform_callback( + callback: &dyn Fn(T), + once: bool, +) -> crate::Result { + let js_val = inner::transformCallback( &|raw| callback(serde_wasm_bindgen::from_value(raw).unwrap()), once, ) - .await - .as_f64() - .unwrap() + .await?; + + Ok(serde_wasm_bindgen::from_value(js_val)?) } mod inner { use wasm_bindgen::{prelude::wasm_bindgen, JsValue}; - #[wasm_bindgen(module = "/dist/tauri.js")] + #[wasm_bindgen(module = "/src/tauri.js")] extern "C" { - pub async fn convertFileSrc(filePath: &str, protocol: Option<&str>) -> JsValue; + #[wasm_bindgen(catch)] + pub async fn convertFileSrc( + filePath: &str, + protocol: Option<&str>, + ) -> Result; #[wasm_bindgen(catch)] pub async fn invoke(cmd: &str, args: JsValue) -> Result; - pub async fn transformCallback(callback: &dyn Fn(JsValue), once: bool) -> JsValue; + #[wasm_bindgen(catch)] + pub async fn transformCallback( + callback: &dyn Fn(JsValue), + once: bool, + ) -> Result; } } diff --git a/dist/updater.js b/src/updater.js similarity index 100% rename from dist/updater.js rename to src/updater.js diff --git a/src/window.js b/src/window.js new file mode 100644 index 0000000..e0b637b --- /dev/null +++ b/src/window.js @@ -0,0 +1,1004 @@ +// tauri/tooling/api/src/tauri.ts +function uid() { + return window.crypto.getRandomValues(new Uint32Array(1))[0]; +} +function transformCallback(callback, once2 = false) { + const identifier = uid(); + const prop = `_${identifier}`; + Object.defineProperty(window, prop, { + value: (result) => { + if (once2) { + Reflect.deleteProperty(window, prop); + } + return callback?.(result); + }, + writable: false, + configurable: true + }); + return identifier; +} +async function invoke(cmd, args = {}) { + return new Promise((resolve, reject) => { + const callback = transformCallback((e) => { + resolve(e); + Reflect.deleteProperty(window, `_${error}`); + }, true); + const error = transformCallback((e) => { + reject(e); + Reflect.deleteProperty(window, `_${callback}`); + }, true); + window.__TAURI_IPC__({ + cmd, + callback, + error, + ...args + }); + }); +} + +// tauri/tooling/api/src/helpers/tauri.ts +async function invokeTauriCommand(command) { + return invoke("tauri", command); +} + +// tauri/tooling/api/src/helpers/event.ts +async function _unlisten(event, eventId) { + return invokeTauriCommand({ + __tauriModule: "Event", + message: { + cmd: "unlisten", + event, + eventId + } + }); +} +async function emit(event, windowLabel, payload) { + await invokeTauriCommand({ + __tauriModule: "Event", + message: { + cmd: "emit", + event, + windowLabel, + payload + } + }); +} +async function listen(event, windowLabel, handler) { + return invokeTauriCommand({ + __tauriModule: "Event", + message: { + cmd: "listen", + event, + windowLabel, + handler: transformCallback(handler) + } + }).then((eventId) => { + return async () => _unlisten(event, eventId); + }); +} +async function once(event, windowLabel, handler) { + return listen(event, windowLabel, (eventData) => { + handler(eventData); + _unlisten(event, eventData.id).catch(() => { + }); + }); +} + +// tauri/tooling/api/src/window.ts +var LogicalSize = class { + constructor(width, height) { + this.type = "Logical"; + this.width = width; + this.height = height; + } +}; +var PhysicalSize = class { + constructor(width, height) { + this.type = "Physical"; + this.width = width; + this.height = height; + } + toLogical(scaleFactor) { + return new LogicalSize(this.width / scaleFactor, this.height / scaleFactor); + } +}; +var LogicalPosition = class { + constructor(x, y) { + this.type = "Logical"; + this.x = x; + this.y = y; + } +}; +var PhysicalPosition = class { + constructor(x, y) { + this.type = "Physical"; + this.x = x; + this.y = y; + } + toLogical(scaleFactor) { + return new LogicalPosition(this.x / scaleFactor, this.y / scaleFactor); + } +}; +var UserAttentionType = /* @__PURE__ */ ((UserAttentionType2) => { + UserAttentionType2[UserAttentionType2["Critical"] = 1] = "Critical"; + UserAttentionType2[UserAttentionType2["Informational"] = 2] = "Informational"; + return UserAttentionType2; +})(UserAttentionType || {}); +function getCurrent() { + return new WebviewWindow(window.__TAURI_METADATA__.__currentWindow.label, { + skip: true + }); +} +function getAll() { + return window.__TAURI_METADATA__.__windows.map( + (w) => new WebviewWindow(w.label, { + skip: true + }) + ); +} +var localTauriEvents = ["tauri://created", "tauri://error"]; +var WebviewWindowHandle = class { + constructor(label) { + this.label = label; + this.listeners = /* @__PURE__ */ Object.create(null); + } + async listen(event, handler) { + if (this._handleTauriEvent(event, handler)) { + return Promise.resolve(() => { + const listeners = this.listeners[event]; + listeners.splice(listeners.indexOf(handler), 1); + }); + } + return listen(event, this.label, handler); + } + async once(event, handler) { + if (this._handleTauriEvent(event, handler)) { + return Promise.resolve(() => { + const listeners = this.listeners[event]; + listeners.splice(listeners.indexOf(handler), 1); + }); + } + return once(event, this.label, handler); + } + async emit(event, payload) { + if (localTauriEvents.includes(event)) { + for (const handler of this.listeners[event] || []) { + handler({ event, id: -1, windowLabel: this.label, payload }); + } + return Promise.resolve(); + } + return emit(event, this.label, payload); + } + _handleTauriEvent(event, handler) { + if (localTauriEvents.includes(event)) { + if (!(event in this.listeners)) { + this.listeners[event] = [handler]; + } else { + this.listeners[event].push(handler); + } + return true; + } + return false; + } +}; +var WindowManager = class extends WebviewWindowHandle { + async scaleFactor() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "scaleFactor" + } + } + } + }); + } + async innerPosition() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "innerPosition" + } + } + } + }).then(({ x, y }) => new PhysicalPosition(x, y)); + } + async outerPosition() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "outerPosition" + } + } + } + }).then(({ x, y }) => new PhysicalPosition(x, y)); + } + async innerSize() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "innerSize" + } + } + } + }).then(({ width, height }) => new PhysicalSize(width, height)); + } + async outerSize() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "outerSize" + } + } + } + }).then(({ width, height }) => new PhysicalSize(width, height)); + } + async isFullscreen() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "isFullscreen" + } + } + } + }); + } + async isMaximized() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "isMaximized" + } + } + } + }); + } + async isDecorated() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "isDecorated" + } + } + } + }); + } + async isResizable() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "isResizable" + } + } + } + }); + } + async isVisible() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "isVisible" + } + } + } + }); + } + async theme() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "theme" + } + } + } + }); + } + async center() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "center" + } + } + } + }); + } + async requestUserAttention(requestType) { + let requestType_ = null; + if (requestType) { + if (requestType === 1 /* Critical */) { + requestType_ = { type: "Critical" }; + } else { + requestType_ = { type: "Informational" }; + } + } + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "requestUserAttention", + payload: requestType_ + } + } + } + }); + } + async setResizable(resizable) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setResizable", + payload: resizable + } + } + } + }); + } + async setTitle(title) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setTitle", + payload: title + } + } + } + }); + } + async maximize() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "maximize" + } + } + } + }); + } + async unmaximize() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "unmaximize" + } + } + } + }); + } + async toggleMaximize() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "toggleMaximize" + } + } + } + }); + } + async minimize() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "minimize" + } + } + } + }); + } + async unminimize() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "unminimize" + } + } + } + }); + } + async show() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "show" + } + } + } + }); + } + async hide() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "hide" + } + } + } + }); + } + async close() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "close" + } + } + } + }); + } + async setDecorations(decorations) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setDecorations", + payload: decorations + } + } + } + }); + } + async setAlwaysOnTop(alwaysOnTop) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setAlwaysOnTop", + payload: alwaysOnTop + } + } + } + }); + } + async setSize(size) { + if (!size || size.type !== "Logical" && size.type !== "Physical") { + throw new Error( + "the `size` argument must be either a LogicalSize or a PhysicalSize instance" + ); + } + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setSize", + payload: { + type: size.type, + data: { + width: size.width, + height: size.height + } + } + } + } + } + }); + } + async setMinSize(size) { + if (size && size.type !== "Logical" && size.type !== "Physical") { + throw new Error( + "the `size` argument must be either a LogicalSize or a PhysicalSize instance" + ); + } + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setMinSize", + payload: size ? { + type: size.type, + data: { + width: size.width, + height: size.height + } + } : null + } + } + } + }); + } + async setMaxSize(size) { + if (size && size.type !== "Logical" && size.type !== "Physical") { + throw new Error( + "the `size` argument must be either a LogicalSize or a PhysicalSize instance" + ); + } + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setMaxSize", + payload: size ? { + type: size.type, + data: { + width: size.width, + height: size.height + } + } : null + } + } + } + }); + } + async setPosition(position) { + if (!position || position.type !== "Logical" && position.type !== "Physical") { + throw new Error( + "the `position` argument must be either a LogicalPosition or a PhysicalPosition instance" + ); + } + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setPosition", + payload: { + type: position.type, + data: { + x: position.x, + y: position.y + } + } + } + } + } + }); + } + async setFullscreen(fullscreen) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setFullscreen", + payload: fullscreen + } + } + } + }); + } + async setFocus() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setFocus" + } + } + } + }); + } + async setIcon(icon) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setIcon", + payload: { + icon: typeof icon === "string" ? icon : Array.from(icon) + } + } + } + } + }); + } + async setSkipTaskbar(skip) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setSkipTaskbar", + payload: skip + } + } + } + }); + } + async setCursorGrab(grab) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setCursorGrab", + payload: grab + } + } + } + }); + } + async setCursorVisible(visible) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setCursorVisible", + payload: visible + } + } + } + }); + } + async setCursorIcon(icon) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setCursorIcon", + payload: icon + } + } + } + }); + } + async setCursorPosition(position) { + if (!position || position.type !== "Logical" && position.type !== "Physical") { + throw new Error( + "the `position` argument must be either a LogicalPosition or a PhysicalPosition instance" + ); + } + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setCursorPosition", + payload: { + type: position.type, + data: { + x: position.x, + y: position.y + } + } + } + } + } + }); + } + async setIgnoreCursorEvents(ignore) { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "setIgnoreCursorEvents", + payload: ignore + } + } + } + }); + } + async startDragging() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + label: this.label, + cmd: { + type: "startDragging" + } + } + } + }); + } + async onResized(handler) { + return this.listen("tauri://resize" /* WINDOW_RESIZED */, handler); + } + async onMoved(handler) { + return this.listen("tauri://move" /* WINDOW_MOVED */, handler); + } + async onCloseRequested(handler) { + return this.listen("tauri://close-requested" /* WINDOW_CLOSE_REQUESTED */, (event) => { + const evt = new CloseRequestedEvent(event); + void Promise.resolve(handler(evt)).then(() => { + if (!evt.isPreventDefault()) { + return this.close(); + } + }); + }); + } + async onFocusChanged(handler) { + const unlistenFocus = await this.listen( + "tauri://focus" /* WINDOW_FOCUS */, + (event) => { + handler({ ...event, payload: true }); + } + ); + const unlistenBlur = await this.listen( + "tauri://blur" /* WINDOW_BLUR */, + (event) => { + handler({ ...event, payload: false }); + } + ); + return () => { + unlistenFocus(); + unlistenBlur(); + }; + } + async onScaleChanged(handler) { + return this.listen( + "tauri://scale-change" /* WINDOW_SCALE_FACTOR_CHANGED */, + handler + ); + } + async onMenuClicked(handler) { + return this.listen("tauri://menu" /* MENU */, handler); + } + async onFileDropEvent(handler) { + const unlistenFileDrop = await this.listen( + "tauri://file-drop" /* WINDOW_FILE_DROP */, + (event) => { + handler({ ...event, payload: { type: "drop", paths: event.payload } }); + } + ); + const unlistenFileHover = await this.listen( + "tauri://file-drop-hover" /* WINDOW_FILE_DROP_HOVER */, + (event) => { + handler({ ...event, payload: { type: "hover", paths: event.payload } }); + } + ); + const unlistenCancel = await this.listen( + "tauri://file-drop-cancelled" /* WINDOW_FILE_DROP_CANCELLED */, + (event) => { + handler({ ...event, payload: { type: "cancel" } }); + } + ); + return () => { + unlistenFileDrop(); + unlistenFileHover(); + unlistenCancel(); + }; + } + async onThemeChanged(handler) { + return this.listen("tauri://theme-changed" /* WINDOW_THEME_CHANGED */, handler); + } +}; +var CloseRequestedEvent = class { + constructor(event) { + this._preventDefault = false; + this.event = event.event; + this.windowLabel = event.windowLabel; + this.id = event.id; + } + preventDefault() { + this._preventDefault = true; + } + isPreventDefault() { + return this._preventDefault; + } +}; +var WebviewWindow = class extends WindowManager { + constructor(label, options = {}) { + super(label); + if (!options?.skip) { + invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "createWebview", + data: { + options: { + label, + ...options + } + } + } + }).then(async () => this.emit("tauri://created")).catch(async (e) => this.emit("tauri://error", e)); + } + } + static getByLabel(label) { + if (getAll().some((w) => w.label === label)) { + return new WebviewWindow(label, { skip: true }); + } + return null; + } +}; +var appWindow; +if ("__TAURI_METADATA__" in window) { + appWindow = new WebviewWindow( + window.__TAURI_METADATA__.__currentWindow.label, + { + skip: true + } + ); +} else { + console.warn( + `Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label. +Note that this is not an issue if running this frontend on a browser instead of a Tauri window.` + ); + appWindow = new WebviewWindow("main", { + skip: true + }); +} +function mapMonitor(m) { + return m === null ? null : { + name: m.name, + scaleFactor: m.scaleFactor, + position: new PhysicalPosition(m.position.x, m.position.y), + size: new PhysicalSize(m.size.width, m.size.height) + }; +} +async function currentMonitor() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + cmd: { + type: "currentMonitor" + } + } + } + }).then(mapMonitor); +} +async function primaryMonitor() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + cmd: { + type: "primaryMonitor" + } + } + } + }).then(mapMonitor); +} +async function availableMonitors() { + return invokeTauriCommand({ + __tauriModule: "Window", + message: { + cmd: "manage", + data: { + cmd: { + type: "availableMonitors" + } + } + } + }).then((ms) => ms.map(mapMonitor)); +} +export { + CloseRequestedEvent, + LogicalPosition, + LogicalSize, + PhysicalPosition, + PhysicalSize, + UserAttentionType, + WebviewWindow, + WebviewWindowHandle, + WindowManager, + appWindow, + availableMonitors, + currentMonitor, + getAll, + getCurrent, + primaryMonitor +}; diff --git a/src/window.rs b/src/window.rs new file mode 100644 index 0000000..5d28453 --- /dev/null +++ b/src/window.rs @@ -0,0 +1,825 @@ +use crate::{event::Event, Error}; +use serde::{de::DeserializeOwned, Serialize}; +use std::fmt::Display; +use wasm_bindgen::{prelude::Closure, JsCast, JsValue}; + +#[derive(Debug, Clone, PartialEq)] +pub enum Theme { + Light, + Dark, +} + +#[derive(Debug, Clone, PartialEq)] +pub enum TitleBarStyle { + Visible, + Transparent, + Overlay, +} + +#[derive(Debug, Clone, PartialEq)] +pub enum UserAttentionType { + Critical = 1, + Informational, +} + +#[derive(Debug, Clone, PartialEq)] +pub enum Position { + Physical(PhysicalPosition), + Logical(LogicalPosition), +} + +#[derive(Debug, Clone, PartialEq)] +pub enum Size { + Physical(PhysicalSize), + Logical(LogicalSize), +} + +#[derive(Debug, Clone, PartialEq)] +pub enum CursorIcon { + Default, + Crosshair, + Hand, + Arrow, + Move, + Text, + Wait, + Help, + Progress, + // something cannot be done + NotAllowed, + ContextMenu, + Cell, + VerticalText, + Alias, + Copy, + NoDrop, + // something can be grabbed + Grab, + /// something is grabbed + Grabbing, + AllScroll, + ZoomIn, + ZoomOut, + // edge is to be moved + EResize, + NResize, + NeResize, + NwResize, + SResize, + SeResize, + SwResize, + WResize, + EwResize, + NsResize, + NeswResize, + NwseResize, + ColResize, + RowResize, +} + +impl Display for CursorIcon { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + CursorIcon::Default => write!(f, "default"), + CursorIcon::Crosshair => write!(f, "crosshair"), + CursorIcon::Hand => write!(f, "hand"), + CursorIcon::Arrow => write!(f, "arrow"), + CursorIcon::Move => write!(f, "move"), + CursorIcon::Text => write!(f, "text"), + CursorIcon::Wait => write!(f, "wait"), + CursorIcon::Help => write!(f, "help"), + CursorIcon::Progress => write!(f, "progress"), + CursorIcon::NotAllowed => write!(f, "notAllowed"), + CursorIcon::ContextMenu => write!(f, "contextMenu"), + CursorIcon::Cell => write!(f, "cell"), + CursorIcon::VerticalText => write!(f, "verticalText"), + CursorIcon::Alias => write!(f, "alias"), + CursorIcon::Copy => write!(f, "copy"), + CursorIcon::NoDrop => write!(f, "noDrop"), + CursorIcon::Grab => write!(f, "grab"), + CursorIcon::Grabbing => write!(f, "grabbing"), + CursorIcon::AllScroll => write!(f, "allScroll"), + CursorIcon::ZoomIn => write!(f, "zoomIn"), + CursorIcon::ZoomOut => write!(f, "zoomOut"), + CursorIcon::EResize => write!(f, "eResize"), + CursorIcon::NResize => write!(f, "nResize"), + CursorIcon::NeResize => write!(f, "neResize"), + CursorIcon::NwResize => write!(f, "nwResize"), + CursorIcon::SResize => write!(f, "sResize"), + CursorIcon::SeResize => write!(f, "seResize"), + CursorIcon::SwResize => write!(f, "swResize"), + CursorIcon::WResize => write!(f, "wResize"), + CursorIcon::EwResize => write!(f, "ewResize"), + CursorIcon::NsResize => write!(f, "nsResize"), + CursorIcon::NeswResize => write!(f, "neswResize"), + CursorIcon::NwseResize => write!(f, "nwseResize"), + CursorIcon::ColResize => write!(f, "colResize"), + CursorIcon::RowResize => write!(f, "rowResize"), + } + } +} + +#[derive(Debug, Clone, PartialEq)] +pub struct WebviewWindow(inner::WebviewWindow); + +impl WebviewWindow { + pub fn new(label: &str, options: ()) -> Self { + Self(inner::WebviewWindow::new(label, options)) + } + + pub fn get_by_label(label: &str) -> Option { + inner::WebviewWindow::getByLabel(label).map(Self) + } + + pub fn label(&self) -> String { + self.0.label() + } + + pub async fn scale_factor(&self) -> crate::Result { + let js_val = self.0.scaleFactor().await?; + + Ok(serde_wasm_bindgen::from_value(js_val)?) + } + + pub async fn inner_position(&self) -> crate::Result { + Ok(PhysicalPosition( + self.0.innerPosition().await?.unchecked_into(), + )) + } + + pub async fn outer_position(&self) -> crate::Result { + Ok(PhysicalPosition( + self.0.outerPosition().await?.unchecked_into(), + )) + } + + pub async fn inner_size(&self) -> crate::Result { + Ok(PhysicalSize(self.0.innerSize().await?.unchecked_into())) + } + + pub async fn outer_size(&self) -> crate::Result { + Ok(PhysicalSize(self.0.outerSize().await?.unchecked_into())) + } + + pub async fn is_fullscreen(&self) -> crate::Result { + let js_val = self.0.isFullscreen().await?; + + Ok(serde_wasm_bindgen::from_value(js_val)?) + } + + pub async fn is_maximized(&self) -> crate::Result { + let js_val = self.0.isMaximized().await?; + + Ok(serde_wasm_bindgen::from_value(js_val)?) + } + + pub async fn is_decorated(&self) -> crate::Result { + let js_val = self.0.isDecorated().await?; + + Ok(serde_wasm_bindgen::from_value(js_val)?) + } + + pub async fn is_resizable(&self) -> crate::Result { + let js_val = self.0.isResizable().await?; + + Ok(serde_wasm_bindgen::from_value(js_val)?) + } + + pub async fn is_visible(&self) -> crate::Result { + let js_val = self.0.isVisible().await?; + + Ok(serde_wasm_bindgen::from_value(js_val)?) + } + + pub async fn theme(&self) -> crate::Result { + let js_val = self.0.theme().await?; + + let str = serde_wasm_bindgen::from_value::(js_val)?; + + match str.as_str() { + "light" => Ok(Theme::Light), + "dark" => Ok(Theme::Dark), + _ => Err(Error::UnknownTheme(str)), + } + } + + pub async fn center(&self) -> crate::Result<()> { + Ok(self.0.center().await?) + } + + pub async fn request_user_attention( + &self, + request_type: UserAttentionType, + ) -> crate::Result<()> { + Ok(self.0.requestUserAttention(request_type as u32).await?) + } + + pub async fn set_resizable(&self, resizable: bool) -> crate::Result<()> { + Ok(self.0.setResizable(resizable).await?) + } + + pub async fn set_title(&self, title: impl AsRef) -> crate::Result<()> { + Ok(self.0.setTitle(title.as_ref()).await?) + } + + pub async fn maximize(&self) -> crate::Result<()> { + Ok(self.0.maximize().await?) + } + + pub async fn unmaximize(&self) -> crate::Result<()> { + Ok(self.0.unmaximize().await?) + } + + pub async fn toggle_maximize(&self) -> crate::Result<()> { + Ok(self.0.toggleMaximize().await?) + } + + pub async fn minimize(&self) -> crate::Result<()> { + Ok(self.0.minimize().await?) + } + + pub async fn unminimize(&self) -> crate::Result<()> { + Ok(self.0.unminimize().await?) + } + + pub async fn show(&self) -> crate::Result<()> { + Ok(self.0.show().await?) + } + + pub async fn hide(&self) -> crate::Result<()> { + Ok(self.0.hide().await?) + } + + pub async fn close(&self) -> crate::Result<()> { + Ok(self.0.close().await?) + } + + pub async fn set_decorations(&self, decorations: bool) -> crate::Result<()> { + Ok(self.0.setDecorations(decorations).await?) + } + + pub async fn set_always_on_top(&self, always_on_top: bool) -> crate::Result<()> { + Ok(self.0.setAlwaysOnTop(always_on_top).await?) + } + + pub async fn set_size(&self, size: Size) -> crate::Result<()> { + match size { + Size::Physical(size) => self.0.setSizePhysical(size.0).await?, + Size::Logical(size) => self.0.setSizeLogical(size.0).await?, + } + + Ok(()) + } + + pub async fn set_min_size(&self, size: Option) -> crate::Result<()> { + match size { + None => self.0.setMinSizePhysical(None).await?, + Some(Size::Physical(size)) => self.0.setMinSizePhysical(Some(size.0)).await?, + Some(Size::Logical(size)) => self.0.setMinSizeLogical(Some(size.0)).await?, + } + + Ok(()) + } + + pub async fn set_max_size(&self, size: Option) -> crate::Result<()> { + match size { + None => self.0.setMaxSizePhysical(None).await?, + Some(Size::Physical(size)) => self.0.setMaxSizePhysical(Some(size.0)).await?, + Some(Size::Logical(size)) => self.0.setMaxSizeLogical(Some(size.0)).await?, + } + + Ok(()) + } + + pub async fn set_position(&self, position: Position) -> crate::Result<()> { + match position { + Position::Physical(pos) => self.0.setPositionPhysical(pos.0).await?, + Position::Logical(pos) => self.0.setPositionLogical(pos.0).await?, + } + + Ok(()) + } + + pub async fn set_fullscreen(&self, fullscreen: bool) -> crate::Result<()> { + Ok(self.0.setFullscreen(fullscreen).await?) + } + + pub async fn set_focus(&self) -> crate::Result<()> { + Ok(self.0.setFocus().await?) + } + + pub async fn set_icon(&self, icon: &[u8]) -> crate::Result<()> { + Ok(self.0.setIcon(icon).await?) + } + + pub async fn set_skip_taskbar(&self, skip: bool) -> crate::Result<()> { + Ok(self.0.setSkipTaskbar(skip).await?) + } + + pub async fn set_cursor_grab(&self, grab: bool) -> crate::Result<()> { + Ok(self.0.setCursorGrab(grab).await?) + } + + pub async fn set_cursor_visible(&self, visible: bool) -> crate::Result<()> { + Ok(self.0.setCursorVisible(visible).await?) + } + + pub async fn set_cursor_icon(&self, icon: CursorIcon) -> crate::Result<()> { + Ok(self.0.setCursorIcon(&icon.to_string()).await?) + } + + pub async fn set_cursor_position(&self, position: Position) -> crate::Result<()> { + match position { + Position::Physical(pos) => self.0.setCursorPositionPhysical(pos.0).await?, + Position::Logical(pos) => self.0.setCursorPositionLogical(pos.0).await?, + } + + Ok(()) + } + + pub async fn set_ignore_cursor_events(&self, ignore: bool) -> crate::Result<()> { + Ok(self.0.setIgnoreCursorEvents(ignore).await?) + } + + pub async fn start_dragging(&self) -> crate::Result<()> { + Ok(self.0.startDragging().await?) + } + + #[inline(always)] + pub async fn emit(&self, event: &str, payload: &T) -> crate::Result<()> { + self.0 + .emit(event, serde_wasm_bindgen::to_value(payload).unwrap()) + .await?; + + Ok(()) + } + + #[inline(always)] + pub async fn listen(&self, event: &str, mut handler: H) -> crate::Result + where + T: DeserializeOwned, + H: FnMut(Event) + 'static, + { + let closure = Closure::::new(move |raw| { + (handler)(serde_wasm_bindgen::from_value(raw).unwrap()) + }); + + let unlisten = self.0.listen(event, &closure).await?; + + closure.forget(); + + let unlisten = js_sys::Function::from(unlisten); + Ok(move || { + unlisten.call0(&wasm_bindgen::JsValue::NULL).unwrap(); + }) + } + + #[inline(always)] + pub async fn once(&self, event: &str, mut handler: H) -> crate::Result + where + T: DeserializeOwned, + H: FnMut(Event) + 'static, + { + let closure = Closure::::new(move |raw| { + (handler)(serde_wasm_bindgen::from_value(raw).unwrap()) + }); + + let unlisten = self.0.once(event, &closure).await?; + + closure.forget(); + + let unlisten = js_sys::Function::from(unlisten); + Ok(move || { + unlisten.call0(&wasm_bindgen::JsValue::NULL).unwrap(); + }) + } +} + +#[derive(Debug, Clone, PartialEq)] +pub struct LogicalPosition(inner::LogicalPosition); + +impl LogicalPosition { + pub fn new(x: u32, y: u32) -> Self { + Self(inner::LogicalPosition::new(x, y)) + } + + pub fn x(&self) -> u32 { + self.0.x() + } + pub fn set_x(&self, x: u32) { + self.0.set_x(x) + } + pub fn y(&self) -> u32 { + self.0.y() + } + pub fn set_y(&self, y: u32) { + self.0.set_y(y) + } +} + +#[derive(Debug, Clone, PartialEq)] +pub struct PhysicalPosition(inner::PhysicalPosition); + +impl PhysicalPosition { + pub fn new(x: u32, y: u32) -> Self { + Self(inner::PhysicalPosition::new(x, y)) + } + + pub fn to_logical(self, scale_factor: u32) -> LogicalPosition { + LogicalPosition(self.0.toLogical(scale_factor)) + } + + pub fn x(&self) -> u32 { + self.0.x() + } + pub fn set_x(&self, x: u32) { + self.0.set_x(x) + } + pub fn y(&self) -> u32 { + self.0.y() + } + pub fn set_y(&self, y: u32) { + self.0.set_y(y) + } +} + +#[derive(Debug, Clone, PartialEq)] +pub struct LogicalSize(inner::LogicalSize); + +impl LogicalSize { + pub fn new(x: u32, y: u32) -> Self { + Self(inner::LogicalSize::new(x, y)) + } + + pub fn width(&self) -> u32 { + self.0.width() + } + pub fn set_width(&self, x: u32) { + self.0.set_width(x) + } + pub fn height(&self) -> u32 { + self.0.height() + } + pub fn set_height(&self, y: u32) { + self.0.set_height(y) + } +} + +#[derive(Debug, Clone, PartialEq)] +pub struct PhysicalSize(inner::PhysicalSize); + +impl PhysicalSize { + pub fn new(x: u32, y: u32) -> Self { + Self(inner::PhysicalSize::new(x, y)) + } + + pub fn to_logical(self, scale_factor: u32) -> LogicalSize { + LogicalSize(self.0.toLogical(scale_factor)) + } + + pub fn width(&self) -> u32 { + self.0.width() + } + pub fn set_width(&self, x: u32) { + self.0.set_width(x) + } + pub fn height(&self) -> u32 { + self.0.height() + } + pub fn set_height(&self, y: u32) { + self.0.set_height(y) + } +} + +#[derive(Debug, Clone, PartialEq)] +pub struct Monitor(JsValue); + +impl Monitor { + pub fn name(&self) -> Option { + let raw = js_sys::Reflect::get(&self.0, &JsValue::from_str("name")).unwrap(); + + raw.as_string() + } + + pub fn size(&self) -> PhysicalSize { + let raw = js_sys::Reflect::get(&self.0, &JsValue::from_str("size")).unwrap(); + + PhysicalSize(raw.unchecked_into()) + } + + pub fn position(&self) -> PhysicalPosition { + let raw = js_sys::Reflect::get(&self.0, &JsValue::from_str("position")).unwrap(); + + PhysicalPosition(raw.unchecked_into()) + } + + pub fn scale_factor(&self) -> u32 { + let raw = js_sys::Reflect::get(&self.0, &JsValue::from_str("size")) + .unwrap() + .as_f64() + .unwrap(); + + raw as u32 + } +} + +pub fn current_window() -> WebviewWindow { + WebviewWindow(inner::getCurrent()) +} + +pub fn all_windows() -> Vec { + inner::getAll().into_iter().map(WebviewWindow).collect() +} + +pub async fn current_monitor() -> Monitor { + Monitor(inner::currentMonitor().await) +} +pub async fn primary_monitor() -> Monitor { + Monitor(inner::primaryMonitor().await) +} + +#[derive(Debug, Clone)] +pub struct AvailableMonitors { + idx: u32, + array: js_sys::Array, +} + +impl Iterator for AvailableMonitors { + type Item = Monitor; + + fn next(&mut self) -> Option { + let raw = self.array.get(self.idx); + + if raw.is_undefined() { + None + } else { + let monitor = Monitor(raw); + self.idx += 1; + + Some(monitor) + } + } +} + +pub async fn available_monitors() -> AvailableMonitors { + AvailableMonitors { + idx: 0, + array: inner::availableMonitors().await.unchecked_into(), + } +} + +mod inner { + use wasm_bindgen::{ + prelude::{wasm_bindgen, Closure}, + JsValue, + }; + + #[wasm_bindgen(module = "/src/window.js")] + extern "C" { + #[derive(Debug, Clone, PartialEq)] + pub type LogicalPosition; + #[wasm_bindgen(constructor)] + pub fn new(x: u32, y: u32) -> LogicalPosition; + #[wasm_bindgen(method, getter)] + pub fn x(this: &LogicalPosition) -> u32; + #[wasm_bindgen(method, setter)] + pub fn set_x(this: &LogicalPosition, x: u32); + #[wasm_bindgen(method, getter)] + pub fn y(this: &LogicalPosition) -> u32; + #[wasm_bindgen(method, setter)] + pub fn set_y(this: &LogicalPosition, y: u32); + } + + #[wasm_bindgen(module = "/src/window.js")] + extern "C" { + #[derive(Debug, Clone, PartialEq)] + pub type PhysicalPosition; + #[wasm_bindgen(constructor)] + pub fn new(x: u32, y: u32) -> PhysicalPosition; + #[wasm_bindgen(method)] + pub fn toLogical(this: &PhysicalPosition, scaleFactor: u32) -> LogicalPosition; + #[wasm_bindgen(method, getter)] + pub fn x(this: &PhysicalPosition) -> u32; + #[wasm_bindgen(method, setter)] + pub fn set_x(this: &PhysicalPosition, x: u32); + #[wasm_bindgen(method, getter)] + pub fn y(this: &PhysicalPosition) -> u32; + #[wasm_bindgen(method, setter)] + pub fn set_y(this: &PhysicalPosition, y: u32); + } + + #[wasm_bindgen(module = "/src/window.js")] + extern "C" { + #[derive(Debug, Clone, PartialEq)] + pub type LogicalSize; + #[wasm_bindgen(constructor)] + pub fn new(width: u32, height: u32) -> LogicalSize; + #[wasm_bindgen(method, getter)] + pub fn width(this: &LogicalSize) -> u32; + #[wasm_bindgen(method, setter)] + pub fn set_width(this: &LogicalSize, width: u32); + #[wasm_bindgen(method, getter)] + pub fn height(this: &LogicalSize) -> u32; + #[wasm_bindgen(method, setter)] + pub fn set_height(this: &LogicalSize, height: u32); + } + + #[wasm_bindgen(module = "/src/window.js")] + extern "C" { + #[derive(Debug, Clone, PartialEq)] + pub type PhysicalSize; + #[wasm_bindgen(constructor)] + pub fn new(width: u32, height: u32) -> PhysicalSize; + #[wasm_bindgen(method)] + pub fn toLogical(this: &PhysicalSize, scaleFactor: u32) -> LogicalSize; + #[wasm_bindgen(method, getter)] + pub fn width(this: &PhysicalSize) -> u32; + #[wasm_bindgen(method, setter)] + pub fn set_width(this: &PhysicalSize, width: u32); + #[wasm_bindgen(method, getter)] + pub fn height(this: &PhysicalSize) -> u32; + #[wasm_bindgen(method, setter)] + pub fn set_height(this: &PhysicalSize, height: u32); + } + + #[wasm_bindgen(module = "/src/window.js")] + extern "C" { + #[derive(Debug, Clone, PartialEq)] + pub type WebviewWindowHandle; + #[wasm_bindgen(constructor)] + pub fn new(label: &str) -> WebviewWindowHandle; + #[wasm_bindgen(method, catch)] + pub async fn listen( + this: &WebviewWindowHandle, + event: &str, + handler: &Closure, + ) -> Result; + #[wasm_bindgen(method, catch)] + pub async fn once( + this: &WebviewWindowHandle, + event: &str, + handler: &Closure, + ) -> Result; + #[wasm_bindgen(method, catch)] + pub async fn emit( + this: &WebviewWindowHandle, + event: &str, + payload: JsValue, + ) -> Result<(), JsValue>; + } + + #[wasm_bindgen(module = "/src/window.js")] + extern "C" { + #[wasm_bindgen(extends = WebviewWindowHandle)] + #[derive(Debug, Clone, PartialEq)] + pub type WindowManager; + #[wasm_bindgen(constructor)] + pub fn new(label: &str) -> WindowManager; + #[wasm_bindgen(method, getter)] + pub fn label(this: &WindowManager) -> String; + #[wasm_bindgen(method, catch)] + pub async fn scaleFactor(this: &WindowManager) -> Result; + #[wasm_bindgen(method, catch)] + pub async fn innerPosition(this: &WindowManager) -> Result; + #[wasm_bindgen(method, catch)] + pub async fn outerPosition(this: &WindowManager) -> Result; + #[wasm_bindgen(method, catch)] + pub async fn innerSize(this: &WindowManager) -> Result; + #[wasm_bindgen(method, catch)] + pub async fn outerSize(this: &WindowManager) -> Result; + #[wasm_bindgen(method, catch)] + pub async fn isFullscreen(this: &WindowManager) -> Result; + #[wasm_bindgen(method, catch)] + pub async fn isMaximized(this: &WindowManager) -> Result; + #[wasm_bindgen(method, catch)] + pub async fn isDecorated(this: &WindowManager) -> Result; + #[wasm_bindgen(method, catch)] + pub async fn isResizable(this: &WindowManager) -> Result; + #[wasm_bindgen(method, catch)] + pub async fn isVisible(this: &WindowManager) -> Result; + #[wasm_bindgen(method, catch)] + pub async fn theme(this: &WindowManager) -> Result; + #[wasm_bindgen(method, catch)] + pub async fn center(this: &WindowManager) -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn requestUserAttention( + this: &WindowManager, + requestType: u32, + ) -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn setResizable(this: &WindowManager, resizable: bool) -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn setTitle(this: &WindowManager, title: &str) -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn maximize(this: &WindowManager) -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn unmaximize(this: &WindowManager) -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn toggleMaximize(this: &WindowManager) -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn minimize(this: &WindowManager) -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn unminimize(this: &WindowManager) -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn show(this: &WindowManager) -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn hide(this: &WindowManager) -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn close(this: &WindowManager) -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn setDecorations(this: &WindowManager, decorations: bool) + -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn setAlwaysOnTop(this: &WindowManager, alwaysOnTop: bool) + -> Result<(), JsValue>; + #[wasm_bindgen(method, js_name = setSize, catch)] + pub async fn setSizePhysical( + this: &WindowManager, + size: PhysicalSize, + ) -> Result<(), JsValue>; + #[wasm_bindgen(method, js_name = setSize, catch)] + pub async fn setSizeLogical(this: &WindowManager, size: LogicalSize) + -> Result<(), JsValue>; + #[wasm_bindgen(method, js_name = setMinSize, catch)] + pub async fn setMinSizePhysical( + this: &WindowManager, + size: Option, + ) -> Result<(), JsValue>; + #[wasm_bindgen(method, js_name = setMinSize, catch)] + pub async fn setMinSizeLogical( + this: &WindowManager, + size: Option, + ) -> Result<(), JsValue>; + #[wasm_bindgen(method, js_name = setMaxSize, catch)] + pub async fn setMaxSizePhysical( + this: &WindowManager, + size: Option, + ) -> Result<(), JsValue>; + #[wasm_bindgen(method, js_name = setMinSize, catch)] + pub async fn setMaxSizeLogical( + this: &WindowManager, + size: Option, + ) -> Result<(), JsValue>; + #[wasm_bindgen(method, js_name = setPosition, catch)] + pub async fn setPositionPhysical( + this: &WindowManager, + position: PhysicalPosition, + ) -> Result<(), JsValue>; + #[wasm_bindgen(method, js_name = setPosition, catch)] + pub async fn setPositionLogical( + this: &WindowManager, + position: LogicalPosition, + ) -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn setFullscreen(this: &WindowManager, fullscreen: bool) -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn setFocus(this: &WindowManager) -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn setIcon(this: &WindowManager, icon: &[u8]) -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn setSkipTaskbar(this: &WindowManager, skip: bool) -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn setCursorGrab(this: &WindowManager, grab: bool) -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn setCursorVisible(this: &WindowManager, visible: bool) -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn setCursorIcon(this: &WindowManager, icon: &str) -> Result<(), JsValue>; + #[wasm_bindgen(method, js_name = setCursorPosition, catch)] + pub async fn setCursorPositionPhysical( + this: &WindowManager, + position: PhysicalPosition, + ) -> Result<(), JsValue>; + #[wasm_bindgen(method, js_name = setCursorPosition, catch)] + pub async fn setCursorPositionLogical( + this: &WindowManager, + position: LogicalPosition, + ) -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn setIgnoreCursorEvents( + this: &WindowManager, + ignore: bool, + ) -> Result<(), JsValue>; + #[wasm_bindgen(method, catch)] + pub async fn startDragging(this: &WindowManager) -> Result<(), JsValue>; + } + + #[wasm_bindgen(module = "/src/window.js")] + extern "C" { + #[wasm_bindgen(extends = WindowManager)] + #[derive(Debug, Clone, PartialEq)] + pub type WebviewWindow; + #[wasm_bindgen(constructor)] + pub fn new(label: &str, options: ()) -> WebviewWindow; + #[wasm_bindgen(static_method_of = WebviewWindow)] + pub fn getByLabel(label: &str) -> Option; + } + + #[wasm_bindgen(module = "/src/window.js")] + extern "C" { + pub fn getCurrent() -> WebviewWindow; + pub fn getAll() -> Vec; + pub async fn currentMonitor() -> JsValue; + pub async fn primaryMonitor() -> JsValue; + pub async fn availableMonitors() -> JsValue; + } +} diff --git a/tauri b/tauri index 35264b4..2e1bd04 160000 --- a/tauri +++ b/tauri @@ -1 +1 @@ -Subproject commit 35264b4c1801b381e0b867c1c35540f0fbb43365 +Subproject commit 2e1bd04775c0f05f1c0b67605e6abec4465dbf84