From 53d36b5186c952a693068622f1371d37dd7e2e5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E9=9B=85=20misaki=20masa?= Date: Thu, 18 Jun 2026 16:18:01 +0800 Subject: [PATCH] refactor: switch to `ratatui-core` (#4050) --- Cargo.lock | 936 ++++-------------------- Cargo.toml | 4 +- nix/yazi-unwrapped.nix | 3 +- yazi-actor/Cargo.toml | 27 +- yazi-actor/src/app/reflow.rs | 2 +- yazi-actor/src/input/show.rs | 2 +- yazi-actor/src/notify/tick.rs | 2 +- yazi-adapter/Cargo.toml | 24 +- yazi-adapter/src/adapter.rs | 2 +- yazi-adapter/src/drivers/chafa.rs | 2 +- yazi-adapter/src/drivers/driver.rs | 2 +- yazi-adapter/src/drivers/iip.rs | 2 +- yazi-adapter/src/drivers/kgp.rs | 2 +- yazi-adapter/src/drivers/kgp_old.rs | 2 +- yazi-adapter/src/drivers/sixel.rs | 2 +- yazi-adapter/src/drivers/ueberzug.rs | 2 +- yazi-adapter/src/image.rs | 2 +- yazi-binding/Cargo.toml | 28 +- yazi-binding/src/elements/align.rs | 10 +- yazi-binding/src/elements/area.rs | 14 +- yazi-binding/src/elements/bar.rs | 7 +- yazi-binding/src/elements/border.rs | 43 +- yazi-binding/src/elements/cell.rs | 4 +- yazi-binding/src/elements/color.rs | 6 +- yazi-binding/src/elements/constraint.rs | 6 +- yazi-binding/src/elements/edge.rs | 2 +- yazi-binding/src/elements/fill.rs | 6 +- yazi-binding/src/elements/gauge.rs | 14 +- yazi-binding/src/elements/layout.rs | 16 +- yazi-binding/src/elements/line.rs | 16 +- yazi-binding/src/elements/list.rs | 8 +- yazi-binding/src/elements/pad.rs | 56 +- yazi-binding/src/elements/rect.rs | 23 +- yazi-binding/src/elements/row.rs | 4 +- yazi-binding/src/elements/span.rs | 4 +- yazi-binding/src/elements/table.rs | 34 +- yazi-binding/src/elements/text.rs | 26 +- yazi-binding/src/elements/wrap.rs | 18 +- yazi-binding/src/macros.rs | 42 +- yazi-binding/src/position/position.rs | 3 +- yazi-binding/src/style/style.rs | 8 +- yazi-binding/src/style/style_flat.rs | 16 +- yazi-config/Cargo.toml | 31 +- yazi-config/src/layout.rs | 2 +- yazi-config/src/popup/options.rs | 3 +- yazi-config/src/preview/wrap.rs | 6 +- yazi-core/Cargo.toml | 35 +- yazi-core/src/confirm/confirm.rs | 3 +- yazi-core/src/core.rs | 2 +- yazi-core/src/highlighter.rs | 34 +- yazi-core/src/mgr/mgr.rs | 2 +- yazi-core/src/notify/message.rs | 4 +- yazi-core/src/notify/notify.rs | 2 +- yazi-core/src/tab/tab.rs | 2 +- yazi-emulator/Cargo.toml | 12 +- yazi-emulator/src/emulator.rs | 2 +- yazi-fm/Cargo.toml | 3 +- yazi-fm/src/app/sync_guard.rs | 2 +- yazi-fm/src/cmp/cmp.rs | 3 +- yazi-fm/src/confirm/body.rs | 5 +- yazi-fm/src/confirm/buttons.rs | 6 +- yazi-fm/src/confirm/confirm.rs | 3 +- yazi-fm/src/confirm/list.rs | 3 +- yazi-fm/src/help/bindings.rs | 3 +- yazi-fm/src/help/help.rs | 2 +- yazi-fm/src/input/input.rs | 3 +- yazi-fm/src/logs.rs | 2 +- yazi-fm/src/mgr/modal.rs | 2 +- yazi-fm/src/mgr/preview.rs | 4 +- yazi-fm/src/notify/notify.rs | 3 +- yazi-fm/src/pick/list.rs | 5 +- yazi-fm/src/pick/pick.rs | 3 +- yazi-fm/src/renderer.rs | 2 +- yazi-fm/src/root.rs | 2 +- yazi-fm/src/spot/spot.rs | 2 +- yazi-fm/src/tasks/list.rs | 2 +- yazi-fm/src/tasks/progress.rs | 2 +- yazi-fm/src/tasks/tasks.rs | 3 +- yazi-fm/src/which/cand.rs | 2 +- yazi-fm/src/which/which.rs | 3 +- yazi-parser/Cargo.toml | 21 +- yazi-parser/src/app/reflow.rs | 2 +- yazi-plugin/Cargo.toml | 3 +- yazi-plugin/src/utils/spot.rs | 10 +- yazi-shim/Cargo.toml | 3 +- yazi-shim/src/ratatui/line.rs | 3 +- yazi-shim/src/ratatui/span.rs | 2 +- yazi-shim/src/ratatui/wrapper.rs | 2 +- yazi-tty/Cargo.toml | 12 +- yazi-tty/src/sequence/erase.rs | 2 +- yazi-tty/src/sequence/style.rs | 2 +- yazi-tui/Cargo.toml | 6 +- yazi-tui/src/backend.rs | 2 +- yazi-tui/src/raterm.rs | 2 +- yazi-widgets/Cargo.toml | 27 +- yazi-widgets/src/clear/clear.rs | 4 +- yazi-widgets/src/clear/inventory.rs | 2 +- yazi-widgets/src/input/input_arc.rs | 4 +- yazi-widgets/src/input/styles.rs | 2 +- yazi-widgets/src/input/widget.rs | 2 +- yazi-widgets/src/renderable.rs | 14 +- 101 files changed, 566 insertions(+), 1203 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 571993bd..e5a1e542 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,7 +23,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1973cfbc1a2daf9cf550e74e1f088c28e7f7d8c1e1418fb6c9dc5184b7e84c99" dependencies = [ - "crypto-common 0.2.2", + "crypto-common", "inout", ] @@ -35,7 +35,7 @@ checksum = "f1fc76eaeac4c9164506c466d4ffdd8ec9d0c5bf57ee97177c4d8eceb3a0e138" dependencies = [ "cipher", "cpubits", - "cpufeatures 0.3.0", + "cpufeatures", "zeroize", ] @@ -102,7 +102,7 @@ version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e42366bb9d958f042bf58f0a85e1b2d091997c1257ca49bddd7e4827aadc65fd" dependencies = [ - "nom 8.0.0", + "nom", "ratatui-core", "simdutf8", "smallvec", @@ -198,7 +198,7 @@ checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -209,7 +209,7 @@ checksum = "7af50940b73bf4e16c15c448a2b121c63f2d68e3e54b6a8731673cb4aa0cdff5" dependencies = [ "base64ct", "blake2", - "cpufeatures 0.3.0", + "cpufeatures", "password-hash", ] @@ -237,15 +237,6 @@ dependencies = [ "event-listener", ] -[[package]] -name = "atomic" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89cbf775b137e9b968e67227ef7f775587cde3fd31b0d8599dbd0f598a48340" -dependencies = [ - "bytemuck", -] - [[package]] name = "autocfg" version = "1.5.1" @@ -281,7 +272,7 @@ dependencies = [ "anyhow", "arrayvec", "log", - "nom 8.0.0", + "nom", "num-rational", "v_frame", ] @@ -336,7 +327,7 @@ checksum = "144e573728da132683b9488acd528274c790e07fc06ff81ee29f9d8f8b1041e0" dependencies = [ "blowfish", "pbkdf2", - "sha2 0.11.0", + "sha2", ] [[package]] @@ -358,33 +349,12 @@ dependencies = [ "serde", ] -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - [[package]] name = "bit_field" version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e4b40c7323adcfc0a41c4b88143ed58346ff65a288fc144329c5c45e05d70c6" -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.13.0" @@ -421,16 +391,7 @@ version = "0.11.0-rc.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "061f1a09225e328e1ffbb378d2d49923c0ca5fee19fb5ac1cc9c1e9d52b93690" dependencies = [ - "digest 0.11.3", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array 0.14.7", + "digest", ] [[package]] @@ -484,7 +445,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.118", + "syn", ] [[package]] @@ -541,7 +502,7 @@ checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -612,7 +573,7 @@ checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" dependencies = [ "cfg-if", "cipher", - "cpufeatures 0.3.0", + "cpufeatures", "rand_core 0.10.1", "zeroize", ] @@ -637,8 +598,8 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8cf2a2c93cd704877c0858356ed03480ff301ee950b43f1cbe4573b088bfa6c" dependencies = [ - "block-buffer 0.12.1", - "crypto-common 0.2.2", + "block-buffer", + "crypto-common", "inout", "zeroize", ] @@ -703,7 +664,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -781,15 +742,6 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c" -[[package]] -name = "convert_case" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -802,15 +754,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15b85f9c39137c3a891689859392b1bd49812121d0d61c9caf00d46ed5ce06ae" -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - [[package]] name = "cpufeatures" version = "0.3.0" @@ -869,51 +812,6 @@ version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" -[[package]] -name = "crossterm" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" -dependencies = [ - "bitflags 2.13.0", - "crossterm_winapi", - "mio", - "parking_lot", - "rustix 0.38.44", - "serde", - "signal-hook 0.3.18", - "signal-hook-mio", - "winapi", -] - -[[package]] -name = "crossterm" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b9f2e4c67f833b660cdb0a3523065869fb35570177239812ed4c905aeff87b" -dependencies = [ - "bitflags 2.13.0", - "crossterm_winapi", - "derive_more", - "document-features", - "mio", - "parking_lot", - "rustix 1.1.4", - "serde", - "signal-hook 0.3.18", - "signal-hook-mio", - "winapi", -] - -[[package]] -name = "crossterm_winapi" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" -dependencies = [ - "winapi", -] - [[package]] name = "crunchy" version = "0.2.4" @@ -937,16 +835,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "crypto-common" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" -dependencies = [ - "generic-array 0.14.7", - "typenum", -] - [[package]] name = "crypto-common" version = "0.2.2" @@ -968,16 +856,6 @@ dependencies = [ "rand_core 0.10.1", ] -[[package]] -name = "csscolorparser" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb2a7d3066da2de787b7f032c736763eb7ae5d355f81a68bab2675a96008b0bf" -dependencies = [ - "lab", - "phf", -] - [[package]] name = "ctr" version = "0.10.1" @@ -1004,9 +882,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f359e08ca85e7bd759e1fd933ff2bccd81864c60a8fba0e259c7f822b0924bf" dependencies = [ "cfg-if", - "cpufeatures 0.3.0", + "cpufeatures", "curve25519-dalek-derive", - "digest 0.11.3", + "digest", "fiat-crypto", "rustc_version", "subtle", @@ -1021,7 +899,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -1044,7 +922,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.118", + "syn", ] [[package]] @@ -1055,7 +933,7 @@ checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" dependencies = [ "darling_core", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -1092,15 +970,9 @@ checksum = "780eb241654bf097afb00fc5f054a09b687dad862e485fdcf8399bb056565370" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] -[[package]] -name = "deltae" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5729f5117e208430e437df2f4843f5e5952997175992d1414f94c57d61e270b4" - [[package]] name = "der" version = "0.8.0" @@ -1121,28 +993,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "derive_more" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" -dependencies = [ - "derive_more-impl", -] - -[[package]] -name = "derive_more-impl" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" -dependencies = [ - "convert_case", - "proc-macro2", - "quote", - "rustc_version", - "syn 2.0.118", -] - [[package]] name = "des" version = "0.9.0" @@ -1152,25 +1002,15 @@ dependencies = [ "cipher", ] -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer 0.10.4", - "crypto-common 0.1.7", -] - [[package]] name = "digest" version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" dependencies = [ - "block-buffer 0.12.1", + "block-buffer", "const-oid", - "crypto-common 0.2.2", + "crypto-common", "ctutils", ] @@ -1195,15 +1035,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "document-features" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" -dependencies = [ - "litrs", -] - [[package]] name = "dyn-clone" version = "1.0.20" @@ -1217,7 +1048,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54fb064faabbee66e1fc8e5c5a9458d4269dc2d8b638fe86a425adb2510d1a96" dependencies = [ "der", - "digest 0.11.3", + "digest", "elliptic-curve", "rfc6979", "signature", @@ -1245,7 +1076,7 @@ dependencies = [ "ed25519", "rand_core 0.10.1", "serde", - "sha2 0.11.0", + "sha2", "signature", "subtle", "zeroize", @@ -1265,8 +1096,8 @@ checksum = "102d3643d30dd8b559613c5cced68317199597fffb278cdc88daa2ef7fafc935" dependencies = [ "base16ct", "crypto-bigint", - "crypto-common 0.2.2", - "digest 0.11.3", + "crypto-common", + "digest", "ff", "group", "hkdf", @@ -1295,7 +1126,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -1315,7 +1146,7 @@ checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -1351,15 +1182,6 @@ version = "3.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dea2df4cf52843e0452895c455a1a2cfbb842a1e7329671acf418fdc53ed4c59" -[[package]] -name = "euclid" -version = "0.22.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a05365e3b1c6d1650318537c7460c6923f1abdd272ad6842baa2b509957a06" -dependencies = [ - "num-traits", -] - [[package]] name = "event-listener" version = "4.0.3" @@ -1385,16 +1207,6 @@ dependencies = [ "zune-inflate", ] -[[package]] -name = "fancy-regex" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" -dependencies = [ - "bit-set", - "regex", -] - [[package]] name = "fast-srgb8" version = "1.0.0" @@ -1448,35 +1260,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64cd1e32ddd350061ae6edb1b082d7c54915b5c672c389143b9a63403a109f24" -[[package]] -name = "filedescriptor" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e40758ed24c9b2eeb76c35fb0aebc66c626084edd827e07e1552279814c6682d" -dependencies = [ - "libc", - "thiserror 1.0.69", - "winapi", -] - [[package]] name = "find-msvc-tools" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" -[[package]] -name = "finl_unicode" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9844ddc3a6e533d62bba727eb6c28b5d360921d5175e9ff0f1e621a5c590a4d5" - -[[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.9" @@ -1570,7 +1359,7 @@ checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -1789,7 +1578,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6303bc9732ae41b04cb554b844a762b4115a61bfaa81e3e83050991eeb56863f" dependencies = [ - "digest 0.11.3", + "digest", ] [[package]] @@ -1911,7 +1700,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "533e68a5842e734946fe159fb03fc9bbbb254f590dd0d8ad321ae5ff7beca2c1" dependencies = [ - "bitflags 2.13.0", + "bitflags", "inotify-sys", "libc", ] @@ -1945,7 +1734,7 @@ dependencies = [ "indoc", "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -1968,7 +1757,7 @@ checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -2040,7 +1829,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e24a010dd405bd7ed803e5253182815b41bf2e6a80cc3bfc066658e03a198aa" dependencies = [ "cfg-if", - "cpufeatures 0.3.0", + "cpufeatures", ] [[package]] @@ -2049,7 +1838,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01737161ba802849cfd486b5bd209d38ba4943494c249a8126005170c7621edd" dependencies = [ - "crypto-common 0.2.2", + "crypto-common", "rand_core 0.10.1", ] @@ -2069,16 +1858,10 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07293a4e297ac234359b510362495713f75ea345d5307140414f20c69ffeb087" dependencies = [ - "bitflags 2.13.0", + "bitflags", "libc", ] -[[package]] -name = "lab" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf36173d4167ed999940f804952e6b08197cae5ad5d572eb4db150ce8ad5d58f" - [[package]] name = "lazy_static" version = "1.5.0" @@ -2128,27 +1911,15 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f50e8f47623268b5407192d26876c4d7f89d686ca130fdc53bced4814cd29f8" dependencies = [ - "bitflags 2.13.0", + "bitflags", ] -[[package]] -name = "linux-raw-sys" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" - [[package]] name = "linux-raw-sys" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" -[[package]] -name = "litrs" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" - [[package]] name = "lock_api" version = "0.4.14" @@ -2201,16 +1972,6 @@ dependencies = [ "which", ] -[[package]] -name = "mac_address" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0aeb26bf5e836cc1c341c8106051b573f1766dfa05aa87f0b98be5e51b02303" -dependencies = [ - "nix 0.29.0", - "winapi", -] - [[package]] name = "matchers" version = "0.2.0" @@ -2241,12 +2002,6 @@ version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88904434abc2901f197fe8cc55f0445e7ded921dba5911dad2e2b39b48e663c4" -[[package]] -name = "memmem" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64a92489e2744ce060c349162be1c5f33c6969234104dbd99ddb5feb08b8c15" - [[package]] name = "memoffset" version = "0.9.1" @@ -2256,12 +2011,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - [[package]] name = "miniz_oxide" version = "0.8.9" @@ -2346,7 +2095,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.118", + "syn", ] [[package]] @@ -2376,26 +2125,13 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" -[[package]] -name = "nix" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" -dependencies = [ - "bitflags 2.13.0", - "cfg-if", - "cfg_aliases", - "libc", - "memoffset", -] - [[package]] name = "nix" version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d" dependencies = [ - "bitflags 2.13.0", + "bitflags", "cfg-if", "cfg_aliases", "libc", @@ -2410,16 +2146,6 @@ dependencies = [ "memchr", ] -[[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 = "nom" version = "8.0.0" @@ -2441,7 +2167,7 @@ version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d3d07927151ff8575b7087f245456e549fea62edf0ec4e565a5ee50c8402bc3" dependencies = [ - "bitflags 2.13.0", + "bitflags", "fsevent-sys", "inotify", "kqueue", @@ -2459,7 +2185,7 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42b8cfee0e339a0337359f3c88165702ac6e600dc01c0cc9579a92d62b08477a" dependencies = [ - "bitflags 2.13.0", + "bitflags", ] [[package]] @@ -2495,7 +2221,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -2547,12 +2273,6 @@ dependencies = [ "libc", ] -[[package]] -name = "numtoa" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aa2c4e539b869820a2b82e1aef6ff40aa85e65decdd5185e83fb4b1249cd00f" - [[package]] name = "objc2" version = "0.6.4" @@ -2574,7 +2294,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" dependencies = [ - "bitflags 2.13.0", + "bitflags", "objc2", ] @@ -2605,7 +2325,7 @@ version = "6.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0cc3cbf698f9438986c11a880c90a6d04b9de27575afd28bbf45b154b6c709e2" dependencies = [ - "bitflags 2.13.0", + "bitflags", "libc", "once_cell", "onig_sys", @@ -2636,15 +2356,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "ordered-float" -version = "4.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bb71e1b3fa6ca1c61f383464aaf2bb0e2f8e772a1f01d486832464de363b951" -dependencies = [ - "num-traits", -] - [[package]] name = "ordered-float" version = "5.3.0" @@ -2666,7 +2377,7 @@ dependencies = [ "elliptic-curve", "primefield", "primeorder", - "sha2 0.11.0", + "sha2", ] [[package]] @@ -2680,7 +2391,7 @@ dependencies = [ "fiat-crypto", "primefield", "primeorder", - "sha2 0.11.0", + "sha2", ] [[package]] @@ -2694,7 +2405,7 @@ dependencies = [ "elliptic-curve", "primefield", "primeorder", - "sha2 0.11.0", + "sha2", ] [[package]] @@ -2710,7 +2421,7 @@ dependencies = [ "futures", "log", "rand 0.10.1", - "sha2 0.11.0", + "sha2", "thiserror 2.0.18", "tokio", "windows 0.62.2", @@ -2739,7 +2450,7 @@ dependencies = [ "by_address", "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -2798,7 +2509,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "112d82ceb8c5bf524d9af484d4e4970c9fd5a0cc15ba14ad93dccd28873b0629" dependencies = [ - "digest 0.11.3", + "digest", "hmac", ] @@ -2817,49 +2528,6 @@ version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" -[[package]] -name = "pest" -version = "2.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0848c601009d37dfa3430c4666e147e49cdcf1b92ecd3e63657d8a5f19da662" -dependencies = [ - "memchr", - "ucd-trie", -] - -[[package]] -name = "pest_derive" -version = "2.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11f486f1ea21e6c10ed15d5a7c77165d0ee443402f0780849d1768e7d9d6fe77" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8040c4647b13b210a963c1ed407c1ff4fdfa01c31d6d2a098218702e6664f94f" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "pest_meta" -version = "2.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89815c69d36021a140146f26659a81d6c2afa33d216d736dd4be5381a7362220" -dependencies = [ - "pest", - "sha2 0.10.9", -] - [[package]] name = "phc" version = "0.6.1" @@ -2870,58 +2538,6 @@ dependencies = [ "ctutils", ] -[[package]] -name = "phf" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" -dependencies = [ - "phf_macros", - "phf_shared", -] - -[[package]] -name = "phf_codegen" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" -dependencies = [ - "phf_generator", - "phf_shared", -] - -[[package]] -name = "phf_generator" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" -dependencies = [ - "phf_shared", - "rand 0.8.6", -] - -[[package]] -name = "phf_macros" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "phf_shared" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" -dependencies = [ - "siphasher", -] - [[package]] name = "pin-project-lite" version = "0.2.17" @@ -2950,7 +2566,7 @@ dependencies = [ "pbkdf2", "rand_core 0.10.1", "scrypt", - "sha2 0.11.0", + "sha2", "spki", ] @@ -2991,7 +2607,7 @@ version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61" dependencies = [ - "bitflags 2.13.0", + "bitflags", "crc32fast", "fdeflate", "flate2", @@ -3004,7 +2620,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a00baa632505d05512f48a963e16051c54fda9a95cc9acea1a4e3c90991c4a2e" dependencies = [ - "cpufeatures 0.3.0", + "cpufeatures", "universal-hash", "zeroize", ] @@ -3016,7 +2632,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dfc63250416fea14f5749b90725916a6c903f599d51cb635aa7a52bfd03eede" dependencies = [ "cpubits", - "cpufeatures 0.3.0", + "cpufeatures", "universal-hash", ] @@ -3048,7 +2664,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.118", + "syn", ] [[package]] @@ -3058,7 +2674,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8675564771a62f69a0af716b03e89b917b963c7b173b5855575e84fd4f605ca0" dependencies = [ "crypto-bigint", - "crypto-common 0.2.2", + "crypto-common", "ff", "rand_core 0.10.1", "subtle", @@ -3093,7 +2709,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -3121,7 +2737,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4488a4a36b9a4ba6b9334a32a39971f77c1436ec82c38707bce707699cc3bbcb" dependencies = [ "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -3262,26 +2878,12 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" -[[package]] -name = "ratatui" -version = "0.30.1" -source = "git+https://github.com/yazi-rs/ratatui.git?rev=a1c4922a242861d755163ae85d7e41b85ed277d2#a1c4922a242861d755163ae85d7e41b85ed277d2" -dependencies = [ - "instability", - "ratatui-core", - "ratatui-crossterm", - "ratatui-termion", - "ratatui-termwiz", - "ratatui-widgets", - "serde", -] - [[package]] name = "ratatui-core" version = "0.1.1" source = "git+https://github.com/yazi-rs/ratatui.git?rev=a1c4922a242861d755163ae85d7e41b85ed277d2#a1c4922a242861d755163ae85d7e41b85ed277d2" dependencies = [ - "bitflags 2.13.0", + "bitflags", "compact_str", "critical-section", "hashbrown 0.17.1", @@ -3298,43 +2900,12 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "ratatui-crossterm" -version = "0.1.1" -source = "git+https://github.com/yazi-rs/ratatui.git?rev=a1c4922a242861d755163ae85d7e41b85ed277d2#a1c4922a242861d755163ae85d7e41b85ed277d2" -dependencies = [ - "cfg-if", - "crossterm 0.28.1", - "crossterm 0.29.0", - "instability", - "ratatui-core", -] - -[[package]] -name = "ratatui-termion" -version = "0.1.1" -source = "git+https://github.com/yazi-rs/ratatui.git?rev=a1c4922a242861d755163ae85d7e41b85ed277d2#a1c4922a242861d755163ae85d7e41b85ed277d2" -dependencies = [ - "instability", - "ratatui-core", - "termion", -] - -[[package]] -name = "ratatui-termwiz" -version = "0.1.1" -source = "git+https://github.com/yazi-rs/ratatui.git?rev=a1c4922a242861d755163ae85d7e41b85ed277d2#a1c4922a242861d755163ae85d7e41b85ed277d2" -dependencies = [ - "ratatui-core", - "termwiz", -] - [[package]] name = "ratatui-widgets" version = "0.3.1" source = "git+https://github.com/yazi-rs/ratatui.git?rev=a1c4922a242861d755163ae85d7e41b85ed277d2#a1c4922a242861d755163ae85d7e41b85ed277d2" dependencies = [ - "bitflags 2.13.0", + "bitflags", "hashbrown 0.17.1", "indoc", "instability", @@ -3423,7 +2994,7 @@ version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags 2.13.0", + "bitflags", ] [[package]] @@ -3454,7 +3025,7 @@ checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -3525,11 +3096,11 @@ dependencies = [ "const-oid", "crypto-bigint", "crypto-primes", - "digest 0.11.3", + "digest", "pkcs1", "pkcs8", "rand_core 0.10.1", - "sha2 0.11.0", + "sha2", "signature", "spki", "zeroize", @@ -3542,7 +3113,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbf893f64684e58da8a68d56a5e84d1cf0440226274c515770fe267707a7d0b0" dependencies = [ "aes", - "bitflags 2.13.0", + "bitflags", "block-padding", "byteorder", "bytes", @@ -3554,7 +3125,7 @@ dependencies = [ "data-encoding", "delegate", "der", - "digest 0.11.3", + "digest", "ecdsa", "ed25519-dalek", "elliptic-curve", @@ -3592,7 +3163,7 @@ dependencies = [ "scrypt", "sec1", "sha1", - "sha2 0.11.0", + "sha2", "sha3", "signature", "spki", @@ -3613,7 +3184,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "443f6bbcfacb34a1aab2b12b99bf08e0c63abdc5a0db261901365df9d57fff51" dependencies = [ "log", - "nix 0.31.3", + "nix", "ssh-encoding", "windows-sys 0.61.2", ] @@ -3651,29 +3222,16 @@ dependencies = [ "semver", ] -[[package]] -name = "rustix" -version = "0.38.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" -dependencies = [ - "bitflags 2.13.0", - "errno", - "libc", - "linux-raw-sys 0.4.15", - "windows-sys 0.59.0", -] - [[package]] name = "rustix" version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ - "bitflags 2.13.0", + "bitflags", "errno", "libc", - "linux-raw-sys 0.12.1", + "linux-raw-sys", "windows-sys 0.61.2", ] @@ -3756,7 +3314,7 @@ dependencies = [ "cfg-if", "pbkdf2", "salsa20", - "sha2 0.11.0", + "sha2", ] [[package]] @@ -3816,7 +3374,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -3870,7 +3428,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -3890,19 +3448,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aacc4cc499359472b4abe1bf11d0b12e688af9a805fa5e3016f9a386dc2d0214" dependencies = [ "cfg-if", - "cpufeatures 0.3.0", - "digest 0.11.3", -] - -[[package]] -name = "sha2" -version = "0.10.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" -dependencies = [ - "cfg-if", - "cpufeatures 0.2.17", - "digest 0.10.7", + "cpufeatures", + "digest", ] [[package]] @@ -3912,8 +3459,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "446ba717509524cb3f22f17ecc096f10f4822d76ab5c0b9822c5f9c284e825f4" dependencies = [ "cfg-if", - "cpufeatures 0.3.0", - "digest 0.11.3", + "cpufeatures", + "digest", ] [[package]] @@ -3922,7 +3469,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be176f1a57ce4e3d31c1a166222d9768de5954f811601fb7ca06fc8203905ce1" dependencies = [ - "digest 0.11.3", + "digest", "keccak", ] @@ -3941,16 +3488,6 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" -[[package]] -name = "signal-hook" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" -dependencies = [ - "libc", - "signal-hook-registry", -] - [[package]] name = "signal-hook" version = "0.4.4" @@ -3961,17 +3498,6 @@ dependencies = [ "signal-hook-registry", ] -[[package]] -name = "signal-hook-mio" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b75a19a7a740b25bc7944bdee6172368f988763b744e3d4dfe753f6b4ece40cc" -dependencies = [ - "libc", - "mio", - "signal-hook 0.3.18", -] - [[package]] name = "signal-hook-registry" version = "1.4.8" @@ -3990,7 +3516,7 @@ checksum = "e513e435a8898a0002270f29d0a708b7879708fb5c4d00e46983ca2d2d378cf0" dependencies = [ "futures-core", "libc", - "signal-hook 0.4.4", + "signal-hook", "tokio", ] @@ -4000,7 +3526,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d567dcbaf0049cb8ac2608a76cd95ff9e4412e1899d389ee400918ca7537f5" dependencies = [ - "digest 0.11.3", + "digest", "rand_core 0.10.1", ] @@ -4025,12 +3551,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" -[[package]] -name = "siphasher" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" - [[package]] name = "slab" version = "0.4.12" @@ -4093,7 +3613,7 @@ dependencies = [ "bytes", "crypto-bigint", "ctutils", - "digest 0.11.3", + "digest", "pem-rfc7468", "zeroize", ] @@ -4117,7 +3637,7 @@ dependencies = [ "rsa", "sec1", "sha1", - "sha2 0.11.0", + "sha2", "signature", "ssh-cipher", "ssh-encoding", @@ -4160,7 +3680,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -4175,17 +3695,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7973cce6668464ea31f176d85b13c7ab3bba2cb3b77a2ed26abd7801688010a" -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - [[package]] name = "syn" version = "2.0.118" @@ -4232,85 +3741,10 @@ dependencies = [ "fastrand", "getrandom 0.4.3", "once_cell", - "rustix 1.1.4", + "rustix", "windows-sys 0.61.2", ] -[[package]] -name = "terminfo" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4ea810f0692f9f51b382fff5893887bb4580f5fa246fde546e0b13e7fcee662" -dependencies = [ - "fnv", - "nom 7.1.3", - "phf", - "phf_codegen", -] - -[[package]] -name = "termion" -version = "4.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f44138a9ae08f0f502f24104d82517ef4da7330c35acd638f1f29d3cd5475ecb" -dependencies = [ - "libc", - "numtoa", - "serde", -] - -[[package]] -name = "termios" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "411c5bf740737c7918b8b1fe232dca4dc9f8e754b8ad5e20966814001ed0ac6b" -dependencies = [ - "libc", -] - -[[package]] -name = "termwiz" -version = "0.23.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4676b37242ccbd1aabf56edb093a4827dc49086c0ffd764a5705899e0f35f8f7" -dependencies = [ - "anyhow", - "base64", - "bitflags 2.13.0", - "fancy-regex", - "filedescriptor", - "finl_unicode", - "fixedbitset", - "hex", - "lazy_static", - "libc", - "log", - "memmem", - "nix 0.29.0", - "num-derive", - "num-traits", - "ordered-float 4.6.0", - "pest", - "pest_derive", - "phf", - "serde", - "sha2 0.10.9", - "signal-hook 0.3.18", - "siphasher", - "terminfo", - "termios", - "thiserror 1.0.69", - "ucd-trie", - "unicode-segmentation", - "vtparse", - "wezterm-bidi", - "wezterm-blob-leases", - "wezterm-color-types", - "wezterm-dynamic", - "wezterm-input-types", - "winapi", -] - [[package]] name = "thiserror" version = "1.0.69" @@ -4337,7 +3771,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -4348,7 +3782,7 @@ checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -4466,7 +3900,7 @@ checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -4564,7 +3998,7 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -4651,12 +4085,6 @@ version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" -[[package]] -name = "ucd-trie" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" - [[package]] name = "uds_windows" version = "1.2.1" @@ -4703,7 +4131,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4987bdc12753382e0bec4a65c50738ffaabc998b9cdd1f952fb5f39b0048a96" dependencies = [ - "crypto-common 0.2.2", + "crypto-common", "ctutils", ] @@ -4725,19 +4153,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" -[[package]] -name = "uuid" -version = "1.23.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "144d6b123cef80b301b8f72a9e2ca4370ddec21950d0a103dd22c437006d2db7" -dependencies = [ - "atomic", - "getrandom 0.4.3", - "js-sys", - "serde_core", - "wasm-bindgen", -] - [[package]] name = "uzers" version = "0.12.2" @@ -4810,15 +4225,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" -[[package]] -name = "vtparse" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d9b2acfb050df409c972a37d3b8e08cdea3bddb0c09db9d53137e504cfabed0" -dependencies = [ - "utf8parse", -] - [[package]] name = "walkdir" version = "2.5.0" @@ -4886,7 +4292,7 @@ dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.118", + "syn", "wasm-bindgen-shared", ] @@ -4905,80 +4311,6 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" -[[package]] -name = "wezterm-bidi" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0a6e355560527dd2d1cf7890652f4f09bb3433b6aadade4c9b5ed76de5f3ec" -dependencies = [ - "log", - "wezterm-dynamic", -] - -[[package]] -name = "wezterm-blob-leases" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692daff6d93d94e29e4114544ef6d5c942a7ed998b37abdc19b17136ea428eb7" -dependencies = [ - "getrandom 0.3.4", - "mac_address", - "serde", - "sha2 0.10.9", - "thiserror 1.0.69", - "uuid", -] - -[[package]] -name = "wezterm-color-types" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7de81ef35c9010270d63772bebef2f2d6d1f2d20a983d27505ac850b8c4b4296" -dependencies = [ - "csscolorparser", - "deltae", - "lazy_static", - "serde", - "wezterm-dynamic", -] - -[[package]] -name = "wezterm-dynamic" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f2ab60e120fd6eaa68d9567f3226e876684639d22a4219b313ff69ec0ccd5ac" -dependencies = [ - "log", - "ordered-float 4.6.0", - "strsim", - "thiserror 1.0.69", - "wezterm-dynamic-derive", -] - -[[package]] -name = "wezterm-dynamic-derive" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c0cf2d539c645b448eaffec9ec494b8b19bd5077d9e58cb1ae7efece8d575b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wezterm-input-types" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7012add459f951456ec9d6c7e6fc340b1ce15d6fc9629f8c42853412c029e57e" -dependencies = [ - "bitflags 1.3.2", - "euclid", - "lazy_static", - "serde", - "wezterm-dynamic", -] - [[package]] name = "which" version = "8.0.4" @@ -4998,22 +4330,6 @@ dependencies = [ "safe_arch", ] -[[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.11" @@ -5023,12 +4339,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[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.56.0" @@ -5104,7 +4414,7 @@ checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -5115,7 +4425,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -5126,7 +4436,7 @@ checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -5137,7 +4447,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -5397,7 +4707,8 @@ dependencies = [ "mlua", "parking_lot", "paste", - "ratatui", + "ratatui-core", + "ratatui-widgets", "scopeguard", "tokio", "tokio-stream", @@ -5437,7 +4748,7 @@ dependencies = [ "moxcms", "palette", "quantette", - "ratatui", + "ratatui-core", "strum", "tokio", "tracing", @@ -5460,16 +4771,14 @@ dependencies = [ "futures", "hashbrown 0.17.1", "image", - "inventory", "libc", "mlua", - "ordered-float 5.3.0", - "ratatui", + "ratatui-core", + "ratatui-widgets", "serde", "serde_json", "strum", "tokio", - "tracing", "unicode-width", "windows-sys 0.61.2", "yazi-codegen", @@ -5538,7 +4847,7 @@ version = "26.5.6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] @@ -5547,13 +4856,14 @@ version = "26.5.6" dependencies = [ "anyhow", "arc-swap", - "bitflags 2.13.0", + "bitflags", "globset", "hashbrown 0.17.1", "indexmap 2.14.0", "inventory", "mlua", - "ratatui", + "ratatui-core", + "ratatui-widgets", "regex", "serde", "serde_with", @@ -5581,7 +4891,8 @@ dependencies = [ "indexmap 2.14.0", "mlua", "parking_lot", - "ratatui", + "ratatui-core", + "ratatui-widgets", "serde", "serde_with", "strum", @@ -5641,7 +4952,7 @@ version = "26.5.6" dependencies = [ "anyhow", "either", - "ratatui", + "ratatui-core", "scopeguard", "tokio", "tracing", @@ -5673,7 +4984,8 @@ dependencies = [ "libc", "mlua", "paste", - "ratatui", + "ratatui-core", + "ratatui-widgets", "signal-hook-tokio", "tikv-jemallocator", "tokio", @@ -5711,7 +5023,7 @@ version = "26.5.6" dependencies = [ "anyhow", "arc-swap", - "bitflags 2.13.0", + "bitflags", "core-foundation-sys", "dirs", "either", @@ -5754,16 +5066,15 @@ name = "yazi-parser" version = "26.5.6" dependencies = [ "anyhow", - "bitflags 2.13.0", + "bitflags", "hashbrown 0.17.1", "mlua", "paste", - "ratatui", + "ratatui-core", "serde", "serde_with", "strum", "tokio", - "yazi-binding", "yazi-boot", "yazi-config", "yazi-core", @@ -5789,7 +5100,8 @@ dependencies = [ "libc", "mlua", "percent-encoding", - "ratatui", + "ratatui-core", + "ratatui-widgets", "serde_json", "tokio", "tokio-stream", @@ -5895,7 +5207,7 @@ dependencies = [ name = "yazi-sftp" version = "26.5.6" dependencies = [ - "bitflags 2.13.0", + "bitflags", "parking_lot", "russh", "serde", @@ -5944,7 +5256,8 @@ dependencies = [ "hashbrown 0.17.1", "mlua", "percent-encoding", - "ratatui", + "ratatui-core", + "ratatui-widgets", "serde", "thiserror 2.0.18", "toml", @@ -5960,13 +5273,13 @@ version = "26.5.6" dependencies = [ "anyhow", "base64", - "bitflags 2.13.0", + "bitflags", "futures", "mlua", "parking_lot", - "rustix 1.1.4", + "rustix", "serde", - "signal-hook 0.4.4", + "signal-hook", "strum", "thiserror 2.0.18", "tokio", @@ -5981,11 +5294,11 @@ name = "yazi-tty" version = "26.5.9" dependencies = [ "base64", - "bitflags 2.13.0", + "bitflags", "libc", "mlua", "parking_lot", - "ratatui", + "ratatui-core", "tracing", "windows-sys 0.61.2", "yazi-binding", @@ -5998,7 +5311,7 @@ name = "yazi-tui" version = "26.5.9" dependencies = [ "anyhow", - "ratatui", + "ratatui-core", "tokio", "yazi-config", "yazi-emulator", @@ -6073,7 +5386,8 @@ dependencies = [ "inventory", "mlua", "parking_lot", - "ratatui", + "ratatui-core", + "ratatui-widgets", "serde", "strum", "tokio", @@ -6105,7 +5419,7 @@ checksum = "1ae7f38b72ec2a254e2b87ef277cf2cd4fb97cbebf944faa6f33354da0867930" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index f107575a..8ecf9733 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,7 +62,8 @@ parking_lot = "0.12.5" paste = "1.0.15" percent-encoding = "2.3.2" rand = { version = "0.10.1", default-features = false, features = [ "std", "sys_rng" ] } -ratatui = { version = "0.30.1", default-features = false, features = [ "std", "layout-cache", "serde", "underline-color", "unstable-rendered-line-info", "unstable-widget-ref" ] } +ratatui-core = { version = "0.1.1", default-features = false, features = [ "std", "layout-cache", "serde", "underline-color" ] } +ratatui-widgets = { version = "0.3.1", default-features = false, features = [ "std", "unstable-rendered-line-info" ] } regex = "1.12.4" russh = { version = "0.61.2", default-features = false, features = [ "ring", "rsa" ] } scopeguard = "1.2.0" @@ -94,6 +95,5 @@ unit_arg = "allow" use_self = "warn" [patch.crates-io] -ratatui = { git = "https://github.com/yazi-rs/ratatui.git", package = "ratatui", rev = "a1c4922a242861d755163ae85d7e41b85ed277d2" } ratatui-core = { git = "https://github.com/yazi-rs/ratatui.git", package = "ratatui-core", rev = "a1c4922a242861d755163ae85d7e41b85ed277d2" } ratatui-widgets = { git = "https://github.com/yazi-rs/ratatui.git", package = "ratatui-widgets", rev = "a1c4922a242861d755163ae85d7e41b85ed277d2" } diff --git a/nix/yazi-unwrapped.nix b/nix/yazi-unwrapped.nix index 6bd05cbc..461685ec 100644 --- a/nix/yazi-unwrapped.nix +++ b/nix/yazi-unwrapped.nix @@ -29,7 +29,8 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoLock = { lockFile = "${src}/Cargo.lock"; outputHashes = { - "ratatui-0.30.1" = "sha256-wkEOgwAhW0ObtPDlJmOOoY5qf9c/P79ktN4b43jtcGw="; + "ratatui-core-0.1.1" = "sha256-wkEOgwAhW0ObtPDlJmOOoY5qf9c/P79ktN4b43jtcGw="; + "ratatui-widgets-0.3.1" = "sha256-wkEOgwAhW0ObtPDlJmOOoY5qf9c/P79ktN4b43jtcGw="; }; }; diff --git a/yazi-actor/Cargo.toml b/yazi-actor/Cargo.toml index e39c009f..f919778a 100644 --- a/yazi-actor/Cargo.toml +++ b/yazi-actor/Cargo.toml @@ -40,19 +40,20 @@ yazi-watcher = { path = "../yazi-watcher", version = "26.5.6" } yazi-widgets = { path = "../yazi-widgets", version = "26.5.6" } # External dependencies -anyhow = { workspace = true } -either = { workspace = true } -futures = { workspace = true } -hashbrown = { workspace = true } -indexmap = { workspace = true } -mlua = { workspace = true } -parking_lot = { workspace = true } -paste = { workspace = true } -ratatui = { workspace = true } -scopeguard = { workspace = true } -tokio = { workspace = true } -tokio-stream = { workspace = true } -tracing = { workspace = true } +anyhow = { workspace = true } +either = { workspace = true } +futures = { workspace = true } +hashbrown = { workspace = true } +indexmap = { workspace = true } +mlua = { workspace = true } +parking_lot = { workspace = true } +paste = { workspace = true } +ratatui-core = { workspace = true } +ratatui-widgets = { workspace = true } +scopeguard = { workspace = true } +tokio = { workspace = true } +tokio-stream = { workspace = true } +tracing = { workspace = true } [target."cfg(unix)".dependencies] libc = { workspace = true } diff --git a/yazi-actor/src/app/reflow.rs b/yazi-actor/src/app/reflow.rs index 958a1a51..cfb55e3b 100644 --- a/yazi-actor/src/app/reflow.rs +++ b/yazi-actor/src/app/reflow.rs @@ -1,6 +1,6 @@ use anyhow::Result; use mlua::Value; -use ratatui::layout::Position; +use ratatui_core::layout::Position; use tracing::error; use yazi_actor::lives::Lives; use yazi_config::LAYOUT; diff --git a/yazi-actor/src/input/show.rs b/yazi-actor/src/input/show.rs index 00517668..1c16fbf6 100644 --- a/yazi-actor/src/input/show.rs +++ b/yazi-actor/src/input/show.rs @@ -1,5 +1,5 @@ use anyhow::Result; -use ratatui::widgets::Padding; +use ratatui_widgets::block::Padding; use yazi_config::{THEME, YAZI}; use yazi_macro::{act, render, succ}; use yazi_parser::input::ShowForm; diff --git a/yazi-actor/src/notify/tick.rs b/yazi-actor/src/notify/tick.rs index 1ee7b610..6cb9b256 100644 --- a/yazi-actor/src/notify/tick.rs +++ b/yazi-actor/src/notify/tick.rs @@ -1,7 +1,7 @@ use std::time::Duration; use anyhow::Result; -use ratatui::layout::Rect; +use ratatui_core::layout::Rect; use yazi_core::notify::Notify; use yazi_macro::{render, render_partial, succ}; use yazi_parser::notify::TickForm; diff --git a/yazi-adapter/Cargo.toml b/yazi-adapter/Cargo.toml index db923d82..886c0128 100644 --- a/yazi-adapter/Cargo.toml +++ b/yazi-adapter/Cargo.toml @@ -23,15 +23,15 @@ yazi-tty = { path = "../yazi-tty", version = "26.5.9" } yazi-widgets = { path = "../yazi-widgets", version = "26.5.6" } # External dependencies -ansi-to-tui = { workspace = true } -anyhow = { workspace = true } -base64 = { workspace = true } -image = { workspace = true } -inventory = { workspace = true } -moxcms = "0.8.1" -palette = { version = "0.7.6", default-features = false } -quantette = { version = "0.6.0", default-features = false } -ratatui = { workspace = true } -strum = { workspace = true } -tokio = { workspace = true } -tracing = { workspace = true } +ansi-to-tui = { workspace = true } +anyhow = { workspace = true } +base64 = { workspace = true } +image = { workspace = true } +inventory = { workspace = true } +moxcms = "0.8.1" +palette = { version = "0.7.6", default-features = false } +quantette = { version = "0.6.0", default-features = false } +ratatui-core = { workspace = true } +strum = { workspace = true } +tokio = { workspace = true } +tracing = { workspace = true } diff --git a/yazi-adapter/src/adapter.rs b/yazi-adapter/src/adapter.rs index 72953de4..b44a6e9a 100644 --- a/yazi-adapter/src/adapter.rs +++ b/yazi-adapter/src/adapter.rs @@ -1,7 +1,7 @@ use std::{fmt::{self, Debug}, ops::Deref}; use anyhow::Result; -use ratatui::layout::Rect; +use ratatui_core::layout::Rect; use yazi_emulator::EMULATOR; use yazi_shim::cell::SyncCell; use yazi_widgets::clear::ClearInventory; diff --git a/yazi-adapter/src/drivers/chafa.rs b/yazi-adapter/src/drivers/chafa.rs index 2bdbf445..c326595a 100644 --- a/yazi-adapter/src/drivers/chafa.rs +++ b/yazi-adapter/src/drivers/chafa.rs @@ -2,7 +2,7 @@ use std::{io::Write, path::PathBuf, process::Stdio}; use ansi_to_tui::IntoText; use anyhow::{Result, anyhow, bail}; -use ratatui::layout::Rect; +use ratatui_core::layout::Rect; use tokio::process::Command; use yazi_config::THEME; use yazi_emulator::Emulator; diff --git a/yazi-adapter/src/drivers/driver.rs b/yazi-adapter/src/drivers/driver.rs index 3764b1fb..e8660919 100644 --- a/yazi-adapter/src/drivers/driver.rs +++ b/yazi-adapter/src/drivers/driver.rs @@ -1,7 +1,7 @@ use std::path::PathBuf; use anyhow::Result; -use ratatui::layout::Rect; +use ratatui_core::layout::Rect; use strum::{Display, IntoStaticStr}; use crate::drivers::{Chafa, Iip, Kgp, KgpOld, Sixel, Ueberzug}; diff --git a/yazi-adapter/src/drivers/iip.rs b/yazi-adapter/src/drivers/iip.rs index 7968f4dd..8e03b5fa 100644 --- a/yazi-adapter/src/drivers/iip.rs +++ b/yazi-adapter/src/drivers/iip.rs @@ -3,7 +3,7 @@ use std::{fmt::Write as _, io::Write as _, path::PathBuf}; use anyhow::Result; use base64::{Engine, engine::{Config, general_purpose::STANDARD}}; use image::{DynamicImage, ExtendedColorType, ImageEncoder, codecs::{jpeg::JpegEncoder, png::PngEncoder}}; -use ratatui::layout::Rect; +use ratatui_core::layout::Rect; use yazi_config::{THEME, YAZI}; use yazi_emulator::{CLOSE, Emulator, START}; use yazi_tty::sequence::{MoveTo, ResetAttrs, SetBg}; diff --git a/yazi-adapter/src/drivers/kgp.rs b/yazi-adapter/src/drivers/kgp.rs index 1a38d8d3..dfeedbc8 100644 --- a/yazi-adapter/src/drivers/kgp.rs +++ b/yazi-adapter/src/drivers/kgp.rs @@ -4,7 +4,7 @@ use std::{io::Write, path::PathBuf}; use anyhow::Result; use base64::{Engine, engine::general_purpose}; use image::DynamicImage; -use ratatui::{layout::Rect, style::Color}; +use ratatui_core::{layout::Rect, style::Color}; use yazi_config::THEME; use yazi_emulator::{CLOSE, ESCAPE, Emulator, START}; use yazi_shim::cell::SyncCell; diff --git a/yazi-adapter/src/drivers/kgp_old.rs b/yazi-adapter/src/drivers/kgp_old.rs index 59842c10..1910703b 100644 --- a/yazi-adapter/src/drivers/kgp_old.rs +++ b/yazi-adapter/src/drivers/kgp_old.rs @@ -4,7 +4,7 @@ use std::{io::Write, path::PathBuf}; use anyhow::Result; use base64::{Engine, engine::general_purpose}; use image::DynamicImage; -use ratatui::layout::Rect; +use ratatui_core::layout::Rect; use yazi_emulator::{CLOSE, ESCAPE, Emulator, START}; use yazi_tty::TTY; diff --git a/yazi-adapter/src/drivers/sixel.rs b/yazi-adapter/src/drivers/sixel.rs index f06994ef..e019bf36 100644 --- a/yazi-adapter/src/drivers/sixel.rs +++ b/yazi-adapter/src/drivers/sixel.rs @@ -4,7 +4,7 @@ use anyhow::{Result, bail}; use image::{DynamicImage, GenericImageView, RgbImage}; use palette::{Srgb, cast::ComponentsAs}; use quantette::{PaletteSize, color_map::IndexedColorMap, wu::{BinnerU8x3, WuU8x3}}; -use ratatui::layout::Rect; +use ratatui_core::layout::Rect; use yazi_config::THEME; use yazi_emulator::{CLOSE, ESCAPE, Emulator, START}; use yazi_tty::sequence::{MoveTo, ResetAttrs, SetBg}; diff --git a/yazi-adapter/src/drivers/ueberzug.rs b/yazi-adapter/src/drivers/ueberzug.rs index 8e2dc9e0..ba6f5009 100644 --- a/yazi-adapter/src/drivers/ueberzug.rs +++ b/yazi-adapter/src/drivers/ueberzug.rs @@ -2,7 +2,7 @@ use std::{path::PathBuf, process::Stdio}; use anyhow::{Result, bail}; use image::ImageReader; -use ratatui::layout::Rect; +use ratatui_core::layout::Rect; use tokio::{io::AsyncWriteExt, process::{Child, Command}, sync::mpsc::{self, UnboundedSender}}; use tracing::{debug, warn}; use yazi_config::YAZI; diff --git a/yazi-adapter/src/image.rs b/yazi-adapter/src/image.rs index 84355b19..5afeff56 100644 --- a/yazi-adapter/src/image.rs +++ b/yazi-adapter/src/image.rs @@ -2,7 +2,7 @@ use std::path::{Path, PathBuf}; use anyhow::Result; use image::{DynamicImage, ImageDecoder, ImageError, ImageReader, Limits, codecs::{jpeg::JpegEncoder, png::PngEncoder}, imageops::FilterType, metadata::Orientation}; -use ratatui::layout::Rect; +use ratatui_core::layout::Rect; use yazi_config::YAZI; use yazi_emulator::Dimension; use yazi_fs::provider::{Provider, local::Local}; diff --git a/yazi-binding/Cargo.toml b/yazi-binding/Cargo.toml index b21d4278..77cdc3c5 100644 --- a/yazi-binding/Cargo.toml +++ b/yazi-binding/Cargo.toml @@ -22,21 +22,19 @@ yazi-macro = { path = "../yazi-macro", version = "26.5.6" } yazi-shim = { path = "../yazi-shim", version = "26.5.6" } # External dependencies -ansi-to-tui = { workspace = true } -anyhow = { workspace = true } -futures = { workspace = true } -hashbrown = { workspace = true } -image = { workspace = true } -inventory = { workspace = true } -mlua = { workspace = true } -ordered-float = { workspace = true } -ratatui = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } -strum = { workspace = true } -tokio = { workspace = true } -tracing = { workspace = true } -unicode-width = { workspace = true } +ansi-to-tui = { workspace = true } +anyhow = { workspace = true } +futures = { workspace = true } +hashbrown = { workspace = true } +image = { workspace = true } +mlua = { workspace = true } +ratatui-core = { workspace = true } +ratatui-widgets = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +strum = { workspace = true } +tokio = { workspace = true } +unicode-width = { workspace = true } [target.'cfg(unix)'.dependencies] libc = { workspace = true } diff --git a/yazi-binding/src/elements/align.rs b/yazi-binding/src/elements/align.rs index 564cfa70..5d4a2a18 100644 --- a/yazi-binding/src/elements/align.rs +++ b/yazi-binding/src/elements/align.rs @@ -3,10 +3,10 @@ use std::ops::Deref; use mlua::{FromLua, IntoLua, Lua, Value}; #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] -pub struct Align(pub(super) ratatui::layout::Alignment); +pub struct Align(pub(super) ratatui_core::layout::Alignment); impl Deref for Align { - type Target = ratatui::layout::Alignment; + type Target = ratatui_core::layout::Alignment; fn deref(&self) -> &Self::Target { &self.0 } } @@ -27,9 +27,9 @@ impl FromLua for Align { }); }; Ok(Self(match n { - 0 => ratatui::layout::Alignment::Left, - 1 => ratatui::layout::Alignment::Center, - 2 => ratatui::layout::Alignment::Right, + 0 => ratatui_core::layout::Alignment::Left, + 1 => ratatui_core::layout::Alignment::Center, + 2 => ratatui_core::layout::Alignment::Right, _ => Err(mlua::Error::FromLuaConversionError { from: value.type_name(), to: "Align".to_string(), diff --git a/yazi-binding/src/elements/area.rs b/yazi-binding/src/elements/area.rs index 1f3e8d4f..62fed8dd 100644 --- a/yazi-binding/src/elements/area.rs +++ b/yazi-binding/src/elements/area.rs @@ -27,14 +27,14 @@ impl Debug for Area { } impl Area { - pub fn size(self) -> ratatui::layout::Size { + pub fn size(self) -> ratatui_core::layout::Size { match self { Self::Rect(rect) => (*rect).into(), - Self::Pos(pos) => ratatui::layout::Size { width: pos.width, height: pos.height }, + Self::Pos(pos) => ratatui_core::layout::Size { width: pos.width, height: pos.height }, } } - pub fn inner(self, padding: ratatui::widgets::Padding) -> Self { + pub fn inner(self, padding: ratatui_widgets::block::Padding) -> Self { match self { Self::Rect(rect) => Self::Rect(rect.pad(padding.into())), Self::Pos(mut pos) => { @@ -46,8 +46,8 @@ impl Area { pub fn transform( self, - f: impl FnOnce(Position) -> ratatui::layout::Rect, - ) -> ratatui::layout::Rect { + f: impl FnOnce(Position) -> ratatui_core::layout::Rect, + ) -> ratatui_core::layout::Rect { match self { Self::Rect(rect) => *rect, Self::Pos(pos) => *Rect(f(*pos)).pad(pos.pad), @@ -59,8 +59,8 @@ impl From for Area { fn from(rect: Rect) -> Self { Self::Rect(rect) } } -impl From for Area { - fn from(rect: ratatui::layout::Rect) -> Self { Self::Rect(rect.into()) } +impl From for Area { + fn from(rect: ratatui_core::layout::Rect) -> Self { Self::Rect(rect.into()) } } impl From for Area { diff --git a/yazi-binding/src/elements/bar.rs b/yazi-binding/src/elements/bar.rs index 61ed138c..e260747c 100644 --- a/yazi-binding/src/elements/bar.rs +++ b/yazi-binding/src/elements/bar.rs @@ -1,5 +1,6 @@ use mlua::{AnyUserData, IntoLua, Lua, MetaMethod, Table, UserData, UserDataMethods, Value}; -use ratatui::widgets::{Borders, Widget}; +use ratatui_core::widgets::Widget; +use ratatui_widgets::borders::Borders; use super::{Area, Edge}; use crate::elements::Spatial; @@ -10,7 +11,7 @@ pub struct Bar { edge: Edge, symbol: String, - style: ratatui::style::Style, + style: ratatui_core::style::Style, } impl Bar { @@ -37,7 +38,7 @@ impl Spatial for Bar { } impl Widget for &Bar { - fn render(self, rect: ratatui::layout::Rect, buf: &mut ratatui::buffer::Buffer) + fn render(self, rect: ratatui_core::layout::Rect, buf: &mut ratatui_core::buffer::Buffer) where Self: Sized, { diff --git a/yazi-binding/src/elements/border.rs b/yazi-binding/src/elements/border.rs index 8c7956ba..cbb76a2f 100644 --- a/yazi-binding/src/elements/border.rs +++ b/yazi-binding/src/elements/border.rs @@ -1,5 +1,6 @@ use mlua::{AnyUserData, IntoLua, Lua, MetaMethod, Table, UserData, UserDataMethods, Value}; -use ratatui::widgets::{Borders, Widget}; +use ratatui_core::widgets::Widget; +use ratatui_widgets::borders::Borders; use super::{Area, Edge}; use crate::elements::{Line, Spatial}; @@ -17,17 +18,17 @@ pub struct Border { pub area: Area, pub edge: Edge, - pub r#type: ratatui::widgets::BorderType, - pub style: ratatui::style::Style, - pub merge: ratatui::symbols::merge::MergeStrategy, + pub r#type: ratatui_widgets::borders::BorderType, + pub style: ratatui_core::style::Style, + pub merge: ratatui_core::symbols::merge::MergeStrategy, - pub titles: Vec<(ratatui::widgets::TitlePosition, ratatui::text::Line<'static>)>, + pub titles: Vec<(ratatui_widgets::block::TitlePosition, ratatui_core::text::Line<'static>)>, } impl Border { pub fn compose(lua: &Lua) -> mlua::Result { let new = lua.create_function(|_, (_, edge): (Table, Edge)| { - Ok(Self { edge, r#type: ratatui::widgets::BorderType::Rounded, ..Default::default() }) + Ok(Self { edge, r#type: ratatui_widgets::borders::BorderType::Rounded, ..Default::default() }) })?; let border = lua.create_table_from([ @@ -58,11 +59,11 @@ impl Spatial for Border { } impl Widget for Border { - fn render(self, rect: ratatui::layout::Rect, buf: &mut ratatui::buffer::Buffer) + fn render(self, rect: ratatui_core::layout::Rect, buf: &mut ratatui_core::buffer::Buffer) where Self: Sized, { - let mut block = ratatui::widgets::Block::default() + let mut block = ratatui_widgets::block::Block::default() .borders(self.edge.0) .border_type(self.r#type) .border_style(self.style) @@ -70,8 +71,8 @@ impl Widget for Border { for title in self.titles { block = match title { - (ratatui::widgets::TitlePosition::Top, line) => block.title_top(line), - (ratatui::widgets::TitlePosition::Bottom, line) => block.title_bottom(line), + (ratatui_widgets::block::TitlePosition::Top, line) => block.title_top(line), + (ratatui_widgets::block::TitlePosition::Bottom, line) => block.title_bottom(line), }; } @@ -80,7 +81,7 @@ impl Widget for Border { } impl Widget for &Border { - fn render(self, rect: ratatui::layout::Rect, buf: &mut ratatui::buffer::Buffer) + fn render(self, rect: ratatui_core::layout::Rect, buf: &mut ratatui_core::buffer::Buffer) where Self: Sized, { @@ -95,20 +96,20 @@ impl UserData for Border { methods.add_function("type", |_, (ud, value): (AnyUserData, u8)| { ud.borrow_mut::()?.r#type = match value { - ROUNDED => ratatui::widgets::BorderType::Rounded, - DOUBLE => ratatui::widgets::BorderType::Double, - THICK => ratatui::widgets::BorderType::Thick, - QUADRANT_INSIDE => ratatui::widgets::BorderType::QuadrantInside, - QUADRANT_OUTSIDE => ratatui::widgets::BorderType::QuadrantOutside, - _ => ratatui::widgets::BorderType::Plain, + ROUNDED => ratatui_widgets::borders::BorderType::Rounded, + DOUBLE => ratatui_widgets::borders::BorderType::Double, + THICK => ratatui_widgets::borders::BorderType::Thick, + QUADRANT_INSIDE => ratatui_widgets::borders::BorderType::QuadrantInside, + QUADRANT_OUTSIDE => ratatui_widgets::borders::BorderType::QuadrantOutside, + _ => ratatui_widgets::borders::BorderType::Plain, }; Ok(ud) }); methods.add_function("title", |_, (ud, line, position): (AnyUserData, Line, Option)| { let position = if position == Some(Borders::BOTTOM.bits()) { - ratatui::widgets::TitlePosition::Bottom + ratatui_widgets::block::TitlePosition::Bottom } else { - ratatui::widgets::TitlePosition::Top + ratatui_widgets::block::TitlePosition::Top }; ud.borrow_mut::()?.titles.push((position, line.inner)); @@ -120,9 +121,9 @@ impl UserData for Border { }); methods.add_function("merge", |_, (ud, exact): (AnyUserData, bool)| { ud.borrow_mut::()?.merge = if exact { - ratatui::symbols::merge::MergeStrategy::Exact + ratatui_core::symbols::merge::MergeStrategy::Exact } else { - ratatui::symbols::merge::MergeStrategy::Fuzzy + ratatui_core::symbols::merge::MergeStrategy::Fuzzy }; Ok(ud) }); diff --git a/yazi-binding/src/elements/cell.rs b/yazi-binding/src/elements/cell.rs index 3b31b907..a75805ac 100644 --- a/yazi-binding/src/elements/cell.rs +++ b/yazi-binding/src/elements/cell.rs @@ -4,10 +4,10 @@ use super::Text; #[derive(Clone, Debug)] pub struct Cell { - pub(super) text: ratatui::text::Text<'static>, + pub(super) text: ratatui_core::text::Text<'static>, } -impl From for ratatui::widgets::Cell<'static> { +impl From for ratatui_widgets::table::Cell<'static> { fn from(value: Cell) -> Self { Self::new(value.text) } } diff --git a/yazi-binding/src/elements/color.rs b/yazi-binding/src/elements/color.rs index cbd0eedd..a7bf7926 100644 --- a/yazi-binding/src/elements/color.rs +++ b/yazi-binding/src/elements/color.rs @@ -3,7 +3,7 @@ use std::str::FromStr; use mlua::{AnyUserData, ExternalError, ExternalResult, FromLua, IntoLua, Lua, MetaMethod, Table, UserData, Value}; #[derive(Clone, Copy, Default)] -pub struct Color(pub ratatui::style::Color); +pub struct Color(pub ratatui_core::style::Color); impl Color { pub fn compose(lua: &Lua) -> mlua::Result { @@ -25,8 +25,8 @@ impl TryFrom<&AnyUserData> for Color { impl FromLua for Color { fn from_lua(value: Value, _: &Lua) -> mlua::Result { Ok(Self(match value { - Value::Nil => ratatui::style::Color::Reset, - Value::String(s) => ratatui::style::Color::from_str(&s.to_str()?).into_lua_err()?, + Value::Nil => ratatui_core::style::Color::Reset, + Value::String(s) => ratatui_core::style::Color::from_str(&s.to_str()?).into_lua_err()?, Value::UserData(ud) => return Self::try_from(&ud), _ => Err("expected a Color".into_lua_err())?, })) diff --git a/yazi-binding/src/elements/constraint.rs b/yazi-binding/src/elements/constraint.rs index c2ecad07..82fe300c 100644 --- a/yazi-binding/src/elements/constraint.rs +++ b/yazi-binding/src/elements/constraint.rs @@ -1,11 +1,11 @@ use mlua::{FromLua, IntoLua, Lua, UserData, Value}; #[derive(Clone, Copy, Default, FromLua)] -pub struct Constraint(pub(super) ratatui::layout::Constraint); +pub struct Constraint(pub(super) ratatui_core::layout::Constraint); impl Constraint { pub fn compose(lua: &Lua) -> mlua::Result { - use ratatui::layout::Constraint as C; + use ratatui_core::layout::Constraint as C; lua .create_table_from([ @@ -20,7 +20,7 @@ impl Constraint { } } -impl From for ratatui::layout::Constraint { +impl From for ratatui_core::layout::Constraint { fn from(value: Constraint) -> Self { value.0 } } diff --git a/yazi-binding/src/elements/edge.rs b/yazi-binding/src/elements/edge.rs index a239ae60..f0b6bcf3 100644 --- a/yazi-binding/src/elements/edge.rs +++ b/yazi-binding/src/elements/edge.rs @@ -1,7 +1,7 @@ use std::ops::Deref; use mlua::{FromLua, IntoLua, Lua, Value}; -use ratatui::widgets::Borders; +use ratatui_widgets::borders::Borders; #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] pub struct Edge(pub Borders); diff --git a/yazi-binding/src/elements/fill.rs b/yazi-binding/src/elements/fill.rs index 00881bdf..2ce66918 100644 --- a/yazi-binding/src/elements/fill.rs +++ b/yazi-binding/src/elements/fill.rs @@ -1,5 +1,5 @@ use mlua::{AnyUserData, IntoLua, Lua, MetaMethod, Table, UserData, UserDataMethods, Value}; -use ratatui::widgets::Widget; +use ratatui_core::widgets::Widget; use super::Area; use crate::elements::Spatial; @@ -8,7 +8,7 @@ use crate::elements::Spatial; pub struct Fill { area: Area, - style: ratatui::style::Style, + style: ratatui_core::style::Style, } impl Fill { @@ -36,7 +36,7 @@ impl Spatial for Fill { } impl Widget for &Fill { - fn render(self, rect: ratatui::layout::Rect, buf: &mut ratatui::buffer::Buffer) + fn render(self, rect: ratatui_core::layout::Rect, buf: &mut ratatui_core::buffer::Buffer) where Self: Sized, { diff --git a/yazi-binding/src/elements/gauge.rs b/yazi-binding/src/elements/gauge.rs index 250317f7..9c411748 100644 --- a/yazi-binding/src/elements/gauge.rs +++ b/yazi-binding/src/elements/gauge.rs @@ -1,5 +1,5 @@ use mlua::{AnyUserData, ExternalError, IntoLua, Lua, MetaMethod, Table, UserData, UserDataMethods, Value}; -use ratatui::widgets::Widget; +use ratatui_core::widgets::Widget; use super::{Area, Span}; use crate::{elements::Spatial, style::Style}; @@ -9,9 +9,9 @@ pub struct Gauge { area: Area, ratio: f64, - label: Option>, - style: ratatui::style::Style, - gauge_style: ratatui::style::Style, + label: Option>, + style: ratatui_core::style::Style, + gauge_style: ratatui_core::style::Style, } impl Gauge { @@ -38,11 +38,11 @@ impl Spatial for Gauge { } impl Widget for Gauge { - fn render(self, rect: ratatui::layout::Rect, buf: &mut ratatui::buffer::Buffer) + fn render(self, rect: ratatui_core::layout::Rect, buf: &mut ratatui_core::buffer::Buffer) where Self: Sized, { - let mut gauge = ratatui::widgets::Gauge::default() + let mut gauge = ratatui_widgets::gauge::Gauge::default() .ratio(self.ratio) .style(self.style) .gauge_style(self.gauge_style); @@ -56,7 +56,7 @@ impl Widget for Gauge { } impl Widget for &Gauge { - fn render(self, rect: ratatui::layout::Rect, buf: &mut ratatui::buffer::Buffer) + fn render(self, rect: ratatui_core::layout::Rect, buf: &mut ratatui_core::buffer::Buffer) where Self: Sized, { diff --git a/yazi-binding/src/elements/layout.rs b/yazi-binding/src/elements/layout.rs index bf499894..eca8187c 100644 --- a/yazi-binding/src/elements/layout.rs +++ b/yazi-binding/src/elements/layout.rs @@ -8,8 +8,8 @@ const VERTICAL: bool = false; #[derive(Clone, Default)] pub struct Layout { direction: bool, - margin: Option, - constraints: Vec, + margin: Option, + constraints: Vec, } impl Layout { @@ -30,7 +30,7 @@ impl UserData for Layout { Ok(ud) }); methods.add_function("margin", |_, (ud, value): (AnyUserData, u16)| { - ud.borrow_mut::()?.margin = Some(ratatui::layout::Margin::new(value, value)); + ud.borrow_mut::()?.margin = Some(ratatui_core::layout::Margin::new(value, value)); Ok(ud) }); methods.add_function("margin_h", |_, (ud, value): (AnyUserData, u16)| { @@ -39,7 +39,7 @@ impl UserData for Layout { if let Some(margin) = &mut me.margin { margin.horizontal = value; } else { - me.margin = Some(ratatui::layout::Margin::new(value, 0)); + me.margin = Some(ratatui_core::layout::Margin::new(value, 0)); } } Ok(ud) @@ -50,7 +50,7 @@ impl UserData for Layout { if let Some(margin) = &mut me.margin { margin.vertical = value; } else { - me.margin = Some(ratatui::layout::Margin::new(0, value)); + me.margin = Some(ratatui_core::layout::Margin::new(0, value)); } } Ok(ud) @@ -60,11 +60,11 @@ impl UserData for Layout { Ok(ud) }); methods.add_method("split", |lua, me, value: Rect| { - let mut layout = ratatui::layout::Layout::new( + let mut layout = ratatui_core::layout::Layout::new( if me.direction == VERTICAL { - ratatui::layout::Direction::Vertical + ratatui_core::layout::Direction::Vertical } else { - ratatui::layout::Direction::Horizontal + ratatui_core::layout::Direction::Horizontal }, &me.constraints, ); diff --git a/yazi-binding/src/elements/line.rs b/yazi-binding/src/elements/line.rs index 93180363..4bcc6048 100644 --- a/yazi-binding/src/elements/line.rs +++ b/yazi-binding/src/elements/line.rs @@ -2,7 +2,7 @@ use std::{borrow::Cow, mem, ops::{Deref, DerefMut}}; use ansi_to_tui::IntoText; use mlua::{AnyUserData, ExternalError, ExternalResult, FromLua, Function, IntoLua, Lua, MetaMethod, Table, UserData, UserDataMethods, Value}; -use ratatui::widgets::Widget; +use ratatui_core::widgets::Widget; use unicode_width::UnicodeWidthChar; use super::{Area, Span}; @@ -14,11 +14,11 @@ const EXPECTED: &str = "expected a string, Span, Line, or a table of them"; pub struct Line { area: Area, - pub(super) inner: ratatui::text::Line<'static>, + pub(super) inner: ratatui_core::text::Line<'static>, } impl Deref for Line { - type Target = ratatui::text::Line<'static>; + type Target = ratatui_core::text::Line<'static>; fn deref(&self) -> &Self::Target { &self.inner } } @@ -51,8 +51,8 @@ impl Line { } } -impl From> for Line { - fn from(value: ratatui::text::Line<'static>) -> Self { +impl From> for Line { + fn from(value: ratatui_core::text::Line<'static>) -> Self { Self { inner: value, ..Default::default() } } } @@ -96,7 +96,7 @@ impl TryFrom for Line { } } -impl From for ratatui::text::Line<'static> { +impl From for ratatui_core::text::Line<'static> { fn from(value: Line) -> Self { value.inner } } @@ -107,7 +107,7 @@ impl Spatial for Line { } impl Widget for &Line { - fn render(self, rect: ratatui::layout::Rect, buf: &mut ratatui::buffer::Buffer) + fn render(self, rect: ratatui_core::layout::Rect, buf: &mut ratatui_core::buffer::Buffer) where Self: Sized, { @@ -157,7 +157,7 @@ impl UserData for Line { } let ellipsis = match t.raw_get::("ellipsis")? { - Value::Nil => (1, ratatui::text::Span::raw("…")), + Value::Nil => (1, ratatui_core::text::Span::raw("…")), v => { let mut span = Span::from_lua(v, lua)?; (span.truncate(max), span.0) diff --git a/yazi-binding/src/elements/list.rs b/yazi-binding/src/elements/list.rs index 5dba2f0d..a4480d77 100644 --- a/yazi-binding/src/elements/list.rs +++ b/yazi-binding/src/elements/list.rs @@ -1,5 +1,5 @@ use mlua::{AnyUserData, IntoLua, Lua, MetaMethod, Table, UserData, UserDataMethods, Value}; -use ratatui::widgets::Widget; +use ratatui_core::widgets::Widget; use super::{Area, Text}; use crate::elements::Spatial; @@ -9,13 +9,13 @@ use crate::elements::Spatial; pub struct List { area: Area, - inner: ratatui::widgets::List<'static>, + inner: ratatui_widgets::list::List<'static>, } impl List { pub fn compose(lua: &Lua) -> mlua::Result { let new = lua.create_function(|_, (_, items): (Table, Vec)| { - Ok(Self { inner: ratatui::widgets::List::new(items), ..Default::default() }) + Ok(Self { inner: ratatui_widgets::list::List::new(items), ..Default::default() }) })?; let list = lua.create_table()?; @@ -38,7 +38,7 @@ impl Spatial for List { } impl Widget for &List { - fn render(self, rect: ratatui::layout::Rect, buf: &mut ratatui::buffer::Buffer) + fn render(self, rect: ratatui_core::layout::Rect, buf: &mut ratatui_core::buffer::Buffer) where Self: Sized, { diff --git a/yazi-binding/src/elements/pad.rs b/yazi-binding/src/elements/pad.rs index c7eb25b4..c2e53070 100644 --- a/yazi-binding/src/elements/pad.rs +++ b/yazi-binding/src/elements/pad.rs @@ -3,46 +3,64 @@ use std::ops::{Add, AddAssign, Deref}; use mlua::{FromLua, IntoLua, Lua, MetaMethod, Table, UserData, UserDataFields, Value}; #[derive(Clone, Copy, Default, FromLua)] -pub struct Pad(ratatui::widgets::Padding); +pub struct Pad(ratatui_widgets::block::Padding); impl Deref for Pad { - type Target = ratatui::widgets::Padding; + type Target = ratatui_widgets::block::Padding; fn deref(&self) -> &Self::Target { &self.0 } } -impl From for Pad { - fn from(pad: ratatui::widgets::Padding) -> Self { Self(pad) } +impl From for Pad { + fn from(pad: ratatui_widgets::block::Padding) -> Self { Self(pad) } } impl Pad { pub fn compose(lua: &Lua) -> mlua::Result { let new = lua.create_function(|_, (_, top, right, bottom, left): (Table, u16, u16, u16, u16)| { - Ok(Self(ratatui::widgets::Padding::new(left, right, top, bottom))) + Ok(Self(ratatui_widgets::block::Padding::new(left, right, top, bottom))) })?; let pad = lua.create_table_from([ ( "left", - lua.create_function(|_, left: u16| Ok(Self(ratatui::widgets::Padding::left(left))))?, + lua + .create_function(|_, left: u16| Ok(Self(ratatui_widgets::block::Padding::left(left))))?, ), ( "right", - lua.create_function(|_, right: u16| Ok(Self(ratatui::widgets::Padding::right(right))))?, + lua.create_function(|_, right: u16| { + Ok(Self(ratatui_widgets::block::Padding::right(right))) + })?, + ), + ( + "top", + lua.create_function(|_, top: u16| Ok(Self(ratatui_widgets::block::Padding::top(top))))?, ), - ("top", lua.create_function(|_, top: u16| Ok(Self(ratatui::widgets::Padding::top(top))))?), ( "bottom", - lua - .create_function(|_, bottom: u16| Ok(Self(ratatui::widgets::Padding::bottom(bottom))))?, + lua.create_function(|_, bottom: u16| { + Ok(Self(ratatui_widgets::block::Padding::bottom(bottom))) + })?, + ), + ( + "x", + lua.create_function(|_, x: u16| { + Ok(Self(ratatui_widgets::block::Padding::new(x, x, 0, 0))) + })?, + ), + ( + "y", + lua.create_function(|_, y: u16| { + Ok(Self(ratatui_widgets::block::Padding::new(0, 0, y, y))) + })?, ), - ("x", lua.create_function(|_, x: u16| Ok(Self(ratatui::widgets::Padding::new(x, x, 0, 0))))?), - ("y", lua.create_function(|_, y: u16| Ok(Self(ratatui::widgets::Padding::new(0, 0, y, y))))?), ( "xy", - lua - .create_function(|_, xy: u16| Ok(Self(ratatui::widgets::Padding::new(xy, xy, xy, xy))))?, + lua.create_function(|_, xy: u16| { + Ok(Self(ratatui_widgets::block::Padding::new(xy, xy, xy, xy))) + })?, ), ])?; @@ -60,11 +78,11 @@ impl UserData for Pad { } } -impl Add for Pad { +impl Add for Pad { type Output = Self; - fn add(self, rhs: ratatui::widgets::Padding) -> Self::Output { - Self(ratatui::widgets::Padding::new( + fn add(self, rhs: ratatui_widgets::block::Padding) -> Self::Output { + Self(ratatui_widgets::block::Padding::new( self.left.saturating_add(rhs.left), self.right.saturating_add(rhs.right), self.top.saturating_add(rhs.top), @@ -73,6 +91,6 @@ impl Add for Pad { } } -impl AddAssign for Pad { - fn add_assign(&mut self, rhs: ratatui::widgets::Padding) { *self = *self + rhs; } +impl AddAssign for Pad { + fn add_assign(&mut self, rhs: ratatui_widgets::block::Padding) { *self = *self + rhs; } } diff --git a/yazi-binding/src/elements/rect.rs b/yazi-binding/src/elements/rect.rs index 6c21d678..8d48516c 100644 --- a/yazi-binding/src/elements/rect.rs +++ b/yazi-binding/src/elements/rect.rs @@ -5,28 +5,33 @@ use mlua::{FromLua, IntoLua, Lua, MetaMethod, Table, UserData, UserDataFields, U use super::Pad; #[derive(Clone, Copy, Debug, Default, FromLua)] -pub struct Rect(pub ratatui::layout::Rect); +pub struct Rect(pub ratatui_core::layout::Rect); impl Deref for Rect { - type Target = ratatui::layout::Rect; + type Target = ratatui_core::layout::Rect; fn deref(&self) -> &Self::Target { &self.0 } } -impl From for Rect { - fn from(rect: ratatui::layout::Rect) -> Self { Self(rect) } +impl From for Rect { + fn from(rect: ratatui_core::layout::Rect) -> Self { Self(rect) } } -impl From for Rect { - fn from(size: ratatui::layout::Size) -> Self { - Self(ratatui::layout::Rect { x: 0, y: 0, width: size.width, height: size.height }) +impl From for Rect { + fn from(size: ratatui_core::layout::Size) -> Self { + Self(ratatui_core::layout::Rect { + x: 0, + y: 0, + width: size.width, + height: size.height, + }) } } impl Rect { pub fn compose(lua: &Lua) -> mlua::Result { let new = lua.create_function(|_, (_, args): (Table, Table)| { - Ok(Self(ratatui::layout::Rect { + Ok(Self(ratatui_core::layout::Rect { x: args.raw_get("x").unwrap_or_default(), y: args.raw_get("y").unwrap_or_default(), width: args.raw_get("w").unwrap_or_default(), @@ -50,7 +55,7 @@ impl Rect { } fn patch(self, t: Table) -> mlua::Result { - Ok(Self(ratatui::layout::Rect { + Ok(Self(ratatui_core::layout::Rect { x: t.raw_get::>("x")?.unwrap_or(self.x), y: t.raw_get::>("y")?.unwrap_or(self.y), width: t.raw_get::>("w")?.unwrap_or(self.width), diff --git a/yazi-binding/src/elements/row.rs b/yazi-binding/src/elements/row.rs index 9b31f5de..0d433a94 100644 --- a/yazi-binding/src/elements/row.rs +++ b/yazi-binding/src/elements/row.rs @@ -10,7 +10,7 @@ pub struct Row { height: u16, top_margin: u16, bottom_margin: u16, - style: ratatui::style::Style, + style: ratatui_core::style::Style, } impl Row { @@ -26,7 +26,7 @@ impl Row { } } -impl From for ratatui::widgets::Row<'static> { +impl From for ratatui_widgets::table::Row<'static> { fn from(value: Row) -> Self { Self::new(value.cells) .height(value.height.max(1)) diff --git a/yazi-binding/src/elements/span.rs b/yazi-binding/src/elements/span.rs index 7b53f8ce..4f57e6eb 100644 --- a/yazi-binding/src/elements/span.rs +++ b/yazi-binding/src/elements/span.rs @@ -5,10 +5,10 @@ use unicode_width::UnicodeWidthChar; const EXPECTED: &str = "expected a string or Span"; -pub struct Span(pub(super) ratatui::text::Span<'static>); +pub struct Span(pub(super) ratatui_core::text::Span<'static>); impl Deref for Span { - type Target = ratatui::text::Span<'static>; + type Target = ratatui_core::text::Span<'static>; fn deref(&self) -> &Self::Target { &self.0 } } diff --git a/yazi-binding/src/elements/table.rs b/yazi-binding/src/elements/table.rs index 6be313c4..058259d5 100644 --- a/yazi-binding/src/elements/table.rs +++ b/yazi-binding/src/elements/table.rs @@ -1,5 +1,5 @@ use mlua::{AnyUserData, IntoLua, Lua, MetaMethod, UserData, UserDataMethods, Value}; -use ratatui::widgets::{StatefulWidget, Widget}; +use ratatui_core::widgets::{StatefulWidget, Widget}; use super::{Area, Row}; use crate::{elements::{Constraint, Spatial}, style::Style}; @@ -10,23 +10,23 @@ pub struct Table { area: Area, rows: Vec, - header: Option>, - footer: Option>, - widths: Vec, + header: Option>, + footer: Option>, + widths: Vec, column_spacing: u16, - block: Option>, // TODO + block: Option>, // TODO - style: ratatui::style::Style, - row_highlight_style: ratatui::style::Style, - column_highlight_style: ratatui::style::Style, - cell_highlight_style: ratatui::style::Style, + style: ratatui_core::style::Style, + row_highlight_style: ratatui_core::style::Style, + column_highlight_style: ratatui_core::style::Style, + cell_highlight_style: ratatui_core::style::Style, - highlight_symbol: ratatui::text::Text<'static>, // TODO - highlight_spacing: ratatui::widgets::HighlightSpacing, // TODO + highlight_symbol: ratatui_core::text::Text<'static>, // TODO + highlight_spacing: ratatui_widgets::table::HighlightSpacing, // TODO - flex: ratatui::layout::Flex, + flex: ratatui_core::layout::Flex, - state: ratatui::widgets::TableState, + state: ratatui_widgets::table::TableState, } impl Table { @@ -41,7 +41,7 @@ impl Table { table.into_lua(lua) } - pub fn selected_cell(&self) -> Option<&ratatui::text::Text<'_>> { + pub fn selected_cell(&self) -> Option<&ratatui_core::text::Text<'_>> { let row = &self.rows[self.selected()?]; let col = self.state.selected_column()?; if row.cells.is_empty() { None } else { Some(&row.cells[col.min(row.cells.len() - 1)].text) } @@ -73,11 +73,11 @@ impl Spatial for Table { } impl Widget for Table { - fn render(mut self, rect: ratatui::layout::Rect, buf: &mut ratatui::buffer::Buffer) + fn render(mut self, rect: ratatui_core::layout::Rect, buf: &mut ratatui_core::buffer::Buffer) where Self: Sized, { - let mut table = ratatui::widgets::Table::new(self.rows, self.widths) + let mut table = ratatui_widgets::table::Table::new(self.rows, self.widths) .column_spacing(self.column_spacing) .style(self.style) .row_highlight_style(self.row_highlight_style) @@ -102,7 +102,7 @@ impl Widget for Table { } impl Widget for &Table { - fn render(self, rect: ratatui::layout::Rect, buf: &mut ratatui::buffer::Buffer) + fn render(self, rect: ratatui_core::layout::Rect, buf: &mut ratatui_core::buffer::Buffer) where Self: Sized, { diff --git a/yazi-binding/src/elements/text.rs b/yazi-binding/src/elements/text.rs index 8089cfbe..fa511d2d 100644 --- a/yazi-binding/src/elements/text.rs +++ b/yazi-binding/src/elements/text.rs @@ -2,7 +2,7 @@ use std::{any::TypeId, mem}; use ansi_to_tui::IntoText; use mlua::{AnyUserData, ExternalError, ExternalResult, FromLua, IntoLua, Lua, MetaMethod, Table, UserData, UserDataMethods, Value}; -use ratatui::widgets::Widget; +use ratatui_core::widgets::Widget; use yazi_shim::SStr; use super::{Area, Line, Span, Wrap}; @@ -15,9 +15,9 @@ pub struct Text { area: Area, // TODO: block - pub inner: ratatui::text::Text<'static>, + pub inner: ratatui_core::text::Text<'static>, pub wrap: Wrap, - pub scroll: ratatui::layout::Position, + pub scroll: ratatui_core::layout::Position, } impl Text { @@ -39,8 +39,8 @@ impl Text { } } -impl From> for Text { - fn from(inner: ratatui::text::Text<'static>) -> Self { Self { inner, ..Default::default() } } +impl From> for Text { + fn from(inner: ratatui_core::text::Text<'static>) -> Self { Self { inner, ..Default::default() } } } impl From for Text { @@ -68,16 +68,16 @@ impl TryFrom
for Text { } } -impl From for ratatui::text::Text<'static> { +impl From for ratatui_core::text::Text<'static> { fn from(value: Text) -> Self { value.inner } } -impl From for ratatui::widgets::Paragraph<'static> { +impl From for ratatui_widgets::paragraph::Paragraph<'static> { fn from(mut value: Text) -> Self { let align = value.inner.alignment.take(); let style = mem::take(&mut value.inner.style); - let mut p = ratatui::widgets::Paragraph::new(value.inner).style(style); + let mut p = ratatui_widgets::paragraph::Paragraph::new(value.inner).style(style); if let Some(align) = align { p = p.alignment(align); } @@ -95,27 +95,27 @@ impl Spatial for Text { } impl Widget for Text { - fn render(self, rect: ratatui::layout::Rect, buf: &mut ratatui::buffer::Buffer) + fn render(self, rect: ratatui_core::layout::Rect, buf: &mut ratatui_core::buffer::Buffer) where Self: Sized, { if self.wrap.is_none() && self.scroll == Default::default() { self.inner.render(rect, buf); } else { - ratatui::widgets::Paragraph::from(self).render(rect, buf); + ratatui_widgets::paragraph::Paragraph::from(self).render(rect, buf); } } } impl Widget for &Text { - fn render(self, rect: ratatui::layout::Rect, buf: &mut ratatui::buffer::Buffer) + fn render(self, rect: ratatui_core::layout::Rect, buf: &mut ratatui_core::buffer::Buffer) where Self: Sized, { if self.wrap.is_none() && self.scroll == Default::default() { (&self.inner).render(rect, buf); } else { - ratatui::widgets::Paragraph::from(self.clone()).render(rect, buf); + ratatui_widgets::paragraph::Paragraph::from(self.clone()).render(rect, buf); } } } @@ -162,7 +162,7 @@ impl UserData for Text { Ok(ud) }); methods.add_function("scroll", |_, (ud, x, y): (AnyUserData, u16, u16)| { - ud.borrow_mut::()?.scroll = ratatui::layout::Position { x, y }; + ud.borrow_mut::()?.scroll = ratatui_core::layout::Position { x, y }; Ok(ud) }); methods.add_method("max_width", |_, me, ()| { diff --git a/yazi-binding/src/elements/wrap.rs b/yazi-binding/src/elements/wrap.rs index cce28cb1..88a8e639 100644 --- a/yazi-binding/src/elements/wrap.rs +++ b/yazi-binding/src/elements/wrap.rs @@ -3,10 +3,10 @@ use std::ops::Deref; use mlua::{FromLua, IntoLua, Lua, Value}; #[derive(Clone, Copy, Debug, Default)] -pub struct Wrap(pub Option); +pub struct Wrap(pub Option); impl Deref for Wrap { - type Target = Option; + type Target = Option; fn deref(&self) -> &Self::Target { &self.0 } } @@ -17,12 +17,12 @@ impl Wrap { } } -impl From for Option { +impl From for Option { fn from(value: Wrap) -> Self { value.0 } } -impl From for Wrap { - fn from(value: ratatui::widgets::Wrap) -> Self { Self(Some(value)) } +impl From for Wrap { + fn from(value: ratatui_widgets::paragraph::Wrap) -> Self { Self(Some(value)) } } impl FromLua for Wrap { @@ -36,8 +36,8 @@ impl FromLua for Wrap { }; Ok(Self(match n { 0 => None, - 1 => Some(ratatui::widgets::Wrap { trim: false }), - 2 => Some(ratatui::widgets::Wrap { trim: true }), + 1 => Some(ratatui_widgets::paragraph::Wrap { trim: false }), + 2 => Some(ratatui_widgets::paragraph::Wrap { trim: true }), _ => Err(mlua::Error::FromLuaConversionError { from: value.type_name(), to: "Wrap".to_string(), @@ -51,8 +51,8 @@ impl IntoLua for Wrap { fn into_lua(self, lua: &Lua) -> mlua::Result { match self.0 { None => 0.into_lua(lua), - Some(ratatui::widgets::Wrap { trim: false }) => 1.into_lua(lua), - Some(ratatui::widgets::Wrap { trim: true }) => 2.into_lua(lua), + Some(ratatui_widgets::paragraph::Wrap { trim: false }) => 1.into_lua(lua), + Some(ratatui_widgets::paragraph::Wrap { trim: true }) => 2.into_lua(lua), } } } diff --git a/yazi-binding/src/macros.rs b/yazi-binding/src/macros.rs index 272ebf87..b2fd3ac1 100644 --- a/yazi-binding/src/macros.rs +++ b/yazi-binding/src/macros.rs @@ -79,7 +79,7 @@ macro_rules! impl_style_shorthands { $methods.add_function("fg", |lua, (ud, value): (mlua::AnyUserData, mlua::Value)| { use $crate::elements::Color; use mlua::FromLua; - use ratatui::style::Modifier; + use ratatui_core::style::Modifier; let me = &mut ud.borrow_mut::()?.$($field).+; match value { @@ -98,7 +98,7 @@ macro_rules! impl_style_shorthands { $methods.add_function("bg", |lua, (ud, value): (mlua::AnyUserData, mlua::Value)| { use $crate::elements::Color; use mlua::FromLua; - use ratatui::style::Modifier; + use ratatui_core::style::Modifier; let me = &mut ud.borrow_mut::()?.$($field).+; match value { @@ -117,86 +117,86 @@ macro_rules! impl_style_shorthands { $methods.add_function("bold", |_, (ud, remove): (mlua::AnyUserData, bool)| { let me = &mut ud.borrow_mut::()?.$($field).+; if remove { - *me = me.remove_modifier(ratatui::style::Modifier::BOLD); + *me = me.remove_modifier(ratatui_core::style::Modifier::BOLD); } else { - *me = me.add_modifier(ratatui::style::Modifier::BOLD); + *me = me.add_modifier(ratatui_core::style::Modifier::BOLD); } Ok(ud) }); $methods.add_function("dim", |_, (ud, remove): (mlua::AnyUserData, bool)| { let me = &mut ud.borrow_mut::()?.$($field).+; if remove { - *me = me.remove_modifier(ratatui::style::Modifier::DIM); + *me = me.remove_modifier(ratatui_core::style::Modifier::DIM); } else { - *me = me.add_modifier(ratatui::style::Modifier::DIM); + *me = me.add_modifier(ratatui_core::style::Modifier::DIM); } Ok(ud) }); $methods.add_function("italic", |_, (ud, remove): (mlua::AnyUserData, bool)| { let me = &mut ud.borrow_mut::()?.$($field).+; if remove { - *me = me.remove_modifier(ratatui::style::Modifier::ITALIC); + *me = me.remove_modifier(ratatui_core::style::Modifier::ITALIC); } else { - *me = me.add_modifier(ratatui::style::Modifier::ITALIC); + *me = me.add_modifier(ratatui_core::style::Modifier::ITALIC); } Ok(ud) }); $methods.add_function("underline", |_, (ud, remove): (mlua::AnyUserData, bool)| { let me = &mut ud.borrow_mut::()?.$($field).+; if remove { - *me = me.remove_modifier(ratatui::style::Modifier::UNDERLINED); + *me = me.remove_modifier(ratatui_core::style::Modifier::UNDERLINED); } else { - *me = me.add_modifier(ratatui::style::Modifier::UNDERLINED); + *me = me.add_modifier(ratatui_core::style::Modifier::UNDERLINED); } Ok(ud) }); $methods.add_function("blink", |_, (ud, remove): (mlua::AnyUserData, bool)| { let me = &mut ud.borrow_mut::()?.$($field).+; if remove { - *me = me.remove_modifier(ratatui::style::Modifier::SLOW_BLINK); + *me = me.remove_modifier(ratatui_core::style::Modifier::SLOW_BLINK); } else { - *me = me.add_modifier(ratatui::style::Modifier::SLOW_BLINK); + *me = me.add_modifier(ratatui_core::style::Modifier::SLOW_BLINK); } Ok(ud) }); $methods.add_function("blink_rapid", |_, (ud, remove): (mlua::AnyUserData, bool)| { let me = &mut ud.borrow_mut::()?.$($field).+; if remove { - *me = me.remove_modifier(ratatui::style::Modifier::RAPID_BLINK); + *me = me.remove_modifier(ratatui_core::style::Modifier::RAPID_BLINK); } else { - *me = me.add_modifier(ratatui::style::Modifier::RAPID_BLINK); + *me = me.add_modifier(ratatui_core::style::Modifier::RAPID_BLINK); } Ok(ud) }); $methods.add_function("reverse", |_, (ud, remove): (mlua::AnyUserData, bool)| { let me = &mut ud.borrow_mut::()?.$($field).+; if remove { - *me = me.remove_modifier(ratatui::style::Modifier::REVERSED); + *me = me.remove_modifier(ratatui_core::style::Modifier::REVERSED); } else { - *me = me.add_modifier(ratatui::style::Modifier::REVERSED); + *me = me.add_modifier(ratatui_core::style::Modifier::REVERSED); } Ok(ud) }); $methods.add_function("hidden", |_, (ud, remove): (mlua::AnyUserData, bool)| { let me = &mut ud.borrow_mut::()?.$($field).+; if remove { - *me = me.remove_modifier(ratatui::style::Modifier::HIDDEN); + *me = me.remove_modifier(ratatui_core::style::Modifier::HIDDEN); } else { - *me = me.add_modifier(ratatui::style::Modifier::HIDDEN); + *me = me.add_modifier(ratatui_core::style::Modifier::HIDDEN); } Ok(ud) }); $methods.add_function("crossed", |_, (ud, remove): (mlua::AnyUserData, bool)| { let me = &mut ud.borrow_mut::()?.$($field).+; if remove { - *me = me.remove_modifier(ratatui::style::Modifier::CROSSED_OUT); + *me = me.remove_modifier(ratatui_core::style::Modifier::CROSSED_OUT); } else { - *me = me.add_modifier(ratatui::style::Modifier::CROSSED_OUT); + *me = me.add_modifier(ratatui_core::style::Modifier::CROSSED_OUT); } Ok(ud) }); $methods.add_function("reset", |_, ud: mlua::AnyUserData| { - ud.borrow_mut::()?.$($field).+ = ratatui::style::Style::reset(); + ud.borrow_mut::()?.$($field).+ = ratatui_core::style::Style::reset(); Ok(ud) }); }; diff --git a/yazi-binding/src/position/position.rs b/yazi-binding/src/position/position.rs index f370012e..bd25fda7 100644 --- a/yazi-binding/src/position/position.rs +++ b/yazi-binding/src/position/position.rs @@ -1,6 +1,7 @@ use std::ops::{Deref, DerefMut}; -use ratatui::{layout::Rect, widgets::Padding}; +use ratatui_core::layout::Rect; +use ratatui_widgets::block::Padding; use super::{Offset, Origin}; diff --git a/yazi-binding/src/style/style.rs b/yazi-binding/src/style/style.rs index 29a19298..efd87add 100644 --- a/yazi-binding/src/style/style.rs +++ b/yazi-binding/src/style/style.rs @@ -1,16 +1,16 @@ use std::ops::Deref; use mlua::{ExternalError, FromLua, IntoLua, Lua, LuaSerdeExt, MetaMethod, Table, UserData, UserDataMethods, Value}; -use ratatui::style::Modifier; +use ratatui_core::style::Modifier; use yazi_shim::{cell::SyncCell, mlua::SER_OPT}; use crate::{elements::Color, style::StyleFlat}; #[derive(Clone, Copy, Default)] -pub struct Style(pub ratatui::style::Style); +pub struct Style(pub ratatui_core::style::Style); impl Deref for Style { - type Target = ratatui::style::Style; + type Target = ratatui_core::style::Style; fn deref(&self) -> &Self::Target { &self.0 } } @@ -23,7 +23,7 @@ impl From<&SyncCell> for Style { fn from(value: &SyncCell) -> Self { value.get().into() } } -impl From