diff --git a/package-lock.json b/package-lock.json index 4665c2b..b3aec9f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,18 +9,19 @@ "version": "0.1.0", "dependencies": { "@tauri-apps/api": "^2.5.0", + "@tauri-apps/plugin-clipboard-manager": "^2.2.2", "@tauri-apps/plugin-fs": "^2.2.1", "@tauri-apps/plugin-http": "^2.4.3", - "@tauri-apps/plugin-log": "^2.3.1", + "@tauri-apps/plugin-log": "^2.4.0", "@tauri-apps/plugin-opener": "^2.2.6", "@tauri-apps/plugin-os": "^2.2.1", "@tauri-apps/plugin-shell": "^2.2.1", "@tauri-apps/plugin-store": "^2.2.0", - "@tauri-apps/plugin-updater": "^2.7.0", + "@tauri-apps/plugin-updater": "^2.7.1", "@tauri-apps/plugin-upload": "^2.2.1", "react": "^18.3.1", "react-dom": "^18.3.1", - "react-router": "^7.5.1", + "react-router": "^7.5.2", "zustand": "^5.0.3" }, "devDependencies": { @@ -28,11 +29,11 @@ "@tauri-apps/cli": "^2.5.0", "@types/react": "^18.3.1", "@types/react-dom": "^18.3.1", - "@vitejs/plugin-react": "^4.4.0", - "daisyui": "^5.0.25", + "@vitejs/plugin-react": "^4.4.1", + "daisyui": "^5.0.28", "tailwindcss": "^4.1.4", "typescript": "^5.8.3", - "vite": "^6.3.1" + "vite": "^6.3.3" } }, "node_modules/@ampproject/remapping": { @@ -1532,6 +1533,15 @@ "node": ">= 10" } }, + "node_modules/@tauri-apps/plugin-clipboard-manager": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-clipboard-manager/-/plugin-clipboard-manager-2.2.2.tgz", + "integrity": "sha512-bZvDLMqfcNmsw7Ag8I49jlaCjdpDvvlJHnpp6P+Gg/3xtpSERdwlDxm7cKGbs2mj46dsw4AuG3RoAgcpwgioUA==", + "license": "MIT OR Apache-2.0", + "dependencies": { + "@tauri-apps/api": "^2.0.0" + } + }, "node_modules/@tauri-apps/plugin-fs": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-fs/-/plugin-fs-2.2.1.tgz", @@ -1551,9 +1561,10 @@ } }, "node_modules/@tauri-apps/plugin-log": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-log/-/plugin-log-2.3.1.tgz", - "integrity": "sha512-nnKGHENWt7teqvUlIKxd6bp2wCUrrLvCvajN6CWbyrHBNKPi/pyKELzD511siEMDEdndbiZ/GEhiK0xBtZopRg==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-log/-/plugin-log-2.4.0.tgz", + "integrity": "sha512-j7yrDtLNmayCBOO2esl3aZv9jSXy2an8MDLry3Ys9ZXerwUg35n1Y2uD8HoCR+8Ng/EUgx215+qOUfJasjYrHw==", + "license": "MIT OR Apache-2.0", "dependencies": { "@tauri-apps/api": "^2.0.0" } @@ -1592,9 +1603,9 @@ } }, "node_modules/@tauri-apps/plugin-updater": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-updater/-/plugin-updater-2.7.0.tgz", - "integrity": "sha512-oBug5UCH2wOsoYk0LW5LEMAT51mszjg11s8eungRH26x/qOrEjLvnuJJoxVVr9nsWowJ6vnpXKS+lUMfFTlvHQ==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-updater/-/plugin-updater-2.7.1.tgz", + "integrity": "sha512-1OPqEY/z7NDVSeTEMIhD2ss/vXWdpfZ5Th2Mk0KtPR/RA6FKuOTDGZQhxoyYBk0pcZJ+nNZUbl/IujDCLBApjA==", "license": "MIT OR Apache-2.0", "dependencies": { "@tauri-apps/api": "^2.0.0" @@ -1682,9 +1693,9 @@ } }, "node_modules/@vitejs/plugin-react": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.4.0.tgz", - "integrity": "sha512-x/EztcTKVj+TDeANY1WjNeYsvZjZdfWRMP/KXi5Yn8BoTzpa13ZltaQqKfvWYbX8CE10GOHHdC5v86jY9x8i/g==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.4.1.tgz", + "integrity": "sha512-IpEm5ZmeXAP/osiBXVVP5KjFMzbWOonMs0NaQQl+xYnUAcq4oHUBsF2+p4MgKWG4YMmFYJU8A6sxRPuowllm6w==", "dev": true, "license": "MIT", "dependencies": { @@ -1774,9 +1785,9 @@ "devOptional": true }, "node_modules/daisyui": { - "version": "5.0.25", - "resolved": "https://registry.npmjs.org/daisyui/-/daisyui-5.0.25.tgz", - "integrity": "sha512-ETVQGxhwR8CIzPvJKKIKbQcOni9o2Dh9ODvy2aqNePo11lKRXkT7ugWldjNbqSTTr/jtHnQKMPau0AraRXSRKw==", + "version": "5.0.28", + "resolved": "https://registry.npmjs.org/daisyui/-/daisyui-5.0.28.tgz", + "integrity": "sha512-H082p8Lg3c7Se9wTbjfSOOhfUbp3BnOM2+cdr3OeY5G1Ll7GYLXB9NWLHgitkTsB1pQKwHRYYchqN2YG0VVShg==", "dev": true, "license": "MIT", "funding": { @@ -1879,9 +1890,9 @@ } }, "node_modules/fdir": { - "version": "6.4.3", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", - "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", + "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", "dev": true, "license": "MIT", "peerDependencies": { @@ -2330,9 +2341,9 @@ } }, "node_modules/react-router": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.5.1.tgz", - "integrity": "sha512-/jjU3fcYNd2bwz9Q0xt5TwyiyoO8XjSEFXJY4O/lMAlkGTHWuHRAbR9Etik+lSDqMC7A7mz3UlXzgYT6Vl58sA==", + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.5.2.tgz", + "integrity": "sha512-9Rw8r199klMnlGZ8VAsV/I8WrIF6IyJ90JQUdboupx1cdkgYqwnrYjH+I/nY/7cA1X5zia4mDJqH36npP7sxGQ==", "license": "MIT", "dependencies": { "cookie": "^1.0.1", @@ -2441,13 +2452,13 @@ } }, "node_modules/tinyglobby": { - "version": "0.2.12", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz", - "integrity": "sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==", + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.13.tgz", + "integrity": "sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==", "dev": true, "license": "MIT", "dependencies": { - "fdir": "^6.4.3", + "fdir": "^6.4.4", "picomatch": "^4.0.2" }, "engines": { @@ -2507,18 +2518,18 @@ } }, "node_modules/vite": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.1.tgz", - "integrity": "sha512-kkzzkqtMESYklo96HKKPE5KKLkC1amlsqt+RjFMlX2AvbRB/0wghap19NdBxxwGZ+h/C6DLCrcEphPIItlGrRQ==", + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.3.tgz", + "integrity": "sha512-5nXH+QsELbFKhsEfWLkHrvgRpTdGJzqOZ+utSdmPTvwHmvU6ITTm3xx+mRusihkcI8GeC7lCDyn3kDtiki9scw==", "dev": true, "license": "MIT", "dependencies": { "esbuild": "^0.25.0", - "fdir": "^6.4.3", + "fdir": "^6.4.4", "picomatch": "^4.0.2", "postcss": "^8.5.3", "rollup": "^4.34.9", - "tinyglobby": "^0.2.12" + "tinyglobby": "^0.2.13" }, "bin": { "vite": "bin/vite.js" diff --git a/package.json b/package.json index dab96df..fcff5f7 100644 --- a/package.json +++ b/package.json @@ -11,18 +11,19 @@ }, "dependencies": { "@tauri-apps/api": "^2.5.0", + "@tauri-apps/plugin-clipboard-manager": "^2.2.2", "@tauri-apps/plugin-fs": "^2.2.1", "@tauri-apps/plugin-http": "^2.4.3", - "@tauri-apps/plugin-log": "^2.3.1", + "@tauri-apps/plugin-log": "^2.4.0", "@tauri-apps/plugin-opener": "^2.2.6", "@tauri-apps/plugin-os": "^2.2.1", "@tauri-apps/plugin-shell": "^2.2.1", "@tauri-apps/plugin-store": "^2.2.0", - "@tauri-apps/plugin-updater": "^2.7.0", + "@tauri-apps/plugin-updater": "^2.7.1", "@tauri-apps/plugin-upload": "^2.2.1", "react": "^18.3.1", "react-dom": "^18.3.1", - "react-router": "^7.5.1", + "react-router": "^7.5.2", "zustand": "^5.0.3" }, "devDependencies": { @@ -30,10 +31,10 @@ "@tauri-apps/cli": "^2.5.0", "@types/react": "^18.3.1", "@types/react-dom": "^18.3.1", - "@vitejs/plugin-react": "^4.4.0", - "daisyui": "^5.0.25", + "@vitejs/plugin-react": "^4.4.1", + "daisyui": "^5.0.28", "tailwindcss": "^4.1.4", "typescript": "^5.8.3", - "vite": "^6.3.1" + "vite": "^6.3.3" } } diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 5b07eb2..e68b33a 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -23,7 +23,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", "once_cell", "version_check", ] @@ -99,6 +99,27 @@ dependencies = [ "derive_arbitrary", ] +[[package]] +name = "arboard" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1df21f715862ede32a0c525ce2ca4d52626bb0007f8c18b87a384503ac33e70" +dependencies = [ + "clipboard-win", + "image", + "log", + "objc2 0.6.1", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation 0.3.1", + "parking_lot", + "percent-encoding", + "windows-sys 0.59.0", + "wl-clipboard-rs", + "x11rb", +] + [[package]] name = "arrayvec" version = "0.7.6" @@ -357,11 +378,11 @@ dependencies = [ [[package]] name = "block2" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d59b4c170e16f0405a2e95aff44432a0d41aa97675f3d52623effe95792a037" +checksum = "340d2f0bdb2a43c1d3cd40513185b2bd7def0aa1052f956455114bc98f82dcf2" dependencies = [ - "objc2 0.6.0", + "objc2 0.6.1", ] [[package]] @@ -413,9 +434,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "4.0.2" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74fa05ad7d803d413eb8380983b092cbbaf9a85f151b871360e7b00cd7060b37" +checksum = "a334ef7c9e23abf0ce748e8cd309037da93e606ad52eb372e4ce327a0dcfbdfd" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -472,6 +493,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + [[package]] name = "bytes" version = "1.10.1" @@ -609,6 +636,15 @@ dependencies = [ "windows-link", ] +[[package]] +name = "clipboard-win" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15efe7a882b08f34e38556b14f2fb3daa98769d06c7f0c1b076dfd0d983bc892" +dependencies = [ + "error-code", +] + [[package]] name = "combine" version = "4.6.7" @@ -857,9 +893,9 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.19" +version = "0.99.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3da29a38df43d6f156149c9b43ded5e018ddff2a855cf2cfd62e8cd7d079c69f" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" dependencies = [ "convert_case", "proc-macro2", @@ -905,6 +941,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" +[[package]] +name = "dispatch2" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec" +dependencies = [ + "bitflags 2.9.0", + "objc2 0.6.1", +] + [[package]] name = "displaydoc" version = "0.2.5" @@ -948,6 +994,12 @@ dependencies = [ "litrs", ] +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + [[package]] name = "dpi" version = "0.1.1" @@ -1076,6 +1128,12 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "error-code" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d9305ccc6942a704f4335694ecd3de2ea531b114ac2d51f5f843750787a92f" + [[package]] name = "event-listener" version = "5.4.0" @@ -1143,6 +1201,12 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "flate2" version = "1.1.1" @@ -1431,6 +1495,16 @@ dependencies = [ "version_check", ] +[[package]] +name = "gethostname" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" +dependencies = [ + "libc", + "windows-targets 0.48.5", +] + [[package]] name = "gethostname" version = "1.0.1" @@ -1454,9 +1528,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "js-sys", @@ -1982,6 +2056,19 @@ dependencies = [ "icu_properties", ] +[[package]] +name = "image" +version = "0.25.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db35664ce6b9810857a38a906215e75a9c879f0696556a39f59c62829710251a" +dependencies = [ + "bytemuck", + "byteorder-lite", + "num-traits", + "png", + "tiff", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -2095,6 +2182,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" +[[package]] +name = "jpeg-decoder" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" + [[package]] name = "js-sys" version = "0.3.77" @@ -2298,6 +2391,12 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "minisign-verify" version = "0.2.3" @@ -2335,10 +2434,10 @@ dependencies = [ "dpi", "gtk", "keyboard-types", - "objc2 0.6.0", + "objc2 0.6.1", "objc2-app-kit", "objc2-core-foundation", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.1", "once_cell", "png", "serde", @@ -2401,6 +2500,16 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "num-conv" version = "0.1.0" @@ -2464,9 +2573,9 @@ dependencies = [ [[package]] name = "objc2" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3531f65190d9cff863b77a99857e74c314dd16bf56c538c4b57c7cbc3f3a6e59" +checksum = "88c6597e14493ab2e44ce58f2fdecf095a51f12ca57bec060a11c57332520551" dependencies = [ "objc2-encode", "objc2-exception-helper", @@ -2474,75 +2583,77 @@ dependencies = [ [[package]] name = "objc2-app-kit" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5906f93257178e2f7ae069efb89fbd6ee94f0592740b5f8a1512ca498814d0fb" +checksum = "e6f29f568bec459b0ddff777cec4fe3fd8666d82d5a40ebd0ff7e66134f89bcc" dependencies = [ "bitflags 2.9.0", - "block2 0.6.0", + "block2 0.6.1", "libc", - "objc2 0.6.0", + "objc2 0.6.1", "objc2-cloud-kit", "objc2-core-data", "objc2-core-foundation", "objc2-core-graphics", "objc2-core-image", - "objc2-foundation 0.3.0", - "objc2-quartz-core 0.3.0", + "objc2-foundation 0.3.1", + "objc2-quartz-core 0.3.1", ] [[package]] name = "objc2-cloud-kit" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c1948a9be5f469deadbd6bcb86ad7ff9e47b4f632380139722f7d9840c0d42c" +checksum = "17614fdcd9b411e6ff1117dfb1d0150f908ba83a7df81b1f118005fe0a8ea15d" dependencies = [ "bitflags 2.9.0", - "objc2 0.6.0", - "objc2-foundation 0.3.0", + "objc2 0.6.1", + "objc2-foundation 0.3.1", ] [[package]] name = "objc2-core-data" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f860f8e841f6d32f754836f51e6bc7777cd7e7053cf18528233f6811d3eceb4" +checksum = "291fbbf7d29287518e8686417cf7239c74700fd4b607623140a7d4a3c834329d" dependencies = [ "bitflags 2.9.0", - "objc2 0.6.0", - "objc2-foundation 0.3.0", + "objc2 0.6.1", + "objc2-foundation 0.3.1", ] [[package]] name = "objc2-core-foundation" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daeaf60f25471d26948a1c2f840e3f7d86f4109e3af4e8e4b5cd70c39690d925" +checksum = "1c10c2894a6fed806ade6027bcd50662746363a9589d3ec9d9bef30a4e4bc166" dependencies = [ "bitflags 2.9.0", - "objc2 0.6.0", + "dispatch2", + "objc2 0.6.1", ] [[package]] name = "objc2-core-graphics" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dca602628b65356b6513290a21a6405b4d4027b8b250f0b98dddbb28b7de02" +checksum = "989c6c68c13021b5c2d6b71456ebb0f9dc78d752e86a98da7c716f4f9470f5a4" dependencies = [ "bitflags 2.9.0", - "objc2 0.6.0", + "dispatch2", + "objc2 0.6.1", "objc2-core-foundation", "objc2-io-surface", ] [[package]] name = "objc2-core-image" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ffa6bea72bf42c78b0b34e89c0bafac877d5f80bf91e159a5d96ea7f693ca56" +checksum = "79b3dc0cc4386b6ccf21c157591b34a7f44c8e75b064f85502901ab2188c007e" dependencies = [ - "objc2 0.6.0", - "objc2-foundation 0.3.0", + "objc2 0.6.1", + "objc2-foundation 0.3.1", ] [[package]] @@ -2574,25 +2685,25 @@ dependencies = [ [[package]] name = "objc2-foundation" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a21c6c9014b82c39515db5b396f91645182611c97d24637cf56ac01e5f8d998" +checksum = "900831247d2fe1a09a683278e5384cfb8c80c79fe6b166f9d14bfdde0ea1b03c" dependencies = [ "bitflags 2.9.0", - "block2 0.6.0", + "block2 0.6.1", "libc", - "objc2 0.6.0", + "objc2 0.6.1", "objc2-core-foundation", ] [[package]] name = "objc2-io-surface" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "161a8b87e32610086e1a7a9e9ec39f84459db7b3a0881c1f16ca5a2605581c19" +checksum = "7282e9ac92529fa3457ce90ebb15f4ecbc383e8338060960760fa2cf75420c3c" dependencies = [ "bitflags 2.9.0", - "objc2 0.6.0", + "objc2 0.6.1", "objc2-core-foundation", ] @@ -2610,14 +2721,14 @@ dependencies = [ [[package]] name = "objc2-osa-kit" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ac59da3ceebc4a82179b35dc550431ad9458f9cc326e053f49ba371ce76c5a" +checksum = "26bb88504b5a050dbba515d2414607bf5e57dd56b107bc5f0351197a3e7bdc5d" dependencies = [ "bitflags 2.9.0", - "objc2 0.6.0", + "objc2 0.6.1", "objc2-app-kit", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.1", ] [[package]] @@ -2635,39 +2746,39 @@ dependencies = [ [[package]] name = "objc2-quartz-core" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb3794501bb1bee12f08dcad8c61f2a5875791ad1c6f47faa71a0f033f20071" +checksum = "90ffb6a0cd5f182dc964334388560b12a57f7b74b3e2dec5e2722aa2dfb2ccd5" dependencies = [ "bitflags 2.9.0", - "objc2 0.6.0", - "objc2-foundation 0.3.0", + "objc2 0.6.1", + "objc2-foundation 0.3.1", ] [[package]] name = "objc2-ui-kit" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777a571be14a42a3990d4ebedaeb8b54cd17377ec21b92e8200ac03797b3bee1" +checksum = "25b1312ad7bc8a0e92adae17aa10f90aae1fb618832f9b993b022b591027daed" dependencies = [ "bitflags 2.9.0", - "objc2 0.6.0", + "objc2 0.6.1", "objc2-core-foundation", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.1", ] [[package]] name = "objc2-web-kit" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b717127e4014b0f9f3e8bba3d3f2acec81f1bde01f656823036e823ed2c94dce" +checksum = "91672909de8b1ce1c2252e95bbee8c1649c9ad9d14b9248b3d7b4c47903c47ad" dependencies = [ "bitflags 2.9.0", - "block2 0.6.0", - "objc2 0.6.0", + "block2 0.6.1", + "objc2 0.6.1", "objc2-app-kit", "objc2-core-foundation", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.1", ] [[package]] @@ -2740,8 +2851,8 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "732c71caeaa72c065bb69d7ea08717bd3f4863a4f451402fc9513e29dbd5261b" dependencies = [ - "objc2 0.6.0", - "objc2-foundation 0.3.0", + "objc2 0.6.1", + "objc2-foundation 0.3.1", "objc2-osa-kit", "serde", "serde_json", @@ -2814,6 +2925,16 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap 2.9.0", +] + [[package]] name = "phf" version = "0.8.0" @@ -2985,7 +3106,7 @@ checksum = "eac26e981c03a6e53e0aee43c113e3202f5581d5360dae7bd2c70e800dd0451d" dependencies = [ "base64 0.22.1", "indexmap 2.9.0", - "quick-xml", + "quick-xml 0.32.0", "serde", "time", ] @@ -3151,6 +3272,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "quick-xml" +version = "0.37.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4ce8c88de324ff838700f36fb6ab86c96df0e3c4ab6ef3a9b2044465cce1369" +dependencies = [ + "memchr", +] + [[package]] name = "quinn" version = "0.11.7" @@ -3173,9 +3303,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.10" +version = "0.11.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b820744eb4dc9b57a3398183639c511b5a26d2ed702cedd3febaa1393caa22cc" +checksum = "bcbafbbdbb0f638fe3f35f3c56739f77a8a1d070cb25603226c83339b391472b" dependencies = [ "bytes", "getrandom 0.3.2", @@ -3306,7 +3436,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", ] [[package]] @@ -3368,7 +3498,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", "libredox", "thiserror 2.0.12", ] @@ -3469,7 +3599,7 @@ checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.15", + "getrandom 0.2.16", "libc", "untrusted", "windows-sys 0.52.0", @@ -3876,9 +4006,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.2" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" dependencies = [ "libc", ] @@ -4148,9 +4278,9 @@ dependencies = [ "ndk", "ndk-context", "ndk-sys", - "objc2 0.6.0", + "objc2 0.6.1", "objc2-app-kit", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.1", "once_cell", "parking_lot", "raw-window-handle", @@ -4200,9 +4330,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be03adf68fba02f87c4653da7bd73f40b0ecf9c6b7c2c39830f6981d0651912f" +checksum = "e7b0bc1aec81bda6bc455ea98fcaed26b3c98c1648c627ad6ff1c704e8bf8cbc" dependencies = [ "anyhow", "bytes", @@ -4210,7 +4340,7 @@ dependencies = [ "dunce", "embed_plist", "futures-util", - "getrandom 0.2.15", + "getrandom 0.2.16", "glob", "gtk", "heck 0.5.0", @@ -4220,9 +4350,9 @@ dependencies = [ "log", "mime", "muda", - "objc2 0.6.0", + "objc2 0.6.1", "objc2-app-kit", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.1", "objc2-ui-kit", "percent-encoding", "plist", @@ -4329,6 +4459,21 @@ dependencies = [ "walkdir", ] +[[package]] +name = "tauri-plugin-clipboard-manager" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab4cb42fdf745229b768802e9180920a4be63122cf87ed1c879103f7609d98e" +dependencies = [ + "arboard", + "log", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "thiserror 2.0.12", +] + [[package]] name = "tauri-plugin-fs" version = "2.2.1" @@ -4378,16 +4523,16 @@ dependencies = [ [[package]] name = "tauri-plugin-log" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2341d5b9bc5318c8e34f35a569140c78337241aa9c14091550b424c49f0314e0" +checksum = "8d2b582d860eb214f28323f4ce4f2797ae3b78f197e27b11677f976f9f52aedb" dependencies = [ "android_logger", "byte-unit", "fern", "log", - "objc2 0.6.0", - "objc2-foundation 0.3.0", + "objc2 0.6.1", + "objc2-foundation 0.3.1", "serde", "serde_json", "serde_repr", @@ -4407,7 +4552,7 @@ dependencies = [ "dunce", "glob", "objc2-app-kit", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.1", "open", "schemars", "serde", @@ -4426,7 +4571,7 @@ version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "424f19432397850c2ddd42aa58078630c15287bbce3866eb1d90e7dbee680637" dependencies = [ - "gethostname", + "gethostname 1.0.1", "log", "os_info", "serde", @@ -4492,9 +4637,9 @@ dependencies = [ [[package]] name = "tauri-plugin-updater" -version = "2.7.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82da763248e635d60ee4aed56c862290e523acc838d83097171f9a544708387" +checksum = "73f05c38afd77a4b8fd98e8fb6f1cdbb5fbb8a46ba181eb2758b05321e3c6209" dependencies = [ "base64 0.22.1", "dirs", @@ -4552,7 +4697,7 @@ dependencies = [ "gtk", "http", "jni", - "objc2 0.6.0", + "objc2 0.6.1", "objc2-ui-kit", "raw-window-handle", "serde", @@ -4573,9 +4718,9 @@ dependencies = [ "http", "jni", "log", - "objc2 0.6.0", + "objc2 0.6.1", "objc2-app-kit", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.1", "once_cell", "percent-encoding", "raw-window-handle", @@ -4708,6 +4853,17 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "tiff" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e" +dependencies = [ + "flate2", + "jpeg-decoder", + "weezl", +] + [[package]] name = "time" version = "0.3.41" @@ -4805,9 +4961,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.14" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b9590b93e6fcc1739458317cccd391ad3955e2bde8913edf6f95f9e65a8f034" +checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" dependencies = [ "bytes", "futures-core", @@ -4869,7 +5025,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.7.6", + "winnow 0.7.7", ] [[package]] @@ -4940,11 +5096,11 @@ dependencies = [ "dirs", "libappindicator", "muda", - "objc2 0.6.0", + "objc2 0.6.1", "objc2-app-kit", "objc2-core-foundation", "objc2-core-graphics", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.1", "once_cell", "png", "serde", @@ -4952,6 +5108,19 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "tree_magic_mini" +version = "3.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac5e8971f245c3389a5a76e648bfc80803ae066a1243a75db0064d7c1129d63" +dependencies = [ + "fnv", + "memchr", + "nom", + "once_cell", + "petgraph", +] + [[package]] name = "try-lock" version = "0.2.5" @@ -5260,6 +5429,76 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wayland-backend" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7208998eaa3870dad37ec8836979581506e0c5c64c20c9e79e9d2a10d6f47bf" +dependencies = [ + "cc", + "downcast-rs", + "rustix 0.38.44", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-client" +version = "0.31.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2120de3d33638aaef5b9f4472bff75f07c56379cf76ea320bd3a3d65ecaf73f" +dependencies = [ + "bitflags 2.9.0", + "rustix 0.38.44", + "wayland-backend", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols" +version = "0.32.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0781cf46869b37e36928f7b432273c0995aa8aed9552c556fb18754420541efc" +dependencies = [ + "bitflags 2.9.0", + "wayland-backend", + "wayland-client", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248a02e6f595aad796561fa82d25601bd2c8c3b145b1c7453fc8f94c1a58f8b2" +dependencies = [ + "bitflags 2.9.0", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.31.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "896fdafd5d28145fce7958917d69f2fd44469b1d4e861cb5961bcbeebc6d1484" +dependencies = [ + "proc-macro2", + "quick-xml 0.37.4", + "quote", +] + +[[package]] +name = "wayland-sys" +version = "0.31.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbcebb399c77d5aa9fa5db874806ee7b4eba4e73650948e8f93963f128896615" +dependencies = [ + "pkg-config", +] + [[package]] name = "web-sys" version = "0.3.77" @@ -5369,6 +5608,12 @@ dependencies = [ "windows-core 0.61.0", ] +[[package]] +name = "weezl" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" + [[package]] name = "winapi" version = "0.3.9" @@ -5406,10 +5651,10 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9bec5a31f3f9362f2258fd0e9c9dd61a9ca432e7306cc78c444258f0dce9a9c" dependencies = [ - "objc2 0.6.0", + "objc2 0.6.1", "objc2-app-kit", "objc2-core-foundation", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.1", "raw-window-handle", "windows-sys 0.59.0", "windows-version", @@ -5900,9 +6145,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63d3fcd9bba44b03821e7d699eeee959f3126dcc4aa8e4ae18ec617c2a5cea10" +checksum = "6cb8234a863ea0e8cd7284fcdd4f145233eb00fee02bbdd9861aec44e6477bc5" dependencies = [ "memchr", ] @@ -5926,6 +6171,25 @@ dependencies = [ "bitflags 2.9.0", ] +[[package]] +name = "wl-clipboard-rs" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5ff8d0e60065f549fafd9d6cb626203ea64a798186c80d8e7df4f8af56baeb" +dependencies = [ + "libc", + "log", + "os_pipe", + "rustix 0.38.44", + "tempfile", + "thiserror 2.0.12", + "tree_magic_mini", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-wlr", +] + [[package]] name = "write16" version = "1.0.0" @@ -5945,7 +6209,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c886a0a9d2a94fd90cfa1d929629b79cfefb1546e2c7430c63a47f0664c0e4e2" dependencies = [ "base64 0.22.1", - "block2 0.6.0", + "block2 0.6.1", "cookie", "crossbeam-channel", "dpi", @@ -5959,10 +6223,10 @@ dependencies = [ "kuchikiki", "libc", "ndk", - "objc2 0.6.0", + "objc2 0.6.1", "objc2-app-kit", "objc2-core-foundation", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.1", "objc2-ui-kit", "objc2-web-kit", "once_cell", @@ -6012,6 +6276,23 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "x11rb" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" +dependencies = [ + "gethostname 0.4.3", + "rustix 0.38.44", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" + [[package]] name = "xattr" version = "1.5.0" @@ -6085,7 +6366,7 @@ dependencies = [ "tracing", "uds_windows", "windows-sys 0.59.0", - "winnow 0.7.6", + "winnow 0.7.7", "xdg-home", "zbus_macros", "zbus_names", @@ -6115,7 +6396,7 @@ checksum = "7be68e64bf6ce8db94f63e72f0c7eb9a60d733f7e0499e628dfab0f84d6bcb97" dependencies = [ "serde", "static_assertions", - "winnow 0.7.6", + "winnow 0.7.7", "zvariant", ] @@ -6209,6 +6490,7 @@ dependencies = [ "serde_json", "tauri", "tauri-build", + "tauri-plugin-clipboard-manager", "tauri-plugin-fs", "tauri-plugin-http", "tauri-plugin-log", @@ -6232,7 +6514,7 @@ dependencies = [ "enumflags2", "serde", "static_assertions", - "winnow 0.7.6", + "winnow 0.7.7", "zvariant_derive", "zvariant_utils", ] @@ -6261,5 +6543,5 @@ dependencies = [ "serde", "static_assertions", "syn 2.0.100", - "winnow 0.7.6", + "winnow 0.7.7", ] diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 7b8d5c6..610be5a 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -30,6 +30,7 @@ tauri-plugin-fs = "2" tauri-plugin-log = "2" time = { version = "0.3", features = ["formatting"] } tauri-plugin-store = "2" +tauri-plugin-clipboard-manager = "2" [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies] tauri-plugin-single-instance = "2" diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index e7e7783..2f36d92 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -26,6 +26,10 @@ "identifier": "fs:allow-read-dir", "allow": [{ "path": "$APPLOCALDATA/**" }] }, + { + "identifier": "fs:allow-read-text-file", + "allow": [{ "path": "$APPLOCALDATA/networks/**" }] + }, { "identifier": "http:default", "allow": [ diff --git a/src-tauri/capabilities/desktop.json b/src-tauri/capabilities/desktop.json index 47424fa..256d12a 100644 --- a/src-tauri/capabilities/desktop.json +++ b/src-tauri/capabilities/desktop.json @@ -2,5 +2,5 @@ "identifier": "desktop-capability", "platforms": ["macOS", "windows", "linux"], "windows": ["main"], - "permissions": ["updater:default"] + "permissions": ["clipboard-manager:allow-write-text", "updater:default"] } diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 5b9d48d..725d632 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -62,6 +62,7 @@ pub fn run() { .plugin(tauri_plugin_upload::init()) .plugin(tauri_plugin_os::init()) .plugin(tauri_plugin_opener::init()) + .plugin(tauri_plugin_clipboard_manager::init()) .invoke_handler(tauri::generate_handler![network_connect]) .run(tauri::generate_context!()) .expect("error while running tauri application"); diff --git a/src/App.css b/src/App.css index e594e82..083006c 100644 --- a/src/App.css +++ b/src/App.css @@ -44,6 +44,14 @@ -moz-osx-font-smoothing: grayscale; } +#root { + /* force WebKit to promote into its compositor and repaint reliably (fix macos issue) */ + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + -webkit-backface-visibility: hidden; + backface-visibility: hidden; +} + /* * Set scrollbar-gutter to prevent sidebar-induced layout shift on Windows * https://github.com/saadeghi/daisyui/issues/2859#issuecomment-2383862183 diff --git a/src/App.tsx b/src/App.tsx index 760cd73..704d588 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -4,7 +4,7 @@ import * as app from "@tauri-apps/api/app"; import * as log from "@tauri-apps/plugin-log"; import { arch, platform } from "@tauri-apps/plugin-os"; import { Footer, Header, Message } from "./components"; -import { Networks, Settings } from "./pages"; +import { Networks, Settings, WalletShield } from "./pages"; import { useStore } from "./store"; import { getNetworks, getPlatformArch } from "./utils"; import "./App.css"; @@ -43,6 +43,7 @@ function App() { } /> } /> + } /> diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 691eedc..0f085e5 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -1,6 +1,6 @@ import { useRef } from "react"; import { Link } from "react-router"; -import { IconBars3, IconCog, IconGlobe } from "."; +import { IconBars3, IconCog, IconGlobe, IconShieldCheck } from "."; import { useStore } from "../store"; export function Header() { @@ -55,7 +55,7 @@ export function Header() { -
+
diff --git a/src/components/RPCEndpoints.tsx b/src/components/RPCEndpoints.tsx new file mode 100644 index 0000000..6569be0 --- /dev/null +++ b/src/components/RPCEndpoints.tsx @@ -0,0 +1,134 @@ +import { useState, useMemo, useEffect } from "react"; +import { useStore } from "../store"; +import { writeText } from "@tauri-apps/plugin-clipboard-manager"; +import * as log from "@tauri-apps/plugin-log"; +import { + defaultWalletshieldListenAddress, + NetworkServices, + readNetworkAssetFile, +} from "../utils"; +import { IconClipboard } from "./icons"; + +export function RPCEndpoints() { + const [includeTestnets, setIncludeTestnets] = useState(true); + const [search, setSearch] = useState(""); + const [services, setServices] = useState(); + const [copied, setCopied] = useState(""); + + const networkConnected = useStore((s) => s.networkConnected); + const setMessage = useStore((s) => s.setMessage); + + const walletshieldListenAddress = useStore( + (s) => s.walletshieldListenAddress, + ); + const wla = walletshieldListenAddress || defaultWalletshieldListenAddress; + const BASE_URL = `http://localhost${wla}`; + + useEffect(() => { + try { + (async () => { + // read services file of the connected network + if (networkConnected) { + const f = await readNetworkAssetFile( + networkConnected, + "services.json", + ); + const s = JSON.parse(f) as NetworkServices; + setServices(s); + } + })(); + } catch (error: any) { + log.error(`${error}`); + setMessage("error", `${error}`); + } + }, []); + + const handleCopy = async (rpcPath: string) => { + await writeText(`${BASE_URL}${rpcPath}`); + setCopied(rpcPath); + }; + + const filtered = useMemo(() => { + if (!services) return []; + const endpoints = services.RPCEndpoints; + return endpoints + .filter((n) => includeTestnets || !n.isTestnet) + .filter((n) => { + const term = search.toLowerCase(); + return ( + n.chain.toLowerCase().includes(term) || + n.network.toLowerCase().includes(term) + ); + }); + }, [includeTestnets, search, services]); + + if (!networkConnected) { + return ( +
+
+ Connect to a network to see its supported RPC endpoints. +
+
+ ); + } + + return ( +
+
+
+ + setSearch(e.target.value)} + /> + +
+
+ +
+ + + + + + + + + + + {filtered.map((n, idx) => ( + + + + + + + ))} + +
ChainNetworkChainIDRPC URL
{n.chain}{n.network}{n.chainId ?? ""} handleCopy(n.rpcPath)} + > + + {`${BASE_URL}${n.rpcPath}`} +
+
+
+ ); +} diff --git a/src/components/icons.tsx b/src/components/icons.tsx index 4eb4c9b..105af56 100644 --- a/src/components/icons.tsx +++ b/src/components/icons.tsx @@ -55,6 +55,34 @@ export const IconCheckBadge = ({ ); +export const IconClipboard = ({ + className = "size-6", + withCheck = false, +}: { + className?: string; + withCheck?: boolean; +}) => ( + + {/* Clipboard outline */} + + {/* Check mark inside */} + {withCheck && ( + + )} + +); + export const IconCog = () => ( ( ); + +export const IconShieldCheck = ({ + className = "size-6", +}: { + className?: string; +}) => ( + + + +); diff --git a/src/components/index.ts b/src/components/index.ts index 5fbe34f..28bf6a3 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,5 +1,6 @@ export { Footer } from "./Footer"; export { Header } from "./Header"; export { Message } from "./Message"; +export { RPCEndpoints } from "./RPCEndpoints"; export * from "./icons.tsx"; diff --git a/src/pages/Networks.tsx b/src/pages/Networks.tsx index b9b8985..7df2383 100644 --- a/src/pages/Networks.tsx +++ b/src/pages/Networks.tsx @@ -71,11 +71,13 @@ export function Networks() { async function clientStart() { const urlClientCfg = `${urlNetwork}/${networkId}/client.toml`; + const urlServices = `${urlNetwork}/${networkId}/services.json`; const urlWalletshield = `${urlNetwork}/${networkId}/walletshield-${platformArch}`; const appLocalDataDirPath = await path.appLocalDataDir(); const dirNetworks = await path.join(appLocalDataDirPath, "networks"); const dirNetwork = await path.join(dirNetworks, networkId); const fileClientCfg = await path.join(dirNetwork, "client.toml"); + const fileServices = await path.join(dirNetwork, "services.json"); const fileWalletshield = (await path.join(dirNetwork, "walletshield")) + (platform() === "windows" ? ".exe" : ""); @@ -95,13 +97,14 @@ export function Networks() { } //////////////////////////////////////////////////////////////////////// - // save the network's client.toml in a network-specific directory + // save the network's assets in a network-specific directory //////////////////////////////////////////////////////////////////////// log.debug(`local network directory: ${dirNetwork}`); if (!(await exists(dirNetwork))) await mkdir(dirNetwork, { recursive: true }); await download(urlClientCfg, fileClientCfg); - setMessage("info", "Retrieved network client configuration"); + await download(urlServices, fileServices); + setMessage("info", "Retrieved network assets"); //////////////////////////////////////////////////////////////////////// // save the network's walletshield binary diff --git a/src/pages/WalletShield.tsx b/src/pages/WalletShield.tsx new file mode 100644 index 0000000..e0a5fa5 --- /dev/null +++ b/src/pages/WalletShield.tsx @@ -0,0 +1,18 @@ +import { RPCEndpoints } from "../components"; + +export function WalletShield() { + return ( +
+ +
+ +
+
+ ); +} diff --git a/src/pages/index.ts b/src/pages/index.ts index d0b73ad..e27a4c7 100644 --- a/src/pages/index.ts +++ b/src/pages/index.ts @@ -1,2 +1,3 @@ export { Networks } from "./Networks"; export { Settings } from "./Settings"; +export { WalletShield } from "./WalletShield"; diff --git a/src/utils/index.ts b/src/utils/index.ts index a4ecda5..fdb4a8c 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,4 +1,5 @@ -import { BaseDirectory, readDir } from "@tauri-apps/plugin-fs"; +import { BaseDirectory, readDir, readTextFile } from "@tauri-apps/plugin-fs"; +import { path } from "@tauri-apps/api"; import { arch, platform } from "@tauri-apps/plugin-os"; export const defaultWalletshieldListenAddress = ":7070"; @@ -30,3 +31,21 @@ export const getNetworks = async () => { }); return entries.filter((i) => i.isDirectory).map((i) => i.name); }; + +export const readNetworkAssetFile = async ( + networkId: string, + asset: string, +) => { + const filePath = await path.join("networks", networkId, asset); + return await readTextFile(filePath, { baseDir: BaseDirectory.AppLocalData }); +}; + +export type NetworkServices = { + RPCEndpoints: { + chain: string; + network: string; + chainId: number | null; + rpcPath: string; + isTestnet: boolean; + }[]; +};